Issue with the 4-wire resistive touch interfacing with smt32h743zi
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!!!!
