cancel
Showing results for 
Search instead for 
Did you mean: 

Implementing 2 UART on same port

HDesa.1
Senior

Hello,

I am trying to implement 2 separate UART channels on the single port. I have initialized the two UART channels and have connected the TXs and RXs of the two channels with each other. (Image attached)

When I run them separately, they work just fine. But when the TXs are connected they won't work. Is this the correct way to operate the two channels on same port?

Please assist.

-Regards

-Regards
Hrishikesh
9 REPLIES 9

The point / purpose of this would be what?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

I have a single port which I can use to transfer the data. I want to transfer and communicate with both the core independently.

-Regards
Hrishikesh

If Tx pins are set to push-pull as is normal, you can't just simply connect them - they will "fight" with uncertain result, or even get damaged.

JW

So what is the solution for this. Should I initialize it to Open Drain. Will this affect the communication?

-Regards
Hrishikesh

You could use open drain with a pull-up, but you'd still need to manage / arbitrate usage so not to step on each other's communication. As the signal is Normally-High you could use an AND gate, or diodes, to mix a signal in Push-Pull mode.

You could share one UART between cores, both have access to the registers. Arbitrate who has owner ship.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

OK. Thank you for your suggestion.

I will give this a try and check if it works for me.

-Regards

-Regards
Hrishikesh

Hi, I tried the solution of open drain with pull-up.

As the port is single, I am sending a data set which eventually reached both the UART channels of the two core. The cores response to the received command by transmitting the data/message back. I am running these steps in a loop.

This entire configuration works for some amount of time but then any one of the core stops completely receiving the data. Can you tell what exactly happens over a period of time? Any solution to this?

-Regards

-Regards
Hrishikesh

I don't know, you'll need to debug the issue and understand it.

For reception, look at sticky errors like Noise, Framing, Parity, etc as they stop reception until addressed.

Watch for while(1) loops or other places the cores can get stuck. For HardFault_Handler() and Error_Handler() output actionable diagnostics so you can identify it has failed and where.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

OK. I will check these things for issues. Thank you.

-Regards
Hrishikesh