I've done both in C, but not assembly... if you'd like to see the servo C code from my first attempt (warning:ugly, amateur C code!) you can see it at https://www.botkin.org/dale. There is a .LST file that has the C and ASM code in the same listing, if that helps. What I do is set up a regular interrupt using TMR0, usually around 1ms. In the interrupt service routine I increment a counter. When the counter hits the refresh interval of 20ms (or a little longer), I generate a pulse with its period determined by the value of a variable. So all I have to do is make that variable represent the position (or speed, in your case) desired for the servo, and let the ISR do the work. I have long suspected that the servo will hit max speed with a pretty small offset in an application like yours. I have done some poking around inside Futaba and Airtronics servos with a 'scope, it's pretty interesting. Been meaning to use a couple for a robot drive for a year or so now, but I keep getting side--tracked on other projects. Maybe on '02. By the way, if anyone has not seen it yet, the /TAB BOOKS BUILD YOUR OWN ROBOT KIT/ is available in the US at Barnes & Noble. Awesome deal!! Designed by Myke Predko & Ben Wirz, two names that should be very familiar to anyone on this list. It's a complete PIC controlled robot kit in a box, with a socket for a Basic STAMP II and Parallax App Mods. Price is $60 and B&N had 20% off when I got one for my 16 year old son. The web site at http://www.tabrobotkit.com/ has complete source listings and schematics, so it's a hack-friendly platform. My *only* wish is that the wheels were big enough for carpet use. Anyway, #3 Son will be opening it some time today or tomorrow, I'll have more info on it then. I just hope someone took my blatant hints and got one for me too! Dale -- "Curiosity is the very basis of education and if you tell me that curiosity killed the cat, I say only the cat died nobly." - Arnold Edinborough On Mon, 24 Dec 2001, Prince Anamalech wrote: > > Hello fellow PICSter's > > I am new to the pic scene but have gained sufficient knowledge to get me through so far! > i am currently building a robot using a PIC16F84 . I am using two hacked servos for the motors, and am hoping to use two > ultrasonic transducers (40Khz) to detect obstacles. > I have hacked the servo's using a transistor bridge (making it think it is always in the centre position). I am trying to > test out the servos by writing some assembly code with mplab, but i am having no success. > I have connected the servo's control wire to a pic pin. PINS A.0 and A.1. Left and Right respectively. > i have tried manipulating some code on the piclist archive but with no success. > COULD anyone please help me out with some assembly code PLEASE? > also does anyone have any ideas or schem's/code to help me out with my ultrasonic's?? -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics