Strange behaviour with my first 28X1

chris_b

New Member
As my first picaxe project, I'm building up a fairly simple box to drive a CNC stepper motor controller - it has push buttons and some switches and its job is to generate variable speed pulses with appropriate enables, direction signals etc. I have a 900MHz laptop, Windows XP, and the AXE027 USB cable

I've got some code working, not pretty but my first go at Basic ;-). Along the way I've noticed two rather worrying instabilities, and I have a real show-stopper which may or may not be related:

Instability 1) Sometimes the Run function in the Programming editor reports it can't find the serial port "in use or not connected". Sometimes just trying it again works, sometimes I have to mess about and change the COM port from COM3 to COM4 and back to 3, reboot etc. I've checked grounds connections etc and it all seems ok. (But why is the shield on the AXE027 connector not the ground??)

Instability 2) If I leave the programming cable connected with the Prog Ed running on the PC but not doing anything, the picaxe program is occasionally interrupted in some way as I can see its output pulse trains stall. I am using the 22K/10K circuit and the device is wired on a speedwire prototyping board with ground planes and plenty of decoupling.

This is all survivable as the circuit functions fine in isolation. But it is concerning - am I missing something?

Now for the show stopper:

I'm using a pot across the 5 volt rail to generate an analogue input on adc3. I wish to read this, do a bit of maths to scale the answer into the range 0 - 180 and use the result to program pwm1 to vary the output frequency from 10KHz to 100KHz (this is divided by 100 externally to drive the stepper motors). So I wrote this little program to start understanding picaxe maths:

#picaxe 28x1

start:
w0 = 0

more:
readadc 3, b0

w1 = w0*180/255
pause 1000

debug
goto more

end

I run this and up pops the debug window. I twiddle the pot and see w1 changing - great. So I go to edit the program and after a few goes round the edit-try_it loop I lose communication with the serial port as in 1) above - but permanently. Then I notice that the mouse pointer is jumping around! Pulling out the AXE027 connector stops the mouse pointer behaviour; looking with a scope on the serial pins of the PICAXE shows bursts of activity. So it looks like the serial data stream is interpreted as a mouse. The laptop has a touchpad and a USB mouse, neither seem linked to a COM port and COM3 and COM4 are not shown as "in use" in device manager. I've seen windows "find" a Serial Ballpoint device and install the driver for it. So I have a 28X1 that I can't talk to any more... Actually I now have three of them as I tried the usual things like reinstalling drivers and the PE software and it was OK for a few tries.

Ideas welcome! I've only got one 28X1 left and a deadline of Thursday (that's four days away...)

I've searched the forum but not found anything like this, so hopefully it's just something I'm doing

TIA

Chris
 

papaof2

Senior Member
Two options:

1. Do you have access to another PC with USB? This will allow you to test the USB-serial adapter.

2. Do you have access to an ancient PC with a physical serial port? This will allow you to finish your work without the problems generated in using the USB->serial adapter.

As has been noted on the forum previously, old desktop PCs and old laptops that need a new battery can be had for little or nothing. Even a 486 CPU can run serial at 56K.

John
 

Technical

Technical Support
Staff member
You have an old mouse driver (e.g. mouseball) (or an interactive whiteboard driver) on your computer that is interpreting the serial data as data for the mouse. Find and disable this driver under Windows and the problem should go away.
 

chris_b

New Member
Thanks for the quick responses everyone.

I've had a look in XP device manager and couldn't see any other serial drivers. In add/remove programs there was mobile phone software which could have used a serial port so I removed it. I tried without the usb mouse plugged in - no change to the mouse pointer behaviour. I'm a linux person mostly so my windows sysadmin is a bit rusty.

As it happens I have an old W98 laptop with defective battery and a real serial port. I will try that with my picaxe serial cable and see what happens.

Chris
 

chris_b

New Member
Update:

Chased the spiders out of the old W98Lite laptop, moved the software over, and used a serial cable (no usb in sight)

Result: Three rejuvenated 28X1. And the program works!

Thanks for the suggestion. Pity the USB arrangement is so (potentially) unstable though....

Chris
 

Technical

Technical Support
Staff member
The USB solution is not unstable in any way, it is a local issue with your computer setup here, either a rogue dos or windows mouse driver!
 

marcos.placona

Senior Member
Exactly, I've been using the USB cable for ages and have never had even a small problem.

I'm sure it's something related to your local setup.
 

slimplynth

Senior Member
I put my axe027 on the PC at work, everthing was working fine apart from having to reset the 18X a few times, something that has never happened on my home PC.

Then at the bottom right of the screen, windows informed me it had recognised a new mouse/tracker ball. Thought this was my sony ericsson as the bluetooth allows it to be used as a wireless mouse. The mouse pointer went nuts for a few seconds before I pulled out all USB connections, believing the Network manager had caught me out again :D
 

chris_b

New Member
The USB solution is not unstable in any way, it is a local issue with your computer setup here, either a rogue dos or windows mouse driver!
I meant "my" USB setup, rather than Revolution Education's software in general. That said, USB under Windows can be fraught with complexity especially where (virtual) COM ports are concerned, and complexity is usually dangerous. From simplynth's post I see I'm not alone (interesting that he also had some Ericsson software around).

Chris
 

slimplynth

Senior Member
well in both instances its still a local issue, my home pc never had a issue... never had any probs with usb connection. in fact its been more reliable than a serial port connection... maybe because of the 5v logic levels, dunno:confused:
 
Top