In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote: Larry, The SX/B [b]PWM[/b] command is intended for use in creating analog output voltages. For example, with a 50% duty cycle setting the result is a [u]stream[/u] of high and low pulses of equal durations during the time interval specified. If you want to control the speed of your motor this might work for you. However, if you want to create just a single pulse output (which you can repeat to make a pulse stream) where you determine how long the pulse is high and how long it is low you will probably want to use the [b]PULSEOUT[/b] command instead. The [b]PULSEOUT[/b] command will create a pulse with a [u]single transition[/u] within the time period specified. The [b]PWM[/b] will likely generate [u]many transitions[/u] during the time period specified. Example outputs where H = HIGH, L = LOW -------------------------------------------------- [b]PULSEOUT[/b]: HHHHHLLLLL at 50% [b]PWM[/b]: HLHLHLHL at 50% NOTE: The SX48 has two internal timers you can use to set up two pulse streams in hardware that continue to run on their own once configured. These are very nice for motor control! If you are using an SX48 be sure to consider them! I hope this helps. - Sparks ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=258538#m258545 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)