Skip to main content
Explorer II
December 2, 2023
Solved

TSC not working STM32F042

  • December 2, 2023
  • 1 reply
  • 1888 views

Hello everybody,

 

I designed a touch sensor whith the STM32F042 MCU but after a week of constant testing and experimenting still not working. First the problem was that the TSC always get in the too much count error, after I thought that maybe the capacitance of the sensor is too low, so I directly soldered a 33pF capacitor on the sensor. Now it's count value is around 230 but going to hard fault error in the Hal library bytheway the TSC registers have correct values.

 

The sensor itself is far from the ideal on the PCB, it's very close to the MCU and small, but I think it should work, for me it doesn't make sense what I experienced. 

 

I tried all the settings and now I don't know what to try next, please help me whith any suggestions, or anybody who experienced something like this, can tell me the what was the solution?

    This topic has been closed for replies.
    Best answer by TDK

    A hard fault typically indicates a program bug and not a hardware problem. The solution is to typically debug your program systematically until you find and fix the issue. For a hard fault, example why and where the hard fault occurred. STM32CubeIDE has a hard fault analyzer that you can use.

    If you are stuck, I would load a known working example for your chip or board that shows how to use the TSC. Here is one:

    https://github.com/STMicroelectronics/STM32CubeF0/tree/master/Projects/STM32072B_EVAL/Examples/TSC/TSC_BasicAcquisition_Polling

     

    1 reply

    TDKAnswer
    Super User
    December 2, 2023

    A hard fault typically indicates a program bug and not a hardware problem. The solution is to typically debug your program systematically until you find and fix the issue. For a hard fault, example why and where the hard fault occurred. STM32CubeIDE has a hard fault analyzer that you can use.

    If you are stuck, I would load a known working example for your chip or board that shows how to use the TSC. Here is one:

    https://github.com/STMicroelectronics/STM32CubeF0/tree/master/Projects/STM32072B_EVAL/Examples/TSC/TSC_BasicAcquisition_Polling

     

    Explorer II
    December 11, 2023

    Thank You, the problem was like trivial, when the group adress needed I was give the IO adress.