Once you turn on HPWM, can you turn it off?
Example: (Melanie's LCD Contast?Backlight tips)
Once you turn on HPWM, can you turn it off?
Example: (Melanie's LCD Contast?Backlight tips)
It may differ from PIC to PIC so check the data sheet, but taking the 18F1320 as an example, the following would turn off HPWM:
CCP1CON=0
"I think fish is nice, but then I think that rain is wet, so who am I to judge?" - Douglas Adams
Depends on what you consider "off". If you set the duty cycle to 0% and leave it there your output pin will be '0' (low). If you set the duty cycle to 100% and leave it there your output pin will be a '1' (high). You might also put the CCP1 pin into the hi-z input state.
Regards, Mike
Hi,
The one and only question is :
1) do you want to stop the PWM output ( set it to 0% )
2) or turn HPWM Module really off ... which is not compulsory, but some kind of " double security ".![]()
you then can use Timer2 for other purposes ...
Alain
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Thanks for the replies:
I wondered about turning off the HPWM in software, i.e. save battery, use Timer2 for other purposes, etc.
I was thinking about using the HPWM to drive an LCD backlight. I wanted to turn on the backlight ,i.e. start HPWM, with a button push and somehow turn it back off again when no longer needed.
Charlie
Bookmarks