The 6522 Versatile Interface Adapter (VIA) is an integrated circuit that was designed and manufactured by MOS Technology as an I/O port controller for the 6502 family of microprocessors. It provides two bidirectional 8-bit parallel I/O ports, two 16-bit timers (one of which can also operate as an event counter), and an 8-bit shift register for serial communications or data conversion between serial and parallel forms. The direction of each bit of the two I/O ports can be individually programmed. In addition to being manufactured by MOS Technology, the 6522 was second sourced by other companies including Rockwell and Synertek. The 6522 was widely used in computers of the 1980s, particularly Commodore's machines, and was also a central part of the designs of the Apple III, Oric-1 and Oric Atmos, BBC Micro, Victor 9000/Sirius 1 and Apple Macintosh. Video game platforms such as the Vectrex also used the 6522, as did the 1984 through 1989 Corvette digital dash cluster. A high speed, CMOS version, the W65C22, is produced by the Western Design Center (WDC). Input/output ports The VIA contains 20 I/O lines, which are organised into two 8-bit bidirectional ports (or 16 general-purpose I/O lines) and four control lines (for handshaking and interrupt generation). The directions for all 16 general lines (PA0-7, PB0-7) can be programmed independently. The control lines can be programmed to generate an interrupt when activated (all four), latch the corresponding I/O port (CA1 and CB1), automatically generate handshaking signals for devices on the I/O ports, or operate as plain program-controlled outputs (CA2 and CB2). CB1 and CB2 are also used as the clock input and the data line for the shift register, precluding their use for other functions while the shift register is enabled. Timers The VIA provides two 16-bit timer/counters. Each can be used in one-shot (monostable) "interval timer" mode; timer 1 can also be used in "free-running" (divider/square wave) mode, in which the timer is automatically reloaded with the initial count when it reaches zero, and timer 2 can also be used in "pulse counting" mode, in which the timer will count the high-to-low state transitions of pin PB6 (the 7th bit of parallel I/O port B). In the one-shot mode, each timer continues free-running so that the time since zero was reached can be determined, but no further interrupt is issued until the timer is restarted. Each timer can generate an interrupt when