Francois, those servos are fairly standard though some allow more travel. Andy Kunz is our resident expert here but it just happens that I finished a 2-channel servo controller last night and I'm looking for a couple of `guinea pigs' (err, Beta testers ;-). One an expert like Andy and one a novice like you (and me in this case). Typically, servos require a 50Hz PRF where the pulse varies from 1 to 2ms with 1.5ms being center. Again, some servos will allow more or less travel, hence a different pulse width range. The majority seem to allow 90 degree rotation with the above PW but I have one that does 180 degrees from 0.5ms to 2ms... The connector is standard though the color of the control line may be white, yellow, or some other color. Black is always ground and red is always +5V. Looking at the connector with the Black wire on top: o GND (Black) o +5V (Red) o CTL (White, Yellow, etc) Back to my project, I was hacking a Radio Shack R/C car to make it a robot. It's based on a 16F876 and is interrupt-intensive. The car does not use proportional servos so I used PWM and an H-Bridge to control the rear drive. I glued a couple of rare-earth magnets to the motor shaft and used a Hall-Effect sensor to provide a tachometer for PID control. I want to use an R/C servo for steering so I came up with this servo controller. I wanted something simple and small with minimum parts so I used a 12C671 since it's an 8-Pin device and, unlike the 12C5xx parts, supports interrupts with TMR0. You send control signals via RS-232. I decided to use a simple resistor and clamp diodes (optional, you can use internal diodes) rather than another MAX232, etc. I wanted to control both servos with one Control Byte so I limited the range to; 0 - 127. The MSB controls which servo gets updated. To make it expandable, I added an Enable input. When disabled, the controller ignores the serial port and maintains the servo's current position. The PRF is around 55Hz. You can easily hack it for three servo channels by eliminating the Enable input and going to a two-Byte protocol where the first Byte is the servo channel and the second is the position. All the servo work is done in the TMR0 ISR. You can also adapt this to any 12C6x or 16xx device by changing the port pin equates. The only requirement is that TMR0 is free and capable of generating an interrupt. The following is the basic interface: Hardware Interface: GP0 <- Enable. 0 = Enabled, 1 = Ignore Serial Port Note: Servos Remain at their Last Position when Not Enabled GP1 -> Servo #0 Control GP2 -> Servo #1 Control GP3 <- RS-232 Input via a 22K Resistor and Clamp Diodes WARNING! Code Inverts the RS-232 Data for use with the Resistor! Software Interface: The span is 0 to 127. The MSB selects Servo #0 or Servo #1 as follows: 0 = Servo #0 1.0ms 63 = Servo #0 1.5ms 127 = Servo #0 2.0ms 128 = Servo #1 1.0ms 191 = Servo #1 1.5ms 255 = Servo #1 2.0ms Since this is based on code from someone else (I don't have the name), I'm putting it in the public domain for anyone interested. I use TechTool's CVASM (Formally Parallax with several enhancements) with it's Intel-style 8051 syntax. If you want to hack the code, you can get the assembler for free from TechTools (See the link below). The code is trivial. I can also provide the object file in both CVASM format or as Hex for Microchip programmers. I'll put this on my web site in the next few days. If you want to get CVASM and the manuals, go to: http://www.tech-tools.com/ Once you get to the site, select "Support". From there select and download the following: Support Category: Product - CVASM16 Item: PIC software - CVASM16 V.5.8 Item: PIC Documents - CVASM16 Instruction Set Item: PIC Documents - CVASM16 Details Item: PIC Manuals - PIC Tools Manual V.8.0 - Tom At 01:51 PM 10/19/00 +0200, Francois Robbertze wrote: >I think I got my answer now!! > > >A 1.5ms bitstream (with a 20ms between pulses) will take the servo to the >center. 1 to 1.5ms will move the servo in one direction (for example 1.25ms >wil move appr. half way to the one direction) and 1.5 to 2 will move it in >the other direction... > >Please correct me if i'm wrong... > >Kindest regards > >Francois > >----- Original Message ----- >From: Francois Robbertze > >Dear Piclist members, > >I want to use a old RC aircraft servo in one of my pic applications...Can >someone direct me to a page on the net. (I get a error when searching the >archives) > >1. The servo (FUTABA S100) has three wires (red, black and white). Can >someone help me with the connections (eg. black - gnd; red - +5V; and white >+5V signal from pic???) > >2. As I understand the servo move one increment in one direction when a >100ms pulse is applied and in the opposite direction if a 200ms pulse is >applied? > >3. Is there some feedback from the servo that you can determine the position >of the rotor (if not how does the servo know the center position every time >I switch it on in the aircraft? ------------------------------------------------------------------------ Tom Handley New Age Communications Since '75 before "New Age" and no one around here is waiting for UFOs ;-) -- http://www.piclist.com hint: PICList Posts must start with ONE topic: "[PIC]:","[SX]:","[AVR]:" =uP ONLY! "[EE]:","[OT]:" =Other "[BUY]:","[AD]:" =Ads