Report
1 year ago.

Can someone help me understand this code for the touch sense controller?

https://github.com/eleciawhite/STM32Cube/blob/master/STM32Cube_FW_F3_V1.3.0/Projects/STM32373C_EVAL/Examples/TSC/TSC_BasicAcquisition_Interrupt/Src/main.c what I don't understand are these definitions:

IoConfig.ChannelIOs = TSC_GROUP8_IO1;

IoConfig.SamplingIOs = (TSC_GROUP7_IO4 | TSC_GROUP8_IO4);

IoConfig.ShieldIOs = TSC_GROUP7_IO3;'

Any idea what are these? Shouldn't I just define the channels?

Comment on this question

1 Answer

1 year ago.

Hello Maryam,

Here is where the TSC_GROUPx_IOx pin masks are defined:

https://github.com/eleciawhite/STM32Cube/blob/897ce598aad7347f9d824719aacf32e93a827098/STM32Cube_FW_F3_V1.3.0/Drivers/STM32F3xx_HAL_Driver/Inc/stm32f3xx_hal_tsc.h

Looking at this document:

https://www.st.com/content/ccc/resource/technical/document/user_manual/group0/d6/4c/20/0d/a1/c1/4c/99/DM00210526/files/DM00210526.pdf/jcr:content/translations/en.DM00210526.pdf

Starting at page 72, looking at the STM32F3 series, you can see the "TSC_GROUPx_IOx" signal names correlates with a particular pin on the boards. On page 90, you can see a hardware diagram of where those pins are mapped to. Hope this helps!

-Karen, team Mbed

If this solved your question, please make sure to click the "Thanks" link below!

Thank you for your reply. My problem now when I operate the code in the link is, it stops at step #-6- "Check if the acquisition is correct (no max count) "

if (HAL_TSC_GroupGetStatus(&TscHandle, TSC_GROUP1_IDX) == TSC_GROUP_COMPLETED)

The above If condition is never true and thus the acquisition is never completed. Any idea what could be wrong?

posted by maryam magdy 02 Aug 2018

You need to log in to post a question