| ??? 01/04/03 18:05 Read: times |
#35623 - RE: Problem: 89c52 with 24c65 |
Bert , does your code resemble something like this.
I dug this out of a a project I did in 1997 , and it worked okay. #define HIGH_U8(U16) ((U8)(U16>>8)) void write_ext_eeprom(U16 address, U8 data) { i2c_start(); i2c_write(0xa0); i2c_write(HIGH_U8(address)); i2c_write(address); i2c_write(data); i2c_stop(); delay_ms(11); } U8 read_ext_eeprom(U16 address) { U8 data; i2c_start(); i2c_write(0xa0); i2c_write(HIGH_U8(address)); i2c_write(address); i2c_start(); i2c_write(0xa1); data=i2c_read(); i2c_stop(); return(data); } |



