Cannot write to PCA9558 EEPROM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cannot write to PCA9558 EEPROM

707 Views
aymanbahouth
Contributor I

I have PCA9558 connected to I2C bus (i2c0, designware_i2c driver, 100KHz). I'm trying to write to it's EEPROM using i2c commands through U-Boot Terminal without any success.

The PCA9558 is the only device connected to i2c0, but when I 'i2c probe' command I get a message says "Valid chip addresses: " with empty list (the device address is 0x4E).

Dumping the EEPROM memory using the command "i2c md 0x4e 0x0300.2 100" prints out a list of "00".

Trying to write to the EEPROM using "i2c mw 0x4e 0x0100.2 0xCCBB 2" then dumping the memory again give me the same result, a series of "00".

I checked the clock and the data signals using a scope, and both seems to be fine. I can see the start condition, slave address, the command, the acknowledgements and the data at pins 0 and 1 are synchronized. The WP have a constant 0V. I tried everything in more than one PCB, all with the same behavior.

One more thing, I have an EEPROM connected to i2c1. Probing i2c1 returns the EEPROM address, and I can read/write to the EEPROM, so the driver is good.

Any advice when I can't write to the PCA9558 EEPROM? Why I can't see it's address when I probe the i2c? Am I using the correct commands to read/write to the EEPROM?

Appreciate your help,

AymanB.

Tags (1)
0 Kudos
1 Reply

423 Views
david_diaz
NXP Employee
NXP Employee

Hello Ayman,

I hope all is great with you.

As we know, a write operation to the 6-bit EEPROM requires that an address byte be written after the command byte. This address points to the 6-bit address space in the EEPROM array. Upon receipt of this address, the PCA9558 waits for the next byte that will be written to the EEPROM. The master then ends the transaction with a STOP condition on the I2C-bus. Please review the figure below:

i2c.data.frame.jpg

Please note that communicating with this device is initiated by sending a valid address on the I2C-bus as described below:

i2c.add.jpg

You can find the command list at the Table 3 from the datasheet.

 

Are you performing such procedure?

 

Regards,

David

0 Kudos