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.

Diode dans resistor value for multi-MCU communication with UART

Status
Not open for further replies.

michcfr

Advanced Member level 4
Full Member level 1
Joined
Mar 7, 2012
Messages
106
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,296
Activity points
2,011
Hello,
I would like to implement multi-MCU communication with UART sharing like in the picture below.
The MCU ara colocated on the same PCB and at few cm of distance; it is 3.3V logic.
What model of diode (with single or many (4 or 8 diodes) in the same package) and resistor value would you suggest?

1636828193334.png


thank you
Michel

thank you
Michel
 

Thank you, I'll take a look
Does it also works for the diode 1N4148 (fast and with relatively low forwarding voltage) with 4.77K resistor?
 

Hi,

If diode, then I'd use a low voltage drop one. Shottky, low current signal diode. Something like BAT54A.
Then you ask about R. But you don't give us any any requirements and application informations. So how can we know what you need?

* For low current applications, good LOW level you need high resistor value,
* For high speed, high noise immunity, high capacitive node, high baud rate you will need a low value resistor.

You are on the safe side with an AND gate, like 74HC21... instead of R and D...

Klaus
 

Thank you Klaus for your response.
My requirements are more related to the second case: high speed. So 1K resistor?
I like your solution about the AND gate but I need to lower the connections.

Michel
 

Hi,
I like your solution about the AND gate but I need to lower the connections.

Did you calculate the count of connections?
With 7 microcontrollers you need
* one 74HC21with 12 connections, or
* 7 diodes plus 1 resistor ... a total of 16 connections

Klaus
 

Klaus,
Thank you for your efforts. Sorry, I was not clear

Each MCU is on a separate mini PCB and I need to interconnect them through a single wire. Can I still keep one wires with the AND gate based solution?

Another question: why the AND gate based solution is safer than the diode based solution?

Regards,
Michel

Some uC provide also configurable open drain option for TX pin.
Can you please elaborate your solution? thx
 
Last edited:

The "one-wire" solution is well acceptable for low and moderate baud rates. Open drain TX pin can be used without a diode, available e.g. with STM32.
 

Hi,

Yes, "single wire" and "separate PCBs" was not clear to me.

AND solution is for one common PCB ... and can not work as single wire solution for multiple PCBs.

why the AND gate based solution is safer than the diode based solution?
Because it is better in every regard discussed in post#4.

******
In post #2 you ask about a 4.77k resistor ... this number is precise down to 0.2%.
But you did neither specify trace length, nor which connector you want to use (expected capacitace) and you did not specify the baud rate to 0.2%...you did not specify it at all.
So you are asking for a very accurate answer without giving equally accurate informations.
This can't work.

I wonder how you came exactly to 4.77k. It is no value in the standard E-series. So why not 4k75 (E96) or 5k as coarse value?

From a technical view (engineering view):
For a reliable operation you need to guarantee that
* the correct voltage level needs
* to be stable with given timing
* includung expectable noise and ground bounce

We don't know which microcontroller you use, thus we don't know the input and output voltage levels.
We don't know the baudrate for timing
We don't know wiring and noise sources.

Thus all we can do is guess. I'd say there is a good chance that a 4.77k resistor solution can work. But it's impossible to give any margin informations or giving a guarantee.

Klaus
 

Klaus,
Thank you for you help.
I am beginner and I am currently exploring this solution for my personal project. Again sorry for bad explanations and infos. About the 4.77k: it is an error. I was thinking about standard resistor value of 4.75K. No special theory behind this value. I have also proposed 1K but no theory behind too.

To clarify:
-the architecture of my system: each MCU is on a separate mini PCB with a pin header/socket connector that connects the PCB MCU into another common PCB (called "PCB Bus"). For space reasons, I can add only one (or two) PCB trace on the PCB Bus to implement the single wire.
-voltage level: 3.3V for logic and power for all the connected MCUs
-MCU used: ESP32, RP2040, STM32/Cortex-M7
-baud rate: maxium MBaud rate knwowing that concerned MCUs can go up to 3.8 MBaud (ESP32), 4.3MBaud (STM32), 7.8MBaud (RP2040)
-wiring: implemented by PCB trace(s) on the PCB Bus
-noise sources: no special constraints to my knwoledge
Please tell me if some info are missing or are not clear.

If you can help me more on:
-R value
-diode choice (if other than BAT54)
-add extra electronics?
-special PCB design rules to respect about the PCB trace implementing the single wire.

Thank you
 

Hi,

The baud rate needs to fit all microcontrollers, thus find out the possible max baud rate first.
Find out
* VIL of each microcontroller Rx pin
* VOL of each microcontroller Tx pin @ about 0.5 .. 1mA

Then do the PCB layout with short traces, far away from other signals. Not very wide signals to keep capacitance low.

Klaus
 

Hi Klaus,
We can target the min baud of all te MCU: 3.8MBaud
This is what I got from the datasheets:

-ESP32: with VDD=3.3V
VIL: -0.3 - 0.25VDD
VOL: 0.1VDD and IOL=28mA (typical) with VOL=0.495V

-RP2040: with VDD=3.3V
VIL -0.3 0.8VDD V
VOL max 0.5V at IOL=2, 4, 8, 12mA depending on settings

-STM32H7: with VDD=1.62V-3.6V
VIL: 0.3VDD V
VOL: max:1.3V at IOL=20mA
I don't know if it helps: The GPIOs can sink or source up to ±8 mA, and sink or source up to ±20 mA (with a relaxed VOL/VOH).

Regards
 

Do you actually target to 3.8 Mbaud? Then bus capacitance is rather critical. I would consider to use no diodes but to enable and disable TX pins, similar to operation of a RS-485 bus.
 

Do you actually target to 3.8 Mbaud? Then bus capacitance is rather critical. I would consider to use no diodes but to enable and disable TX pins, similar to operation of a RS-485 bus.
I target the maximum possible Baud. Do you have an example of such operation usage?
One of the issue I face is about the MCU firmware that do not gives the capability to enable/disable the TX. I try to design a pure electronic solution tranparent to the MCU (without coding).

Do you think we can avoid Diodes (and resistor?) if I suceed in Enable/Disable TX?
 
Last edited:

Hi,

I doubt that evry microcontroller can work at exactly 3.8MHz. It's not the "max value" that counts ... it's the exact 3.8MHz you have to check.

So 0.25 VCC is the max value your system can tolerate. This is 0.825V

Not IOL is important, but VOL at 1mA.
Maybe you need to look for VOL vs IOL charts. Maybe interpolate from other VOL values.

A BAT54 has about 0.35V at 1mA.
Thus VOL needs to be less than 0.825V - 0.35V = 0.475V (@1mA)


VOL of 1.3V makes no sense at all. It's against all standards I know for 3.3V systems.

Klaus
 

I target the maximum possible Baud. Do you have an example of such operation usage?
One of the issue I face is about the MCU firmware that do not gives the capability to enable/disable the TX. I try to design a pure electronic solution tranparent to the MCU (without coding).
The firmware must be able to handle half duplex anyway, specifically only send when the bus is idle.
Regarding baud rate, it must be achievable for all involved nodes. I'd probably go for a standard baud rate like 921k. At this rate, a low ohmic diode/resistor circuit should still work, e.g. 470 to 1k.
 

Hi,

I doubt that evry microcontroller can work at exactly 3.8MHz. It's not the "max value" that counts ... it's the exact 3.8MHz you have to check.

So 0.25 VCC is the max value your system can tolerate. This is 0.825V

Not IOL is important, but VOL at 1mA.
Maybe you need to look for VOL vs IOL charts. Maybe interpolate from other VOL values.

A BAT54 has about 0.35V at 1mA.
Thus VOL needs to be less than 0.825V - 0.35V = 0.475V (@1mA)


VOL of 1.3V makes no sense at all. It's against all standards I know for 3.3V systems.

Klaus

thank you Klaus
I'll better investigate the documentation of the MCUs. brb to you
--- Updated ---

The firmware must be able to handle half duplex anyway, specifically only send when the bus is idle.
Regarding baud rate, it must be achievable for all involved nodes. I'd probably go for a standard baud rate like 921k. At this rate, a low ohmic diode/resistor circuit should still work, e.g. 470 to 1k.
Thank you FvM.
Ok, I'll take a deeper look at the firmware.
If I succeed to get open drain for TX pin, do I still need the diode? if yes, is the BAT54 model good enough?
 
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top