Chapter 19

Advanced Timing

Abstract

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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.