Group Interrupt processing

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Group Interrupt processing

1,312 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdupre on Thu Sep 17 10:54:14 MST 2015
I'm not understanding how the interrupt processing is supposed to work with the Group Interrupt peripheral.  (I'm using the LPC15xx) :

I have 4 GPIO push-button inputs, normally high.

I have set up the Group Interrupt controller with the inputs active low, edge triggered, and ORed.

When a button is pressed, the IRQ is triggered (and sometimes multiple times due to switch bounce).  When it is released, the IRQ is not triggered.  So far so good.

However, if a button is pressed and held down, and then another button is pressed, the interrupt does not fire for the second button.  Why is this?  The group interrupt is configured to OR the inputs so that any input going low should fire the interrupt.

I then change the configuration so the inputs are active high.  I expected the interrupt to fire when a button was released (a transition from low to high).  However, the interrupt is triggered only once at startup.  After that, pressing of any button does nothing.

It appears that any input being active "locks" the group interrupt mechanism.  Is that the intended behavior?

- Joe
标签 (1)
0 项奖励
回复
2 回复数

1,203 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jdupre on Thu Sep 17 16:26:46 MST 2015
Yeah, I understand the logic of what I am seeing.  The documentation of the Group Interrupt implementation is sparse.  (A logic diagram in the manual would be helpful !)

I thought I'd try this new to me feature, but it doesn't seem that useful for my purposes.  Especially since there is no register to indicate which of the grouped GPIOs triggered the interrupt. (You have to read the GPIO port after the interrupt has fired-- which in some cases fails due to switch bounce.)

Since I need to detect multiple quasi-simultaneous button press combinations, it will probably be easier to just use individual interrupts on the inputs.

- Joe 
0 项奖励
回复

1,203 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Thu Sep 17 13:07:29 MST 2015
I am not familiar with the 15xx family specifically, but a simple logic analysis should explain the first question ...

I don't know if you are familiar with logic gates, but imagine a 4-input AND gate.

Rest condition is 4 x high (1) in therefore high (1) out.
Press any one switch: 3 x high in and 1 x low in therefore low (0) out ... high to low transition  ... IRQ fired.
Press any other switch (keeping the first held): 2 x high and 2 x low in therefore low (0) out ... low remains low no transition ... no IRQ

So yes; I think that is the expected behaviour.

The other question: at power on, all GPIOs go from low (un-powered) to high (the default is input with pull-up) so a transition is
seen and your IRQ fires.

Not sure about your group IRQ setup in the second case [polarity, combine-function] but possibly needs to be opposite
(in some sense) to what you have. Sorry, I don't know what options there are as I don't use 15xx and don't have that manual.

Maybe check "Boolean Logic" on wikipedia.

Cheers, Mike

0 项奖励
回复