Chapter 19

Advanced Timing


This chapter describes the peripherals associated with timers on most PIC® microcontrollers.

Pulse width modulation (PWM) is fully explained, with diagrams and C code examples. The capture peripheral found on most PIC® processors allows a timer value to be captured in response to an external event. The compare peripheral also on most PIC® processors triggers an event when the timer reaches a specific value. Both capture and compare are fully described with C examples.

The differences between the 24 bit opcode PIC® processors, and the other processors as it applies to the timer peripherals, are also explained.

Examples and exercises are for the popular PIC® microcontroller manufactured by Microchip.

Get Embedded C Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.