ArticleslgStudy

engineering

MOS Technology 6522

MOS Technology 6522 is a engineering topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand MOS Technology 6522 rather than just read about it. In short: The MOS Technology 6522, also known as the 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 was an upgrade of the earlier MOS Technology 6520 PIA and MOS Technology 6532 RIOT, and was in turn upgraded to become the more powerful MOS Technology CIA.

MOS Technology 6522 — main illustration
MOS Technology 6522 — illustration

Key takeaways

  • MOS Technology 6522 belongs to engineering; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect MOS Technology 6522 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of MOS Technology 6522 from memory before moving on to harder problems.

Reference excerpt

The MOS Technology 6522, also known as the 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 was an upgrade of the earlier MOS Technology 6520 PIA and MOS Technology 6532 RIOT, and was in turn upgraded to become the more powerful MOS Technology CIA. In addition to being manufactured by MOS Technology, the 6522 was second sourced by other companies including Rockwell and Synertek. The 6522 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 contrast to the earlier RIOT, the VIA does not include any internal static RAM or ROM. 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 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 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 CB2, and CB1 can also be programmed to output a bit clock for external clocked serial devices.

IRQ output The NMOS 6522 has an open drain IRQ output that may be used in wired-OR interrupt circuits. The WDC W65C22S, in contrast, has a totem pole IRQ output that must be isolated from a wired-OR circuit by a Schottky diode, 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 CB1 falls within a few nanoseconds of the falling edge of the ϕ2 (phase–2) clock, the CB1 edge will be ignored, causing the loss of a bit and framing errors on subsequent data. A workaround is put the external clock signal into the D input of a 74ACT74 flip-flop, run the flop's Q output to the 6522's CB1 pin, and clock the flip-flop with ϕ0 or ϕ2. The serial shift register bug was corrected in the California Micro Devices CMD G65SC22 and in the MOS 6526, the latter device which Commodore used in place of the 6522 from the Commodore 64 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 architecture, such as a Motorola 68000. If the address lines changed while chip select 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) MOS 6522 VIA die shots WDC W65C22 description

Illustrations

MOS Technology 6522: Pin configuration of the 6522 VIA
Pin configuration of the 6522 VIA
MOS Technology 6522: Rockwell 6522 VIA
Rockwell 6522 VIA

Worked examples

Example 1 — a first encounter with MOS Technology 6522

Start with the simplest possible case. Write down what MOS Technology 6522 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In engineering, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to MOS Technology 6522 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about MOS Technology 6522 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of MOS Technology 6522

In research
MOS Technology 6522 appears in engineering research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses MOS Technology 6522 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
MOS Technology 6522 is common in secondary-school and first-year university syllabi. It links to neighbouring topics Input/output integrated circuits, MOS Technology integrated circuits, so understanding it makes those chapters shorter.
In everyday life
Look for MOS Technology 6522 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “MOS Technology 6522” →

How to study MOS Technology 6522 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what MOS Technology 6522 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain MOS Technology 6522 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is MOS Technology 6522 in simple terms?

The MOS Technology 6522, also known as the 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 was an upgrade of the earlier MOS Technology 6520 PIA and MOS Technology 6…

Why does MOS Technology 6522 matter?

Because it connects several engineering ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study MOS Technology 6522?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on MOS Technology 6522.

Tags

  • Input/output integrated circuits
  • MOS Technology integrated circuits

Keep exploring