- This topic has 2 replies, 2 voices, and was last updated 14 years, 1 month ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › How to setup communication between I2C/TWI and EEPROM
Hi Friends,
I have a query that i am doing my programs on I2C/TWI with EEPROM.
I am unable to set communication with my EEPROM and I am not getting the acknowledgement signal.
Furthermore,I am not understanding the instruction in the link seen below.
Plz.reply me with clean explaination that TWI acknowledgement.
http://www.engineersgarage.com/embedded/avr-microcontroller-projects/atmega32-twi-two-wire-interface
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
}
which EEPROM u using is it at24c02???
have went thorugh the links:
http://www.engineersgarage.com/tutorials/twi-i2c-interface
http://www.engineersgarage.com/tutorials/avr-atmega32-twi-registers
which part you got sturct i mean where you not getting acknoledgement in sending start condition or sending address??
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
}