Skip to main content
Visitor II
January 14, 2024
Solved

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

  • January 14, 2024
  • 1 reply
  • 2595 views

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).

    This topic has been closed for replies.
    Best answer by tjaekel

    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. 

    1 reply

    Technical Moderator
    January 14, 2024

    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

    tjaekelAuthorAnswer
    Visitor II
    January 14, 2024

    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.