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

Software I2C slave

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



Joined: 24 Apr 2005
Posts: 6
Location: Austria

View user's profile Send private message

Software I2C slave
PostPosted: Wed Aug 31, 2005 1:32 pm     Reply with quote

Hello Forum,

I want to recycle a couple of '98 SX28 chips as I2C-I/O-expanders.
The SX can run in a PIC16C5x compatible mode. Does anybody have software I2C slave routines (ASM or C)?

BTW, along with the SX chips I found some (~20) 50MHz resonators that I'd give away for free. In case someone can use them, contact me.

Regards,

Peter.
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

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

PostPosted: Wed Aug 31, 2005 8:26 pm     Reply with quote

You wouldn't want to implement a slave in software. It would be kinda slow. Why not just buy a couple of pics or even a couple of io expanders. Heck, you could even sample them for free. Now I wouldn't ask this if I thought that you were a geek like me just wanting to play around, but you are asking for the code so were would the fun be?

Edit:
Maybe you can
http://ww1.microchip.com/downloads/en/AppNotes/00541e.pdf
Peter Pitzeier



Joined: 24 Apr 2005
Posts: 6
Location: Austria

View user's profile Send private message

PostPosted: Thu Sep 01, 2005 10:18 am     Reply with quote

Very Happy
Thank you Mark,

AppNote 00541e is perfect. It needed almost no modification to run the SX as I2C slave. Running on internal 4Mhz in Turbo mode, the chip can handle the I2C bus mastered by a 16F873 (in SW too, since SSP is occupied by SPI). The PIC running @20MHz I had to insert some 20µS delays between I2C_Start / I2C_Write and I2C_Stop.

Regards,

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