alternative serial cable

aduy

Senior Member
sort of on topic sorry, but is it possible to program a picaxe using audio from an ipod, if you configured the cable correctly?
 

nick12ab

Senior Member
My customer image is up on Amazon and you can see it either on the product page itself or I'll just put it here for convenience.



I can't imagine more than a handful of people that would ever have the need to mass-program Picaxe Chips, since the target market is mostly educational/ hobby. Which is not to say that a Picaxe cannot be used in a commercial product. I sell several products using both Picaxe 14M and 8M. But the volume is less than 20 devices per month. It simply would not make any sense (MFG cost wise) to use a Picaxe in a true high volume product when the Picaxe can cost over 4 times more than the Identical PIC. ( PIC18F25K22 @ $2.05 US vs Picaxe 28X2@$8.76 US. - @Qty 100). For me the Picaxe shines in the areas of rapid development and proof of concept.

And FYI, yes people do run 40 Pin Micros at 4 Mhz even if it can run at 32 or 64. Why ? Because the Micro was selected for the number of I/0s or ADC's and not for its Oscillator Speed. Sometimes peripherals demand lower MCU speeds. Here in the US certain Federal Regulations kick in around 3 Mhz for unintentional RF radiation devices so that any commercial product that has an oscillator greater than that must be FCC tested and approved (which runs the development cost up.) .... Faster is not always better.
I think you'll find that 3MHz is SLOWER than 4MHz so the FCC testing would still apply for 4MHz. And for download speeds, a few weeks ago there was a question asking whether there was an easy way to program around 100 PICAXEs in the forum.

How about this for an explanation: You're in a car shop and you want to buy a Ferrari. There are two slight variations of the particular model that you want. One of which can go at 300mph and the other is speed limited to 20mph. Both cars cost exactly the same, except you're standing closer to the speed-limited one. Going with the 300mph variant is like reducing the latency on the AXE027 (the effort to do so is like having to walk over to the faster car) and going with the 20mph variant is like not changing it at all. Which one would you rather?

Download speed matters a lot to me. I don't recall much of my code ever working the first time I downloaded it, or the second, or the third....

I simply keep changing my code over and over until it works, so the download speed determines my programming speed and I spend most of my time just waiting for the download. So far, faster downloads matter more to me than faster processor clock speeds.
That proves my point!

hmm i should record the a program when it downloads, and then play it back into the picaxe
One major problem - the length of the break command varies with how long it takes for the PICAXE to respond and there's no way of verifying the download so it's very likely that the first bytes will be dropped. You'd have a better chance of programming it with a push button. Even if you could develop an app to do it properly, the iPod very likely has no hardware capability to accept a 'microphone' through the headphone jack especially as they want you to buy overpriced accessories to do so.

erco said:
I'm waiting for a Prolific PL2303 cable to arrive
Like the thing I bought of Amazon, the driver chip is probably counterfeit and will therefore be unusable with the PICAXE system. I think I'll contact Prolific about whether they offer their PL2303 chip in COB packages (bare die) and if not, that'll be instant proof that my adaptor had a counterfeit chip, although that's pretty clear already.
 
Last edited:

nick12ab

Senior Member
When trying to remove the board and plug from the serial end of the Amazon adaptor (not the Rev-Ed adaptor, not going to disassemble that), I broke off the USB cable so I soldered a USB plug straight onto the connectors and it instantly looked similar to an adaptor the starter of this thread: http://www.picaxeforum.co.uk/showthread.php?18715-problem-with-downloading-the-program-onto-the-picaxe&highlight=dealextreme had problems with.

The board is marked with CJS1015-04C and a Google search for it comes up with Chinese websites with pictures very similar to my assembly (the USB port soldered straight onto the board).
P200711_15.46_cropped.jpg
 

aduy

Senior Member
The idea is that i record it on my computer, and then use an ipod or some other music playing device like my cell phone to play it back into the picaxe. oh and i want to do that to my cable. its too long.
 

nick12ab

Senior Member
The idea is that i record it on my computer, and then use an ipod or some other music playing device like my cell phone to play it back into the picaxe.
See what I said earlier about this, and in addition, your iPod will have a 3.7 volt lithium ion battery (around 4.5v off-load when charged) which will probably be regulated to 3.3v so unless you're powering the PICAXE with 3.3v or less, your iPod could lose sound output on one channel, both channels, or kill the iPod completely. And one more thing - the Gnd on headphones is the sleeve and on PICAXE it's one of the other two connections (can't remember which one at the moment) and Serial Out is the sleeve so you'd actually apply reverse voltage to the iPod!

oh and i want to do that to my cable. its too long.
Record your cable onto your iPod? I think you mean that you want to do what I did and solder the USB plug straight onto the board. Use the MULTIQUOTE button to make what you're replying to clearer to others.

To do it, you probably won't be able to use the USB plug itself so you'll need a PCB-mounting USB plug like those used in pen drives. It has to be soldered onto the USB-to-serial PCB and the metal surrounding on the USB plug can either be connected to Vss (Gnd) or left unconnected, but I recommend that you do connect it to Gnd. I also recommend use of a glue gun or potting compound or something to give a strong bond between the USB plug and the board so that the plug doesn't break off.

I still think the best thing to do is to cut the USB cable short and have a 10cm cable so that the serial socket doesn't prevent pen drives from being put in the neighbouring USB port.
 

aduy

Senior Member
its ok i modified my serial to usb adapter already. And yes i run my 08m2s off of 3v so the output from my phone/ipod/computer will probably be enough, and if not i can use an amplifier.
 

srnet

Senior Member
Perhaps I dont have enough experience, but why would an iPod, which puts out AC Audio I presume, be able to put out DC level RS232 ?
 

jtcurneal

Senior Member
The serial input to the PicAxe has to be like a square wave (sharp rises and falls) the audio output from your ipod will be just noise to the PicAxe, not programming info.

Joel
 

aduy

Senior Member
im not sure that the picaxe can tell the difference between a sine wave and a square wave through the serial, so in theory i think it could work. but i don't have a 3.5mm cable to test it with.
 

nick12ab

Senior Member
im not sure that the picaxe can tell the difference between a sine wave and a square wave through the serial, so in theory i think it could work. but i don't have a 3.5mm cable to test it with.
In theory it wouldn't work as the PICAXE response time will vary before each download and the iPod cannot be programmed to detect when it receives a pulse then start playing the file.
 

hippy

Technical Support
Staff member
The idea is that i record it on my computer, and then use an ipod or some other music playing device like my cell phone to play it back into the picaxe.
It might be possible with enough time and effort spent on it but I very much doubt you can do it as easily as record and playback. I also can't see how it would be worth the effort or even useful in any practical way.

It was pleasing to see robots-everywhere recommend a PICAXE as the controlled device using Android to drive serial to it through an audio port, but that technique required additional hardware and AIUI a specialist App to generate appropriate audio to be turned into serial.

Because, at best, you can only record a program to be download, download it later, I can't see many people being interested in such a project and I'd say there are other things more useful if you have energy to expend.
 

srnet

Senior Member
your iPod will have a 3.7 volt lithium ion battery (around 4.5v off-load when charged)
4.5V ? That a bit high, voltage at end of charge should be 4.2V, or slightly less.

Lithium batteries (especially Lithium Polymer) do not like being overcharged, they can explode in a fairly spectacular fireball.

No need to ask how I know this.
 

nick12ab

Senior Member
4.5V ? That a bit high, voltage at end of charge should be 4.2V, or slightly less.

Lithium batteries (especially Lithium Polymer) do not like being overcharged, they can explode in a fairly spectacular fireball.

No need to ask how I know this.
I must have misread the multimeter then. I don't have any gadgets with fully charged batteries to test at the moment but I'll measure again when I have. 4.2v means it's even more likely to damage the iPod with a 4.5v battery pack.

When it comes to rechargeables exploding, i put a small 3-cell Ni-MH battery on charge and didn't realize that I had forgotten to take it off until it exploded expelling a black powder all over my desk and parts of it flew across the room. (although the charger was simply a regulated 5v power supply).
 

nick12ab

Senior Member
I was watching one of those type charge, I noticed the volts went up to 4.7v (very bad) and it started to swell , straight out the door of the workshop its went, 5 mins later ........ booom !
So it exploded after 5 mins even though you disconnected it? That makes it a time bomb!
 

nick12ab

Senior Member
Yesterday I put a battery from my old mobile phone into my mp4 player (which used a bigger battery). Will that explode?
 

erco

Senior Member
"USB to UART TTL Cable module PL2303 Converter"

That likely means the polarity will be inverted to what it should be for use with a PICAXE.
@Hippy: You are correct sir, it didn't work until I added an inverter. Per the thread at http://www.picaxeforum.co.uk/showthread.php?18715-problem-with-downloading-the-program-onto-the-picaxe&p=174475&viewfull=1#post174475 this solution worked with the $3 Ebay China PL2303 USB/serial adapter cable, and also also with the $3 Ebay China small red CP2102 USB/serial adapter. A cheap and easy fix for anyone wanting to make their own inexpensive alternative cable.
 

erco

Senior Member
What part of my link to the thread with detailed description and full schematic is unclear? :)
 

nick12ab

Senior Member
The 'fake' USB-to-Serial cable wasn't completely useless. I've got a 9-way socket and plug plus a 25-way socket now (without housings).
 

SAborn

Senior Member
One thing i notice here with all the complaints about the cheap Chinese cables not working is everyone seems to use the PL2303 driver.

I have bought more than 50 of the cheap Chinese cables and have never had one not work, but always use the HL-340 driver as they dont work with the PL2303 driver.

The cables work on XP, vista, and win7, but only on 32 bit operating systems and not on 64 bit.

As this forum wont let me upload the HL-340 driver you can download it from here....

http://ozelecforum.com/viewtopic.php?f=27&t=44

Here is the cables i use and they cost $1.88 with free postage from China.
 

Attachments

Technical

Technical Support
Staff member
You can't choose which driver to use at will, as it is based upon the USB PID/VID identication numbers. If the chips inside use the HL-340 VID/PID identification you will need to use that driver, if the chips inside use the Prolific VID/PID (as both real and fake chips to) you will need the Prolific driver.
 

SAborn

Senior Member
I am aware of that Technical.

As all the driver discs that come with the many cables i have purchased always have more than 1 driver on the disc, i was just pointing out it is not always the prolific PL2303 driver that is required.

Some cables have the driver code stamped on the plug but not always, so before the cable is written off and trashed its worth trying the other drivers.
 

erco

Senior Member
The EBay link within your ozlecforum link says no workee with Vista, BTW. I've tried a couple of those blue/silver HL-brand serial adapters (just as shown in your photo) and they don't work on XP or Vista with Basic Stamps or PicAxes, direct or inverted. The included driver is branded "Huge Pine", FWIW.
 

SAborn

Senior Member
Its an old link now, but there is dozens of suppliers on ebay. (i have updated the link.... see the price has gone up to AU$2.12)

Even though it says it dont work with vista they do, with the driver i posted.

I run vista and never had a glitch with the cables, my workshop PC runs XP and that works with every cable, a close friend runs win7 and the cables work for him.

Every picaxe kit i send i include a cable as everyone has a serial port till they go to plug into it and it becomes a different port, for that reason i just send a usb cable, and for $1.88 i cant make a serial cable with plugs for that.

I test every cable with a download before shipping so i know they work, and never had one fail yet.
I buy them in lots of 10 or 20 cables so after many cables you would think i would get a faulty one now and then like everyone else, but so far every cable has worked.
 
Last edited:

Goeytex

Senior Member
One thing i notice here with all the complaints about the cheap Chinese cables not working is everyone seems to use the PL2303 driver.

I have bought more than 50 of the cheap Chinese cables and have never had one not work, but always use the HL-340 driver as they dont work with the PL2303 driver.
The cables work on XP, vista, and win7, but only on 32 bit operating systems and not on 64 bit.
The driver is chip specific. This driver will only work with the CH341 chip.
 

nick12ab

Senior Member
4.5V ? That a bit high, voltage at end of charge should be 4.2V, or slightly less.

Lithium batteries (especially Lithium Polymer) do not like being overcharged, they can explode in a fairly spectacular fireball.

No need to ask how I know this.
Measured a fully-charged battery and yes, it was 4.2v.
 

erco

Senior Member
Glad to hear the PL2303 works fine on your 32 bit machine, kentmh. I used those adapters up through Vista but when Win8 came out, I got my first 64 bit machine and all my 2303s stopped working, so I switched to CP2102 & CH340 adapters using goeytex's inverter mod here. I boycotted FT232s after FTDIgate and bricked adapters.

But last year I did find a PL2303 workaround driver that got my 64-bit machine going at http://www.totalcardiagnostics.com/support/Knowledgebase/Article/View/92/0/prolific-usb-to-serial-fix-official-solution-to-code-10-error
 

kentmh

New Member
I purchased this adapter cable recently and it works great:

https://www.ebay.com/itm/Ugreen-USB-2-0-to-RS232-DB9-Serial-Cable-Male-A-Converter-Adapter-PL2303-for-Mac/153141429108?ssPageName=STRK:MEBIDX:IT&var=452992988415&_trksid=p2057872.m2749.l2649

It sells for $10.99 Canadian or $8.43 US. Although its listing states that it is for Mac, it comes with a mini CD that has drivers for Mac, Linux and Windows. I use it on a Win 10 32bit laptop with PicAxe Editor 6 and the included Windows driver which must be installed before the adapter cable is inserted to a USB port.

My PicAxe chips are 08M2 that are part of Elenco Snap Circuit sets, so I made a converter from a plastic hooded female DB9 RS232 connector and three Snap wire connectors (yellow, orange and black, just like the original Elenco adapter cable that is a converted AXE027 cable). I purchased the female DB9 RS232 connector on eBay (https://www.ebay.com/itm/DB9-D-SUB-VGA-female-10pin-Terminal-Breakout-PCB-Connector-COVER-HOOD-SHELL-nut/302393572582?ssPageName=STRK:MEBIDX:IT&_trksid=p2057872.m2749.l2649) for $4.00 US. It has screw connectors so no soldering is required. The Snap wire connectors are available from http://cs-sales.net/ for $0.85 US each, part nos. 6SCJ1 (18" black), 6SCJ3A (8"
orange) and 6SCJ3B (8" yellow). I cut the Snap connector off one end of each wire, adjusting the longer black wire to the same length as the other wires. I stripped 1/16" of insulation off the cut end of each wire and installed them to the RS232 connector screw terminals. Black goes to Ground on
terminal #5, yellow to RxD on terminal #2 and orange to TxD on terminal #3.

If you want to convert this adapter cable to match the OEM AXE027 programming cable, you would just replace the Snap connector wires I used with a wired 3.5mm stereo plug. The wire going to the tip (or end) contact of the plug connects to Ground on the female RS232 screw terminal #5, the wire from the plug's ring (or middle) contact goes to TxD on screw terminal #3 and the wire from the plug's shaft (or bottom) contact goes to RxD on screw terminal #2.

The female DB9 RS232 connector mates with the male DB9 RS232 connector on the adapter cable and the USB connector on the other end of the cable plugs into the laptop USB port. Clicking "Ports" in Device Manager shows the Prolific PL2303TA device in the adapter cable and the COM port to which it is assigned. To change the assigned port, double click on the Prolific device, select the Port Settings tab, click the "Advanced" button and choose any other available COM port from the "COM Port Number" pull down list. When running the PicAxe Editor program, make sure the correct COM port is selected for the adapter cable.

Good luck!
 

inglewoodpete

Senior Member
I bought a USB cable incorporating an OBDII interface from China, so not strictly PICAXE related... but the device incorporated a fake PL2302 clone. It's been a pain in the bum to use. While I managed to find a driver that would make it work, Windows10/64 replaces the driver every time it runs its updates. There must be a lesson there somewhere!
 
Top