1
\$\begingroup\$

My Setup

I have an Arduino Mega connected with my PCB and both boards exchange data using UART TTL @ 57600 baud rate.

Both have their own separate power supplies (5 Volts each; Mega is powered via my laptop USB and the PCB has it's own isolated power supply). I have connected both their grounds along with Tx/Rx pins.

Because of the application requirement, the Mega often restarts the PCB by switching off it's main supply (which is fed via Relay) and then switching it back on after around 5 seconds (making sure all the charge has effectively drained).

Observations

I have noticed that when the Mega cuts off the PCB's supply, the circuit still remains powered (at around 2 volts). I suspect this is because the Tx pin of my Mega supplies sufficient current which keeps my board alive.

The Problem

Now this setup works fine almost 70% of the time. But there are occasions when after the power up, the PCB can no longer communicate via UART (i receive nothing on my Mega's UART port), maybe because the micro-controller isn't reset properly, and it somehow messes up with it's silicon. But i am not sure, this is just a guess.

Anyways, in such cases, i have to manually reset the power supplies of both my circuits after which they work flawlessly.

How can i prevent this? I have tried applying 10K current limiting resistances, but it adds to the propagation delay and ruins the communincaiton (i suspect this is because i am using a high baud rate). I haven't experimented with pull-ups/pull-downs as of yet, but i'll run the tests and post an update tomorrow.

I have tried to find a solution, but i am not sure where exactly to find a solution. This isn't exactly a ground-loop problem. Or is it?

Please suggest.

\$\endgroup\$

2 Answers 2

3
\$\begingroup\$

If the problem is caused by the power through the Tx pin (which is definitely possible), then you can solve it by disabling that pin before powering down. Just configure it as a (digital or analog) input.

\$\endgroup\$
1
  • \$\begingroup\$ Such an elegant and simple solution. It's shameful how complex i was thinking (current limiting resistors, etc.). I tested it over 130 cycles and it hasn't failed even once. Thank You! \$\endgroup\$ Feb 23, 2017 at 12:22
1
\$\begingroup\$

You can use optocouplers for isolation of signal lines. In that case, you do not need to share grounds between AMega and the custom PCB and there will not be an issue of parasitic powering.

\$\endgroup\$
2
  • \$\begingroup\$ Yes this could also be a possible solution, but i suspect it will add to the propagation delay and might cause trouble for high baud rates. i have decided to accept @CL. 's answer because it works with no change in hw. \$\endgroup\$ Feb 23, 2017 at 12:24
  • \$\begingroup\$ 57600 baud rate is not an issue. Good to know that the issue is fixed. \$\endgroup\$
    – nvd
    Feb 23, 2017 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.