This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PWM | |
; Puls bredde modulation | |
BANKSEL TRISA ; Set bank | |
BSF TRISA,5 ; Disable the PWMx pin output driver(s) by setting the associated TRIS bit(s) | |
BANKSEL PWM5CON ; Set bank | |
BCF PWM5CON,PWM5POL ; Configure the PWM output polarity by configuring the PWMxPOL bit of the PWMxCON register. | |
; Load the PR2 register with the PWM period value | |
BANKSEL PR2 ; Set bank |