From CPCWiki - THE Amstrad CPC encyclopedia!
Revision as of 08:46, 9 July 2014 by SyX (Talk | contribs)

Jump to: navigation, search


Thank you very much for supporting our product!

By choosing the PlayCity board, you have acquired a high-quality product which will set new standard features for Amstrad and Schneider CPC 464/664/6128 range of computers.

Its most important features are:

  • Raster programmable interrupts with CURSOR and NMI support
  • Six stereo audio channels with programmable frequency
  • General purpose counters and timers

Hardware Installation

  • Power OFF your Amstrad / Schneider CPC.
  • Attach the PlayCity board to one free MotherX4 slog.
  • Turn ON your computer, and enjoy! (if a grey screen appear, turn off your computer and check the connexions)

Peripheral Soft Reset

All expansion peripherals should be reset when an output is performed to I/O port $F8FF.

Used by the standard BIOS functions MC_BOOT_PROGRAM and MC_START_PROGRAM (vector BD13h and BD16h), in particular a peripheral that generates interrupts.

The PlayCity board use this feature to be sure that the CTC and YMZs circuits are properly reseted before using them.

Counter/Timer Circuit


The Z84C30 has four independently programmable counter/timer channels witch interface directly with the Z80 CPU. The first thing to consider is how those channels are linked to the CTC-AY board.

Channel 0 ($F880)

The channel 0 is exclusively used to generate the frequency of the two embedded soundchips (YMZ294). The input for the trigger (TRG0) is the 4 MHz system clock of the CPC. The output signal (ZC/TO0) is sent to the clock pins of the soundchips.

Channel 1 ($F881)

The channel 1 is typically used to generate raster interrupts. The input (TRG1) is linked to the CRTC CURSOR signal. The output (ZC/TO1) is connected to the NMI pin of the Z80. Used as a counter, it's synchronized with the CRTC CURSOR signal, generating a smooth high priority rasters interrupt. Used as a timer (prescaler set to 256), it's 15.625 kHz signal is scanline-synchronized. That means the time constant is the number of scanlines to wait before to send an NMI.

Channel 2/3 ($F882/$F883)

The channels 2 and 3 are dedicated to general purpose usages. Yes, it's for you! The input for the trigger (TRG2) is the 4 MHz system clock. The output (ZC/TO0) is linked to the trigger for the channel 3 (TRG3). They can be used as 2x 8-bit or 1x 16-bit counter/timer. They generate normal interrupts and allow to use the Z80 vector interrupt (mode 2) too.

Coding examples

Each channel is programmed with two bytes; a third is necessary when interrupts are enabled. Once started, the CTC countdown automaticaly reloads its time constant and resume counting. Interrupt processing is simplified because only one vector need to be specified; the CTC internally generates an unique vector for each channel. Before programming the CTC channels, you need to set the lower byte for the vectorized interrupts. Vector interrupts