Shop OBEX P1 Docs P2 Docs Learn Events
PWM Question — Parallax Forums

PWM Question

FaubFaub Posts: 6
edited 2010-07-19 18:39 in Propeller 1
Hi, I am just getting into propeller / microcontroller programming and have a question. I have worked my way through the PE kit tutorials and have a question about using the counter modules to generate a pwm signal.

What I am interested in doing is generating a pwm at 2000 Hz and adjusting the duty cycle. The examples given allowed me to vary the duty cycle but not the frequency. I think it should be fairly easy to utilize the counter to set the frequency and duty, but there must be something I am missing from the PE manual and the Propeller manual counters section. Anything to help point me in the right direction would be most helpful. I did look at the H bridge example but had a difficult time understanding the code in the DAT Block.

All I am really looking for is doing something like LedDutySweep.spin but set the frequency to 2000 hz or adjustable at run time.

Any help would be greatly appreciated.

Comments

Sign In or Register to comment.