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

How does PC communicate with multi-mcus via the RS232?

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



Joined: 23 May 2007
Posts: 22

View user's profile Send private message

How does PC communicate with multi-mcus via the RS232?
PostPosted: Thu Nov 13, 2008 7:17 pm     Reply with quote

PC communicates with two mcus, two mcus link with bus.
If first mcu's address is 0X00;the second mcu's address is 0x01.
PC send a address, then the two mcus both receive the address to
judge which one can receive.
If PC send a 0x00, the first mcu judge the address to enable the send interruption.
then it send data to PC, when it send all data, then it disable the send interruption.
The second mcu judge the address(0x00) to disable the interruption.

If PC send data to any of the mcus, how they works?

Who has example about communication PC with multi-mcus, give me some advice.
Thanks in advance
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: How does PC communicate with multi-mcus via the RS232?
PostPosted: Thu Nov 13, 2008 9:10 pm     Reply with quote

stefsun wrote:
PC communicates with two mcus, two mcus link with bus.
If first mcu's address is 0X00;the second mcu's address is 0x01.
PC send a address, then the two mcus both receive the address to
judge which one can receive.
If PC send a 0x00, the first mcu judge the address to enable the send interruption.
then it send data to PC, when it send all data, then it disable the send interruption.
The second mcu judge the address(0x00) to disable the interruption.

If PC send data to any of the mcus, how they works?

Who has example about communication PC with multi-mcus, give me some advice.
Thanks in advance


RS232 is a point to point communications solution (single bus master). It is possible to have one transmitter and multiple receivers connected together but not to have multiple transmitters to share the same bus.

RS485 is a multi-bus master communications solution that will allow you to achieve the result you are looking for. RS232 to RS485 converters are readily available for the PC.

An alternative solution is to use something like the CAN bus however you will then need a CAN interface for the PC.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
Guest








PostPosted: Thu Nov 13, 2008 11:06 pm     Reply with quote

thanks your reply
do you have the example about multi-mcus communication via the rs485
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Sat Nov 15, 2008 4:44 am     Reply with quote

A basic example can be found in PICC\examples;directory, ex_rs485.c

Some other examples/ communication schemes regarding RS 485 have been discussed in this forum, just search for RS485 in this forum.

You can also search in google. There are many other examples..

thanks
arunb
Guest








PostPosted: Sat Nov 15, 2008 9:33 am     Reply with quote

arunb wrote:
A basic example can be found in PICC\examples;directory, ex_rs485.c

Some other examples/ communication schemes regarding RS 485 have been discussed in this forum, just search for RS485 in this forum.

You can also search in google. There are many other examples..

thanks
arunb



hi arunb,


but isn't there differences in writing routines between RS232 and RS485 ??


thanks
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sat Nov 15, 2008 8:53 pm     Reply with quote

The only difference is that RS485 requires an extra PIC pin to tell the driver/receiver chip which direction to use, driving or receiving. In CCS this is the Enable pin in the #useRS232 statement.
_________________
The search for better is endless. Instead simply find very good and get the job done.
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Sat Nov 15, 2008 9:41 pm     Reply with quote

The other difference being that RS232 uses +12 and -12 V voltage levels to send/receive data.

While the RS 485 uses a differential voltage of +/- 5 V DC.

thanks
arunb
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