How do I configure a GPIO pin as an external interrupt in a Target Support Package?

4 views (last 30 days)
I would like to configure GPIO pin as external interrupt for F28335 board. I would like an example or demo for this.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 17 Jan 2013
The attached model configures GPIO0 as external interrupt to trigger the blinking of LED. The custom code in the System Initialize block assigns GPIO0 as an input to trigger the XINT1 interrupt:
EALLOW;
GpioCtrlRegs.GPAMUX1.bit.GPIO0 = 0;
GpioIntRegs.GPIOXINT1SEL.bit.GPIOSEL = 0;
EDIS;
XIntruptRegs.XINT1CR.bit.ENABLE = 1;
XIntruptRegs.XINT1CR.bit.POLARITY = 1;
The ISR toggles the LED based on a rising edge of GPIO00. Connect GPIO to 3V and GND in order to blink the LED.

More Answers (0)

Tags

Products


Release

R2009b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!