test1
March 30, 2017, 03:27:23 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: You can attach photos hosted by the forum rather than using an external image hosting site, this means they will stay forever and not disappear after a year or two.
 
   Home   Help Search Login Register  
Pages: 1 [2] 3 4 ... 8
  Print  
Author Topic: Some technical information on ADB tablets.  (Read 49823 times)
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #15 on: October 17, 2010, 09:26:16 AM »

After a bit of tinkering (well that took me about 5 hours of "I-should-have-gone-to-bed-instead" time). Got my Eclipse environment working with the Arduino UNO.  Up to the point of when I change a line in a source file, I hit CTRL+S (to save the file) and "boing!" the Arduino is now running my new change about 2-3 seconds later. Well, that auto-download step is fine for certain projects, but not all obviously (it is of course optional). 

In all, I think I am now ready to start the ADB bus decoding logic on the UNO (for the purpose of "sniffing/tracing" the bus). The Arduino UNO has an ICP (Input CaPture) pin but none of the pin has both an InputCapture and OutputCompare combined (like the PC7 on the Teensy).  For my setup, it is fine, since I am only going to "read" only from the ADB bus from the UNO (no need for the OutputCompare).  But if the UNO would have to be used as the ADB bridge I think one would have to hard-wire two pins together (by making sure one is not going against the other in the software). Another annoyance about the UNO: I think it does not have a 16Mhz crystal to drive the main CPU but uses a "resonator" (which is not as accurate).  Previous Arduino models had the crystal. To add to the twisted weirdness: it actually *still* have such a crystal... but to drive the "USB" chip only (which is another ATmega btw).  I hope that the resonator will be accurate enough to read the ADB bus -- I assume it will be "ok" given the fact that the ADB bus is relatively slow.  Tongue 
Logged
Osgeld
New Poster
*
Posts: 4


View Profile
« Reply #16 on: October 17, 2010, 07:46:23 PM »

yea your splitting hairs over accuracy at these speeds and tolerances , I use a resonator on my boards (cause they are easier to wire), though I share your disappointment about a "pro" made board, if nothing else if they were smart about it they could have used 1 crystal for both and daisy chained them
« Last Edit: October 17, 2010, 07:48:11 PM by Osgeld » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #17 on: October 18, 2010, 02:31:44 AM »

Given the fact that this board is an upgrade from a Crystal-based design, I would expect that they picked a good part. I'll stop worrying about it now (nothing much I can do about it anyways).
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #18 on: October 23, 2010, 05:03:58 AM »

Progress update:

I started coding my little "ADB Sniffer" using an Arduino UNO board.  I am to the point where I can see the "Talk" and "Listen" standard "packets".  Here's the output for a Wacom in HID Mouse mode through an IMate. (Mouse messages have 2 bytes of data) along with the many [3T0] polling (Address=3, Talk, Register 0).  Here we see all packets from the time the iMate & the Wacom gets powered up.

Code:
[3L3:602][2T0]x100 [2T2][2L2:06][2T0]x100 x100 x100 x100 x100
x100 x100 x100 x100 x100 x100 x18 [3T0:80FF][3T0][3T0:FEFF][3T0]
[3T0:FEFF][3T0:FD80][3T0:FEFF][3T0:FF80][3T0:FDFD][3T0:FEFE][3T0:FFFF][3T0:80FD][3T0:80FE][3T0:80FF]x2
[3T0][3T0:80FF][3T0]x2 [3T0:FEFF][3T0:FE80][3T0:FFFF][3T0][3T0:FFFE][3T0:8380][3T0:8281]
[3T0:8181][3T0]x100 x100 x100 x93 [3T0:8080][3T0]x34 [3T0:8080][3T0]
x2 [3T0:8280][3T0:8580][3T0:83FF][3T0]x2 [3T0:85FB][3T0:83F8][3T0:80F7][3T0:80F9][3T0:80FD]
[3T0:FFF9][3T0:80FB][3T0:80FC][3T0:80FE][3T0:FFFB][3T0:FFFA][3T0:80FD][3T0:FDF9][3T0:FEF8][3T0:FEF9][3T0:FFFD]
[3T0:FDFA][3T0:FEFB][3T0:FEFD][3T0:FFFF][3T0:80FF][3T0:FEFE][3T0]x2 [3T0:FFFE][3T0]x4
[3T0:FF80][3T0:8085][3T0:8082][3T0:8083][3T0:8181][3T0:8082][3T0][3T0:8181][3T0:8081]x2 [3T0:8180]
[3T0:8081][3T0]x11 [3T0:0080][3T0:7BFD][3T0:7EFF][3T0:7DFE][3T0:7F80][3T0:00FF][3T0:7E80][3T0]
[3T0:7F80][3T0]x2 [3T0:0180][3T0:282][3T0:0181][3T0]x3 [3T0:8281][3T0:8483][3T0:8584]
[3T0:8283]x2 [3T0:8082][3T0:8284][3T0:8085][3T0:FF85][3T0:8082][3T0:FE84]x2 [3T0:FF82][3T0:FD85]
[3T0]x100 x100 x100 x100 x100 x100
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #19 on: October 24, 2010, 07:52:31 AM »

I think my ADB sniffer is mostly done (it now detects SRQs too).

I hooked the sniffer to a Mac Classic with the UD-0608-A board and looked at all the initialization from the moment the Mac is powered up.

The first interesting stuff that the Wacom driver seems to send to the board looks like [without any interaction with the board]:

Code:
[4T1:384850003C000617]
[4L3:6F68]
[4T3:6968]
[4L1:6768]
[4T1:386B50003C000617]
[4T0:800000003CFF0000]
[4T0]
[4T0]
[4T0]
...


-- and after interacting with the pen:

Code:
[4T0:E04B110E448028F5]
[4T0:E04ACA0E208027F5]
[4T0:E04A530DC38026F5]
[4T0:F149C60D9EE01BF6]
[4T0:F1491C0DDE4112F7]
[4T0:F148F60DE7480EF8]
[4T0:F148E20DE74208F8]
[4T0:F149190DA8B403F9]
[4T0:E0494E0D9D8003F9]
[4T0:E049600DB48003F9]
[4T0:A049520E018005F9]

I think I am at the stage of looking at the actual data (and match with tufty's excellent ADB analysis) to start implementing on the Teensy!  yay!  Grin
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #20 on: October 24, 2010, 08:36:09 AM »

I must say that I am very much tempted to work on the bridge to USB (and skipping the ADB -> Serial project). To emulate the serial port protocol, there is that baud rate changing crap and maybe other serial port nitty-gritty annoyances to deal with. Serial has no future since Wacom dropped its support.

On the other hand emulating a USB version also requires quite some work! 
As a motivation, I do have the source code to make a working HID mouse and/or keyboard with the Teensy (thanks to Paul -- teensy guy). In addition, the USB protocol must be "documented" since the linux guys had to code against it. So I guess I would have to dig that a bit more carefully.

For this, I have to find a good USB sniffer tool (that works with Windows 7, 64 bits). Can't shoot in the dark.

Logged
farinasa
Guest
« Reply #21 on: October 25, 2010, 05:46:09 AM »

If you are looking for encouragement, I can at least give that.  I think working toward the serial > usb emulation would be more beneficial in the long run.  It seems like you can find old tablet pc digitizers all over ebay for fair prices.  Achieving this would open a flood gate of available mods.  I have a couple serial digitizers that I would like to get working with windows 7.  I was originally going to wire them to a serial > usb converter and attempt using one of the third party drivers like vtablet or tablet magic.  However, being able to install the standard wacom drivers would certainly make my project a million times easier, but I also think that if there was an easy way to do it, many more people would be encouraged to take on this sort of project.
« Last Edit: October 25, 2010, 05:47:43 AM by farinasa » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #22 on: October 25, 2010, 04:16:35 PM »

farinasa: thanks for the encouragement.

I understand that there are many more serial boards than ADBs out there. Rest assured that I want to do the serial version since I personally have many of those boards myself -- including a recently acquired TabletPC Wacom digitizer.

I am doing the ADB version as an incentive since (unlike the serial) a hardware solution is about the only way to connect it on most systems. (there are ADB-USB products out there you can get on ebay only if you are lucky but they will not work without suitable drivers).

I am making progress, but I am still at an early stage on the USB side of things (which is the most difficult part). (EDIT: the USB portion is virtually done now). This is a pure hobby fueled by passion and, like I always say, it is stealing time of much more important private life activities. It can stop at any time. Getting more encouragements will certainly help keep the flame alive and the project going.  So thanks again Smiley

From the top of my head, here's how the serial bridge might involve hardware-wise:

For a TabletPC 3.3v TTL serial interface: the Teensy 2.0 can do it but you have to buy and solder a 1$ regulator in the back to generate and interface the 3.3v.  http://www.pjrc.com/store/mcp1825.html  There is something about reducing the cpu core clock speed to 8Mhz (internal setting). For this type of application (low USB bandwidth), it should work perfectly fine. (I emailed Paul to check on that and he says the USB speed should not be affected).    If the TabletPC board is a 5v-compatible TTL serial interface, then no need for the regulator. You just need to hook up the good power and serial signals and you are in business.   

For connecting to a standard serial board: (still with the Teensy 2.0) - there are many options that depends on your skillset. The cleanest and cheapest solution would involve modifying the wacom to inject the 5v from the Teensy and hooking to the TTL serial signals (probably requires partially disconnecting the regulator and the serial driver chip). No external power would be required.  Without modifying the Wacom, you would need to have an external power and also "drive" the TTL serial signals to be RS-232-compatible (using a MAX232 or equivalent), get a DB-9 connector, solder all that and connect it.  EDIT: it might be possible to get away without any external power supply ("pump-up" the 5v to feed 9v-12v to the tablet through its DB9 connector). I think there should be enough power (mA) from the USB port. This requires an additional IC (+supporting electronics) to perform the voltage boost. But again, this is if you do not want to alter the Wacom or want somebody else to construct this for you without touching your Wacom.
« Last Edit: December 23, 2010, 09:01:45 PM by bernard » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #23 on: October 26, 2010, 01:44:11 AM »

The only USB device that I have is a Graphire 3. I am going to use that one as an example until I get my hand onto a USB intuos1/2/3/4.

If anybody has one of these, can you run microsoft USBView http://www.ftdichip.com/Support/Utilities/usbview.zip  and copy the descriptor entries associated with the Wacom?

Here's the output for my Graphire3:

Code:
Device Descriptor:
bcdUSB:             0x0101
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x08 (8)
idVendor:           0x056A (WACOM Co., Ltd.)
idProduct:          0x0014
bcdDevice:          0x0314
iManufacturer:        0x01
0x0409: "WACOM"
iProduct:             0x05
0x0409: "CTE-630-UV3.1-4"
iSerialNumber:        0x00
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Low
Device Address:       0x04
Open Pipes:              1

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x0A

Configuration Descriptor:
wTotalLength:       0x0022
bNumInterfaces:       0x01
bConfigurationValue:  0x01
iConfiguration:       0x00
bmAttributes:         0x80 (Bus Powered )
MaxPower:             0x14 (40 Ma)

Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x01
bInterfaceClass:      0x03 (HID)
bInterfaceSubClass:   0x01
bInterfaceProtocol:   0x02
iInterface:           0x00

HID Descriptor:
bcdHID:             0x0100
bCountryCode:         0x00
bNumDescriptors:      0x01
bDescriptorType:      0x22
wDescriptorLength:  0x0062

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x0008 (8)
bInterval:            0x0A
Logged
AmbiDextrose
Full Member
***
Posts: 74


View Profile
« Reply #24 on: October 27, 2010, 01:48:40 PM »

Wacom Intuos 3
Code:
Device Descriptor:
bcdUSB:             0x0110
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x08 (8)
idVendor:           0x056A (WACOM Co., Ltd.)
idProduct:          0x00B7
bcdDevice:          0x0116
iManufacturer:        0x01
0x0409: "Tablet"
iProduct:             0x02
0x0409: "PTZ-431W"
iSerialNumber:        0x00
bNumConfigurations:   0x01

ConnectionStatus: DeviceConnected
Current Config Value: 0x01
Device Bus Speed:     Full
Device Address:       0x03
Open Pipes:              1

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x000A (10)
bInterval:            0x04

Configuration Descriptor:
wTotalLength:       0x0022
bNumInterfaces:       0x01
bConfigurationValue:  0x01
iConfiguration:       0x00
bmAttributes:         0x80 (Bus Powered )
MaxPower:             0x96 (300 Ma)

Interface Descriptor:
bInterfaceNumber:     0x00
bAlternateSetting:    0x00
bNumEndpoints:        0x01
bInterfaceClass:      0x03 (HID)
bInterfaceSubClass:   0x01
bInterfaceProtocol:   0x02
iInterface:           0x00

HID Descriptor:
bcdHID:             0x0100
bCountryCode:         0x00
bNumDescriptors:      0x01
bDescriptorType:      0x22
wDescriptorLength:  0x00AA

Endpoint Descriptor:
bEndpointAddress:     0x81  IN
Transfer Type:   Interrupt
wMaxPacketSize:     0x000A (10)
bInterval:            0x04

Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #25 on: October 27, 2010, 06:49:26 PM »

Thanks Ambidextrose, very informative!  There are quite a few things to note here:

- They (seem) to be both HID devices, which is a good thing -- it will facilitate the work.
- the MaxPacketSize is 10 instead of 8 -- that is probably a good indication of the different Wacom protocols (like you were mentioning at one point). 
- Mine is tagged as "Low speed and yours is "Full" speed;
- Mine is 40mA  and yours is 300 mA
- The manufacturer id is the same 0x0409 -- but the "string" name is different:  "WACOM" (mine) and "Tablet" (yours). That probably means I could put a custom suffix string in there for me to "distinguish" that I am in front of my "emulation" and not a real Wacom tablet -- without worrying to much about breaking the compatibility with Wacom drivers. (I need to build a small utility to setup options).
- there is some sort of "bInterval" difference (is this about polling time?*) Yours seems faster.

*I guess I should read the USB specification to know more what all this means Tongue *sigh*
« Last Edit: October 28, 2010, 12:50:51 AM by bernard » Logged
AmbiDextrose
Full Member
***
Posts: 74


View Profile
« Reply #26 on: October 27, 2010, 07:27:04 PM »

Yep - bInterval is the interval time (i.e., 10ms for the Graphire, 4ms for the Intuos) between packets. The packet length of the Graphire is kinda curious - looking in the Linux WACOM driver source code, Protocol IV packets are usually 7 bytes unless it includes tilt information which bumps up the packet size to 9 bytes. The 8 bytes reported by the Graphire is unusual. Unless they just pad the last byte with zeros.
« Last Edit: October 27, 2010, 07:29:28 PM by AmbiDextrose » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #27 on: October 28, 2010, 12:12:28 AM »

I built a little "rawhid" application (a sligthly modified Teensy sample) and I actually receive only 7 bytes when I manipulate the pen. Maybe some packets are 8 bytes for initialization or configuration purposes?? 

Here's the app (if one wants to try it out): It looks for the first Wacom USB (HID) device you have on your system.
 
http://sites.google.com/site/bernardpublicstuff/wacom_rawhid_dump.zip

Code:
C:\dev\rawhid\rawhid>wacom_rawhid_dump.exe
found rawhid device with VendorId = 0x056A

recv 7 bytes:
10 F5 08 37 18 00 00

recv 7 bytes:
10 21 09 3E 18 00 00

recv 7 bytes:
90 50 09 46 18 00 00

recv 7 bytes:
91 B2 1A D4 18 E9 01    <-- pen down: pressure = E9 it seems



Logged
AmbiDextrose
Full Member
***
Posts: 74


View Profile
« Reply #28 on: October 28, 2010, 05:02:23 AM »

Bernard,

There may be something wrong with how you're building your bytes from the serialized bit-wise data. WACOM Graphire tablets use Protocol 4. For stylus coordinate packets, only the first byte should have the MSB set to '1' - this is the delimiter for the packet 'header'. All other byte should have the MSB set to '0'. Thus, the 2nd thru 7th bytes should not exceed 7F (0b01111111).
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #29 on: October 28, 2010, 06:07:24 AM »

AmbiDextrose: That's quite intriguing info you are giving me now. I actually did not code the portion that manipulates the data, I only modified the "filtering parameters" to select a "Wacom" HID USB device.

I just did another test:

That utility above outputs (this packet, I believe, had the maximum 0xFF pressure value):  EDIT: the max pressure value is 0x01FF (511) (expressed here as FF 01)
Code:
recv 7 bytes:
91 AF 22 AF 20 FF 01

At the same time, I had a USB tracing utility that gave me *8 bytes*:
 
Code:
02 91 AF 22 AF 20 FF 01

But the "HID" view of that same packet (in the same USB tracing tool) only shows me 7 bytes. Probably that "02" has something to do with the HID-protocol. "A Report number or whatever?"

Code:
000166: Report Arrived (UP), 28.10.2010 00:52:31.763 +0.008
Report Name:Digitizer
Unknown[0..255]: 145
Unknown[0..255]: 172
Unknown[0..255]: 34
Unknown[0..255]: 180
Unknown[0..255]: 32
Unknown[0..255]: 255         
Unknown[0..255]: 1
         

So if a commercial tool is giving out exactly the same stuff, I am pretty certain that the utility (that I did not code really) also gives the good data. I still trust it.

Where do you see that MSB bit thingy again?
« Last Edit: November 09, 2010, 09:31:28 PM by bernard » Logged
Pages: 1 [2] 3 4 ... 8
  Print  
 
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!