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.
Summary of Contents for 80C186XL
Page 1: ...80C186XL 80C188XL Microprocessor User s Manual...
Page 2: ...80C186XL 80C188XL Microprocessor User s Manual 1995...
Page 18: ...1 Introduction...
Page 19: ......
Page 27: ......
Page 28: ...2 Overview of the 80C186 Family Architecture...
Page 29: ......
Page 79: ......
Page 80: ...3 Bus Interface Unit...
Page 81: ......
Page 127: ......
Page 128: ...4 Peripheral Control Block...
Page 129: ......
Page 137: ......
Page 138: ...5 ClockGenerationand Power Management...
Page 139: ......
Page 154: ...6 Chip Select Unit...
Page 155: ......
Page 178: ...7 Refresh Control Unit...
Page 179: ......
Page 193: ......
Page 194: ...8 Interrupt Control Unit...
Page 195: ......
Page 227: ......
Page 228: ...9 Timer Counter Unit...
Page 229: ......
Page 253: ......
Page 254: ...10 Direct Memory Access Unit...
Page 255: ......
Page 283: ......
Page 284: ...11 Math Coprocessing...
Page 285: ......
Page 302: ...12 ONCE Mode...
Page 303: ......
Page 306: ...A 80C186 Instruction Set Additions and Extensions...
Page 307: ......
Page 318: ...B Input Synchronization...
Page 319: ......
Page 322: ...C Instruction Set Descriptions...
Page 323: ......
Page 371: ......
Page 372: ...D Instruction Set Opcodes and Clock Cycles...
Page 373: ......
Page 396: ...Index...
Page 397: ......