My device has 2 controllers. When the device is about to shutdown, the main micro-controller sends a power down event signal to SM470 controller on line INT0 (GPIOA[0]). This interrupt will be used to carry out systematic shutdown on SM470. I checked on the scope that this line goes low when this event occurs. So I configured my code to set this as an interrupt to trigger at low level. When I run the test the interrupt never occurs. I configured my code to toggle test pins when this event occurs and I verified that the interrupt never triggers. I have set GIOA as high priority interrupt (FIQ). Please see if my code snippet below is correct. Please advice what I may be missing.
GPIO INITIALIZATION:
// GIO:A0 as INT0 for PWRINT
GIODCLRA |= X0; // Clear pin
GIODIRA &= ~X0; // Set as input
GIOENA1 |= A0; // Enable the interrupt on this pin
GIOPOL1 &= ~A0; // Configure to detect low level
GIOPRY1 &= ~A0; // Set interrupt to low priority
INTERRUPT INITIALIZATION:
REQMASK |= (1 << (int32_t)CIM_GIOA);
FIRQPR = 0x00000020;
INTERRUPT:
__fiq __arm void FIQ_Handler(void)
{
switch ((0xff & FIQIVEC) - 1)
{
case CIM_GIOA :
GIOA_IntHandler();
break;
}
}
Pinakin