I think the 'F877 is up to the task. It is possible to do 1us timing of t= he incoming RC channels and the outgoing PWM commands to the servos with a 4= MHz clock (that's about 10 bits resolution). All of this would use both of th= e CCP modules of the PIC, and very little external hardware (some resistanc= es and switches. This two tasks runs in one of my projects, interrupt driven, and the same PIC takes care of I2C communications, Manchester encoding and decoding through the USART to RF stages, some simple math, A/D sampling, etc. If y= ou are interested, I've posted the code of the PWM generation and acquisitio= n in this list some time ago. I'll try to find it again. Regards, Alvaro Deibe. P.S.: RC servo PWM signals go from 1 to 2 ms, and 1.5ms is the center poi= nt. This is a general rule, but you'll find some differences between brands. Also, the 20ms frame time is not an absolute rule. In fact, I drive my servos (Futaba, Sanwa, Cyclone) at 10ms or less without damage. This increase in the update of the information to the servo translates in more speed and torque (not stalled). Some brand (Sanwa) use this trick, raisin= g the freq of the PWM generated right in the transmitter... ----- Original Message ----- From: "Thomas Holmstr=F6m" To: Sent: Monday, June 17, 2002 9:44 PM Subject: [PIC]: Servos, timing, interrupts etc... ---- Snip ---- > I my project for an onboard flight computer for an R/C model, I have a > few heavy tasks. One of them is to both monitor and adjust servo > channels from the receiver to the servos. Both to generate servo > position info and to be able to adjust control throws, exponentials, > mixes, gyro-based adjustments etc. Since the servo sampling/pulsing > seems to be quite intense for a PIC (I'm developing on 16f877's but the > final board could use some other suitable model) I've thought of puttin= g > the servo control on a separate PIC. This would communicate (through > SPI?) with the main controller. > > Generally, I'm trying to figure out the most efficient way to both read > the servo pulses from the receiver and to generate output pulses. In > meantime, I need to have time to respond to requests from the main > controller. How many channesl In/Out is feasible to handle if I find an > optimal method? (I'm basically assuming 20MHZ clock.) ---- Snip ---- > ------Servos--------------------------------------- > You probably all know this but anyway. Servos are (supposed to be) > encoded as high pulses with a variable length of 0,5ms to 1,5ms, > corresponding to position, where 1,0ms represents middle or zero > deflection. Pulses should be repeated within 20ms which means one can > usially generate one pulse for each channel and still have some time to > wait until the next 20ms repetition. ---- Snip ---- -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.