Shop OBEX P1 Docs P2 Docs Learn Events
dumbing down pwm with counter — Parallax Forums

dumbing down pwm with counter

mikeamikea Posts: 283
edited 2012-03-27 11:57 in Propeller 1
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

  • JonnyMacJonnyMac Posts: 9,197
    edited 2012-03-27 09:57
    The great thing about the forums is that others can answer you -- at no fee to you -- on their own schedule. Keep in mind that time = $ for many forum participants.

    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.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2012-03-27 10:21
    You are on the propeller forum, you are therefore not a dummy.
  • mikeamikea Posts: 283
    edited 2012-03-27 11:57
    thank you for that -mike
Sign In or Register to comment.