Creating a USB device with a Picaxe

SalRod

New Member
Hi All,

Just wondering if anyone has created a USB device using a picaxe. I have done some searching but cannot find anything obvious.

What I am thinking of is something like a USB-parallel port where you can write and read individual pins to the outside world using a PC application. I know you would have to create a driver for it.

Most USB to Parallel adapters aren't seen as LPT1s anymore with the latest OSs.

Lurker for many years. Just love this forum.
 

hippy

Technical Support
Staff member
Welcome to the PICAXE forum.

PICAXE devices don't have any native USB capability. If one permanently connected an AXE027 or other USB-to-serial interface to a PICAXE it would appear as a USB device to the computer, but as a serial device rather than a parallel port.
 

steliosm

Senior Member
You are looking probably for a USB to GPIO bridge chip. That kind of chips have intyegrated USB support and support GPIO ping. You will need to write a driver for it though, in order to control it from a PC. This is an example of such a chip: http://www.ftdichip.com/Products/ICs/FT232H.htm

In a project I was doing I had a need for a similar solution. I took under consideration all the costs if I wanted to go with this chip (chip price, time to code driver & application) and I ended up using a simple USB-2-serial cable and a picaxe chip to handle the IOs. Pretty straight forward, cheaper and easier to use. That is, if you don't need extra high speeds on the IOs.

What you are describing sounds like a project that a picaxe can handle quite easily. Do you have something specific you need to implement?
 

nekomatic

Member
If you don't mind your device 'looking like' a serial port on the computer, this could be done very easily - just attach the PICAXE to a USB-serial adapter as hippy suggests (it doesn't have to be the Rev-Ed one if you aren't using it to program the PICAXE, it could be a cheaper type and if you choose one that has a USB-powered 5V or 3.3V output you can power your PICAXE from that) and program it to wait for a command and set its outputs appropriately, then read its inputs and send that data back to the computer.

With a 20M2 you could have 8 ins and 8 outs and just send and receive one byte each way - alternatively you could design a command protocol to set pins as in or out, read analogue inputs, etc etc, as complex as you like.
 

Jeremy Harris

Senior Member
It might also be worth exploring what the VDrive2 can do. I've used the USB memory stick firmware in one, but the chip that drives the USB port in the VDrive2 can also be loaded with different firmware for other classes of USB device. I'll own up to only having used one as a USB memory device, but when debugging things to make it work I did discover that there are other capabilities within the hardware. The datasheet and command reference is here: http://www.picaxestore.com/index.php/en_gb/picaxe/add-on-modules/usb031.html
 
Top