Книга: 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.
- 1.3.1 Supply Voltage
- 1.3.2 The Clock
- 1.3.3 Timers
- 1.3.4 Watchdog
- 1.3.5 Reset Input
- 1.3.6 Interrupts
- 1.3.7 Brown-out Detector
- 1.3.8 Analog-to-Digital Converter
- 1.3.9 Serial Input-Output
- 1.3.10 EEPROM Data Memory
- 1.3.11 LCD Drivers
- 1.3.12 Analog Comparator
- 1.3.13 Real-time Clock
- 1.3.14 Sleep Mode
- 1.3.15 Power-on Reset
- 1.3.16 Low-Power Operation
- 1.3.17 Current Sink/Source Capability
- 1.3.18 USB Interface
- 1.3.19 Motor Control Interface
- 1.3.20 CAN Interface
- 1.3.21 Ethernet Interface
- 1.3.22 ZigBee Interface