- This topic has 1 reply, 2 voices, and was last updated 12 years, 1 month ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
|
Microcontroller › AVR › Problem: How to use I2C / TWI (Two Wire Interface) in AVR ATmega32
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
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