GPIO External Interrupt falling edge

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GPIO External Interrupt falling edge

1,181 Views
k_sunilgupta
Contributor II

Hey all,

 

is there any example code for external interrupt (falling edge) in LPC54606J512BD100 micro-controller.

If any one have the reference then please let me know, i tried but did not found the example code for this.

 

@nxp @xiangjun_rong @nxp_敢爷 

0 Kudos
5 Replies

1,176 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Yes, there is PINT example, which is loicated in driver_example->PINT->pint_pin_interrupt as the following screenshot.

Hope it can help you

BR

XiangJun Rong

 

xiangjun_rong_0-1655377224098.png

 

0 Kudos

1,165 Views
k_sunilgupta
Contributor II

i have run the program as you suggest and its working properly,

and i convert it on register level which also working fine but when i use to check the status of external interrupt is not working and when i use its API function its working fine.

could you please tell me where i am wrong?

here is my code:- External interrupt 0 rising edge

SYSCON->AHBCLKCTRL[0] |= 0x00000800;
SYSCON->AHBCLKCTRL[0] |= 0x00004000; // GPIO0

INPUTMUX->PINTSEL[0] = 0x06; // P0_6

SYSCON->AHBCLKCTRL[0] |= 0x00040000;

PINT->ISEL = 0x00; // edge mode
PINT->SIENR |= 0x01; // rising mode
NVIC->ISER[0] |= 0x00000010; // pin interrupt 0 enable

when i use below API function with above function its working fine

void pint_intr_callback(pint_pin_int_t pintr, uint32_t pmatch_status)
{
flagStatus = true;
//PRINTF("\f\r\nPINT Pin Interrupt %d event detected.", pintr);
}

 

and when i am using my function its not working

 

void Rising_edge(void)
{
if(PINT->IST & 0x01)   // check status
{
PINT->RISE |= 0x01;  // clear rising flag
flagStatus = true;

}
}

0 Kudos

1,147 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Frankly speaking, I do not know your current problem clearly.

As you know that the callback function is called in ISR, so you have to enable interrupt mode, after the ISR is entered, then the callback function is called.

Regarding your function:

void Rising_edge(void)
{
if(PINT->IST & 0x01)   // check status
{
PINT->RISE |= 0x01;  // clear rising flag
flagStatus = true;

}
}

I suppose you want to clear the status falg. Pls try to use the code:

void Rising_edge(void)
{
if(PINT->IST & 0x01)   // check status
{
PINT->IST|= 0x01;  // clear rising flag
flagStatus = true;

}
}

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 

0 Kudos

1,145 Views
k_sunilgupta
Contributor II

thanktyou.

0 Kudos

1,174 Views
k_sunilgupta
Contributor II

thankyou.

0 Kudos