PICAXE USB to Serial Conversion

It is not possible to directly program PICAXE chips via the USB port of a computer. If you have a need - or desire - to use USB, the signals will need to be converted to RS232 serial using the Revolution Education AXE-027 USB cable or a similar solution from a third-party vendor. You cannot use a standard USB cable. As an added wrinkle, not all USB to serial converters on the market will work properly. This article provides an overview of USB to serial conversion issues and some of the options available.

There are some obvious benefits to choosing the Rev-Ed AXE-027. It is designed for the PICAXE, supported by the manufacturer, and compatible with all of the currently available Rev-Ed prototyping and development boards. The cable is available as a standalone product, and is also included in a number of starter packs and development kits. When bundled in with another product there is typically a decent cost savings.

Regardless of which USB solution you choose, you will need to install software drivers and configure a virtual COM port on your computer. The need to install and configure drivers is another good argument in favor of the AXE-027 - especially if you are not very experienced in such matters. Rev-Ed has taken some pains to make the process as easy as possible, providing access to the necessary drivers and good supporting documentation.

Because your computer will treat the AXE-027 cable as a "device," you should always plug in the USB cable before starting the PICAXE programming software and you will want to always use the cable in the same USB port on your computer. You should also remove the cable when not in use as it draws a low amount of power through the port.

Although there are a number of reasons that people might choose not to use the AXE-027, cost and availability are certainly driving factors for many - especially for those shopping outside the United Kingdom. In the US the cable assemblies will run upwards of $30, and even at that price not all vendors will consistently stock them. As noted, there is a savings if you buy the cable bundled with a kit, but if you don't need the kit then the savings won't mean much. Other reasons for choosing a different solution include wanting to take advantage of the ability to drive low power 5 volt circuits from the USB port, or wishing to build USB communications abilities into a circuit to exchange data with a computer using a generic USB cable.

There are many extremely inexpensive USB to RS232 adapters, but unfortunately not all of them will program a PICAXE. The problem is that the PICAXE uses a rather esoteric RS232 function called the break signal. Since this function is seldom used, some manufacturers don't support it. Their products work fine for many applications and so this lack of support for the full protocol doesn't present much of a problem.

The AXE-027 contains an integrated circuit manufactured by Future Technology Devices International (FTDI) called the FT232RQ which is the actual USB to serial converter. So if possible, using a substitute device based on the FTDI chip is your best bet.

The FTDI is a fairly widely used IC. It is found in adapters and cables, as well as boards designed to be integrated into microcontroller projects. Of note are two such boards, the USB-BUB manufactured by Modern Device and the SparkFun USB to RS232 module. (To be completely accurate these boards use the FT232R chip not the RQ, but it's not important). These devices provide a complete USB to serial circuit that also gives access to the 5 volt power supply. Peter Anderson sells a line of PICAXE starter/development kits based on the USB-BUB and a standard breadboard. Setting up the USB-BUB on the breadboard makes it simple to use the circuit as an ad-hoc programmer even though it is designed to be integrated into projects.

One issue to be aware of with the FTDI boards is that they need to be reprogrammed in order to be used with PICAXEs. In short, the logic levels for transmit and receive (TX and RX) are the inverse of the PICAXE requirement. The chips are designed to be flexible. The reprogramming is not particularly difficult, and the software needed is provided at no charge from FTDI at www.ftdichip.com. One nice thing about buying the boards or kit from Peter Anderson is that he takes care of the reprogramming for you.

Since they are built around the same circuits as the AXE-027, if there is any savings at all in buying alternate FTDI devices it is typically not very dramatic. Some devices and cables will even cost more. The Modern Device and Sparkfun boards will usually cost about $15 so there is some savings, but the real advantage is in the added capability and flexibility.

Another converter system that appears to work reliably in PICAXE is the Prolific chipset. Adapters and cables based on Prolific chips tend to be somewhat less expensive than their FTDI counterparts and can be found for $10 or less if you shop around. The chips are well regarded as providing full support for both RS232 and USB protocols. Prolific advertises that no drivers are required to run on most Windows versions, however the drivers are easily available if they are needed.

The last of the potential solutions are the generic and "barely branded" adapters. Available for as little as $3 shipped, these items are certainly a temptation for the budget conscious. The primary issue with the cheapies is that it is difficult or impossible to know what chip they are based on, or if they support the RS232 break - they all look pretty much alike and they typically don't come with much in the way of specifications. Another potential issue would be quality of construction, but depending on how much rough treatment you intend to dole out this might not be much of a problem for you. In general, reports on the generics have been mixed; sometimes they work, sometimes they don't. However, the potential for savings is great and there certainly are situations where it makes sense to give a cheap adapter a try.

Other Articles You Might Find Enjoyable

Introduction to the PICAXE Microcontroller

Guide to PICAXE Selection

Setting Up A Differential Drive For Your PICAXE Project

Adding Memory with i2c EEPROMs

Understanding Variables and Symbols in PICAXE BASIC

Basic PICAXE Servo Interfacing

Robot Obstacle Detection and Avoidance with the Devantech SRF05 Ultrasonic Range Finder

Calculating Right Triangles with PICAXE BASIC

Things to Do Here

All PICAXE Articles