Hello my friends,
I am trying to configure the pins A2 and A3 to generate interruption so that I can count events (pull down) in both pins. I am using the UART at Pins A0 and A1 and it's working perfectly.
Bellow follows the code I am using:
#define SENSOR_T2M_PORT GPIO_PORTA_BASE
#define SENSOR_T2M GPIO_PIN_3
#define SENSOR_M2T_PORT GPIO_PORTA_BASE
#define SENSOR_M2T GPIO_PIN_2
void InitSensorPins(void)
{
GPIOIntRegister(SENSOR_T2M_PORT, SensorIntHandler);
GPIOIntRegister(SENSOR_M2T_PORT, SensorIntHandler);
GPIOPinTypeGPIOInput(SENSOR_T2M_PORT, SENSOR_T2M);
GPIOPinTypeGPIOInput(SENSOR_M2T_PORT, SENSOR_M2T);
GPIOIntTypeSet(SENSOR_T2M_PORT, SENSOR_T2M, GPIO_FALLING_EDGE);
GPIOIntTypeSet(SENSOR_M2T_PORT, SENSOR_M2T, GPIO_FALLING_EDGE);
GPIOPadConfigSet(SENSOR_T2M_PORT, SENSOR_T2M, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOPadConfigSet(SENSOR_M2T_PORT, SENSOR_M2T, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
GPIOIntEnable(SENSOR_T2M_PORT, SENSOR_T2M);
GPIOIntEnable(SENSOR_M2T_PORT, SENSOR_M2T);
}
The interruption at pin A3 works but the A2 doesn't.
I already did the same code using the kit buttons (SW1 (pin F4) and SW2 (pin F0) ) and only the F4 pin worked.
I have seen some "unlocking" piece of code in the forum but sincerely I do not understand if I need to use it or not and if I need, how should I code it.
Thank you in advance,
Regards,
Eduardo