How have you been?
I have been searching and trying badly to get an external 24C32AN from Microchip to work... without success so far.
This is the external EEPROM which cames with the RTC module -> DS1307 from Dallas.
The clock is working OK... I can write, read, whatever... on it's 56bytes NV SRAM.
Then I though: "Hey! Why not check how the the 24C32 works?"
I added this line of code:
#define E24C32_I2C_ADDRESS 0x50
and a little bit of this:
//Write data on 5th row
Wire.write(0x05); //choose the 5th row
Wire.write(decToBcd(10)); //write number 10 on memory
//Read the written data
Wire.requestFrom(E24C32_I2C_ADDRESS), 1); //reads one byte starting on the latest position -> 0x05
newvar = bcdToDec(Wire.read());
lcd.setCursor(2,3); //Set the cursor in the position number 2 (3rd char) on line 3 of the LCD.
No idea why, but no matter which value I write, I get this decimal value of "165" ( 0b10100101 )
Do you guys have any idea what's going wrong?
Thanks for you help