PIC to PIC communication requirments
Moderators: David Barker, Jerry Messina
PIC to PIC communication requirments
Dear all,
I am striding into new areas in my project.
As my project expands, so is the requirement on the computational power. Now, there is real need for me to start thinking about using multiple PICs. But I have no experience in this.
I will need to divide tasks in between the different PICs, possibly transfering data from a master to slaves and synchronize the operation of multiple slaves by the master.
The other architecture that I can think of is to let the individual PICs to do their own tasks until complete and then synchronize their outputs. Can anyone show me some hints or basics on how to communicate between multiple PICs in the most efficient way?
Anyone can offer any experience or show me some sites with these information?
Regards,
Liak
I am striding into new areas in my project.
As my project expands, so is the requirement on the computational power. Now, there is real need for me to start thinking about using multiple PICs. But I have no experience in this.
I will need to divide tasks in between the different PICs, possibly transfering data from a master to slaves and synchronize the operation of multiple slaves by the master.
The other architecture that I can think of is to let the individual PICs to do their own tasks until complete and then synchronize their outputs. Can anyone show me some hints or basics on how to communicate between multiple PICs in the most efficient way?
Anyone can offer any experience or show me some sites with these information?
Regards,
Liak
I apologise for not answering your question directly. but maybe you don’t need to go to the complexity of multiple pics when one would do. The one you are using will almost certainly run at 40MHz microchip already do some that run at 64Mhz, that maybe pin compatible(@3.3V) with the device you are using. This would be equivalent to 3 of your pics. Changing some of your algorithms may have an even bigger impact.
Getting back to what you asked originally.
It really does depend on how much data is being sent how often you’re communicating, and how many pins you have free.
Rs232 is probably the lowest pin count if you can get away without any extra handshaking. If you use an extra transistor per pic you can fan in./out to from multiple pics.
Using spi if probably the best compromise of speed and pin count you just need chip select to decide which pic the master is talking to.
Richard
Getting back to what you asked originally.
It really does depend on how much data is being sent how often you’re communicating, and how many pins you have free.
Rs232 is probably the lowest pin count if you can get away without any extra handshaking. If you use an extra transistor per pic you can fan in./out to from multiple pics.
Using spi if probably the best compromise of speed and pin count you just need chip select to decide which pic the master is talking to.
Richard
Hmmm..
richardb wrote: Rs232 is probably the lowest pin count if you can get away without any extra handshaking. If you use an extra transistor per pic you can fan in./out to from multiple pics.
Using spi if probably the best compromise of speed and pin count you just need chip select to decide which pic the master is talking to.
Richard
I personnaly would have said: use I2C or better, CAN bus ! for CAN you can use 18F458 (not too expensive). If you need it at 3.3V you can use LF version of this PIC. With CAN you got low pin usage+noise immunity!
Regards
octal
Hi Richard,
I didn't used them myself, but I have friends who use them a lot (18F458 aspecially) in industrial applications here in France.
You need to use a transeiver after the PIC 18F458. most users use Microchip MCP2551 http://ww1.microchip.com/downloads/en/D ... 21667E.pdf
Floran had also converted sometimes ago the Microchip implementation (Application Note AN738) to Swordfish Basic module (you can find it on modules page - He reported that it worked on his hardware).
http://www.sfcompiler.co.uk/wiki/pmwiki ... ser.CanBus
Regards
octal
I didn't used them myself, but I have friends who use them a lot (18F458 aspecially) in industrial applications here in France.
You need to use a transeiver after the PIC 18F458. most users use Microchip MCP2551 http://ww1.microchip.com/downloads/en/D ... 21667E.pdf
Floran had also converted sometimes ago the Microchip implementation (Application Note AN738) to Swordfish Basic module (you can find it on modules page - He reported that it worked on his hardware).
http://www.sfcompiler.co.uk/wiki/pmwiki ... ser.CanBus
Regards
octal
Dear Richard and Octal,
Thanks for the replies. I will lookup for those materials you have given. I did a survey on the Microchip site. Indeed, the 18K series run on 64Mhz clock on HSPLL mode. However, when I checked on the supported device list in SF, these devices are missing. I am wondering:
1. What are the special things about the K series and J series from the normal PIC18?
2. Does SwordFish support these devices? What sorts of modification are required?
3. The hardware does seem same like the normal PICs with maybe lower voltage, any changes apart from those required?
Thanks.
Regards,
Liak
Thanks for the replies. I will lookup for those materials you have given. I did a survey on the Microchip site. Indeed, the 18K series run on 64Mhz clock on HSPLL mode. However, when I checked on the supported device list in SF, these devices are missing. I am wondering:
1. What are the special things about the K series and J series from the normal PIC18?
2. Does SwordFish support these devices? What sorts of modification are required?
3. The hardware does seem same like the normal PICs with maybe lower voltage, any changes apart from those required?
Thanks.
Regards,
Liak
Hello,liak wrote: ...
However, when I checked on the supported device list in SF, these devices are missing. I am wondering:
1. What are the special things about the K series and J series from the normal PIC18?
2. Does SwordFish support these devices? What sorts of modification are required?
...
Liak
K series are supported, and are compatible with 18F series.
Check this page ... http://www.sfcompiler.co.uk/wiki/pmwiki ... ionHistory the link for K header files.
You'll find there also the link to the PDF file from Microchip that indicates the differences between K and F series and the migration guidelines.
Regards
octal
Some further questions...
Dear all,
I have an embarrassing question to ask; . I have been considering what richard has said. May be a single PIC will be adequate for my application. Now, just if I can do this task below. I am not sure if there is a way to achieve this or I am just making myself look foolish.
Now, the stupid question. Is it possible to make a few devices share the output from a same pin, given that the output to all these devices are the same, let's say a clock signal? Because I have on hand a few devices running at the same clock speed and to be synchronized. So the most convenient thing to do is to make all of them running on the same clock signal from a same port. I wonder if this is possible. If not what sort of hardware modification can be made to implement this.
Tell me if I have asked a stupid question. Thanks.
regards,
Liak
I have an embarrassing question to ask; . I have been considering what richard has said. May be a single PIC will be adequate for my application. Now, just if I can do this task below. I am not sure if there is a way to achieve this or I am just making myself look foolish.
Now, the stupid question. Is it possible to make a few devices share the output from a same pin, given that the output to all these devices are the same, let's say a clock signal? Because I have on hand a few devices running at the same clock speed and to be synchronized. So the most convenient thing to do is to make all of them running on the same clock signal from a same port. I wonder if this is possible. If not what sort of hardware modification can be made to implement this.
Tell me if I have asked a stupid question. Thanks.
regards,
Liak
Dear Richard,
To clarify myself further. Now what I intend to do is to connect a single PIC to control multiple of my output devices. These devices are controlled by serial data. So I am wondering is it possible for all these devices to share a clock signal generated from a single pin on the PIC? Diagramatic wise:
PIC Pin PortB.3 Clock -------------> Device 1
|___________> Device 2
|___________> Device 3
|___________> Device N
I am sorry that I am not that good in electronics. I am not sure if this is feasible with PIC?
Thanks.
Regards,
Liak
To clarify myself further. Now what I intend to do is to connect a single PIC to control multiple of my output devices. These devices are controlled by serial data. So I am wondering is it possible for all these devices to share a clock signal generated from a single pin on the PIC? Diagramatic wise:
PIC Pin PortB.3 Clock -------------> Device 1
|___________> Device 2
|___________> Device 3
|___________> Device N
I am sorry that I am not that good in electronics. I am not sure if this is feasible with PIC?
Thanks.
Regards,
Liak
Dear All and Richard,
Sorry for confusing you further. Maybe I am not good in asking this. My device runs on SPI. I am asking this because, if I can somehow, connect all the parallel output devices, to sharing the same clock pin, then I can save some pins and comp time. Maybe I can illustrate my case better by some coding similar to below:
Rather than, having to code each separate ClockPin
So I save some on the ClockPin as Device1, Device2 and Device3 run on same pace.
Please tell me if I have asked something stupid or this is not possible. Thanks.
Regards,
Liak
Sorry for confusing you further. Maybe I am not good in asking this. My device runs on SPI. I am asking this because, if I can somehow, connect all the parallel output devices, to sharing the same clock pin, then I can save some pins and comp time. Maybe I can illustrate my case better by some coding similar to below:
Code: Select all
Public Dim ClockPin as PortB.3
Public Dim DataPin1 as PortC.2
Public Dim DataPin2 as PortC.3
Public Dim DataPin3 as PortC.4
...
...
Sub SendData()
Dim Counter as Byte
For Counter = 1 to MaxBit
Low(ClockPin)
High(DataPin1)
High(DataPin2)
High(DataPin3)
High(ClockPin)
Next Counter
End Sub
Code: Select all
Public Dim ClockPin1 as PortB.1
Public Dim ClockPin2 as PortB.2
Public Dim ClockPin3 as PortB.3
Please tell me if I have asked something stupid or this is not possible. Thanks.
Regards,
Liak