Книга: Advanced PIC Microcontroller Projects in C

1.3.3 Timers

1.3.3 Timers

Timers are important parts of any microcontroller. A timer is basically a counter which is driven from either an external clock pulse or the microcontroller’s internal oscillator. A timer can be 8 bits or 16 bits wide. Data can be loaded into a timer under program control, and the timer can be stopped or started by program control. Most timers can be configured to generate an interrupt when they reach a certain count (usually when they overflow). The user program can use an interrupt to carry out accurate timing-related operations inside the microcontroller. Microcontrollers in the PIC18F series have at least three timers. For example, the PIC18F452 microcontroller has three built-in timers.

Some microcontrollers offer capture and compare facilities, where a timer value can be read when an external event occurs, or the timer value can be compared to a preset value, and an interrupt is generated when this value is reached. Most PIC18F microcontrollers have at least two capture and compare modules.

Оглавление книги


Генерация: 0.050. Запросов К БД/Cache: 0 / 0
поделиться
Вверх Вниз