The CIA (Complex Interface Adapter) is a peripheral IC which is used in the C-64 for controlling the serial bus and the keyboard, among other things.
|2-9||PA0-PA7||progr.||Port A 0-7.|
|10-17||PB0-PB7||progr.||Port B 0-7. With the control registers A and B, bits 6 and 7 can be programmed to indicate an underflow of timer A and B.|
|18||/PC||out||Port control. Indicates availability of data on port B or both ports .|
|19||TOD||in||Time of day. A TTL signal carrying the mains frequency (derived from the 9VAC) of 50Hz (PAL) / 60Hz (NTSC) is applied here to trigger the realtime clock.|
|20||Vcc||-||Supply voltage (+5V DC).|
|21||/IRQ||out||Interrupt ReQuest. Becomes LOW when it matches a set bit in the interrupt control register on ocurrence of the corresponding event. In the C64, this line is connected to the CPU's /IRQ pin (CIA #1) or to the /NMI pin (CIA #2), respectively.|
|22||R/-W||in||Read/-Write. 0=read on data bus, 1=write on data bus.|
|23||/CS||in||Chip select. 0=coupled to data bus, 1=tri-state.|
|24||/FLAG||in||Flag input. See /PC (pin 18).|
|25||ø 2*||in||Phi 2. System clock signal. All data bus action takes place only when ø2=1.|
|34||/RES||in||Reset. 0=reset the CIA to initial state.|
|35-38||RS3-RS0||in||Register select. These four pins select one of the CIA's internal registers.|
|39||SP||in/out||Serial port. In/output of the shift register.|
|40||CNT||in/out(?)||Counter. In/(out??)put of shift register clock or trigger input for interval timer .|
In the 1570/71/81, the CIA is used to implement the fast serial bus.
Wolfgang Lorenz has detailled information in his article 'A Software Model of the CIA6526'. This article, a test suite for testing CIA compatibility of emulators, and other files belonging to it can be found on Funet.