GPIO external interrupt

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

GPIO external interrupt

1,538件の閲覧回数
storm_rd
Contributor I

Hi,

I am working on GPIO external interrupt on LPC1769 board and having problems getting it to work. I have connected pin 2.11 to a push button and interrupt must be generated when the button is pushed. Any help is greatly appreciated. Thanks.. Below is the code, 

#define EINT0      0

void EINT0_IRQHandler(void)

{

LPC_GPIOINT->IO2IntClr = (1 << 11);

printf("0interrupt\n");

}

int main(void) {

LPC_PINCON->PINSEL4 &= ~(3<<20);

LPC_PINCON->PINSEL4 |= (1<<20);

LPC_GPIO2->FIODIR &= ~(1<<10);

// LPC_GPIOINT->IO2IntEnF |= (0x01 <<10);

LPC_SC->EXTMODE = (1<<EINT0);

LPC_SC->EXTPOLAR = (1<<EINT0);

NVIC_EnableIRQ(EINT0_IRQn);

while(1)

{

}

    return 0 ;

 

0 件の賞賛
返信
1 返信

1,184件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi Ramadevi Jayaraman 

Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.
To provide the fastest possible support, I'd like to recommend you to refer to the periph_pinint demo of the LPCOpen library.
If you have any further questions about it, please feel free to contact with me.
Have a great day,

TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 件の賞賛
返信