This site is no longer active and is available for archival purposes only. Registration and login is disabled.

Stylus input wastes CPU cycles


Postby James S » Feb 27, 2003 @ 2:26am

<img src="http://home.comcast.net/~sonne/james/tag.gif">
James S
pm Insider
 
Posts: 17064
Joined: Jan 12, 2002 @ 2:33pm
Location: Lexington, KY


Postby JoJo » Feb 27, 2003 @ 7:36pm

I used to write driver for touch panel and I would like to share my experience on touch panel.

The following is its mechanism.

1. When the touch panel (TP) is tounched, an interrupt is generated. Disable the interrupt for YP, but it depends on hardware design. If the interrupt is generated by falling/raising edge, it may be not neccessary. If it is generated by low/high, we need to disable the interrupt.

2. The driver has to control the IO to provide a voltage across the Y (can be X if step 3 is Y)panel and start the AD to measure the voltage. It will need to wait for sometime because the mechanism of AD. It is used for get Y coordinate.

3. The driver has to control the IO to provide a voltage across the X (can be Y if step 2 is X) panel and start the AD to measure the voltage. Again,it will need to wait for sometime because the mechanism of AD.It is used for get X coordinate.

4. The step 2 and 3 may be repeated a couple times for taking average. (It is because hardware may not be reliable.)

5. Set the I/O to check if the TP is pressed.

6. If the TP is pressed, the driver has to wait a default period and repeat checking again to generate PEN_MOVE message.

7. If the TP is released, set the interrupt works again.

Factors which eats CPU cycles.

1. If timer is avialable in step 2 and 3, it will save your CPU cycle because the driver designer may use interrupt for checking the reading of AD.

2. If the speed of AD is fast, the driver don't need to spend much time on getting reading.

3. Some driver designer, however, simple use polling to checking the reading. Then your CPU cycle will be wasted.

4. If the TP is pressed, the frequency of checking it by driver is also important.
JoJo
pm Member
 
Posts: 25
Joined: Feb 12, 2003 @ 9:28pm
Location: Hong Kong


Postby JoJo » Feb 27, 2003 @ 8:04pm

Correction. It should apply voltage across Y panel to get x coordinate and apply voltage across X panel to get y coordinate.
JoJo
pm Member
 
Posts: 25
Joined: Feb 12, 2003 @ 9:28pm
Location: Hong Kong


Postby Kzinti » Feb 27, 2003 @ 9:46pm

So if I understand correctly, this is working in a similar way to analog joysticks. In that case, the slow down is easily explained and there isn't much we can do about it.

Thanks for the info Jojo.
Kzinti
pm Member
 
Posts: 3238
Joined: Jan 13, 2002 @ 5:23am


Previous

Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron