Microcontroller › AVR › How to setup communication between I2C/TWI and EEPROM › communication b/w I2C/TWI & EEPROM
March 4, 2011 at 5:57 am
#5656
SANDEEP RAVAL
Participant
Hi dear,
I am using ATMEGA32 microcontroller and EEPROM 24C16.
I am getting acknowledgwment in sending start condition & sending address both.
when i studied following istruction i could not understand it means how will my EEPROM recieve or send an acknowledgement to my ATMEGA32.:
plz help.
u r my last hope.
void TWI_start(void)
{
// Clear TWI interrupt flag, Put start condition on SDA, Enable TWI
TWCR= (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);
while(!(TWCR & (1<<TWINT))); // Wait till start condition is transmitted
while((TWSR & 0xF8)!= 0x08); // Check for the acknowledgement
}