PIC servo control
Second PIC program, this one moves a hobby servo motor to one of two positions. The switch needs to be pulled up with a resistor.
It has one light that is always on and a second that switches on/off when the servo moves.
PIC12F683 servo motor movie:
Here are the code files: p12_servo1.asm and p12_servo1.hex.
Assembly of the .asm to a .hex:
>gpasm p12_servo1.asm
Write it to the PIC12 using:
wine “C:\Program Files\PICPgm\WinPICPgm.exe”
It is wired as shown in the video.
The servo timing is off from what I calculated. A calculated 1ms to 2ms gave about 60 degrees of movement, what’s shown is 0.75 to 1.25 ms pulses every 20 ms. I haven’t measured the pulse lengths with a scope.