Gp2x-f200 Usb Host Issues


slippy

Still Fresh
Joined
Apr 22, 2008
Messages
12
Hey guys, after seeing Sprite's internal USB hack for the GP2X, I figured it must be possible to do something externally which provides a USB host port without requiring an external power source, so I built one. Now I just need help figuring out why it doesn't work.

I started out with a USB Thumbpad keyboard, some solderless breadboard, a bunch of components, a modified Samsung phone data connector, a mini 4-port USB hub, 20 years of soldering and electronics assembly experience, a very basic understanding of electronics, a gp2x-f200 (4.0.0 firmware), some tools and a bucketful of determination.

First step was to take the 3.3VDC from pin 21, and the ground from pin 13 on the F200's EXT connector and pump it through a MAX631 - using a sample schematic from the MAX631 datasheet - to give us a nice, smooth 5VDC (+/- 1%) to power the USB. To test it before connecting to the F200, I hooked up an external 3.3V supply and confirmed the output at a rock-steady 4.99VDC. So far so good, I connected it to the F200, ran it up on internal battery power and measured the output. Now delivering 5VDC on the nose, interestingly enough.

Using this power source meant I could simplify Sprite's circuit slightly, by omitting the redundant 68uF filter cap, as there's already a 100uF one in the supply circuit. Building the usb data circuit was now no more complex than taking the usb data lines to ground individually using 15K resistors and dropping in a 100nF ceramic disc capacitor across +5V and 0V, then connecting those same data lines to the F200. Pin 2 on the USB socket (pinout here) to pin 9 on EXT connector, and USB pin 3 to EXT pin 10.

Having connected it all up, the F200 - perhaps a little surprisingly - still works perfectly well. I power up the F200 and enable USB host mode from the system menu. The LED lights up on the mini hub, and that's about it. The only USB devices I have are an SD card adapter and the aforementioned thumbpad. The thumbpad works perfectly well plugged into my PC (as does the mini hub and sd reader), but doesn't appear to do anything in Sterm when connected to the F200. Plugging the SD adapter into the mini hub does nothing more than dim the led on the mini hub drastically, but I expected that, as it's an ugly thing that won't even run up on my PC's USB without a seperate supply.

[edit - insert]
Just to double check everything, I severed the 3.3V connection from the F200, and ran an external 3V supply directly into the input of my supply circuit. Oddly, it's exactly the same behaviour as before.

Next, I removed my supply circuit from the equation, and instead powered the USB mini hub directly from an external source. No dimming of the LED this time, but everything else is as before.
[end edit]

Are there some drivers or something I need to install to make the keyboard work, or is it more likely that my circuit is at fault? I don't have a scope or anything to check it, but let's face it, the bit I haven't been able to confirm as working is only two wires, two resistors and a capacitor, so there's not much that can go wrong there.

Argh! Anyone got any clues?
 
(this message is only assumptions based on my experiences, please be careful)

You do not need the MAX631, since the F200 (and the last models of the F100, but the wiki administrators didn't let me to write that) outputs 5V through its pin 21. 5V, but only 500mA. Be careful with that and the USB hub.

Sterm will not output anything, since it is not connected to the kernel logger. Run dmesg in sterm to see that messages. You'll thumbpad won't work if it needs special drivers in your PC. If it is a standard keyboard, you need to activate both USB Host and human interface options in the Gp2x configuration. Alternatively, see http://www.gp32x.de/board/index.php?showtopic=42916 to load input modules at boot.

Finally, you can try without capacitors nor resistors. In my tests that worked for USB joysticks, but not for pendrives nor external mouse.
 
Last edited by a moderator:
Do you have access to an oscilloscope? You could check out the data then and see if it was trying to talk, and whether or not it was noisy.
 
juanvvc said:
You do not need the MAX631, since the F200 (and the last models of the F100, but the wiki administrators didn't let me to write that) outputs 5V through its pin 21. 5V, but only 500mA. Be careful with that and the USB hub.
No offence, but I wonder where you're getting your information from. I have my gp2x-f200 powered up in front of me. I'm looking at the display of my multimeter, and the potential difference across pins 21 and 13 is 3.3VDC. Definitely not 5.

QUOTE

Sterm will not output anything, since it is not connected to the kernel logger. Run dmesg in sterm to see that messages. You'll thumbpad won't work if it needs special drivers in your PC. If it is a standard keyboard, you need to activate both USB Host and human interface options in the Gp2x configuration.



When I say nothing happens in sterm, what I mean is, I type on the keyboard and nothing comes up on the screen. I'm not trying to see any messages or anything, just testing a keyboard to see if it does what keyboards do.
The thumbpad works fine on my PC with absolutely no drivers at all
There is no "human interface option" anywhere on my F200.

QUOTE

Alternatively, see http://www.gp32x.de/board/index.php?showtopic=42916 to load input modules at boot.



Okay, the first example at that link requires me to edit a file in the root filesystem, which as far as I can make out requires me to telnet to my gp2x. Unfortunately to telnet to my gp2x, I need for my usb adapter to be working, which it isn't.

[edit] Checking out the second example now. Might be what I need!
[edit again] Nope. Didn't work.

QUOTE

Finally, you can try without capacitors nor resistors. In my tests that worked for USB joysticks, but not for pendrives nor external mouse.



No chance! Not gonna fry my F200 with unfiltered power and signals.

Thanks for your time, all the same ;-)
 
Last edited by a moderator:
Squidge said:
Do you have access to an oscilloscope? You could check out the data then and see if it was trying to talk, and whether or not it was noisy.
Nope, no scopes. All I have is a multimeter.

I guess I think I'll just have to assume it's a noise issue on the data lines, insert a 33ohm resistor into each one and a picofarad cap between the data lines and ground. If that doesn't work, I'll assume it's never going to.

Has anyone actually successfully done this on an F200 with 4.0.0 firmware? I wonder, because there seems to be a lot of inaccurate received wisdom regarding the pinouts of the F200.
 
Last edited by a moderator:
Slippy Lane said:
Squidge said:
Do you have access to an oscilloscope? You could check out the data then and see if it was trying to talk, and whether or not it was noisy.
Nope, no scopes. All I have is a multimeter.

I guess I think I'll just have to assume it's a noise issue on the data lines, insert a 33ohm resistor into each one and a picofarad cap between the data lines and ground. If that doesn't work, I'll assume it's never going to.

Has anyone actually successfully done this on an F200 with 4.0.0 firmware? I wonder, because there seems to be a lot of inaccurate received wisdom regarding the pinouts of the F200.



Hey Slippy, There seems to be little info out there for us with f200's and usb keyboards. I had some trouble getting them to work at all. If you go in sterm/Termula2x and type 'dmesg' with the consoles controls then you should see some output as to the status of the usb device, you should see something like this when you plug in a usb keyboard or other device:

hub.c: new USB device <NULL>-1.2.1, assigned address 10
usb.c: kmalloc IF c1e05f00, numif 1
usb.c: skipped 1 class/vendor specific interface descriptors
usb.c: new device strings: Mfr=1, Product=2, SerialNumber=0
usb.c: USB device number 10 default language ID 0x409
Manufacturer: Alps Electric?M2452
Product: M2452
input: USB HID v1.00 Keyboard [Alps Electric?M2452 M2452] on usb1:10.0
usb.c: hid driver claimed interface c1e05f00
usb.c: kusbd: /sbin/hotplug add 10
kusbd_policy: /sbin/hotplug add 10, ret=0x0
hub.c: port 2, portstatus 301, change 1, 1.5 Mb/s
hub.c: port 2 connection change
hub.c: port 2, portstatus 301, change 1, 1.5 Mb/s
hub.c: port 2, portstatus 301, change 0, 1.5 Mb/s
hub.c: port 2, portstatus 301, change 0, 1.5 Mb/s
hub.c: port 2, portstatus 301, change 0, 1.5 Mb/s
hub.c: port 2, portstatus 301, change 0, 1.5 Mb/s
hub.c: port 2, portstatus 303, change 10, 1.5 Mb/s
hub.c: new USB device <NULL>-1.2.2, assigned address 11
usb.c: kmalloc IF c186d300, numif 1
usb.c: skipped 1 class/vendor specific interface descriptors
usb.c: new device strings: Mfr=0, Product=1, SerialNumber=0
usb.c: USB device number 11 default language ID 0x409
Product: USB Mouse
input: USB HID v1.10 Mouse [15d9:0a33] on usb1:11.0
usb.c: hid driver claimed interface c186d300
usb.c: kusbd: /sbin/hotplug add 11
kusbd_policy: /sbin/hotplug add 11, ret=0x0
hub.c: port 3, portstatus 100, change 0, 12 Mb/s
hub.c: port 4, portstatus 100, change 0, 12 Mb/s
hub.c: port 1, portstatus 303, change 0, 1.5 Mb/s
hub.c: port 2, portstatus 303, change 0, 1.5 Mb/s
hub.c: port 3, portstatus 100, change 0, 12 Mb/s
hub.c: port 4, portstatus 100, change 0, 12 Mb/s

Another thing, are you using Gmenu2x or the default one? I have only been able to get the keyboard to work with Links2x and Temula2x through Gmenu2x, not in the menu itself but only in the applications. However if you go back to the original menu you can use the arrow keys on the keyboard and enter and escape to navigate. Very strange issue. I believe the issue is with gmenu2x as it doesnt fully support the f200.

I too made my cable from parts... I found the 33 ohm and 15k resistors and caps to be needed, although i ended up using 30 ohm and 22k, still works great using bluetooth, wifi, flash cards, sd card reader, and keyboard and mouse.

Hope this helps
 
Last edited by a moderator:
Hey Christien.

Yeah, I tried dmesg | tail. Doesn't give the expected result when plugging/unplugging usb devices. Can't remember what it said exactly, but it was odd - something about dropping blocks.

As you suggest, I've tried the keyboard both in sterm launched from gmenu2x, and ive also tried using the keyboard in the gp2x's built-in menu system. No luck in either case.

I think you are correct regarding the extra filtering on the data lines. I'm going to try that tomorrow, i think.
 
Slippy Lane said:
Hey Christien.

Yeah, I tried dmesg | tail. Doesn't give the expected result when plugging/unplugging usb devices. Can't remember what it said exactly, but it was odd - something about dropping blocks.

As you suggest, I've tried the keyboard both in sterm launched from gmenu2x, and ive also tried using the keyboard in the gp2x's built-in menu system. No luck in either case.

I think you are correct regarding the extra filtering on the data lines. I'm going to try that tomorrow, i think.

Oh, interesting about using the max631 i was think about using one of these to get the 5 volts, and I wonder how much current the 3.3v can supply from pin 21. I would be worried about overloading the gp2x circuitry. I am in the process of modeling a new back to the gp2x which would accommodate wifi, bluetooth and different batteries. I was thinking two 3.6v lithiums that are meant for the psp. Where did you get your usb thumb keyboard? ive seen many thumb keyboards on ebay but they are all for pdas with special connectors. Also the gp2x used the MAX1566 which according to this can take up to 5v input. So the 3.6 volt lithium shouldnt be too high.. sorry to ramble and good luck.
 
Last edited by a moderator:
Christien said:
Oh, interesting about using the max631 i was think about using one of these to get the 5 volts, and I wonder how much current the 3.3v can supply from pin 21. I would be worried about overloading the gp2x circuitry. I am in the process of modeling a new back to the gp2x which would accommodate wifi, bluetooth and different batteries. I was thinking two 3.6v lithiums that are meant for the psp. Where did you get your usb thumb keyboard? ive seen many thumb keyboards on ebay but they are all for pdas with special connectors. Also the gp2x used the MAX1566 which according to this can take up to 5v input. So the 3.6 volt lithium shouldnt be too high.. sorry to ramble and good luck.



Can't remember where the thumbpad came from, but i found it using google product search. it was originally designed for a ps2, and even comes with a clip to mount it to a ps2 controller, but it works as a standard usb keyboard without drivers on everything else I've tried it on. It doesn't have all the keys, but it's still a usable device. MadCatz do a bluetooth thumbpad for PS3 along the same lines.

As I already have a decent, regulated 5V supply, I'm going to power the usb externally until I get it working. Then I'll look again at getting the power from the GP2X. Still, the Max631 can only deliver 450mA at 5V, while the f200's internal 5v supply can deliver 500mA. As the 3.3V from the ext port is essentially the same source that drives the internal 5v supply, it shouldn't have any trouble delivering what the Max needs, so long as pins 20 AND 21 are used to provide the 3.3V

Using a 3.6V Lithium is probably a good idea. Will the gp2x be ok running on 3.6V, I wonder?

I don't think there's a great deal of difference between the MAX631 and the LT111. The Maxim can deliver about 50mA more current, but that's about it. Don't know if the LT needs an inductor coil or not. If not, it could well be the better option, as the Max does require one. The main reason I chose the 631 in the first place is the simplicity of the circuit - couple of links, a cap and a coil.

A new back to mount it all in is a great idea. Guess I'll break out the ol' polymorph and try the same thing once I've got the circuitry working!
 
Last edited by a moderator:
Slippy Lane said:
Using a 3.6V Lithium is probably a good idea. Will the gp2x be ok running on 3.6V, I wonder?
It'll be fine. When it takes the voltage from the batteries, the first thing it does is boost the voltage to a more usable level. The 2X actually uses slightly less current at higher voltages too *(although I wouldn't go >= 4V), probably to do with the fact it's ready usable.

* (yes, I am aware that everything uses less current at higher voltages, but on the GP2X even if you do V*A, it still comes out surprisngly less with more volts)
 
Last edited by a moderator:
Squidge said:
Slippy Lane said:
Using a 3.6V Lithium is probably a good idea. Will the gp2x be ok running on 3.6V, I wonder?
It'll be fine. When it takes the voltage from the batteries, the first thing it does is boost the voltage to a more usable level. The 2X actually uses slightly less current at higher voltages too *(although I wouldn't go >= 4V), probably to do with the fact it's ready usable.

* (yes, I am aware that everything uses less current at higher voltages, but on the GP2X even if you do V*A, it still comes out surprisngly less with more volts)


lol, I know what you mean, Squidge, don't worry. :)

If/when I eventually get my usb thingummy working, I'll build a more permanent version and document it as I go, so's I can post the finished article at instructables or somewheres.

[edit - afterthough, lol]

So, if all the 2x's internals are run on the 5V from the internal DC-DC converter, then overtaxing the 3.3V at the EXT port shouldn't be a problem. I think the official docking cradle can be powered from the 2x's batteries (please correct me if I'm wrong on this assumption), so it looks like it should be okay to get my power that way - once I've debugged my circuit of course, lol

Anyway, thanks everybody for your help and advice. I'll let y'all know how I get on tomorrow. For now, I'm away to bed.
 
Last edited by a moderator:
Back
Top