Friday 24 February 2012

The first 'gotcha'

The tablet arrived, and so have the parts from jeenode!

The tablet is nice, especially after I did some updates on it  - more about that some other time.

I got the arduino development tools to work, too. If you're using a jeenode USB, the instructions given on JeeNode Tips are a bit out-of-date: if you get arduino programmer is not responding errors, you need to change the device type to Uno (I think the bootloader has been updated). Then you can just take one of the example sketches, go to 'upload' - and see it working (with small changes - the 'blink' sketch assumes an LED on pin 13 - it's on pin 9 on the jeenode).

In eclipse, I went with this Arduino plugin - a fork from the official WinAVR plugin. It appears to work, though Eclipse is throwing java.lang.UnsatisfiedLinkError: no spawner in java.library.path in the path configuration - so I had to configure all the paths by hand. By default, the executables are all in /usr/bin, the header files in /usr/lib/avr/include, the IDE path is /usr/share/arduino, and I have no idea where the Atmel part description files are (or what they are, for that matter). I wonder if the problem is cause by setting the java library path in eclipse.ini for subclipse (see yesterdays post), but removing that entry doesn't seem to help.

That wasn't the 'gotcha', unfortunately. The gotcha is that the tablet only has one USB OTG mini-b socket, and no external power connection. In the OTG standard, the host device (the tablet in my setup) provides the power. When the battery is empty, I have to unplug it and charge - but that won't do if the tablet is the user interface for the whole system.

Fortunately, it looks as if there is a provision for exactly this in the USB OTG standard (thank you Wikipedia for linking to it). The USB Accessory Charger Adapter is a three-way connection between host, client, and charger. Has anyone ever come across a device actually implementing this? (don't confuse this with the USB splitter cable that's plugged into two ports on the host, to double the current). From reading the spec, since I am only interested in a single use case, it looks like a resistor in the plug at the tablet might be enough to tell it that, while it's the host, it is allowed to draw charge.

Of course, that depends on if the tablet actually implements OTG, including that part of the spec. It's not clear, as some other tablets come with a dongle that adds a second port and ethernet adapter - that would suggest it's connecting to a hub, which OTG can't do (I think?). Maybe there is another way of switching from client to host role without following the OTG standard.

I don't actually have a cable yet that goes from USB mini male to USB A female, so I can't try what happens if you plug in a hub.

No comments:

Post a Comment