The Hitech sample code is for a bit bashed MASTER only. If you search through the PIC archives (at www.piclist.com) you'll find that several snippets of slave code have been posted in the past, as well as a wealth of information on potential gotchas. Regards Mike > -----Original Message----- > From: Russell Farnhill [SMTP:r.farnhill@STOR-WAVE.CO.UK] > Sent: Tuesday, May 08, 2001 11:32 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]:Pic <--> Pic Comms > > Sorry REPOST NO TAG.... > > > > Hi, > > Thanks for all your suggestions, I've got some good ideas to try > now. > I think I'll try the ASYNC serial solutions. > > Just one thing regarding I2C, When I mentioned I couldn't find > any code for the SLAVE only the MASTER this was after looking at > the HI-Tech example. Is this just for the MASTER or will it work > for both and if so how do you set the slave address. It's just > that > I see that most of the functions take an address parameter but I > don't see the address being set anywhere in the functions/code. > > > Thanks again, > > Russ. > > > > -----Original Message----- > From: Antonio L Benci [mailto:Nino.Benci@SPME.MONASH.EDU.AU] > Sent: Monday, May 07, 2001 12:48 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Pic <--> Pic Comms > > > Check out: > > http://www.hth.com/snap/ > > Nino. > > Russell Farnhill wrote: > > > > 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. > > > > Nino. > -- > ------------------------------------------------------ > | Antonio (Nino) L. Benci | > | Professional Officer, Electronic Services | > | School of Physics & Materials Engineering | > | Monash University | > | email: nino.benci@spme.monash.edu | > | T: 61 3 9905 3649. F: 61 3 9905 3637 | > | M: 0414 924 833 | > ------------------------------------------------------ > > > -----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 list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics