Understanding 5V tolerance and internal pull up/down resistors
Hi all:
I have problems understanding the pull up/down situation with regards to 5V tolerance.
I must admit that I have limited hardware knowledge, so please be gentle. I have searched and read a lot, but couldn't find a definitive answer yet.
Say that I have one board with an STM32F407VGT6 running at 3,3 V. This board has one UART Rx (input) on one pin, which is 5V tolerant according to the datasheet.
Say that I can connect this board to 1 of 2 other boards, each with one UART Tx (output). One of the boards runs at 3.3 V, the other at 5 V.
I want to tell the customer that he/she can connect either board. That should be fine because the STM32 is 5V tolerant.
Let's ignore for this exercise of understanding the start-up problem, where the 5V may come before the 3.3V is there, overstepping the VDD + 4V limit in the datasheet.
Normally, a UART Rx pin should be pulled up. But I cannot use the internal pull-up, right? It is not really clear from the STM documentation, but the following external source says that the input voltage is pulled down to around 4V because of the internal pull-up, and that is risky because some internal diode 'clamps' then:
https://github.com/ARMmbed/mbed-os/issues/5102
For my understanding: Is the internal pull-down affected too? According to this source, yes:
http://forums.netduino.com/index.php?/topic/10401-guidance-using-5v-signals-with-pull-upspull-downs/
But AN4899 only warns about the internal pull-up, and not the internal pull-down. If I could enable the pull-down, I could at least prevent the input from floating if no board is connected
Say that I always need a pull-up, and a pull-down won't do it.
What can I do? Should I fit an external pull-up resistor? But that is not enough, is it? I should then learn and implement a proper lever-shifting logic which would also work with the optional 3.3V input.
That means I would have to worry about the 5 V tolerance myself, in which case, I can actually forget about the supposedly 5V tolerance of the STM32, right?
If that is the case, could someone point me to an example of such a clever, external 5V-tolerant input circuit? Or at least give me some hints I can pass on to a real hardware guy. 8-)
Thanks in advance,
rdiez
