Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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: 65

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top