Commodore VIC-20 Programmer's Reference Manual page 236

Hide thumbs Also See for VIC-20:
Table of Contents

Advertisement

used to store a 16-bit data word to load into the counter. Loading a
number into the latches does not affect the count in progress.
After it is set, the counter will begin decrementing at 1 MHz. When
the counter reaches zero, an interrupt flag will be setT and the IRQ
will go low. Depending on how the TIMER is set, either further
interrupts will be disabled, or it will automatically load the two
latches into (he counter and continue counting. The TIMER can
also be set to invert the output signal on a peripheral pin each time it
reaches zero and resets.
The TIMER locations work differently on reading and writing.
WRITING TO THE TIMER:
E: Write into the low order latch. This latch can be loaded into the
low byte of the 16-bit counter.
F: Write into the high order latch, write into the high order counter,
transfer low order latch into the low order counter, and reset the
Tl MER T1 interrupt flag. In other words, when this location is set the
counter is loaded.
G:
Same as E.
H:
Write into the high order latch and reset the TIMER T1
interrupt flag.
READ TIMER T1
I
E:
Read theTIMERTI low order counter and reset the TIMER
T1 interrupt ffag.
F:
Read the TIMER T1 high order counter,
G:
Read the TIMER T1 low order latch.
H:
Read the TIMER T1 high order latch.
TIMER T2
This TIMER operates as an interval timer (in one-shot mode), or
as a counter for counting negative pulses on PORT B pin 6. A bit in
the ACR selects which mode TIMER T2 is in.
WRITING TO TIMER T2
I:
Write TIMER T2 low order byte o1 latch.
J;
Write TIMER T2 high order counter byte, transfer low order
latch to low order counter, clear TIMER T2 interrupt flag.
READING TIMER T2
I:
Read TIMER T2 low order counter byte, and clear TIMER T2
.
interrupt 1lag.
220

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents