cancel
Showing results for 
Search instead for 
Did you mean: 

How are the timers configured for STM32L1 TS hardware acquisition?

A.D.
Associate III

I want to test TS with one normal touchkey. I use the STM32L152RETx on the Nucleo-L152RE.

I want to use hardware acquisition mode to keep the CPU in sleep mode until a touch is registered. As I understand the UM1913 the L1 series is using TIM9 and TIM11 for that. But when I enable hardware acquisition mode, the timers are not configured in the CubeMX dialog and the settings for the timers offer no option that sounds like it would belong to the TS functionality (only input capture, output compare and PWM).

How do I configure the timers for TS? Did I oversee something obvious? I admit that the TS functionality is not really transparent to me yet...

5 REPLIES 5
OlivierR
ST Employee

Hello,

You can get TS sw examples using hw and sw acquisition modes in STM32Cube_FW_L1_V1.10.3:

./Projects/STM32L152D-EVAL/Applications/TouchSensing/TouchSensing_Linear_hwacq/readme.txt

./Projects/STM32L152D-EVAL/Applications/TouchSensing/TouchSensing_Linear_swacq/readme.txt

Set TIM9 in Master and TIM11 in slave modes.

Set-up example in api TSL_Init_TIMs located in file tsl_acq_stm32l1xx_hw.c:

  • STM32Cube_FW_L1_V1.10.3\Middlewares\ST\STM32_TouchSensing_Library\src

TIM11 IRQ handler call the api TSL_acq_ProcessIT(), see file stm32l1xx_it.c

Regards.

A.D.
Associate III

Ah, thank you, I will look into it. That Touch Sensing libraray seems quite complex, I anticipated it to be simpler to set up. I will see what I can do on monday ;)

Stassen.C
ST Employee

Hello,

To complete to what Olivier said earlier, here is a small code example that works on the Nucleo-L152RE.

Regards

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

A.D.
Associate III

I see, so the timers are not configured by any CubeMX settings, but manually by settings the register values with the TSL_Init_TIMs.

This has the potential to be quite confusing over the course of a project, when other developers try to change some settings via CubeMX, don't you think?

OlivierR
ST Employee

Hello, Yes, I agree.

When "TouchSensing acquisition"==hardware, for sure improvement can be done like move TIM9/11 in used state. I will discuss this point with RnD. Regards.