Product specifications

Programming the CTC
The Zilog CTC counter Timer Circuit handles all interrupts on the MTX including the
Video Display Processor (VDP) interrupt. The following is intended only as brief
outline concerning CTC operation. For more details refer to Zilog’s Z8430 CTC
Counter/Timer Circuit product specifications.
The CTC is capable of generating mode 2 interrupts from any of its 4 independently
programmable channels. It is capable of acting as either a timer or counter, working
on an external clock. The port numbers, CTC channel numbers and functions are as
follows:
Port Channel Function
Number
08 ch0 VDP interrupt line
09 ch1 4 MHz system clock /13
0A ch2 4 MHz system clock /13
0B ch3 cassette edge input
The first word to write out to the channel being programmed is the channel control
word this is made up as follows:
Bit Value Function
B7 1 Interrupt enabled
0 Disable interrupt
B6 1 counter mode
0 timer mode
B5 1 prescaler of 256 *
0 prescaler of 16
B4 1 trigger on rising edge
0 trigger on falling edge
B3 1 clk/trig pulse starts timer *
0 start on receiving time constant
B1 1 software reset
0 continued operation
B0 1 control word
0 vector word
Using Timer Mode Only
If bit 2 is set then the channel will consider the next byte it receives to be a time
constant. Setting bit 1 causes the channel to stop what it is doing and accept the next
set of parameters it will also require a new time constant.