Coding a bullet-proof bit bashed slave I2C or SPI is not a trivial exercise. Unless you really need to use one of these protocols, I strongly suggest you use async serial comms. If you are stuck on using I2C then you will probably have to base it on an interrupt driven state machine to ensure a small latency to the masters clock. The Scenix has an I2C slave virtual peripheral (http:\\www.ubicom.com) and I'm fairly sure that Microchip has an app note implementing an I2C slave for one of the low end (16C5x) devices. Regards Mike > -----Original Message----- > From: Russell Farnhill [SMTP:r.farnhill@STOR-WAVE.CO.UK] > Sent: Friday, May 04, 2001 3:23 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Pic <--> Pic Comms > > Hi all, > > I want to be able to control six F84's from a master > F84. I think my options are I2C, SPI or some serial link. > > It would also be nice if the slaves could send data back > to the master as well. > > Looking on the net I find lots of I2C routines, but they > all seem to be for the master and not for the slave. > > Does anyone know where I could get a simple set or routines > in 'C' for slave and master to get me going. > > SPI... Don't really know anything about this so I'll look > at this if I can't get anywhere with I2C or Serial. > > lastly Serial... > > I think this is my best chance of success because I've already > got one pic talking to another and probably just need to expand > it. > > Would this serial set-up work ? > > Master pic Tx pin wired to all six slave Rx pins > Master Pic Rx pin wired to all six slave Tx pins > > So now master should be able to send cmd's to any slave and > any slave back to master. Also I thought of using six more pins > on the master as Select lines going to each slave. So slave can > grab attention of master and help on bus collisions. > > I'am a little unsure about all the slave Tx pins connected > together > on the master Rx pin, if all Tx's are low and one goes high to > send > data, will this cause a short and blow the pin ??, if so could I > use > some series resistor or something ? > > > Any suggestions, help appreciated. > > Thanks, > > Russ. > > > -----EMAIL DISCLAIMER------------------------------------------------- > This email and any files transmitted with it are intended solely for > the addressee(s) and may be legally privileged and/or confidential. If > you have received this email in error please destroy it and notify the > sender. You must not use or disclose any part of this message if you > are not the intended recipient. Unauthorised use/disclosure may be > unlawful. Opinions expressed may be personal to the author and may not > necessarily reflect the opinions of Khaos Technologies or its > affiliates. We may monitor email communication passing through our > networks and we reserve the right to store all/part of any > communication. We take reasonable precautions to ensure our emails are > virus free, however, we cannot accept responsibility for any virus > transmitted and recommend that you implement your own virus checking > procedures. > > -- > http://www.piclist.com hint: The PICList is archived three different > ways. See http://www.piclist.com/#archives for details. > > > > ------------------------------------------------------------------------- > This email server is running an evaluation copy of the MailShield anti- > spam software. Please contact your email administrator if you have any > questions about this message. MailShield product info: www.mailshield.com -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.