AnsweredAssumed Answered

External Interrupt - GPIO

Question asked by Lightseek on Feb 12, 2014
Latest reply on Feb 12, 2014 by PatrickN

DioCfg(pADI_GP2, 0);                          //config all bits in port2 to be digital I/O

DioOen(pADI_GP2, 0x2);                     //config all bits in port 2 to be inputs except bit 1, which is an output

EiCfg(EXTINT0,INT_EN,INT_RISE);      //Enable External Interrupt 0 to trigger at rising edge               

NVIC_EnableIRQ(EINT0_IRQn);           //Enable External Interrupt 0 

 

DioSet(pADI_GP2, 0x2); 

//Pull high port2 bit 1, which is HARD WIRED into port2 bit 0. I would suspect that when the line of code "DioSet(pADI_GP2, 0x2)"

//is executed, Ext_Int0_Handler (), should be called, but it does not. Why?

//Does external interrupt 0 correspond to any bit 0 in ANY port? (i.e. port0.0, port1.0 and port2.0)?

 

//...

 

void Ext_Int0_Handler ()

{   

          EiClr(EXTINT0);            

}

Outcomes