If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.
Special Thanks To:
Aaron Holmes
Aaron Wheeler
Adam Horden
Alan Scrimgeour
Andre
Andrew Haynes
Anonymous000
asabase
Austin Weil
barney
Barry
Bert Hickman
Bill Kukowski
Blitzorn
Brandon Paradelas
Bruce Bowling
BubeeMike
Byong Park
Cesiumsponge
Chris F.
Chris Hooper
Corey Worthington
Derek Woodroffe
Dalus
Dan Strother
Daniel Davis
Daniel Uhrenholt
datasheetarchive
Dave Billington
Dave Marshall
David F.
Dennis Rogers
drelectrix
Dr. John Gudenas
Dr. Spark
E.TexasTesla
eastvoltresearch
Eirik Taylor
Erik Dyakov
Erlend^SE
Finn Hammer
Firebug24k
GalliumMan
Gary Peterson
George Slade
GhostNull
Gordon Mcknight
Graham Armitage
Grant
GreySoul
Henry H
IamSmooth
In memory of Leo Powning
Jacob Cash
James Howells
James Pawson
Jeff Greenfield
Jeff Thomas
Jesse Frost
Jim Mitchell
jlr134
Joe Mastroianni
John Forcina
John Oberg
John Willcutt
Jon Newcomb
klugesmith
Leslie Wright
Lutz Hoffman
Mads Barnkob
Martin King
Mats Karlsson
Matt Gibson
Matthew Guidry
mbd
Michael D'Angelo
Mikkel
mileswaldron
mister_rf
Neil Foster
Nick de Smith
Nick Soroka
nicklenorp
Nik
Norman Stanley
Patrick Coleman
Paul Brodie
Paul Jordan
Paul Montgomery
Ped
Peter Krogen
Peter Terren
PhilGood
Richard Feldman
Robert Bush
Royce Bailey
Scott Fusare
Scott Newman
smiffy
Stella
Steven Busic
Steve Conner
Steve Jones
Steve Ward
Sulaiman
Thomas Coyle
Thomas A. Wallace
Thomas W
Timo
Torch
Ulf Jonsson
vasil
Vaxian
vladi mazzilli
wastehl
Weston
William Kim
William N.
William Stehl
Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Registered Member #1143
Joined: Sun Nov 25 2007, 04:55PM
Location: Vilnius, Lithuania
Posts: 721
Hello. Not that long ago, i wanted to reverse engineer my old phone capacitive touchscreen, because resistive touchscreen is just pain to work, and it is very unstable at low pressure.
Inspired by MikeElectronicStuff video about reverse engineering ipod screen, i ordered connector for TP, and also connector for phone, so i can hook my MSO2024B on I2C bus so i can decode it.
For tp init (at power-up ), it sends 6 packets containing 16b of data like this: [(80).<FF>,<10>] [(80).<41>,<04>] [(80).<44>,<0C>] [(80).<FF>,<04>] [(80).<F0>,<81>] [(80).<F1>,<01>]
80 is address, and it writing (8 bit is zero) "[" is i2c start condition, and "]" is stop condition ok, so i next, i need to read coordinates from TP. It is capable of tracking two fingers at the same time, so x0,y0,p0 and x1,y1,p1 are variables ( well, as far as i know ). x and y is just coordinates (screen is 800x480 so x and y should be inside this limit) and p is pressure , so but in phone is represented p as float value between 0.0 and 2.0 ( i get around 1,5 )
To get data from screen, TP controller have IRQ line, when IRQ goes low i have data in TP, easy.
Now comes the tricky part, in where i need your help . Yes, it is data decode.
Packet to get data looks like this:
[(80,<00>[(81)
,<XX>,<XX>,<XX>,<XX>,<XX>,<XX>,<XX>,<XX>,<XX>,<XX>
,<XX>,<XX>,<40>] As you can see, it has two start condition, and 81 is address 80 with read bit. After that, follows 12 packets of data about coordinates (+ additional data ? who knows, no pdf for controller ), and burst always ends with 41 or 40 (it is always toggles from 41 to 40, first packet always is 41, second 40, then 41, then 40, I bet it is static data.
Now, any one have any idea how to decode message (12 char long, i know only one thing, that last 4 packets is for x1,y1,p1, since if i hold only one finger, data is zero in last 4 packets )
And yes, i already have this controller working with STM32F4, with interrupt enabled, so only decoding in software is left.
Example of packet for singe touch:
Now i will make a list for packet data and coordinates for singe and double touch, so some one could help me decode it.
what will be same x y for singe and double touch, same x and different y for multitouch and so on.
Registered Member #1143
Joined: Sun Nov 25 2007, 04:55PM
Location: Vilnius, Lithuania
Posts: 721
Hm, problem. it looks that data is not that stable, while x,y,p is stable,i2c data jitters in some packets. So it looks that it has some sort ADC output, since data should be dead stable,but it's not.
So right now trying to make a table with correct data for decoding protocol :(
controller is Synaptics T1007A2, and no datasheet or anything. Can some one extract data from HTC desire SDK ?
Registered Member #1938
Joined: Sun Jan 25 2009, 12:44PM
Location: Romania
Posts: 701
The touchscreen in Android, is linked in software using the Linux input event files. These are located under /dev/input/eventX where X is an index attributed to each input device.
The format accepted by these input event node files is:
struct input_event { struct timeval time; unsigned short type; unsigned short code; unsigned int value; };
Most likely the data you've intercepted is in this format already. I already wrote a code library to handle these (both reading and injecting events) , so it would be a good start point for what you are doing. I can't post it here as it's big and with lots of details, but you can read more here:
Also if there is anything else I can do to help, let me know. I'd say you already did the hard part by making the hardware interface work, the rest is just putting the data in the right format.
Registered Member #1143
Joined: Sun Nov 25 2007, 04:55PM
Location: Vilnius, Lithuania
Posts: 721
well, i need to be able decode 12 packets from I2C bus. in attached file is all information about TP data conversion to X and Y and P parameters, but i just don't know where. Maybe you can spot it ?
ok, from static void synaptics_ts_work_func(struct work_struct *work) function, i get something like this: int x = buf[3] | (uint16_t)(buf[2] & 0x1f) << 8; int y = buf[5] | (uint16_t)(buf[4] & 0x1f) << 8; int z = buf[1]; int w = buf[0] >> 4; int finger = buf[0] & 7;
and
int x2 = buf[3+6] | (uint16_t)(buf[2+6] & 0x1f) << 8; int y2 = buf[5+6] | (uint16_t)(buf[4+6] & 0x1f) << 8; int z2 = buf[1+6]; int w2 = buf[0+6] >> 4; int finger2 = buf[0+6] & 7;
i will try that later, but still something here is missing, like screen size or something
Hey, it does work. I only needed to calculate scaling coefficients, and it spot on. (kx+b=data)
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.