CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

I2C communication sending ACK from master

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
stoyanoff



Joined: 20 Jul 2011
Posts: 375

View user's profile Send private message

I2C communication sending ACK from master
PostPosted: Wed Jan 30, 2013 1:42 am     Reply with quote

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

View user's profile Send private message

Re: I2C communication sending ACK from master
PostPosted: Wed Jan 30, 2013 2:13 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 30, 2013 2:25 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 30, 2013 2:39 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jan 30, 2013 5:33 am     Reply with quote

Thanks!
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group