cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop IRQ?

georges_emmanuel
Associate II
Posted on August 11, 2006 at 14:01

How to stop IRQ?

3 REPLIES 3
georges_emmanuel
Associate II
Posted on August 04, 2006 at 06:36

Well,

I'm currently doing some operations in a function and I don't want to be interrupt (I've got 4 sources of IRQ: TIM1(50kHz),TIM2(100kHz to 1,4Hz),TIM3(100kHz to 1,4Hz),ADC12(500Hz)).

I count each line of code, and instead of disable EIC, maybe directly in ARM7 core would be faster.

Thx all.

sjo
Associate II
Posted on August 04, 2006 at 07:35

To turn off the irq in the system add the following functions to an asm file. and call ARMIRQ_Disable() to turn off the irq at system level.

/* Disable the ARM7 core IRQ line */

ARMIRQ_Disable:

MRS r0, CPSR

ORR r0, r0, #I_Bit

MSR CPSR_c, r0

BX lr

/* Disable the ARM7 core FIQ line. */

ARMFIQ_Disable:

MRS r0, CPSR

ORR r0, r0, #F_Bit

MSR CPSR_c, r0

BX lr

/* Enable the ARM7 core IRQ line. */

ARMIRQ_Enable:

MRS r0, CPSR

BIC r0, r0,#I_Bit

MSR CPSR_c, r0

BX lr

/* Enable the ARM7 core FIQ line. */

ARMFIQ_Enable:

MRS r0, CPSR

BIC r0, r0,#F_Bit

MSR CPSR_c, r0

BX lr

These fucntions need to be done from a priveledged mode (not user mode)

The best thing todo is run your program from system mode.

Regards

sjo

georges_emmanuel
Associate II
Posted on August 11, 2006 at 14:01

Thx Sjo, i did it.