Keyboard interruption by 2 pins

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

Keyboard interruption by 2 pins

1,316件の閲覧回数
carlesls
Contributor II

I have a question: 

When I enable 2 pins as inputs for keyboards interrupts, the KBI0_IRQHandler does not respond. But it is curious because  I am able to trigger the KBI0_IRQHandler by one pin or another but when I set the both pin, the KBI0_IRQHandler is never triggered...

 

carlesls_0-1732800596743.png

 

ラベル(1)
0 件の賞賛
返信
5 返答(返信)

1,243件の閲覧回数
carlesls
Contributor II

Another question: Is it possible to change the edge detection (from falling to rising or from rising to falling) at the very interruption? 

Thanks a lot again. 

0 件の賞賛
返信

1,290件の閲覧回数
carlesls
Contributor II

This piece of code does not work.

kbiConfig.mode = kKBI_EdgesDetect;
kbiConfig.pinsEnabled = (uint32_t) (0b00010000 | 0b01000000) ;
kbiConfig.pinsEdge = (uint32_t) (0b00010000 | 0b01000000) ; // Rising edge.

But this, 

kbiConfig.mode = kKBI_EdgesDetect;
kbiConfig.pinsEnabled = (uint32_t) ( 0b01000000) ;
kbiConfig.pinsEdge = (uint32_t) ( 0b01000000) ; // Rising edge.

or this

kbiConfig.mode = kKBI_EdgesDetect;
kbiConfig.pinsEnabled = (uint32_t) (0b00010000 ) ;
kbiConfig.pinsEdge = (uint32_t) (0b00010000 ) ; // Rising edge.

does trigger the keyboard 0 interruption... but why?

0 件の賞賛
返信

1,260件の閲覧回数
Pablo_Ramos
NXP Employee
NXP Employee

Hi @carlesls.,

You can check if the KBI is being configure correctly in the Peripherals+ tab.

Also, the KBI only manage one interrupt flag, if two interrupt happens at the same time in the same KBI this can cause only one of them to trigger, this same flag should be cleared every interruption, if this is not done the code will constantly enter the IRQHandler.

I made some test on a FRDM-KE02Z with the configuration you share, and all work as expected.

Is there any other configuration on your project that could affect the KBI peripheral?

0 件の賞賛
返信

1,244件の閲覧回数
carlesls
Contributor II

carlesls_0-1733214427573.png

Is it possible to use the GPIO and the KBI0 at the same time in the same physical pin?

Thanks a lot.

0 件の賞賛
返信

1,170件の閲覧回数
Pablo_Ramos
NXP Employee
NXP Employee

Hi @carlesls,

The pin uses the last configuration, in this case if you configure the KBI0 and then set the same pins as GPIO the pins will only act as GPIO.

Also, for the KBI interruption there is no difference on the edges, you can only detect edges or edges and levels.

0 件の賞賛
返信