dumbing down pwm with counter
mikea
Posts: 283
is there a breakdown of code and how the counter executes its function for pwm for a complete dummy to understand. ive spent many hours spinning my wheels and would like to get past this hump. ive read about the counters from the prop manual and an exercise in prop pe kit. is there a place to talk to someone in real time to get answers? is there a "tudor" or someone on this forum i could call on the phone periodically for help? -mike
Comments
And I would suggest that you not want to "dumb down" anything; just learn it. The counters can be tricky, but with a bit of persistence you'll get there (I'm an actor; if I can do it you certainly can). The real trick is how you define PWM. If you (like me) are wanting fixed-frequency, variable-duty-cycle PWM then it takes a little code to do that. You can use the counter to create the "on" portion of the signal while a synchronized timing loop handles the desired frequency of your signal. Many of us use this strategy for motor control (I'm updating a Propeller-based motor controller today).
The attached code is commented and may help you find your way.