[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Problem with stack
From: |
David Breeze |
Subject: |
Re: [avr-gcc-list] Problem with stack |
Date: |
Tue, 13 Jun 2006 16:41:31 +0100 |
Bjoern,
The following is from the ATmega 128 data sheet.
"When using the SEI instruction to enable interrupts, the instruction following
SEI will be
executed before any pending interrupts, as shown in this example."
Assembly Code Example
sei ; set global interrupt enable
sleep; enter sleep, waiting for interrupt
; note: will enter sleep before any pending
; interrupt(s)
C Code Example
__enable_interrupt(); /* set global interrupt enable */
__sleep(); /* enter sleep, waiting for interrupt */
/* note: will enter sleep before any pending interrupt(s) */
Also when describing RETI
"When the AVR exits from an interrupt, it will always return to the main
program and execute
one more instruction before any pending interrupt is served."
So not totally undocumented.
David
>>> "Haase Bjoern (PT-BEU/EMT)" <address@hidden> 13 June 2006 15:18 >>>
Hi,
For AVR there is an undocumented feature that is present to my best knowledge
on all of the AVR devices
that when enabling IRQs the first IRQ could happen only two instructions after
the "enabling" instruction.
This feature seems to be related to the two-stage pipeline used for the
implementation.
Bjoern.
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
an addressing or transmission error has misdirected
this e-mail, please notify the author by replying to this e-mail. If you are
not the intended recipient you must not use, disclose, copy, print or rely on
this e-mail.
Joy Mining Machinery Limited/P&H Minepro Services aims to prevent the
propagation of viruses, but cannot guarantee that this email is virus free.
You are advised to scan all attachments and open them at your own risk.
Joy Mining Machinery Limited/P&H Minepro Services may monitor outgoing and
incoming e-mails and other telecommunications on its e-mail and
telecommunication systems.
-Privacy - UK-