Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
08/06/02 15:30
Read: times


 
#26813 - RE: AT24C01 SEEPROM
Hi Shahzad,

Atmel's website has an apnote and code for accessing that part. Go to www.atmel.com/atmel/acrobat/doc0507.pdf and www.atmel.com/pub/atmel/aa24cxx.exe.

The code is written in assembler, but is useful in understanding how Atmel's "Bidirectional Data Transfer Protocol" works. Note that most of the world calls this bus I2C; if you search on this you should be able to find examples in C as well.

Other sources of information are the 24Cxx data sheet which details the timing, and from Philips' web site you can get the official I2C specs.

If you suspect you are having timing problems, you will want to check your compiler's assembler output, and using the instruction set documentation for your particular 8051 variant verify your timing is correct. For example, check data setup and hold times (SDA vs. SCL).

Other problems when writing code for an interface such as this include improper device address, data bits transmitted lsb first instead of msb first, improper handling of ack, start and stop.

You can use Atmel's code as a model for your C code, begin by writing bit-banging code for start and stop functions, send byte, receive byte, ack, and then use these pieces to build your eeprom write and read functions.

Good luck!

Dennis

List of 4 messages in thread
TopicAuthorDate
AT24C01 SEEPROM            01/01/70 00:00      
RE: AT24C01 SEEPROM            01/01/70 00:00      
RE: AT24C01 SEEPROM            01/01/70 00:00      
RE: AT24C01 SEEPROM            01/01/70 00:00      

Back to Subject List