Hi all,
I am using an 08M to asynchronously fade on and off 2 sets of 9 LED's based on the state of some input sensors. With 2 sets to fade I want to use the PWM command, not the PWMOUT command. It isn't working well - LEDs blink or flash or come on almost instantly. So, couple questions:
Does PWM operate in the background like PWMOUT or does the code pause for the number of cycles specified?
Is a period defined as a single 5-ms cycle or if I specify 3 cycles, does the period change to 15 ms or execute 3 periods?
The Manual2 document says it returns the pin to input when done. I have the pins connected to the gate of 2 Mosfets so I can drive multiple LEDs. If returned to an input seems like I could get some unwanted feedback. Should I force the pin back to an output?
The code I have takes about 15ms to run each cycle with the PWM commands at the end of each cycle. Should I restructure the code to
force more frequent PWM command executions?
I am running overclocked to 8MHz, how does this affect PWM?
Any other hints on how to get expected behavior out of PWM?
TIA
-- Dan
I am using an 08M to asynchronously fade on and off 2 sets of 9 LED's based on the state of some input sensors. With 2 sets to fade I want to use the PWM command, not the PWMOUT command. It isn't working well - LEDs blink or flash or come on almost instantly. So, couple questions:
Does PWM operate in the background like PWMOUT or does the code pause for the number of cycles specified?
Is a period defined as a single 5-ms cycle or if I specify 3 cycles, does the period change to 15 ms or execute 3 periods?
The Manual2 document says it returns the pin to input when done. I have the pins connected to the gate of 2 Mosfets so I can drive multiple LEDs. If returned to an input seems like I could get some unwanted feedback. Should I force the pin back to an output?
The code I have takes about 15ms to run each cycle with the PWM commands at the end of each cycle. Should I restructure the code to
force more frequent PWM command executions?
I am running overclocked to 8MHz, how does this affect PWM?
Any other hints on how to get expected behavior out of PWM?
TIA
-- Dan