Skip to Content
Embedded C Programming
book

Embedded C Programming

by Mark Siegesmund
September 2014
Beginner to intermediate
424 pages
10h 4m
English
Newnes
Content preview from Embedded C Programming
Chapter 18

Timers/Counters

Abstract

The chapter covers in detail the counter and timer peripherals found on most microcontrollers. Diagrams of the peripheral with all the possible options such as gates, multiplexers, pre-scalers, and post-scalers are shown and explained.

Many C examples are included, with the math used to calculate various characteristics. This chapter also shows how timers and counters are integrated with interrupt processing. The concept of a virtual timer created with software is also included.

This chapter includes a detailed example of using a timer and interrupt to control a relay on the zero-crossing of an AC source.

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

Keywords ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical C Programming

Practical C Programming

B. M. Harwani

Publisher Resources

ISBN: 9780128013144