In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: It's actually pretty simple: there is a timer that reloads a PWM accumulator every 256 cycles (when the time rolls over from 255 to 0). After the accumulator is loaded with the desired duty cycle (0 to 255 = 0 to 100%). When not doing a reload cycle the accumulator is incremented and when it rolls over the output is set high, so the higher your duty cycle, the earlier the accumulator rolls over and the quicker the output goes high. I actually found a small error (I just got home from a trip and have my scope packed -- sorry). Give the version attached to this message a try. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m259277 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)