Microcontroller › AVR › Need help for I2C/TWI article of engineers garage
- This topic has 16 replies, 6 voices, and was last updated 12 years, 5 months ago by
AJISH ALFRED.
-
AuthorPosts
-
April 17, 2012 at 6:57 am #1495
Amit Kumar
ParticipantDear all,
I am doing practical for TWI/I2C from engineers garage. I copied & pasted the programe.My hardware is in working condition as led programe is running on hardware. I also connected SDA of master to SDA of slave & SCL of master to SCL of slave. Still the programe is not running. LEDs are in ON condition as they are connected in active low configuration.
I am using atmega16 instead of atmega32. Am i supposed to configure fuse bits for I2C/TWI. I am using serial programmer/Pony Prog to brn controller.
Please help.
June 29, 2012 at 1:52 pm #8153AJISH ALFRED
ParticipantHi,
Please share the link of the code. Have you pulled up SDA and SCL lines to VCC?
June 30, 2012 at 12:47 am #8161Amrith
ParticipantHi Amit,
Did you add pull up resistors on SDA & SCL Lines. For TWI/I2C communication, with out pull up resistors controller will not able communicate with the external component.
Try to debug your code by manual method.
December 30, 2012 at 9:41 pm #8886Harsh Deshpande
ParticipantHello,
Even I am having the same problem.
I have 4.7k pull up resistor on SCL and SDA.
The start condition is being transmitted, but the code hangs while receiving the ACK.
What might be the problem?
Regards
Harsh
January 2, 2013 at 3:01 pm #8896Harsh Deshpande
ParticipantI finally got the acknowlegdement from the slave after sending the address.
But the data transfer is not happening.
What can be the issue?
January 5, 2013 at 6:22 pm #8904AJISH ALFRED
ParticipantMake sure that you really have aknowledgement from the slave. Change the slave address and observe wheather you are still getting the acknowledgement.
What is your slave device actually?
July 4, 2013 at 9:47 pm #10098Yash Tambi
ParticipantEven i am facing the same problem. I tried changing the address, but it didnt work.. what could be the issue?
July 5, 2013 at 4:20 am #10100AJISH ALFRED
ParticipantHi,
The hardware set up is very important. you should pull up the SDA and SCL pins. Also check the port direction of the pins.
If you can get a CRO, check the waveforms on both SDA and SCL. Make sure that the clock appears on the SCL.
July 5, 2013 at 9:36 pm #10105Yash Tambi
ParticipantHi!
I was Finally able to figure out the problem.. that is: the slave is not matching the incoming address with its own address. when i removed the while loop to check the status after own slave address has been received, the slave received the data and responded accordingly. Please help me with this issue!
Thanks in advance!
July 6, 2013 at 9:03 am #10106AJISH ALFRED
ParticipantHi,
Suggest you to go through the data sheet of the slave device and find the unique address of your slave device.
July 6, 2013 at 10:58 am #10109Yash Tambi
ParticipantI am trying to Communicate between two Atmega8
July 22, 2013 at 5:37 pm #10180pouria
ParticipantHI
1-what is your compiler?
2-what is the version of it?
July 24, 2013 at 4:36 am #10185AJISH ALFRED
ParticipantHi Pouria,
From the code written, I think the compiler is AVR Studio. Try to download the latest version.
July 24, 2013 at 8:53 pm #10193pouria
Participanthi
i don’t think this code compiled in avr studio?
July 25, 2013 at 4:23 am #10194AJISH ALFRED
ParticipantHi Pouria,
Please post the link of your reference or give me some hint of the location where you find the code. I’ll confirm it and let you know.
-
AuthorPosts
- You must be logged in to reply to this topic.