In SX Microcontrollers, SX/B Compiler and SX-Key Tool, robotworkshop wrote: What do you want to know about using the SX48 TIMERS to generate PWM? There are two 16 bit timers available. I've used them on a couple projects with SX/B and they worked out well. If you only need a couple the built-in hardware ones are nice since the Interrupt routine and other code is completely free to do other things. Once you set the on/off times for the timers they just run and will toggle the state of their assigned pin. One thing you may need to do is mask their interrupt if you don't want them. I was using an ISR based serial routine and since I didn't care about the Timer interrupts I just masked them off. Otherwise the extra interrupts messed up receiving serial data. Depending on your needs you can simulate PWN on any number of pins by using your own Interrupt routine to keep track of the counts. The nice thing about this route is that you can use any pin instead of the couple pins dedicated to the hardware timers. The help file for SX/B has some information about the timers and there is a great deal more in the SX48 datasheet and another great source is Programming the SX Microcontroller by Gunther Daubach. For the timer do you know the duty cycle and frequency you are tring to get? Not just ticks, but on for a number of ms and off for a number of ms? Robert ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357764#m358513 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)