MOS Technology 6522
   HOME

TheInfoList



OR:

The 6522 Versatile Interface Adapter (VIA) is an
integrated circuit An integrated circuit or monolithic integrated circuit (also referred to as an IC, a chip, or a microchip) is a set of electronic circuits on one small flat piece (or "chip") of semiconductor material, usually silicon. Large numbers of tiny ...
that was designed and manufactured by
MOS Technology MOS Technology, Inc. ("MOS" being short for Metal Oxide Semiconductor), later known as CSG (Commodore Semiconductor Group) and GMT Microelectronics, was a semiconductor design and fabrication company based in Audubon, Pennsylvania. It is mo ...
as an
I/O port Memory-mapped I/O (MMIO) and port-mapped I/O (PMIO) are two complementary methods of performing input/output (I/O) between the central processing unit (CPU) and peripheral devices in a computer. An alternative approach is using dedicated I/O pro ...
controller for the
6502 The MOS Technology 6502 (typically pronounced "sixty-five-oh-two" or "six-five-oh-two") William Mensch and the moderator both pronounce the 6502 microprocessor as ''"sixty-five-oh-two"''. is an 8-bit microprocessor that was designed by a small te ...
family of microprocessors. It provides two bidirectional 8-bit parallel I/O ports, two 16-bit
timer A timer is a specialized type of clock used for measuring specific time intervals. Timers can be categorized into two main types. The word "timer" is usually reserved for devices that counts down from a specified time interval, while devices th ...
s (one of which can also operate as an event counter), and an 8-bit
shift register A shift register is a type of digital circuit using a cascade of flip-flops where the output of one flip-flop is connected to the input of the next. They share a single clock signal, which causes the data stored in the system to shift from one loc ...
for
serial communication In telecommunication and data transmission, serial communication is the process of sending data one bit at a time, sequentially, over a communication channel or computer bus. This is in contrast to parallel communication, where several bits are ...
s 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 source In the electronics industry, a second source is a company that is licensed to manufacture and sell components originally designed by another company (the first source). It is common for engineers and purchasers to avoid components that are only av ...
d by other companies including Rockwell and
Synertek Synertek, Inc. was an American semiconductor manufacturer founded in 1973. The initial staff consisted of Bob Schreiner (the CEO), Dan Floyd, Jack Balletto, and Gunnar Wetlesen and Zvi Grinfas. Schreiner, Floyd, Balletto and Wetlesen were all forme ...
. The 6522 was widely used in computers of the 1980s, particularly
Commodore Commodore may refer to: Ranks * Commodore (rank), a naval rank ** Commodore (Royal Navy), in the United Kingdom ** Commodore (United States) ** Commodore (Canada) ** Commodore (Finland) ** Commodore (Germany) or ''Kommodore'' * Air commodore, a ...
's machines, and was also a central part of the designs of the
Apple III The Apple III (styled as apple ///) is a business-oriented personal computer produced by Apple Computer and released in 1980. Running the Apple SOS operating system, it was intended as the successor to the Apple II series, but was largely consi ...
,
Oric-1 Oric was the name used by UK-based Tangerine Computer Systems for a series of 6502-based home computers sold in the 1980s, primarily in Europe. With the success of the ZX Spectrum from Sinclair Research, Tangerine's backers suggested a hom ...
and
Oric Atmos Oric was the name used by UK-based Tangerine Computer Systems for a series of 6502-based home computers sold in the 1980s, primarily in Europe. With the success of the ZX Spectrum from Sinclair Research, Tangerine's backers suggested a hom ...
,
BBC Micro The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by Acorn Computers in the 1980s for the BBC Computer Literacy Project. Designed with an emphas ...
, Victor 9000/Sirius 1 and
Apple Macintosh The Mac (known as Macintosh until 1999) is a family of personal computers designed and marketed by Apple Inc. Macs are known for their ease of use and minimalist designs, and are popular among students, creative professionals, and software en ...
. Video game platforms such as the
Vectrex The Vectrex is a vector display-based home video game console–the only one ever designed and released for the home market, developed by Smith Engineering. It was first released for the North America market in November 1982 and then Europe and ...
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 The Western Design Center (WDC), located in Mesa, Arizona, is a company which develops intellectual property for, and licenses manufacture of, MOS Technology 65xx based microprocessors, microcontrollers (µCs), and related support devices. W ...
(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 A handshake is a globally widespread, brief greeting or parting tradition in which two people grasp one of each other's like hands, in most cases accompanied by a brief up-and-down movement of the grasped hands. Customs surrounding handshakes a ...
and
interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted, ...
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 A square wave is a non-sinusoidal periodic waveform in which the amplitude alternates at a steady frequency between fixed minimum and maximum values, with the same duration at minimum and maximum. In an ideal square wave, the transitions b ...
) 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 it reaches zero, and timer 1 can also output pulses (in the interval timer mode) or square waves (in the free-running mode) on pin PB7 (the 8th bit of port B). Timer 2 can be used to provide the clock frequency for the shift register. A useful feature of the free-running mode is that the 16-bit counter latch can be loaded with a new count without reloading the counter, so that it will load the new count only after the current count reaches zero, seamlessly changing the output frequency. This feature of timer 1, combined with its ability to output to pin PB7, can be used to generate complex waveforms, for example
pulse-width modulation Pulse-width modulation (PWM), or pulse-duration modulation (PDM), is a method of reducing the average power delivered by an electrical signal, by effectively chopping it up into discrete parts. The average value of voltage (and current) fed ...
signals, frequency sweeps, or bi-phase or FM-encoded serial bit streams.


Shift register

The VIA's shift register is bidirectional, 8 bits wide, and can run from either a timer-generated clock (from timer 2), the CPU clock, or an external source on line CB1. The serial input/output is on line , and can also be programmed to output a bit clock for external clocked serial devices.


IRQ output

The NMOS 6522 has an
open drain An open collector is a common type of output found on many integrated circuits (IC), which behaves like a switch that is either connected to ground or disconnected. Instead of outputting a signal of a specific voltage or current, the output sig ...
IRQ output that may be used in
wired-OR A wired logic connection is a logic gate that implements boolean algebra (logic) using only passive components such as diodes and resistors. A wired logic connection can create an AND or an OR gate. The limitations are the inability to create a ...
interrupt circuits. The WDC W65C22S, in contrast, has a
totem pole Totem poles ( hai, gyáaʼaang) are monumental carvings found in western Canada and the northwestern United States. They are a type of Northwest Coast art, consisting of poles, posts or pillars, carved with symbols or figures. They are usually m ...
IRQ output that must be isolated from a wired-OR circuit by a
Schottky diode The Schottky diode (named after the German physicist Walter H. Schottky), also known as Schottky barrier diode or hot-carrier diode, is a semiconductor diode formed by the junction of a semiconductor with a metal. It has a low forward voltage ...
, due to the fact that the totem pole output actively drives the IRQ pin high when the W65C22S is not interrupting. This specific issue is resolved on the WDC W65C22N which is fitted with an open-drain IRQ output.


Bugs

Due to a design defect, if the edge on falls within a few nanoseconds of the falling edge of the ϕ2 (phase–2) clock, the will be ignored, causing the loss of a bit and framing errors on subsequent data. As a workaround, put the external clock signal into the input of a 74AC74 flip-flop, run the flop's output to the 6522's pin, and clock the flip-flop with ϕ0 or ϕ2.Wilson, Garth
/ref> The serial shift register bug was corrected in the
California Micro Devices onsemi (stylized in lowercase; legally ON Semiconductor Corporation; formerly ON Semiconductor until August 5, 2021) is an American semiconductor supplier company, based in Phoenix, Arizona and ranked #483 on the 2022 ''Fortune'' 500 based on it ...
CMD G65SC22, the
Western Design Center The Western Design Center (WDC), located in Mesa, Arizona, is a company which develops intellectual property for, and licenses manufacture of, MOS Technology 65xx based microprocessors, microcontrollers (µCs), and related support devices. W ...
W65C22 and in the MOS 6526, the latter device which Commodore used in place of the 6522 from the
Commodore 64 The Commodore 64, also known as the C64, is an 8-bit home computer introduced in January 1982 by Commodore International (first shown at the Consumer Electronics Show, January 7–10, 1982, in Las Vegas). It has been listed in the Guinness ...
onwards. Aside from the aforementioned shift register bug, there was a potential register corruption problem that usually only occurred in systems using the 6522 with a microprocessor having a non-6502
bus A bus (contracted from omnibus, with variants multibus, motorbus, autobus, etc.) is a road vehicle that carries significantly more passengers than an average car or van. It is most commonly used in public transport, but is also in use for cha ...
architecture, such as a
Motorola 68000 The Motorola 68000 (sometimes shortened to Motorola 68k or m68k and usually pronounced "sixty-eight-thousand") is a 16/32-bit complex instruction set computer (CISC) microprocessor, introduced in 1979 by Motorola Semiconductor Products Sector ...
. If the address lines changed while
chip select Chip select (CS) or slave select (SS) is the name of a control line in digital electronics used to select one (or a set) of integrated circuits (commonly called "chips") out of several connected to the same computer bus, usually utilizing the thre ...
was low (inactive) but the ϕ2 clock input was high (active), register contents could be changed despite the fact that the chip was not selected. This was fixed in some but not all of the CMOS versions.


References


External links


MOS 6522 VIA preliminary datasheet (1977)WDC W65C22 description
{{DEFAULTSORT:Mos Technology 6522 MOS Technology integrated circuits Input/output integrated circuits