Is there a way to have 2x HWPWM outputs from one PIC, that will run at the same frequency but at a different duty cycle?
Is there a way to have 2x HWPWM outputs from one PIC, that will run at the same frequency but at a different duty cycle?
Or, if you need fairly low frequencies (10-200hz) and your PIC doesn't have 2 CCP's, this might work...
(SPWM_INT - Multiple Software PWM)
http://darreltaylor.com/DT_INTS-14/SPWM.html
<br>
DT
Well, if it's going to run two solenoids, chances are they aren't going to run any more than 100Hz or so (unless you've got special solenoids that run at a lot more than that).
The Multiple Software PWM practically runs in the background and works well.
Myself, I have been able to do software PWM running 63 LEDs, all with independent PWM on a 18F8722, with instruction cycles leftover to do other things.
Past that, if you really need that much processing power (and I'm guessing you really don't, but think you do), you're probably better off with 3 separate PIC's, one master, and a couple of slave PICs, each one doing it's own PWM.
Hi,
While the timebase is fixed to a single timer the frequency of the PWMs remain same. But for PICs with 2 PWMs you need to update the registers CCPR1L and CCPR2L with your desired duty cycle. Example 16F877A, 18F452.
Regards
Sougata
Bookmarks