#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached#define REFRESH_INTERVAL 20000 // minumim time to refresh servos in microseconds#define SERVOS_PER_TIMER 12 // the maximum number of servos controlled by one timer#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER)

If the REFRESH_INTERVAL is increased the maximum stable update is at 8000 / 125hz. At 2500 the frequency changes from 125hz at 2000us pulse width to 250hz at 1000us. Is there a way to modify this library to give a nice consistent 400hz update rate? Thanks in advance for the help.

I'm running quad rotor ESCs. The craft flies fine at 125hz updates. I'm looking to the 400hz update because I have moved from running the control algorithms on the arudino to a more powerful 32bit ARM uC. All the arduino does in that mode is take the data from the transmitter, send that data to the other MCU, and update the ESCs based on the data received from the 32 bit processor. All of that takes place over a SPI link in ~.4ms.

That makes sense and I just verified what you said on the scope. When the pulses are at 2ms it takes the entire time. So I guess the question now is how does one generate all of the pulses simultaneously?

i would not do that, instead i would interlace them with an offset chosen to minimise clashes int the high/low transitions for each channel, but thats just off the top of my head and may not be the best plan. whether it is a good plan or not, its very far from anything the servo library does so your looking at some serious modification or starting from scratch.

its also worth checking the specs of your escs, i dont know anything about quad copters, but i think i have seen reference to some escs having the option to switch to a different resolution to spport higher refresh rates in which case you might still be able to get away with some simple mods to the servo library.

#define MIN_PULSE_WIDTH 1000// the shortest pulse sent to a servo#define MAX_PULSE_WIDTH 2000// the longest pulse sent to a servo#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached#define REFRESH_INTERVAL 2500// minumim time to refresh servos in microseconds#define SERVOS_PER_TIMER 1 // the maximum number of servos controlled by one timer#define MAX_SERVOS (_Nbr_16timers * SERVOS_PER_TIMER)

The key is 1 servo per timer. If you want to run 8 ESCs the max rate is 200hz with servos per timer at 2. Hope this helps someone.