[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: Re: USART - Interrupt - problem -Similar (SOLVED)
From: |
Matthew Arcus |
Subject: |
Re: [avr-gcc-list] Re: Re: USART - Interrupt - problem -Similar (SOLVED) |
Date: |
Mon, 24 May 2004 23:25:32 +0100 |
On Monday 24 May 2004 7:53 pm, Steve wrote:
> Matthew,
>
> I followed your advise and now have the transmit complete interrupt
> firing constantly.
Jolly good (I assume "constantly" means no more often than it should).
>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
> }
It's a really good idea to use the _BV macro and the predefined bits for this
sort of thing (and it's probably not a good idea to set all the bits, you
would be better off using a mask) ie:
UCR &= ~_BV(UDRIE);
It's clearer, and also not all AVRs have the same bits in the same places.
Cheers,
Matthew.