KB Gear Pablo Graphics Tablet Protocol

KB Gear went out of business (or something) and so these "Pablo Internet Edition Graphics Tablet" thingies are now cheap as borscht, especially because the Windows drivers have sucked forever and ever (amen).

I accidentally got the serial-only version (i.e., no USB cable), so I had to figure out the serial protocol to use it in Linux. Nobody seems to have done that before. So I'm posting my experience here, though it is no doubt dull and boring.

Source for a simple driver is here: tablet.c tablet.h

First things first, I hooked it up to my scope just to be sure, so I wouldn't waste time on a garbled stream: it communicates at 9600 8n1. That is to say, 9600bps, with one start bit, one stop bit, and no parity or other gobbledygook.

It transmits a series of packets. It's pretty much constantly sending packets over whenever the pen is anywhere near the board. A packet consists of a byte with the most significant bit set, followed by a sequence of bytes without that bit set. So it's pretty easy to accumulate characters and when you see one with the MSB set, just flush all the ones you've read thus far into your packet handler.

There are two types of packets that I could figure out. The first is the 1-byte packet. It looks like this (bits are shown MSB first):

1??? 1000
This packet appears to exist to indicate that the pen has just come into range of the tablet's sensors, and we should expect a bunch more packets to come. I don't know its real purpose, maybe it is to warn us that the first couple packets may not really represent where the user wants to touch it? I have not figured out the "???" bits -- they seem to take completely random values in most conditions.

The other type is your typical data packet, it is 6 bytes long, and has the following format:

1??? 00bt 0xxx xxxx 0xx0 0xxx 0yyy yyyy 0y00 yyyy 00pp pppp
           876 5432  10   BA9  765 4321  0   BA98   54 3210
The second line there indicates the bit significance, higher numbers mean more significant bits. So you have 3 mystery bits ("???"), a button press indicator, a touch indicator (these are mutually exclusive and touch is flakey), 12 bits of X (in a funny order), 12 bits of Y (in a funny order), and 6 bits of pressure. Pressing the button causes it to stop sending pressure feedback -- cruddiness abounds.

Occasionally it also spat out 4-byte packets, which I ignore. Their format appeared to be:

1??? 00bt 0yyy yyyy 0y00 yyyy 00pp pppp
           765 4321  0   BA98   54 3210
I also saw a couple 7-byte and longer packets, but I'm hoping that was just line noise.

Questions? Email me (pablo at galexander.org)

Sun Aug 8, 2004 - Greg Alexander