Help with comms to 18M2 on CHI030 board?

jusmee

Member
I have purchased my first picaxe. It's an 18M2 on a CHI030 board.

I have got it talking to my computer, partially. I can see it's
"Hello, I am your PICAXE-18M2" in the terminal in AXEpad, but can't seem to send any sensible data to it.

Going back a step, I already had a USB to RS232 cable that linux (Ubuntu) recognises

Code:
[ 3971.183433] pl2303 3-6:1.0: device disconnected
[ 3974.416023] usb 3-6: new full speed USB device using ohci_hcd and address 8
[ 3974.628673] usb 3-6: configuration #1 chosen from 1 choice
[ 3974.632568] pl2303 3-6:1.0: pl2303 converter detected
[ 3974.664670] usb 3-6: pl2303 converter now attached to ttyUSB0
I have wired pins 2, 3, and 7 of the RS232 to the CHI030 pins 3, 4, and ground. I believe that's the right ones?

I am running LinAXEpad and have set it for /dev/ttyUSB0 (and USB Setup detects that port is available). Pressing F8 brings up the terminal, then when I apply power to the 18M2, the picaxe starts writing messages "Hello, I am your PICAXE-18M2" to the input. Great!

If I type couple of characters and press send I see weird characters echoed
Code:
Hello, I am your PICAXE-18M2

Hello, I am your PICAXE-18M2

ðððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððððð¥*Hello, I am your PICAXE-18M2

Hello, I am your PICAXE-18M2

Hello, I am your PICAXE-18M2

However, if I exit the terminal, and press F5 to program the chip, it reports that it is searching for hardware on /dev/ttyUSB0, but after a short pause, says, hardware not found.
 

elios

Senior Member
It sounds like you have completed a loop back test....

By connecting the rx to the tx on the cable you can send data using the terminal window and it will recieve it back..

I dont think you have the wires in the right place..

[edit] okay after re reading you post, have you tried a hard reset? Doesnt sound like you have configured the picaxe for receiving messages
 
Last edited:

jusmee

Member
OK, I am new to this. I didn't know you had to reconfigure the chip. I just took it out of the packet and plugged it in. How do I change it?
 

jusmee

Member
I thought you had to use the AXEpad to program it, so therefore a new one would be blank, but still able to talk to the AXEpad via serial coms
 

hippy

Ex-Staff (retired)
elios has hit the nail on its head in post #2 - When sending characters via the download cable the PICAXE thinks you are initiating a download to it, hence the 'gibberish' you see.

You need to use SERRXD to receive from the download cable or use DISCONNECT to prevent data on the download cable acting as a download indicator and reset.

To get the 18M2 downloading again, perform a Hard Reset - Disconnect power, initiate a download, wait for the "Searching for hardware" then power the 18M2 up again. You'll have to do this while SERRXD or DISCONNECT is active.

Note the Reset button on the board is only a button input on the 18M2, not a Hardware Reset as it would be with earlier 18-pin PICAXE.
 

jusmee

Member
elios has hit the nail on its head in post #2 - When sending characters via the download cable the PICAXE thinks you are initiating a download to it, hence the 'gibberish' you see.

You need to use SERRXD to receive from the download cable or use DISCONNECT to prevent data on the download cable acting as a download indicator and reset.

To get the 18M2 downloading again, perform a Hard Reset - Disconnect power, initiate a download, wait for the "Searching for hardware" then power the 18M2 up again. You'll have to do this while SERRXD or DISCONNECT is active.

Note the Reset button on the board is only a button input on the 18M2, not a Hardware Reset as it would be with earlier 18-pin PICAXE.
What is SERRXD or DISCONNECT?

I tried turning off the power, pressing F5, saw the message searching for hardware on /dev/ttyUSB0, turned the power on, then nothing until the error no hardware found came up.
 

Pauldesign

Senior Member
I have wired pins 2, 3, and 7 of the RS232 to the CHI030 pins 3, 4, and ground. I believe that's the right ones?
Should be 5 instead of 7 and how long did you wait. Please peruse download tips and the picaxe manuals. Remember u must first understand principles before u putting them into practice. The are there for a reason otherwise, u're in the wrong field.:rolleyes:

Please have a look at manual 2 (picaxe commands)
 

jusmee

Member
I decided to try it with my netbook, which runs win7. I got the prolific drivers from microed's website and installed them. I plugged in the cable and it was detected and became com8. I ran winaxepad, and made sure it was using the com8 port.

The result, - not even as good as in linux. It still says hardware not found. The terminal program is not even receiving the hello messages that I can still receive from the picaxe under linux.

This is so frustrating. I thought prolific USB/serial cables worked with the picaxe?

If so, then either the picaxe chip is faulty or the USB/serial cable is faulty. I am going to have to buy a new picaxe chip, and I suppose an AXE027 cable too.

Can anyone tell me for sure if a brand new picaxe 18M2 chip should continually send "Hello, I am your PICAXE-18M2" messages at power on?

:( It really shouldn't be this hard to talk RS232 to a device. I've been patching RS232 cables and making them work since 30 years ago, and never had so much trouble.
 

jusmee

Member
Should be 5 instead of 7 and how long did you wait. Please peruse download tips and the picaxe manuals. Remember u must first understand principles before u putting them into practice. The are there for a reason otherwise, u're in the wrong field.:rolleyes:

Please have a look at manual 2 (picaxe commands)
I believe it's pin 7 on a full size DB25 RS232 connector which is what I am using.

I have the manuals, but how can I possibly use a picaxe command when I can't download any commands into it to start with?
 

Pauldesign

Senior Member
Sorry, i thought it was DB9 but why don't you try DB9 instead of DB25.

Windows 7:rolleyes:, from my recent experience it's more frustrating to get to work but once working, it's faster to program with since it's USB and i also suggest you try using PICaxe programming editor instead of Axepad and see if it works.

Please goto http://www.rev-ed.co.uk/picaxe/ and check under manuals for some tutorials and under drivers download windows 7/vista drivers. (pls only use the RS2323 to USB drivers from picaxe website!!!). Please feel free to surf the website and download whatever u can lay your hands on. Remember it's freeeeeeeee.

Remember you should wait upto 2s, once the download bar appears, fires power straight up (otherwise it might timeout and thus error).

Also try adjusting the supply voltage between 1 to 5V in increments of 0.5V and repeat programming at various Vcc.

I've been patching RS232 cables and making them work since 30 years ago
Really, i suggest you revamp your knowledge. Please don't hesitate to ask further questions if stuck. ;)
 

MartinM57

Moderator
Can anyone tell me for sure if a brand new picaxe 18M2 chip should continually send "Hello, I am your PICAXE-18M2" messages at power on?
I was just going to write a "Don't be ridiculous" response...but I thought I'd better check first...

...brand new 18M2 out of the tube, start Programming Editor, F8 for Serial Terminal and there it is:

Hello, I am your PICAXE-18M2
Hello, I am your PICAXE-18M2
Hello, I am your PICAXE-18M2
Hello, I am your PICAXE-18M2

...about every 600ms at 4800 baud.

EDIT: And if you send any characters to it, it responds with weird characters just like your first post....

Well I never knew that....;)
 
Last edited:

Pauldesign

Senior Member
I've not used AXEpad before but if you click on help, u should see all the three manuals. To avoid another question, i meant to say RS232 (RS2323 is the 3.3V version which will still work also) to USB driver and please check under USB010 USB-Serial Adapter and don't just give up if neither of the above tips helps, maybe you just have to redefine your problem and elaborate it the forums if possible with photos and u'll have a working solution.

Just for interest sake, it took me three weeks under hard struggle to program my first picaxe chip and i was using all custom made parts.

My first problem was, i was using blank pics (order free samples from microchip and thought it was the same) because i misinterpreted the manuals.

Made mistake with download cable because i wired it according to the audio standard.

Secondly i happens to get some chips to work with partial downloads then stop and other chips (18x, 28x2, 08) not just working at all. I tried all the downloading tips to not avail. I thought the chips were duff or maybe i damage them via ESD or due to my many wrong connections in hardware. I took matters in my own hands, altering Vcc and and reprogram oops errors, try again and just by surprise it works and i can troubleshoot all Prog edit download problems and program any picaxe chip with my eyes close.
In fact i loved now to experience download problems.

Check wrong COM port settings in software. (check device managers and fiddle around).

I'm not even going to mention my frustrations with windows 7 and esp on a laptop with no COM ports.

I was so frustrated until i thought it was just luck and magic but it was all due to under-estimating the basics and how astonished when it works.

I thought i was dreaming. So please don't get angry if i sound rude in my replies, it's my own way of motivations and with your experience you'll do better once you see it working. Good luck.:)
 

MartinM57

Moderator
Next random suggestion being fired at you...

On your Win 7 machine, install the Windows Programming Editor and do the serial port test (View|Options|Serial Port|Test Port) - if that works then you're at least getting somewhere
 

hippy

Ex-Staff (retired)
Can anyone tell me for sure if a brand new picaxe 18M2 chip should continually send "Hello, I am your PICAXE-18M2" messages at power on?
I was just going to write a "Don't be ridiculous" response...but I thought I'd better check first...
I wasn't 'on the ball' earlier - Yes, PICAXE-18M2 are now pre-loaded with a downloaded PICAXE program which announces itself in this manner, and, no, I'm not sure if that has been documented in the manuals ( I've added that to 'the list' ).

This is to aid people setting up their systems and aid people helping others setup their systems. Plug a factory delivered 18M2 into a board, power-up, open the Programming Editor or AXEpad Terminal and, if serial is setup correctly and correct port selected, you'll see the 'welcome' message.

That message should persist until a new program is downloaded over the top of of it or a Clear Hardware Memory is performed.

What seems to have happened is that the 'welcome' program has now been overwritten and there's some reason the 18M2 won't respond to program downloads or Clear Hardware Memory. A Hard Reset as described earlier should resolve that.

I got the prolific drivers from microed's website and installed them.
We recommend installing the official Rev-Ed drivers found by following the "Software & Drivers" link at the top right of this page.
 
Last edited:

jusmee

Member
What seems to have happened is that the 'welcome' program has now been overwritten and there's some reason the 18M2 won't respond to program downloads or Clear Hardware Memory. A Hard Reset as described earlier should resolve that.
.
That program has not been overwritten. It is still sending those messages. The hard reset (power off until the searching message appears etc) does not work unfortunately.

With regard to drivers - except for my brief try with Win7, I am using linux, and the latest kernel released by Ubuntu. It seems to work fine - i.e. I get the exact same result as MartinM57 describes above. I just can't get it to accept a download.
 

jusmee

Member
Sorry, i thought it was DB9 but why don't you try DB9 instead of DB25.
because I have a DB25 breakoutbox I was using to diagnose the problem.

Windows 7:rolleyes:, from my recent experience it's more frustrating to get to work but once working, it's faster to program with since it's USB and i also suggest you try using PICaxe programming editor instead of Axepad and see if it works.
Today I have access to an XP laptop and I will be trying that - with both editors.
 

jusmee

Member
Next random suggestion being fired at you...

On your Win 7 machine, install the Windows Programming Editor and do the serial port test (View|Options|Serial Port|Test Port) - if that works then you're at least getting somewhere
I have access to a plain old XP machine today. Will try this test on that.
 

jusmee

Member
Oh wonderful, I downloaded the drivers from rev-ed, installed the USB cable and it became com17. Trouble is, the picaxe editor software only sees up to com16 (a bluetooth com port), and refresh doesn't find it. It's right there in device manager though!
 

Grogster

Senior Member
You SHOULD be able to re-order your com ports around

- Open control-panel, select System/Hardware tab/Device Manager
- Select the COM port - #17 in your example under PORTS(COM & LPT)
- Right-click port 17, then select PROPERTIES and left-click
- Select PORT SETTINGS tab, then click ADVANCED
- In the COM PORT # drop-down box, select another number for it

You can select any number you like, so long as the system does not think it is already in use.
 

jusmee

Member
Managed to change it to COM1, and so the editor can now see it. Still no hardware found reported.

Back in axepad, with an RS232 breakout box connected, I see

- pin 3 pulsing with the hello message being transmitted by the picaxe.
- pin 2 silent

I go to the options/port/test dialog and change it from disconnected to high. I see

- pin 4 (request to send) goes high.
- pin 20 Data terminal ready pulses
- pin 2 remains silent

This is telling me that it is using hardware flow control (even though I turned that off in device manager). This would explain why the computer cannot send to the picaxe. I even tried setting it to xon/xoff but it persists in using hardware.
 

jusmee

Member
A friend just loaned me his prolific based usb/serial cable and I am seeing some differences, but it still doesn't work.

Right, enough time wasting :)

I have just ordered a new 18M2 and a AXE027 usb cable. When that arrives, I'll start fresh.
 

hippy

Ex-Staff (retired)
This is telling me that it is using hardware flow control (even though I turned that off in device manager). This would explain why the computer cannot send to the picaxe.
Programming Editor and WinAXEpad tell Windows to set No Handshaking when the download port is opened and this will override whatever settings have been specified in Device Manager and elsewhere. The signals on hardware handshaking lines may change but that should not matter. The important things are what is on pin 3 ( TX from PICAXE / RX to PC ) and pin 2 ( TX from PC / RX to PICAXE ) ...

Pin 3 seems to be correct, pulsing when the welcome message is being sent from the PICAXE.

Pin 2, in Programming Editor, Serial Port LED test, should be 0V or negative when the on-screen LED is off, positive when the LED is on. As it's RS232 output the voltage should be around -10V and +10V respectively.

If pin 2 is not showing such voltages it may be that there is some fault with the USB cable.

Disconnect the cable from the PICAXE, connect pin 2 to pin 3, open Programming Editor or WinAXEpad Terminal and see if what is sent is received. Pin 2 should pulse positive as data is sent.
 
Last edited:

jusmee

Member
.

Disconnect the cable from the PICAXE, connect pin 2 to pin 3, open Programming Editor or WinAXEpad Terminal and see if what is sent is received. Pin 2 should pulse positive as data is sent.
Nope, nothing. I will patiently await my new AXE027 cable. Thanks for all the help.
 

jusmee

Member
Just to close this off - new cable arrived - all works perfectly


Thanks again - hope to be hanging around this forum learning and even helping from time to time.
 
Top