SLAAEU1 August 2025 MSPM0L1306 , MSPM0L1306
The reason why touch detection is used is that problems can occur if the measurement method is used to do the detection.
When the resistive layers are not connected, the ADC is floating. When there is no touch, the result is strongly affected by the noise coupled from IO switch. That means ADC constantly outputs a fixed coordinate. When touch happens, a resistance is included between two resistive layers, which is very high when the touch is very weak. This also generates disturbance on the ADC output.
The MSPM0 setup is shown in Figure 5-2. Set the Y-axis to positive IO and Y-axis to negative IO for all outputs high when doing the detection. In this demo, ADC is used to do the measurement. For low-power requirement, users can use GPIO instead and paired with the wake-up function.
Use ADC to do the detection to filter the low-pressure condition for a touch action. TOUCH_DETECTION_THD in resistive_detection.h is used to do this. The MSPM0 ADC is configured in 8-bit mode, which means the max output counter is 255. Users can slightly adjust this parameter value to check when to release the detection signal.
Figure 5-3 Touch Detection Threshold