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.

Help in atmega16 and USART

Status
Not open for further replies.

etherios

Member level 4
Joined
Nov 19, 2003
Messages
73
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Where eagles dare
Activity points
748
usart atmega16

Ok i am using a STK500 with an atmega16 and for debugging a JTAGICE mkII. I use assembly language.

I have observed the following
a. I cannot see the content of baud rate registers (UBRRH+UBRRL). It seems to be empty.
b. I have to re-initialise the UBRR every time i have to write a byte to USART. To be more precise i have to write the following code

LOOP:
ldi r16,0x00
out UBRRH,r16
ldi r16,0x19
out UBRRL,r16
out UDR,r17
jmp LOOP

and not

ldi r16,0x00
out UBRRH,r16
ldi r16,0x19
out UBRRL,r16
LOOP:
out UDR,r17
jmp LOOP
which seems more reasonable
anyone has an idea what is going on? I am using the 4MHZ internal clock
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top