speedEC
Full Member level 6
TinyRTC Module. DS1307 works OK with the same code.
CODE WORKS IN EEPROM AT24C04 THAT NOT WORKS IN AT24C32N. I have changed the Address of the EEPROM only. (A4 for 24C04 - 1010010 & R/W). (A0 for 24C32N - 1010000 & R/W; since all A0, A1, A2 are GNDed). WP pin also grounded.
Am I missing anything?
thank you.
CODE WORKS IN EEPROM AT24C04 THAT NOT WORKS IN AT24C32N. I have changed the Address of the EEPROM only. (A4 for 24C04 - 1010010 & R/W). (A0 for 24C32N - 1010000 & R/W; since all A0, A1, A2 are GNDed). WP pin also grounded.
Code:
EEPROM_ADDR = 0x00;
I2C_Master_Start();
I2C_Master_Write(0xA0 | ((EEPROM_ADDR>>7) & 0x0E));
I2C_Master_Write((unsigned char)EEPROM_ADDR & 0xFF);
I2C_Master_Write((unsigned char)0x41);
I2C_Master_Stop();
__delay_ms(100);
EEPROM_ADDR = 0x00;
I2C_Master_Start();
I2C_Master_Write(0xA0 | ((EEPROM_ADDR>>7) & 0x0E));
I2C_Master_Write((unsigned char)EEPROM_ADDR & 0xFF);
I2C_Master_RepeatedStart(); //re Start condition
I2C_Master_Write(0xA1);
strData[0] = I2C_Master_Read(1); // ACK
strData[1] = 0x00;
I2C_Master_Stop(); // STOP
__delay_ms(100);
Am I missing anything?
thank you.