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 / Problem: How to use I2C / TWI (Two Wire Interface) in AVR ATmega32

Problem: How to use I2C / TWI (Two Wire Interface) in AVR ATmega32

|

Microcontroller › AVR › Problem: How to use I2C / TWI (Two Wire Interface) in AVR ATmega32

  • This topic has 1 reply, 2 voices, and was last updated 14 years, 1 month ago by dagakshay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 25, 2011 at 6:37 pm #883
    adi
    Participant

    Hello everyone,

     

    I am currently learning about communication between two AVR through TWI and came to this project.

     

    the codes are compiled and there was no error, ah I’m using AVR Studio 4 and two identically ATMega32 circuit with 8 MHz crystal each. The fuse setting was with SPIEN and CLKOPT (checked), and the SUT_CLKSEL were set to ext. crystal high freq: startup time 16k CK + 64 ms. The pins 22 and 23 were pulled-up each  with 5 kOhm. 

     

    After I downloaded the program, one for slave, and the other for master. But it didn’t work, there were no changes in portb, it stayed low for both master and slave.

     

    Could you please explained it to me what happend?

     

    PS: I’ve tried to download a LEDs-looping program and I could see the changing states from the LEDs connected to portb. so I knew there was nothing wrong with the circuit I have.

     

    Regards

     

    Adi 

    April 26, 2011 at 1:21 pm #6036
    dagakshay
    Participant

    hi adi

    TWI always seems to be tidious till the time you won’t understand its each and every line properly.. both stayed low means there is no exchange of data.. try to make them more syncronize they are not syncronised yet so you getting this kind of problem…

    there i am sending you link which might be helpful for you check out:

    http://www.engineersgarage.com/embedded/avr-microcontroller-projects/atmega32-twi-two-wire-interface

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

RSS Recent Posts

  • Help with finding unique wire lug(s) June 21, 2025
  • Simple LED Analog Clock Idea June 21, 2025
  • Kawai KDP 80 Electronic Piano Dead June 21, 2025
  • Saga 1400sv vinyl cutter motherboard issue June 21, 2025
  • using a RTC in SF basic June 20, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 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