Hello,
I am working with an ATMEGA16 and an AT24C512 serial eeprom chip. I am able to write to the chip successfully (at least according to the status codes - no errors). But reading from the chip has been difficult. I have a couple of questions. This first is for a current address read. The order of operations is this:
1. Send start from uC
2. Wait for start acknowledge from eeprom
3. Send device address for slave read (master transmit mode)
4. Wait for device acknowledge
This is where I am lost. When does the uC know that the data register has been loaded? Can I assume that once the device acknowledge has been sent that the data is already in the register?
Second question is for a sequential address read. Order of operations is the same as steps 1-4 as noted above. Except...after the uC receives the first data byte, there is an acknowledge to be sent from the uC to the eeprom. This is how the eeprom knows to load another value into the TWDR register. So, how does this work? What register is loaded with what value in the ATMEGA16 which will be used to acknowledge the eeprom?
thanks for your help.