SC514 is a Z80 CTC card designed for Z50Bus.
The Z80 Counter/Timer Channels (CTC) integrated circuit has four independently programmable counter/timer channels. Each channel can generate a unique mode 2 interrupt.
Each channel’s input and output can be connected in a variety of ways with jumpers. This includes using the Z50Bus USR pins as either input single sources or output signal destinations. It is also possible to cascade channels to create up to a 32-bit counter timer.
The board includes flexible I/O address decoding allowing the CTC’s base address to be on any 4-byte boundary.
The card includes an oscillator making the card’s functionality independent of the main bus clock frequency, thus allowing compatibility of software across different processor speeds.
Address select jumpers
The card responds to input/output addresses matching the address set with jumpers. When a jumper shunt is fitted, that bit must be a 1 (high voltage). When the shunt is not fitted, that bit must be a 0 (low voltage).
Header JP1 is the 8 address select jumpers that are labelled with their bit numbers. The card occupies 4 addresses, thus address bits 0 and 1 are not included in the address decoding. The board includes placeholders for bits 0 and 1 for consistency with other cards in the SC500 series. It is suggested that you remove or cut the pins for bits 0 and 1 as a reminder that they are not used.
The recommended base address is currently 60 hex (01100000 binary) when used as part of an SC500 system. This address is selected by fitting jumper shunts for bits 6 and 5. A CTC at this address is not used by any current system software, such as for the system timer or baud rate clock generator.
It is possible to use this card as a system timer by setting the base address to 0x88. Current system software assumes a CTC at this address uses channels 0 and 1 for baud rate clock generators and channels 2 and 3 for the system timer.
Each of the four channels has a set of jumpers to select the input source. The available input sources are shown below. Fit a single jumper shunt to one of the positions of each of the sets of jumper header pins labelled “CTC channel # input” (JP2, 4, 6, and 8) to select the required input signal. Alternatively, connect a signal to the required input on connector P2.
INT = Z50Bus interrupt request signal
OUT0 = CTC channel 0’s output
OUT1 = CTC channel 1’s output
OUT2 = CTC channel 2’s output
CLK = Z50Bus clock signal
CLKX = SC514’s on-board oscillator (typically 1.8432 MHz)
USR0 = Z50Bus user 0 signal
USR1 = Z50Bus user 0 signal
USR2 = Z50Bus user 0 signal
USR3 = Z50Bus user 0 signal
Each channel is 8-bit but the channels can be cascaded by fitting jumper shunts to connect the output of one channel to the input of the next. This allows 16-bit, 24-bit and 32-bit counter/timers to be created.
The outputs of the first three channels can optionally be connected to any of the four USR pins on the Z50Bus. This is achieved by fitting a jumper shunt to the header pins labelled “CTC # output” (JP3, 5, and 7).
Each of the Z50Bus USR signals has an optional 10k pull-up resistor. The pull-up resistors are connected by fitting jumper shunts to the jumper header pins labelled “USR pull-ups” (JP9).
Interrupt Mode 2 Converter
One application of this card is to generate Z80 mode 2 interrupts for non-Z80 family devices.
It is desirable to use Z80 mode 2 interrupts but this causes a problem when using devices that can not generate the necessary signals. One solution is to use a Z80 CTC to generate a mode 2 interrupt for such devices. By connecting the interrupt output of the non-Z80 family device to the input of a CTC, it is possible to program the CTC to generate an interrupt when the input signal changes state.
The signal from the non-Z80 family device to the CTC could be connected with a flying lead to connector P2. Alternatively, it could be connected through one of the Z50Bus USR signals.
Example – SC514 CTC timer demo v1.0 (ZIP)
This program has been written for the Small Computer Monitor (SCM) running on a system with an SC514 (Z80 CTC card for Z50Bus) set to address 0x60.
This code demonstrates how to generate a periodic mode 2 interrupt using a Z80 CTC.
CTC channel 0 is set to divide the onboard oscillator’s frequency by 256. The onboard oscillator is assumed to be 1.8432 MHz (CLKX) giving a 7200 Hz output from channel 0. ie. 1843200 / 256 = 7200.
CTC channel 1 is set to generate an interrupt every 10 ms (100 Hz). Channel 1’s input is connected to channel 0’s output, thus its input is 7200 Hz. By dividing by 72 the output of channel 1 is 100 Hz.
CTC channel 2 counts the output pulses from channel 1, thus it counts the number of 10 ms events. Note, the counter counts down, not up. Channel 2’s input is connected to channel 1’s output. This is totally optional to the interrupts generated by channel 1.
Channel 1 generates a 10 ms (100 Hz) period mode 2 interrupt.
The required jumper positions for this example are shown below.