View previous topic :: View next topic |
Author |
Message |
kloppy
Joined: 28 Jul 2004 Posts: 32
|
connect 20 pics |
Posted: Tue Aug 31, 2004 2:56 pm |
|
|
what is a good way to communicate with 20 pics? I need only one master and it hasn't to be fast. the distance between the first and the last pic ist between 0.5 an 1 meter |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue Aug 31, 2004 3:04 pm |
|
|
I2C or SPI are easy to impliment. 485 is overkill for the short distance. You get best speed with a parallel bus but it will use a lot of pins. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Tue Aug 31, 2004 4:00 pm |
|
|
Ok, I gotta know... What are you doing that you need 20 PICs within 1 meter of each other? |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
|
jds-pic
Joined: 17 Sep 2003 Posts: 205
|
|
Posted: Tue Aug 31, 2004 6:10 pm |
|
|
Darren Rook wrote: | Ok, I gotta know... What are you doing that you need 20 PICs within 1 meter of each other? |
beowulf cluster of PICs. (!)
http://www.beowulf.org/overview/index.html
jds-pic |
|
|
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Tue Aug 31, 2004 9:40 pm |
|
|
Mark,
how many PICs in the big one? |
|
|
Haplo
Joined: 06 Sep 2003 Posts: 659 Location: Sydney, Australia
|
|
Posted: Tue Aug 31, 2004 10:33 pm |
|
|
We used RS485 to connect 16 PICs, with each PIC being about one meter apart from the next one. It worked very well. |
|
|
kloppy
Joined: 28 Jul 2004 Posts: 32
|
|
Posted: Wed Sep 01, 2004 1:02 am |
|
|
i have 20 steppermotor controllers in a scanner with a pic on each controller.
i thought about i2c but i worry if the distance is already too long. |
|
|
rnielsen
Joined: 23 Sep 2003 Posts: 852 Location: Utah
|
|
Posted: Wed Sep 01, 2004 8:37 am |
|
|
I have one project with an 18F452 talking to 10 16F87's. The 87's do all of the time intensive stuff (monitoring sensors) while the 452 simply requests data from each slave every second and then does the process controlling. All using I2C.
Ronald |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Wed Sep 01, 2004 8:45 am |
|
|
kloppy wrote: | i have 20 steppermotor controllers in a scanner with a pic on each controller.
i thought about i2c but i worry if the distance is already too long. |
I2C should be able to handle 1 meter. Just be careful of excess capacitance on the lines and use pull-up resistors on the low side of the usual range, maybe 1K or 330 Ohm. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Wed Sep 01, 2004 10:27 am |
|
|
We use 6ma active pullups |
|
|
kloppy
Joined: 28 Jul 2004 Posts: 32
|
|
Posted: Wed Sep 01, 2004 3:46 pm |
|
|
what do you think about twisted pair connections? |
|
|
Yashu
Joined: 08 Oct 2003 Posts: 26
|
|
Posted: Wed Sep 01, 2004 11:52 pm |
|
|
crying out for single wire CAN |
|
|
J_Purbrick
Joined: 16 Sep 2003 Posts: 9
|
|
Posted: Thu Sep 02, 2004 9:22 am |
|
|
A method that I'm using for about 20 PICs communicating with a computer is "modified RS422" where the master (the computer) can talk any time it wants to, using packets containing an address. Every character is received by every PIC, and each PIC checks for the address, and responds only to packets addressed to it. Simple enough.
For data back to the master, there's a "hardware token" that is generated by the processor closest to the computer. It's a positive-going pulse that's sent out 10 times a second, and while sending it, the PIC has the authority (in fact, a requirement) to enable its driver onto a shared line and send a packet to the master. When the PIC completes its packet, it sends the token line feeding the next PIC low, which starts that processor's communication sequence. The packet sent by a PIC contains its address, so the master knows who said what, regardless of the order of PICs on the network. Clearly, there are limitations on what this network can achieve, but it's suitable for the purpose.
The network runs at 115.2KB and hence is compatible with an ordinary serial port, with just the need for RS232 to RS422 level conversion. |
|
|
|