R6522 Versatile Interface Adapter (VIA) INTERFACE SIGNALS Figure 1 (on the front page) shows the R6522 VIA pin assign- ments and Figure 2 groups the signals by functional interface. RESET (RES) Reset (RES) clears all internat registers (except T1 and d T2 counters and latches, and the Shift Register (SR) ). In the RES condition, ail peripheral interface fines (PA and PB) are placed in the input state. Also, the Timers (T1 and T2), SR and inter- rupt logic are disabled from operation. INPUT CLOCK (PHASE 2) The system Phase 2 (62) Input Clock controls all data transfers between the R6522 and the microprocessor. READ/WRITE (R/W) The direction of the data transfers between the R6522 and the system processor is controlled by the RW line in conjunction with the CS1 and CS2 inputs. When RAW is low (write opera- tion} and the R6522 is selected, data is transferred from the processor bus into the selected R6522 register. When RIW is high (read operation) and the R6522 is selected, data is trans- ferred from the selected R6522 register to the processor bus. DATA BUS (D0-D7) The eight bidirectional Data Bus lines transfer data between the R6522 and the microprocessor. During a read operation, the con- tents of the selected R6522 internal register are .ransferred to the microprocessor via the Data Bus lines. During a write opet- ation, the Data Bus lines serve as high impedance inputs over which data is transferred from the microprocessor to a selected R6522 register. The Data Bus lines are in the high impedance state when the R6522 is unselected. CHIP SELECTS (CS1, CS2) Normally, the two chip select lines are connected to the micro- processor address lines. This connection may be direct or through decoding. To access a selected R6522 register, CS1 must be high (logic 1) and CS2 must be low (logic 0). REGISTER SELECTS (RSO-RS3)} The Regisiter Select inputs allow the microprocessor to select one of 16 internal registers within the R6522. Refer to Table 1 for Register Select coding and a functional description. REGISTER SELECTS (RSO-RS3) The Register Seiect inputs allow the microprocessor to select one of 16 internal registers within the R6522. Refer to Table 4 for Register Select coding and a functional description. INTERRUPT REQUEST (IRQ) The Interrupt Request (1R'Q) output signal is generated whenever an internal Interrupt Flag bit is set and the corresponding Inter- rupt Enabie bit is a Logic 1. The interrupt Request output is an PAO--PAT Gane CAF AN fi CAD CS, 633 —__ 42» nee? > CBI + CB2 ind ¢ PB0-PB7 Figure 2. R6522 VIA Interface Signals open-drain configuration, thus allowing the IRO signal to be wire-ORed to a common microprocessor IRQ input line. PORT A DATA LINES (PAO-PA7) Peripheral Data Port A is an 8-line, bidirectional bus for the trans- fer of data, control and status information between the R6522 and a peripheral device. Each Peripheral Data Port bus line may be individually programmed as either an input or output under contro! of a Data Direction Register. Data Row direction may be selected on a line-by-line basis with intermixed input and out- put lines within the same port. When a '‘0” is written to any bit position of the Data Direction Register, the corresponding line will be programmed as an input. When a ‘’1”’ is written into any bit position of the register, the corresponding data line will serve as an output. Polarity of the data output is determined by the Output Register, while input data may be latched into the Input Register under control of the CA1 line. All modes are program controlled by the microprocesgor by way of the R6522's inter- nai controt registers. Each Peripheral Data Port line represents one TTL foad in the input mode and will drive one standard TTL foad in the output mode. A typical output circuit for Peripheral Data Port A is shown in Figure 3. PORT A CONTROL LINES (CA1, CA2) Control lines CA1 and CA2 serve as interrupt inputs or hand- shake outputs for Peripheral Data Port A. Each line controfs an internal Interrupt Flag with a corresponding interrupt Enable bit. CA1 also controls the latching of input Data on Port A. CA1 is a high impedance input, while CA2 represents one standard TTL load in the input mode, In the output mode, CA2 will drive one standard TTL load.