[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Sought: interrupt-driven buffered UART sender
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] Sought: interrupt-driven buffered UART sender |
Date: |
Wed, 24 Oct 2001 11:27:40 +0200 (MET DST) |
"Ron Kreymborg" <address@hidden> wrote:
> Below and attached a Uart send routine I use quite a lot.
Thanks for following up to this!
(Btw., Rich's code looks fine, i'll test it and send him my remarks.
He intents to make it freely available.)
> //-------------------------------------------------------------------
> // Signal handler for uart txd ready interrupt.
> //
> SIGNAL(SIG_UART_TRANS)
Does SIG_UART_TRANS make sense? According to the AVR documentation,
it'll only be signalled once all characters have left the transmitter.
Normally, I'd use SIG_UART_DATA instead (which gets signalled once
there's room in the data holding register, i. e. the current byte is
still in the Tx shift register). However, handling UDRE interrupts is
a bit messy (the interrupt gets only cleared by writing to UDR, so
once all has been written, you need to turn that interrupt off again
completely since you can't write anything else to UDR), so i didn't
get my version to work at first.
Rich's code apparently does it that way. He did some things a bit
differently than my initial version, maybe that's the reason why it
works. ;-)
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/