R6522 Versatile Interface Adapter (VIA) SR Mode 3 — Shift in Under CBi Control In mode 3, external pin CB1 becomes an input (Figure 24). This allows an external device to load the shift register at its own pace. The shift register counter will interrupt the processor each time 8 bits have been shifted in. The shift register stops after 8 counts and must be reset to start again. Reading or writing the Shift Register resets the interrupt Flag and initializes the SR counter to count another 8 pulses. Note that the data is shifted during the first system clock cycle tollowing the positive-going edge of the CBi shift pulse. For this reason, data must be held stable during the first full cycle fol- lowing CB1 going high. The minimum CB1 positive pulse width must be one clock period. SR Mode 4 — Shift Out Under T2 Control (Free-Run) Mode 4 is very similar to mode 1 in which the shifting rate is set by T2. However, in mode 4 the SR Counter does not stop the shifting operation (Figure 25). Since the Shift Register bit 7 (SR7) is recirculated back into bit 0, the 8 bits loaded into the shift register will be clocked onic CB2 repetitively. In this mode the shift register counter is disabled. SR Mode 5 — Shift Out Under T2 Control in made §, the shift rate is controlled by T2 (as in mode 1). The shifting operation is triggered by the read or write of the SR if the SR fiag is set in the IFR (Figure 26). Otherwise the first shift will occur at the next time-out of T2 after a read or write of the SR. However, with each read or write of the shift register the SA Counter is reset and 8 bits are shified onto CB2. At the same time, 8 shift pulses are generated on CB1 to control shifting in ’ external devices. After the 8 shift pulses, the shifting is disabled, the SR Interrupt Flag is set and CB2 remains at the last data level. READ SR rl | CBt OUTPUT SHIFT CLOCK CB2 INPUT 77 DATA ino Figure 23. SR Mode 2 — Shift In Under @2 Control ATUL AU CBI INPUT yg in SHIFT CLOCK ] | id 14 7/ st HE = UK SUK (OK Figure 24. SR Mode 3 — Shift In Under CBT Control on miepAaemoer i were sr [| i N + 2 CYCLES; CBi OUTPUT U CYCLES SHIFT CLOCK as ee | CB2 INPUT TIT DATA SL a 4 » Ga aren Gare Gk Figure 25. SR Mode 4 — Shift Out Under T2 Control (Free-Run)