problem in read operation for I2C in atmega 128

Status
Not open for further replies.

arash rezaee

Member level 5
Joined
Sep 10, 2009
Messages
87
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,952
Hi every one. I want to communicate with Si4705 chip with I2c. I am using Atmega 128. First of all I used the functions of code vision for read and write in I2C mode (I2c.h file included in my project). the write operation was good but when I tried to read from the bus, SDA line went to low and it doesn`t read the data. then I decided to use Atmega registers to read and write. again write is fine and read is not fine. SDA goes High after finishing the read operation but I don`t have ack after the first byte I receive. I will send my read function as a reference so you guys can help me. the read operation is like this. First I send restart, then address+read(0x22+0x01), then i use the loop while to read the data and at the end stop command. Please help me.

Regards
Arash
 

Attachments

  • I2C read.txt
    894 bytes · Views: 66

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…