PDA

View Full Version : 16f628a Hpwm-stop??



Caddydan
- 13th April 2006, 06:56
I am using the 16f628a as a lamp dimmer for my mountain bike light. I can change the duty cycle of the hpwm but can't get the pin to just stop without setting the on time to 0-HPWM just runs and runs and.... Any ideas??
Thanx Dan

Acetronics2
- 13th April 2006, 09:43
Hi,

just have a ZERO for PWM value ...

CCP1CON = 0 Disables the PWM unit ... think to re-Enable it somewhere.

Alain

mister_e
- 13th April 2006, 12:54
AND it's probably safe to set the pin low after that... Maybe.

Caddydan
- 14th April 2006, 06:44
I know setting on time to zero turns things off but I wanted to use the same pin for flashing the light and hpwm does not run slow enough. CCP1CON = 0
worked great.
Thanx for helping us newbies out.
Dan

mister_e
- 14th April 2006, 17:28
This is why forums exist dude!

Good luck!

PS: keep it for you... i learn almost everything here by reading other posts and solutions, datasheet, do experiments and, when possible, helping others. Don't give up.. oh no, don't give up.