Skip to main content
ndsmith34
Associate
December 12, 2018
Question

How to Configure Basic Touch Sensing Library with CubeMX

  • December 12, 2018
  • 1 reply
  • 1015 views

I have a STM32F0-DISCOVERY board that I've connected a sampling capacitor and a single touch button to. I've generated code in CubeMX for this configuration and have all the coed in my TrueStudio project. I want to use STM Studio to tune my touch button settings. What are the functions I need to add to my code (assuming the only thing my code does is run this touch button) to initialize and run the button?

CubeMX adds:

HAL_Init()

SystemClock_Config()

MX_GPIO_Init()

MX_TSC_Init()

MX_TOUCHSENSING_Init()

I have added TSL_tkey_Init() before the while(1) loop. Inside the while loop I have tsl_user_Exec() and TSL_tkey_Process().

When I run the program, Ref and RefRest stay at 0, StateId stays at 0 (calibration), but the Delta is about -600 and reacts to touches. What steps am I missing?

This topic has been closed for replies.

1 reply

ndsmith34
ndsmith34Author
Associate
December 12, 2018

I think I figured it out: my sample capacitor was not soldered on very well.