HERE'S A PROBLEM WITH KBI MODULE. AS WE KNOW KBI CAN BE SET UP FOR RISING EDGE / FALLING EDGE TRIGGER. BUT IF I USE KBI FOR A SWITCH WITH SETUP OF ACTIVE LOW HOW CAN I KNOW WHEN USER RELEASE THE SWITCH? I MEAN WHEN USER IS PUSHING BUTTON WE CAN THROUGH INTERRUPT FLAG TO CONFIRM THE STATUS BUT CANNOT RECOGNIZE THE RELEASE FROM BUTTON.
WE DON'T WANT TO USE A METHOD OF FOR LOOP BY POLLING. IT WASTE THE PERFORMANCE OF CHIP. WE WANT HARDWARE DETECTION LIKE FTM CAPTURE IN.
When you have detected the button being pressed reprogram the interrupt to react to rising edge and then you will get a second interrupt when it is released.
There is generally a difficulty when more that one key (with the KBI) is used due to the fact that if one is in an active state no other can be detected until this first one has been released again.
In my opinion the KBI design is flawed and so is often not usable.
There is an external interrupt module that has one single interrupts that supports rising/falling and level sensitive interrupts (on only one of a few selectable inputs) which allows 2 interrupt inputs to be flexibly handed (one on KBI and one on IRQ).
Unfortunately the basic KE and KEA series doesn't support the flexible port interrupts that most other parts allow.
Generally I would use an approx. 50ms polling technique for HMI key inputs since this will allow adequate response with little processor overhead and no de-bouncing requirements. The interrupt method is only really necessary for very fast input handling.
Complete Kinetis solutions for professional needs, training and support:http://www.utasker.com/kinetis.html
uTasker: supporting >1'000 registered Kinetis users get products faster and cheaper to market
Request Free emergency remote desk-top consulting at http://www.utasker.com/services.html