September 29, 2014 at 6:56 pm #3278bilal ahmedParticipant
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 #12242AJISH ALFREDParticipant
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 #12243bilal ahmedParticipant
yeah I know it, I am using a max232 circuit and its transmitting garbage dataOctober 1, 2014 at 6:40 am #12249AJISH ALFREDParticipant
Alright, please post the circuit diagram and the snapshot of your hardware connections.October 2, 2014 at 5:58 am #12254
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 firstOctober 7, 2014 at 5:31 am #12266himanshu mittalParticipant
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
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 #12271himanshu mittalParticipant
using tera term and a serial terminal software but both has same problemOctober 13, 2014 at 6:25 pm #12281
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 #12818T KandeParticipant
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
- You must be logged in to reply to this topic.