Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

2 UART on a single port

Status
Not open for further replies.

chrischina

Newbie level 4
Joined
May 13, 2016
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
60
I am curently working on a project where a MCU got only one UART port available, however I need to run two peripherals with UART interface (not simultaneously) so I was wondering if I can connect two peripherals UARTs on the same UART of the MCU while playing with enabling and disabling the peripherals one by one for communicating with the MCU?

Your feedbacks and recommendation are appreciated about this situation

Regards
 

Hi,

As long as your slaves don't talk randomly..

In other words: if it is apure "master requests" --> "slave answers" system, then it is possible.

You have to take care, that the disabled slave sees a HIGH = idle, without a LOW going pulse/glitch during switching.

You may multiplex the RS232 signals or the TTL signals (wich needs two pairs of RS232 tranmitter/receiver).

Klaus
 

The simple answer is no.
The more complex answer is that it is possible but not without adding other components.
The real problem is that UARTs expect to be able to drive the Tx line all the time. That is not a prob elm when the 1 Tx line goes to two devices but when two devices try to drive the same line (the Rx line on the MCU say) then the two line drivers will conflict.
By adding in extra component you can select which sender you listen to but that often limits the purpose of having two UARTs that otherwise could send whenever they needed to without being 'enabled'.
This is a bit like the RTS/CTS lines on some UARTs but they do not necessarily tri-state the line drivers. If they do then that makes for an easier implementation (but still with additional control lines).
Susan
 

As I have understand you would like to connect two physical serial ports (SP1 and SP2) to one UART in PIC?
Question which PIC you use and if there is possibility to remap pins. You could remap UART when you want and it could work. But you have another solution – software UART....
Additionally it is possible to use UART as for instance RX from SP1 and TX to SP2. And software one for rest. It is only your will ;) The only limit is that you will be deaf while reinitialise UARTs
 

The correct solution is to use the correct chip for the job in the first place of course.
(I really don't understand why people seem to put these problems in their way so often)

As an alternative you might be able to create a software uart but since you gave no
information on what you are using and exactly how, only you can say if that's possible.
 

At least, electrically it is possible to directly connect multiple busses; I did that a long time ago with the TX. In regard to RX I connected them by diode, but as mentioned above, you should certify that there wouldn’t occur any reception unless solicited by the device working as master.

dby.PNG
 

As I have understand you would like to connect two physical serial ports (SP1 and SP2) to one UART in PIC?
Question which PIC you use and if there is possibility to remap pins. You could remap UART when you want and it could work. But you have another solution – software UART....
Additionally it is possible to use UART as for instance RX from SP1 and TX to SP2. And software one for rest. It is only your will ;) The only limit is that you will be deaf while reinitialise UARTs

I rather use TI chip such as CC1310 or CC2650
 

With all chip uarts is the same problem - only one TX on the bus in the time, and there could be more RX. With few TX connected to line .
But question is why not to use proven way with RS485 or CAN way?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top