View previous topic :: View next topic |
Author |
Message |
stefsun
Joined: 23 May 2007 Posts: 22
|
How does PC communicate with multi-mcus via the RS232? |
Posted: Thu Nov 13, 2008 7:17 pm |
|
|
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
|
Re: How does PC communicate with multi-mcus via the RS232? |
Posted: Thu Nov 13, 2008 9:10 pm |
|
|
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
|
|
Posted: Thu Nov 13, 2008 11:06 pm |
|
|
thanks your reply
do you have the example about multi-mcus communication via the rs485 |
|
|
arunb
Joined: 08 Sep 2003 Posts: 492 Location: India
|
RE: |
Posted: Sat Nov 15, 2008 4:44 am |
|
|
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
|
|
Posted: Sat Nov 15, 2008 9:33 am |
|
|
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
|
|
Posted: Sat Nov 15, 2008 8:53 pm |
|
|
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
|
RE: |
Posted: Sat Nov 15, 2008 9:41 pm |
|
|
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 |
|
|
|