Problem with servo @16MHz

husslemk4

New Member
Hello,

I'm trying to run a servo with a 28X1 at 16MHz and I am having some trouble. When I run my code the servo jams itself fully to the left. Im using firmware A.2, so perhaps this problem was adressed in newer firmware. Any ideas would be great,

Thanks

Code:
setfreq em16
init:
high 6
pause 500
servo 5, 150
main:
servopos 5, 150
pause 100
goto main
 

hippy

Technical Support
Staff member
Latest firmware.txt does not indicate anything specific about servos at 16MHz not working with A.2 Firmware. Does the servo operate as exected at 4MHz ?
 
Last edited:

hippy

Technical Support
Staff member
Thanks. We will have to investigate the issue. The workround at present would seem to be to run at 4MHz or run at 16MHz using a bit-banged servo loop. Untested but the following should hopefully work ...

#Picaxe 28X1
#No_Table
#No_Data

w0 = 150 ' Servo Position (75..225)

SetFreq EM16
w0 = w0 * 4
w1 = 8000 - w0
Do
Pause w1
PulsOut 5, w0
Loop
 
Last edited:

MartinM57

Moderator
Obvious (probaby stupid) question - you did have an external 16MHz resonator fitted originally i.e. for post #1?
 
Top