1
\$\begingroup\$

I have been having issues with my AVR USART. Using a PL2303 USB adapter with the following connections to the AVR

enter image description here

What I am seeing is

Garbage data (mostly of 0xFF or 0xF7 or 0xE7) even when the circuit is turned off (output below in HEX)

FF FF 7F 7F FF FF FF FF F7 F7 77 F7 FF 76 F6 FF F6 B7 FF FF E7 77 7F
FF EE FF FF 76 FF F7 F7 FF FB F7 FF FF FF F7 77 37 F7 77 FF 77 F7 FF
FF FF F7 FF FF EF F7 7F 7F 77 77 FF 77 FF 77 F7 7F 6F FF FE FF 7F F3
E7 FE E7 FF 77 FF 9F DF 94 EE FF FF EB BF FF 27 DA FF B7 FF FF 7F 6C
B9 FF 6F 6F 7F FF FE EF DB FF FE BF 74 FF F6 F7 F7 FF DE FB FF BF BF
B7 3F B4 FB 7F 6F 7F

When the circuit is on, this garbage data is interleaved with my regular output (below in ASCII to show my regular output interleaved with garbage)

Pro?yv2?[?o?[???rrent Time &n?m????????{??10:47:33
1/1/9???????????{3y 'm' &
'?'`???????????v<6>6{kk<11>s#?<3>????ow????o?????f<6>6{kk<11>s#?<3>??k??????????<27>?<3>accepted
??????????????n<22><27><27>+??+#`

This happens randomly. Somedays it would happen, then go away on its own and then come back again.

I am using 16 Mhz crystal. Baud rate 38400, Data 2, Parity None. USART mode asynchronous

\$\endgroup\$
11
  • \$\begingroup\$ Could you replace the screenshots with the actual text that is on screen? The images are hard to read and use more screen real-estate than necessary. There must be a way to copy the text. \$\endgroup\$
    – jippie
    Commented Jul 9, 2014 at 5:52
  • \$\begingroup\$ What baudrate are you using? What UART clock mode are you using, ×16 or ×4? Are you using internal resonator or a crystal? \$\endgroup\$
    – jippie
    Commented Jul 9, 2014 at 5:54
  • \$\begingroup\$ @jippie images replaced with text & required USART information added \$\endgroup\$
    – Ankit
    Commented Jul 9, 2014 at 6:08
  • 1
    \$\begingroup\$ Is the ATMega328's ground connected to the PL2303 ground? You need that connection to provide a reference for the data lines. \$\endgroup\$ Commented Jul 9, 2014 at 6:38
  • 1
    \$\begingroup\$ @PeterBennett. Yes it is. I overlooked it while drawing the circuit. circuit image updated \$\endgroup\$
    – Ankit
    Commented Jul 9, 2014 at 6:49

1 Answer 1

0
\$\begingroup\$

Is the ATMega328's ground connected to the PL2303 ground? You need that connection to provide a reference for the data lines.

\$\endgroup\$
1
  • \$\begingroup\$ The original drawing did not show a ground connection between the ATMega and PL2303. The OP added the ground connection in the drawing, and found a loose wire in his circuit. Read all the comments on the original question. \$\endgroup\$ Commented Jul 9, 2014 at 17:44

Your Answer

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

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