Content originally posted in LPCWare by amelendez@dibal.com on Fri Nov 04 04:09:12 MST 2011
I'm working on the LPCXpresso LPC1114 evaluation board.
I've tested and executed the "extint" example without any problem.
The way for testing it it's by placing a breakpoint in PIOINT2_IRQHandler at p2_1_counter++ instruction (in gpio.c). Everytime that I shortcircuited p2.1 to gnd the execution stopped at the defined breakpoint.
I've not been able to perform the same with the p1.1 pin. I've interchanged PORT2 by PORT1 and I didn't get any stop in the breakpoint placed in PIOINT1_IRQHandler at p1_1_counter++ instruction making a shortcircuit on AD2.
I have tested that the GPIO1 status changed (monitoring the memory table in the LPCXpresso IDE) as desired averytime I shortcircuited P1.1
The main code is as follows:
[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]int[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] [B]main[/B] ([/SIZE][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]void[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2])[/SIZE]
[LEFT][SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Basic chip initialization is taken care of in SystemInit() called[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]* from the startup code. SystemInit() and chip settings are defined[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]* in the CMSIS system_<part family>.c file.[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#3f7f5f]
[SIZE=2][COLOR=#3f7f5f]*/[/COLOR][/SIZE][/LEFT]
[/COLOR][/SIZE]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* Initialize GPIO (sets up clock) */[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]GPIOInit();[/SIZE][/LEFT]
[LEFT][SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* [U]use[/U] port1_1 as input event, interrupt test. */[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]GPIOSetDir( PORT1, 1, 0 );[/SIZE]
[SIZE=2][COLOR=#3f7f5f][SIZE=2][COLOR=#3f7f5f]/* port1_0, single edge trigger, active high. */[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]GPIOSetInterrupt( PORT1, 1, 0, 0, 0 );[/SIZE][/LEFT]
[SIZE=2]GPIOIntEnable( PORT1, 1 );[/SIZE][LEFT][B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]while[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2]( 1 );[/SIZE][/LEFT]
[SIZE=2]}[/SIZE]