led pwm cycle
could someone make me up a example for doing this pwm command using interrupt instead
PWM RB.0, 220, 1000
I know theirs some examples on the one pwm section but i just cant seem to get them to work
Thanks Again
Travis
PWM RB.0, 220, 1000
I know theirs some examples on the one pwm section but i just cant seem to get them to work
Thanks Again
Travis
Comments
You need a pwm timer (for any number of outputs); when this rolls over then you start the new PWM cycle. At the start you'll transfer the level for the pin(s) to the accumulator(s) for that(those) pins; the outputs are cleared at the same time. Then you increment the accumulator(s); when there is a rollover detected then the output is activated. In use, the larger the value of "level", the sooner the output will be activated within the cycle and the brighter the LED will be.
Keep in mind that when you're using an ISR, instructions like PAUSE, SEROUT, etc. (anything timing based) is affected.