|
|
View previous topic :: View next topic |
Author |
Message |
afede
Joined: 12 May 2008 Posts: 4
|
serial communication among three PICs |
Posted: Mon May 12, 2008 4:23 pm |
|
|
Hi;
I want to communicate 3 PICs. First pic will transmit data to second one. Then, second PIC will receive, merge this data with its own data and transmit result to third PIC...
First PIC will transmit by pin_c6. Second PIC'll receive by pin_c7 and transmit pin_c6. Third PIC'll receive by pin_c7...
for first PIC: Code: |
#use rs232 (baud=600, xmit=PIN_C6)
|
for second PIC: Code: |
#use rs232 (baud=600, xmit=PIN_C6)
#use rs232 (baud=600, rcv=PIN_C7)
|
and the third PIC: Code: |
#use rs232 (baud=600, rcv=PIN_C7)
|
But these use codes are not enough. How can i introduce these PICs to each other?? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon May 12, 2008 4:51 pm |
|
|
When you put only one pin (C6 or C7) in the #use rs232() statement,
the compiler will generate code for a software UART on those pins.
That's not the best way.
It's better to use the hardware UART. To do that, you must specify
both hardware pins (C6 and C7) in the same statement. Example:
Code: | #use rs232 (baud=600, xmit=PIN_C6, rcv=PIN_C7, ERRORS) |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|