gosub PROBLEM SOLVED
a) I have read the Read Me First document
b) I have searched the forums and found nothing
c) This is a 'hobby', I have little electronics experience, this is my first PICAXE, but I do have software experience.
I recently received my Picaxe 28x1 and the servo upgrade pack. I followed the instructions given with the servo pack, i.e. soldered on the 10 way header, fitted the DIL resistor pack and connected the supplied 6V battery pack to header E and then connected the servo to output 0.
Using the program on the instruction sheet supplied with the servo upgrade (modified the 'loop' label as that's a reserved word) the servo rotates clockwise and then buzzes. I tried the example program in picaxe_manual3.pdf and that behaves the same.
I changed the program to use different output ports, still no joy.
At this point I was thinking the servo must be broken; however I found code someplace that used pulsout and when I tried that it worked just fine which makes me think that the servo is ok but the servo/servopos commands aren't working.
I don't have any spare bits I can swap out and I don't have much in the way of diagnostic equipment - a multi-meter and some LEDs. I patched the outputs into a breadboard and connected LEDs to show Power, Output 0 (and Output 7 so I could flash the LED to show what the program was up to) and patched up to a header for the servo with signal from output 0, V2+ and 0V.
The power to the picaxe (from 3 alkaline cells) is 4.42V
I can measure 5.81V coming from the board to the servo header (4 x alkaline).
When I use the pulsout command I can see LED0 light up, the brightness dependent on the width of the pulse (which is what I would have expected) and the servo rotates anti-clockwise as expected.
When I use the servo or serverpos commands LED0 remains unlit (or very, very dim I suppose) and the servo rotates fully clockwise and then buzzes. I have tried to measure the voltage on the signal pin, it read as 0.009/0.010 when the servo/servopos commands were executing, and 0.000 when the program finished. I wouldn't like to say how accurate or meaningful those measurements are as waving the leads about can give a higher reading.
I'm using the command line compiler on Linux which reports "PASS - programmed PICAXE-28X1 (40X1) vA.4 successfully.". (The program seems just fine other than not seeing the board sometimes and other programs I have written all seem to operate correctly, e.g. I have successfully connected up an SRF005 (using port 0), switches and LEDs )
Here is the program I have been using - nothing complicated - any ideas on what might be wrong?
===========
PROBLEM SOLVED:
Rev-ed shipped me a new chip with V A.5 of the firmware and the servo/servopos commands work just fine
Thanks everyone
===========
a) I have read the Read Me First document
b) I have searched the forums and found nothing
c) This is a 'hobby', I have little electronics experience, this is my first PICAXE, but I do have software experience.
I recently received my Picaxe 28x1 and the servo upgrade pack. I followed the instructions given with the servo pack, i.e. soldered on the 10 way header, fitted the DIL resistor pack and connected the supplied 6V battery pack to header E and then connected the servo to output 0.
Using the program on the instruction sheet supplied with the servo upgrade (modified the 'loop' label as that's a reserved word) the servo rotates clockwise and then buzzes. I tried the example program in picaxe_manual3.pdf and that behaves the same.
I changed the program to use different output ports, still no joy.
At this point I was thinking the servo must be broken; however I found code someplace that used pulsout and when I tried that it worked just fine which makes me think that the servo is ok but the servo/servopos commands aren't working.
I don't have any spare bits I can swap out and I don't have much in the way of diagnostic equipment - a multi-meter and some LEDs. I patched the outputs into a breadboard and connected LEDs to show Power, Output 0 (and Output 7 so I could flash the LED to show what the program was up to) and patched up to a header for the servo with signal from output 0, V2+ and 0V.
The power to the picaxe (from 3 alkaline cells) is 4.42V
I can measure 5.81V coming from the board to the servo header (4 x alkaline).
When I use the pulsout command I can see LED0 light up, the brightness dependent on the width of the pulse (which is what I would have expected) and the servo rotates anti-clockwise as expected.
When I use the servo or serverpos commands LED0 remains unlit (or very, very dim I suppose) and the servo rotates fully clockwise and then buzzes. I have tried to measure the voltage on the signal pin, it read as 0.009/0.010 when the servo/servopos commands were executing, and 0.000 when the program finished. I wouldn't like to say how accurate or meaningful those measurements are as waving the leads about can give a higher reading.
I'm using the command line compiler on Linux which reports "PASS - programmed PICAXE-28X1 (40X1) vA.4 successfully.". (The program seems just fine other than not seeing the board sometimes and other programs I have written all seem to operate correctly, e.g. I have successfully connected up an SRF005 (using port 0), switches and LEDs )
Here is the program I have been using - nothing complicated - any ideas on what might be wrong?
Code:
symbol servopin = 0
low 7
b0 = 75 : gosub pulseto
b0 = 150 : gosub pulseto
b0 = 225 : gosub pulseto
high 7
gosub example1
gosub example2
low 7
pause 2000
end
' This is the example given on the servo upgrade pack instruction sheet
example1: servo 0,75
pause 2000
servo 0,150
pause 2000
servo 0,225
pause 2000
return
' This is the example given in picaxe_manual3.pdf
' but changed to use port '0' instead of '4'
example2: servo 0,255 ' start servo on 4
pause 2000
main: servopos 0,75 ' move servo to one end
pause 2000 ' wait 2 seconds
servopos 0,150 ' move servo to centre
pause 2000 ' wait 2 seconds
servopos 0,225 ' move servo to other end
pause 2000 ' wait 2 seconds
return
pulseto:
for b1 = 1 to 20
pulsout servopin, b0
pause 20
next
return
PROBLEM SOLVED:
Rev-ed shipped me a new chip with V A.5 of the firmware and the servo/servopos commands work just fine
Thanks everyone
===========
Last edited: