DIY Light pen- how tosend absolute position & pressure to PC/software?

I'm planning on converting an old CRT monitor to use a light pen.

I have the hardware side of things largely figured out, so I can get an absolute position of the pen on the screen and a pressure value, but I don't know the best way to go about getting those values into the PC or software.

Ideally, I'd like to use R-S232 or PS/2 to connect to the PC, in both of which the cursor could be homed by the hardware and then moved to an absolute position by keeping track of the relative positions sent, all using the standard drivers, albeit without a pressure input. However, I have found this specification for synaptics touchpads, which provides information on using their driver to send more data (including pressure) over the PS/2 or serial connection, but I can't tell if the absolute mode is intended to work as I want it to, or if is simply to catch and correct any bad position reports. I also doubt this pressure input will be recognised or used by any software.

The only alternative I can see is USB, which looks horrible to try and implement, and still doesn't look as though it will support a pressure input with the standard drivers. Ideally I'd like to try to emulate one of wacoms touchscreens, as this would allow me to use their drivers, allowing it to be compatible with most software, though so far I have been unable to find any information on this, and don't expect that I will be able to get it without borrowing a tablet and watching the communications with the PC.

Which interface would be best, and does anyone have any suggestions regarding drivers?

Thanks in advance for any help.

sort by: active | newest | oldest
Can't you use the mouse profile on an Arduino Leonardo to stuff it into USB ?
The Skinnerz (author)  steveastrouk4 years ago
Thanks for the reply.

I had been looking at something like that for USB, but using the standard HID drivers the only improvement over PS/2 or serial would be proper support for inputting an absolute position. However, there does seem to be a lot of support for using MIDI devices as inputs, so if it presents itself to the PC as a MIDI device and a mouse over the same USB, then this approach may be worthwhile.

Alternatively, how hard is it to write drivers for custom hardware? I recently learned the basics of C, and this seems like a good excuse to learn to do something useful with it.
Put it this way, I've been programming on and off for 30 years, and windows device drivers scare the hell out of me....

See what's been done with the MBED , using the 11U24 device.
The Skinnerz (author)  steveastrouk4 years ago
I think I'll stick to using the standard drivers for now then, at least I can confine faults to the hardware that way.

At the moment, PS/2 looks to be the best option, with a combination keyboard/mouse connector to send a stream of keyboard shortcuts instead of trying to create a genuine pressure input. USB probably would be better in the long term, but I can't see any way to use any of the existing USB mouse programs in an assembly program without a huge amount of work.
Mbed might be a better option altogether then.
The Skinnerz (author)  steveastrouk4 years ago
Thanks for the suggestion, it does seem a little excessive for what this project is at the moment, but I may look into it later when I've got a bit more experience with writing PC software.