6526 COMPLEX INTERFACE ADAPTER (CIA) CHIP SPECIFICATIONS DESCRIPTION The 6526 Complex Interface Adapter (CIA) is a 65XX bus compatible peripheral interface device with extremely flexible timing and I/O capabilities. FEATURES o 16 individually programmable I/O lines o 8 or 16-Bit handshaking on read or write o 2 independent, linkable 16-Bit interval timers o 24-hour (AM/PM) time of day clock with programmable alarm o 8-Bit shift register for serial I/O o 2 TTL load capability o CMOS compatible I/O lines o 1 or 2 MHz operation available ORDERING INFORMATION PIN CONFIGURATION MXS 6526 ___ ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ ³ Vss ͵ 1 40 ÆÍ CNT ³ ³ PA0 ͵ 2 39 ÆÍ SP ³ ³ PA1 ͵ 3 38 ÆÍ RS0 ³ ³ PA2 ͵ 4 37 ÆÍ RS1 ³ ³ PA3 ͵ 5 36 ÆÍ RS2 ³ ÀÄÄÄÄÄÄ FREQUENCY RANGE PA4 ͵ 6 35 ÆÍ RS3 ³ NO SUFFIX = 1MHz PA5 ͵ 7 34 ÆÍ /RES ³ A = 2MHz PA6 ͵ 8 33 ÆÍ D0 ³ PA7 ͵ 9 32 ÆÍ D1 ³ PB0 ͵ 10 31 ÆÍ D2 ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ PACKAGE DESIGNATOR PB1 ͵ 11 30 ÆÍ D3 C = Ceramic PB2 ͵ 12 29 ÆÍ D4 P = Plastic PB3 ͵ 13 28 ÆÍ D5 PB4 ͵ 14 27 ÆÍ D6 PB5 ͵ 15 26 ÆÍ D7 PB6 ͵ 16 25 ÆÍ 02 PB7 ͵ 17 24 ÆÍ /FLAG /PC ͵ 18 23 ÆÍ /CS TOD ͵ 19 22 ÆÍ R/W Vcc ͵ 20 21 ÆÍ /IRQ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 6526 BLOCK DIAGRAM [See BLOCK.GIF picture supplied separately] 6526 INTERFACE SIGNALS 02 ÄÄ Clock Input The 02 clock is a TTL compatible input used for internal device operation and as a timing reference for communicating with the system data bus. __ CS ÄÄ Chip Select Input __ __ The CS input controls the activity of the 6526. A low level on CS while 02 is high causes the device to respond to signals on the R/W and address (RS) lines. A high on /CS prevents these lines from controlling the 6526. The /CS line is normally activated (low) at 02 by the appropriate address combination. _ R/W ÄÄ Read/Write Input _ The R/W signal is normally supplied by the microprocessor and controls the direction of data transfers of the 6526. A high on R/W indicates a read (data transfer out of the 6526), while a low indicates a write (data transfer into the 6526). RS3-RS0 ÄÄ Address Inputs The address inputs select the internal registers as described by the Register Map. REGISTER MAP ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ RS3 ³ RS2 ³ RS1 ³ RS0 ³ REG ³ NAME ³ DESCRIPTION ³ ÃÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ ³ 0 ³ 0 ³ 0 ³ 0 ³ 0 ³ PRA ³ PERIPHERAL DATA REG A ³ ³ 0 ³ 0 ³ 0 ³ 1 ³ 1 ³ PRB ³ PERIPHERAL DATA REG B ³ ³ 0 ³ 0 ³ 1 ³ 0 ³ 2 ³ DDRA ³ DATA DIRECTION REG A ³ ³ 0 ³ 0 ³ 1 ³ 1 ³ 3 ³ DDRB ³ DATA DIRECTION REG B ³ ³ 0 ³ 1 ³ 0 ³ 0 ³ 4 ³ TA LO ³ TIMER A LOW REGISTER ³ ³ 0 ³ 1 ³ 0 ³ 1 ³ 5 ³ TA HI ³ TIMER A HIGH REGISTER ³ ³ 0 ³ 1 ³ 1 ³ 0 ³ 6 ³ TB LO ³ TIMER B LOW REGISTER ³ ³ 0 ³ 1 ³ 1 ³ 1 ³ 7 ³ TB HI ³ TIMER B HIGH REGISTER ³ ³ 1 ³ 0 ³ 0 ³ 0 ³ 8 ³ TOD 10THS ³ 10THS OF SECONDS REGISTER ³ ³ 1 ³ 0 ³ 0 ³ 1 ³ 9 ³ TOD SEC ³ SECONDS REGISTER ³ ³ 1 ³ 0 ³ 1 ³ 0 ³ A ³ TOD MIN ³ MINUTES REGISTER ³ ³ 1 ³ 0 ³ 1 ³ 1 ³ B ³ TOD HR ³ HOURS-AM/PM REGISTER ³ ³ 1 ³ 1 ³ 0 ³ 0 ³ C ³ SDR ³ SERIAL DATA REGISTER ³ ³ 1 ³ 1 ³ 0 ³ 1 ³ 0 ³ ICR ³ INTERRUPT CONTROL REGISTER ³ ³ 1 ³ 1 ³ 1 ³ 0 ³ E ³ CRA ³ CONTROL REG A ³ ³ 1 ³ 1 ³ 1 ³ 1 ³ F ³ CRB ³ CONTROL REG B ³ ÀÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ DB7-DB0 ÄÄ Data Bus Inputs/Outputs The eight data bus pins transfer information between the 6526 and the system data bus. These pins are high impedance inputs unless /CS is low and R/W and 02 are high to read the device. During this read, the data bus output buffers are enabled, driving the data from the selected register onto the system data bus. ___ IRQ ÄÄ Interrupt Request Output ___ IRQ is an open drain output normally connected to the processor interrupt input. An external pullup resistor holds the signal high, allowing multiple /IRQ outputs to be connected together. The /IRQ output is normally off (high impedance) and is activated low as indicated in the functional description. ___ RES ÄÄ Reset Input ___ A low on the RES pin resets all internal registers. The port pins are set as inputs and port registers to zero (although a read of the ports will return all highs because of passive pullups). The timer control registers are set to zero and the timer latches to all ones. All other registers are reset to zero. 6526 FUNCTIONAL DESCRIPTION I/O PORTS (PRA, PRB, DDRA, DDRB). Ports A and B each consist of an 8-bit Peripheral Data Register (PR) and an 8-bit Data Direction Register (DDR). If a bit in the DDR is set to a one, the corresponding bit in the PR is an output; if a DDR bit is set to a zero, the corresponding PR bit is defined as an input. On a READ, the PR reflects the information present on the actual port pins (PA0-PA7, PB0-PB7) for both input and output bits. Port A and Port B have passive pull-up devices as well as active pull-ups, providing both CMOS and TTL compatibility. Both ports have two TTL load drive capability. In addition to normal I/O operation, PB6 and PB7 also provide timer output functions. HANDSHAKING __ Handshaking on data transfers can be accomplished using the PC output pin and the /FLAG input pin. /PC will go low for one cycle following a read or write of PORT B. This signal can be used to indicate "data ready" at PORT B or "data accepted" from PORT B. Handshaking on 16-bit data transfers (using both PORT A and PORT B) is possible by always reading or writing PORT A first. /FLAG is a negative edge sensitive input which can be used for receiving the /PC output from another 6526, or as a general purpose interrupt input. Any negative transition of /FLAG will set the /FLAG interrupt bit. ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ 0 ³ PRA ³ PA7 ³ PA6 ³ PA5 ³ PA4 ³ PA3 ³ PA2 ³ PA1 ³ PA0 ³ ³ 1 ³ PRB ³ PB7 ³ PB6 ³ PB5 ³ PB4 ³ PB3 ³ PB2 ³ PB1 ³ PB0 ³ ³ 2 ³ DDRA ³ DPA7 ³ DPA6 ³ DPA5 ³ DPA4 ³ DPA3 ³ DPA2 ³ DPA1 ³ DPA0 ³ ³ 3 ³ DDRB ³ DPB7 ³ DPB6 ³ DPB5 ³ DPB4 ³ DPB3 ³ DPB2 ³ DPB1 ³ DPB0 ³ ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ INTERVAL TIMERS (TIMER A, TIMER B) Each interval timer consists of a 16-bit read-only Timer Counter and a 16-bit write-only Timer Latch. Data written to the timer are latched in the Timer Latch, while data read from the timer are the present contents of the Time Counter. The timers can be used independently or linked for extended operations. The various timer modes allow generation of long time delays, variable width pulses, pulse trains and variable frequency waveforms. Utilizing the CNT input, the timers can count external pulses or measure frequency, pulse width and delay times of external signals. Each timer has an associated control register, providing independent control of the following functions: Start/Stop A control bit allows the timer to be started or stopped by the micro- processor at any time. PB On/Off A control bit allows the timer output to appear on a PORT B output line (PB6 for TIMER A and PB7 for TIMER B). This function overrides the DDRB control bit and forces the appropriate PB line to an output. Toggle/Pulse A control bit selects the output applied to PORT B. On every timer underflow the output can either toggle or generate a single positive pulse of one cycle duration. The Toggle output is set high whenever the timer is started and is set low by /RES. One-Shot/Continuous A control bit selects either timer mode. In one-shot mode, the timer will count down from the latched value to zero, generate an interrupt, reload the latched value, then stop. In continuous mode, the timer will count from the latched value to zero, generate an interrupt, reload the latched value and repeat the procedure continuously. Force Load A strobe bit allows the timer latch to be loaded into the timer counter at any time, whether the timer is running or not. Input Mode Control bits allow selection of the clock used to decrement the timer. TIMER A can count 02 clock pulses or external pulses applied to the CNT pin. TIMER B can count (02 pulses, external CNT pulses, TIMER A underflow pulses or TIMER A underflow pulses while the CNT pin is held high. The timer latch is loaded into the timer on any timer underflow, on a force load or following a write to the high byte of the prescaler while the timer is stopped. If the timer is running, a write to the high byte will load the timer latch, but not reload the counter. READ (TIMER) ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ 4 ³ TA LO ³ TAL7 ³ TAL6 ³ TAL5 ³ TAL4 ³ TAL3 ³ TAL2 ³ TAL1 ³ TAL0 ³ ³ 5 ³ TA HI ³ TAH7 ³ TAH6 ³ TAH5 ³ TAH4 ³ TAH3 ³ TAH2 ³ TAH1 ³ TAH0 ³ ³ 6 ³ TB LO ³ TBL7 ³ TBL6 ³ TBL5 ³ TBL4 ³ TBL3 ³ TBL2 ³ TBL1 ³ TBL0 ³ ³ 7 ³ TB HI ³ TBH7 ³ TBH6 ³ TBH5 ³ TBH4 ³ TBH3 ³ TBH2 ³ TBH1 ³ TBH0 ³ ÀÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ WRITE (PRESCALER) ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ 4 ³ TA LO ³ PAL7 ³ PAL6 ³ PAL5 ³ PAL4 ³ PAL3 ³ PAL2 ³ PAL1 ³ PAL0 ³ ³ 5 ³ TA HI ³ PAH7 ³ PAH6 ³ PAH5 ³ PAH4 ³ PAH3 ³ PAH2 ³ PAH1 ³ PAH0 ³ ³ 6 ³ TB LO ³ PBL7 ³ PBL6 ³ PBL5 ³ PBL4 ³ PBL3 ³ PBL2 ³ PBL1 ³ PBL0 ³ ³ 7 ³ TB HI ³ PBH7 ³ PBH6 ³ PBH5 ³ PBH4 ³ PBH3 ³ PBH2 ³ PBH1 ³ PBH0 ³ ÀÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ TIME OF DAY CLOCK (TOD) The TOD clock is a special purpose timer for real-time applications. TOD consists of a 24-hour (AM/PM) clock with 1/10th second resolution. It is organized into 4 registers: 10ths of seconds, Seconds, Minutes and Hours. The AM/PM flag is in the MSB of the Hours register for easy bit testing. Each register reads out in BCD format to simplify conversion for driving displays, etc. The clock requires an external 60 Hz or 50 Hz (programmable) TTL level input on the TOD pin for accurate time-keeping. In addition to time-keeping, a programmable ALARM is provided for generating an interrupt at a desired time. The ALARM registers or located at the same addresses as the corresponding TOD registers. Access to the ALARM is governed by a Control Register bit. The ALARM is write-only; any read of a TOD address will read time regardless of the state of the ALARM access bit. A specific sequence of events must be followed for proper setting and reading of TOD. TOD is automatically stopped whenever a write to the Hours register occurs. The clock will not start again until after a write to the 10ths of seconds register. This assures TOD will always start at the desired time. Since a carry from one stage to the next can occur at any time with respect to a read operation, a latching function is included to keep all Time Of Day information constant during a read sequence. All four TOD registers latch on a read of Hours and remain latched until after a read of 10ths of seconds. The TOD clock continues to count when the output registers are latched. If only one register is to be read, there is no carry problem and the register can be read "on the fly", provided that any read of Hours is followed by a read of 10ths of seconds to disable the latching. READ ÚÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ 8 ³ TOD 10THS³ 0 ³ 0 ³ 0 ³ 0 ³ T8 ³ T4 ³ T2 ³ T1 ³ ³ 9 ³ TOD SEC ³ 0 ³ SH4 ³ SH2 ³ SH1 ³ SL8 ³ SL4 ³ SL2 ³ SL1 ³ ³ A ³ TOD MIN ³ 0 ³ MH4 ³ MH2 ³ MH1 ³ ML8 ³ ML4 ³ ML2 ³ ML1 ³ ³ B ³ TOD HR ³ PM ³ 0 ³ 0 ³ HH ³ HL8 ³ HL4 ³ HL2 ³ HL1 ³ ÀÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ WRITE CRB7=0 TOD CRB7=1 ALARM (SAME FORMAT AS READ) SERIAL PORT (SDR) The serial port is a buffered, 8-bit synchronous shift register system. A control bit selects input or output mode. In input mode, data on the SP pin is shifted into the shift register on the rising edge of the signal applied to the CNT pin. After 8 CNT pulses, the data in the shift register is dumped into the Serial Data Register and an interrupt is generated. In the output mode, TIMER A is used for the baud rate generator. Data is shifted out on the SP pin at 1/2 the underflow rate of TIMER A. The maximum baud rate possible is 02 divided by 4, but the maximum useable baud rate will be determined by line loading and the speed at which the receiver responds to input data. Transmission will start following a write to the Serial Data Register (provided TIMER A is running and in continuous mode). The clock signal derived from TIMER A appears as an output on the CNT pin. The data in the Serial Data Register will be loaded into the shift register then shift out to the SP pin when a CNT pulse occurs. Data shifted out becomes valid on the falling edge of CNT and remains valid until the next falling edge. After 8 CNT pulses, an interrupt is generated to indicate more data can be sent. If the Serial Data Register was loaded with new information prior to this interrupt, the new data will automatically be loaded into the shift register and transmission will continue. If the microprocessor stays one byte ahead of the shift register, transmission will be continuous. If no further data is to be transmitted, after the 8th CNT pulse, CNT will return high and SP will remain at the level of the last data bit transmitted. SDR data is shifted out MSB first and serial input data should also appear in this format. The bidirectional capability of the Serial Port and CNT clock allows many 6526 devices to be connected to a common serial communication bus on which one 6526 acts as a master, sourcing data and shift clock, while all other 6526 chips act as slaves. Both CNT and SP outputs are open drain to allow such a common bus. Protocol for master/slave selection can be transmitted over the serial bus, or via dedicated handshaking lines. ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ C ³ SDR ³ S7 ³ S6 ³ S5 ³ S4 ³ S3 ³ S2 ³ S1 ³ S0 ³ ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ INTERRUPT CONTROL (ICR) There are five sources of interrupts on the 6526: underflow from TIMER A, underflow from TIMER B, TOD ALARM, Serial Port full/empty and /FLAG. A single register provides masking and interrupt information. The interrupt Control Register consists of a write-only MASK register and a read-only DATA register. Any interrupt will set the corresponding bit in the DATA register. Any interrupt which is enabled by the MASK register will set the IR bit (MSB) of the DATA register and bring the /IRQ pin low. In a multi-chip system, the IR bit can be polled to detect which chip has generated an interrupt request. The interrupt DATA register is cleared and the /IRQ line returns high following a read of the DATA register. Since each interrupt sets an interrupt bit regardless of the MASK, and each interrupt bit can be selectively masked to prevent the generation of a processor interrupt, it is possible to intermix polled interrupts with true interrupts. However, polling the IR bit will cause the DATA register to clear, therefore, it is up to the user to preserve the information contained in the DATA register if any polled interrupts were present. The MASK register provides convenient control of individual mask bits. When writing to the MASK register, if bit 7 (SET/CLEAR) of the data written is a ZERO, any mask bit written with a one will be cleared, while those mask bits written with a zero will be unaffected. If bit 7 of the data written is a ONE, any mask bit written with a one will be set, while those mask bits written with a zero will be unaffected. In order for an interrupt flag to set IR and generate an Interrupt Request, the corresponding MASK bit must be set. READ (INT DATA) ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ D ³ ICR ³ IR ³ 0 ³ 0 ³ FLAG ³ SP ³ ALARM³ TB ³ TA ³ ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ WRITE (INT MASK) ÚÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ REG ³ NAME ³ D7 ³ D6 ³ D5 ³ D4 ³ D3 ³ D2 ³ D1 ³ D0 ³ ÃÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ D ³ ICR ³ S/C ³ X ³ X ³ FLAG ³ SP ³ ALARM³ TB ³ TA ³ ÀÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÙ CONTROL REGISTERS (CRA, CRB) There are two control registers in the 6526, CRA and CRB. CRA is associated with TIMER A and CRB is associated with TIMER B. The register format is as follows: CRA: Bit Name Function 0 START 1=START TIMER A, 0=STOP TIMER A. This bit is automatically reset when underflow occurs during one-shot mode. 1 PBON 1=TIMER A output appears on PB6, 0=PB6 normal operation. 2 OUTMODE 1=TOGGLE, 0=PULSE 3 RUNMODE 1=ONE-SHOT, 0=CONTINUOUS 4 LOAD 1=FORCE LOAD (this is a STROBE input, there is no data storage, bit 4 will always read back a zero and writing a zero has no effect). 5 INMODE 1=TIMER A counts positive CNT transitions, 0=TIMER A counts 02 pulses. 6 SPMODE 1=SERIAL PORT output (CNT sources shift clock), 0=SERIAL PORT input (external shift clock required). 7 TODIN 1=50 Hz clock required on TOD pin for accurate time, 0=60 Hz clock required on TOD pin for accurate time. CRB: Bit Name Function (Bits CRB0-CRB4 are identical to CRA0-CRA4 for TIMER B with the exception that bit 1 controls the output of TIMER B on PB7). 5,6 INMODE Bits CRB5 and CRB6 select one of four input modes for TIMER B as: CRB6 CRB5 0 0 TIMER B counts 02 pulses. 0 1 TIMER B counts positive CNT transistions. 1 0 TIMER B counts TIMER A underflow pulses. 1 1 TIMER B counts TIMER A underflow pulses while CNT is high. 7 ALARM 1=writing to TOD registers sets ALARM, 0=writing to TOD registers sets TOD clock. REG NAME TODIN SPMODE INMODE LOAD RUNMODE OUTMODE PB ON START ÚÄÄÄÂÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿ ³ E ³CRA³0=60Hz³0=INPUT ³ 0=02 ³1=FORCE ³0=CONT.³0=PULSE ³0=PB6OFF³0=STOP ³ ³ ³ ³ ³ ³ ³ LOAD ³ ³ ³ ³ ³ ³ ³ ³1=50Hz³1=OUTPUT³ 1=CNT ³(STROBE)³1=O.S. ³1=TOGGLE³1=PB6ON ³1=START³ ÀÄÄÄÁÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ´ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ TA ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ REG NAME ALARM INMODE LOAD RUNMODE OUTMODE PB ON START ÚÄÄÄÂÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿ ³ F ³CRB³0=TOD ³ 00=02 ³1=FORCE ³0=CONT.³0=PULSE ³0=PB7OFF³0=STOP ³ ³ ³ ³ ³ 11=CNT ³LOAD ³ ³ ³ ³ ³ ³ ³ ³ ³ 10=TA ³ ³ ³ ³ ³ ³ ³ ³ ³1=ALARM³ 11=CNT&TA ³(STROBE)³1=O.S. ³1=TOGGLE³1=PB7ON ³1=START³ ÀÄÄÄÁÄÄÄÁÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄ´ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ- TB ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ All unused register bits are unaffected by a write and are forced to zero on a read. 6526 SYSTEM TIMING CHARACTERISTICS ÚÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ ³ ³ 1MHz ³ 2MHz ³ ³ ³ Symbol ³ Characteristic ÃÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ´ Unit ³ ³ ³ ³ MIN ³ MAX ³ MIN ³ MAX ³ ³ ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ ³ 02 CLOCK ³ ³ ³ ³ ³ ³ ³ Tcyc ³ Cycle Time ³ 1000 ³ 20000 ³ 500 ³ 20000 ³ ns ³ ³ Tr, Tf ³ Rise and Fall Time ³ - ³ 25 ³ - ³ 25 ³ ns ³ ³ Tchw ³ Clock Pulse Width (High) ³ 440 ³ 10000 ³ 255 ³ 10000 ³ ns ³ ³ Tclw ³ Clock Pulse Width (Low) ³ 420 ³ 10000 ³ 200 ³ 10000 ³ ns ³ ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ ³ WRITE CYCLE ³ ³ ³ ³ ³ ³ ³ Tpd ³ Output Delay From 02 ³ - ³ 960 ³ - ³ 460 ³ ns ³ ³ Twcs ³ /CS low while 02 high ³ 280 ³ - ³ 255 ³ - ³ ns ³ ³ Tads ³ Address Setup Time ³ 58 ³ - ³ 20 ³ - ³ ns ³ ³ Tadh ³ Address Hold Time ³ 10 ³ - ³ 10 ³ - ³ ns ³ ³ Trws ³ R/W Setup Time ³ 15 ³ - ³ 15 ³ - ³ ns ³ ³ Trwh ³ R/W Hold Time ³ 15 ³ - ³ 15 ³ - ³ ns ³ ³ Tds ³ Data Bus Setup Time ³ 200 ³ - ³ 75 ³ - ³ ns ³ ³ Tdh ³ Data Bus Hold Time ³ 25 ³ - ³ 15 ³ - ³ ns ³ ÃÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ ³ READ CYCLE ³ ³ ³ ³ ³ ³ ³ Tps ³ Port Setup Time ³ 300 ³ - ³ 150 ³ - ³ ns ³ ³ Twcs(2)³ /CS low while 02 high ³ 280 ³ - ³ 255 ³ - ³ ns ³ ³ Tads ³ Address Setup Time ³ 58 ³ - ³ 20 ³ - ³ ns ³ ³ Tadh ³ Address Hold Time ³ 10 ³ - ³ 10 ³ - ³ ns ³ ³ Trws ³ R/W Setup Time ³ 15 ³ - ³ 15 ³ - ³ ns ³ ³ Trwh ³ R/W Hold Time ³ 15 ³ - ³ 15 ³ - ³ ns ³ ³ Tco ³ /CS to valid Data Out ³ - ³ 240 ³ 150 ³ - ³ ns ³ ³ Tacc ³ Data Access from RS3-RS0 ³ - ³ 550 ³ - ³ 275 ³ ns ³ ³ Tco(3) ³ Data Access from /CS ³ - ³ 320 ³ - ³ 150 ³ ns ³ ³ Tdr ³ Data Release Time ³ 50 ³ - ³ 25 ³ - ³ ns ³ ÀÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÙ ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» º NOTES: 1 - All timings are referenced from Vil max and Vih min on inputs º º and Vol max and Voh min on outputs. __ __ º º 2 - Twcs is measured from the later of 02 high or CS low. CS must º º be low at least until the end of 02 high. __ º º 3 - Tco is measured from the later of 02 high or CS low. º º Valid data is available only after the later of Tacc or Tco. º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ 6526 WRITE TIMING DIAGRAM [See WRITE.GIF picture supplied separately] 6526 READ TIMING DIAGRAM [See READ.GIF picture supplied separately] ELECTRICAL CHARACTERISTICS (Vcc +-5%, Vss=0V, Ta=0-70 Celsius) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄ¿ ³ CHARACTERISTIC ³ SYMBOL ³ MIN. ³ TYP. ³ MAX. ³ UNIT ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Input High Voltage ³ Vih ³ +2.4 ³ - ³ Vcc ³ V ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Input Low Voltage ³ Vil ³ -0.3 ³ - ³ - ³ V ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Input Leakage Current; ³ Iin ³ - ³ 1.0 ³ 2.5 ³ uA ³ ³ Vin=Vss+5V ____ ___ __ ³ ³ ³ ³ ³ ³ ³ (TOD, R/W, FLAG, RES, CS ³ ³ ³ ³ ³ ³ ³ 02, RS0-RS3) ³ ³ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Port Input Pull-up Resistance ³ Rpi ³ 3.1 ³ 5.0 ³ - ³ kOhms³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Output Leakage Current for High ³ Itsi ³ - ³ +-1.0 ³+-10.0 ³ uA ³ ³ Impedance State (Three State); ³ ³ ³ ³ ³ ³ ³ Vin=4V to 2.4V ___ ³ ³ ³ ³ ³ ³ ³ (DB0-DB7, SP, CNT, IRQ) ³ ³ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Output High Voltage; ³ Voh ³ +2.4 ³ - ³ Vcc ³ V ³ ³ Vcc=MIN, Iload < -200uA __ ³ ³ ³ ³ ³ ³ ³ (PA0-PA7, PB0-PB7, DB0-DB7, PC) ³ ³ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Output Low Voltage; ³ Vol ³ - ³ - ³ +0.40 ³ V ³ ³ Vcc=MIN, Iload < 3.2 mA __ ³ ³ ³ ³ ³ ³ ³ (PA0-PA7, PB0-PB7, DB0-DB7, PC) ³ ³ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Output High Current (Sourcing); ³ Ioh ³ -200 ³ -1000 ³ - ³ uA ³ ³ Voh > 2.4V __ ³ ³ ³ ³ ³ ³ ³ (PA0-PA7, PB0-PB7, DB0-DB7, PC) ³ ³ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Output Low Current (Sinking); ³ Iol ³ 3.2 ³ - ³ - ³ mA ³ ³ Vol < 0.4V __ ³ ³ ³ ³ ³ ³ ³ (PA0-PA7, PB0-PB7, DB0-DB7, PC) ³ ³ ³ ³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Input Capacitance ³ Cin ³ - ³ 7 ³ 10 ³ pf ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Output Capacitance ³ Cout ³ - ³ 7 ³ 10 ³ pf ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÅÄÄÄÄÄÄ´ ³ Power Supply Current ³ Icc ³ - ³ 70 ³ 100 ³ mA ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÁÄÄÄÄÄÄÙ MAXIMUM RATINGS Supply Voltage, Vcc -0.3V to +7.0V Input/Output Voltage, Vin -0.3V to +7.0V Operating Temperature, Top 0 to 70 Celsius Storage Temperature, Tstg -55 to 150 Celsius All inputs contain protection circuitry to prevent damage due to high static discharges. Care should be exercised to prevent unnecessary application of voltages in excess of the allowable limits. COMMENT Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. These are stress ratings only. Functional operation of this device at these or any other conditions above those indicated in the operational sections of this specification is not implied and exposure to absolute maximum rating conditions for extended periods may affect device reliability.