Servo controller schematic and code V1.00
[Document Version: 1.00]
[Last Updated: 4/15/95]
Servo controller schematic and code
Author: Richard John Farmer
Date: 15 Apr 1995
Rick Farmer firstname.lastname@example.org `85 CB700SC AMA# 482666
3510 Buford Hwy K-6 85k miles and 10 years of merciless abuse and it still
Atlanta, Ga. 30329 lives, but then again a spare engine (or two) helps.
I got a lot of mail on this project in
and figured the folks of
might like it too, so follow up on there. For those of you
who don't know a PIC is a $5 microcontroller (single chip computer),
and the servos in question are the RC model type which go for ~$20.
Here it is, the code and schematic for a simple servo controller using a
PC joystick and a PIC 16c55. The code can be complied with
MPASM (use this)
and simulated with
All are free from
and available on
+ tons of other code examples. A demo version
is available on
mobius.gmu.edu (limited to 2 anonymous connections!)
in directory /pub/circad as file
So you can play with this for free.
If you're in the Atlanta area you can even come over and use my burner to make
a chip if you bring a beer.
Send one a 1ms pulse every 20-30 ms and it goes
all the way to the left, a 2ms pulse every 20-30ms and it goes all the way
to the right, 1.5 ms and it goes to the middle, simple. This code is simple
it just counts while the joystick pot charge a cap enough to be a 1, saves
the time, flips the pin to an output to discharge it (with a low out), then
flips it back to an input. The timing is all done in spin loops. If you want
to do something else the low time of 20-30ms is not critical. I actually
compensate for the variable high pulse time, but it isn't needed. The 16c5x
chips don't have interrupts and only 2 level deep stack, but hey they're
cheap and fast as hell. Remember, this is just something I cooked one
afternoon, so it's not pretty but it works.
My current project is a Xilinx SPROM programer. Anyone up on the *.MCS
file format. I've got the hardware designed, but I still don't have
all the info needed to parse the input file yet. The hardware is fully
software configurable so it'll make a good starting point for other
such project by the net.community.
Anybody want a copy of my resume too :-)