EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / UART communication problem

UART communication problem

|

Microcontroller › AVR › UART communication problem

  • This topic has 9 replies, 5 voices, and was last updated 10 years, 9 months ago by T Kande.
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • September 29, 2014 at 6:56 pm #3278
    bilal ahmed
    Participant

    I have programmed the atmega16 to recive data serially and diaply it on LCD and perform the respective operations, but it shows the garbage/wrong characters on LCD if i send the data from hyperterminal/proteus and if i send the data from the serial port of an other atmega16 it works fine. so simply the code is correct but PC com port is not correctly communicating. any idea??

    using internal clock @ 4 MHz.

    September 30, 2014 at 4:31 am #12242
    AJISH ALFRED
    Participant

    Hi,

    The PC serial port uses RS232 standard whereas the microcontroller uses TTL standard. You mentiioned that you were able to communicate between two atmega, you can since they are using the same TTL standard. Inorder to make the microcontroller communicate with a PC port you need a MAX232 converter IC inbetween the PC port and the microcontroller.

    September 30, 2014 at 2:29 pm #12243
    bilal ahmed
    Participant

    yeah I know it, I am using a max232 circuit and its transmitting garbage data :/

    October 1, 2014 at 6:40 am #12249
    AJISH ALFRED
    Participant

    Alright, please post the circuit diagram and the snapshot of your hardware connections.

    October 2, 2014 at 5:58 am #12254
    Ashutosh Bhatt
    Participant

    for communicating with PC is is required to set exactly same baud rate at both ends. I think using 4 MHz crystal it wont be possible to generate standard baud rate of 4800 bps or 9600 bps. first calculate required crystal value from 9600 bps baud rate and then use that crysal.

    one more thing is whatever you will get from PC will be HEX data. to display it on LCD you have to convert it into ASCII first

    October 7, 2014 at 5:31 am #12266
    himanshu mittal
    Participant

    the  same problem i am getting using atmega16 16 mhz crystal. Baudrate, max232 everything is fine . when i transmit data from microcontroller it works fine but when i transmit data from pc to microcontroller it shows garbage value. i can’t understand what is the problem.

    October 8, 2014 at 6:19 pm #12268
    Ashutosh Bhatt
    Participant

    in two AVR micro controller you will not get any problem in sending or receiving data because you have to set same crystal and same UBRR value thats it. 

    but when one end is computer matching baud rate is an issue. 

    how are you sending data from PC? through hyper terminal? flash magic? putty? 

    October 9, 2014 at 4:55 am #12271
    himanshu mittal
    Participant

    using tera term and a serial terminal software but both  has same problem

    October 13, 2014 at 6:25 pm #12281
    Ashutosh Bhatt
    Participant

    have you written the subroutine or any function to convert the HEX data available from serial port of computer into ASCII?

    April 23, 2015 at 8:03 am #12818
    T Kande
    Participant

    i am also having the same problem. i am reading 2 adc value from my atmega32 and send them serially via ftdi chip to GUI in vb. On the GUI im receiving the exact values since i have also an lcd displaying the values. The problem im having is receiving values on the atmega from the GUI, im getting garbage data instead of values and im failing to come up with the function to convert into actual integer values. Your help wil be appreciated

  • Author
    Posts
Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • Buffer design? February 9, 2026
  • BPF February 9, 2026
  • To couple or decouple February 9, 2026
  • ANOTHER OLD PROJECT REDO February 9, 2026
  • Op amp shock February 9, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise