Electronic – uart TTL problem

ttluart

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.

Best Answer

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.