MOS Technology CIA

The 6526/8520 Complex Interface Adapter (CIA) was an integrated circuit made by MOS Technology.

It served as an I/O port controller for the 6502 family of microprocessors, providing for parallel and serial I/O capabilities as well as timers and a Time-of-Day (TOD) clock.

Furthermore, the Amiga home computers and the Commodore 1581 floppy disk drive employed a modified variant of the CIA circuit called 8520.

It was possible to implement a simple "network" by connecting the shift register and clock outputs of several computers together.

The CIA was originally intended to allow fast communication with a disk drive, but in the end couldn't be used because of a desire to keep disk drive compatibility with the VIC-20; in practice the firmware of 1541 drive had to be made even slower than its VIC-20 predecessor to workaround a behaviour of the C64's video processor, that, when drawing the screen, turned off the CPU for 40 microseconds every 512 microseconds and in that timeslice can't listen to the bus, risking to miss some bit .

This meant that the timers decremented at approximately one microsecond intervals, the exact time period being determined by whether the system used the NTSC or PAL video standard.

In the C-128, clock stretching was employed so the CIA's timing was unaffected by whether the system was running in SLOW or FAST mode.

A real-time clock is incorporated in the CIA, providing a timekeeping device more conducive to human needs than the microsecond precision of the interval timers.

In addition to its timekeeping features, the TOD can be configured to act as an alarm clock, by arranging for it to generate an interrupt request at any desired time.

The TOD clock's internal circuitry is designed to be driven by either a 50 or 60 Hz sine wave signal.

It is important to note that contrary to the popular belief, NTSC or PAL video standards are not directly linked to mains power frequency.

For example, both NTSC and PAL variants of Commodore SX-64 use 60 Hz TOD clock supplied by a dedicated crystal.

The 8520 revision of the CIA, as used in the Amiga and the Commodore 1581 disk drive, modified the time-of-day clock to be a 24-bit binary counter, replacing the BCD format of the 6526.

Pin configuration of the 6526 CIA
Early 6526 CIA were still in costly ceramic package with gold contacts. Later versions were produced in cheaper plastic package.
CIA MOS 6526A in plastic package
MOS 8520A in an Amiga 1000