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_read() problem

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







I2C_read() problem
PostPosted: Mon May 08, 2006 8:40 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 08, 2006 11:41 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue May 09, 2006 11:27 am     Reply with quote

Quote:
address = 0x01


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
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