Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

mega16 UBRRH/UCSRC

2004-04-09 by Dan

Hello,

I'm trying to write a program that implements the UART on my ATmega16 
and allow it to communicate with my PC.  In configuring the two 
registers UBRRH and UCSRC, I have run into difficulty.  I understand 
that these two registers share the same address space and that the 
first bit determines which register is written to.  However, when I 
run the simulator in AVRStudio 4, both registers are written no 
matter what that bit is.  Here is the code snippet and what happens 
in comments:

ldi temp, 0b10001100
out UCSRC, temp     ;UBRRH = xxxx1100, UCSRC = 10001100
ldi temp, 0b00000000
out UBRRH, temp     ;UBRRH = xxxx0000, UCSRC = 00000000

Is this just an issue with the simulator in AVRStudio or am I really 
making a mistake somewhere?  I do not have an STK500 because I'm in 
college (read: poor), so I have no way of knowing what the AVR is 
really doing.

Any help is greatly appreciated.
Thanks,

~Dan

P.S. - is there a way to directly input text in Hyperterminal?  What 
are some Hyperterminal alternatives?

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.