I am able to write and read from the chip using the i2c functions (both i2c_master_write_read_device() and i2c_master_write_byte() commands). The data being written to memory on the i2c bus looks correct. Same values I intended to send. Reading the memory back from the chip however looks right on my logic analyzer, just as it was written, but the values returned from the framework function is wrong.
Each byte is double bits shifted in. For example:
the value 1 will return 03
the value 2 will return 0C
the value 3 will return 0F
the value 0F will return FF
I have seen others complain about read problems similar to this. Is there a bug in the framework or do I have a setting wrong that may be causing this?
Thanks for your help!
I am using a ESP32-S2 on a SOLOA development kit.
Version 4.4.2 of the framework.
i2c read returns wrong data from 24LC32 chip
Re: i2c read returns wrong data from 24LC32 chip
I just fixed the problem. I was using a clock speed of 10khz. When I changed to 100 kHz it read correctly. Not sure why that caused the error, but happy it is working now.
Who is online
Users browsing this forum: Perplexity-User, PetalBot and 8 guests