>Also, I will try Bob's idea of getting all the bits ready, >and then moving them into the port. This should further >help to get even fading. And if you do things this way, the load of the port register can be done in an interrupt routine, from a background (non-interrupt) prepared value. This means that the write out is done in a very tightly controlled timescale, without the PWM calculation affecting that time (provided the calculation is done in less than an interrupt interval) This has an advantage in that you now do not need to deal with code symmetry for on and off times. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist