Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Atmega2560 problem with UART communication

Status
Not open for further replies.

Thiliniv

Junior Member level 3
Joined
Nov 20, 2009
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,458
I wrote a code for communication with Atmega2560 and a PC. My program is when the microcontroller ransmit a character
(say 65) it should be read using hyperterminal.

But in hyperterminal i just get some garbage characters. pls help me.
 

well the thing is you should transfer ascii values , but when you transmit 65 from controller you actually transmit 65 in hex , but the hyperterminal reads it as ascii and prints the ascii charater for it , another problem may be of improper baud rate ...
 

Hey Thiliniv... I will help you step by step. :)

step 1:

In this eksampel i will use the my own Atmega2560 development board - with a 16 MHZ crystal... i I hope That this will help you :)

IMAG0036.jpg
(THIS IS MY AVR DEVELOPMENTBOARD WITH THE ATMEGA2560 plucked in )


ljhgfv.PNG
(THIS MUST BE WHAT YOU GET WHEN YOU ARE USING UART... RIGHT ;) )


The reason why you get garbage characters is the internal-clock :/ we have to change it :)


Udklip.PNG
(IN THIS PIC YOU CAN SEE THE ATMEGA2560 DEFAULT INTERNAL-CLOCK SETTINGS)

Step 2:

Now we are going to change the Internal-clock on the Atmega2560 :)
Im using AVR studio 4 :)

like this.PNG
( CHANGE IT TO what you can see on the pic :) )

Step 3:

And after you have done that :)

Now it works.PNG
(AND NOW IS SHOULD ALL WORK FINE)

Hope this helped :)
Rune Hansen
 
RuneHansen,

What you are telling is also correct , i think. Thanx for replying.

I solved the problem by unticking the "CKDIV8" fuse bit. I was using the internal oscillator of the micro controller which is 8MHz. When "CKDIV8" is programmed it is divided by 8. But when i untik it i culd get 8MHz again.
 

Good to hear :) if u have any other problems with the atmega2560.. just ask :)

---------- Post added at 17:40 ---------- Previous post was at 17:38 ----------

And take a look at my profile. in my album i have some pic of my new atmega2560 developmentboard if your are interestet?
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top