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
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