Russ, Can you pls trim down your code again and just leave the PWM part only. Pls post it again. Once again, the problem MUST exist after the trimming. Do also provide the schematics for the new code. Leave out the loads and replace it with LEDs. It should help us narrow it down plenty. John PS: If you would like a fresh idea to the problem. Start a fresh with the code first. Start with blinky leds first and put in the original code one at a time. Subroutine the code properly so that you can know where it is failing at. --- Russ Hensel wrote: > John Chung replied: > > First of all is the code working right? When you > remove the loads does the program work right or does > it work periodically? Could you remove the routine > for > the pushbuttons and just run the code first with a > preset setting? > > Regards, > John > > Russ then says: > > Code is working right sometimes, simulated some > versions, seemed ok, > may do more. > When loads removed still erratic. > When pusbutton code gone, still erratic. > Did not simulate the delay code, may put that in the > simulation next. > > Russ > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > ____________________________________________________________________________________ Food fight? Enjoy some healthy debate in the Yahoo! Answers Food & Drink Q&A. http://answers.yahoo.com/dir/?link=list&sid=396545367 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist