AnsweredAssumed Answered

How can I clear the status bit when I got into an interrupt?

Question asked by nigong on Oct 24, 2011
Latest reply on Oct 25, 2011 by Nabeel

Hi all,


When I press PF8 button, I want the blackfin goes into a ISR and the counter increases 1.

I should clear or set a bit which indicates the processor has entered the ISR, but I don't know how to clear it.


Here is my code:

#include<sys\exception.h> // needed for interrupts
// prototype

volatile int count = 0;
void main(void)
     // Register FlagA ISR to interrupt vector group 12
     register_handler(ik_ivg12, FlagA_ISR);
     // set direction of programmable flag PF8 to input
     *pFIO_DIR &= ~PF8;
     // interrupt enable PF8
     *pFIO_INEN |= PF8;
     // give interrupt when FIO_FLAG_D PF8 changes
     *pFIO_MASKA_D |= PF8;
     // Bind FlagA interrupt to IVG12
     *pSIC_IAR2 |= 0x00005000; // flag A IVG12
     // Enable PFA in system interrupt mask register
     *pSIC_IMASK = 0x00080000;
     // enable IVG12 in core interrupt mask register
     *pIMASK |= 0x00001000;
     // wait for interrupt
     while(count < 5);
        printf("5 interrupts received");
     // Needed to clear or set a bit to indicate that the processor has entered the ISR

BTW, my processor is BF533.