Page 182 - Programming Microcontrollers in C
P. 182

Timers    167

                          offered in some microcontrollers is the  computer operating prop­
                          erly (COP) timer. Each of the systems will be examined in some
                          detail in the following paragraphs.


            Multifunction Timer—15-Bit Timer
                              A timer of this nature can be found on the smallest of the
                          M68HC05 components, such as the M68HC05J1 or the M68HC05P8,
                          and it is not found on the M68HC05Bx devices discussed previously.
                          This timer consists of an 8-bit ripple counter followed by an addi­
                          tional 7-bit counter. This counter chain is driven by a signal that is at
                          one-fourth the internal clock frequency of the microcontroller. The
                          internal clock frequency in turn is half the crystal frequency. This
                          portion of the counter is completely uncontrolled. The program can,
                          however, read the value of this counter at any time. A block diagram
                          of this type of timer is shown in Figure 4-1.
                                                                                  Internal
                                                                                  Processor
                                                                                   Clock
                                                                                  (XTAL ÷2)
                       Least Significant Eight Bits of 15 Stage Ripple Counter
                                                                                   Fixed
                          ÷2     ÷2    ÷2     ÷2     ÷2    ÷2     ÷2    ÷2        Divide By
                                                                                    4
                     MSB                                                LSB
                                                                           $0009
                                          Timer Count Register
                                                                           TCR


                                                                           $0008
                        TOF    RTIF   TOFE   RTIE   0     0     RT1   RT0
                                                                           TCSR
                                            RTI Rate Select


                                         ÷2     ÷2    ÷2     ÷2    ÷2     ÷2    ÷2

                                     Most Significant Seven Bits of 15 Stage Ripple Counter



                                 ÷2    ÷2     ÷2     S
                                                         Q      COP Timeout-Generate
                                                                Internal MCU Reset
                     Service (Clear)                 R
                     COP Watchdog

                              Figure 4-1 15-bit Timer Block Diagram
   177   178   179   180   181   182   183   184   185   186   187