At 02:00 PM 5/26/2005, Dave Turner wrote: >Well, I'm not sure if it's because we're doing an entirely different >think, but his pwm function is 105 lines. Mine is 26. Here is mine >so far (the part I asked this question about goes after the on and off >instructions, replacing the porta,0: Actually, if you look at Scott's code, you will find within the comments at the start of the code the following: ;RAM: ; pwm0-pwm7 - pwm counters ; rising_edge - rising edge counter ; pwm_state - current state of the pwm outputs. ;ROM ; 38 instructions ;Execution time ; 23 cycles In other words, Scott's routine uses 23 cycles to generate 8 separately adjustable PWM outputs. That would make it about 5 times faster than your method. Nothing wrong with the way you are approaching the problem. Scott's method is different and faster. dwayne -- Dwayne Reid Trinity Electronics Systems Ltd Edmonton, AB, CANADA (780) 489-3199 voice (780) 487-6397 fax Celebrating 21 years of Engineering Innovation (1984 - 2005) .-. .-. .-. .-. .-. .-. .-. .-. .-. .- `-' `-' `-' `-' `-' `-' `-' `-' `-' Do NOT send unsolicited commercial email to this email address. This message neither grants consent to receive unsolicited commercial email nor is intended to solicit commercial email. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist