[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] FAQ #27: "Why are interrupts re-enabled in the middle of
From: |
Bob Paddock |
Subject: |
[avr-libc-dev] FAQ #27: "Why are interrupts re-enabled in the middle of writing the stack pointer?" |
Date: |
Tue, 15 May 2007 11:20:37 -0400 |
User-agent: |
Opera Mail/9.10 (Win32) |
I have a question about AVR-LIBC FAQ #27:
http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_spman
"Why are interrupts re-enabled in the middle of writing the stack pointer?"
I understand that when the SEI instruction is used,
"The instruction following SEI will be executed before any pending
interrupts".
I'm fine with that. So using out __SP_H_,r29 SEI, out __SP_L_,r28 would
always be safe. Might not be what you wanted if interrupts where off.
However I have missed any Atmel documentation that says a 'out' to SREG
applies that same protection? Does that mean all 'out' instructions
delay pending interrupts, or just 'out' instructions to SREG?
What document did I miss reading?
in __tmp_reg__,__SREG__
cli
out __SP_H__,r29
out __SREG__,__tmp_reg__
out __SP_L__,r28
- [avr-libc-dev] FAQ #27: "Why are interrupts re-enabled in the middle of writing the stack pointer?",
Bob Paddock <=