Author | Stef Mientki, Copyright (C) 2002-2006, all rights reserved. |
Adapted-by | Sebastien Lelong |
Compiler | >=2.4g |
performs PWM operations on CCP5 The target must support this.
this is a heavy refactoring of the original pwm_hardware.jal Stef's lib
pwm5_set_dutycycle_highres(word in duty)
pwm5_set_dutycycle(byte in duty)
pwm5_on()
pwm5_off()
pwm5_set_percent_dutycycle(byte in percent)
var byte ccp5con_shadow
No documentation found
var byte ccpr5l_shadow
No documentation found
pwm5_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: * duty5h<0:1> are the 2 LSbits * duty5h<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
pwm5_set_dutycycle(byte in duty)
Sets dutycyle in low resolution mode. The 2 LSbits take their value from ccp5con_shadow, by default 0 This means if duty5 = 0, there's no pwm, if duty5 = 255, you're closed to (but not at) the maximum pwm
pwm5_on()
No documentation found
pwm5_off()
No documentation found
pwm5_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.