December 2015
Beginner to intermediate
650 pages
18h 28m
English
This chapter describes the PIC32’s output compare peripheral, which is used to generate pulse-width modulation (PWM) pulse trains. A PWM pulse train, when used with an H-bridge, can control the speed and direction of a motor. A PWM signal can also be used to control the brightness of an LED or low-pass filtered to generate an analog output. The special function registers controlling the output compare peripheral are explained and sample code is given.
Keywords
Output compare
Pulse-width modulation (PWM)
Analog output
Duty cycle
RC filter
Low-pass filter
The output compare (OC) peripheral sets the state of an output pin based on the value of a timer. Output compare can be used to generate a single pulse of ...
Read now
Unlock full access