Skip to main content
Visitor II
January 9, 2025
Question

Issue with the 4-wire resistive touch interfacing with smt32h743zi

  • January 9, 2025
  • 1 reply
  • 2027 views

i have written a driver code to run 4 wire resistive touch panel. I use only 1 adc and change its adc channel during runtime. Like i set X+ and Y+ as output high by default and X- and Y- set as low by default and set X- and y- pull down to make ADC read 0 when not pressed. Basically, I have few functions that change the configuration such as X+ and X- to output, set Y+ to analog and Y- to input to set Y+ and Y- as an output, set X+ to analog and X- to input. read x voltage in previous case and read y voltage in later case. ADC is only one to switch the configuration during runtime and its resolution is 16 bit with 810.5 cycles sampling time. 

 

ISSUES:

1- gpio output 3.3v and ground but its adc measuring voltage is from (0.7 to 1.15 for x axis) and (0.55 to 2.8 for y axis)

2- if i move the wires then its voltage ranges change.

 

Is this issue related with the firmware developed for running the 4-wire touch panel or hardware issue?

I have connected decoupling capacitors of 0.33uF across X+ AND X- and Y+ and Y- as well to stablize the 3.3v source from the mcu gpios.

 

 

Looking for your precious advice and solution!!!!

    This topic has been closed for replies.

    1 reply

    Graduate II
    January 9, 2025

    @Embedded_12engr wrote:

    I have connected decoupling capacitors of 0.33uF across X+ AND X- and Y+ and Y- as well to stablize the 3.3v source from the mcu gpios.


    I think this influences the reading. The foil has capacitance and resistance and you cannot read it too fast because of this. The voltage needs to stabilize. Adding additional capacitance will make it worse. Also you are adding capacitance on MCU outputs which will load the pins. Remove the capacitors and try tweaking your sampling rate.
    Also realize if the ADC measurement is ratiometric the exact supply voltage doesn't matter.

     


    @Embedded_12engr wrote:

    ISSUES:

    1- gpio output 3.3v and ground but its adc measuring voltage is from (0.7 to 1.15 for x axis) and (0.55 to 2.8 for y axis)

    2- if i move the wires then its voltage ranges change.


    You should not expect full range. You need to calibrate your measurement too.

    Your measurement should produce 5 resistance values. One of them is the touch resistance which varies based on how hard you push.

    Visitor II
    January 11, 2025

    Hi there, 

    Thank you so much for your response to my query.

    Can you please explain following terms in detail or through example:

    1. Also realize if the ADC measurement is radiometric the exact supply voltage doesn't matter. (Please explain radiometric term)

    2. Your measurement should produce 4 resistance values (what four resistance values?)
    3.  You need to calibrate your measurement too. (what to take in reference for calibration?)

     

    Please explain my touch code logic also ok or I need to change the logic?

     

    Looking for your precious advice and solution!!

    Graduate II
    January 11, 2025

    ratiometric means the ADC uses the same reference as the signal. So if the reference is the power supply and the same power supply is used for a voltage divider the resulting measurement is a ratio. No need to calculate an absolute voltage or resistance.

     

    Here is an application note. On page 4 you can see what I meant with the 5 resistors
    https://ww1.microchip.com/downloads/en/AppNotes/doc8091.pdf