PDA

View Full Version : I2C Slave and 16F84A



Mith
- 21st August 2005, 10:48
Does anyone have any ideas on how to implement an I2C Slave using an 84A? I have read the PBP thread and examples for master/slave and the slave is accomplished using the hardware I2C port. Th 84A doesn't have one. I want to use an 84A for a remote keypad and have the master poll the 84A once in a while to check for keypresses. I would rather not use rs232 if I can avoid it since I already have the I2C and several devices on the bus.

I would appreciate any ideas.

Melanie
- 21st August 2005, 11:53
This request must be asked at least once every week. Please do a search on the forum for 'I2CSlave' or just the word 'Slave' and you will eventually find links to PBP Code.

Mith
- 21st August 2005, 12:42
Thank you Melanie. I know this has been beaten to death. All the info I have uncovered while searching 'I2Cslave' and 'Slave' etc... Just explains implementing it using the built in SSP. The examples called I2CSlave.bas and I2CMast.bas are great examples but the I2CSlave.bas (unless I am mistaken) uses the SSP of the 16F877. This routine is looking for the SSPIF to be set so it knows to check to see if there is new communications for the slave. Without an SSP I don't see how to implement a slave using this as an example. I'm sure I'm missing something important here. I'll keep studying this. Thanks.

Melanie
- 21st August 2005, 16:37
I wouldn't say there are LINKS TO PBP CODE if there wasn't any...

http://www.picbasic.co.uk/forum/showthread.php?t=2194&highlight=Slave

BigWumpus
- 21st August 2005, 18:46
Hello Melanie,

MITH just doesn't want to realize, that an 16F84 can't run as a I2C-slave !
There is no software-solution for I2C-Slave for any PIC!

mister_e
- 21st August 2005, 19:31
I disagree, everything is possible. It's just not one of those COPY/PASTE solution.

Usually, those who did will keep it for them. As GLCD and such other.

Mith
- 22nd August 2005, 00:49
BigWumpus, it's not that I don't want to realize it. It's that I didn't realize it. I went back again to the link that Melanie sent and looked line by line at the code there and now I understand the limitations to the 16f84. I wasn't trying to be a burden. I thought when I etched my board that the 84 would be adaquate but it just isn't up to the task.

Thanks again Melanie. Your posts are always the most educational. I especially like the RTC example!

Mith