View previous topic :: View next topic |
Author |
Message |
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
I2C communication sending ACK from master |
Posted: Wed Jan 30, 2013 1:42 am |
|
|
Hi, everyone! I have to control a sensor through I2C. I need to know how to send ACK from the controller.
Thanks! |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
Re: I2C communication sending ACK from master |
Posted: Wed Jan 30, 2013 2:13 am |
|
|
stoyanoff wrote: | Hi, everyone! I have to control a sensor through I2C. I need to know how to send ACK from the controller.
Thanks! |
First, have you read http://www.ccsinfo.com/forum/viewtopic.php?t=47549?
Next, have you read the datasheet on both the PIC and the sensor and how they do communications over I2C?
From there, have you downloaded the I2C specification?
(You can also look it up on wikipedia.)
If you read all those things, you would have the answer to your question.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
|
Posted: Wed Jan 30, 2013 2:25 am |
|
|
I`m using 18F2550. I don`t have very much info about the sensor. I have only an algorythm of communication. In this algorythm the sensor first I have to start communication (I2C_start()), next I have to send the sensor address(I2C_write(address)), next the microcontroller will recieve ACK(I2C_poll()), next I have to recieve data(i2c_read()) and to return ACK.
I don`t know how to return ACK.
Is there standard ACK byte? |
|
|
bkamen
Joined: 07 Jan 2004 Posts: 1615 Location: Central Illinois, USA
|
|
Posted: Wed Jan 30, 2013 2:39 am |
|
|
Have you read the section in the PIC datasheet covering I2C? (it's in the MSSP section.)
Next, did you look at the CCS compiler manual for all the I2C commands?
I'm asking because if you look, you'll find it right in front of your eyes.
ESPECIALLY if you look at the CCS help file for the i2c_read() function.
-Ben _________________ Dazed and confused? I don't think so. Just "plain lost" will do. :D |
|
|
stoyanoff
Joined: 20 Jul 2011 Posts: 375
|
|
Posted: Wed Jan 30, 2013 5:33 am |
|
|
Thanks! |
|
|
|