What are some of reasons that PC terminal receives garbage characters from one microcontroller?

I am using BeagleBone and UART works okay, but after few transmitted command characters from PC terminal to microcontroller, PC terminal starts to receive weird characters while I am trying to send those char commands? What can be the problem?

UART won't work properly for some time, but after few minutes it starts again to work and respond to char commands.

Bauds are same on both sides.

UART acts the same on every PC terminal software.


Common issues that came immediately to mind:

  1. Ground connection: you need a shared ground to get a usable communication, this gives very weird issues like the ones you describe
  2. Unstable clock on either side: as UART has no clock sharing mechanism the clock must be fairly well defined and may not drift much. If you are running from an internal RC oscillator this might be a problem. Better use a resonator or oscillator.
  3. Wrong signal levels: Make sure both sides are working with the same signal levels and you are not trying to feed a TTL signal to a RS232 port.
  4. Polarity setting: define inactive high/low on both sides the same (normally you won't get anything useful if this is wrong)
  5. Correct communication parameters otherwise: baudrate, number of bits, parity, number of stopbits, flowcontrol
  6. RX / TX mixed up: Often the signals are called RX and TX for receive and transmit. It also often happens to just connect RX to RX, but it should be RX to TX (receive on one end is transmit on the other) (can also happen the other way round, depending on how people look at it, it's a mess)
  • \$\begingroup\$ 3. is unlikely to be consistent (works for the first few then fails) 4. is not applicable 5. is not applicable (a small baud rate difference could cause this but the parameters allowed are always at least 2x off so this would not cause issues as described) 6. is not applicable \$\endgroup\$
    – Sam
    Sep 3 '15 at 16:25
  • \$\begingroup\$ @Sam well yes, this is not all applicable to the phenomenon as described by Junior, but as the title states "Common Serial Port Issues", I thought I also list common serial port issues, because some other people with some other problem might visit this page and get a useful hint as well without asking another question. \$\endgroup\$
    – Arsenal
    Sep 3 '15 at 20:43
  • \$\begingroup\$ How is Junior or any other future person supposed to know that? \$\endgroup\$
    – Sam
    Sep 4 '15 at 3:02
  • \$\begingroup\$ @Sam I hoped that "Common issues are:" in my first sentence would act as a hint to that fact. Also as most of the points are fairly simple to check and go through it's easy to dispose of some of them as not applicable. I expect that people on EE.SE are able to think about their problems. Fun fact: I ordered my list to have the two most probable causes (in my thinking) for Junior at the top. \$\endgroup\$
    – Arsenal
    Sep 4 '15 at 6:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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