Yahoo Groups archive

AVR-Chat

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

Message

Re: [AVR-Chat] Re: USART Interrupts

2012-05-18 by Clark Martin

Sent from an iPhone, but is it mine?

On May 18, 2012, at 6:47 AM, "Steven Hodge" <steve@terrafirma.us> wrote:

> This is somewhat of an aside. I just finished porting my USART ISR's from
> mega to xmega. They only use the Receive Complete (RXC) and Transmit
> Complete (TXC) interrupts. I've always been curious as to when one would
> use the "Data Register Empty" (DRE) interrupt. Can somebody give a brief
> reason when and why to use this one? Thanks, Steve
Normally you use the DRE for sending out serial data. This gives you the highest data rate. Using TxC adds a short space between characters. 

In my RS-485 code I use DRE to send the data then TxC to switch the bus transceiver to receive when the packet has been sent. 

One important point is that DRE will generate an interrupt any time the buffer is empty. So you need to disable the DRE interrupt enable bit when you have sent the last byte. Otherwise it will continue to call the service routine. 
> 


[Non-text portions of this message have been removed]

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.