I basically just want to use bit 0 of port b to send the pulse, 1.5mS which will centre the servo. Trying to work out the delay's .. UHhhhh Can someone paste some suitable code in? ----- Original Message ----- From: "Drew Vassallo" To: Sent: Thursday, March 08, 2001 10:05 PM Subject: Re: [PIC]: Driving a servo? > >4) call a delay routine of around 40ms (0.040sec), this is not a critical > >delay > > I never heard of this... typically the servos work at 50Hz, which is 20ms > between pulses. There's no real reason to go to 40ms delay. > > You'll get jitter on your servos if you don't have the pulse widths within 2 > or 3us (MAYBE stretch it to 4us) on consecutive pulses. > > In other words, set output high, wait the desired time (0-2ms, depending on > to where you want your servo to move), set output low, wait 20ms minus the > time you had your pulse high. Repeat, but ensure that the next high pulse > width is within 2 or 3us of the previous one. This can be tricky if you're > using interrupts to determine your pulse width. Or, if you run through > different paths to get to your pulse level changing routine, you may end up > with more or fewer instruction cycles from one pulse to the next. > Alternately, if you don't care about a few minor "clicks" of your servo here > and there, then you can ignore the jitter. > > Should be a good learning experience... at least it'll give you a good > visual example of what happens in your code. > > --Andrew > _________________________________________________________________ > Get your FREE download of MSN Explorer at http://explorer.msn.com > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads