Go Down

Topic: serial 5v leaks into VCC (Read 1 time) previous topic - next topic

db2db

Aug 23, 2015, 10:13 am Last Edit: Aug 23, 2015, 10:14 am by db2db
I power my board with external 5v, and have serial input as well.
The serial line is also high at 5v when no data is present.

If I then shut the 5v to switch the device off, I still see that SOME of serial line is leaking through the 328p chip, and pin 7 & 20 (VCC) are then seeing about 3.5v.

It's causing some issues.
Suggestions?

chucktodd

I power my board with external 5v, and have serial input as well.
The serial line is also high at 5v when no data is present.

If I then shut the 5v to switch the device off, I still see that SOME of serial line is leaking through the 328p chip, and pin 7 & 20 (VCC) are then seeing about 3.5v.

It's causing some issues.
Suggestions?
You need to understand the data sheet.

If you look at the ATMel 328p Data Sheet Table 29-1.  The Vih value:


It states the highest value that can be applied to a pin is Vcc+0.5 Volts.  so if you are 'turning off' by setting the Vcc of the Arduino to 0V.  the maximum Safe Voltage that can be applied to any PIN is 0.5V.  Anything over this level is shunted through protection diodes to Vcc.
So, effectively you are powering up the 'powered down' CPU by forcing power through an pin.

Here is the schematic for AVR 328p pins:


When the processor is powered down, all pins (inputs and outputs) must be powered down.

If the Serial port is still at 5V you are going to have to install a tri-state buffer between the CPU and external connections.

something like a 74LS126 with its control input 'G' connected to Vcc, the 'Y' connected to RX, 'A' from the input source. But this 74ls126 would still need to be powered while the CPU is off.



Chuck.
Currently built mega http server, Now converting it to ESP32.

db2db

Makes sense. Thanks for the comprehensive answer.

I can't rely on continuing to power a 74ls126.
Can you think of an IC that does high side switching, that will be open when power is off?
I could use a tiny relay, but I'd prefer not to.

jremington

If you can't avoid the possibility of the Arduino being unpowered, but connected to powered circuitry, place a 10K ohm resistor in series with the inputs to protect them.

A small amount of current may flow into the unpowered Arduino, but not enough to cause any damage.

Still, this is something to be avoided.

db2db

This 10k idea seems to work pretty well.

Without the resistor, I get 4.1v on the RX pin when the MPU isn't powered.
With the resistor I get 1.1 on the RX pin when the MPU isn't powered.

That's a big improvement.

Can you elaborate as to what is happening on the RX inputs that makes this work?
Would a 20k be even better or do I start to affect my serial data at some point?

zoomkat

Quote
Would a 20k be even better or do I start to affect my serial data at some point?
Have you tried serial communications since you made the mod? This was discussed not long back. The powered arduino is back feeding the unpowered arduino via the tx/rx connections (these have high value resistors tied to the arduino power bus to keep them high). What issues are you incurring with the unpowered arduino being back fed?
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

db2db


Yes, comms seem to work just fine. Only tested at 115200.

I should point out these are both custom boards.

The biggest issue is that when I cut power to the whole device, I was seeing that leakage on the chips VCC. When I power back on, the MPU wasn't starting up properly, so must have become unstable in that low voltage range.

I'd love to read that thread you referred to. Do you have an idea how I can find it?

chucktodd

This 10k idea seems to work pretty well.

Without the resistor, I get 4.1v on the RX pin when the MPU isn't powered.
With the resistor I get 1.1 on the RX pin when the MPU isn't powered.

That's a big improvement.

Can you elaborate as to what is happening on the RX inputs that makes this work?
Would a 20k be even better or do I start to affect my serial data at some point?
the 10k resistor is limiting the current that can flow into the cpu.  V=I*R where V=(5v-1.1v), R=10000 so I=3.9/10000 or i= 0.39mA the resistor is dropping 3.9volts.  Turning that power into heat. (heating the resistor with 3.9v*0.39ma or 1.52mW)

In this static mode (unpowered), this 10k resistance is ok.  but depending on what the circuit that is driving the RX pin, and the signal frequency this resistance might 'slur' the serial signal enough such that the UART misses bits.  Whether this 10k is enough cause problems depends on your Baud rate and how powerful your RX drive circuit is.

Chuck.
Currently built mega http server, Now converting it to ESP32.

zoomkat

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

db2db

the 10k resistor is limiting the current that can flow into the cpu.  V=I*R where V=(5v-1.1v), R=10000 so I=3.9/10000 or i= 0.39mA the resistor is dropping 3.9volts. 
Chuck.
When the power is back on, with the 10k inline, I get close to 5v on the RX pin, as desired.
I'm still curious what happens inside that pin that is so different when the chip is powered and not, that this 10k affects this voltage so much.

Also, as I have 5v on RX when MPU is powered, perhaps there is not that slew you spoke of?

jremington

Quote
I'm still curious what happens inside that pin that is so different when the chip is powered and not, that this 10k affects this voltage so much.
See the MPU data sheet for the equivalent circuitry of the input pin.

The pin has an internal clamping diode that shunts current to Vcc, if the input voltage exceeds Vcc + 0.7 V.  For a powered-down MPU, Vcc is 0 V.

Go Up