cancel
Showing results for 
Search instead for 
Did you mean: 

MCU at 1V8 - a need for UART level shifters?

tjaekel
Senior III

I saw on NUCLEO-U5A5 schematics - there is a level shifter for signal T_VCP_TX:
a bit obvious: if MCU jumper is set to run on 1V8 VDD - an external UART receiver (e.g. CP2102N) would not get anymore correct UART_TX signals (yes, it does not anymore with 1V8 logic on TX).

Wouldn't it be enough to use an Open Drain signal on MCU (for UART_TX) and an external pull-up to 3V3?
The UART_RX should be OK, even MCU on 1V8 MCU VDD, but assuming RX is 5V tolerant.

Here what I mean - and it works!

LS_1V8_UART.png

Just configure the UART_TX as GPIO_MODE_AF_OD and it should work also without a need for a level shifter (with external pull-up).

1 ACCEPTED SOLUTION

Accepted Solutions

You are right, it is correct what you have pointed out.

Open Drain and Pull-Up creates an RC circuit (C from cable and input capacitance on Rx side) and a low-pass filter.
The waveform can look "ugly" (esp. the charging phase, the raising edge is "rounded" and not a sharp edge anymore).

It works fine on UART as: 1K4 pull-up and 1843200 as baudrate (1.8 MHz). It works also fine on I2C (which are Open Drain) up to 4 MHz - but the faster the frequency the smaller the pull-up (e.g. 300R for 4 MHz I2C).

This can draw too much current from a GPIO Open Drain output pin and the minimum size of a pull-up is limited by it.

Totally right: a push-poll and level shifter is better,, safer and faster. Push-poll pins have an almost zero resistance (and therefore much higher frequency).

For my feeling: the main reason to use a level shifter instead of this "open drain trick" is:
when users do NOT configure as Open Drain but there is a pull-up (to 3V3) but MCU runs on 1V8 - it creates a risk to damage the pin (or chip) because now you are driving 3V3 into a 1V8 MCU.

Level shifters are always better, totally agreed. 

View solution in original post

2 REPLIES 2
Peter BENSCH
ST Employee

An open-drain output needs a pull-up to reach Hi level, but this forms a low-pass filter with the subsequent line and input capacitance and therefore suppresses high frequencies. For this reason, open-drain outputs are rarely used for frequencies above a few kHz.

Therefore level shifters are always necessary for higher pulse frequencies.

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

You are right, it is correct what you have pointed out.

Open Drain and Pull-Up creates an RC circuit (C from cable and input capacitance on Rx side) and a low-pass filter.
The waveform can look "ugly" (esp. the charging phase, the raising edge is "rounded" and not a sharp edge anymore).

It works fine on UART as: 1K4 pull-up and 1843200 as baudrate (1.8 MHz). It works also fine on I2C (which are Open Drain) up to 4 MHz - but the faster the frequency the smaller the pull-up (e.g. 300R for 4 MHz I2C).

This can draw too much current from a GPIO Open Drain output pin and the minimum size of a pull-up is limited by it.

Totally right: a push-poll and level shifter is better,, safer and faster. Push-poll pins have an almost zero resistance (and therefore much higher frequency).

For my feeling: the main reason to use a level shifter instead of this "open drain trick" is:
when users do NOT configure as Open Drain but there is a pull-up (to 3V3) but MCU runs on 1V8 - it creates a risk to damage the pin (or chip) because now you are driving 3V3 into a 1V8 MCU.

Level shifters are always better, totally agreed.