26
\$\begingroup\$

I was going through an app-note AN2606 where I came across this connection diagram:

enter image description here

As per my knowledge, UART is push-pull type and Tx provides the pull-up required and hence we don't need to use any external pull ups. Am I missing something here?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ When UART is idle, Both the lines are high. Start bit in UART is first High-to-Low transition on the line. Hence they are pulled up. \$\endgroup\$
    – Swanand
    Nov 22, 2016 at 9:56
  • 1
    \$\begingroup\$ @swanand - That's what even I thought. I am wondering why this app note would recommend pull ups. \$\endgroup\$ Nov 22, 2016 at 10:39
  • 2
    \$\begingroup\$ Probably to guarantee certain requirements, like that it's high before the micro ends its power cycle or rise times are fast enough... \$\endgroup\$
    – zakkos
    Nov 22, 2016 at 10:55
  • 1
    \$\begingroup\$ I've used UART a number of times on STM32s and I haven't had any pullups, although admitedlt it was not for the bootloader, so @zakkos might be right. Also see the note below the schematic - it's only necessary if the hostst does not have a pull up of it's own, so it seems even more likely that it's there to ensusre some requirement for the state of the line. \$\endgroup\$
    – jaskij
    Nov 22, 2016 at 11:16
  • 2
    \$\begingroup\$ @swanand - what I meant was - UART pins are pulled up on their own. We should not need external pull ups as shown in the image. The Tx pins are responsible to drive the line HIGH without the need of external resistors. Tony's answer explain the requirement of those resistors. :) \$\endgroup\$ Nov 22, 2016 at 11:50

3 Answers 3

26
\$\begingroup\$

While the microcontroller is in reset, its I/O pins will be configured as high-impedance inputs. So the pin used for a UART serial Transmit Data (TXD) will be floating during this time. This can lead to noise causing rubbish to be transmitted by the RS232 line driver.

Some line driver ICs have internal pull-up resistors on their TTL/LVTTL-side input pins to prevent this and produce an RS232 idle state. Otherwise, a pull-up resistor can be added.

A pull-up resistor on the UART serial Receive Data (RXD) input pin is not necessary because the RS232 line receiver is always driving that pin.

Note that the reset period is usually a relatively long time and that any I/O pins used as output pins are prone to this problem and must be considered for a pull-up or pull-down resistor.

\$\endgroup\$
2
  • 2
    \$\begingroup\$ About RXD, if the host side has no pull-up at its 'TXD' pin, the 'RXD' pin at slave side (STM32 side) may also need pull-up. \$\endgroup\$
    – diverger
    Aug 22, 2018 at 7:19
  • \$\begingroup\$ See question diagram. RXD is always driven by RS232 line receiver, never floating so no pull needed, as answer says. \$\endgroup\$
    – TonyM
    Mar 17, 2022 at 7:55
2
\$\begingroup\$

The pull-ups are meaningful just in case the micro is in boot mode. In that case the micro cycle on different ports (uart, I2C usb, can) depending on the kind of micro.

If the input port is not driven noise could eventually let the micro thinking that there's a transmission on that port and then waiting for a bott from a port that isn't connected to anything. Having a pull-up will prevent this case.

\$\endgroup\$
1
\$\begingroup\$

The circuit shown will not require a pull-up on the Rx line, however there are occasions when a pull-up is required to avoid possible break conditions occuring when they are not expected. There are occasions where RS232 transceiver shown in the circuit above is something else, say like a UART multiplexer for switching between several UART enabled peripherals. These muxes (or other possible switching networks) may and generally do have tri-state outputs, and when this is the case one could find oneself with a switched UART bus Rx line being left without a driving Tx line, with instead a tri-stated line from the mux. As it has occurred on one occasion this left me when switching between peripheral with an Rx line being in a high-impedance state and causing break interrupts that were not properly handled, causing all sorts of other unwanted problems. The solution was to add a 100K pull-up on the Rx line concerned so that when a bus switch occurred to another peripheral, the other peripheral's Rx line would continue remaining in a high state not causing any break timeouts with the concerned UART. I guess it does depend on the context and if there is a possibility to program the UART Rx pins with pull-ups or not as it is possible with some processors.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.