Communicate and power through USB

Nicolai

New Member
Hi,
I've previously communicated with the Picaxe, using rs323 and the seriel programming cable.
Now, is it possible to do this, with a USB cable while also powering the picaxe through the usb cable?

I've seen some mention of using a FTDI cable, but I'm a little unsure if that is what I am looking for, and if it is, how to proceed. Do I simply wire it to the board? Do I need additional components?

I'm a bit of a novice with picaxe, so if I'm leaving out something important, or asking something stupid, just let me know, and I'll try to adapt.
 

inglewoodpete

Senior Member
It is possible but not recommended. You would need to buy an FTDI-based USB to serial cable (or a PL2303 based one) and open up the cable end encasing the USB-to-Serial chip.

I have used PICAXE chips for 10 years and not given it a thought. I'd hate to accidentally damage my computer's USB ports.
 

lbenson

Senior Member
I power and communicate with a dozen or so picaxe chips using usb serial from small routers or devices running openWrt Linux or debian, such as gl.inet, tp-link wr703n, HLK-RM04, DX WR3G01, Hame A5, et. The picaxe reads temperatures, opens heating zone valves, operates servos to turn on electric heaters in my barn, etc. The openwrt devices provide network connectivity, either wired or wireless.

I use cheap usb serial dongles with pl-2303, ch341, or cp210x controllers like these:

http://www.ebay.com/itm/USB-2-0-to-TTL-UART-Module-5pin-Serial-Converter-CP2102-STC-Replace-FT232-/161282081867?pt=LH_DefaultDomain_0&hash=item258d29444b

http://www.ebay.com/itm/CP2104-USB-UART6PIN-module-serial-converter-STC-PRGMR-replace-CP21022-0-for-TTL-/221624607026?pt=LH_DefaultDomain_0&hash=item3399db2132

http://www.ebay.com/itm/PL2303HX-Converter-USB-To-RS232-TTL-USB-To-COM-Serial-Adapter-Cable-Module-/181341408242?pt=LH_DefaultDomain_0&hash=item2a38ca4bf2

There are many to choose from.

The biggest disadvantage I have found is that they idle high, and can "phantom power" the picaxe when you think you have switched it off. This happens when you are powering from batteries--shouldn't be a problem if powering from the usb dongle.
 

nekomatic

Member
You can buy USB-serial cables or breakout boards, using FTDI or other chipsets, that provide a 5 V and/or 3.3 V supply from USB. FTDI actually offer such cables themselves but they're rather more expensive than the ones lbenson links to above. Sparkfun do an FTDI-based breakout board. Any of these should be perfectly fine for powering a PICAXE - maximum current available varies but just make sure your circuit's demand is within the spec of the adapter. Your computer's USB port shouldn't be vulnerable to damage by doing this but if you're worried you could connect via a USB hub.

These adapters will have 'TTL' serial input/output which is inverted relative to 'proper' RS232. With the FTDI ones you can use their utility program to set the data lines to invert, then connect direct to the PICAXE serial in / serial out; with the others you'd have to add a hardware inverter in each line.
 

Goeytex

Senior Member
I have been powering Picaxe chips and breadboards via USB cables / adapters for nearly 10 years now. I have never had a problem with a USB port. nor do I fret about blowing a USB port. USB ports are generally very well protected. But I would certainly recommend a fuse of some kind. I use a 250 ma inline fuse but a polyfuse is another option.

As has been advised, a Cable/ adapter.or breakout board with an FTDI chipset is the most flexible. These can be programmed via a utility supplied by FTDI to invert the data as required by the Picaxe. This eliminates the need for external components to invert the data.

Most other USB/TTL adapters will use a PL2303, CCP2102, or CH340 chipset. These will all required some external components to invert the data, either a couple of transistors, or an Inverter IC such as a 74HC14, or a Max232 type chip. I don't particularly like using the Max232 because it raises the voltage levels to about +10 / -10 volts.

Below are 2 links to Items on Ebay that should work. Note that there are many others that are similar. But these have 5 volt TTL levels while others may only have 3.3 Volt TTL levels. I recommend 5V TTL for Picaxe as this is what the Official AXE27 cable uses.

FTDI CABLE


FTDI ADAPTER with Cable

I am not endorsing these products as they ship from Hong Kong and it is possible that the FTDI chips may not be genuine. I referenced these only as an examples of what you need in regards to an FTDI based cable or adapter. Both of these will need to be programmed with the FT_PROG utility to invert the RX and TX data lines.

Good Luck
 
Top