View previous topic :: View next topic |
Author |
Message |
jack Guest
|
I2C_read() problem |
Posted: Mon May 08, 2006 8:40 am |
|
|
I2C PROBLEM
I am facing a few problems regarding I2C, please help me.
I have already defined,
#use I2C(slave,sda=PIN_C4,scl=PIN_C3,address = 0x01,FORCE_HW), why do the compiler still say i2c_isr_state as an Undefined identifier??
when I use i2c_read() in #INT_SSP, why does the program keeps looping at this statement?
Thank you. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon May 08, 2006 11:41 am |
|
|
Quote: | Why do the compiler still say i2c_isr_state as an Undefined identifier ? |
Maybe your version of the compiler doesn't support that version.
Here is the notice from the CCS versions page of when it was added:
3.231 New function added: I2C_ISR_STATE()
See this post for a work-around:
http://www.ccsinfo.com/forum/viewtopic.php?t=26477&start=3 |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Tue May 09, 2006 11:27 am |
|
|
The Slave address needs to be an Even number. The LSB is used to determine if the Master is Reading from or Writing to the Slave. You might want to look at the I2C standards publication to see what addresses are valid to use. Granted, any address could be used if you're just doing your own thing but if you ever want to add other I2C devices on the bus you will want to stick to what is valid.
Ronald |
|
|
|