Skip to content

Instantly share code, notes, and snippets.

View mathiasbejlegaard's full-sized avatar

Mathias Bejlegaard Madsen mathiasbejlegaard

  • Cubris - A Thales Company
  • Copenhagen
View GitHub Profile
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