+ Post New Thread
Results 1 to 10 of 10
  1. #1
    Advanced Member level 3
    Points: 5,376, Level: 17
    Achievements:
    Created Blog entry 7 years registered
    Mithun_K_Das's Avatar
    Join Date
    Apr 2010
    Location
    Dhaka, Bangladesh, Bangladesh
    Posts
    828
    Helped
    22 / 22
    Points
    5,376
    Level
    17
    Blog Entries
    3

    Is it possible to connect two PCS via serial port with one microcontroller

    Is it possible to connect two PCS via serial port with one microcontroller with only one pair of Tx-Rx?

    I want to know is it possible to use two COM ports via MAX232 with a single microcontroller? Note that Only one of these com port will be used to communicate. Another one will be standby. If one is not working for any reason, another one can be used alternately.
    I love my profession, I love my M's Lab. __MKDas

  2. #2
    Super Moderator
    Points: 77,731, Level: 67
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    15,754
    Helped
    3589 / 3589
    Points
    77,731
    Level
    67

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    Hi,

    No. Not as long as you like to comply with specification.

    * RS232 is point-to-point, it is no bus.
    * In RS232 there is no "standby" in the meaning of High-Z of Tx ... allowing other member to drive the Tx.

    Klaus
    Please don´t contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  3. #3
    Advanced Member level 3
    Points: 5,376, Level: 17
    Achievements:
    Created Blog entry 7 years registered
    Mithun_K_Das's Avatar
    Join Date
    Apr 2010
    Location
    Dhaka, Bangladesh, Bangladesh
    Posts
    828
    Helped
    22 / 22
    Points
    5,376
    Level
    17
    Blog Entries
    3

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    So is it possible to use 2 com like this: one is used to data communication. Another is just standby.
    I love my profession, I love my M's Lab. __MKDas



    •   AltAdvertisement

        
       

  4. #4
    Super Moderator
    Points: 81,387, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,343
    Helped
    4455 / 4455
    Points
    81,387
    Level
    69

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    Without considering whether it's a PC or anything else, if two devices drive the same wire at the same time with different data there will be a collision and one or both drivers will be overloaded. Current will flow through the high side driver of one device then through the low side driver of the other, effectively shorting the supply. In practice, drivers usually have some degree of protection against overload but the resulting data in overloaded condition is indeterminate.

    You CAN have more than one device listening to (receiving from) one driver because it is only monitoring the line, not influencing what is already there.

    There are serial methods that allow more than one driver on a three wire connection, for example RS485, but they have protocols that ensure only one device is driving at a time.

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

    •   AltAdvertisement

        
       

  5. #5
    Advanced Member level 4
    Points: 8,209, Level: 21
    Achievements:
    7 years registered
    paulfjujo's Avatar
    Join Date
    Jun 2008
    Location
    France 01120
    Posts
    1,324
    Helped
    269 / 269
    Points
    8,209
    Level
    21

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    Quote Originally Posted by Mithun_K_Das View Post
    So is it possible to use 2 com like this: one is used to data communication. Another is just standby.
    Add a relay 2 contact RT to commute RS232 level to One or Other PC
    Relay driven by Human choice ! or by a MCU output wich match some confitions

    or a simple double inverter ..



  6. #6
    Super Moderator
    Points: 29,631, Level: 41
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Brazil
    Posts
    8,861
    Helped
    1114 / 1114
    Points
    29,631
    Level
    41
    Blog Entries
    9

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    There are means of sharing buses for very particular cases, for example by using diode in the RX of the device side, especially in the opposite situation (1PC + 2devices) where they only respond upon request, so that the general question as posed does not allow a precise answer, once we don't know how these modules work.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



  7. #7
    Advanced Member level 3
    Points: 5,376, Level: 17
    Achievements:
    Created Blog entry 7 years registered
    Mithun_K_Das's Avatar
    Join Date
    Apr 2010
    Location
    Dhaka, Bangladesh, Bangladesh
    Posts
    828
    Helped
    22 / 22
    Points
    5,376
    Level
    17
    Blog Entries
    3

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    If a microcontroller is connected with PC via COM and it is working. Now if another COM (may be another PC) is used just to monitor their communication will it work?
    I love my profession, I love my M's Lab. __MKDas



    •   AltAdvertisement

        
       

  8. #8
    Super Moderator
    Points: 260,203, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    45,441
    Helped
    13825 / 13825
    Points
    260,203
    Level
    100

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    As already clarified, the RS-232 standard doesn't provide a high-Z feature. As for standard RS-232 devices like PCs, the answer to your question in post #1 and #3 is clearly no.

    Nevertheless some devices extend the RS-232 standard towards a multi-drop bus. There are RS-232 drivers with TX high-Z feature, and devices that use device addresses with three-stateable RS-232 driver operated similar to RS-485, e.g. VICI valve actuators in the lab automation. The operation is opposite to the intended operation, one PC and multiple peripheral devices controlled by one interface.

    Monitoring with a second RS-232 is possible, but you cut to interrupt the TX line.



  9. #9
    Super Moderator
    Points: 81,387, Level: 69
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    13,343
    Helped
    4455 / 4455
    Points
    81,387
    Level
    69

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    Yes, just join the grounds together and connect the RX pin to either the RX (monitor incoming) or TX pin (monitor outgoing) of the other computer.
    If you have two serial ports you can connect the RX of one to the RX on the other PC and the RX or the other port to TX on the other PC, that lets you see the serial traffic in both directions. The golden rule is to NEVER connect two TX pins together!

    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  10. #10
    Advanced Member level 3
    Points: 5,376, Level: 17
    Achievements:
    Created Blog entry 7 years registered
    Mithun_K_Das's Avatar
    Join Date
    Apr 2010
    Location
    Dhaka, Bangladesh, Bangladesh
    Posts
    828
    Helped
    22 / 22
    Points
    5,376
    Level
    17
    Blog Entries
    3

    Re: Is it possible to connect two PCS via serial port with one microcontroller

    Quote Originally Posted by betwixt View Post
    Yes, just join the grounds together and connect the RX pin to either the RX (monitor incoming) or TX pin (monitor outgoing) of the other computer.
    If you have two serial ports you can connect the RX of one to the RX on the other PC and the RX or the other port to TX on the other PC, that lets you see the serial traffic in both directions. The golden rule is to NEVER connect two TX pins together!

    Brian.
    Yes! It works. I tested it before while working with GSM module and microcontrollers and monitoring their data communication from PC connecting a TTL-USB converter connecting their Tx Rx pins. But only module Tx to TTL to USB converter's Rx works fine. But if I connect TTL to USB converter's Tx to MCU Tx >>> problem here. TTL to usb converter become hot.

    Thanks for your suggestion.
    I love my profession, I love my M's Lab. __MKDas



--[[ ]]--