The Engineering Staff of TEXAS INSTRUMENTS INCORPORATED Semiconductor Group TMS9901 PROGRAMMABLE SYSTEMS INTERFACE JULY 1978 TEXAS)NSTRUMENTS I NCORPORATE D IMPORTANT NOTICES Texas I nstruments reserves the right to make changes at any time in order to improve design and to supply the best product possible. TI cannot assume any resposibility for any circuits shown or represent that they are free from patent infringement. Copyright © 1978 Texas I nstruments Incorporated TABLE OF CONTENTS 1. INTRODUCTION 1 .1 Description ........................................................................... . 1.2 Key Features .......................................................................... . 1.3 Application Overview ................................................................... . 2. ARCHITECTURE 2.1CRU Interface .......................................................................... 2 2.2Interrupt Interface ....................................................................... 5 2.3Input/Output Interface ................................................................... 5 2.4Programmable Ports .................................................................... 9 2.6Power-Up Considerations ................................................................ 10 2.7Pin Descriptions ........................................................................ 11 3. APPLICATIONS 3.1 Hardware Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 12 3.2 Software Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 13 3.3 Interval Timer Application ................................................................ 15 4. TMS 9901 ELECTRICAL SPECIFICATIONS 4.1 Absolute Maximum Ratings Over Operating Free Air Temperature Range (Unless Otherwise Noted) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 19 4.2 Recommended Operating Conditions ...................................................... 19 4.3 Electrical Characteristics Over Full Range of Recommended Operating Conditions (Unless Otherwise Noted) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 19 4.4 Timing Requirements Over Full Range of Operating Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 19 4.5 Switching Characteristics Over Full Range of Recommended Operating Conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 20 5. MECHANICAL DATA 5.1 TMS 9901 -40 Pin Ceramic Package ..................................................... 21 5.2 TMS 9901 - 40 Pin Plastic Package ...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 22 LIST OF ILLUSTRATIONS Figure 1 Typical TMS 9901 Programmable System Interface (PSI) Application ...................... 2 Figure 2 TMS 9901 PSI Block Diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 3 Figure 3 TMS 9901 PSI Interrupt Control Block Diagram ......................................... 6 Figure 4 TMS 9901 liD Interface Section ...................................................... 8 Figure 5 Input and Output Equivalents ........ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 8 Figure 6 TMS 9901 Interval Timer Section ..................................................... 9 Figure 7 TMS 9900/TMS 9901 Interface ...... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 12 Figure 8 TMS 9981/TMS 9901 Interface ...................................................... 13 Figure 9 TMS 9900 Sample Software To Control The TMS 9901 .................................. 14 Figure 10 TMS 9901 Interval Timer Application Flowchart ......................................... 16 Figure 11 Interval Timer .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 17 Figure 12 Switching Characteristics ........................................................... 20 iii LIST OF TABLES Table 1 CRU Bit Assignments ............................................................... 4 Table 2 Interrupt Code Generation ........................................................... 4 Table 3 TMS 9980A or TMS 9981 Interrupt Level Data .......................................... 7 Table 4 TMS 9901 Pin Assignments and Functions .... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. 11 iv 1. INTRODUCTION 1.1 DESCRIPTION The TMS 9901 Programmable Systems Interface (PSI) is a multifunctional component designed to provide low cost interrupt and I/O ports and an interval timer for TMS 9900-family microprocessor systems. The TMS 9901 is fabricated using N-channel silicon-gate MOS technology. The TMS 9901 is TTL-compatible on all inputs and outputs, including the power supply (+5 V) and single-phase clock. 1.2 KEY FEATURES • Low Cost • 9900-Family Peripheral • Performs Interrupt and I/O Interface functions: - Six Dedicated Interrupt Lines - Seven Dedicated I/O Lines - Nine Programmable Lines as I/O or Interrupt - Up to 15 Interrupt Lines - Up to 22 Input Lines - Up to 16 Output Lines • Easily Cascaded for Expansion • Interval or Event Timer o Single 5 V Power Supply • All Inputs and Outputs TTL-Compatible o Standard 40-Pin Plastic or Ceramic Package • N-Channel Silicon-Gate MOS Technology. 1.3 APPLICATION OVERVIEW The following example of a typical application may help introduce the user to the TMS 9901 PSI. Figure 1 is a block diagram of a typical application. Each of the ideas presented below is described in more detail in later sections of this manual. The TMS 9901 PSI interfaces to the CPU through the Communications Register Unit (CRU) and the interrupt control lines as shown in Figure 1. The TMS 9901 occupies 32 bits of CRU input and output space. The five least significant bits of address bus are connected to the S lines of the PSI to address one of the 32 CRU bits of the TMS 9901. The most significant bits of the address bus are decoded on CRU cycles to select the PSI by taking its chip enable (CE) line active (LOW). Interrupt inputs to the TMS 9901 PSI are synchronized with ~, inverted, and then ANDed with the appropriate mask bit. Once every ~ clock time, the prioritizer looks at the 15 interrupt input AND gates and generates the interrupt control code. The interrupt control code and the interrupt request line constitute the interrupt interface to the CPU. After reset all I/O ports are programmed as inputs. By writing to any I/O port, that port will be programmed as an output port until another reset occurs, either software or hardware. Data at the input pins is buffered on to the TMS 9901. Data to the output ports is latched and then buffered off-chip by the PSI's MOS-to-TTL buffers. The interval timer on the TMS 9901 is accessed by writing a ONE to select bit zero (control bit), which puts the PSI CRU interface in the clock mode. Once in the clock mode the 14-bit clock contents can be read or written. Writing to the clock register will reinitialize the clock and cause it to start decrementing,. When the clock counts to zero, it will cause an interrupt and reload to its initial value. Reading the clock contents permits the user to see the decrementer contents at that point in time just before entering the clock mode. The clock read register is not updated when the PSI is in the clock mode. . - -_ _ _ _ _ _---'A.;.:::;D..::;DRESS BUS AD - A 14 7 DEDICATED 1/0 PORTS TMS 9900 CPU PROGRAMMABLE SYSTEM LINES AS 1/0 OR MEMORY INTERRUPTS TMS 9901 PSI 6 DEDICATED INTERRUPT LINES DATA BUS DO - D15 FIGURE 1- TYPICAL TMS 9901 PROGRAMMABLE SYSTEM INTERFACE (PSI) APPLICATION 2. ARCHITECTURE The architecture of the TMS 9901 Programmable Systems Interface (PSI) is designed to provide the user maximum flexibility when designating system I/O ports and interrupts. The TMS 9901 can be divided into four subsystems: CRU interface, interrupt interface, input/output interface, and interval timer. Figure 2 is a general block diagram of the TMS 9901 internal architecture. Each of the subsystems of the PSI is discussed in detail in subsequent paragraphs. 2.1 CRU Interface The CPU communicates with the TMS 9901 PSI via the CRU. The TMS 9901 occupies 32 bits in CRU read space and 32 bits in CRU write space. Table 1 shows the mapping for CRU bit addresses to TMS 9901 functions. The CRU interface consists of five address select lines (SO-S4), chip enable (CE), and the three CRU lines (CRUIN, CRUOUT, CRUCLK). The select lines (SO-S4) are connected to the five least significant bits of the address bus; for a TMS 9900 system SO-S4 are connected to A10-A14, respectively. Chip enable (CE) is generated by decoding the most significant bits of the address bus on CRU cycles; for a 9900 based system address bits 0-9 would be decoded. When CE goes active (LOW), the five select lines point to the CRU bit being accessed. When CE is inactive (HIGH), the PSI's CRU interface is disabled. NOTE When CE is inactive (HIGH) the 9901 sets its CRUIN pin to high impedance and' disables CRUCLK from coming on chip. This means that CRUIN can be used as an OR tied bus. When CE is high the 9901 will still see the select lines, but no command action is taken. In the case of a write operation, the TMS 9901 strobes data off the CRUOUT line with CRUCLK. For a read operation, the data is sent to the CPU on the CRUIN line. 2 r---- M R INTPEO I A E PRIORITIZER GROUP I S G K I A INTERRUPT ~ AND ENCODER (15 to 4) I I s T Kr 1 BUFFERS CODE ~ I ~~ ;:.. INT7/PI5 INTB/P14 r-- iNT9/PI3 GROUP iNTlO/P12 INTERVAL 2 INT1l1Pl1 -- TIMER BUFFERS INTI2/Pl0 / INT13/P9 'v- ~ iNr14/PB iNfiS/P7 ~ P6 "-r-- P5 r GROUP P4 3 P3 CRU INTERFACE ( CRU "\I ~ BUFFERS P2 "\I LOGIC rV PI PO ~ FIGURE 2-TMS 9901 PSI BLOCK DIAGRAM Several TMS 9901 devices may be cascaded to expand lID and interrupt handling capability simply by connecting all CRU and address select lines in parallel and providing each device with a unique chip enable signal: the chip enable (CE) is generated by decoding the high-order address bits (AO-A9) on CRU cycles. For those unfamiliar with the CRU concept, the following is a discussion of how to build a CRU interface. The CRU is a bit addressable (4096 bits), synchronous, serial interface over which a single instruction can transfer between one and 16 bits serially. Each one of the 4096 bits of the CRU space has a unique address and can be read and written to. During multi-bit CRU transfers, the CRU address is incremented at the beginning of each CRU cycle to point to the next consecutive CRU bit. 3 TABLE 1 CRU SELECT BIT ASSIGNMENTS CRU Bit So SI S2 S3 S4 CRU Read Data CRU Write Data 0 0 0 0 0 0 CONTROL BIT(1) CONTROL BIT(1) 0 0 0 0 INT1/CLK1(2) Mask 1/CLK1(3) 2 0 0 0 0 INT2/CLK2 Mask 2/CLK2 3 0 0 0 1 1 INT3/CLK3 Mask 3/CLK3 4 0 0 0 0 INT4/CLK4 Mask 4/CLK4 5 0 0 0 INT5/CLK5 Mask 5/CLK5 6 0 0 0 INT6/CLK6 Mask 6/CLK6 7 0 0 1 INT7/CLK7 Mask 7/CLK7 S 0 0 0 0 INTS/CLKS Mask S/CLKS 9 0 0 0 INT9/CLK9 Mask 9/CLK9 10 0 0 0 INT10/CLK10 Mask 10/CLK10 11 0 0 1 INT11/CLK11 Mask 11/CLK11 12 0 0 0 INT12/CLK12 Mask 12/CLK12 13 0 0 INT13/CLK13 Mask 13/CLK 13 14 0 1 0 INT14/CLK14 Mask 14/CLK14 15 0 1 1 INT15/INTREO (7) Mask 15/RST2(4) 16 0 0 0 0 PO Input(5) PO Output(6) 17 0 0 0 P1 Input P1 Output 1S 0 0 0 P2 Input P2 Output 19 0 0 1 P3 Input P3 Output 20 0 0 0 P4 Input P4 Output 21 0 0 P5 Input P5 Output 22 0 1 0 P6 Input P6 Output 23 0 1 1 P7 Input P7 Output 24 0 0 0 PS Input PS Output 25 0 0 1 P9 Input P9 Output 26 0 0 P10 Input P10 Output 27 0 1 P11 Input P11 Output 2S 0 0 P12 Input P12 Output 29 0 P13 Input P13 Output 30 0 P14 Input P14 Output 31 P15 Input P15 Output NOTES: (1) 0= Interrupt Mode 1 = Clock Mode (2) Data present on I NT input pin (or clock value) will be read regardless of mask value. (3) While in the I nterrupt Mode (Control Bit = 0) writing a "1" into mask will enable interrupt; a "0" will disable. (4) Writing a zero to bit 15 while in the clock mode (Control Bit = 1) executes a software reset of the I/O pins. (5) Data present on the pin will be read. Output data can be read without affecting the data. (6) Writing data to the port will program the port to the output mode and output the data. (7) I NTR EQ is the inverted status of the"i'NfFi'EO pin. 4 When a 99XX CPU executes a CRU Instruction, the processor uses the contents of workspace register 12 as a base address. (Refer to the 9900 Microprocessor Data Manual for a complete discussion on how CRU addresses are derived.) The CRU address is brought out on the 15-bit address bus; this means that the least significant bit of R12 is not brought out of the CPU. During CRU cycles, the memory control lines (MEMEN, WE, and DBIN) are all inactive; MEMEN being inactive (HIGH) indicates the address is not a memory address and therefore is a CRU address or external instruction code. Also, when MEMEN is inactive (HIGH) and a valid address is present, address bits AO-A2 must all be zero to constitute a valid CRU address; if address bits AO-A2 are other than all zeros, they are indicating an external instruction code. In summary, address bits - A3-A14 contain the CRU address to be decoded, address bits AO-A2 must be zero and MEMEN must be inactive (HIGH) to indicate a CRU cycle. 2.2 Interrupt Interface A block diagram of the interrupt control section is shown in Figure 3. The interrupt inputs (six dedicated, INT1-INT6, and nine programmable) are sampled on the falling edge of~ and latched onto the chip for one ¢ time by the SYNC LATCH, each ~ time. The output of the sync latch is inverted (interrupts are LOW active) and ANDed with its respective mask bit (MASK = 1, INTERRUPT ENABLED). On the riSing edge of ,,¢, the prioritizer and encoder senses the masked interrupts and produces a four-bit encoding of the highest priority interrupt present (see Tables 2 and 3). The four-bit prioritized code and INTREQ are latched off-chip with a sync latch on the falling edge of the next;j), which ensures proper synchronization to the processor. Once an interrupt goes active (LOW), it should stay active until the appropriate interrupt service routine explicitly turns off the interrupt. If an interrupt is allowed to go inactive before the interrupt service routine is entered, an erroneous interrupt code could be sent to the processor. A total of five clock cycles occur between the time the CPU samples the INTREQ line and the time it samples the ICO-IC3 lines. For example, if an interrupt is active and the CPU recognizes that an interrupt is pending, but before the CPU can sample the interrupt control lines the interrupt goes inactive, the interrupt control lines will contain an incorrect code. The interrupt mask bits on the TMS 9901 PSI are individually set or reset under software control. Any unused interrupt line should have its associated mask disabled to avoid false interrupts: To do this, the control bit (CRU bit zero), is first set to a zero for interrupt mode operation. Writing to TMS 9901 CRU bits 1-15 will enable or disable interrupts 1-15, respectively. Writing a one to an interrupt mask will enable that interrupt; writing a zero will disable that interrupt. Upon application of RST1 (power-up reset), all mask bits are reset (LOW), the interrupt code is forced to all zeros, and INTREQ is held HIGH. Reading TMS 9901 CRU bits 1-15 indicates the status of the respective interrupt inputs; thus, the designer can employ the unused (disabled) interrupt input lines as data inputs (true data in). 2.3 Input/Output Interface A block diagram of the TMS 9901 I/O interface is shown in Figure 4. Up to 16 individually controlled, 110 ports are available (seven dedicated, PO-P6, and nine programmable) and, as discussed above, the unused dedicated interrupt lines also can be used as input lines (true data in). Thus the 9901 can be configured to have more than 16 inputs. RST1 (power-up reset) will program all I/O ports to input mode. Writing data to a port will automatically switch that port to the output mode. Once programmed as an output, a port will remain in output mode until RST1 or RST2 (command bit) is executed. An output port can be read and indicates the present state of the pin. A pin programmed to the output mode cannot be used as an input pin: Applying an input current to an output pin may cause damage to the TMS 9901. The TMS 9901 outputs are latched and buffered off-chip, and inputs are buffered onto the chip. The output buffers are MOS-to-TTL buffers and can drive two standard TTL loads. 5 ICO PRIORITIZER AND 15 ENCODER ICl IC2 IC3 ¢t CRU INTERFACE CRU LOGIC FIGURE 3- TMS 9901 PSI INTERRUPT CONTROL SECTION BLOCK DIAGRAM TABLE 2 INTERRUPT CODE GENERATION INTERRUPT/STATE PRIORITY ICO IC1 IC2 IC3 INTREQ RST 1 - 0 0 0 0 1 - INT 1 1 (HIGHEST) 0 0 0 1 0 INT 2 2 0 0 1 0 0 INT 3/CLOCK 3 0 0 1 1 0 INT4 4 0 1 0 0 0 - INT 5 5 0 1 0 1 0 INT6 6 0 1 1 0 0 INT 7 7 0 1 1 1 0 INT8 8 1 0 0 0 0 - INT9 9 1 0 0 1 0 INT 10 10 1 0 1 0 0 INT 11 11 1 0 1 1 0 INT 12 12 1 1 0 0 0 INT 13 13 1 1 0 1 0 INT 14 14 1 1 1 0 0 INT 15 15 (LOWEST) 1 1 1 1 0 NO INTERRUPT - 1 1 1 1 1 TABLE 3 TMS 9980A OR TMS 9981 INTERRUPT LEVEL DATA INTERRUPT VECTOR LOCATION INTERRUPT MASK VALUES CODE FUNCTION (MEMORY ADDRESS DEVICE ASSIGNMENT TO ENABLE (lCO-IC2) IN HEX) (ST12 THROUGH ST15) 1 1 0 Level 4 0 0 1 0 External Device 4 Through F 1 0 1 Level 3 0 0 0 C External Device 3 Through F 1 0 0 Level 2 0 0 0 8 External Device 2 Through F 0 1 1 Level 1 0 0 0 4 External Device 1 Through F 0 0 1 Reset 0 0 0 0 Reset Stimulus Don't Care 0 1 0 Load 3 F F C Load Stimulus Don't Care a 0 a Reset 0 0 0 0 Reset Stimulus Don't Care 1 1 1 No-Op ------ ------ 7 I/O CONTROL DATA LATCH CRU CRU INTERFACE LOGIC I/O PORTS (PO-P15 MAX) I/O CONTROL DATA LATCH FIGURE 4-TMS 9901 I/O INTERFACE SECTION EQUIVALENT OF I/O INPUTS EQUIVALENT OF I/O OUTPUTS Vec INPUT o>----a--r FIGURE 5 - INPUT AND OUTPUT EQUIVALENTS 8 2.4 Programmable Ports A total of nine pins (INT7IP15-INT15/P7) on the TMS 9901 are user-programmable as either lID ports or interrupts. These pins will assume all characteristics of the type pin they are programmed to be (as described in Sections 2.2 and 2.3). Any pin which is not being used for interrupt should have the appropriate interrupt mask disabled (mask = 0) to avoid erroneous interrupts to the CPU. To program one of the pins as an interrupt, its interrupt mask simply is enabled and the line may be used as if it were one of the dedicated interrupt lines. To program a pin as an lID port, disable the interrupt mask and use that pin as if it were one of the dedicated lID ports. 2.5 Interval Timer Figure 6 is a block diagram of the TMS 9901 interval timer section. The clock consists of a 14-bit counter that decrements at a rate of f(~)/64 (at 3 MHz this results in a maximum interval of 349 milliseconds with a resolution of 21.3 microseconds). The clock can be used as either an interval timer or an event timer. To access the clock, select bit zero (control bit) must be set to a one. The clock is enabled to cause interrupts by writing a nonzero value to it and is then disabled from interrupting by writing zero to it or by a RST1. The clock starts operating at no more than two cp times after ~ is loaded. When the clock decrementer is running, it will decrement down to zero and issue a level-3 interrupt. The decrementer, when it becomes zero, will also be reloaded from the clock register and decrementing will start again. (The zero state is counted as any other decrementer state.) The decrementer always runs, but it will not issue interrupts unless enabled; of course, the contents of the unenabled clock read register are meaningless. DEC: 0 CLOCK ~-------- INTERRUPT CRU ClK lOGIC CLOCK DEC REM ENTER ClK READ REGISTER f I~I 64 - _ - - - I FIGURE 6-TMS 9901 INTERVAL TIMER SECTION 9 The clock is accessed by writing a one into the control bit (TMS 9901 CRU bit zero) to force CRU bits 1-15 to clock mode. Writing a nonzero value into the clock register then enables the clock and sets its time period. When the clock is enabled, it interrupts on level 3 and externallevel-3 interrupts are disabled. The mask for level 3 in the PSI must be set to a one so that the processor will see the clock interrupt. When the clock interrupt is active, the clock mask (mask bit 3) must be written into with either a one or zero to clear the interrupt; writing a zero also disables further interrupts. If a new clock value is required, a new 14-bit clock start value can be programmed by executing a CRU write operation to the clock register. During programming, the decrementer is restarted with the current start value after each start value bit is written. A timer restart is easily implemented by writing a single bit to any of the clock bits. The clock is disabled by RST1 (power up reset) or by writing a zero value into the clock register; RST2 does not affect the clock. The clock read register is updated every time the decrementer decrements when the TMS 9901 is not in clock mode. There are two methods to leave the clock mode: first, a zero is written to the control bit; or second, a TMS 9901 select bit greater than 15 is accessed. Note that when CE is inactive(HIGH), the PSI is not disabled from seeing the select lines. As the CPU is addressing memory, A 1O-A 14 could very easily have a value of 15 or greater - A 1O-A 14 are connected to the select lines; therefore, the TMS 9901 interval timer section can "think" it is out of clock mode and update the clock read register. Very simply, this means that a value cannot be locked into the clock read register by writing a one to CRU select bit zero (the control bit). The 9901 must be out of clock mode for at least one timer period to ensure that the contents of the clock read register has been updated. This means that to read the most recent contents of the decrementer, just before reading, the TMS 9901 must not be in the clock mode. The only sure way to manipulate clock mode is to use the control bit (select bit zero). When clock mode is reentered to access the clock read register, updating of the read register will cease. This is done so that the contents of the clock read register will not change while it is being accessed. 2.6 Power-Up Considerations During hardware reset, RST1 must be active (LOW) for a minimum of two clock cycles to force the TMS 9901 into a known state. RST1 will disable all interrupts, disable the clock, program all I/O ports to the input mode, and force ICO-IC3 to all zeros with INTREQ held HIGH. The system software must enable the appropriate interrupts, program the clock, and configure the I/O ports as required. After initial power-up the TMS 9901 is accessed only as needed to service the clock, enable (disable) interrupts, or read (write) data to the I/O ports. The I/O ports can be reconfigured by use of the RST2 software reset command bit. 10 2.7 Pin Descriptions Table 4 defines the TMS 9901 pin assignments and describes the function of each pin. TABLE 4 TMS 9901 PIN ASSIGNMENTS AND FUNCTIONS SIGNATURE PIN I/O DESCRIPTION 11 OUT INTERRUPT Request. When active (low) il\iTRrn indicates that an enabled interrupt RST1 CRUOUT 2 1 [ ~ U P b 40 39 VCC so has been received. fi'.J'FRl:Q will stay active until all enabled interrupt inputs are reo CRUCLK 3 [ P 38 PO moved. CRUIN 4 [ P37 P1 ICO (MSB) 15 OUT Interrupt Code lines. ICO-IC3 output the CE 5[ J36 S1 IC1 14 OUT binary code corresponding to the highest M6 6 ~ ~ 35 S2 IC2 13 OUT priority enabled interrupt. If no enabled INT5 7 [ J 34 INTI/P15 IC3 (L5B) 12 OUT interrupts are active ICO-IC3 = (1,1,1,1). INT4 8 ~ J 33 INT8/P14 CE 5 IN Chip Enable. When active (low) data may be INT3 9 [ J 32 INT9/P13 transferred through the CRU interface to ¢ 10 ~ 0 31 INT10/P12 the CPU. cr has no effect on the interrupt INTREQ 11 [ Q 30 INT11/P11 control section. IC3 12 [ 0 29 INT12/P10 IC2 13 [ Q 28 INT13/P9 SO 39 IN Address select lines. The data bit being IC1 14 [ ] 27 INT14/P8 Sl 36 IN accessed by the CRU interface is specified ICO 15 [ ~ 26 P2 S2 S3 35 25 IN IN by the 5-bit code appearing on SO-54. VSS 16 ~ b 25 S3 S4 24 IN INT1 17 [ P 24 S4 INT2 18 ~ P23 0015/P7 CRUIN 4 OUT CRU data in (to CPU). Data specified by P6 19 [ P22 P3 SO-S4 is transmitted to the CPU by CRUIN. When CE is not active CRUIN is in a high- P5 20 [ "---------" P21 P4 impedance state. CRUOUT 2 IN CRU data out (from CPU). When CE is active, data present on the CRUOUT input will be sampled during CRUCLK and written into the command bit specified by SO-S4. CRUCLK 3 IN CRU Clock (from CPU). CRUCLK specifies that valid data is present on the CRUOUT line. liST 1 1 IN Power Up Reset. When active (low) RST1 resets all interrupt masks to "0", resets ICO - IC3 = (0, 0, 0,0), INTERQ = 1, disables the clock, and programs all I/O ports to inputs. RST1 has a SchmitHriger input to allow implementation with an RC circuit as shown in Figure 7. VCC 40 Supply Voltage. +5 V nominal. VSS 16 Ground Reference 1) 10 IN System clock (¢"3 in TMS 9900 system, CKOUT in TMS 9980 system). TNT 1 17 IN TNT2 18 IN Group 1, interrupt inputs. INT3 9 IN When active (Low) the signal is AN Oed with its corresponding TNT4 8 IN mask bit and if enabled sent to the interrupt control section. TNi5 7 IN I NTl has highest priority. TNT6 6 IN INT7/ P15 34 I/O fi\JTs/ P14 33 I/O TNT9/ P13 32 I/O fNTl0/P12 31 I/O Group 2, programmable inte'rrupt (active low) or I/O pins (true logic). Each pin is individually programmable as fNT11/P11 30 I/O TNT12/P10 29 an interrupt, an input port, or an output port. I/O fNT13/P9 28 I/O INT14/P8 27 I/O INT15/P7 23 I/O PO 38 I/O P1 37 I/O P2 26 I/O P3 22 I/O Group 3, I/O ports (true logic). Each pin is individually programmable as an input port or an output port. P4 21 I/O P5 20 I/O P6 19 I/O 11 3. APPLICATIONS 3.1 Hardware Interface Figure 7 illustrates the use of a TMS 9901 PSI in a TMS 9900 system. The TIM 9904 clock generator/driver syncs the RESET for both the TMS 9901 and the CPU. The RC circuit on the TIM 9904 provides the power-up and pushbutton RESET input to the clock chip. Address lines AO-A9 are decoded on CRU cycles to select the TMS 9901. Address lines A10-A14 are sent directly to PSI select lines SO-S4, respectively, to select which TMS 9901 CRU bit is to be accessed. Figure 8 illustrates the use of a TMS 9901 with a TMS 9981 CPU. No TIM 9904 is needed with the TMS 9981" so the reset circuitry is connected directly to the system reset line. The clock (7j;) then comes from the TMS 9981. All other circuitry is identical to the TMS 9900 system. "VVCC ~~1' D TIM 9904 Q CLOCK GENERATOR '-- I/n -r {> ~ CRU ¢ ';>1 .- 1,)4 AO- A9 DECODE I--- -CE TMS TMS 9900 9901 CPU A10 A11 A12 SO S1 S2 PSI K SY STEM IN TERRUPTS A13 S3 ~ I/O PORTS A14 S4 ~ CRUOUT CRUCLK CRUI~J -- - RESET RST1 FIGURE 7-TMS 9900/TMS 9901 INTERFACE 12 ~ CRU -- AO-A8 DECODE r--- CE TMS 9981 -V TMS 9901 ~ CPU PSI SY STEM ~ so IN TERRUPTS A9 A10 Sl Al1 S2 A12 S3 /l I/O PORTS A13 CRUOUT S4 "f CRUCLK CRUIN ¢ ¢ - - - RESET RSTl / ~.~ "" vvv- -0 VCC FIGURE 8- TMS 9981/TMS 9901 INTERFACE 3.2 Software Interface Figure 9 lists the TMS 9900 code needed to control the TMS 9901 PSI. The code initializes the PSI to an eight-bit input port, an eight-bit output port, and enables interrupt levels 1-6. The six dedicated interrupt pins are all used for interrupts; their mask bits are set ON. The nine programmable pins are all used as liD ports; mask bits 7-15 remain reset. PO-P7 are programmed as an eight-bit output port, and P8-P 15 are programmed as an eight-bit input port. Some code is added to read the contents of the clock read-register. The SBZ instruction takes the TMS 9901 out of clock mode long enough for the clock read register to be updated with the most recent decrementer value_ When clock mode is reentered, the decrementer will cease updating the clock read-register so that the contents of the register will not be changing during a read operation. The second section of code is typical code found in a clock interrupt service routine. All interrupts initially are disabled by the routine. These functions are not necessary, but are usually done to ensure system integrity_ The interrupt mask should be restored as soon as the sensitive processing is complete. The interrupt is counted in the variable COUNT and is then cleared by writing a one to mask bit 3. If a zero is written to mask bit 3 to clear the interrupt, clock interrupt will be disabled from that point onward, but the clock will continue to run. 13 ASSUMPTION: • System uses clock at maximum interval (349 msec @ 3MHz) • Interrupts 1-6 are used • Eight bits are used as an output port, PO -P7 • Eight bits are used as an input port, P8 - P15 • RST1 (power-up reset) has been applied • The most significant byte of R 1 contains data to be output. LI R 12, PSIBAS Set up CRU base to point to 9901 LDCR @CLKSET, 0 16-bit transfer, set clock to max interval LDCR @INTSET, 7 Enter interrupt mode and enable interrupts 1 - 6 LI R12, PSIBAS+32 Set CRU base to I/O ports - output LDCR R1,8 Output byte from R 1, program ports 0 - 7 as output LI R 12, PSIBAS+48 Set CRU base to I/O ports - input STCR R2,8 Store a byte from input port into MSBT of R2 LI R 12, PSI BAS Set CRU base to 9901 SBZ 0 Leave clock mode so decremented contents can be latched INCT R12 Set CRU base to clock read register SBO -1 Enter clock mode STCR R3,14 Read 14-bit clock read register contents into R3 CLKSET DATA >FFFF INTSET BYTE >7E CLKINT $ Clock interrupt service routine - level 3 LlMI 0 Disable interrupts at CPU INC @COUNT Count the clock interrupt LI R12, PSIBAS Set CRU base to point to 9901 SBZ 0 Enter interrupt mode SBO 3 Clear clock interrupt FIGURE 9 - TMS 9900 SAMPLE SOFTWARE TO CONTROL THE TMS 9901 14 3.3 Interval Timer Application A TM 990/100M microcomputer board application in which every 10 seconds a specific task must be performed is described below. The TMS 9901 clock is set to interrupt every 333.33 milliseconds. This is accomplished by programming the 14-bit clock register to 300916 (15,62~o). The TM 990/100M micro- computer board system clock runs at 3 MHz, giving a clock resolution of 21.33 microseconds. A decrementer period of 21.33 microseconds multiplied by 15,625 periods until interrupt gives 333.33 milliseconds between interrupts. The interrupt service routine must count 30 interrupts before 10 seconds elapses: f(cp) 1 64 f( DEC) = 64 ' T(DEC)=--= = 21.333311s f( DEC) 3,000,000 Figure 10 is a flowchart of the software required to perform the above application, and Figure 11 is a listing of the code. Following the flowchart, the main routine sets up all initial conditions for the 9901 and clock service routine. The interrupt service routine decrements a counter in R2 which was initialized to 30. When the counter in R2 decrements to zero, 10 seconds have elapsed, and the work portion of the service routine is entered. Note carefully that the work portion of the service routine takes longer than 333.33 ms which is the time between clock interrupts from the 9901. Therefore, recursive interrupts are going to occur and some facility must be provided to handle them. Loading a new workspace pointer and transferring the saved WP, PC, and ST (R13-R15) from the interrupt workspace to the new workspace allows one level of recursion. 15 START 1 DECREMENT R2 SET UP 9901 CLOCK I,ND INTERRUPTS CLOCK ~ >3D09 R2; 30 I MAIN PROGRAM INTER RUPTS FOR CLOCK LOAD WP TRANSFER SAVED R13 - R15 FROM INTERRUPT • THIS BRANCH REQUIRES LONGER TO EXECUTE THAN WORKSPACE THE INTERRUPT TIME (333.3 msl; THEREFORE, CODE TO ALLOW ONE LEVEL OF RECURSION IS INCLUDED CLEAR INTERRUPT FOR CLOCK INTERRUPTS SUBROUTINE FIGURE 10-TMS 9901 INTERVAL TIMER APPLICATION FLOWCHART DEVICE INITIALIZATION rEOO 02EO U •.IF' I >FF20 I-f_02 t=F~::: 0 r=·E04 020(: Ll ~~ 12 ~ .:. 1 00 9901 CPU BAiE ADDRESS rE:,06 01 uo FE. 0::: 02~0 Li.o.lP 1 .> F'Fr::.:::: INTERRUPT :;: WORKSPACE. FEOA FF6::: FEUC o~~ 0 1 LI ;;;~ 1 >?A13 ~ DATA FOR 333.33MS CLOCK FEOE ?A13 FE1 0 020c~ Ll F.'2 ~ JO JO X J33.33MS = 10SEC FEl2 OOlE FEl4 O~-:'OC LI ~~ L::' ~ : 1 00 9901 CPU BASE ADDRESS FEl6 1.11 00 FE1::: :3:.::C 1 LDC~~ P1 15 ~ LOAD '~9 (I 1 CLOCK FE1A lEOO :.;:B2 I) SET 9901 TO INTERRUPT MODE FE.1C 1 £I 03 :~:BD :3 UNMASK INTERRUPT 3 MAIN PROGRAM FDOO 02EO U.JP 1 .> rF 00 MAIN PROGRAM WORKSPACE FD02 FF 00 FD04 0:3 00 LItH :::: Et"HiBLE I rH u-3 FD06 000:3 ....-_~_INTERRUPTS MAIN PROGRAM NOTE: This code was assembled using the TM 990/402 line-by-line assembler. FIGURE 11-INTERVAL TIMER 17 INTERRUPT 3 SERVICE ROUTINE (WP = FF68) FTiHO 06n2 DEC F.~2 COUNT DOWN :30 IN R2 ~=D:::~~' 1 ::::02 JEO )FD:::::-: IF ZERO THEN JUMP rD::::4 1110:3 :~:BO :.:: CLEAR 9901 CLOCK INTEPPUPT FD"::6 0:::::::0 f;;~TI.rIP PETURN TO INTERRUPTED ROUTINE FIlS::: 0202 LI p.-, ~ ",'::' ::::0 RELOAD R2 FOR 1 I) S·EC CDur·i T DOI.tH"i F 11::: A (lU1E FD:::L 1.1460 B ;il.> Fe::: 0 BRANCH TO SUBROUTINE FD:::E. FC:30 ROUTINE TO BE PERFORMED EVERY 10 SECONDS, IT TAKES LONGER THAN 333.33 MS WHICH IS 9901 CLOCK PERIOD' FC:?O Oc~EO LI.•JPI >FF20 WORKSPACE FOR SUBROUTINE FC:32 FF20 FC:=:4 C:360 MOV @>FF:=:2,R13 TRANSFER SAVED wP,PC,ST ~ROM FC86 FFBE: Fe:::? C3AO MOV ~)FF84,R14 INT 3 WORKSPACE FC:::A FF:34 FC::::C C3EO FC8E FF:36 FC90 1110:3 SBO :3 CLEAR 9901 CLOCK INTERRUPT FC92 0300 L!PH :3 Et·iftBLE HiT (1-3 FC94 000:3 ~_ _ INTERRUPTS SUBROUTINE ~C I) RTI.•.IP FIGURE 11-(CONCLUDED) 18 4. TMS 9901 ELECTRICAL SPECIFICATIONS 4.1 Absolute Maximum Ratings Over Operating Free Air Temperature Range (Unless Otherwise Noted) * Supply voltage, VCC ............................................................. -0.3Vto 10V All inputs and output voltages ..................................................... - 0.3 V to 10 V Continuous power dissipation ........................................................... 0.85 W Operating free-air temperature range ................................................. O°C to 700 e Storage temperature range ........................ . . . . . . . . . . . . . . . . . . . . . . . . . . . .. -65°e to 1500 e ·Stresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of tho device at these or any other conditions beyond those indicated in the "Recommended Operating Conditions" section of this specification is not implied. Exposure to absolute maximum rated conditions for extended periods may affect device reliability. 4.2 Recommended Operating Conditions * PARAMETER MIN NOM MAX UNIT Supply voltage, VCC 4.75 5.0 5.25 V Supply voltage, VSS 0 V High·level input voltage, VIH 2.0 VCC V Low-level input voltage, VIL VSS-·3 0.8 V Operating free-air temperature, T A 0 70 °c 4.3 Electrical Characteristics Over Full Range of Recommended Operating Conditions (Unless Otherwise Noted) * PARAMETER TEST CONDITIONS MIN TYP MAX UNIT IOH = -100 p,A 2.4 VCC V VOH High level output voltage IOH = -200 p,A 2.2 VCC V VOL Low level output voltage IOL = 3.2mA VSS 0.4 V II Input current (any input) VI = OVtoVCC ±100 p,A ICC(av) Average supply current from VCC tc(cf» = 330 ns, TA = 70°C 150 mA CI Small signal input capacitance, any input f= 1 MHz 15 pF 4.4 Timing Requirements Over Full Range of Operating Conditions PARAMETER MIN TYP MAX UNIT tc(cf» Clock cycle time 300 333 2000 ns tr(cf» Clock rise time 5 40 ns tf(cf» Clock fall time 10 40 ns tw(cf>H) Clock pulse width (high level) 225 ns tw(¢L) Clock pulse width (lOW level) 45 300 ns tw(CC) CRUCLK pulse width 100 185 ns tsu1 Setup time for CE, SO-S4, or CRUOUT before CRUCLK 100 ns tsu2 Setup time for interrupt before cf> low 60 ns tsu3 Setup time for inputs before valid CRUIN 200 ns th Hold time for CE, SO-S4, or CRUOUT after CRUCLK 60 ns ·NOTE: All voltage values are referenced to Vss. 19 4.5 Switching Characteristics Over Full Range of Recommended Operating Conditions PARAMETER TEST CONDITION MIN TYP MAX UNIT tpd1 Propagation delay, CE to valid CRUIN CL = 100pF 300 ns tod2 Propagation delay, SO-S4 to valid CRUIN CL = 100pF 320 ns tpd3 Propagation delay, ;p low to valid mRW, ICO-IC3 CL = 100pF 110 ns tpd Propagation delay, CRUCLK to valid data out (PO-P15) CL = 100pF 300 ns tw(.pU -II '- tr( I I I It-- tw(r/>H) t su 2 -J l- I I I -I I-- t su2 INTERRUPT \ I J I -I I--- tpd3 t pd3---l l- , INTREQ I~ .1 tsu 1 t t I I I - tpd1 ----j CE t 1 1 1 / t 1 -I I- tw(CC) CRUClK t \ I I I tsu 1 I- I- th -I t- tpd2 ----.j VALID AD DR ESS wma..-V-A-Ll-O-A-D-D-R-E-S-S------------X so - S4 I 1 l r- tsu3 -I ~---~~-A-L-I-O-I-N-PU-T-O-A-TA--------X INT1-INT15. PO-P15I I I I I I I I I I CRUOUT NOTE1: ALL TIMING MEASUREMENTS ARE FROM 10% and 90% POINTS. FIGURE 12-SWITCHING CHARACTERISTICS 20 5. MECHANICAL DATA 5.1 TMS 9901 JL - 40 Pin Ceramic Package ceramic packages with side-brazed leads and metal or epoxy or glass lid seal ' 2.020 151.3) MAX -I I®. ® ~~'''~ ::::::I~: ~~I :::::::I ----------------------------------------------.. @V NOTES: a. Each pin centerline is located within 0.010 (2,54) of its true longitudinal position. b. All linear dimensions are in inches and parenthetically in millimeters. Inch dimensions govern. c. The index is placed in this area to identify pin 1 and to provide other information as follows: Pin 1 connected to chip-mounting pad. llXX Pin XX connected to chip-mounting pad_ No connection to chip-mounting pad. Other symbols may indicate any combination of up to 4 pins connected to the chip-mounting pad. ~ DIM 16 18 20 22 24 28 40 A ' 0.010 10,26) 0.30017,621 0.300 17,621 0.30017,62) 0.400110,16) 0.600 115,24) 0.600 115.241 0.600 115,241 B MAX 0.S40 121,41 0.910123,11 1.020125,9) 1.10012S,01 1,290 132,S) 1.415136,01 2.020151,31 C NOM 0.29017,41 0.29017,4) 0.29017,41 0.39019,91 0.590 115,01 0.590 115,01 0.590 115,01 21 5.2 TMS 9901 NL - 40 Pin Plastic Package plastic packages " 2.090 (53,1) MAX _I It. It. ~~~~~t::::::::::::::::::1 o .@ r, j 0.600 ± 0.010 (15,24 ± O'26)~ 0.020 (0,51) = M.N-. 10:0 t90"-"""OO; - ',""11 10.279 , ""."'''~ -SEATING PLANE-===- ~ T .0.457 ; 0.'''' --I/"" PIN SPACING 0.100 (2 54) T.P. ~ ~ ~0'200 ~ I '-'33 10.'" .'N ~ (5,08) MAX 0.125 (3,17) MIN 0.095 (2,42) (See Note) , 0.060 (1,52) NOM 0.055 (1,39) NOTE: Each pin centerline is located within 0.010 (2,54) of its true longitudinal position. ~ DIM 8 16 18 20 22 24 28 40 A ± 0.010 10,261 0.30017,621 0.30017,621 0.30017,621 0.300 17,621 0.400110,161 0.600 115,241 0.600 115,241 0.600110,241 B MAX 0.39019,91 0.870122,1) 0.920 123,41 1.070 127,21 1.100128,01 1.290132,81 1.440136,61 2.090 153,11 C NOM 0.25016,41 0.25016,4) 0.25016,41 0.26516,71 0.35018,91 0.550114,01 0.550114,01 0.550114,01 22 MP003 Printed in U.S.A.