cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F401 UART pull up to 5V on RX

Danilotto Runi
Associate II
Posted on April 10, 2018 at 17:58

Hi all,

Checking a schematic of an RX485 transceiver connected to STM32F401 UART, I got into this detail that captured my attention:

0690X0000060AVDQA2.png

The RX line is directly connected to the RX pin of UART1 of the the MCU and it is pulled up to 5V, there is not level adapter between.

The UART pins on the MCU are 5V tolerant but, checking into the configuration settings on STMCube configurator I found out that RX and TX pin have the pull-up settings activated and it is not possible to modify this setting (at least in the configurator...

pulling up to 5V externally the line could be ok because the pin is 5V tolerant, I did it previously on I2C lines but they were configured as open drain.

What does it happen if I apply 5V to a PIN that is internally pulled up to 3.3V? Does the MCU is damaged?

Is it possible to configure the UART pins as open drain or disable the pull-up?

Thanks

7 REPLIES 7
Posted on April 10, 2018 at 19:43

>>Is it possible to configure the UART pins as open drain or disable the pull-up?

Yes

If you have external pull-ups, select the NOPULL setting

The peripheral determines if a specific pin is used as an Input or Output, clearly as an Input it's not going to be using the output transistors to drive the pin high or low, so the PP vs OD setting there isn't material.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Posted on April 10, 2018 at 21:37

Hello Clive!

Thank you for your prompt support, as usual. Got the point. 

Thinking about it, it is obvious that on the rx line, being an input, PP vs OD has no point!!

T J
Lead
Posted on April 11, 2018 at 00:57

I would be surprised if you actually need to pull the RO pin to 5V (not 3v3.)

The 'High' threshold is approx 2V either way, pull up to 3v or 5v won't worry the RS485 output.

You could try to pull up to 3V3 and your issue will go away.

Posted on April 10, 2018 at 23:21

I back again because I think there is a kind of bug in the CubeMX configurator. The MCU is an STM32F401. If I go into the pin configuration tag, it addresses the RX pin like an output. I tried to configure an STM32F103 and it works correctly with the RX as input and the selection to disable the pull-up. Also the generated code reflects this misbehavior.

0690X0000060AV8QAM.png 

Posted on April 11, 2018 at 16:36

Hello!

Reading the datasheet High thresold is 2V for D, DE and RE

0690X0000060AYlQAM.png

But for R the thresold is 4.6V

0690X0000060AYqQAM.png

I think the solution could be switching the transceiver to a 3.3V rated part. But I would like to keep this for commonality with other projects

Posted on April 12, 2018 at 00:05

How long is your cable?

You would want to stay with 5V parts if the cable length is over 100M.

The ST processor is 5V tolerant like Clive said, if you take the precautions/advice from Clive, it works well. and you get the long cable support.

Posted on April 12, 2018 at 11:38

Reasonably it will be shorter, but, despite very rare, there are few possibilities that it will exceed 100M. I have to take into account this case.

Thank you TJ for your support.