Reset Write Protect (WP) bit of MCP46XX Digital Potentiometer

Thread Starter

fedezampe

Joined Sep 28, 2020
8
Hi all,

I'm a noob here, so apologies if my question may seem a bit simple.

I am using a MCP4661 10K digital potentiometer (Microchip, datasheet found here: MCP453X/455X/463X/465X Data Sheet (microchip.com) ) and I'm interested in writing a value into the non-volatile register for wiper 0 or wiper 1. On my PCB, the WP* pin on the IC (active low) is connected to a GPIO of my MCU and set high (3.3V), whereas pins A0, A1, A2 are tied to ground (connected to ground plane using vias underneath pads) to assign the slave address for I2C (I am using 2 units of this digipot on the same I2C bus).

My question is: how can I reset the internal WP bit so that I can write to the memory, please? I read the datasheet over and over again but I am just more confused. Should I put a high voltage (8.5V-12.5V) on the WP* pin or on the A0 pin before I send the I2C command to reset the WP bit? Or should I do something else? I just can't figure it out.

Any suggestion is very much appreciated, please!
 

Papabravo

Joined Feb 24, 2006
21,225
I looked at the datasheet and none of the packages listed had a WP* (Write Protect - Active Low). We might be looking at different datasheets.
 

Papabravo

Joined Feb 24, 2006
21,225
Hi,

thanks for your reply. I double checked and realise I have includer the link to the wrong datasheet. Here’s the one for the device I’m using:

https://ww1.microchip.com/downloads/en/DeviceDoc/22107B.pdf

I hope this helps.
Thanks!
Yes. That looks better. IMHO the following does imply that you need to apply a high voltage to the HVC (High Voltage Command) pin.

You will need to use a High Voltage command to reset the WP configuration bit. See §7.8 on page 65, where it says:

These commands are special cases of the High Voltage
Decrement Wiper and the High Voltage Increment
Wiper commands to the nonvolatile memory
locations 02h, 03h, and 0Fh.

Figure 7.9 shows a disable sequence for WP(Write Protect), WL0(Wiper Lock 0) and WL1(Wiper Lock 1). Figure 7.10 shows the corresponding enable sequence. when you execute one of these commands you initiate an EEPROM WRITE SEQUENCE which limits what you can do while that process is going on.

A Modify Write Protect or WiperLock Technology Command will only start an EEPROM write cycle (twc) after a properly formatted Command has been received and the Stop condition occurs.
During an EEPROM write cycle, only serial commands to Volatile memory (addresses 00h, 01h, 04h, and 05h) are accepted. All other serial commands are ignored until the EEPROM write cycle (twc) completes. This allows the Host Controller to operate on the Volatile Wiper registers and the TCON register, and to Read the Status Register. The EEWA bit in the Status register indicates the status of an EEPROM Write Cycle.

Does that clarify things for you?
 
Last edited:

Thread Starter

fedezampe

Joined Sep 28, 2020
8
Yes. That looks better. IMHO the following does imply that you need to apply a high voltage to the HVC (High Voltage Command) pin.

You will need to use a High Voltage command to reset the WP configuration bit. See §7.8 on page 65, where it says:

These commands are special cases of the High Voltage
Decrement Wiper and the High Voltage Increment
Wiper commands to the nonvolatile memory
locations 02h, 03h, and 0Fh.

Figure 7.9 shows a disable sequence for WP(Write Protect), WL0(Wiper Lock 0) and WL1(Wiper Lock 1). Figure 7.10 shows the corresponding enable sequence. when you execute one of these commands you initiate an EEPROM WRITE SEQUENCE which limits what you can do while that process is going on.

A Modify Write Protect or WiperLock Technology Command will only start an EEPROM write cycle (twc) after a properly formatted Command has been received and the Stop condition occurs.
During an EEPROM write cycle, only serial commands to Volatile memory (addresses 00h, 01h, 04h, and 05h) are accepted. All other serial commands are ignored until the EEPROM write cycle (twc) completes. This allows the Host Controller to operate on the Volatile Wiper registers and the TCON register, and to Read the Status Register. The EEWA bit in the Status register indicates the status of an EEPROM Write Cycle.

Does that clarify things for you?
Thank you for your reply, Papabravo, that is very helpful and confirms what I was thinking.

In terms of how to send the I2C command, what function do you suggest I should use? I am using STM32CubeIDE for programming in C and the HAL_I2C library. Based on page 65, I just need to send 2 bytes: the first one is the I2C device address (in my case, 0b0101001 since A2=0, A1=0, A0=high voltage, plus a 0 as the LSB for a write operation, so overall 0b0101 0010). The second byte, instead, should include the 0Fh address followed by 0b01XX for disabling WP, so I could use a byte like 0b1111 0100, correct? Because I don't have any other data to send, I am thinking of using:

HAL_I"C_Master_Transmit( &hi2c1, slave_address, WP_disable_command, 1, HAL_MAX_DELAY)

Where slave_address is: 0b0101 0010 (first byte)
And WP_disable_command is: 0b1111 0100 (second byte)

Does this seem correct? Or should I use function HAL_I2C_Mem_Write() instead? If so, what should I use as the payload data for this function?

Thank for your help!
 

Attachments

Papabravo

Joined Feb 24, 2006
21,225
I think that is correct. The "increment" command with high voltage on A0 should disable WP, which will allow you to write things.
 
Top