1
\$\begingroup\$

In a resistive touchscreen I am trying to read x-y position. The schematics is as followed. The code works fine and when I press a point, it reads correct position well but the problem is in standby ( when no touch ). The ADC shows the middle of the screen both for x and y instead of reading zero ( around 512 in a 10 bit ADC reading ). I set a parallel 4.7 k resistor from X1 and Y1 to ground and the result is better ( it reads around 20 in standby) but I have not seen such design anywhere and dont know which value of the resistor is the best if this is the solution. There is a good tutorial on resistive touchscreens by ATMEL here. In page 4, there is a table about the settings. I couldn't understand what Hi-Z stands for and I think the main result of my problem goes to that pull-up/int in the table for standby , but I couldn't find any sample code for setting a pull-up/int . What is that? should I clear SFIOR register PUD before reading and turning it off during the scan?

Schematics without resistor: enter image description here

Schematics with resistor:

enter image description here

\$\endgroup\$
3
\$\begingroup\$

Hi Z stands for "seemingly almost nothing connected", it acts as an open circuit, so you should take care of that situation if you want the other circuit to function properly.

Also, by the looks of it, 4.7k seems to be right in this scenario, as it would mean ~1mA at 5V, which is usually tolerable by most of the devices.

You should take a look at the uC datasheet on what resistance it uses for pulling down, and probably just set the port to pull down and the direction to input, but that might depend on what output impedance the touch module provides...

Copied form my comment below

According to the doc In stand-by mode one of the lines are connected to a level triggered interrupt in order to detect touch activity

It seems it stands for interrupt - if the device is touched, and goes out of standby, it pulls the line low to make the uC aware that it is touched. The uC has to switch mode of that pin to ADC at that time, and then it can detect the coordinate.

\$\endgroup\$
  • \$\begingroup\$ Thanks. So Hi-Z/ADC means reading ADC WITHOUT a pull-up? \$\endgroup\$ – Aug Sep 15 '13 at 11:27
  • \$\begingroup\$ Yes, and as the other end is Hi-Z too (i assume it goes to that when in standby), they both are just "floating". \$\endgroup\$ – ppeterka Sep 15 '13 at 11:28
  • \$\begingroup\$ Ok. One other question. in standby, what is Int in pullup/Int? \$\endgroup\$ – Aug Sep 15 '13 at 11:34
  • \$\begingroup\$ According to the doc In stand-by mode one of the lines are connected to a level triggered interrupt in order to detect touch activity It seems it stands for interrupt - if the device is touched, and goes out of standby, it pulls the line low, to make the uC aware that it is touched. The uC has to switch mode of that pin to ADC at that time, and then it can detect the coordinate. \$\endgroup\$ – ppeterka Sep 15 '13 at 11:36
  • \$\begingroup\$ Wow, that looks great! I will give it a try soon in a few hours. Please put this last comment in your answer as I can mark your answer as the correct answer . Thank you, it was a big help! \$\endgroup\$ – Aug Sep 15 '13 at 11:43
1
\$\begingroup\$

Hi Z is abbreviation for High Impedance (Z). Dont forget to use interrupt for touch detection.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.