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

Replicate I2C in PIC 16F628 mcu

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



Joined: 08 Sep 2003
Posts: 492
Location: India

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

Replicate I2C in PIC 16F628 mcu
PostPosted: Mon Jul 28, 2003 9:48 pm     Reply with quote

Hi All,

Is it possible to use the #uses_I2C routine in an mcu (like the PIC 16F628 ) which does not have an built-in I2C ports ???.

thanks
arun
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516456
john cutler



Joined: 06 Sep 2003
Posts: 82
Location: Hot Tub, California

View user's profile Send private message

Re: Replicate I2C in PIC 16F628 mcu
PostPosted: Mon Jul 28, 2003 9:54 pm     Reply with quote

YES!! I'm doing that with an 18F1320, using the UART for RS232.

You just need to set it up just like if you did have hardware I2C. Specify the xmit and receive pin, master mode, speed.

Check out page 57 of the CCS Manual (which you can download)

Good luck

JC
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516457
R.J.Hamlett
Guest







Re: Replicate I2C in PIC 16F628 mcu
PostPosted: Tue Jul 29, 2003 1:57 am     Reply with quote

:=Hi All,
:=
:=Is it possible to use the #uses_I2C routine in an mcu (like the PIC 16F628 ) which does not have an built-in I2C ports ???.
:=
:=thanks
:=arun
Yes, but with some 'limits'.
Only the master mode is supported (doing a slave, and getting the response fast enough, would be very hard).
Quite a few people do this, even on chips with hardware (for instance, I am using the MSSP, to drive an SPI bus, so to read an I2C clock chip, take advantage of the 'software' version on another pair of pins).
Fortunately, because the 'master' controls the bus timing, unlike the software serial routines, the I2C implementation keeps working OK, even if interrupts occur during the transactions.

Best Wishes
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516459
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