> >Remember that when the output is low, you want to start a pulse as soon as >possible to minimize ripple. Since these processors don't have interrupts, >it means the code can't ever be too far from checking for the output being >low. Also note that to get 100Khz switching speed, for example, there can >be no more than 10 instructions in the loop. My discontinuous buck >regulators typically switch in the 40-80KHz range. One continuous mode >design I've currently got going switches at around 10-15Khz. I did an AVR version, using a timer's PWM output at 500kHz, but I only checked the output every mS. In this case, I wanted constant current to charge a battery, not too critical on ripple. The ADC and timer adjustments all happened in ints, and the rest of the code is devoted to handling the various battery states. This was in the Tiny-26, which has an 8 MHz RC for the processor, and a PLL giving 64 MHz to the timer in question. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist