Touch Sensing Example with usafa key detector not working any more

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

Touch Sensing Example with usafa key detector not working any more

跳至解决方案
983 次查看
arun07
Contributor III

Hello Everyone,

I am facing a strange problem due to the NXP Touch Library available with the NXP SDK.

I am using NXP FRDM-KE15Z with MKE15Z256 micro-controller.

if I use the version 2.10 version of the SDK, the touch_sensing example project works very well with usafa key detector algorithm, below are the screen shot from the FreeMASTER tool.

arun07_1-1724861624887.png

 

But in the latest version of the SDK i.e. 2.16, I see there is a new key detector mbw and the project is updated to use this key detector. And when I use this project everything works fine.

But due to some reason I still want to use usafa key detector, so I copied the usafa key detector settings/tuning values from version 2.10 project to version 2.16 example project, and also updated the Electrode_1 and Electrode_2 to use the usafa key detector, and when I started this project, I see that the touch is not working, and the reason is clear, whenever I am touching the electrodes the signal is not crossing the deadband signal, and that's not detected.

I want to understand what exactly is changed in this touch sensing library which is causing this strange behavior (atleast for me), as per my understanding the same parameters should produce same results, as I am using the "usafa" key detector only.

The following is the screen shot of FreeMASTER with SDK version 2.16 and Electrode 1 and 2 updated to use usafa electrode with settings/tuning values copied from version 2.10

arun07_0-1724861422699.png

Also as I can see the values are also different.

I am also sharing the updated nt_setup.c file, just wanted to inform you guys that, I am just testing on two onboard electrodes i.e. Electrode 1 and Electrode, I don't have Freedom Touch board, and in project I have set this "#define NT_FRDM_TOUCH_SUPPORT 0".

The changes I did are just adding these lines.

// Keydetector with usafa key detector
const struct nt_keydetector_usafa nt_keydetector_usafa_El_1 = {
    .signal_filter.coef1        = 2,
    .base_avrg.n2_order         = 12,
    .non_activity_avrg.n2_order = 15,
    .entry_event_cnt            = 4,
    .deadband_cnt               = 4,
    .signal_to_noise_ratio      = 6,
    .min_noise_limit            = 100,
    .dc_track_enabled           = 1,
    .dc_track_cnt               = 100,
};
// Update the electrode with usafa instead of mbw key detector and copied the tuning
// values from version 2.10 version of SDK
const struct nt_electrode El_1 = {
    .shielding_electrode      = NULL,
    .multiplier               = 0,
    .divider                  = 0,
    .shield_threshold         = 5,
    .shield_gain              = 30,
    .shield_attn              = 1,
    .shield_sens              = 800,
    .keydetector_params.usafa = &nt_keydetector_usafa_El_1,
    .keydetector_interface    = &nt_keydetector_usafa_interface,
    .pin_input                = FRDM_TOUCH_BOARD_TSI_1,
    .gpio_input               = {GPIO_PTC0},
    .baseline_level           = 57593,
};
// Update the electrode with usafa instead of mbw key detector and copied the tuning
// values from version 2.10 version of SDK
const struct nt_electrode El_2 = {
    .shielding_electrode      = NULL,
    .multiplier               = 0,
    .divider                  = 0,
    .shield_threshold         = 5,
    .shield_gain              = 30,
    .shield_attn              = 1,
    .shield_sens              = 800,
    .keydetector_params.usafa = &nt_keydetector_usafa_El_1,
    .keydetector_interface    = &nt_keydetector_usafa_interface,
    .pin_input                = FRDM_TOUCH_BOARD_TSI_2,
    .gpio_input               = {GPIO_PTC1},
    .baseline_level           = 58346,
};

And the content of the complete file is as below.

/*
 * Copyright 2013 - 2016, Freescale Semiconductor, Inc.
 * Copyright 2016-2021 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
/*
Static configuration c file for the NXP Touch Library
generated by the NXP Touch GUI Tool
*/
#include "nt_setup.h"
#include "board.h"

int16_t actMat[NT_XTALK_NSENSORS * NT_XTALK_NSENSORS] = {
          32767, 15342, 19509, 12501,
          10826, 32767, 16167, 9671,
          4189,  3630,  32767, 6795 ,
          5213,  7894,  16532, 32767,
};

// Keydetector with usafa key detector
const struct nt_keydetector_usafa nt_keydetector_usafa_El_1 = {
    .signal_filter.coef1        = 2,
    .base_avrg.n2_order         = 12,
    .non_activity_avrg.n2_order = 15,
    .entry_event_cnt            = 4,
    .deadband_cnt               = 4,
    .signal_to_noise_ratio      = 6,
    .min_noise_limit            = 100,
    .dc_track_enabled           = 1,
    .dc_track_cnt               = 100,
};

const struct nt_keydetector_mbw nt_keydetector_mbw_El_1 = {
    .signal_filter.coef1        = 0,
    .base_avrg.n2_order         = 12,
    .non_activity_avrg.n2_order = 15,
    .entry_event_cnt            = 4,
    .deadband_cnt               = 4,
    .signal_to_noise_ratio      = 6,
    .min_noise_limit            = 200,
    .baseline_track_window      = 2000,
    .baseline_track_window_touch= 8000,
    .touch_limit                = 3,
    .tau_smooth_signal          = 50,
    .tau_smooth_baseline        = 1000,
    .debounce_length            = 0,
};

const struct nt_keydetector_mbw nt_keydetector_mbw_El_3 = {
    .signal_filter.coef1        = 0,
    .base_avrg.n2_order         = 12,
    .non_activity_avrg.n2_order = 15,
    .entry_event_cnt            = 4,
    .deadband_cnt               = 5,
    .signal_to_noise_ratio      = 4,
    .min_noise_limit            = 30,
    .baseline_track_window      = 2000,
    .baseline_track_window_touch= 8000,
    .touch_limit                = 3,      
    .tau_smooth_signal          = 10,
    .tau_smooth_baseline        = 1000,
    .debounce_length            = 5,
};

const struct nt_keydetector_mbw nt_keydetector_mbw_El_7 = {
    .signal_filter.coef1        = 0,
    .base_avrg.n2_order         = 14,
    .non_activity_avrg.n2_order = 15,
    .entry_event_cnt            = 4,
    .deadband_cnt               = 4,
    .signal_to_noise_ratio      = 3,
    .min_noise_limit            = 60,
    .baseline_track_window      = 2000,
    .baseline_track_window_touch= 8000,
    .touch_limit                = 0,      
    .tau_smooth_signal          = 10,
    .tau_smooth_baseline        = 1000,
    .debounce_length            = 0,
};

// Update the electrode with usafa instead of mbw key detector and copied the tuning
// values from version 2.10 version of SDK
const struct nt_electrode El_1 = {
    .shielding_electrode      = NULL,
    .multiplier               = 0,
    .divider                  = 0,
    .shield_threshold         = 5,
    .shield_gain              = 30,
    .shield_attn              = 1,
    .shield_sens              = 800,
    .keydetector_params.usafa = &nt_keydetector_usafa_El_1,
    .keydetector_interface    = &nt_keydetector_usafa_interface,
    .pin_input                = FRDM_TOUCH_BOARD_TSI_1,
    .gpio_input               = {GPIO_PTC0},
    .baseline_level           = 57593,
};
// Update the electrode with usafa instead of mbw key detector and copied the tuning
// values from version 2.10 version of SDK
const struct nt_electrode El_2 = {
    .shielding_electrode      = NULL,
    .multiplier               = 0,
    .divider                  = 0,
    .shield_threshold         = 5,
    .shield_gain              = 30,
    .shield_attn              = 1,
    .shield_sens              = 800,
    .keydetector_params.usafa = &nt_keydetector_usafa_El_1,
    .keydetector_interface    = &nt_keydetector_usafa_interface,
    .pin_input                = FRDM_TOUCH_BOARD_TSI_2,
    .gpio_input               = {GPIO_PTC1},
    .baseline_level           = 58346,
};
const struct nt_electrode El_3 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 500,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_3,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_MUTUAL_ELECTRODE_1,
    .gpio_input             = {GPIO_PTD5, GPIO_PTE11},
    .baseline_level         = 11640,
};
const struct nt_electrode El_4 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 500,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_3,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_MUTUAL_ELECTRODE_2,
    .gpio_input             = {GPIO_PTD6, GPIO_PTE11},
    .baseline_level         = 11557,
};
const struct nt_electrode El_5 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 500,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_3,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_MUTUAL_ELECTRODE_3,
    .gpio_input             = {GPIO_PTD5, GPIO_PTE10},
    .baseline_level         = 14512,
};
const struct nt_electrode El_6 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 500,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_3,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_MUTUAL_ELECTRODE_4,
    .gpio_input             = {GPIO_PTD6, GPIO_PTE10},
    .baseline_level         = 14512,
};
const struct nt_electrode El_7 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 1500,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .tsicnt_shift           = 6,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_7,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_SLIDER_ELECTRODE_1,
    .gpio_input             = {GPIO_PTD7},
    .baseline_level         = 55358,
};
const struct nt_electrode El_8 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 1500,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .tsicnt_shift           = 6,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_7,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_SLIDER_ELECTRODE_2,
    .gpio_input             = {GPIO_PTD1},
    .baseline_level         = 55247,
};
const struct nt_electrode El_9 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 1000,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .tsicnt_shift           = 6,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_7,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_ROTARY_ELECTRODE_1,
    .gpio_input             = {GPIO_PTE5},
    .baseline_level         = 50554,
};
const struct nt_electrode El_10 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 1000,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .tsicnt_shift           = 6,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_7,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_ROTARY_ELECTRODE_2,
    .gpio_input             = {GPIO_PTE4},
    .baseline_level         = 52651,
};
const struct nt_electrode El_11 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 1000,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .tsicnt_shift           = 6,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_7,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_ROTARY_ELECTRODE_3,
    .gpio_input             = {GPIO_PTB5},
    .baseline_level         = 53261,
};
const struct nt_electrode El_12 = {
    .shielding_electrode    = NULL,
    .multiplier             = 0,
    .divider                = 0,
    .delta_limit            = 1000,
    .shield_threshold       = 5,
    .shield_gain            = 30,
    .shield_attn            = 1,
    .shield_sens            = 800,
    .tsicnt_shift           = 6,
    .keydetector_params.mbw = &nt_keydetector_mbw_El_7,
    .keydetector_interface  = &nt_keydetector_mbw_interface,
    .pin_input              = FRDM_TOUCH_BOARD_TSI_ROTARY_ELECTRODE_4,
    .gpio_input             = {GPIO_PTB4},
    .baseline_level         = 53803,
};

const tsi_config_t tsi_hw_config = {
    .configSelfCap.commonConfig.mainClock     = kTSI_MainClockSlection_0,
    .configSelfCap.commonConfig.ssc_mode      = kTSI_ssc_prbs_method,
    .configSelfCap.commonConfig.mode          = kTSI_SensingModeSlection_Self,
    .configSelfCap.commonConfig.dvolt         = kTSI_DvoltOption_3,
    .configSelfCap.commonConfig.cutoff        = kTSI_SincCutoffDiv_1,
    .configSelfCap.commonConfig.order         = kTSI_SincFilterOrder_2,
    .configSelfCap.commonConfig.decimation    = kTSI_SincDecimationValue_4,
    .configSelfCap.commonConfig.chargeNum     = kTSI_SscChargeNumValue_4,
    .configSelfCap.commonConfig.prbsOutsel    = kTSI_SscPrbsOutsel_2,
    .configSelfCap.commonConfig.noChargeNum   = kTSI_SscNoChargeNumValue_2,
    .configSelfCap.commonConfig.ssc_prescaler = kTSI_ssc_div_by_2,
    .configSelfCap.enableSensitivity          = true,
    .configSelfCap.enableShield               = kTSI_shieldAllOff,
    .configSelfCap.xdn                        = kTSI_SensitivityXdnOption_3,
    .configSelfCap.ctrim                      = kTSI_SensitivityCtrimOption_0,
    .configSelfCap.inputCurrent               = kTSI_CurrentMultipleInputValue_0,
    .configSelfCap.chargeCurrent              = kTSI_CurrentMultipleChargeValue_0,
    .configMutual.commonConfig.mainClock      = kTSI_MainClockSlection_0,
    .configMutual.commonConfig.ssc_mode       = kTSI_ssc_prbs_method,
    .configMutual.commonConfig.mode           = kTSI_SensingModeSlection_Mutual,
    .configMutual.commonConfig.dvolt          = kTSI_DvoltOption_3,
    .configMutual.commonConfig.cutoff         = kTSI_SincCutoffDiv_1,
    .configMutual.commonConfig.order          = kTSI_SincFilterOrder_2,
    .configMutual.commonConfig.decimation     = kTSI_SincDecimationValue_4,
    .configMutual.commonConfig.chargeNum      = kTSI_SscChargeNumValue_4,
    .configMutual.commonConfig.noChargeNum    = kTSI_SscNoChargeNumValue_2,
    .configMutual.commonConfig.prbsOutsel     = kTSI_SscPrbsOutsel_2,
    .configMutual.commonConfig.ssc_prescaler  = kTSI_ssc_div_by_2,
    .configMutual.preCurrent                  = kTSI_MutualPreCurrent_4uA,
    .configMutual.preResistor                 = kTSI_MutualPreResistor_4k,
    .configMutual.senseResistor               = kTSI_MutualSenseResistor_10k,
    .configMutual.boostCurrent                = kTSI_MutualSenseBoostCurrent_0uA,
    .configMutual.txDriveMode                 = kTSI_MutualTxDriveModeOption_0,
    .configMutual.pmosLeftCurrent             = kTSI_MutualPmosCurrentMirrorLeft_32,
    .configMutual.pmosRightCurrent            = kTSI_MutualPmosCurrentMirrorRight_1,
    .configMutual.enableNmosMirror            = true,
    .configMutual.nmosCurrent                 = kTSI_MutualNmosCurrentMirror_1,
    .thresl                                   = 0,
    .thresh                                   = 65535,
    .newCalc                                  = true,
};
const struct nt_tsi_recalib_config recalib_configuration = {
    .SelfRangeMin      = 50000,
    .SelfRangeMax      = 62000,
    .SelfRangeDeltaMin = 150,
    .SelfRangeDeltaMax = 7000,
    .MutRangeMin       = 9000,
    .MutRangeMax       = 16000,
    .MutRangeDeltaMin  = 150,
    .MutRangeDeltaMax  = 7000,
};
const struct nt_module_safety_gpio_params my_safety_params = {
    .delay_interval = 0,
    .user_interface = &gpio_interface,
};
const struct nt_system_xtalk_params my_xtalk_params= {
    .actMat =(uint16_t*)actMat,
    .nt_xtalk_neighbours = 4,
    .nt_xtalk_adapt_touch_time = 25,
};

const struct nt_electrode *const Keypad_1_controls[]         = {&El_1, &El_2, &El_3, &El_4, &El_5, &El_6, NULL};
const struct nt_electrode *const ASlider_2_controls[]        = {&El_7, &El_8, NULL};
const struct nt_electrode *const ARotary_3_controls[]        = {&El_9, &El_10, &El_11, &El_12, NULL};
const struct nt_control_arotary nt_control_arotary_ARotary_3 = {
    .range = 72,
};
const struct nt_control_aslider nt_control_aslider_ASlider_2 = {
    .range         = 160,
    .insensitivity = 2,
};
const struct nt_control_keypad nt_control_keypad_Keypad_1 = {
    .groups           = NULL,
    .groups_size      = 0,
    .multi_touch      = (uint32_t[]){0x0C, 0x18, 0x30, 0x24, 0x3C, 0x03, 0},
    .multi_touch_size = 6,
};
const struct nt_control Keypad_1 = {
    .electrodes            = &Keypad_1_controls[0],
    .control_params.keypad = &nt_control_keypad_Keypad_1,
    .interface             = &nt_control_keypad_interface,
    .adjacent_electrodes   = kAdj_grounding,
};
const struct nt_control ASlider_2 = {
    .electrodes             = &ASlider_2_controls[0],
    .control_params.aslider = &nt_control_aslider_ASlider_2,
    .interface              = &nt_control_aslider_interface,
};
const struct nt_control ARotary_3 = {
    .electrodes             = &ARotary_3_controls[0],
    .control_params.arotary = &nt_control_arotary_ARotary_3,
    .interface              = &nt_control_arotary_interface,
};
const struct nt_electrode *const nt_tsi_module_electrodes[] = {&El_1, &El_2, &El_3,  &El_4,  &El_5,  &El_6, &El_7,
                                                               &El_8, &El_9, &El_10, &El_11, &El_12, NULL};
const struct nt_electrode *const nt_tsi_module_xtalk_electrodes[] = {&El_3,  &El_4,  &El_5,  &El_6, NULL};
const struct nt_module nt_tsi_module                        = {
    .interface          = &nt_module_tsi_interface,
    .wtrmark_hi         = 65535,
    .wtrmark_lo         = 0,
    .config             = (void *)&tsi_hw_config,
    .instance           = 0,
    .electrodes         = &nt_tsi_module_electrodes[0],
    .safety_interface   = &nt_safety_interface,    
    .safety_params.gpio = (void *)&my_safety_params,
    .recalib_config     = (void *)&recalib_configuration,
    .elec_random_order  = true,
};
const struct nt_control *const System_0_controls[] = {&Keypad_1, &ASlider_2, &ARotary_3, NULL};
const struct nt_module *const System_0_modules[]   = {&nt_tsi_module, NULL};
const struct nt_system System_0                    = {
    .time_period            = 5,
    .init_time              = 400,
    .safety_period_multiple = 0,
    .safety_crc_hw          = true,
    .controls               = &System_0_controls[0],
    .modules                = &System_0_modules[0],
    .xtalk_interface        = &nt_system_xtalk_interface,
    .xtalk_params           = (void *)&my_xtalk_params,
    .xtalk_electrodes       = &nt_tsi_module_xtalk_electrodes[0],
};
void nt_enable(void)
{
    nt_electrode_enable(&El_1, 0);
    nt_electrode_enable(&El_2, 0);
    nt_electrode_enable(&El_3, 0);
    nt_electrode_enable(&El_4, 0);
    nt_electrode_enable(&El_5, 0);
    nt_electrode_enable(&El_6, 0);
    nt_electrode_enable(&El_7, 0);
    nt_electrode_enable(&El_8, 0);
    nt_electrode_enable(&El_9, 0);
    nt_electrode_enable(&El_10, 0);
    nt_electrode_enable(&El_11, 0);
    nt_electrode_enable(&El_12, 0);
    nt_control_enable(&Keypad_1);
    nt_control_enable(&ASlider_2);
    nt_control_enable(&ARotary_3);
}

// Following functions are generate, copy them to your application and implement there behaviour of events
/* Call on the TSI CNTR overflow 16-bit range (65535) */
/*void system_0_callback_template(uint32_t event, union nt_system_event_context * context)
{
  switch(event)
  {
    case NT_SYSTEM_EVENT_OVERRUN:
        // your code
    break;
    case NT_SYSTEM_EVENT_DATA_READY:
        // your code
    break;
    case NT_SYSTEM_EVENT_MODULE_DATA_READY:
        // your code
    break;
    case NT_SYSTEM_EVENT_DATA_OVERFLOW:
        // your code
    break;
    case NT_SYSTEM_EVENT_SIGNAL_LOW:
        // your code
    break;
    case NT_SYSTEM_EVENT_SIGNAL_HIGH:
        // your code
    break;
    case NT_SYSTEM_EVENT_ELEC_SHORT_VDD:
        // your code
    break;
    case NT_SYSTEM_EVENT_ELEC_SHORT_GND:
        // your code
    break;
    case NT_SYSTEM_EVENT_ELEC_SHORT_ADJ:
        // your code
    break;
  }
}
*/

/*static void Keypad_1_callback_template(const struct nt_control *control,
                               enum nt_control_keypad_event event,
                               uint32_t index)
 {
   switch(event)
   {
   case NT_KEYPAD_RELEASE:
     switch (index) {
         case 0:
         // your code
     break;
         case 1:
         // your code
     break;
         case 2:
         // your code
     break;
         case 3:
         // your code
     break;
         default:
         // your code
     break;
     }
     break;
   case NT_KEYPAD_TOUCH:
     switch (index) {
         case 0:
         // your code
     break;
         case 1:
         // your code
     break;
         case 2:
         // your code
     break;
         case 3:
         // your code
     break;
         default:
         // your code
     }
     break;
   }
 }
 */

/*static void ASlider_2_callback_template(const struct nt_control *control,
                                enum nt_control_aslider_event event,
                                uint32_t position)
 {
 switch(event)
     {
     case NT_ASLIDER_MOVEMENT:
         // your code
     break;
     case NT_ASLIDER_ALL_RELEASE:
         // your code
     break;
     case NT_ASLIDER_INITIAL_TOUCH:
         // your code
     default:
         // your code
     break;
   }
 }
 */

/*static void ASlider_2_callback_template(const struct nt_control *control,
                                enum nt_control_aslider_event event,
                                uint32_t position)
 {
 switch(event)
     {
     case NT_ASLIDER_MOVEMENT:
         // your code
     break;
     case NT_ASLIDER_ALL_RELEASE:
         // your code
     break;
     case NT_ASLIDER_INITIAL_TOUCH:
         // your code
     default:
         // your code
     break;
   }
 }
 */

 

Can someone please explain, why this is happening? Thanks in advance.

NXP-TOUCH-SOFTWARE FRDM-TOUCH 

 

0 项奖励
回复
1 解答
957 次查看
arun07
Contributor III

I found the issue why with previous parameters touch is not working, it is due to the fact that in the touch library there is a new setting which is "newCalc".

const tsi_config_t tsi_hw_config;
typedef struct
{
    tsi_selfCap_config_t configSelfCap;  /*!< Hardware configuration for self capacitance measurement */
    tsi_mutualCap_config_t configMutual; /*!< Hardware configuration for mutual capacitance measurement */
    uint16_t thresl;                     /*!< Low threshold for out-of-range interrupt (wake-up from low-power) */
    uint16_t thresh;                     /*!< High threshold for out-of-range interrupt (wake-up from low-power) */
    bool newCalc;                        /*!< Use new calculation for Self cap */  
} tsi_config_t;

And in the project it was set to "true", and due to this things was not working.

I updated this to "false" and touch started working fine.

I need to understand what impact is this "true" is doing, in case someone can explain it will be really helpful.

在原帖中查看解决方案

0 项奖励
回复
1 回复
958 次查看
arun07
Contributor III

I found the issue why with previous parameters touch is not working, it is due to the fact that in the touch library there is a new setting which is "newCalc".

const tsi_config_t tsi_hw_config;
typedef struct
{
    tsi_selfCap_config_t configSelfCap;  /*!< Hardware configuration for self capacitance measurement */
    tsi_mutualCap_config_t configMutual; /*!< Hardware configuration for mutual capacitance measurement */
    uint16_t thresl;                     /*!< Low threshold for out-of-range interrupt (wake-up from low-power) */
    uint16_t thresh;                     /*!< High threshold for out-of-range interrupt (wake-up from low-power) */
    bool newCalc;                        /*!< Use new calculation for Self cap */  
} tsi_config_t;

And in the project it was set to "true", and due to this things was not working.

I updated this to "false" and touch started working fine.

I need to understand what impact is this "true" is doing, in case someone can explain it will be really helpful.

0 项奖励
回复