Hi.
How can I simply disable interrupts (IRQ) on my ATSAM7X application? I simply want to prevent some critical HW-timing from beeing interrupted by "other stuff". Something like: ... disable_irq(); "PA1=0" // set 0 to a port "do some time-consuming instruction to ensure a fixed duration" "PA1=1" // set 1 to the port enable_irq()
I tried to include "core_cm3.h" and use NVIC_DisableIRQ(1), but it gave me 30 ERRORS and messages like "...error: #1114: this feature not supported on target architecture/processor".
How can I simply disable/enable IRQ's for my SAM7X (which C-procedures to use)? I'll appreciate comments to this isse.
Best Regards Terje Bohler
On a different route - any possibility of using a SPI device for your task, so you just give the SPI device a suitable sequence of bits to send at a pre-defined baudrate and then let your software do something else while the hardware plays the pattern on a processor pin? Then you don't affect your interrupt response times.
Thanks Per.
Yes, I guess that's another way. And I'm sure we can use TC or PWM also. I need exactly XX pulses of YY uSec undisrupted. I haven't used SPI earlier and (the rest of) my application doesn't care for a 1 mSec interrupt response delay, so I thought this primitive way would "do the job" (good enough).
Is there a "disable_irq()" and "enable_irq()" or similar supported ?
ARM7 != Cortex-M3 (cm3), a thus isn't going to have an NVIC
static __inline unsigned long disable_irq(void) { register unsigned long ret, rx; __asm { mrs ret, CPSR; orr rx, ret, #0x80; msr CPSR_c, rx } return ret; } static __inline unsigned long enable_irq(void) { register unsigned long ret, rx; __asm { mrs ret, CPSR; bic rx, ret, #0x80; msr CPSR_c, rx } return ret; }
Thanks again Pier.
It compiles OK, and the compiler does not give any Warnings either. But, a "yellow warning triangle" is shown to the left of the "__asm" statement in the C-code-window, and when my mouse hovers over it, the following text is shown: "warning: MS-style inline assembly is not supported".
Hmmm... It sounds spooky... Should I simply disregard this message? Do you know what it means?