CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

serial communication among three PICs

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
afede



Joined: 12 May 2008
Posts: 4

View user's profile Send private message

serial communication among three PICs
PostPosted: Mon May 12, 2008 4:23 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Mon May 12, 2008 4:51 pm     Reply with quote

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)
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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