Chapter 10 - v3.1 - Chapter 10 Programmable Timer Subsystem...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
110 Chapter 10 Programmable Timer Subsystem The timer section in the M68HC11 is based ona 16-bit counter operating from the system E- clock. It provides basic real time functions with the following features: Timer overflow to extend the 16-bit capability of the timer section counter. Output compare function that can generate a variety of waveforms by comparing the 16- bit timer counter with the contents of a programmable register. Input capture function that can latch the value of the 16-bit timer counter on selected edges of external control signals. Programmable and periodic interrupt generator, called the real time interrupt . Pulse accumulator to count external events or act as a gated timer counting internal clock pulses. Computer operating properly (COP) watchdog timer. The timer subsystem is the most complex subsystem in the M68HC11 and it involves many control registers and control bits. All timer functions have interrupt controls and separate interrupt vectors. Figure 10.1 illustrates the timer subsystem block diagram. Timer subsystem registers: Data registers TCNT Timer count register TIC1-TIC3 Timer input capture registers 1 to 3 TIC1-TIC5 Timer output compare registers 1 to 5 PACNT Pulse accumulator count register Control registers TCTL1 Timer control register 1 (output compare specifications) TCTL2 Timer control register 2 (input capture edge specifications) TMSK1 Main timer interrupt mask register 1 (output compare and input capture interrupt enable bits) TMSK2 Miscellaneous timer interrupt mask register 2 (other interrupt enable bits) PACTL Pulse accumulator control register OC1M Action mask register OC1D Action data register Status registers TFLG1 Main timer interrupt flag register 1 (output compare and input capture flags) TFLG2 Miscellaneous timer flag register 2 (other system flags) For the names and positions of various control and status bits see also Fig 11.1 in your reference book (Spasov).
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
111 Fig. 10.1 Main timer system block diagram Port A Pins If the timer function is not enabled Port A pins can be used as general input/output pins. Otherwise port A pins have certain other functionality related to the specified timer subsection operation. Basic Timer The key to the operation of the M68HC11 is the 16-bit, free running counter called the TCNT. It is input is the system E-clock, which may be prescaled (divided) by 1, 4, 8 or 16. Starting from $0000 at system reset, the counter counts forever and the programmer can read its
Background image of page 2
112 contents at any time. When it reaches $FFFF, it is reset to $0000 and the timer overflow flag (TOF in TFLG2) is set. This state can be detected either by polling or by an interrupt if timer overflow interrupt enable (TOI in TMSK2) bit is set. Clearing Timer Flag
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 15

Chapter 10 - v3.1 - Chapter 10 Programmable Timer Subsystem...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online