Author | Stef Mientki, Copyright (C) 2002-2006, all rights reserved. |
Adapted-by | Sebastien Lelong |
Compiler | >=2.4g |
performs PWM operations on CCP2 The target must support this.
this is a heavy refactoring of the original pwm_hardware.jal Stef's lib
pwm2_set_percent_dutycycle(byte in percent)
pwm2_on()
pwm2_off()
pwm2_set_dutycycle(byte in duty)
pwm2_set_dutycycle_highres(word in duty)
var byte ccpr2l_shadow = 0
No documentation found
var byte ccp2con_shadow = 0
No documentation found
pwm2_set_percent_dutycycle(byte in percent)
This procedure set duty cycle using a percentage According to what has been computed by pwm_set_frequency(), it converts the duty percent to a value suitable for the selected pwm frequency.
pwm2_on()
No documentation found
pwm2_off()
No documentation found
pwm2_set_dutycycle(byte in duty)
Sets dutycyle in low resolution mode. The 2 LSbits take their value from ccp2con_shadow, by default 0 This means if duty2 = 0, there's no pwm, if duty2 = 255, you're closed to (but not at) the maximum pwm
pwm2_set_dutycycle_highres(word in duty)
sets dutycyle in high resolution mode the word passed to the procedure represents the high resolution value of the duty cycle: * duty2h<0:1> are the 2 LSbits * duty2h<2:9> are the 8 MSbits Because duty cycle is coded on 10 bits, the given value can't greater than 1024 If not active yet, calling this procedure will enable PWM