How to use the PICAXE USB cable on Linux

tux.jpg

So i finally managed to have the Picaxe USB Cable working under linux. Not the programming editor of course, just the serial connection. You can use it to send/receive data with sertxd and serrxd basic command.

Basically, the download cable contains an USB to Serial chip made by FTDI for which a linux kernel module already exists! The problem is that the module is not recognized automatically becouse the cable have different non-standard identificatives. So first, let's find the device. (note: give all commands as root)

Connect the cable to an USB port, then give the following command:

cat /proc/bus/usb/devices

It should list something like (among other devices):

T: Bus=01 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#= 6 Spd=12 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs= 1
P: Vendor=0403 ProdID=bd90 Rev= 6.00
S: Manufacturer=Revolution
S: Product=AXE027 PICAXE USB
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr= 90mA
I: If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
E: Ad=81(I) Atr=02(Bulk) MxPS= 64 Ivl=0ms
E: Ad=02(O) Atr=02(Bulk) MxPS= 64 Ivl=0ms

Now take note of the Vendor and ProdID you have (i don't know if they're the same as mine). Then give the following command:

modprobe ftdi_sio vendor=0x0403 product=0xbd90

This will load the ftdi_sio kernel module which will handle the serial communication. Substitute the two ID if they're different (remember the 0x before).

Now try to list the devices again, you should see where it said Driver=(none), now should say Driver=ftdi_sio.

The driver should have created a new device under /dev, called /dev/ttyUSB0 (maybe ttyUSB1 or 2 etc if you had other serial devices).

That's the device for your cable! You can now run your favourite program to use the port.

For example, to access it from the console you can run the standard minicom program. Once open hit CTRL-A O. It should open a configuration menu. Go to Serial port setup, choose the right device, set Bps/par/bits to 4800 8N1, no hardware control flow, no software control flow. Close the menu, connect your robot and you should see his output on the terminal!

(To exit minicom, give CTRL-A Q).

I think you can make the module load at boot time by putting a line in /etc/modules, something like:

ftdi_sio vendor=0x0403 product=0xbd90

This ends this wanderful guide. IHTH

 

fd0e766c85b53e15ecfdc9e9449afb13.jpg

 

Fantastic!(And rumor goes

Fantastic!

(And rumor goes that they are making a Linux version of the editor!)

/ Fritsl

you can’t just wine the

you can’t just wine the editor?

 

I want to wipe XP off my EEE pc :stuck_out_tongue:

good question - or just vmware it? :slight_smile:

spoken from person

someone want to try it :stuck_out_tongue:
someone want to try it :stuck_out_tongue: then i can switch :smiley: back to debain + kde

someone want to try it :stuck_out_tongue:
someone want to try it :stuck_out_tongue: then i can switch :smiley: back to debain + kde

Well that’s true but i don’t

Well that’s true but i don’t like non native applications and windows emulators… I prefer to run real linux stuff :slight_smile:

Someone could try to reverse engineering the download protocol and make a real linux programming environment, but maybe it’s not worth the effort since a linux version is already in the works.

BTW if you prefer a more user friendly graphical serial terminal instead of minicom, take a look at GtkTerm.

 

Anyone know of any attempt

Anyone know of any attempt to reverse engineer the picaxe download protocol (ie some documentation) ?

I tryed to log the serial port traffic but when i run a download the picaxe doesn’t answer… there’s something going on :slight_smile:

You should contact the

You should contact the company directly - see if they can release any specs or other details to you . Although, less glamorous than hacking, this can be a HUGE time saver. If they are trying to support linux they might be very amiable in giving you the necessary info, who knows, maybe their project is on sourceforge now…

When you tried to log it did you use ttysnoop or ttylog -> http://linuxgazette.net/issue48/tag/52.html ?

You cannot do that reverse…

You cannot do that reverse… (in a million years, at last) - because the Picaxe editor is NOT just transferring the BASIC to the Picaxe; It assambles it, parces it to the libraries etc… and then it transfers.

/ Fritsl

Yeah i know… But it’s less

Yeah i know… But it’s less than a million year :slight_smile: After all, they reverse engineered harder stuff, like NTFS… There are well known tecniques to do reverse engineerings, i did some in the past. Basically you observe the transfer, than make small changes and observe the difference and so on.

For what i know, the basic interpreter resides on the chip, so the programs are not “compiled” on the editor. Instead they’re probably parsed and tokenized with some eventual transformations. For example, that’s exacly the way old MSX computers save Basic programs on tape.

Anyway, i’m not gonna do anything near a full or useful reverse engineering… i dont’ have the time nor the skills :slight_smile: I’m just investigating a little… I like to know how things work :slight_smile:

For grog: i was on windows, i used Null Modem Emulator and a small program by me to log stuff.

For all you Ubuntu/Debian

For all you Ubuntu/Debian x86_64 users you might want to try ‘lsusb’ to list you usb devices

since cat /proc/bus/usb/devices may not work, it didn’t for me.

BTW the vendor and prodid is exactly the same 0409,bd90.

though the chip name was different.

Bus 001 Device 004: ID 0403:bd90 Future Technology Devices International, Ltd

But it works, bye, bye winbloze!

However the editor is pretty neat, can’t wait for the linux version.

My experience with wine and

My experience with wine and the editor was that it didn’t work too well. I had a bit of a migrane(damn those tanins) in the morning and my program looked like crap as well…oh wait…wrong wine… :slight_smile: But seriously, the setup that I had was running on an older dell laptop(inspiron 8100) that I use when I need serial com. The After getting the com port setup the app ran slow and seemed to hang almost every other minute… I was running ubuntu 8.0.4 with all the current updates at the time.

 

Any body gotten this to load

Any body gotten this to load at boot time?

I’m running Ubuntu 8.04 x86_64 , i don’t have a etc/modules.

 

 

Help
I connect the cable to the usb port and it doesn’t show up under devices. Windows will recognize it as Axe027 Usb Cable. Any idea why it isn’t showing up under devices? i’m on Ubuntu 8.04

There is a compiler for linux.
I think there is one. This no? http://www.rev-ed.co.uk/software/picaxe.tgz from rev-ed themselves.

Good find! They even have a

Good find! They even have a compiler for the mac! Now I can use the brilliant TextMate program for editing programs and I wont have to start windows when I want to update the program.

Thanx!

how pixace work
how pixace work