cancel
Showing results for 
Search instead for 
Did you mean: 

TSC not working STM32F042

kokbarnabas
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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

 

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

2 REPLIES 2
TDK
Guru

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

 

If you feel a post has answered your question, please click "Accept as Solution".

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