PIC Based Serial Port Servo Controller 8 Servo Variant
Author: Ashley Roll, March 2002.
Many Thanks to Richard Gardiner for providing this program for everyone! Its a small PC program that allows you to control all the servo outputs for the 8 servo variant. You can download it here Servo.zip (12KB). Alternatively you can go to Richard's website for more details and some other interesting projects and you can contact Richard on his web site.
You can download the PIC program which contains a HEX file which most PIC programmers can read; and a PIC Assembler code (ASM) file if you would like to see how it works or modify it.
I used the free PIC assembler from Microchip, the manufactures of the PIC range of Microcontrollers.
Servo Controller Commands
The commands are the same as the 4 servo version, except that there are no longer any digital output control commands. See below for a quick listing.
The software now recognises channels 0 to 7. These map to RB0 to RB7 on the PIC. Note: the servo pin numbers have changed! What was Digital 0 is now Servo 0, what was Servo 0 is now Servo 4.
| Hex | Decimal | Data Byte | Description |
|---|---|---|---|
| 00 | 0 | Yes | Reset the controller. All outputs off, all servos disabled and all servos position and offset values are set to 128 (midrange). The data byte following this command MUST be zero. To ensure that a reset command it actually executed, send three consecutive zero bytes. |
| 10 | 16 | Yes | Set the servo output 'Position' value for the servo specified in the channel nibble. The data byte contains the new position value between 0 and 255. |
| 20 | 32 | Yes | Set the servo output 'Offset' value for the servo specified in the channel nibble. The data byte contains the new offset value between 0 and 255. |
| 30 | 48 | No | Enable Servo Output. Start generating the servo control pulse for the servo specified in the channel nibble. |
| 40 | 64 | No | Disable Servo Output. Stop generating the servo control pulse for the servo specified in the channel nibble. |