P1_0 Interrumption

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

P1_0 Interrumption

706件の閲覧回数
lpcware
NXP Employee
NXP Employee
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]
0 件の賞賛
返信
2 返答(返信)

685件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by amelendez@dibal.com on Mon Nov 07 03:35:57 MST 2011

Quote: Zero
Default pin function for PIO1_1 isn't PIO (See IOCON_R_PIO1_1 register), so you have to change LPC_IOCON->PIO1_1 register :eek:


Thanks. Also it was needed to add

[B][SIZE=2][COLOR=#7f0055][SIZE=2][COLOR=#7f0055]#define[/COLOR][/SIZE][/COLOR][/SIZE][/B][SIZE=2] CONFIG_GPIO_DEFAULT_PIOINT1_IRQHANDLER [/SIZE]

[SIZE=2]in driver_config.h[/SIZE]
0 件の賞賛
返信

685件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sat Nov 05 08:27:53 MST 2011
Default pin function for PIO1_1 isn't PIO (See IOCON_R_PIO1_1 register), so you have to change LPC_IOCON->PIO1_1 register :eek:
0 件の賞賛
返信