PWM count

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
sorell13
Posts: 6
Joined: Fri Dec 18, 2009 8:07 pm

PWM count

Post by sorell13 »

Does anybody know how to count the PWM pulses generated by the ccp module (in Flowcode 4.2) ? I want for example to generate 100 pulses from a certain frequency.
Thank you,
Sorin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PWM count

Post by Benj »

Hello Sorin,

You should be able to use a delay to do this. eg a count of 100 with a PWM running at 100 hz would take 1 second, at 1000hz would take 100ms etc.

sorell13
Posts: 6
Joined: Fri Dec 18, 2009 8:07 pm

Re: PWM count

Post by sorell13 »

Indeed is a great idea. I turn on pwm then I put a desired delay and then I disable pwm and so I will have a defined number of pulses. Thank you very much Benj!
Best regards,
Sorin

Post Reply