View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
I don't grasp I2C_isr_state() |
Posted: Mon Mar 18, 2013 1:28 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
|
Posted: Mon Mar 18, 2013 2:38 pm |
|
|
Some of the grammar in the manual is confusing.
Why not have a play with the provided examples, to see how they work?
Mike |
|
![](templates/subSilver/images/spacer.gif) |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Tue Mar 19, 2013 9:44 am |
|
|
I'll try to see what happen. _________________ A person who never made a mistake never tried anything new. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Mar 19, 2013 8:04 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|