Bongofish
November 19, 2017, 04:58:20 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
  Print  
Author Topic: Converting Wacom KT-0405-R from Serial to USB  (Read 32212 times)
Manni
New Poster
*
Posts: 19


View Profile
« Reply #30 on: June 15, 2012, 07:29:46 PM »

After putting the (non functional) Teensy away for a while I have found some time to try it again. Maybe I was over-worked back than, because now I found the error quite easily: I soldered the cables to the wrong side of the serial connector. So the cable for pin 2 was connected to pin 4, the cable for pin 5 was connected to pin 1, ... I think you get the picture. Stupid me!

Now it not only looks better but it also works. At least a bit.

At first I had the debug software loaded into the Teensy. The tablet's PS/2 power connector stayed where it was (i.e. in the computer's PS/2 connector), I plugged the serial connector into the Teensy's and inserted the USB connector. When I now moved the stylus I saw some nice data with HID_LISTEN.

Next I loaded the correct software into the Teensy. I already had the Wacom drivers installed for quite some time, so it took not long for the tablet to be recognized.

Wow! Now I have an Intuos!

BUT: Here's what I did next: Disconnect USB to Teensy. Disconnect the PS/2 power from my computer and connected it to the (USB powered) PS/2 connector of the Teensy. Connect USB to Teensy.

The Teensy was flashing very fast and did not stop. No tablet was recognized! So I disconnected the USB cable and tried it again. Nothing. I even rebootet my computer after some more unsuccessful tries. Nothing. I wasn't even able to load a different software into the Teensy because it apparently was not found.

After two more reboots (with all cables connected) I had a working stylus again! But only partially: Now I've got a flickering mouse pointer. As soon as I lower the stylus and move it just a tiny bit the mouse cursor jumps every few miliseconds to a different position. It only moves in y direction and the distance of this jumps seems to be proportional to the y position: When the cursor is at the top of the screen the jump is almost not noticable but when it's at the bottom (1920x1200) the jump is probably about 50 pixels.

The strange thing is that it already has worked. Maybe I'll try this whole process again to check if the original Wacom driver does some special things to the tablet... Or do you already have any idea?
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #31 on: June 15, 2012, 08:52:44 PM »

Have you fixed the pullups/pulldowns on the serial handshake lines yet?  What have you done on that front?  If something is floating then it will only sporadically work.
Logged
Manni
New Poster
*
Posts: 19


View Profile
« Reply #32 on: June 15, 2012, 09:56:02 PM »

DTR and RTS are both connected to +8.5V. This comes from pin 2 of the MAX232.

In the meantime I have rebootet my computer. With the old Wacom driver the tablet is working, if WaxBee is doing the conversion I get a jumpy cursor. And if I connect it back to the PC's serial port (without it loosing power!) everything is back to normal. So it's not a matter of the tablet's configuration.
« Last Edit: June 15, 2012, 11:02:06 PM by Manni » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #33 on: June 16, 2012, 02:59:00 AM »

Normally the when the teensy is booting (powered on after connecting the power), the tablet is booting roughly at the same time.  If the tablet was connected to something else that configures it differently, then there might be issues when swapping the tablet without reseting it (rebooting). (one of the main configuration is the serial port speed).

If I understand correctly, (sorry, it has been a while and my memory is failing). The power is coming from from a PS/2 connector -- is this from PS/2 connection on the computer or just using the PS/2 to feed the USB power? (I think the latter, right?)   And for the grounding, I assume you grounded the teensy to the RS-232 and somehow indirectly the PS/2 connector ground.

« Last Edit: June 16, 2012, 03:04:30 AM by bernard » Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #34 on: June 16, 2012, 03:34:10 AM »

Are you sure you are not pulling too much current?  How much current does the MAX232 with its capacitors requires? Maybe the teensy is constantly rebooting (brownout or whatnot)? (hence the flashing?) Put your multimeter in series near the PS/2 plug (yeah, that requires disconnecting a wire unless you are a happy low-power clamp multimeter owner).

What is the configured mAmp power in your WaxBee template?  This is how much power you are requesting from the PC -- and this can be a very small number like 20mAmp! In case you do not know, this is located the WaxBee template -- Edit the "USB Device Descriptor" (either through the WaxBeeConfig software (recommended) or open directly with a text editor while WaxBeeConfig is not running). There should be a comment in there -- If I recall correctly, the number configured in there is supposed to be half of the mAmp (50 for 100mA).  (watch that it could be written in hex -- WaxBee support both hex and normal 10-base numbers for us mere mortals).

Can you try with the PS/2 connected to the "normal" PS/2 plug instead of USB? Is this valid electrically? (thinking about ground here).

I saw you already tried the debug template and HID_Listen.  The alternative is to program the virtual serial port .hex (download from waxbee site) -- then directly hook it with RealTerm (like you would normally do when the tablet is hooked to the PC directly, but using the COM port associated with the virtual serial port).  On Windows, you may need to install a .inf file. (more info on the prjc.com site: http://www.pjrc.com/teensy/usb_serial.html ) -- maybe you can analyze the traffic to see if something is weirdly reported.

What baud rate speeds is configured in the template? I assume 9600 (initial) and 19200 (normal) bauds.

Normally the teensy will try to reduce the speed to 9600 baud before augmenting it back to 19200 -- this is to attempt to catch the case that the board might already be in 19200 baud (already powered and configured).  If the board was configured to another (neither 9600 nor 19200 then the teensy might not be able to talk to it and will fail to initialize it).  

Normally you would connect the USB connection power *last*.  I mean, first connect the DB9 and PS/2 and finally connect the USB (to essentially power up the teensy and the tablet together).  On top of that, PS/2 was never meant to be hot-pluggable and neither RS-232 either btw -- just that RS-232 drivers are known to be resilient).  

« Last Edit: June 16, 2012, 04:02:11 AM by bernard » Logged
Manni
New Poster
*
Posts: 19


View Profile
« Reply #35 on: June 16, 2012, 12:51:26 PM »

When the Teensy's LED was flashing all the time, I think it was some kind of Windows error because at the same time the Teensy was not accessible from any program.

My PCB with the Teensy and the MAX232 is powered from the USB port the Teensy is connected to. Also this powers a PS/2 connector where I can connect the tablet to. So all is powered from USB but I can also power the tablet from the computer's PS/2 port.

Currently the configuration template is set to 0x32 = 100mA which is the current rating for the tablet alone. The Teensy is rated at 60mA (typical) @ 16MHz. The MAX232's data sheet says it's rated at 10mA (max). I could set the configuration template to 0x64 = 200mA to be on the safe side but I don't think this will make any difference because I don't really think Windows can monitor the USB ports real current. Also: It's not even close to the 500mA maximum.

I use the computers PS/2 connector only for the tablet (I don't have a PS/2 mouse) so hot plugging only to get the 5V should not be a problem. By the way, I've tried both: powering the tablet from USB and from PS/2. In both cases I get this jumpy cursor and when I connect the tablet to the computer's serial port where there is the old Wacom driver listening, it all works fine. I can do this without powering down the tablet or the Teensy so the tablet is not configured again by any of the drivers. This is the reason why it seems to me some kind of problem in the Teensy. Although it worked for a short time. When it's working it always seems to be set to 19200 baud.

Next I will try to re-install the Intuos driver. If that does not help, I will try HID_LISTEN or RealTerm.
Logged
bernard
Administrator
Hero Member
*****
Posts: 2584


pato mania


View Profile
« Reply #36 on: June 16, 2012, 02:34:08 PM »

"It appear to work" does not mean "it works all the time".  I am just trying to go through all the possibilities -- sorry if this sounds like repetition, I am just trying to help here. These are things I went through myself and I repeat them here just in case. This is for you of course but also for any other (future) one that would be in a similar situation. (You are the first one using an external line driver chip like the MAX232).

There is special logic in the teensy to try to cope with the baud rate not being at 9600 at startup (because this was a real problem in the past), so in theory it should be fine that the tablet is already set at 19200 bauds.

If I understand your tests correctly, when you connect with the teensy, you are also testing the MAX232 circuitry. I mean the MAX232 is not tested in any other configuration. This is something I never experienced myself (since I connect the teensy directly to the internal TTL signals). In theory this should be perfectly fine, but we all know that hardware does not always behave like we want to. Do you have some sort of scope to check if the serial pulses are clean on the output of the MAX232?  Uploading the virtual serial port .hex and visually monitoring the raw bytes might help a little, but there is nothing like looking at the raw analog signal. As an alternative to a real scope maybe there could be a way to connect this into a sound card line input (might have to divide the voltage though - you probably know better than me on that front) -- with a 44khz sampling rate, it might be just enough to give an idea of the shape of the pulses (quite a few sound card supports higher sampling rates). There are numerous windows-based software that support this.

Logged
Manni
New Poster
*
Posts: 19


View Profile
« Reply #37 on: June 17, 2012, 11:26:40 PM »

Hi Bernard,

it's all very strange with my computer. Maybe the Windows XP x64 installation is a bit too old.

I removed all the Wacom drivers, booted the computer and installed an Intuos driver (v6.2?). Afterwards the tablet worked.

Perfectly!

No cursors jumps!

Then I made some changes in the settings panel so that only a small part of my tablet covers the whole screen. This also worked.

But only until I booted the computer...

After this reboot I could only move the cursor in a small rectangular area in the top left corner of the screen. Huh Huh Huh

I removed this driver and installed a different one (v6.11?) and now my tablet is working.

Even after reboot.
Even after changing the tablet area to display settings.
Even after hot disconnecting/plugging the USB device with Teensy + tablet.
Even after more reboots.

It's still all there! Up and running!

Great!

Next on my list is trying my "new Intuos 2 tablet" Grin on Windows 7 - but not this weekend: The number of tolerable computer reboots has exceeded its maximum.  Smiley


For now: Thank you very much for your help, your patience and your work on WaxBee! It's great!

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


pato mania


View Profile
« Reply #38 on: June 17, 2012, 11:38:56 PM »

Yay! Good for you!
Logged
Dragon
Full Member
***
Posts: 121



View Profile WWW
« Reply #39 on: June 27, 2012, 03:54:17 AM »

Nice!  Could you post a circuit diagram for anyone else wanting to try this?
Logged
Manni
New Poster
*
Posts: 19


View Profile
« Reply #40 on: June 28, 2012, 08:56:55 PM »

I don't have any program for this. If you know any freeware or an online tool for this, I would look into it.
Logged
Dragon
Full Member
***
Posts: 121



View Profile WWW
« Reply #41 on: June 28, 2012, 09:40:23 PM »

I don't have any program for this. If you know any freeware or an online tool for this, I would look into it.

A program for what, making a circuit diagram?  I figured you'd just sketch it in pencil, but http://en.wikipedia.org/wiki/Schematic_capture#Individual_products lists a number of different programs.  http://www.physicsforums.com/showthread.php?t=25526 seems to recommend KiCAD.  I found this quick start tutorial: http://teholabs.com/knowledge/kicad.html

Or, this looks like it could be easier to use for a simple diagram: http://www.circuit-diagram.org/
« Last Edit: June 28, 2012, 09:42:50 PM by Dragon » Logged
Manni
New Poster
*
Posts: 19


View Profile
« Reply #42 on: June 28, 2012, 10:28:30 PM »

Thank you for the links. I've tried a few of them now but they are not really useful for what I had in mind. Or maybe I'm just not used to this kind of software any more. I will have to draw it by hand. Maybe tomorrow.
Logged
Dragon
Full Member
***
Posts: 121



View Profile WWW
« Reply #43 on: June 28, 2012, 10:38:56 PM »

Thank you for the links. I've tried a few of them now but they are not really useful for what I had in mind. Or maybe I'm just not used to this kind of software any more. I will have to draw it by hand. Maybe tomorrow.

I'm not sure if you saw that I edited my original post to mention that this looks like it could be easier to use for a simple diagram: http://www.circuit-diagram.org/

Also check out TinyCAD: http://sourceforge.net/apps/mediawiki/tinycad/index.php?title=TinyCAD
Logged
Manni
New Poster
*
Posts: 19


View Profile
« Reply #44 on: June 28, 2012, 11:24:15 PM »

This circuit-diagram tool was actually the first one I tried. Probably I'm too stupid to make a (more or less realistic) drawing of the Teensy so that everybody who wants to build this stuff on his own would know which pins to connect...

No I'll do it by hand. At first I thought that in order to post this drawing here, I would have to take my old scanner out of the closet and try to make it work, but now I think a photo of the drawing will be OK.
Logged
Pages: 1 2 [3] 4
  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!