In my project, I use a atmega16 to send data to PC via USB to TTL converter at baud rate of 9600 and internal RC of 4Mhz. If I power the atmega16 using my laptop through a usb cable I can receive the data perfectly, but when I power the same using a 9v DC battery and 7805 regulator, I get garbage value on the PC. Please help me out.
1 Answer
\$\begingroup\$
\$\endgroup\$
2
You must connect Rx, Tx and ground.
When you supply power from USB then they both PC and mcu operate on a common ground, when you use a battery that ground connection between mcu and PC doesn't exist.
Connect the grounds of USB and battery(-pole) and it should get fixed.
-
\$\begingroup\$ Can you please suggest some ideas to fix it, i'm just a beginner in electronics \$\endgroup\$– sp39Commented Mar 2, 2014 at 16:54
-
\$\begingroup\$ @sp39 Have you connected the ground of AVR supply with the ground of the TTL to USB converter? That is what I think is the cause of the problem, you are missing that connection. \$\endgroup\$– alexan_eCommented Mar 2, 2014 at 17:05