Robotics And The Gp2x, Is It Possible?


gsx82

Still Fresh
Joined
May 27, 2006
Messages
12
Hello all, I picked up a gp2x about 2 weeks ago and this thing is bloody sweet, I'm very impressed with this system all around. I and building a robo-one clone with on-chip artificial inteligence via a BX-24 microcontroller and various sensors . It is not yet complete, about 50% done but slowly it is coming together. What I want to do is read and write data from the gp2x to my robot via a serial connection. I have written a program in C and compiled it on my linux box to read serial data(real time senror readings) from the robot's microcontroller and it works great. Now, I wonder if I can just cross-compile that program to run on the ARM architecture and run it on the gp2x? I would also need a direct serial connection from the gp2x to my robot, is there a premade one that I can buy online? Right now my program only reads data from the robot to gather sensor positioning but in the future I will have two way communication to fully control the robot from the gp2x. I should be able to do things like view sensor logs,real-time acceleration and tilt reading, movement commands, pattern scripting and maybe remote control the robot from the joystick and buttons, but that would be alot more complex as I would have to deal with writting code to grab the input from the gp2x buttons and joystick. Anyway, if anyone has any tips that would make this quicker and less painful that would be awesome.

Here is a link to some pictures of my robot
The picture quality sucks and it's going to be slow, the pictures are hosted on my web server and I don't have a super-high speed internet connection.

Thanks
 

gsx82

Still Fresh
Joined
May 27, 2006
Messages
12
Well, I looked up the j-tag cable and it seems that it is not the interface I need. I need a direct serial cable from the gp2x to my robots microcontroller which is a standard rs-232 interface. I see that Toyz4Boyz did sell what I am looking for but no longer sell these cables, that sucks. I also found this link which shows how to build a serial cable, so it looks like that is what I will be doing. It looks like the gp2x serial output vlotage is 3.3v, I will check the documentation on my microcontroller and see if it will work with 3.3v and not standard 12v, then maybe I don't need to use the MAX3232 chip to change the voltage.

I looked up the specs on my microcontrollers serial port and this is what it says:

A high speed 5 volt serial port is provided for connection to modems, PC's, terminals, or other controllers. A hex inverter(tc7wh04) inverts the serial signals coming to and from the processors serial port. The hex inverter is also used to isloate the processors 5v serial port from the higher voltage levels (tyipically +-12v) present on standard PC serial ports.

By the looks of this I think I might be able to directly link the gp2x to my robot without any extra circuitry but I can't be sure until I test it out.
 

Feeg

Still Fresh
Joined
Apr 29, 2006
Messages
99
Age
35
Location
Sydney, Au
Website
Visit site
Perhaps you want something like a USB to Serial converter?

Google found me this:
http://www.mrgadget.com.au/catalog/targus-...able-p-477.html

But I guess then you'll need to adjust your code to work with USB output intead of a serial port. Haven't done any of that sort of programming before, so I'm not sure how complicated it is.

Awesome robot, by the way. Please keep us posted with your progress. :)
 

Squidge

Certified Guru
Joined
Nov 16, 2003
Messages
8,495
Location
UK
Website
Visit site
Every microcontroller I've used is either 3.3V or 5V for the RS232 connection, and so can be used almost interchangably without any need for a max232.

www.artaylor.co.uk used to sell serial cables, but ever since he moved house, he's stopped selling them too.

All I think you need really though is a ext connector and a bit of cable - where your going to source a single connector from is another story however.
 

Dzz

stmia r0!, {r2-r9}
Joined
Jan 30, 2006
Messages
1,098
Website
Visit site
Well, I looked up the j-tag cable and it seems that it is not the interface I need. I need a direct serial cable from the gp2x to my robots microcontroller which is a standard rs-232 interface. I see that Toyz4Boyz did sell what I am looking for but no longer sell these cables, that sucks. I also found this link which shows how to build a serial cable, so it looks like that is what I will be doing. It looks like the gp2x serial output vlotage is 3.3v, I will check the documentation on my microcontroller and see if it will work with 3.3v and not standard 12v, then maybe I don't need to use the MAX3232 chip to change the voltage.
This cable works well as a starting point:

http://cgi.ebay.com/OEM-Samsung-e720-e810-...1QQcmdZViewItem
 
Last edited by a moderator:

gsx82

Still Fresh
Joined
May 27, 2006
Messages
12
Squidge I think you are right about serial signals on the microcontoller and being able to directly connect without any additional circuitry and IC's. The problem like you said is finding an ext connector for the gp2x, so I think my best choice is going with the samsung cable that Dzz seggested. That way I can use it on my PC for debugging gp2x apps and for my robot project aswell. Sweet, thanks alot guys.

Update:

I just installed the devkit on my linux box and compiled a test program and it worked perfect. I don't think I will have a problem porting my robot controller program over to the gp2x. I think I will use the gp2x CPU to do some AI work while it is connected, to take some stress off the BX-24 microcontroller CPU and to save much needed RAM . The gp2x cpu is a hell of alot faster than the BX-24 CPU and I will not be limited to the 400 bytes of RAM the BX-24 has. This way I can write sloppy code and get away with it.
 

gsx82

Still Fresh
Joined
May 27, 2006
Messages
12
I sure hope you have a digicam to post up some pics of this thing :p .
I do have a digital camera but it sucks, it takes really crummy pictures, I posted some of the pics on my website here but you probably already saw those. I will get my girlfrieds nikon camera and I will take some good pics. Eventually I will put together a small webpage with lots of pics and go through how I built it. The robot still needs alot of work and I still need to build legs for it and do alot of coding to get it walking. I am also having problems getting it to run off batteries, but I should have that worked out soon. Pictures don't do this thing justice you need to see it in motion, I will make some short videos of it in motion being controlled by the gp2x when I get that up and running.
 
Last edited by a moderator:

nubie

Recovering Jerk-A-Holic
Joined
Oct 19, 2005
Messages
2,749
Location
USA California
Website
Visit site
You are welcome for my sweet Samsung cable Idea :).

I like the bot so far (not the head, personal preference), Are you just using PC Blanking plates for mounting the servos?

Not a bad Idea :).

What are you going for exactly? Will the GP2X fit inside/on the back?
 

gsx82

Still Fresh
Joined
May 27, 2006
Messages
12
Yea, I was kinda going for the Terminator look, the head is a chrome shift knob from an auto shop. nubie, that samsug cable hack is very cool and it seems like its the the best option for me. I did use pc case slot covers to make the brackets for the servos. I didn't think of mounting the gp2x on the robot but now you sparked my intrest. I am going to use the gp2x to read sensor logs, send and recieve commads. I will also write a program on the gp2x to take the sensor reading and create a virutal map of the area, so it can learn its surroundings. I have a sharp distance sensor mounted on the front of the bot so it will know if objects are in front of it and at what exact distance. I also have an accelerometer connected to the bot to get acceleration and tilt readings. I want all that sensor data displayed on the gp2x screen real time, I thought it would be cool. In the future I would like to add voice recognition hardware and write a really detailed program with a 3d wireframe model of my robot running on the gp2x that would show the robots movements realtime. Thats all a long way off from where I'm at right now, but I can wish.

I can't seem to find a samsung serial cable on ebay that will ship to Canada. Oh well, I will keep looking.. Thanks guys.
 

DaveC

Internal Development
Joined
Mar 4, 2004
Messages
9,208
I always though it would be cool to have kind of an environmental capability to a robot. Sensors for temperature, humidity, barometric pressure compared to light level and time via real time clock could actually be used by the bot to tell you the weather or if a storm is approaching (by changes in pressure, temp etc) . It could just rattle out data via voice synth too. Just another means that the robot could be "aware" of the real world.


I have been looking for a viable robot platform for awhile. If I had the right "brains" I would cad up a body and have the frame lasercut for a real high tech bot. I would really like something with voice rec, and speech synth but that gets kind out of the range of a homebrew bot. It would have to be low power so that it could remain on "standby" awaiting a command for days before a re-charge. I haven't found anything good yet so I gave up on the idea awhile ago.
 

cbox

Member
Joined
Dec 27, 2005
Messages
565
google the model number and samsung + usb cable and i'm sure you'll find a canadian store, last time I did that a few showed up in the results
 

gsx82

Still Fresh
Joined
May 27, 2006
Messages
12
I would like to build a really pro robot too, with nice brackets instead of my hacked body out of old computer parts. They sell professional servo brackets but they are like $15us each and when you have like 15 to 20 servos that gets expensive. You can get hardware audio chips that can store pre-recorded audio fairly cheap these days that would be perfect for a talking robot. You can also get voice recognition chips cheap that are desined to integrate with a microcontroller. I think the only other sensor to go on my robot will be a sensor to detect light levels so my bot knows when to turn on its light. As far as getting the bot to run in standby that is definalty possible as long as all the servos are powered down, and the BX-24 has a low power cpu sleep function. With my robot it will come out of sleep mode when motion is detected within 80cm via the proximity sensor but if I decide to go with voice recognition I could get it to wake up on voice command too, which I think would be a little cooler.

What do you guys think I should do with this robot? Build legs and get it walking or start on voice recognition and speech because the cost would be about the same either way.

I know this is getting off topic and not about the gp2x so let me know if this is frowned upon.
 

hitbyambulance

Active Member
Joined
Nov 26, 2005
Messages
634
Location
Seattle, WA
Website
troubletype.org
well, it is related to the capabilities of the GP2x in this field, which hasn't been touched upon yet... so it would be more than OK, i think. i'd like to get more into robotics myself... (tho i did nearly flunk out of the PIC assembly language class i took... : /
 

saboteur

Member
Joined
Nov 17, 2005
Messages
172
I think your robot should be able to play on a GP2X :)

I've gat a GP2X serial cable lying around somewhere - if I can find it do u want it ??

Cheers
 

Robster

Dodgy hardware mod maker
Joined
Jul 8, 2003
Messages
439
Location
New Zealand
Website
www.cobbleware.com
Hi gsx82,

Nice job on the robot! It looks really impressive.

You can't just connect the BX-24 serial port to the GP2X serial port, because the BX-24 is 5V and the GP2X is 3.3V. You may well damage the GP2X by connecting them directly.

Unfortunately, level shifting 5V - 3.3V is a pain! You either need to clamp the 5V signal (see my GP32 JTAG page for an example) or else you need a level-shifting buffer. The 74LVC family is pretty good for this, as it runs on 3.3V but has 5V-tolerant inputs and outputs. I've used the 74LVC541 buffer, it works well.

Also good to hear that you've got some code working on the GP2X. From all you've written, you sound pretty capable so I'm sure you'll get a good result! Please do come back and tell us how you got on :D
 
Top