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

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



Joined: 31 Mar 2009
Posts: 11

View user's profile Send private message

i2c in PIC16F84A
PostPosted: Fri May 15, 2009 4:14 am     Reply with quote

Is this possible with PIC16F84A alone? I need more i/o pins but unfortunately we don't have any PIC16F877A or any other PICs. Will the command from CCS C like i2c_start() or i2c_read work even if it doesn't have any dedicated SCL and SDA in it?
Any suggestions or clarifications or tips will be highly appreciated. Thanks in advance!! Very Happy Very Happy Smile
Guest








PostPosted: Fri May 15, 2009 8:31 am     Reply with quote

Yes.
CCS, implements a software I2C master, if you just use any pins on the chip, that don't have hardware I2C abilities.
All the standard library functions work quite well.
Half of the library examples, for I2C, default to chips without the hardware present. Smile

Best Wishes
rnielsen



Joined: 23 Sep 2003
Posts: 852
Location: Utah

View user's profile Send private message

PostPosted: Fri May 15, 2009 9:35 am     Reply with quote

You need to understand that software I2C works in Master mode. If you're wanting to have a PIC run as a Slave you had better select one that has the hardware built in.

You can assign SCL & SDA to almost any pin you want to use. There are a few exceptions, like a pin that's Input only or something that's dedicated to a certain function. Otherwise, the compiler takes care of everything for you. Just put the correct pin assignments in your #use i2c() statement and you're ready to fly.

Ronald
horde_fuego



Joined: 31 Mar 2009
Posts: 11

View user's profile Send private message

PostPosted: Sat May 16, 2009 5:03 am     Reply with quote

thank you very much!!!i'll try it now! Very Happy Smile
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