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

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

Re: [avr-gcc-list] timer interrupt service routine


From: J Wunsch
Subject: Re: [avr-gcc-list] timer interrupt service routine
Date: Wed, 2 May 2001 17:17:35 +0200 (MET DST)

Jamie Morken <address@hidden> writes:

> What happens when you execute code in a timer ISR which is called
> every 1/3600th of a second and the code in the ISR takes longer than
> 1/3600th of a second?

It depends on how your interrupt service is being organized.

Have a look at the description of interrupt services in the Atmel
docs.  Normally, when entering an ISR, the hardware disables further
interrupts, and eventually re-enables them when executing the RETI
instruction.  If you don't change this, you'll simply lose interrupts
(which is not all that good since your program's idea of time will be
wrong, but it's not fatal).

However, you can manually enable nested interrupts by setting the
I-bit in SREG.  In that case, you IMHO need to make sure that your
ISRs do not nest, otherwise you'll eventually hit a stack rollover.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)



reply via email to

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