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

I don't grasp I2C_isr_state()

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



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

I don't grasp I2C_isr_state()
PostPosted: Mon Mar 18, 2013 1:28 pm     Reply with quote

Hello fellows!
I'm about to develop I2C slave code on my 16F873A. So, as I can see by the example code is that I need interrupt routine and utilizing I2C_isr_state(). As I read from CCS Manual the returned value increases with each sent or received byte trough I2C bus.
My question is:
If I2C_isr_state() start value is 0, and if I can write only if the value is bigger than 0x80 then, do I need to read 128 bytes before I be able to write? I mean
it's needed to increase the value of I2C_isr_state() 0x80 times before enable I2C_write() according to
Quote:
The return value increments with each byte received or sent
.
Another question is: is I2C_isr_state() value somehow connected to the value of first received byte, and R/W bit determines the value of I2C_isr_state()?
_________________
A person who never made a mistake never tried anything new.
Mike Walne



Joined: 19 Feb 2004
Posts: 1785
Location: Boston Spa UK

View user's profile Send private message

PostPosted: Mon Mar 18, 2013 2:38 pm     Reply with quote

Some of the grammar in the manual is confusing.

Why not have a play with the provided examples, to see how they work?

Mike
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Tue Mar 19, 2013 9:44 am     Reply with quote

I'll try to see what happen.
_________________
A person who never made a mistake never tried anything new.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 19, 2013 8:04 pm     Reply with quote

Also, Ttelmah as several threads where he explains the details.
Go to the forum search page:
http://www.ccsinfo.com/forum/search.php
Set the top search box to: i2c_isr_state
Set the bottom box to: Ttelmah
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