MKW30Z set-up TSI capacitive touch

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MKW30Z set-up TSI capacitive touch

970 Views
lucianfiran
Contributor V

KW40Z_Connectivity_Software_1.0.1 (KSDK_1.3.0); IAR 7.50;

I'am trying to setup one capacitive button touch using TSI engine.

located on TSI0_CH15 on my MKW30Z

39 28 PTC3 DISABLED TSI0_CH15 PTC3/LLWU_P11 RX_SWITCH I2C1_SDA UART0_TX — — DTM_TX

As reference I used:

frdm_kw40z_demo_1.0
frdm_kw40z_demo_1.0\source\sensor_drivers\tsi_sensor\ tsi_sensor.h and tsi_sensor.c

I modified:

tsi_sensor_electrode_data_t tsiSensorElectrodeList[] = {
  {
    .channel = 15,
  },
};

change  configure_tsi_pins(0);

PORT_HAL_SetMuxMode(PORTC,3u,kPortPinDisabled); /* TSIO_CH15 */

but it get stuck in TSI_DRV_Measure(0) after initialization ?

tsi_sensor_status_t tsi_sensor_start_single_measurement (void){
  tsi_status_t result;

  /* Start measurements */
  result = TSI_DRV_Measure(0);

....

MKW30Z4_features.h

/* @brief TSI module version. */
#define FSL_FEATURE_TSI_VERSION (4)

I presume that is used fsl_tsi_v4_hal_specific.h, fsl_tsi_v4_driver_specific.c

\KW40Z_Connectivity_Software_1.0.1\KSDK_1.3.0\platform\drivers\src\tsi

Some other changes are necessary ?

There is some relations with TMR or TPM set-up ?

Best Regards,

Lucian

2 Replies

752 Views
michael_galda
NXP Employee
NXP Employee

Hello Lucian,

Have you looked into:

c:\Freescale\KSDK_1.3.0\examples\frdmkw40z\driver_examples\tsi\

It is very basic example.

It contains just the TSI init and usage itself.

752 Views
lucianfiran
Contributor V

The example frdm_kw40z_demo_1.0 uses FreeRTOS, while my app uses bare_metal.

I added:

extern void TSI_DRV_IRQHandler(uint32_t instance);

.....

/*!
 * @brief Implementation of TSI0 handler named in startup code.
 *
 * Passes instance to generic TSI IRQ handler.
 */
void TSI0_IRQHandler(void)
{
    TSI_DRV_IRQHandler(0);
}

and it seems to work.

Thank you,

Lucian

0 Kudos
Reply