Instruction manual

PC24E/25E
Page 21
0 1 1 1 0 1 1 0 = 76 hex.
This value has to be loaded to the control register whose address is Base Address + 0B.
Assuming that the board address is 0300, the BASIC statement
OUT &H030B, &H76
will load the control register with 76 hex.
The value of the count has now to be loaded to the counter. The address of Counter 1 is base
address + 09 which, in our example would be 0309. To load the value 50 decimal to this
counter the following BASIC statement is used
OUT &H0309, &H32 : OUT &H0309, &H00
It should be noted that both the low order and high order bytes have to be loaded even though
the high order byte, as in the above example, is zero.
Example 2 To read the current count on Counter 1 without affecting the counting
operation the counter has to be latched. To do this the control word 0 1 0 0 0 1 1 0 (46 hex) is
loaded to the control register by OUT &H030B, &H46.
The two bytes then have to be read from the latch using the command IN &H0309 to read the
low order byte followed by IN &H0309 to read the high order byte.
The two bytes MUST be read before attempting to execute another write instruction on the
same counter.