[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Problem with stack
From: |
Niklas Lövgren |
Subject: |
RE: [avr-gcc-list] Problem with stack |
Date: |
Tue, 13 Jun 2006 18:21:41 +0200 |
Un the other hand this talks about using sei. In the example given the whole
register is restored manually. I guess then it might be in effect
immediately!?
/niklo
-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of David
Breeze
Sent: den 13 juni 2006 17:42
To: address@hidden; address@hidden
Subject: Re: [avr-gcc-list] Problem with stack
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-
_______________________________________________
AVR-GCC-list mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list