gnupic: PWM Fun
Subject:
Re: PWM Fun
From:
Jeff Jackowski ####@####.####
Date:
24 Jan 2003 22:43:23 -0000
Message-Id: <Pine.OSF.4.44.0301241545340.34621-100000@fly.hiwaay.net>
On Wed, 22 Jan 2003, Scott Dattalo wrote:
>Check out
>http://www.dattalo.com/technical/software/software.php
>
>and particularly:
>http://www.dattalo.com/technical/software/pic/pwm8.asm
>
>This code will drive 8 PWMS simultaneously. I've got a new version that
>does the same thing but allows you to easily update the Pulse Width.
>
>For 8 pwms, it takes 23 cycles. For 4 it would only take 15 cycles.
>That's very little overhead. The code reside in a timer 0 interrupt
>handler.
Thanks for the code, Scott! I didn't realize it could be done in so few
instructions. I'm going to be moving the code to the 16F877A, and in the
process will be going from 4MHz to 20MHz because I can't see a reason not
to. That should put an end to most of my performance concerns. The only
thing I'm worried about is taking the right amount of time to charge the
small capacitors (0.068uF) I'll be working with.
I did look for some chips, as was also suggested, but I could only find
the one chip that was mentioned, the 82C54. A chip that takes SPI input
would be ideal as I have to use SPI already. I searched, but didn't locate
one.
I'm going to try Scott's solution for now and hope that I can get it to
work for my application.
--
Jeff Jackowski
http://ro.com/~jeffj/