9-1
CHAPTER 9
TIMER/COUNTER UNIT
The Timer/Counter Unit can be used in many applications. Some of these applications include a
real-time clock, a square-wave generator and a digital one-shot. All of these can be implemented
in a system design. A real-time clock can be used to update time-dependent memory variables. A
square-wave generator can be used to provide a system clock tick for peripheral devices. (See
“Timer/Counter Unit Application Examples” on page 9-17 for code examples that configure the
Timer/Counter Unit for these applications.)
9.1 FUNCTIONAL OVERVIEW
The Timer/Counter Unit is composed of three independent 16-bit timers (see Figure 9-1). The op-
eration of these timers is independent of the CPU. The internal Timer/Counter Unit can be mod-
eled as a single counter element, time-multiplexed to three register banks. The register banks are
dual-ported between the counter element and the CPU. During a given bus cycle, the counter el-
ement and CPU can both access the register banks; these accesses are synchronized.
The Timer/Counter Unit is serviced over four clock periods, one timer during each clock, with an
idle clock at the end (see Figure 9-2). No connection exists between the counter element’s se-
quencing through timer register banks and the Bus Interface Unit’s sequencing through T-states.
Timer operation and bus interface operation are asynchronous. This time-multiplexed scheme re-
sults in a delay of 2½ to 6½ CLKOUT periods from timer input to timer output.
Each timer keeps its own running count and has a user-defined maximum count value. Timers 0
and 1 can use one maximum count value (single maximum count mode) or two alternating max-
imum count values (dual maximum count mode). Timer 2 can use only one maximum count val-
ue. The control register for each timer determines the counting mode to be used. When a timer is
serviced, its present count value is incremented and compared to the maximum count for that tim-
er. If these two values match, the count value resets to zero. The timers can be configured either
to stop after a single cycle or to run continuously.
Timers 0 and 1 are functionally identical. Figure 9-3 illustrates their operation. Each has a
latched, synchronized input pin and a single output pin. Each timer can be clocked internally or
externally. Internally, the timer can either increment at ¼ CLKOUT frequency or be prescaled by
Timer 2. A timer that is prescaled by Timer 2 increments when Timer 2 reaches its maximum
count value.
Содержание 80C186EA
Страница 1: ...80C186EA 80C188EA Microprocessor User s Manual...
Страница 2: ...80C186EA 80C188EA Microprocessor User s Manual 1995...
Страница 19: ......
Страница 20: ...1 Introduction...
Страница 21: ......
Страница 28: ...2 Overview of the 80C186 Family Architecture...
Страница 29: ......
Страница 79: ......
Страница 80: ...3 Bus Interface Unit...
Страница 81: ......
Страница 129: ......
Страница 130: ...4 Peripheral Control Block...
Страница 131: ......
Страница 139: ......
Страница 140: ...5 ClockGenerationand Power Management...
Страница 141: ......
Страница 165: ......
Страница 166: ...6 Chip Select Unit...
Страница 167: ......
Страница 190: ...7 Refresh Control Unit...
Страница 191: ......
Страница 205: ......
Страница 206: ...8 Interrupt Control Unit...
Страница 207: ......
Страница 239: ...INTERRUPT CONTROL UNIT 8 32...
Страница 240: ...9 Timer Counter Unit...
Страница 241: ......
Страница 265: ......
Страница 266: ...10 Direct Memory Access Unit...
Страница 267: ......
Страница 295: ...DIRECT MEMORY ACCESS UNIT 10 28...
Страница 296: ...11 Math Coprocessing...
Страница 297: ......
Страница 314: ...12 ONCE Mode...
Страница 315: ......
Страница 318: ...A 80C186 Instruction Set Additions and Extensions...
Страница 319: ......
Страница 330: ...B Input Synchronization...
Страница 331: ......
Страница 334: ...C Instruction Set Descriptions...
Страница 335: ......
Страница 383: ...INSTRUCTION SET DESCRIPTIONS C 48...
Страница 384: ...D Instruction Set Opcodes and Clock Cycles...
Страница 385: ......
Страница 408: ...Index...
Страница 409: ......