MKW30Z TSI Stuck Key Detection implementation

Showing results for 
Search instead for 
Did you mean: 

MKW30Z TSI Stuck Key Detection implementation

Contributor V

KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0); IAR 7.50

There is some stuck key detection algo implemented in framework ?

There is the Initial Start-up Calibration witch is a low value calibration.

Occurs every time the device resets. The first key detection cycle is used as a baseline

capacitance value for all remaining calculations.
Thus, a touch is detected by taking the difference between this baseline value and a sensitivity value
compared with current capacitance on the electrode.

I guess that the Stuck Key Detection can be a counter (timer) of continuous press events (not interrupted by idle).
When this value goes above a set value it triggers a recalibration - but should be high value calibration.

Got some inspiration from (pag 24):

and tried something like:

        #if (gUseStuckButtonCounter_d)
          /* trigger recalibration */
          if (stuckBtnCnt > stuckBtnCntMax)
            /* Calibrate electrode channel - try lower threshold */
            if(threshold > sensitivity)  { threshold = threshold - sensitivity; }
            else { TsiCalibrate(); }

where threshold is first measured low + sensitivity and the counter fires of about ~5 minutes.

The framework contains a high value calibration demo example ?       

0 Kudos
1 Reply

NXP Employee
NXP Employee

Hi Lucian,

As far as I know, the Connectivity Framework for KW40Z doesn’t implement TSI functionality.

Have you looked at the Kinetis Peripheral Module Quick Reference? There is a chapter about the TSI module with useful reference material on how to implement the TSI module.


0 Kudos