RETRODREAMSAMIGA & SPECTRUM
Menu

← All chips

gary.chip

DIP-48 · 5719 · drawing, not a photo

Amiga chipsCommodore (MOS / CSG)

1987

Gary

The Amiga 500's glue: it decides who owns each address and answers the processor on behalf of all of them.

Gary is the glue-logic chip of the A500, A2000 and CDTV. It reads the addresses the 68000 puts on the bus, selects the memory, the ROM, the CIAs or the custom chips, and gives the processor the answer it needs to close each cycle, even when there is nothing at the address. It replaced a handful of loose chips from the Amiga 1000.

What took twenty chips in the A1000

Gary means gate array: a matrix of logic gates etched to order. In the Amiga 1000 the logic linking the 68000 to the custom chips was spread over dozens of 74-series circuits and PALs. For the A500 and A2000, Commodore gathered it all into one 48-pin chip, and the specification describes it modestly: "miscellaneous control circuitry which provides interface and control for systems using the Amiga custom chip set and a 68000".

The chip has two numbers. The 5718 went into the A2000 and the 5719 into the A500 and A500+, both under part 318072-01. The earliest A2000s, of revision 4, carried a gate array made by Toshiba, with faults: Commodore's service bulletins said to replace it with the MOS version, which became the common one.

In the 32-bit A3000 and A4000 the job passed to Fat Gary, a PLCC that does the same work for a 68030 or 68040. And in the A600 and A1200, Gary was replaced by Gayle, which adds IDE and PCMCIA to it.

Who lives at each address

Gary's main job is to look at the 68000's seven highest address bits, A17 to A23, and decide who answers. The first 2 MB are Chip RAM; from $200000 to $9FFFFF is the space for Zorro II cards; at $BFxxxx sit the two CIAs; at $C00000 the trapdoor expansion memory, which only exists if the A501 card pulls its EXP pin low; higher up the real-time clock and the custom chip registers; and at the top the Kickstart ROM. The map below shows it.

There is one exception that lives only at start-up: while OVL is high, Gary answers with the ROM at the lowest addresses, so that the 68000 finds its reset vector there. It is CIA-A that drops OVL, and from then on address zero is RAM again.

For each address, Gary produces the right select signals: ROMEN for the ROM, RAMEN for the video memory, RGAE for the custom chip registers, VPA, which tells the 68000 it is talking to a 6800-type peripheral (the CIAs), and the read and write enables for the clock.

The 16 MB the chip decodes
$000000$800000$FFFFFF
  1. $000000Chip RAM2 MB
  2. $200000Zorro II expansion8 MB
  3. $A00000CIAs ($BFD000, $BFE001)2 MB
  4. $C00000Expansion memory ($C00000)512 KB
  5. $C80000No use in the chip1 MB
  6. $D80000Real-time clock256 KB
  7. $DC0000No use in the chip192 KB
  8. $DF0000Chip registers ($DFF000)64 KB
  9. $E00000Kickstart ROM512 KB
  10. $E80000No use in the chip1 MB
  11. $F80000Kickstart ROM512 KB

Stripes: ROM at the lowest addresses at start-up (OVL). 24-bit addresses; in the bar, the small blocks are widened so they can be seen. Source: Commodore, A500/A2000 Gary Specification.

The answer the 68000 waits for

The 68000 does not finish a memory cycle on its own: it waits for someone to pull DTACK low, the notice that the data is ready. If DTACK never comes, the processor stops for good. Gary generates it for every device on the board and also for the expansion space, even when nothing is there: so an access to an empty address returns garbage instead of hanging the machine.

Two inputs let the outside world change this. XRDY, pulled by an expansion card, delays DTACK and inserts wait states for slow devices. OVR switches off the internal decoding and DTACK altogether, so a card can take the place of a motherboard device, such as an external ROM, and answer for itself. The specification warns that the trick does not work for replacing Chip RAM or the chip registers: the timing is not reliable.

Gary also steps in when the custom chips are doing DMA. If the processor tries to reach the video bus while Agnus is using it, Gary holds DTACK and the 68000 waits its turn. And when the processor is in the $C00000 area, it asserts the signal that slows the Blitter down.

Amiga 500Amiga 500 · 1987
Photo: Bill Bertram · CC BY-SA 2.5 · Wikimedia Commons

And the floppy, the reset and the buffers too

Beyond addresses, Gary has a string of small jobs that fitted nowhere else. It controls the buffers between the processor bus and the video bus, the CDR, CDW and C4 signals that open the latches at the right moment of the C1 and C3 clocks. It receives the keyboard reset, and it is Gary that pulls the 68000's reset and halt lines.

And it handles a piece of the floppy drive: it latches the motor state when the drive is selected, and buffers the write and motor signals that go to the connector. That is why a drive that will not start its motor can have Gary to blame, and not only CIA-B.

The chip runs off the Agnus clocks: C1 and C3 at 3.58 MHz, 90 degrees apart, and CDAC at 7.14 MHz. It has no clock of its own and no registers: it is pure logic, so it is not programmed, only wired.

Did you know…

  1. Without Gary, a 68000 reaching an empty address would hang for ever waiting for DTACK. It is Gary that makes sure every address, even one with nothing behind it, answers.

  2. The first A2000s carried a Toshiba Gary with faults. Commodore had it replaced with the MOS one, and the specification itself admits one case where neither meets the timing.

  3. The EXP pin is how Gary knows there is memory in the trapdoor: the A501 card ties it to ground, and only then does Gary answer at address $C00000.

  4. It draws at most 25 mA. For a 48-pin chip that takes part in every bus cycle, that is next to nothing.

  5. Fat Gary is not a bigger Gary: it is a PLCC for the A3000 and A4000, with a 32-bit bus to decode, and two part numbers (4393 and 4791) for the same job.

Faults it is part of

Diagnostic guides from the board explorer that measure this chip's signals, board by board.

Where it's found

Sources

  1. [1]A500/A2000 Gary Specification · Commodore · arquivo de Dave Haynie (espelho devili.iki.fi)
  2. [2]Gary 5718/5719 e Fat Gary (números de peça, máquinas, nota sobre a Toshiba) · Big Book of Amiga Hardware
  3. [3]A500 Service Manual (PN-314981-04) · Commodore, 1990
  4. [4]Amiga custom chips · Wikipédia