Yahoo Groups archive

AVR-Chat

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

Thread

Re: [AVR-Chat] Digest Number 985

Re: [AVR-Chat] Digest Number 985

2005-03-28 by al boehnlein

I am working on a control application that reads
quadrature readings from an encoder.  I seem to
missing some counts.  I am wondering what happens to
the interrupts when you are in the "SIGNAL(SIG_LCD)"
ISR routine?  I assume  they are turned off, but I am
wondering if an interrupt occurs while in the routine,
is it saved and executed latter, upon exit?

The documentation is not clear to me, as to what
happens if I get an interrupt on my quadrature sensors
while I am in the LCD ISR.  

Also, can I use cli(); and  sei(); instructions
without fear of missing an interrupt?  I need to read
every quadrature interrupt, although I can wait until
another ISR finishes.

My max interrupt rate is probably around 2000/sec or �
millisecond.

I am using the AVR butterfly.

What approach do you recommend?

Thanks

Al
 

Bit 7 � I: Global Interrupt Enable

The Global Interrupt Enable bit must be set for the
interrupts to be enabled. The individual interrupt
enable control is then performed in separate control
registers. If the Global Interrupt Enable Register is
cleared, none of the interrupts are enabled
independent of the individual interrupt enable
settings. The I-bit is cleared by hardware after an
interrupt has occurred, and is set by the RETI
instruction to enable subsequent interrupts. The Ibit
can also be set and cleared by the application with
the SEI and CLI instructions, as described in the
instruction set reference.

Re: [AVR-Chat] Digest Number 985

2005-03-28 by Richard Reeves

> I assume  they are turned off, but I am
> wondering if an interrupt occurs while in the routine,
> is it saved and executed latter, upon exit?
Yes, the interrupt flags are set while you're in an ISR, and executed 
in the order that they appear in the interrupt vector table once the 
MCU is able to.



Richard

---
"Iz dana u dan ona dolazi i odlazi u talasima"
   http://www.van-gogh.co.yu/

RE: [AVR-Chat] Digest Number 985

2005-03-28 by Larry Barello

However, if two or more occur (of the same vector) you will lose
information.  With quadrature you need to insure your interrupt latency
(i.e. duration that interrupts are disabled) is less than your minimum time
between quadrature interrupts.  2000/sec is very slow, however.  I routinely
work with 40-100k/sec on an 8mhz mega16 processor.  It isn't easy, but it
can be done.

Cheers!
Show quoted textHide quoted text
-----Original Message-----
From: Richard Reeves

> I assume  they are turned off, but I am
> wondering if an interrupt occurs while in the routine,
> is it saved and executed latter, upon exit?
Yes, the interrupt flags are set while you're in an ISR, and executed
in the order that they appear in the interrupt vector table once the
MCU is able to.

Re: [AVR-Chat] Digest Number 985

2005-03-28 by Mark Jordan

On 28 Mar 2005 at 20:14, Richard Reeves wrote:

> Yes, the interrupt flags are set while you're in an ISR, and executed 
> in the order that they appear in the interrupt vector table once the 
> MCU is able to.
> 
	Even if they occur out of that order?  

	Mark Jordan

Re: [AVR-Chat] Digest Number 985

2005-03-29 by David Kelly

On Mon, Mar 28, 2005 at 08:47:18PM -0300, Mark Jordan wrote:
> 
> On 28 Mar 2005 at 20:14, Richard Reeves wrote:
> 
> > Yes, the interrupt flags are set while you're in an ISR, and executed 
> > in the order that they appear in the interrupt vector table once the 
> > MCU is able to.
> > 
> 	Even if they occur out of that order?  

Another way to look at it is that there isn't anything to queue the
order pending IRQ's arrived. So once the CPU is freed to service IRQs
its hardwired logic simply dispatches the highest priority pending IRQ.

-- 
David Kelly N4HHE, dkelly@HiWAAY.net
========================================================================
Whom computers would destroy, they must first drive mad.

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.