Skip to content

Instantly share code, notes, and snippets.

View zlepper's full-sized avatar

Rasmus Hansen zlepper

View GitHub Profile
PWM
; Pulse width 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