[Top][All Lists]

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

Re: [avr-gcc-list] Preemptable Interrupts

From: Volkmar Dierkes
Subject: Re: [avr-gcc-list] Preemptable Interrupts
Date: Thu, 20 Feb 2003 08:33:51 +0100
User-agent: 40tude_Dialog/ Hamster/


On Thu, 20 Feb 2003 16:25:04 +1100, Grahame Kelly wrote:

> Hi Steve.
>>> I'm trying to figure out how to make the SIG_UART_DATA and SIG_UART_RECV
>>> signals preemptable.  I've got another interrupt that I want interrupt
>>> the UART interrupts if it comes along.  I've also got other lower
>>> priority interrupts that I don't want interrupting the UART interrupts.
> Looking at your sample program, you don't have to disable lower priority
> interrrupts as this is done automatically in hardware on AVR's. Take the
> M16 chip for example. 
> IntR    Function
> 0...3
> 4        Timer2 COMP
> 5        Timer2 OVF
> 6 ... 11
> 12   -  UART Rx Complete
> 13   -  UART - DATA
> 14   -  UART Tx Complete
> 15 ... 
> Interrupts 0 ... 12 have higher priority over UART-DATA.

The priority is only important if there are more than 1 interrupts 
pending at the same time.

> So, you don't have to disable any thing about #12 as they are 
> automatically disabled by AVR internal h/w untill the AVR UART DATA
> ISR returns. So, according to your code snippet you should only have to
> disable the Timer2 interrupt.

This behavior depends on the clearing of the interrupt flag. After 
writing data to the transmit buffer the interrupt flag for 
SIG_UART_DATA is cleared and from this time on it is possible that 
other lower priority interrupts will break the actual one.

>     /* do stuff here, (minimal amount of code, of course) */

if you are using minimal amount of code, maybe your code to disable 
some of the interrupt sources may take more or similiar amount of 
code than your ISR?


reply via email to

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