i am using atmel 89c51rd2 controller for developing application. i have interfaced an 2k atmel AT24C02A EEPROM with the controller. can anybody of u tell me how to read and write to the EEPROM. i need the logics in terms of Keil C programming.(C code source code)
Look at the Eeprom datasheet and find out how I2C communication works. It's not difficult...
The best (and most) IIC appnotes including the bus specification: http://www.semiconductors.philips.com/buses/i2c/support/index.html after all, Philips invented and own the IIC standard. Erik
Tow links that may help: http://www.keil.com/download/docs/apnt_153.zip.asp http://www.keil.com/download/docs/mcb520_i2c.zip.asp Reinhard
i have referred the datasheets and i have done a module for reading and writing bytes using Keil C. but that is not working. i don't know how to maintain the timing between the operations with the nop. how i can know more things about I2C communication. i am new to this field. please help me. regards, thangaraj
Hello, I think it's not a timing problem. I think the 8051 isn't that much faster than my 167 at 20MHz. I have worked with different Eeprom types and I've never had any problems with timing. I'm using a single NOP between setting the SCL pin and SDA pin. Wires between processor and Eeprom have to be short. Perhaps it would help if you watch the signals with an oscilloscope. Jochen
using Keil C. ... maintain the timing You can NOT do timing in C, use assembler for the delay routines. Erik