Ian Mmith wrote: > I am using a 18F252 that can output two PWM waveforms each with it's own > duty cycle. However, I need three for my project. > > The hardware PWM works great as you can see from this image, where it > smoothly blends one color into another... > > http://www.ian.org/HD-Clock/HDC-BG-PWM.jpg > > > I tried doing the PWM in software and it worked.. but not well. I could > only get a few bits of resolution and it ate up all the CPU cycled because > of the high speed it needs, even with the PIC running at 40MHz. The > minimum period I need to use is 25us. Higher and there is visible > interference patterns from the PWM wave. Just too fast to bit-bang and > leave room for much else. > > Are there any PICs that can output more than two duty cycles? I have seen > some PICs have four outputs but they are just for driving h-bridges and > still only let you set two duty cycles. > > I suppose I could use a 2nd PIC like a 16F86 but I'd prefer internal PWM > since it works so well for the 2 channels I have. > > Thanks! > > -- > Ian Smith > www.ian.org Software can easily do several pwm channels; see Scott Dattalo's page, http://www.dattalo.com/technical/software/software.php in particular, his pwm8.asm code. It does 8 channels of pwm in software. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist