Datasheet

ACPI Devices
Intel
®
Atom™ Processor E6xx Series Datasheet
205
3. Load the least and/or most significant bytes (as required by Control Word bits 5, 4)
of the 16- bit counter.
4. Repeat with other counters
Only two conventions need to be observed when programming the counters. First, for
each counter, the control word must be written before the initial count is written.
Second, the initial count must follow the count format specified in the control word
(least significant byte only, most significant byte only, or least significant byte and then
most significant byte).
A new initial count may be written to a counter at any time without affecting the
counter’s programmed mode. Counting will be affected as described in the mode
definitions. The new count must follow the programmed count format.
If a counter is programmed to read/write two-byte counts, the following precaution
applies: A program must not transfer control between writing the first and second byte
to another routine which also writes into that same counter. Otherwise, the counter will
be loaded with an incorrect count.
The Control Word Register at port 43h controls the operation of all three counters.
Several commands are available:
Control Word Command: Specifies which counter to read or write, the operating
mode, and the count format (binary or BCD).
Counter Latch Command: Latches the current count so that it can be read by the
system. The countdown process continues.
Read Back Command: Reads the count value, programmed mode, the current
state of the OUT pins, and the state of the Null Count Flag of the selected counter.
11.1.7 Reading from the Interval Timer
It is often desirable to read the value of a counter without disturbing the count in
progress. There are three methods for reading the counters: a simple read operation,
counter Latch Command, and the Read-Back Command. Each is explained below.
With the simple read and counter latch command methods, the count must be read
according to the programmed format; specifically, if the counter is programmed for two
byte counts, two bytes must be read. The two bytes do not have to be read one right
after the other. Read, write, or programming operations for other counters may be
inserted between them.
11.1.7.1 Simple Read
The first method is to perform a simple read operation. The counter is selected through
port 40h (counter 0), 41h (counter 1), or 42h (counter 2).
Note, performing a direct read from the counter will not return a determinate value,
because the counting process is asynchronous to read operations. However, in the case
of counter 2, the count can be stopped by writing to NSC.TC2E.
11.1.7.2 Counter Latch Command
The Counter Latch Command, written to port 43h, latches the count of a specific
counter at the time the command is received. This command is used to ensure that the
count read from the counter is accurate, particularly when reading a two-byte count.
The count value is then read from each counter’s Count Register as was programmed
by the Control Register.