5. GPIO Interrupt
This GPIO interrupt is only available to PORT 0 & PORT 2 of LPC1768 Microcontroller.
- Falling Edge Interrupt
Register LPC_GPIOINT –> IOxIntEnF is used to enable falling edge detected interrupt, in which ‘x’ is the group number, either 0 or 2. To turn on falling edge interrupt of pin,
set the corresponding pin to ‘1’.
Example:
To enable Pin 0.3 falling edge interrupt
LPC_GPIOINT –> IO0IntEnF |= (1<<3); - Rising Edge Interrupt
Register LPC_GPIOINT –> IOxIntEnR is used to enable rising edge detected interrupt. In which ‘x’ is the group number to turn on rising edge interrupt of a pins set the corresponding pin to ‘1’.
Example:
To enable Pin 0.3 and 0.5 rising edge interrupt
LPC_GPIOINT –> IO0IntEnR |= ((1<<3) | (1<<5));
All GPIO interrupt are connected to EINT3 interrupt source. You need to turn EINT3_IRQn ON in order to use GPIO interrupt. NVIC_EnableIRQ(EINT3_IRQn);
This is it !!! for this tutorial. I believe now you have good understanding about how to configure GPIO in Cortex-M3 LPC1768 Microcontroller. In next tutorial we’ll be dealing with some interesting projects to get more deeper understanding about GPIO. I hope you will find this tutorial educational and entertaining….Thank’s….!!!!
Pages: 1 2