August 2008
Beginner to intermediate
304 pages
6h 2m
English
• Counter/timers
• Capture and Compare
• Timer interrupt
The PIC 16F877 has three hardware timers built in: Timer0 (originally called RTCC, the real-time counter clock), Timer1, and Timer2. The principal mode of operation of these registers are as counters for external events or timers using the internal clock. Additional registers are used to provide Capture, Compare, and Pulse Width Modulation (PWM) modes. The CCS timer function set is shown in Table 3.5
| Action | Description | Example |
|---|---|---|
| TIMERX SETUP | Set up the timer mode | setup_timer0(RTCC_INTERNAL|RTCC_DIV_8 ); |
| TIMERX READ | Read a timer register (8 or 16 bits) | count0=get_timer0(); |
| TIMERX WRITE | Preload a timer register (8 or 16 bits) | set_timer0(126); |
| CCPX SETUP ... |
Read now
Unlock full access