[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] UART transmitting problem
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] UART transmitting problem |
Date: |
Fri, 28 Nov 2003 00:16:33 +0100 (MET) |
[Sorry for the empty mail, operator error]
As Bob Paddock <address@hidden> wrote:
>> #define UART_BAUD_SELECT (F_CPU/(UART_BAUD_RATE*16l)-1)
>Always check to see what is really being generated by that type of formula.
The compiled assembler code says 25, which is the expected value.
>Are you sure that UDRE will be set BEFORE you send the first char?
Yes, the datasheet says so. It's pretty common to spin on that bit in
an UART send routine. If this bit is set, it means the Tx buffer is
empty, regardless of whether it is empty after a reset, or after a
previous transfer.
>I've been bitten by a problem like that recently. The UART Shift Register
>empty bit comes up zero from reset, not set like you would want.
You mean the TXC bit? That's different. However, it's normally not
needed at all, since you don't have to wait until the Tx has shifted
out all bits before loading the next character.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/
Re: [avr-gcc-list] UART transmitting problem, Anderas Strodl, 2003/11/28