cancel
Showing results for
Did you mean:

# Could UART function on lines with 10nF capacitance?

Associate II

I am using all of the pins of a STM32L471RE in a design.

In manufacturing, there is the need to communicate with the MCU over UART (during Functional Testing (FCT)).

The problem is that all the pins are taken, so there are no free UART ports available.

One idea is to use 2 pins which are not needed during FCT, which have a UART port (UART4). However, these pins have pullup resistors and capacitors, due to their normal function. Shown below.

My questions:

1. Could the MCU's UART port still work with the capacitors and pullup resistors? Would the capacitors pull too much current during switching and damage the port?
2. If this would work, what baud would you recommend? Obviously it must be low due to the capacitance.
3. If the UART would not work on these lines, would the only option be to find pins without capacitors and bit-bang UART?

4 REPLIES 4
Chief

Hi,

1. its heavy load for a switching pin, but should be no problem, if frequency is not high.

2. i made simple simu :

Here switching at 10kHz in 10n load, source (=pin) has 300 ohms internal resistance ( => 10mA at 3,3V , this a cpu pin can drive....see ds of your cpu); so it should drive 19.2 K easily , if ok for your test, i would set the uart to 9600 .

+ checking the average power loss for the cpu/pin :

44 uW should not damage it - right ? 🙂

+ from ds :

So dont use PC13..15 for this !

+

So a pin will survive with 20mA*1,3V = 26mW loss, we drive it here at 0,04 mW --> no problem.

Associate II

I only have one question:

You're assuming ~300ohm internal resistance of GPIOs due to their specified current limit.

Is this a safe assumption to make? What if the current limit is based on limits other than voltage drop, or what if it is a conservative value and the resistance is normally much lower? Would this still be safe?

I just want to be make sure, because damaging MCUs during testing on the production line would be disastrous.

Thank you.

>Is this a safe assumption to make?

There is no "simple safe" assumption , because there is no constant impedance, its a switching CMOS output;

so its real resistance when switching from off to on-state is the typical characteristic of a MOSFET : changing in some nanoseconds from Mega-ohms to (maybe) 30 ohms, its ON-resistance.

So on every switching action the pin driver will have a short time of high power loss - always, and this is, what its built for.

From ds we see:

ON-resistance here is maximum 1,3/20 = 65 ohm , so 30 ohm may be a good real value (as a minimum).

I made the same simple simu also with 30 ohms (just to be sure and see what happens then) and it was about 1 mW loss then, still far away from the 1,3*20 = 26mW a pin can safely survive .

So i recommended using 9600 baud speed (-> 50% lower than in simu ) to increased safety distance .

Just think: you have a 10MHz output and check it with a scope - you think about killing the chip ? no. right ?

But here (with 10:1 probe , 35 pF , track + pin capacitance, maybe 50 pF load in total ) 50pF at 10MHz to drive, similar to drive 50nF at 10kHz --- and no problem (and 500% of your 10nF at 10kHz).

So if you kill a cpu with this load at 9600 baud, you can be glad, you found it at testing , replace it and this not happens at the customer side. 🙂

Evangelist III

@oscarw wrote:

In manufacturing, there is the need to communicate with the MCU over UART (during Functional Testing (FCT)).

The problem is that all the pins are taken, so there are no free UART ports available

Could you not use the SWD pins ?

https://shawnhymel.com/1840/how-to-use-semihosting-with-stm32/