Hello A T,
You also need configure the interrupt of the pin use the "PORTx_PCRn" register.

Also configure the pin to GPIO function, enable the related interrupt.
For example : set PTA19 for GPIO interrupt when the pin is logic zero
SIM_SCGC5 = SIM_SCGC5_PORTA_MASK;
PORTA_PCR19=PORT_PCR_MUX(1)|PORT_PCR_IRQC(0x08)|PORT_PCR_PE_MASK|PORT_PCR_PS_MASK;
enable_irq(87); //GPIOA Vector is 103. IRQ# is 103-16=87
/////////////////////////////////////////////////////////////////////////////
void enable_irq (int irq)
{
int div;
/* Make sure that the IRQ is an allowable number. Right now up to 91 is
* used.
*/
/* Determine which of the NVICISERs corresponds to the irq */
div = irq/32;
switch (div)
{
case 0x0:
NVICICPR0 = 1 << (irq%32);
NVICISER0 = 1 << (irq%32);
break;
case 0x1:
NVICICPR1 = 1 << (irq%32);
NVICISER1 = 1 << (irq%32);
break;
case 0x2:
NVICICPR2 = 1 << (irq%32);
NVICISER2 = 1 << (irq%32);
break;
}
}
////////////////////////////////////
then when you set the pta10 to zero , it will enter interrupt function.
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------