View previous topic :: View next topic |
Author |
Message |
Peter Pitzeier
Joined: 24 Apr 2005 Posts: 6 Location: Austria
|
Software I2C slave |
Posted: Wed Aug 31, 2005 1:32 pm |
|
|
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
|
|
Posted: Wed Aug 31, 2005 8:26 pm |
|
|
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
|
|
Posted: Thu Sep 01, 2005 10:18 am |
|
|
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. |
|
|
|