Keyboard interruption by 2 pins

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

Keyboard interruption by 2 pins

1,324 次查看
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,251 次查看
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,298 次查看
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,268 次查看
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,252 次查看
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,178 次查看
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 项奖励
回复