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

i2c on pic16f886 by using other pins than c4 and c3

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



Joined: 30 Aug 2007
Posts: 144
Location: South Africa

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

i2c on pic16f886 by using other pins than c4 and c3
PostPosted: Tue Sep 02, 2008 4:08 pm     Reply with quote

Hi.

Is it possible to use a i2c protocol in a pic if i am using c4 and c3 with a spi interface to cc1000 board?
I basically need to generate a software i2c from other pins, but i don't want to open a black hole for myself before i start the project.

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 02, 2008 4:24 pm     Reply with quote

Are you asking if you can create software i2c master on other pins ?
The answer is yes. It's fully supported by the #use i2c() statement.
(You can only do an i2c slave on the hardware pins).
Gerhard



Joined: 30 Aug 2007
Posts: 144
Location: South Africa

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

PostPosted: Tue Sep 02, 2008 5:05 pm     Reply with quote

Can i just use this type of function with the normal i2c functions and just change the pins or what has to be different else?

Code:
#use i2c(Master, sda=PIN_C4, scl=PIN_C3, FORCE_HW)
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Sep 02, 2008 5:08 pm     Reply with quote

Get rid of the FORCE_HW, if you use other pins. The compiler will
ignore it anyway.
Gerhard



Joined: 30 Aug 2007
Posts: 144
Location: South Africa

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

PostPosted: Tue Sep 02, 2008 5:20 pm     Reply with quote

Thanks.
I will then try that and hopefully not struggle to much.
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