I just found your site and can't believe the code I saw.  This is exactly what I've been looking for.  I'm currently using 555's to drive servos using a Dallas digital pot to control them, but the PIC looks like a much cleaner example of how to do it.  I think the site is great, keep it up.

Davis Ringo,
Radiant Systems.com

"Free Servo Control Software"
Hobby ServoServo Control SoftwareHobby Servo

This serial servo control software was written in "Visual Basic 5 Pro".  I wrote it as a simple test program to test hobby servos. It uses the PC serial port "com1" to talk to a Basic Stamp, or a Pic Micro programmed with MicroEngineerings PicBasic.  For a more powerful version click here.  The new version has control knobs instead of the slider control.

Port pin 0 on the stamp (port RB0) on the PIC, connects through a 22K resistor directly to the PC's serial port "TX" on "com1". The Stamp or PIC receives serial information from the PC to position seven hobby servo motors attached to port pins 1-7.

OPERATION:

1. Slide the scroll bar to the desired position for the servo motor. Up for right, center, and down for left.

2. Click on the button number that corresponds to the servo motor you want to move.

In between positions are available as well, in fact you will have very precise positioning using the scroll bar. You can just click on the slider and hold the mouse button down while moving the slider for large adjustments, or use the up/down arrows for slower more precise positioning.

This is a very simple example of controlling external equipment with the PC and the basic stamp, or a PIC programmed with PicBasic from MicroEngineering Labs.

Here is the basic code to use with the servo control software. NOTE: This code will work with both the Basic Stamp, and the PicBasic Compiler.

 Here's the Basic Code for The Microcontroller

                symbol pos = b2                ' Position storage
                symbol servo = b3             ' Corresponds to pins 1-7 for servo number
                symbol count = b4             ' Count storage

                start:
                serin 0,N2400,servo,pos     ' Input data on pin 0, 2400 baud
                
                move:
                for count = 0 to 40              
                    pulsout servo,pos            ' Send servo# ?, to position# ?
                    pause 20                        ' Timing delay
                next count                          ' Do it again until count = 40
                goto start                            ' Return and wait for more input

      If you're looking for PicBasic, we now have it in stock, and ready to ship.  Click HERE for details...!

 Here's the schematic for using a PIC16F84.
If you're using the Basic Stamp just hook pin "0" on the Stamp to the PC serial port-pin #3
serialservo schematic

 

NOTE: The Visual Basic Software provided by us is 32-Bit and runs on Window 95, or Windows 98.

Price: FREE [My Favorite Price]......:o)

Click Here to Download the Code for this project.

The above Download comes with:

bullet

The Serial Servo Install Program for use on "Comm 1".

bullet

The Complete Microcontroller Code, in "Text Format", for use with the Basic Stamp.

bullet

The Compiled "HEX" Source Code ready to burn into the PIC16F84.

 

bullet

Click HERE to purchase PicBasic Compilers - and hardware.

bullet

Click HERE to learn more about the PicBasic compiler.

bullet

Click HERE to return to the PicBasic projects page.