4. Using the I/O Address Map
24
CNT16-8(FIT)GY,
CNT16-8L(FIT)GY
Description of Input Commands
Reading a Count (command 00h - 07h)
By reading the contents of the READ register for a corresponding channel, this command reads a count
value. By issuing the command to the output port +16 and reading the input port +17 two times, you can
read low, middle, and high count values.
In the initial state, the contents of the READ register are undefined.
Following are programs that read a count value from CH0:
Microsoft C
Microsoft QBASIC
outp( ADR+16, 0x0 );
OUT ADR+16, &H0
LowerData = inp( ADR+17 );
LowerData = INP( ADR+17 )
UpperData = inp( ADR+17 ); UpperData = INP( ADR+17 )
In this case, the count value latch for CH0 must be pre-set to [1].
Interrupt mask (command 11h)
Command D7 D6 D5 D4 D3 D2 D1 D0
Function
Data
length
11h CH7
CH6
CH5
CH4
CH3
CH2
CH1
CH0
Interrupt
masuk
8-bit
This command allows you to monitor the status of the current interrupt mask that was set using the
interrupt mask command. CH7 - CH0 are associated with channels. When these bits are [1], the interrupt
is masked, and no interrupt signals are output.
You can monitor the masking status by issuing the value 15h to the output port +16 and by reading the
input port +17.
0: Not masked
1: Masked
CAUTION
Initial
state:
FFH