In SX Microcontrollers, SX/B Compiler and SX-Key Tool, bean wrote: Assuming you only need 8-bits (256 levels) of PWM you would setup the interrupt with a rate of 8192 (32 * 256). PwmPin PIN RA.0 OUTPUT ' Change to whatever SX pin you want but make sure you have OUTPUT pwmCnt VAR BYTE pwmValue VAR BYTE ' Set this variable to whatever PWM duty cycle you want INTERRUPT 8192 INC pwmCnt IF pwmCnt > pwmValue THEN pwmPin = 0 ELSE pwmPin = 1 ENDIF RETURNINT Bean. ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=192079#m195618 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2007 (http://www.dotNetBB.com)