Touchscreen module hardware query

Coding and general discussion relating to user created compiler modules

Moderators: David Barker, Jerry Messina

Post Reply
blackcattech
Posts: 113
Joined: Mon Jan 11, 2010 10:39 pm
Location: Chesterfield

Touchscreen module hardware query

Post by blackcattech » Sat Feb 13, 2010 4:27 pm

I'm developing a touch-screen control unit using Swordfish and an LCD/Touch screen combo purchased via eBay. I've used the Touchscreen module but the accuracy of the touchscreen reading is not so good. There seems to be a lot of 'noise' in the position calculation - using a program which plots a single pixel based on the touch position you almost get an 'airbrush' effect even with a fine stylus.

I wonder if this is due to the variation in the signal being too small. The module says to use 10k pull-down resistors but does not explain how this value was arrived at. The touchscreen I'm using seems to have quite a low resistance - the datasheet suggests 500-1k for one axis and 300-600 ohms for the other. Using a 10k resistor would surely only give around 1/20th of the range, or around 50 counts across the full screen.

However, I tried dropping the resistance to 1k5 and the screen became almost impossible to use - it wouldn't respond to touches unless I was using the flat of my thumb.

Any suggestions on how to work out what pull-down I need?

User avatar
Steven
BETA Tester
Posts: 406
Joined: Tue Oct 03, 2006 8:32 pm
Location: Cumbria, UK

Post by Steven » Tue Apr 13, 2010 7:29 pm

I experienced a similar lack of precision when developing the touchscreen module. I overcame it by averaging a read from the top-left and the bottom-right, but this is part of the module now, so it seems that this is not enough in your case.
I don't think changing the pull-down resistors is the answer. The touch screen works by connecting the left and right sides of the top touchscreen layer to 0 and 5V (hence forming a potential divider) and then, when touched, this connects with the bottom layer and the voltage at this touch point is read from either of the analogue channels connected to the bottom two terminals at the top and bottom edges. This gives the x-position. Then the top and bottom edges of the bottom layer are connected to 0 and 5V and the voltage is read from the anaolgue channels connected to the top layer. The pull-down resistors do not form part of the potential divider itself. They are there to pull the voltage down to 0V when the screen is not touched (and not leave them floating) so that you can accurately work out when the screen is touched using the PenPressure subroutine in the module. In order to do the pull-down without affecting the analogue reading significntly when the screen is actually touched, the value of the pull down resistors must be quite high (certainly, at a guess, 10 times the resistance of the touchscreen, measured between left and right connections).
I'm not sure what else I would suggest to improve the reading. You might possibly try increasing the option TS_Pen_Down_Threshold to reject any light touches, or increasing the delays in the options. I take it that you have set up the analogue channels etc as in the module header?

Hope this helps, Steve

Post Reply