avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-gcc-list] Re: Re: USART - Interrupt - problem -Similar (SOLVED)


From: Steve
Subject: [avr-gcc-list] Re: Re: USART - Interrupt - problem -Similar (SOLVED)
Date: Mon, 24 May 2004 20:53:31 +0200

Matthew,

I followed your advise and now have the transmit complete interrupt
firing constantly. Just quickly incase it helps someone else; I changed
the interrupt code to the following:

/*UDRE data register empty*/
SIGNAL(SIG_UART_DATA)
{
        UCR = 0xD8; //disable this int
}

/*REC char has been received*/
SIGNAL(SIG_UART_RECV)
{
        /*PORTC ^=0x01;*/
        a = UDR;
}

/*TXC transmit complete*/
SIGNAL(SIG_UART_TRANS)
{
        PORTC ^=0x01;
}

In the main routine, I send one char. When this char is sent from the
data reg, the UDRE interrupt fires. I disable this in the interrupt and
then when a char is sent every time, the TXC interrupt fires.

In an application I would tend to use the UDRE interrupt in order to
feed more chars out on the serial line and probably would not enable the
TXC interrupt but I wanted to understand when and how the interrupts
which relate to the UART occur.

Thanks!

Steve
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.689 / Virus Database: 450 - Release Date: 21.05.2004
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]