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 support@ccsinfo.com

Need help with i2c slave interface

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



Joined: 29 Jul 2007
Posts: 31
Location: UK

View user's profile Send private message Send e-mail MSN Messenger

Need help with i2c slave interface
PostPosted: Thu Aug 16, 2007 4:31 pm     Reply with quote

dear sir,
after RS232 interface, I also need build I2C and SPI interfaces into my LCD module, after reading the datasheet of PIC16F876A and the help file of CCS Compiler, I have been sure about the working principle. My current codes of I2C was shown below:
Code:

#USE I2C(slave, sda=PIN_C4, scl=PIN_C3, address=0x00)
...
while(1)
{
   i2c_start();
   while(!i2c_poll()) ;
   value3=i2c_read();
   lcd_putc(value3);
   i2c_stop();
}

Without the experience in I2C and SPI interface, my hardware did not work with I2C interface in simulating. Could you please check my code and give me several suggestions for those two interfaces?
By the way, my hardware would only be regarded as a slave.
Thanks.
_________________
Enjoy our EEE
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