EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / How to setup communication between I2C/TWI and EEPROM

How to setup communication between I2C/TWI and EEPROM

|

Microcontroller › AVR › How to setup communication between I2C/TWI and EEPROM

  • This topic has 2 replies, 2 voices, and was last updated 14 years, 10 months ago by SANDEEP RAVAL.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 3, 2011 at 6:19 am #768
    SANDEEP RAVAL
    Participant

    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
    }

    March 3, 2011 at 6:40 am #5654
    dagakshay
    Participant

    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??

    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
    }

     

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Sine wave distortion January 16, 2026
  • Flip Flop for My Mirrors January 16, 2026
  • potenciometer attachment / screwdriver January 16, 2026
  • flexible copper cable January 16, 2026
  • Variable audio oscillator January 16, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise