cancel
Showing results for 
Search instead for 
Did you mean: 

Why would UART_TX need to be set as OC with external pullup, if UART is set to single-wire half-duplex mode?

0693W00000WHa5EQAT.png 

Why?

What happens if the respective pin is set as Push-Pull? And what happens if only the internal pullup is enabled and there's no external pullup?

And there's no point to tell that the pin has to be set as "alternate function" - of course. That ST can't forget the 'F1 GPIO disaster perpetuated through dumb Cube terminology is sad, but should not reflect in RMs.

In other words, I consider this whole sentence to be nonsense. The potential need for pullup to avoid inadvertent frames to be received, should be phrased differently - it's exactly the same requirement as with *any* UART_RX pins.

JW

4 REPLIES 4
gbm
Lead III

Half-duplex is normally used for communication with another chip(s) over a single wire, so setting it to push-pull would lead to a little disaster - creating a low power heater out of your microcontrollers. Internal pullup would work for baud rates around 1000..2000. For higher speeds the pullup is too week/too slow for going from 0 to 1. The internal pullup is ok for ensuring SPACE (inactive) state when no other device is connected but not for enforcing logic high while sending data.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
Uwe Bonnes
Principal III

The time constant from cable capacitance and the pullup should be shorter than th turn-around between different drivers. Otherwise the startbit may not be recognized.

Piranha
Chief II

The problem is that they present the the open-drain mode and external pull-up as mandatory and it indirectly implies that such a solution is chosen to avoid a short circuit. In reality it doesn't make a short connection universally impossible, is not mandatory and can degrade performance. The best solution depends on other devices on the bus.

And, not only they write this in reference manuals, but also ST employees recommend the same principles online. Here is a real life example and my explanation of the problem and solution:

https://community.st.com/s/question/0D53W00001TgA9WSAV/for-stm32f407-what-uart-mode-to-set-for-tmc2209-pdnuart-pin

Instead the reference manual should clearly inform that HDSEL option can be used together with SWAP option and it completely swaps the Tx/Rx pin functionality.

> Half-duplex is normally used for communication with another chip(s) over a single wire, so setting it to

> push-pull would lead to a little disaster

No. We are talking about a bus, and there are various techniques for dealing with bus contention. Using OC is only one of them, and one which brings in its share of problems, including the choice of pullup.

> Internal pullup would work for baud rates around 1000..2000. For higher speeds the pullup is too

> week/too slow for going from 0 to 1.

Not necessarily. And who said I am not good with baud rates around 1000-2000 or below.

ST should have enough faith that their users can multiply R by C.

> The time constant from cable capacitance

Who said a cable is to be used.

> and the pullup should [result in rise time to] be shorter than the turn-around between different drivers.

I don't know what that means.

> The problem is that they present the the open-drain mode and external pull-up as mandatory

This.

The RM ought to explain the exact working of the peripheral and leave the application hints to... well... application notes (and RM could then simply refer to them). This sort of half-true non-essential remarks just litter the RMs, inflating them unnecessarily, while making them less precise at the same time. Both these things are substantially bad, even if from ST's point of view they may reduce number of complaints from incompetent users.

That ST refuses to provide an adequate number (dozens per peripheral) and adequately written appnotes, together with concise examples, i.e. the "good enough" mentality and lack of leadership is what the the real problem here is.

JW