Jump to content

MOS Technology CIA

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Crotalus horridus (talk | contribs) at 08:00, 13 December 2005 (→‎Interval timers). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

The 6526 Complex Interface Adapter (CIA) was an integrated circuit made by MOS Technology. It served as a 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. The circuit's most prominent use was in the Commodore 64 and Commodore 128 home computers, each of which included two CIA chips.

Parallel I/O

The CIA had two 8-bit bidirectional parallel I/O ports. Each port had a corresponding Data Direction Register, which allowed each data line to be individually set to input or output mode.

Serial I/O

An internal bidirectional 8-bit shift register enables the CIA to handle serial I/O. The chip can accept serial input clocked from an external source, and can send serial output clocked with one of the built-in programmable timers. An IRQ is generated whenever an 8-bit serial transfer has completed.

Handshaking

Two dedicated control lines (/FLAG and /PC) were implemented to allow coordination between multiple CIA chips.

Interval timers

Two programmable interval timers were available. Each timer consisted of a 16-bit read-only presettable down counter and a corresponding 16-bit write-only latch. Whenever a timer was started, the timer's latch was automatically copied into its counter, and the counter would then decrement with each clock cycle until underflow, at which an IRQ would be generated. The timer could run in either "one-shot" mode, halting after the first IRQ, or "continuous" mode, reloading the latch value again and starting the timer cycle anew. In addition to generating IRQs, the timer output could also be gated to the second I/O port.

Time-of-Day (TOD) Clock

A real-time clock was incorporated in the CIA. It was accurate to a tenth of a second, and could be driven by either a 50 Hz or 60 Hz external signal, selected by a user-programmable register. This was to ensure compatibility with both NTSC and PAL systems. The clock operated in binary-coded decimal. Latching and halting behavior was implemented to prevent errors when reading or writing the clock. An "alarm" feature was also included, which allowed an IRQ to be generated whenever a certain time of day was reached.

Versions

The CIA was available in 1 MHz (6526) and 2 MHz (6526A) versions. The form factor was a JEDEC-standard 40-pin ceramic or plastic DIP.