3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

A Servo-based 4-legged Walker

Step 7Program the chip

Program the chip
Programming can be done with as sophisticated a setup as you've got. Myself, that's just the (pictured) ghetto-programmer -- just some wires soldered to a parallel port plug.

This instructable details the programmer and software you need to get it all running.

Do Not! Do Not! Do not use this programming cable with any devices that even get near to voltages above 5v. The voltage could run up the cable and fry your computer's parallel port, ruining your computer. More elegant designs have limiting resistors and/or diodes. For this project, ghetto is fine. It's only a 3.6v battery onboard. But be careful.

The code I use is attached here. Mostly, it's overkill for just getting two motors to swing back and forth, but I was having fun.

The gist of it is that the servos need pulses every 20ms or so. The length of the pulse tells the servo where to turn the legs. 1.5ms is around the center, and the range is from 1ms to 2ms approximately.

The code uses the built-in 16-bit pulse generator for both the signal pulse and the 20ms delay, and gives microsecond resolution at the stock speed. The servo's resolution is somewhere near 5-10 microseconds, so 16-bits is plenty.

Does there need to be an microcontroller-programming instructable? I'll have to get on that. Let me know in the comments.

« Previous StepDownload PDFView All StepsNext Step »
5 comments
Jun 6, 2011. 2:06 PMcreatorroboto says:
Great project but is the Code in C or C++? I'm an Arduinophyte. Sorry, I'm not the most hardworking person...

Once again, Great Project
Dec 27, 2008. 3:57 PMgeeklord says:
I need to learn how to write in C. Can I use C to programall microcontrollers??
Jun 6, 2011. 2:03 PMcreatorroboto says:
Nope. I tried uploading C++.

C++ = busted Arduino (if you're using one.)

Try getting the Turbo C bible...worked for me.
Mar 15, 2008. 7:49 AMxenomorph says:
awesome!!!!!!!!!!! i have never programmed before and thanks to your instructable I can start THX:-)
Jan 9, 2008. 6:53 PMknive05 says:
can i use pic16f84a as a microcontroller

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
93
Followers
7
Author:The Real Elliot