Power supply and serial port behavior difference?

I am trying to read and write character through RX1/TX1 ports on mega2560. I downloaded a sketch that read from a terminal (running on a PC to which the RX1/TX1 are connected through a USB port). If I connect the Mega to the PC through the USB port, the output from TX1 (as monitored by Saleae login analyzer) looks fine, I see the characters typed. However, if I power Mega with DC power supply (12V) or even through the USB port, but from a USB wall power supply, the TX output doesn't make any sense. The logic analyzer shows '255' right away. Can someone guess what is going on, or what I need to do so the TX looks okay. It is quite possible that the RX (as seen by Mega) may be in trouble. But I'm not sure how I can get around that either.

  • Thanks,
  • Rao.

the TX output doesn't make any sense. The logic analyzer shows '255' right away.

What does "255" on the logic analyzer equate to? If it is 5v, than that might be expected.

Have you connected ground on the logic analyser to the circuit being measured? Rather vital that…

Someone forgot to connect all the respective grounds together, didn't he?

Well, the problem seems related to the USB-Serial converter. I tried a 3.3v/5v tolerant converter, and the RX/TX from the terminal looks okay even when the power supply isn't coming from the desktop. I'm curious as to why the "tolerant behavior" is needed when the Mega isn't powered from the desktop.