Searching \ for ' Pic <--> Pic Comms' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: 'Pic <--> Pic Comms'.

No exact or substring matches. trying for part
PICList Thread
'[PICLIST] Pic <--> Pic Comms'
2001\05\04@101631 by Russell Farnhill

flavicon
face
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.


2001\05\04@105009 by Bob Ammerman

picon face
A very simple way to use aync serial to get multiple slaves talking to a
single master using ASYNC comms.

First, this assumes all the PICs are on one board, or at least in one box
sharing a power supply. If this assumption is incorrect then you could run
into all kinds of trouble (which you could get around by adding in RS232
drivers and receivers as needed).

1: Connect the TX pin of the master PIC to the RX pins of all the slave
PICs.

2: Connect a 20K resistor from the RX pin of the master PIC to Vdd.

3: Connect a diode from the TX pin of each slave PIC to the RX pin of the
master PIC. The anode of the diode should be connected to the master PIC's
RX pin and the cathode to the slave's TX pin.

Now, all the slaves will see everything the master sends. Slaves can respond
to the master.

If multiple slaves attempt to talk at once the communcation will most likely
be garbled, so the slaves should probably only respond to polls from the
master.

Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

{Original Message removed}

2001\05\04@111949 by Russell Farnhill

flavicon
face
Bob,


So are the diode's there to stop a HIGH slave Tx pin being dragged low by
the other LOW
slave Tx pins ?

Why do I need a pull-up on Master Rx pin ?, When I bread boarded a test
circuit
I just connected Tx -> Rx
                Rx <- Tx

and this seemed to work ok.

Thanks,

Russell.

{Original Message removed}

2001\05\04@151356 by Bob Ammerman

picon face
> Bob,
>
>
> So are the diode's there to stop a HIGH slave Tx pin being dragged low by
> the other LOW
> slave Tx pins ?
>
> Why do I need a pull-up on Master Rx pin ?, When I bread boarded a test
> circuit
> I just connected Tx -> Rx
>                  Rx <- Tx
>
> and this seemed to work ok.
>
> Thanks,
>
> Russell.


To understand this you need to know that an idle serial port is sending a
HIGH condition on TX.

The resistor and diodes form what amounts to an AND gate. If any of the
slave TX pins is low then the master's RX will be low (because the diode
will conduct).

If all of the slave TX pins are high then the resistor can pull the master's
RX high and the master will see a high.

Now, if any one slave sends, the master will see it just fine (because the
other slaves are holding their TX pins high).

So, you just need an appropriate protocol.

When the master talks, all the slaves hear it. The message should include an
address so that only the correct slave acts on it and responds to it.



Bob Ammerman
RAm Systems
(contract development of high performance, high function, low-level
software)

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.


2001\05\04@182100 by Michael Rigby-Jones

flavicon
face
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:\\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 removed}

2001\05\06@195026 by Antonio L Benci

flavicon
picon face
part 1 2367 bytes content-type:text/plain; charset=us-ascii (decoded 7bit)

Check out:

http://www.hth.com/snap/

Nino.

Russell Farnhill wrote:
{Quote hidden}

Nino.
--
------------------------------------------------------
| Antonio (Nino) L. Benci                            |
| Professional Officer, Electronic Services          |
| School of Physics & Materials Engineering          |
| Monash University                                  |
| email: spam_OUTnino.benciTakeThisOuTspamspme.monash.edu                  |
| T: 61 3 9905 3649. F: 61 3 9905 3637               |
| M: 0414 924 833                                    |
------------------------------------------------------


part 2 586 bytes content-type:text/x-vcard; name=Nino.Benci.vcf; charset=us-ascii
(decoded 7bit)

begin:vcard
n:Benci;Antonio L
tel;cell:0414 924 833
tel;fax:+61 3 9905 3637
tel;home:0414 924 833
tel;work:+61 3 9905 3649
x-mozilla-html:FALSE
url:http://www.physics.monash.edu.au/~ninob
org:Monash University;School of Physics & Materials Engineering
version:2.1
email;internet:.....Nino.BenciKILLspamspam@spam@spme.monash.edu
title:Professional Officer, Electronic Services
adr;quoted-printable:;;PO Box 27=0D=0ASchool of Physics and Materials Engineering=0D=0AMonash University;Monash University;VIC;3800;Australia
x-mozilla-cpt:;10672
fn:Antonio L Benci
end:vcard


part 3 105 bytes
--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestspamKILLspammitvma.mit.edu


2001\05\08@054117 by Russell Farnhill

flavicon
face
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 removed}

More... (looser matching)
- Last day of these posts
- In 2001 , 2002 only
- Today
- New search...