Skip to main content
Visitor II
August 11, 2006
Question

How to stop IRQ?

  • August 11, 2006
  • 3 replies
  • 1017 views
Posted on August 11, 2006 at 14:01

How to stop IRQ?

    This topic has been closed for replies.

    3 replies

    Visitor II
    August 4, 2006
    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.

    Visitor II
    August 4, 2006
    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

    Visitor II
    August 11, 2006
    Posted on August 11, 2006 at 14:01

    Thx Sjo, i did it.