8/16 BIT MULTI-CHIP MICROCOMPUTER DATA BOOK .HITACHI TABLE OF CONTENTS Quality and Reliability Commitment .............................................................. 3 Hitachi Microprocessor/Peripheral Cross Reference ............................................... 4 New Hitachi Microprocessor Numbering System .................................................. 5 HD6800, HD68AOO, HD68800 MPU (Micro Processing Unit) ................................................•............... 6 HD6802 MPU (Microprocessor with Clock and RAM) ................................................. 37 HD6809, HD68A09, HD68809 MPU (Micro Processing Unit) ............................................................... 48 HD6821 , HD68A21, HD68821 PIA (Peripheral Interface Adapter) ........................................................... 77 HD6840, HD68A40, HD68840 PTM (Programmable Timer Module) ......................................................... 97 HD6843S, HD68A43S FDC (Floppy Disk Controller) .............................................................. 110 H 06844, H D68A44 DMAC (Direct Memory Access Controller) .................................................. 143 H D6845S, H D68A45S, H D68845S CRTC (CRT Controller) .................................................................... 160 HD6846 COM80 (Combination ROM 110 Timer) .................................................... 190 HD6850, HD68A50 ACIA (Asynchronous Communication Interface Adapter) .................................... 211 HD6852, HD68A52 SSDA (Synchronous Serial Data Adapter) ................................................... 211 HD46508, HD46508-1 ADU (Analog Data Acquisition Unit)-Preliminary ........................................... 234 HD68000 MPU (Micro Processing Unit)-Preliminary . ................................................. 253 APPENDiX ...................................................................................... . Package Information ........................................................................... 296 HMCS6800 Family Instructions ............................. " ................. , ................ 298 Memories ..................................................................................... 303 Linear IC & Interface Circuits .................................................................. 306 TTL HD74/HD74S/HD74LS Series ............... '" ........................... , ................ 308 Quality and Reliability An Unprecedented Commitment to Quality and Reliability . . . As quality and reliability become increasingly important concerns, Hitachi continues to improve its efforts to provide the best possible product. The experience gained in shipping millions of microprocessors and peripheral LSls for critical and demanding automotive and industrial applications is reflected in every product we sell. Each unit shipped receives 100% dynamic high-temperature burn-in, a quality assurance effort unparalleled in the semiconductor industry, and another reason why Hitachi is the Symbol of Semiconductor Quality, Worldwide. QUALITY ASSURANCE FLOW FOR ASSEMBLY AND TEST (all microprocessor and microcomputer products): PROCESS INSPECTION LEVEL QC CRITERIA REMARKS 1 Dicing - - - 2 Chip Visual 100% Visual 100x 3 Lot Acceptance AOL=0.25%* Visual 100x 4 Die Attachment - - Au-Si 5 Patrol Inspection OncelDay/Machine Visual - 6 Wire Bonding - - AI Ultrasonic 7 Patrol Inspection OncelDay/Machine Visual Once/Week/Machine Bond Dimension Bond Strength 8 Visual Inspection 100% Visual 20x 9 Lot Acceptance AOL=0.25%* Visual 20x 10 Seal - - A-Sn Alloy '11 Temperature Cycle 100% - -55°C -25°C ·150°C 10 Cycles 12 Hermeticity 100% Fine and Gross Hermetic Packages Only 13 Plating - - Tin (Sn) 14 Lead Trim - - - 15 Visual Inspection 100% Visual 16 Lot Acceptance AOL=0.25% Visual 17 Burn-in 100% - Dynamic Ta = 125°C 18 Electrical Test 100% DC, AC, Functional Ta =70°C 19 Marking - - 20 Electrical 100% DC 21 Visual Inspection 100% External Visual 22 Lot Acceptance AOL=0.25%* Electrical AOL=0.65% External Visual *Combined DC, AC and functional. 3 HITACHI MICROPROCESSOR/PERIPHERAL CROSS REFERENCE Hitachi is in the process of converting many micro- 1) marked with the "old" Hitachi part number ... processor part numbers to "industry standard" or generic part numbers. A complete list showing both the "old" and "new" part numbers is shown in 2) marked with a dual number ("old" and "new") figure 1. The use of industry standard part numbers At the completion of the conversion (approximately will greatly simplify the interface between Hitachi JANUARY 1, 1982) all product will be shipped with and our customers. the dual marking (2 above). Beginning JULY 1, 1981, all orders should be If this conversion plan poses problems, or you have entered using the "new" part numbers only. any questions, please contact Hitachi Microproces- Note that during the conversion process, product sor Marketing. shipped by Hitachi will be marked 1 of 2 ways (see figure 2). "old" "new" Description HITACHI HITACHI MOTOROLA number number number 16/32 bit microprocessing unit, 8 mhz ............. ------ HD68000-8 MC68000L 16/32 bit microprocessing unit, 6 mhz ............. ------ HD68000-6 MC68000L6 16/32 bit microprocessing unit, 4 mhz ............. ----- HD68000-4 MC68000L4 8/16 bit microprocessing unit, 1mhz ............... HD6809P HD6809P MC6809P 8/16 bit microprocessing unit, 1.5mhz ............. HD68A09P HD68A09P MC68A09P 8/16 bit microprocessing unit, 2mhz ............... HD68B09P HD68B09P MC68B09P 8 bit microprocessing unit, 1mhz .................. HD46800DP HD6800P MC6800P 8 bit microprocessing unit, 1.5mhz ................ HD468AOOP HD68AOOP MC68AOOP 8 bit microprocessing unit, 2mhz .................. HD468BOOP HD68BOOP MC68BOOP 8 bit microprocessing unit, 1mhz .................. HD46802SP HD6802SP MC6802P with clock and 128 bytes RAM 8 bit microprocessing unit, 1mhz .................. ------ HD6802WP ------ with clock and 256 bytes RAM 128 x 8 static RAM, 450ns access time ............. HM46810P HD6810P MC6810P 128 x 8 static RAM, 360ns access time ............. HM468A10P HD68A10P MC68A10P Peripheral interface adapter, 1mhz ................ HD46821P HD6821P MC6821P Peripheral interface adapter, 1.5mhz ............... HD468A21P HD68A21P MC68A21P Peripheral interface adapter, 2mhz ................ HD468B21P HD68B21P MC68B21P Programmable timer module, 1mhz ................ ------ HD6840P MC6840P Programmable timer module, 1.5mhz .............. ------ HD68A40P MC68A40P Programmable timer module, 2mhz ................ ------ HD68B40P MC68B40P Floppy disk controller, 1mhz ...................... HD46503SP HD6843SP MC6843P Floppy disk controller, 1.5mhz .................... HD46503SP-1 HD68A43SP MC68A43P 8 bit DMA controller, 1mhz ........................ HD46504RP HD6844P MC6844P 8 bit DMA controller, 1.5mhz ...................... HD46504RP-1 HD68A44P MC68A44P 8 bit DMA controller, 2mhz ........................ HD46504RP-2 HD68B44P MC68B44P CRT controller, 1mhz ............................. HD46505RP HD6845RP MC6845P CRT controller, 1.5mhz ........................... HD46505RP-1 HD68A45RP MC68A45P CRT controller, 2mhz ............................. HD46505RP-2 HD68B45RP MC68B45P CRT controller (enhanced), 1 mhz ................. HD46505SP HD6845SP ------ CRT controller (enhanced), 1.5mhz ................ HD46505SP-1 H068A45SP ------ CRT controller (enhanced), 2mhz ................. HD46505SP-2 HD68B45SP ------ ROM, I/O, Timer combo, 1mhz .................... ------ HD6846P MC6846P Asynchronous comm interface, 1mhz ........... : .. HD46850P HD6850P MC6850P Asynchronous comm interface, 1.5mhz ............ HD468A50P HD68A50P MC68A50P Synchronous comm interface, 1mhz ............... HD46852P HD6852P MC6852P Synchronous comm interface, 1.5mhz ............. HD468A52P HD68A52P MC68A52P Analog data acquisition unit, 1mhz ................ HD46508P HD46508P ------ Analog data acquisition unit, 1.5mhz .............. HD46508P-1 HD46508P-1 ------ Analog data acquisition unit, 1mhz (enhanced) ..... HD46508PA HD46508PA ------ Analog data acquisition unit, 1.5mhz (enhanced) ... HD46508PA-1 HD46508PA-1 ------ Figure 1. Hitachi Microprocessor/Peripheral Cross Reference 4 NEW HITACHI MICROPROCESSOR NUMBERING SYSTEM (a) Present marking ~ []JDB BD~BBDBSB (]~B~ISI (b) New marking ~ []JDB BD~BBDBSB (]~B~ISI BDB8~BSB Figure 2. 5 HDSBOO, HDSBAOO, HDSBBOO---- MPU (Micro Processing Unit) The HD6800 is a monolithic 8-bit microprocessor forming the central control function for Hitachi's HMCS6800 family. Compatible with TTL, the HD6800 as with all HMCS6800 system parts, requires only one 5V power supply, and no ex- ternal TTL devices for bus interface. The HD68AOO and HD68BOO are high speed versions. The HD6800 is capable of addressing 65K bytes of mem- ory with its 16-bit address lines. The 8-bit data bus is bi-direc- tional as well as 3-state, making direct memory addressing and multiprocessing applications realizable. • FEATURES • Versatile 72 Instruction - Variable Length (1-3 Byte) • Seven Addressing Modes - Direct, Relative, Immediate, Indexed, Extended, Implied and Accumulator HD6800P, HD68AOOP, HD68BOOP • Variable Length Stack • Vectored Restart • Maskable Interrupt • Separate Non-Maskable Interrupt - Internal Registers Saved in Stack • Six Internal Registers - Two Accumulators, Index Register, Program Counter, Stack Pointer and Condition Code Register • Direct Memory Accessing (DMA) and Multiple Processor Capability • Clock Rates as High as 2.0 MHz (HD6800 1 MHz, HD68AOO ... 1.5 MHz, HD68BOO ... 2.0 MHz) (DP-40) • Halt and Single Instruction Execution Capability • Compatible with MC6800, MC68AOO and MC68BOO • PIN ARRANGEMENT • BLOCK DIAGRAM RES TSC NC 1>2 DBE NC R/W D. D, D, D, D, DBE 36 SA 7 D, VMA 5 Au Am 34 A" A" (Top View) 26 27 28 29 30 31 32 33 0.1 O. 01 04 OJ O2 0l Do 6 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - - • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3 - +7.0 V Input Voltage V in * -0.3 - +7.0 V Operating Temperature Topr - 20 - + 75 °c Storage Temperature T stg - 55 - +150 °c * With respect to Vss (SYSTEM GNO) (NOTE) Permanent LSI damage may occur if maximum rating are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. • RECOMMENDED OPERATING CONDITION Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V V ,L * -0.3 - 0.8 V Input Voltage V ,H * 2.0 - Vee V Operating Temperature Topr -20 25 75 °c * With respect to Vss (SYSTEM GNO) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vee = 5V ± 5%, Vss = OV, Ta = -20-+75°C, unless otherwise noted.) Item Symbol Test Condition min typ* max Unit Input "High" Voltage Logic** V ,H Vss + 2.0 - Vee V Input "Low" Voltage Logic** V ,L Vss - 0.3 - Vss + 0.8 V Clock Input "High" Voltage ¢1, ¢2 V ,He V ce - 0.6 - Vee + 0.3 V Clock Input "Low" Voltage ¢1, ¢2 V,Le Vss - 0.3 - Vss + 0.4 V 0 0 -0 7 IOH = -205pA Vss + 2.4 - - V A o-A 15 , R/W Output "High" Voltage V OH IOH = -145pA Vss + 2.4 - - V VMA BA IOH = -100pA Vss + 2.4 - - V Qutput"Low" Voltage VOL IOL = 1.6mA - - Vss + 0.4 V Logic*** V in = 0-5.25V, - 1.0 2.5 pA Input Leakage Current lin All other pins are connected ¢1,¢2 to GND - - 100 pA Three-State (Off-state) 0 0 -0 7 - 2.0 10 pA I TS1 V in = 0.4 - 2.4V Input Current A o-A 15 , R/W - - 100 pA Power Dissipation Po - 0.5 1.0 W Logic*** - 6.5 10 pF 0 0 -0 7 Vin = OV, Ta = 25°C, - 10 12.5 pF Input Capacitance Cin ¢1 f = 1 MHz - 25 35 pF ¢2 - 45 70 pF v Output Capacitance A o-A 15 , R/W V in = OV, Ta = 25 C, Cout - - 12 pF VMA BA f = 1 MHz * Ta = 25°C, Vee = 5V ** All inputs except 4>1 and 1/>2 *** All inputs except 4>1 ,1/>2 and 0 0-0 7 7 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - - •. AC CHARACTERISTICS 1. TIMING CHARACTERISTICS OF CLOCK PULSE CPI and cpz Test HD6800 HD68AOO HD68800 Item Symbol Unit Condition min typ max min typ max min typ max Frequency of Operation f 0.1 - 1.0 0.1 - 1.5 0.1 -- 2.0 MHz Cycle Time tcyC Fig.10 1.000 - 10 0.666 - 10 0.500 - 10 /J.s - Clock Pulse Width I CPI, cpz PWCH1. PWCH 2 Fig. 10 400 - 4,500 230 - 4,500 180 -- 4,500 ns I Rise and Fall Times CPI, cpz t r , tf Fig. 10 - - 100 - - 100 - - 100 ns Delay Time (Clock Internal) tct Fig. 10 - - 4,500 - - 4,500 - - 4,500 ns Clock "High" Level Time tUT Fig. 10 900 - - 600 - - 440 - - ns 2 READ/WRITE CHARACTERISTICS Test HD6800 HD68AOO HD68BOO Item Symbol Unit Condition min typ max min typ max min typ max Fig.11, ns C=90pF tA01 - - 270 - - 180 - - 150 Address Delay Fig. 12 Time Fig. 11, C=30pF tAo2 Fig. 12 - - 250 - - 165 - - 135 ns Data Setup Time (Read) tOSR Fig. 11 100 - - 60 - - 40 - - ns Peripheral Read Access Time tacc Fig. 11 - - 530 - - 360 - - 250 ns tacc = tUT - (tAD + tOSR ) Input Data Hold Time tH Fig. 11 10 - - 10 - - 10 - - ns Output Data Hold Time tH Fig. 12 20 - - 20 - - 20 - - ns Address Hold Time Fig. 11, (Address, R/W, VMA) tAH Fig. 12 10 - - 10 - - 10 - - ns Enable "High" Time for DBE Input tEH Fig. 12 450 - - 280 - - 220 - - ns Data Delay Time (Write) toow Fig. 12 - - 225 - - 200 - - 160 ns Data Bus Enable Down Time tOBE Fig. 12 150 - - 120 - - 75 - - ns (During CPI Up Time) Data Bus Enable Delay Time tOBEO Fig. 12 300 - - 250 - - 180 - - ns Data Bus Enable tOBEr Rise and Fall Times Fig. 12 - - 25 - - 25 - - 25 ns tOBEf Processor Control Setup Time tpcs 200 - - 140 - - 110 - - ns Processor Control tpcr Rise and Fall Times tpCf - - 100 - - 100 - - 100 ns Bus Available Delay Time (BA) tBA - - 250 - - 165 - - 135 ns Three-State Delay Time tTso - - 270 - - 270 - - 220 ns 5.0V C = 130pF for 0 0 -0 7 = 90pF for Ao -AI s. R/W. and VMA Test Point o-.......--+--W-.... = 30pF for BA R= 11kn for 0 0 -0 7 c = 16kn for Ao-A ls ' R/W and VMA = 24kn for BA C includes Stray Capacitance. All diodes are 152074<9. Figure 1 Bus Timing Test Load D HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - - The Last Instruction Cycle '" BA Figure 2 Timing of HALT and BA Halt Cycle I nstruction Cycle ·1- ct>1 BA O.4V Figure 3 Timing of HALT and BA MPU Reset -I- MPU Restart Sequence \'---__1VCC -06V\'---_---'r Vee - O.6V RES 2.4V VMA Figure 4 RES and MPU Restart Sequence HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - - WAIT Cycle or The Last Instruction Cycle Interrupt Sequence \"---_--.-11 \'-_---Jr VCC-O.6V (When WAIT Cycle) BA Figure 5 IRQ and NMI Interrupt Timing .. . The last execution cycle of WAI instruction (#9) ...I WAIT Cycle I \'-__§;:C~.6VL _tpcr BA Figure 6 WAI Instruction and BA Timing PWCHt (4.5Ils max) Figure 7 TSC Input and MPU Output HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - • MPU REGISTERS Address Bus Address Bus The MPU provides several registers in Fig. 8, which is avail- (H) A~ -A '5 (Ll Ao -A~ able for use by the programmer. Each register is described below. • Program Counter (PC) The program counter is a two byte (16-bit) register that points to the current program address. Temporary Register • Stack Pointer (SP) StackPomter{LJ The stack pointer is a two byte register that contains the Stack Pointer (HI address of the next available location in an external push-down/ pop-up stack. This stack is normally a random access Read/ Incrementer (H) Write memory that may have any location (address) that is con- Program Counter (Hl venient. In those applications that require storage of informa- Incrementer(U tion in the stack when power is lost, the stack must be non- Program Counter (Ll volatile. Index Register (H) • Index Register (IX) The index register is a two byte register that is used to store Index Register (L1 data or a sixteen bit memory address for the Indexed mode of memory addressing. • Accumulators (ACCA, ACCB) The MPU contains two 8-bit accumulators that are used to hold operands and results from an arithmetic logic unit (ALV). Data Bus 0,,-0, 7 0 I ACCA I Accumulator A Figure 9 Internal Block Diagram of MPU 7 0 I ACCB IAccumulator B • MPU SIGNAL DESCRIPTION Proper operations of the MPU requires that certain control 15 0 and timing signals (Fig. 9) be provided to accomplish specific I 15 IX 0 I Index Register functions. The functions of pins are explained in this section. • Clock (2 2) I Two pins are used to provide the clock signals. A two-phase I 15 PC 0 I Program Counter non-{)veriapping clock is provided as shown in Fig. 10. .......------tcyc------~ I SP I Stack Pointer ri>l - Carry (From Bit 7) Overflow VIHC Zero Negative ri>2 VI LC -------.J( vav V IHC = vcc - O.6V (min.) VILC = Vss+O.4V (max.) Interrupt Mask Vav = Vss + O.6V ' - - - - - - Half Carry (From Bit 3) Figure 10 Clock Timing Waveform Figure 8 Programming Model of the Microprocessing Unit • Address Bus (Ao "'A 1 5 ) Sixteen pins are used for the address bus. The outputs are • Condition Code Register (CCR) three-state bus drivers capable of driving one standard TTL load The condition code register indicates the results of an Arith- and 90pF. When the output is turned off, it is essentially an- metic Logic Unit operation: Negative (N), Zero (Z), Overflow open circuit. This permits the MPU to be used in DMA applica- (V), Carry from bit 7 (C), and half carry from bit 3(H). These tions. Putting TSC in its high state forces the Address bus to go bits of the Condition Code Register are used as testable condi- into the three-state mode . tions for the conditional branch instructions. Bit 4 is the • Data Bus (0 0 "'0 7 ) interrupt mask bit (I). The unused bits of the Condition Code Eight pins are used for the data bus. It is bidirectional, Register (b6 and b7) are "1". The detail block diagram of the transferring data to and from the memory and peripheral microprossing unit is shown in Fig. 9. devices. It also has three-state output buffers capable of driving one standard TTL load and 130pF. Data Bus is placed in the three-state mode when DBE is "Low." 11 HD6800, HD68AOO, HD68BOO ------------~ ~-----------------------tcyc------------------------~ CPI Address~~~~~~~~~~------------------------------------t1~~~ From MPU ---"'--------------tacc--------+- Data From Memory or 2.0V --::~I--~======~~ Peripherals -------------------------------O~.8~V~~~~~~~~ ~~ Indeterminate period Figure 11 Read from Memory or Peripherals Start of Cycle 1/>1 Address FromMPU~~~~~~~-~~r_--__----4_--------------------------11r__ 2.4V ---t:=~~-;;;.;j-------+--------------------"tt""""'~ Data From MPU -----I-I-------------I~~~-:-:=~~-'--,_~-----D-a-ta-V-a-li-d---~_-~~ ~tD~::r ~"03 Indeterminate period Figure 12 Write to Memory of Peripherals 12 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - • Data Bus Enable (DBE) Write ("Low") state. The normal standby state of this signal is This input is the three-state control signal for the MPU data Read ("High"). Three-State Control going "High" will turn R/W bus and will enable the bus drivers when in the "High" state;will to the off (high impedance) state. Also, when the processor is make the bus driver off when in the "Low" state. This input is halted, it will be in the off state. This output is capable of TTL compatible; however in normal operation, it would be driving one standard TTL load and 90pF. driven by 2 cycles. The RES pulse can be completely IRQ is maskable by the interrupt mask in the Condition Code asynchronous with the MPU system clock and will be recog- Register while NMI is not maskable. The handling of these inter- nized during ct>2 if setu~e tPCS is met . rupts by the MPU is the same except that each has its own • Interrupt Request (IRQ) vector address. The behavior of the MPU when interrupted is This level sensitive input requests that an interrupt sequence shown in Fig. 14 which details the MPU response to an interrupt be generated within the machine. The processor will wait until while the MPU is executing the control program. The interrupt it completes the current instruction that is being executed shown could be either lRQ or NMI and can be asynchronous before it recognizes the request. If the interrupt mask bit in the with respect to ct>2. The interrupt is shown going "Low" at Condition Code Register is not set, the machine will begin an time tpcs in cycle #1 which precedes the first cycle of an in- interrupt sequence. The Index Register, Program Counter, struction (OP code fetch). This instruction is not executed but Accumulators, and Condition Code Register are stored away on instead the Program Counter (PC), Index Register (IX), the stack. Accumulators (ACCX), and the Condition Code Register (CCR) Next the MPU will respond to the interrupt request by are pushed onto the stack. setting the interrupt mask bit "1" so that no further inter- The Interrupt Mask bit is set to prevent further interrupts. rupts may occur. At the end of the cycle, a 16-bit address will The address of the interrupt service routine is then fetched from be loaded that points to a vectoring address which is located in FFFC, FFFD for an NMI interrupt and from FFF8, FFF9 for memory locations FFF8 and FFF9. An address loaded at these an IRa interrupt. Upon completion of the interrupt service locations causes the MPU to branch to an interrupt routine in routine, the execution of RTI will pull the PC, IX, ACCX, and memory. Interrupt timing is shown in Fig. 14. CCR off of the stack; the Interrupt Mask bit is restored to its The HALT line must be in the "High" state for interrupts condition prior to interrupts. Fig. 15 is a similar interrupt se- to be serviced. Interrupts will be latched internally while HALT quence, except in this case, a WAIT instruction has been ex- is "Low". The IRQ has a high impedance pullup device internal ecuted in preparation for the interrupt. This technique speeds to the chip; however a 3kn external resistor to Vee should be up the MPU's response to the interrupt because the stacking of used for wire-OR and optimum control of interrupts. I #1 I #2 I #3 I #4 I #5 I #6 I #7 I #8 I #9 I #10 I #11 I #12 I #13 I #14 I #15 I Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Cycle Address Bus IRQ or NMI 1M Data Bus Inst (x) PCO-PC7 PC8- IXO-IX7 IX8- ACCA ACCB CCR New PCB-PCIS New PCO-PC7 First Inst of R/W \~ ____________________________________JI PC15 IX15 Address Address Interrupt Routine .VMA Figure 14 Interrupt Timing #4 I Cycle Cycle CYCle) Cycle CYcle) Cycle ICycle Cyclel Cycle I #1 I #2 #3 I #5 #6 #7 #8 #9 I I Wait Cycl e ICYCle) Cycle ICYcie I Cycle ICycle ICyclel # n #n+1 #n+2 #n+3 #n+4 #n+5 Cycle (NOTE) Cycle Address Bus Jl #1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 I n In+1 n+2 n+3 7.. n+4 #n+5 X Instruction SPlnl SPin-II SPln-21 SPln-31 SPln-41 SPin-51 SPln-SI _ _ FFF8-FFF9- New PC R/W Address VMA I First Inst. 1M ot Interrupt fRO or Routine NMI Data " - I I--tpcs (2oons) .r X X X , X X A. X X A. lI. X Bus New PCB-PCI 5 New pca-pc Wait PCO-PC7 P~~~5IXO-IX7 1~~;5 ACCA ACCB CCR f Address Address Inst 1>3~~g~~ (NOTE) Midrange waveform indicates high impedance state. Figure 15 WAI Instruction Timing 14 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - the PC, IX, ACCX, and the CCR is already done. • Valid Memory Address (VMA) While the MPU is waiting for the interrupt, Bus Available will This output indicates to peripheral devices that there is a go "High" indicating the following states of the control lines: valid address on the address bus. In normal operation, this signal VMA is "Low", and the Address Bus, R/W and Data Bus are all should be utilized for enabling peripheral interfaces such as the in the high impedance state. After the interrupt occurs, it is PIA and ACIA. This signal is not three-state. One standard TTL serviced as previously described. load and 90pF may be directly driven by this active "High" signal. Table 1 Memory Map for Interrupt Vectors • Halt (HALT) Vector When this input is in the "Low" state, all activity in the Description machine will be halted. This input is level sensitive. MS LS The HALT line provides an input to the MPU to allow con- FFFE FFFF Restart trol or program execution by an outside source. If HALT is FFFC FFFD Non·maskable Interrupt "High", the MPU will execute the instructions; if it is "Low", the MPU will go to a halted or idle mode. A response signal, FFFA FFFB Software Interrupt Bus Available (BA) provides an indication of the current MPU FFF8 FFF9 Interrupt Request status. When BA is "Low", the MPU is in the process of execut- Refer to Figure 18 for program flow for Interrupts. ing the control program; if BA is "High", the MPU has halted and all internal activity has stopped. • Three State Control (TSC) When BA is "High", the Address Bus, Data Bus, and R/W line When the Three State Control (TSC) line is "High" level, the will be in a high impedance state, effectively removing the Address Bus and the R/W line are placed in a high impedance MPU from the system bus. VMA is forced "Low" so that the State. VMA and BA are forced "Low" when TSC = "High" to floating system bus will not activate any device on the bus that prevent false reads or writes on any device enabled by VMA. is enabled by VMA. It is necessary to delay program execution while TSC is held While the MPU is halted, all program activity is stopped, and "High". This is done by insuring that no transitions of ¢l (or if either an NMI or IRQ interrupt occurs, it will be latched into ¢2) occur during this period. (Logic levels of the clocks are the MPU and acted on as soon as the MPU is taken out of the irrelevant so long as they do not change.) halted mode. If a RES command occurs while the MPU is Since the MPU is a dynamic device, the ¢I clock can be halted, the following states occur: VMA = "Low", BA = "Low", stopped for a maximum time PWCH1 without destroying data Data Bus = high impedance, R/W = "High" (read state), and within the MPU. TSC then can be used in a short Direct Me- the Address Bus will contain address FFFE as long as RES is mory Access (DMA) application. "Low". As soon as the HALT line goes "High", the MPU will Fig. 16 shows the effect of TSC on the MPU. The Address go to locations FFFE and FFFF for the address of the reset Bus and R/W line will reach the high impedance state at tTS D routine. (three-state delay), with VMA being forced "Low". In this Fig. 18 shows the timing relationships involved when halting example, the Data Bus is also in the high impedance state while the MPU. The instruction illustrated is a one byte, 2 cycle in- ¢2 is being held "Low" since DBE=¢2' At this point in time, a struction such as CLRA. When HALT goes "Low", the MPU DMA transfer could occur on cycles #3 and #4. When TSC is will halt after completing execution of the current instruction. returned "Low," the MPU address and R/W lines return to the The transition of HALT must occur tpcs before the trailing edge bus. Because it is too late in cycle #5 to access memory, this of ¢l of the last cycle of an instruction (point A of Fig. 18). cycle is dead and used for synchronization. Program execution HALT must not go "Low" any time later than the minimum resumes in cycle #6. tpcs specified. Cycle #1 #2 I #3 #4 #5 I #6 System CPl MPUCPl Address Bus R/W VMA Data Bus CPz DBE TSC Figure 16 TSC Control Timing 15 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - >---y-. IRQ Ignored #1 ~ 2 #3- 9 y (FFFC) Fetch IM=1 #11 Reset ( ~RMd~ #10 (FFF8) Fetch #11 IM=1 Reset (~R~~ #12 JUMP FFFC/O #13 #13 Figure 17 MPU Interrupt Flow Chart 16 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Fetch II jl nstruction nstruction ... ,t Execution j , ~ t,indicating The coding of the first (or only) byte corresponding to an that the Address Bus, Data Bus, VMA and R/W lines are back executable instruction is sufficient to identify the instruction on the bus. A single byte, 2 cycle instruction such as LSR is and the addressing mode. The hexadecimal equivalents of the used for this example also. During the first cycle, the instruction binary codes, which result from the translation of the 72 in- Y is fetched from address M+ 1. BA returns "High" at tBA on structions in all valid modes of addressing, are shown in Table 3. the last cycle of the instruction indicating the MPU is off the There are 197 valid machine codes, 59 of the 256 possible codes bus, if instruction Y had been three cycles, the width of the BA being unassigned. "Low" time would have been increased by one cycle. When an instruction translates into two or three bytes of Table 2 shows the relation between the state of MPU and code, the second byte, or second and third bytes contain(s) an signal outputs. operand, an address, or information from which an address is obtained during execution. 17 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Microprocessor instructions are often devided into three memory locations. In addition, the HD6800 MPU allow the general classifications; (1) memory reference, so called because MPU to treat peripheral devices exactly like other memory they operate on specific memory locations; (2) operating in- locations, hence, no I/O instructions as such are required. Be- structions that function without needing a memory reference; cause of these features, other classifications are more suitable (3) I/O instructions for transferring data between the micro- for introducing the HD6800's instruction set: (1) Accumu- pr.ocessor and peripheral devices. lator and memory operations; (2) Program control operations; In many instances, the HD6800 MPU performs the same (3) Condition Code Register operations. operation on both its internal accumulators and the external For Accumulator and Memory Operations, refer to Table 4. Table 3 Hexadecimal Values of Machine Codes ~MSB 0 1 2 3 4 5 6 7 8 9 A B C 0 E F 0 . NOP (IMP) · · . · TAP (IMP) TPA (IMP) INX (IMP) OEX (IMP) CLV (IMP) SEV (IMP) CLC (IMP) SEC (IMP) CLI (IMP) SEI (IMP) 1 SBA (A,B) CBA (A, B) · · . · TAB (IMP) TBA (IMP) . OAA (IMP) . ABA (IMP) . . · · 2 BRA (REL) TSX · INS BHI (REL) PUL BLS (REL) PUL BCC (REL) DES BCS (REL) TXS BNE (REL) PSH BEO (REL) PSH BVC (REL) . BVS (REL) RTS BPL (REL) . BMI (REL) RTI BGE (REL) . BLT (REL) . BGT (REL) WAI BLE (REL) SWI 3 (IMP) (IMP) (A) (A) (IMP) (B) (IMP) (IMP) (B) (IMP) (IMP) (IMP) 4 NEG (A) · · COM (A) LSR (A) · ROR (A) ASR (A) ASL (A) ROL (A) DEC (A) · INC (A) TST (A) · CLR (A) 5 NEG (B) · · COM (B) LSR (B) · ROR (B) ASR (B) ASL (B) ROL (B) DEC (B) · INC (B) TST (B) · CLR (B) 6 NEG (lNO) · · COM (lNO) LSR (lNO) · ROR (lNO) ASR (lNO) ASL (lNO) ROL (lNO) DEC (lNO) · INC (lNO) TST (lNO) 'JMP (lNO) CLR (lNO) 7 NEG (EXT) · · COM (EXT) LSR (EXT) · ROR (EXT) ASR (EXT) ASL (EXT) ROL (EXT) DEC (EXT) · INC (EXT) TST (EXT) JMP (EXT) CLR (EXT) 8 ~I~M)(A) (lMM)(A) ~I~CM)(A) CMP * ~~~iA) ~~MiA) ~~~)(A) . EOR (A) (lMM) ~~~)(A) ~:~)(A) ~~~)(A) ~~XM)(A) (REL) BSR LOS (lMM) · ~~I~)(A) CMP ~~I~)(A) ~O~~)(A) (OIR) (A) (OIR) ~~~)(A) ORA ~O~~)(A) CPX (A) BIT LOA (A) STA (A) EOR (A) (A) (A) LOS STS 9 (OIR) * * (OIR) (OIR) (OIR) (OIR) (OIR) (OIR) ~~~)(A) CMP · 'STA EOR (A) AOC ' ~~~)(A) ~~~)(A) ~~~)(A) CPX (A) JSR (A) SBC (A) AND (A) BIT (A) LOS STS A (lNO)(A) (lNO) (lNO)(A) (lNO) (lNO) (lNO) (lNO) (lNO) (lNO) (lNO) (lNO) B f~:T)(A) CMP A SBC · ~~)(A) ~~~TiA) ~~XAT)(A) ~;:'n(A) (EXTi ) (EXT)(A) EOR (A) (EXT) ~~~)(A) ~E~~iA) ~~)(A) ~::T)(A) (EXT) JSR LOS (EXT) STS (EXT) ~~~"B) ~I~CM)(B) · ~~~)(B) ~~M)(B) ~~~)(B) . · SUB ~~~)(B) ~:~)(B) ~~~)(B) EOR (B) LOX C (lMM)(B) * * (lMM) (lMM) 0 f~I~)(B) f~~)(B) ~~~)(B) * AND (B) (OIR) ~~~R)(B) (OIR) LOA (B) ~~~)(B) EOR (OIR) (B) ~~)(B) ~O~~)(B) ~~~)(B) * * ~~~)(B) ~~I~)(B) E ~I~~)(B) ~~~)(B) ~I~~)(B) · ~~~)(B) ~~O)(B) ~~~)(B) ~I~AO)(B) EOR (B) (lNO) ~~~)(B) ~~~)(B) ~~~)(B) * * LOX (lNO) STX (lNO) f~:T)(B) fEM:T)(B) ~:;T)(B) ~E~~)(B) ~~~TiB) ~~X~)(B) ~;:TiB) ~~XRT)(B) ~~~)(B) ~E~~)(B) ~EOX~)(B) LOX STX F * * * (EXT) (EXT) OIR • Direct Addressing Mode INO = Index Addressing Mode A - Accumulator A EXT = Extended Addressing Mode IMP = Implied Addressing Mode B = Accumulator B IMM= Immediate Addressing Mode REL= Relative Addressing Mode 18 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - - Table 4 Accumulator and Memory Operations Addressing Modes Condo Code Reg. Booleanl Operation Mnemonic IMMED DIRECT INDEX EXTND IMPLIED 5 4 3 2 1 0 Arithmetic Operation OP - # OP- # OP - # OP- # OP - # H I N Z V C Add ADDA AD DB 8B CB 2 2 2 2 9B DB 3 3 2 2 AB 5 EB 5 2 2 BB FB 4 4 3 3 A+M-+A B+M-+B t t t t t t ··· t t t t · Add Acmltrs ABA lB 2 1 A+B-+A t t t t t ·· ··· ·· Add with Carry ADCA 89 2 2 99 3 2 A9 5 2 B9 4 3 A+M+C-+A t t t t t ADCB C9 2 2 09 3 2 E9 5 2 F9 4 3 B+M+C-+B t t t t t And ANDA 84 2 2 94 3 2 A4 5 2 B4 4 3 A'M-+A t R t ·· ·· ·· ANDB C4 2 2 04 3 2 E4 5 2 F4 4 3 B'M-+B t R t Bit Test BITA 85 2 2 95 3 2 A5 5 2 B5 4 3 A·M t R t ····· ····· BITB C5 2 2 05 3 2 E5 5 2 F5 4 3 B·M t R t Clear CLR 6F 7 2 7F 6 3 00-+ M R S R R CLRA 4F 2 1 00-+ A R S R R CLRB 5F 2 1 00-+ B R S R R Compare CMPA 81 2 2 91 3 2 Al 5 2 Bl 4 3 A-M t t t t ·· ·· CMPB Cl 2 2 01 3 2 El 5 2 Fl 4 3 B-M t t t t Compare Acmltrs CBA 11 2 1 A-B t t t t ··· ·· Complement,l's COM 63 7 2 73 6 3 M-+ M t t R S COMA 43 2 1 A-+A t t R S ·· ··· COMB 53 2 1 B"-+B t t R S Complement,2's NEG 60 7 2 70 6 3 OO-M-+M t t CD® (Negate) NEGA 40 2 1 OO-A-+A t t CD® CD® ·· ·· NEGB 50 2 1 OO-B-+B t t Decimal Adjust, A DAA 19 2 1 Converts Binary Add of BCD t t t @ Characters into BCD Format @ • ··· ··· · Decrement DEC 6A 7 2 7A 6 3 M-l-+M t t DECA 4A 2 1 A-l-+A t t @ • DECB 5A 2 1 B-l-+B t t @ • ··· ··· ··· Exclusive OR EORA 88 2 2 98 3 2 A8 5 2 B8 4 3 A(!)M-+A t t R EORB C8 2 2 D8 3 2 E8 5 2 F8 4 3 B$M-+B t t R Increment INC 6C 7 2 7C 6 3 M+l-+M t t @ ··· ··· ··· INCA 4C 2 1 A+l-+A t t @ INCB 5C 2 1 B+l-+B t t @ Load Acmltr LDAA 86 2 2 96 3 2 A6 5 2 B6 4 3 M-+A t t R ·· ·· ·· LDAB C6 2 2 06 3 2 E6 5 2 F6 4 3 M-+B t t R Or, Inclusive ORAA 8A 2 2 9A 3 2 AA 5 2 BA 4 3 A+M-+A t t R ······ ORAB CA 2 2 DA 3 2 EA 5 2 FA 4 3 B+M-+B t t R ···· ···· ··· ··· ··· ··· Push Data PSHA 36 4 1 A -+ Msp, SP - 1 -+ SP PSHB 37 4 1 B -+ Msp, SP - 1 -+ SP Pull Data PULA 32 4 1 SP + 1 -+ SP, Msp -+ A PULB 33 4 1 SP + 1 -+ SP, Msp .... B ·· ·· tt ® t ~} LO-.m=m::l Rotate Left ROL 69 7 2 79 6 3 ROLA 49 2 1 tt ® t C b7 bO t t ® t ···· ··· ROLB 59 2 1 +- t t ® t ~} CCI .. CIID:I:[JJ:J Rotate Right ROR 66 7 2 76 6 3 RORA 46 2 1 t t ® t ·· ··· RORB 56 2 1 C b7 - bO t t ® t t t ® t ~} Shift Left, Arithmetic ASL 68 7 2 78 6 3 ASLA 48 2 1 mfum-o 0.- t t ® t bO ·· ·· ASLB 58 2 1 C b7 t t ® t t t ® t ~} C2DIw:D-o Shift Right, Arithmetic ASR 67 7 2 77 6 3 t t ® t ··· ··· ASRA 47 2 1 ASRB 57 2 1 b7 bO C t t ® t R t ® t ~} Shift Right, Logic LSR 64 7 2 74 6 3 ··· ··· ·· LSRA 44 2 1 O+CIIIIIIIJ-O R t ® t LSRB 54 2 1 b7 bO C R t @" t Store Acmltr STAA 97 4 2 A7 6 2 B7 5 3 A-+ M t t R ·· ·· STAB D7 4 2 E7 6 2 F7 5 3 B -+ M t t R Subtract SUBA 80 2 2 90 3 2 AO 5 2 BO 4 3 A-M .... A t t t t ·· ·· SUBB CO 2 2 DO 3 2 EO 5 2 FO 4 3 B-M-+B t t t t Subtract Acmltrs SBA 10 2 1 A-B-+A t t t t ··· ··· ·· Subtr with Carry SBCA 82 2 2 92 3 2 A2 5 2 B2 4 3 A-M-C-+A t t t t SBCB C2 2 2 D2 3 2 E2 5 2 F2 4 3 B-M-C-+B t t t t Transfer Acmltrs TAB 16 2 1 A-+B t t R ·· ··· TBA 17 2 1 B-+A t t R Test Zero or Minus TST 60 7 2 70 6 3 M-OO t t R R t R R · TSTA 40 2 1 A -00 t TSTB 50 2 1 B - 00 t t R R LEGEND: CONDITION CODE SYMBOLS: OP Operation Code (Hexadecimal) + Boolean Inclusive OR H Half-carry from bit 3 R Reset Always Number of MPU Cycles @ Boolean Exclusive OR I Interrupt mask S Set Always # Number of Program Bytes M Complement of M N Negative (sign bit) t Test and set if true, cleared otherwise + Arithmetic Plus Transfer Into Z Zero (byte) • Not Affected Arithmetic Minus OBit = Zero V Overflow, 2's complement Boolean AND 00 Byte = Zero C Carry from bit 7 Msp Contents of memory location pointed to be Stack Pointer (Note) Accumulator addressing mode instructions are included in the column for IMPLI ED addressing. CONDITION CODE REGISTER NOTES: (Bit set if test is true and cleared otherwise) CD (Bit V) Test: Result = 10000000? ® (Bit C) Test: Result l' OOOOOOOO? ® (Bit C) Test: Decimal value of most significant BCD Character greater than nine? (Not cleared if previously set.) @ (Bit V) Test: Operand = 10000000 prior to execution? ® (Bit V) Test: Operand = 01111111 prior to execution? ® (Bit V) Test: Set equal to result of N(±)C after shift has occurred. 19 HD8800, HD88AOO, HD88BOO - - - - - - - - - - - - - • PROGRAM CONTROL OPERATIONS this example) to be stored in memory at the location indicated Program Control operation can be subdivided into two cate- by the Stack Pointer. The Stack Pointer is automatically de- gories: (1) Index Register/Stack Pointer instructions: (2) Jump cremented by one following the storage operation and is "point- and Branch operations. ing" to the next empty stack location. • Index Register/Stack Pointer Operations The Pull instruction (pULA or PULB) causes the last byte The instructions for direct operation on the MPU's Index stacked to be loaded into the appropriate accumulator. The Register and Stack Pointer are summarized in Table 5. Decre- Stack Pointer is automatically incremented by one just prior to ment (DEX, DES), in(!rement (INX, INS), load (LOX, LOS), the data transfer so that it will point to the last byte stacked and store (STX, STS) instructions are provided for both. The rather than the next empty location. Note that the PULL Compare instruction, CPX; can be used to compare the Index instruction does not "remove" the data from memory; in the Register to a 16-bit value and update the Condition Code example, lA is still in location (m+l) following execution of Register accordingly. PULA. A subsequent PUSH instruction would overwrite than The TSX instruction causes the Index Register to be loaded location with the new "pushed" data. with the address of the last data byte put onto the "stack". Execution of the Branch to Subroutine (BSR) and Jump to The TXS instruction loads the Stack Pointer with a value equal Subroutine (JSR) instructions cause a return address to be to one less than the current contents of the Index Register. This save on the stack as shown in Figs. 21 through 23. The stack is causes the next byte to be pulled from the "stack" to come decremented after each byte of the return address is pushed from the location indicated by the Index Register. The utility of onto the stack. For both of the these instructions, the return these two instructions can be clarified by describing the "stack" address is the memory location following the bytes of code that concept relative to the HMCS 6800 system. correspond 'to the BSR and JSR instruction. The code required The "stack" can be thought of as a sequential list of data for BSR or JSR may be either two or three bytes, depending on stored in the MPU's read/write memory. The Stack Pointer whether the JSR is in the indexed (two bytes) or the extended contains a l6-bit memory address that is used to access the list (three bytes) addressing mode. Before it is stacked, the Program from one end on a last-in-first-out (LIFO) basis in contrast to Counter is automatically incremented the correct number of the random access mode used by the MPU's other addressing times to be pointing at the location of the next instruction. The modes. Return from Subroutine instruction, RTS, causes the return The H06800 MPU instruction set and interrupt structure address to be retrieved and loaded into the Program Counter as allow extensive use of the stack concept for efficient handling shown in Fig. 24. of data movement, subroutines and interrupts. The instructions There are several operations that cause the status of the MPU can be used to establish one or more "stacks" anywhere in read! to be saved on the stack. The Software Interrupt (SWI) and Wait write memory. Stack length is limited only by the amount of for Interrupt (YVAI) instructions as well as the maskable (IRQ) memory that is made available. and non-maskable (NMI) hardware interrupts all cause the Operation of the Stack Pointer with the Push and Pull in- MPU's internal registers (except for the Stack Pointer itself) to structions is illustrated in Figs. 19 and 20. The Push instruction be stacked as shown in Fig. 25. MPU status is restored by the (PSHA) causes the contents of the indicated accumulator (A in Return from interrupt, RTI, as shown in Fig. 26. Table 5 Index Register and Stack Pointer Instructions AddreSSing Modes Cond, Code 'Reg, IMMED DIRECT INDEX EXTND IMPLIED Booleanl Operation Mnemonic 5 4 3 2 1 0 Arithmetic Operation OP ~ # OP ~ # OP ~ # OP ~ # OP ~ # H I N Z V C Compare Index Reg CPX 8C 3 3 9C 4 2 AC 6 2 BC 5 3 (XH) - (M), (XL) - (M+1) • • CD t ® • Decrement Index Reg DEX 09 4 1 X-1-+X • • • t • • Decrement Stack Pntr DES 34 4 1 SP - 1 -+ SP • • • • • • Increment Index Reg INX 08 4 1 X + 1 .... X • • • t • • Increment Stack Pntr INS 31 4 1 SP + 1 -+ SP • • @• •t R• • Load Index Reg LDX CE 3 3 DE 4 2 EE 6 2 FE 5 3 M .... XH,(M+1) .... XL • • • Load Stack Pntr LDS 8E 3 3 9E 4 2 AE 6 2 BE 5 3 M .... SPH, (M+1) .... SPL • • @@ t RR • Store Index Reg STX DF 5 2 EF 7 2 FF 6 3 XH .... M, XL -+ (M + 1) • • t • Store Stack Pntr STS 9F 5 2 AF 7 2 BF 6 3 SP H .... M,SP L .... (M + 1) • • @ t R • Index Reg -+ Stack Pntr TXS 35 4 1 X-1 .... SP • • • • • • Stack Pntr -+ Index Reg TSX 30 4 1 SP + 1 .... X • • • • • • CD(Bit N) Test: Sign bit of most significant (MS) byte of result = 1? ® (Bit V) Test: 2's complement overflow from subtraction of ms bytes? @ (Bit N) Test: Result less than zero? (Bit 15 = 1) ?n HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - - MPU MPU ACCA ACCA m-2 m-2 m-l SP-m-l '" ::::I CD SP • m New Data m F3 19 co m+l 0 m+l 7F { 7F Pm;o",', { Previously Stacked m+2 63 Stacked m+2 63 Data Data m+3 FD m+3 FD PC----- PSHA Next Instr. PC---- Next Instr. (a) Before PSHA (b) After PSHA Figure 19 Stack Operation (Push Instruction) MPU MPU ACCA o ACCA - m-2 m-2 m-l m-l SP-m m m+l lA SP-m+l lA Previously Stacked m+2 3C Data m+2 3C { previo.usl Y m+3 D5 Stacked m+3 D5 Data { L----- EC - EC PC------ PC- (a) Before PU LA Figure 20 Stack Operation (Pull Instruction) HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - m-2 SP-m-2 m-1 m-1 '(n+2)H SP-m m (n+2)L m+1 7E m+1 7E PC-n -- 7A n -- BSR BSR n+1 ±K* = Offset n+1 ±K* = Offset n+2 Next Main I nstr. n+2 Next Main Instr. * K = Signed 7-Bit Value PC-(n+2) ±K (a) Before Execution (b) After Execution Figure 21 Program Flow for BSR r---- - ~- m-3 m-2 S P - m ...2 m-1 m-1 (n+3)H sp-m m (n+3)L m+1 7E m+1 7E m+2 7A m+2 7A -- 7D ~ 7C - ~- PC----n JSR = BD JSR n+1 SH = Subr. Addr. n+1 SH = Subr. Addr. n+2 SL = Subr. Addr. n+2 SL = Subr. Addr . nT~ . _ Eo'... • a.ll_:_ 1_ ........ "'~.,. "," Next iviain insir. PC---S 1st Subr. Instr. (S formed from SH and SL) (a) Before Execution (b) After Execution' Figure 22 Program Flow for JSR (Extended) 22 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - ~ m-2 SP-m-2 m-1 m-1 (n+2)H SP---m m (n+2)L 1-------1 m+1 7E m+1 7E 7A 7A ~ Pc-n JSR=AO JSR = AO 1-------1 n+1 K* = Offset n+1 K*= Offset n+2 Next Main Instr. n+2 Next Main Instr. *K = 8-Bit Unsigned Value PC-X** + K 1st Subr. Instr. * *Contents of I ndex Register (a) Before Execution (b) After Execution Figure 23 Program Flow for JSR (Indexed) SP-m-2 m-2 m-1 (n+3)H m-1 (n+3)H m (n+3)L SP-m (n+3)L m+1 7E m+1 7E 7A 7A JSR = BO n JSR = BO n+1 SH = Subr. Addr. n+1 SH = Subr. Addr. n+2 SL = Subr. Addr. n+2 SL = Subr. Addr. n+3 Next Main Instr. Pc-n+3 Next Main Instr. Last Subr. Instr. P C - Sn RTS (a) Before Execution (b) After Execution Figure 24 Program Flow for RTS 23 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Wait for Hardware Interrupt or Software Interrupt Interrupt Non-Maskable Interrupt (NMIl Main Program Main Program Main Program n+1 n Yes Continue Main Prog. Stack SP ..... m-7 m-6 Condition Code ~ m-5 Acmltr. B m-4 Acmltr. A m-3 Index Register (XH) m-2 Index Register (XL) m-1 PC(n+1)H m PC(n+llL SWI HDWR WAI NMI INT No FFF8 FFF9 I nterrupt Memory Assignment FFF8 r Hardware Int I MS FFF9 Hardware Int. LS FFFA MS First Instr. Software Addr. Formed FFFB Software LS By Fetching FFFC 2-Bytes From Non-Maskable Int. MS Per. Mem. FFFD Non-Maskable Int. LS Assign. FFFE Restart MS FFFF Restart LS (NOTE) MS = Most Significant Address Byte LS = Least Significant Address Byte Figure 25 Program Flow for Interrupts 24 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - SP-m-7 m-7 m-6 CCR m-6 CCR m-5 ACCB m-5 ACCB m-4 ACCA m-4 ACCA m-3 XH (Index Reg) m-3 XH m-2 XL (Index Reg) m-2 XL m-1 PC(n+1)H m-1 PCH m PC(n+ll l SP-m PCl L2:----- n+1 PC----n+1 last Inter. Inst. Pc-Sn RTI (a) Before Execution (b) After Execution Figure 26 Program Flow for RTI • Jump and Branch Operation cremented to be pointing at the correct return address before The Jump and Branch instructions are summarized in Table it is stacked. Operation of the Branch to Subroutine and Jump 6. These instructions are used to control the transfer of opera- to Subroutine (extended) instruction is similar except for the tion from one point to another in the control program. range. The BSR instruction requires less opcode than JSR (2 The No Operation instruction, NOP, while included here, bytes versus 3 bytes) and also executes one cycle faster than is a jump operation in a very limited sense. Its only effect is to JSR. The Return from Subroutine, RTS, is used at the end of increment the Program Counter by one. It is useful during a subroutine to return to the main program as indicated in Fig. program development as a "stand-in" for some other instruc- 24. tion that is to be determined during debug. It is also used for The effect of executing the Software Interrupt, SWI, and the equalizing the execution' time through alternate paths in a con- Wait for Interrupt, WAI, and their relationship to the hardware trol program. interrupts is shown in Fig. 25. SWI causes the MPU contents to Execution of the Jump Instruction, JMP, and Branch Always, be stacked and then fetches the starting address of the interrupt BRA, affects program flow as shown in Fig. 27. When the MPU routine from the memory locations that respond to the ad- encounters the Jump (Index) instruction, it adds the offset to dresses FFFA and FFFB. Note that as in the case of the sub- the value in the Index Register and uses the result as the address routine instructions, the Program Counter is incremented to of the next instruction to be executed. In the extended address- point at the correct return address before being stacked. The ing mode, the address of the next instruction to be executed is Return from Interrupt instruction, RTI, (Fig. 26) is used at the fetched from the two locations immediately following the JMP end of an interrupt routine to restore control to the main instruction. The Branch Always (BRA) instruction is similar to program. The SWI instruction is useful for inserting break points the JMP (extended) instruction except that the relative address- in the control program, that is, it can be used to stop operation ing mode applies and the branch is limited to the range within and put the MPU registers in memory where they can be ex- -125 or +127 bytes of the branch instruction itself. The opcode amined. The WAI instruction is used to decrease the time for the BRA instruction requires one less byte than JMP (ex- required to service a hardware interrupt; it stacks the MPU tended) but takes one more cycle to execute. contents and then waits for the interrupt to occur, effectively The effect on program flow for the Jump to Subroutine removing the stacking time from a hardware interrupt sequence. (JSR) and Branch to Subroutine (BSR) is shown in Figs. 21 through 23. Note that the Program Counter is properly in- 25 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - "fable 6 JUMP/BRANCH Instruction Addressing Modes Cond. Code Reg. Operation Mnemonic RELATIVE INDEX EXTND IMPLIED Branch Test 5 4 3 2 1 0 OP - # OP - # OP - # OP - # H I N Z V C Branch Always BRA 20 4 2 None • • • • • • Branch If Carry Clear BCC 24 4 2 C=O • • • • • • Branch If Carry Set BCS 25 4 2 C=1 • • • • • • Branch If = Zero BEQ 27 4 2 Z=1 • • • • • • Branch If ~ Zero BGE 2C 4 2 N<±)V=O • • • • • • Branch If > Zero BGT 2E 4 2 Z + (N G> V) = 0 • • • • • • Branch If Higher BHI 22 4 2 C+Z=O • • • • • • Branch If ~ Zero BLE 2F 4 2 Z + (N G> V) = 1 • • • • • • Branch If Lower Or Same BLS 23 4 2 C+Z=1 • • • • • • Branch If < Zero BLT 2D 4 2 N ®V=1 • • • • • • Branch If Minus BMI 2B 4 2 N=1 • • • • • • Branch If Not Equal Zero BNE 26 4 2 Z=O • • • • • • Branch If Overflow Clear BVC 28 4 2 v=o • • • • • • Branch If Overflow Set BVS 29 4 2 V = 1 • • • • • • Branch If Plus BPL 2A 4 2 N=O • • • • • • Branch To Subroutine BSR 8D 8 2 • • • • • • Jump JMP 6E 4 2 7E 3 3 • • • • • • Jump To Subroutine JSR AD 8 2 BD 9 3 • • • • • • No Operation NOP 01 2 1 Advances Prog Cntr Only • • • • • • - - ~·r Return From Interrupt RTI 3B 10 1 - t-- Return From Subroutine RTS 39 5 1 • • • • Software Interrupt SWI 3F 12 1 • S • • • • Wait for Interrupt WAI 3E 9 1 • ® • • • • CD (All) Load Condition Code Register from Stack. (See SpeCial Operations) ® (Bit I) Set when interrupt occurs. If previously set, a Non-Maskable interrupt is required to exit the wait state. PC Main Program PC Main Program Main Program 7E = JMP {" 6E = JMP 20 = BRA INDXD n+1 X+K K = Offset Next Instruction EXTND {" n+1 n+2 K KH = Next Address K L = Next Address INext Instruction n+1 K* = Offset (n+2) ± K I Next Instruction *K = Signed 7-bit value (a) Jump (b) Branch Figure 27 Program Flow for JUMP/BRANCH Instructions The conditional branch instructions, Fig. 28, consists of BMI N=1; BEQ Z= 1; seven pairs of complementary instructions. They are used to BPL N = 0; BNE Z=O; test the results of the preceding operation and either continue BVC V=0 ; BCC C= 0 ; with the next instruction in sequence (test fails) or cause a BVS V= 1; BCS C= 1 ; branch to another point in the program (test succeeds). BHI C+Z=O; BLT NEf)V=1; Four ot the pairs are used for simpie tests of status bIts N, BLS C+Z=1; BGE N<±>V=O; Z, V,and C: B LE : Z + (N <±> V) = 1 ; 1. Branch on Minus (BMI) and Branch On Plus (BPL) tests the BGT : Z + (N G> V) = 0 ; sign bit, N, to determine if the previous result was negative or Figure 28 Conditional Branch Instructions positive, respectively. 2. Branch On Equal (BEQ) and Branch On Not Equal (BNE) are used to test the zero status bit, Z, to determine whether or not the result of the previous operation was equal to "0". These two instructions are useful following a COinpare (CMP) instruction to test for equality between an accumulator and the operand. They are also used following the Bit Test (BIT) to determine whether or not the same bit positions are set in an accumulator and the operand. 26 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - 3. Branch On Overflow Clear (BVC) and Branch On Overflow • CONDITION CODE REGISTER OPERATIONS Set (BVS) tests the state of the V bit to determine if the The Condition Code Register (CCR) is a 6-bit register within previous operation caused an arithmetic overflow. the MPU that is useful in controlling program flow during sys- 4. Branch On Carry Clear (BCC) and Branch On Carry Set tem operation. The bits are defined in Fig. 29. (BCS) tests the state of the C bit to detennine if the previous The instructions shown in Table 7 are available to the user operation caused a carry to occur. BCC and BCS are useful for direct manipulation of the CCR. In addition, the MPU auto- for testing relative magnitude when the values being tested matically sets or clears the appropriate status bits as many of are regarded as unsigned binary numbers, that is, the values the other instructions on the condition code register was in- are in the range "00" (lowest) of "FF" (highest). BCC dicated as they were introduced. following a comparison (CMP) will cause a branch if the Systems which require an interrupt window to be opened (unsigned) value in the accumulator is higher than or the under program control should use a CLI-NOP-SEI sequence same as the value of the operand. Conversely, BCS will cause rather than CLI-SEI. a branch if the accumulator value is lower than the operand. The Fifth complementary pair, Branch On Higher (BHI) b5 b4 b3 b2 b1 bO and Branch On Lower or Same (BLS) are in a sense comple- ments to BCC and BCS. BHI tests for both C and Z = "0", if H N Z v C used following a CMP, it will cause a branch if the value in the accumulator is higher than the operand. Conversely, BLS will H = Half-carry; set whenever a carry from b3 to b4 of the resu It is cause a branch if the unsigned binary value in the accumulator generated by ADD, ABA, ADC; cleared if no b3 to b4 carry; not affected by other instructions. is lower than or the same as the operand. The remaining two pairs are useful in testing results of opera- Interrupt Mask; set by hardware of software interrupt or SEI instruction; cleared by CLI instruction. (Normally not used tions in which the values are regarded as signed two's comple- in arithmetic operations.) Aestored to a "0" as a result of an ment numbers. This differs from the unsigned binary case in the ATI instruction if 1M stored on the stacked is "0" following sense: In unsigned, the orientation is higher or lower; N = Negative; set if high order bit (b7) of result is set; cleared in signed two's complement, the comparison is between larger otherwise. or smaller where the range of values is between -128 and +127. Z = Zero; set if result = "0"; cleared otherwise. Branch On Less Than Zero (BLT) and Branch On Greater V = Overflow; set if there was arithmetic overflow as a result of Than Or Equal Zero (BGE) test the status bits for NEBV = "1" the operation; cleared otherwise. and N EB V = "0", respectively. BLT will always cause a branch C = Carry; set if there was a carry from the most significant bit following an operation in which two negative numbers were (b7) of the result; cleared otherwise. added. In addition, it will cause a branch following a CMP in which the value in the accumulator was negative and the oper- Figure 29 Condition Code Register Bit Definition and was positive. BLT will never cause a branch following a CMP in which the accumulator value was positive and the operand negative. BGE, the complement to BLT, will cause a • ADDRESSING MODES branch following operations in which two positive values The MPU operates on 8-bit binary numbers presented to it were added or in which the result was "0". via the Data Bus. A given number (byte) may represent either The last pair, Branch On Less Than Or Equal Zero (BLE) and data or an instruction to be executed, depending on where it is Branch On Greater Than Zero (BGT) test the status bits for encountered in the control program. The HD6800 MPU has Z EB (N + V) = "1" and Z EB (N + V) = "0", respectively, 72 unique instructions, however, it recognizes and takes action The action of BLE is identical to that for BLT except that a on 197 of the 256 possibilities that can occur using an 8·bit branch will also occur if the result of the previous result was word length. This larger number of instructions results from the "0". Conversely, BGT is similar to BGE except that no branch fact that many of the executive instructions have more than will occur following a "0" result. one addressing mode. Table 7 Condition Code Register Instructions Addressing Condo Code Reg. Mode Operations Mnemonic IMPLIED Boolean Operation 5 4 3 2 1 0 OP - # H I N Z V C Clear Carry CLC OC 2 1 0-+ C • • • • • A Clear Interrupt Mask CLI OE 2 1 0-+ I • R • • • • Clear Overflow CLV OA 2 1 0--> V • • • • A • Set Carry SEC 00 2 1 1 -+ C • • • • • S Set I nterrupt Mask SEI OF 2 1 1 -+ I • S • • • • Set Overflow SEV OB 2 1 1 --> V • • • • S • Acmltr A --> CCA TAP 06 2 1 A -+ CCA CD CCR --> Acmltr A TPA 07 2 1 CCA--> A • I• I• f•I• I• A = Aeset S '" Set • '" Not affected CD (ALL) Set according to the contents of Accumulator A. 27 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - These addressing modes refer to the manner in which the Assembler whenever it encounters the "#" symbol in the program causes the MPU to obtain its instructions and data. operand field. Similarly, an "X" in the operand field causes the The programmer must have a method for addressing the MPU's Indexed mode to be selected. Only the Relative mode applies internal registers and all of the external memory locations. to the branch instructions, therefore, the mnemonic instruc- Selection of the desired addressing mode is made by the user tion itself is enough for the Assembler to determine addressing as the source statements are written. Translation into appropri- mode. ate opcode then depends on the method used. If manual trans- For the instructions that use both Direct and Extended lation is used, the addressing mode is inherent in the opcode. modes, the Assembler selects the Direct mode if the operand For example, the Immediate, Direct, Indexed, and Extended value is in the range 0-255 and Extended otherwise. There are modes may all be used with the ADD instruction. The proper a number of instructions for which the Extended mode is mode is determined by selecting (hexidecimal notation) 8B, valid but the Direct is not. For these instructions, the Assembler 9B, AB, or BB, respectively. automatically selects the Extended mode even if the operand is The source statement format includes adequate information in the 0"'255 range. The addressing modes are summarized in for the selection if an assembler program is used to generate the Fig. 30. opcode. For instance, the Immediate mode is selected by the n DO Instruction Immediate: n Instruction Direct: Example: SUBB Z n+1 Z = Operand Address Example: LDAA #K n+1 K = Operand Addr. Range = 0~255 (K = One-Byte Operand) & n+2 Next Instr. n+2 Next Inst. • OR • (K = Two-Byte Operand) Instruction • (CPX, LDX and LDS) n+1 KH = Operand • K = Operand n+2 KL = Operand (K = One·Byte Operand) Z OR n+3 Next Instr. (K = Two-Byte Operand) Z KH = Operand Z+1 KL = Operand Relative: Instruction & If Z;£ 255, Assembler Select Direct Mode Example: BNE K n+1 ±K = Branch Offset If Z > 255, Extended Mode is selected (K = Signed 7-Bit Value) Next Instr.ill n+2 Addr. Range: • -125 to +129 Relative to n. • • Extended: FO Instruction • Example: CMPA Z n+1 ZH = Operand Address (n+2)±K Next I nstr . ill Addr. Range: n+2 ZL = Operand Address .& If Branch Test False, &. If Branch Test True. &. 256-65535 n+3 Next Instr. • Indexed: Instruction • n+1 Z = Offset Example: ADDA Z, X • Next Instr. • Addr. Range: 0~255 Relative to n+2 (K = One-Byte Operand) Z K = Operand Index Register, X • OR • • KH = Operand (K = Two-Byte Operand) Z • Z+1 KL = Operand (Z = a-Bit Unsigned Value) X+Z IL--__K_=_o_p_e_r_an_d_ _--' Figure 30 Addressing Mode Summary 28 HD6800, HD68AOO, HD68BOO - - - - - - - - - - -_ _ MPU MPU • Inherent (Includes "Accumulator Addressing" Mode) The successive fields in a statement are normally separated by one or more spaces. An exception to this rule occurs for in- structions that use dual addressing in the operand field and for instructions that must distinguish between the two accumu- lators. In these cases, A and B are "operands" but the space between them and the operator may be omitted. This is com- monly done, resulting in apparent four character mnemonics for those instructions. The addition instruction, ADO, provides an example of dual addressing in the operand fields; Operator Operand Comment ADDA MEM12 ADD CONTENTS OF MEM12 TO ACCA or ADDB MEM12 ADD CONTENTS OF MEM12 TO ACCB The example used earlier for the test instruction, TST, also applies to the accumulators and uses the "accumulator address- ing mode" to designate which of the two accumulators is being Example General Flow tested: Figure 32 Accumulator Addressing Operator Comment TSTB TEST CONTENTS OF ACCB or TSTA TEST CONTENTS OF ACCA • I mmediate Addressing Mode In the Immediate addressing mode, the operand is the value A number of the instructions either alone or together with that is to be operated on. For instance, the instruction an accumulator operand contain all of the address information Operator Operand Comment that is required, that is, "inherent" in the instruction, itself. For instance, the instruction ABA causes the MPU to add the LDAA #25 LOAD 25 INTO ACCA contents of accumulators A and B together and place the result in accumulator A. The instruction INCB, another example of causes the MPU to "immediately load accumulator A with the "accumulator addressing", causes the contents of accumulator value 25"; no further address reference is required. The Im- B to be increased by one. Similarly, INX, increment the Index mediate mode is selected by preceding the operand value with Register, causes the contents of the Index Register to be in- the "#" symbol. Program flow for this addressing mode is creased by one. illustrated in Fig. 33. Program flow for instructions of this type is illustrated in The operand format allows either properly defmed symbols Figures 31 and 32. In these figures, the general case is shown or numerical values. Except for the instructions CPX, LOX, and on the left and a specific example is shown on the right. LOS, the operand may be any value in the range 0"'" 255. Since Numerical examples are in decimal notation. Instructions of this C()mpare Index Register (CPX) , Load Index Register (LOX), type require only one byte of opcode. Cycle-by-cycle operation of the inherent mode is shown in Table 8. Load Stack Pointer (LOS), require 16-bit values, the immediate mode for these three instructions requie two-byte operands. Table 9 shows the cycle-by-cyde operation for the im- MPU MPU mediate addressing mode. RAM Program Program Memory Memory PC PC = 5000I-_ _-f, PC PC = 5002 t---"~~-v t-~~--II .... General Flow Example General Flow Example Figure 33 Immediate Addressing Mode Figure 31 Inherent Addressing 29 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Table 8 Inherent Mode Cycle by Cycle Operation Address Mode Cycle Cycle VMA Address Bus R/W Data Bus and Instructions # Line Line ABA DAA SEC Op Code Address Op Code ASL DEC SEI 2 ASR INC SEV 2 Op Code Address + 1 Op Code of Next Instruction CBA LSR TAB CLC NEG TAP CLI NOP TBA CLR ROL TPA CLV ROR TST COM SBA DES 1 1 Op Code Address I 1 Op Code DEX 4 I 2 1 Op Code Address + 1 I 1 Op Code of Next Instruction INS I 3 0 Previous Register Contents I' 11 Irrelevant Data (NOTE 1) INX i 4 0 New Register Contents Irrelevant Data (NOTE 1) - - P S - H - - - - - - - - + - - - +- 4-1 -+---0~1--+---0-p-Co-de Address !I'I II 1 Op Code Op Code of Next Instruction 4 23 ~:a;o~~i~t~~ress + 1 1 o Accumulator Data Stack Pointer - 1 1 Accumulator Data PU L ;1 ~1 Op Code Address I Op Code Op Code of Next Instruction 4 Op Code Address + 1 Stack Pointer Irrelevant Data (NOTE 1) 4 1 Stack Pointer + 1 I Operand Data from Stack I TSX 1 1 Op Code Address I 1 I Op Code 32 4 01 Op Code Stack Pointer Address~: ~l~_i'~ 1 I Op Code ofData Irrelevant Next(NOTE Instruction 1) __________+-__+--~4_+__-0-+__-N-ew~l-nd-e-~~IJ~~~ 1 Irrelevant Data (NOTE 1) II TXS 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 IOp Code of Next Instruction 4 -r! 3 0 Index Register 1 I Irrelevant Data _ _ _ _ _ _ _ _ _ _+-_~+-~4_+_-0-~-N~ew--S--ta-c-k-P--o-in-ter __1_-+1__I_rr_e_le_v_an_t_D_a_t_a___________________ RTS 1 1 Op Code Address I 1 Op Code I 2 1 Op Code Address + 1 1 Irrelevant Data (NOTE 2) 5 3 0 Stack Pointer 1i Irrelevant Data (NOTE 1) 4 1 Stack Pointer + 1 I 1~:Address of Next Instruction (High Order Byte) ___________~____+-___+-__ 5 __+_--1--t_-S-t-a-ck--po--in-t-e.-r--+-2--~ Address of Next Instruction (Low Order Byte) WAI 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 [' Op Code of Next Instruction 3 1 Stack Pointer 0 Return Address (Low Order Byte) 4 1 Stack Pointer - 1 0 I: Return Address (High Order Byte) 9 I 5 1 Stack Pointer - 2 0 Index Register (Low Order Byte) I 6 1 Stack Pointer - 3 0 I Index Register (High Order Byte) 7 1 Stack Pointer - 4 II 00 Contents of Accumulator A 8 1 Stack Pointer - 5 Contents of Accumulator B 9 1 Stack Pointer - 6 (NOTE 3) 1 Contents of Condo Code Register RTI 1 1 Op Code Address [ 1 i Op Code 2 1 Op Code Address + 1 I 1~ Irrelevant Data (NOTE 2) 3 0 Stack Pointer Irrelevant Data (NOTE 1) 4 1 Stack Pointer + 1 Contents of Condo Code Register from Stack 5 1 Stack Pointer + 2 1 Contents of Accumulator B from Stack 10 6 1 Stack Pointer + 3 1 Contents of Accumulator A from Stack 7 1 Stack Pointer + 4 1 Index Register from Stack (High Order Byte) 8 1 Stack Pointer + 5 1 Index Register from Stack (Low Order Byte) 9 1 Stack Pointer + 6 1 Next Instruction Address from Stack (High Order Byte) 10 Stack Pointer + 7 1 Next Instruction Address from Stack LOW Order Byte) SWI 1 2 3 4 1 1 1 1 Op Code Address Op Code Address + 1 Stack Pointer Stack Pointer - 1 h--H o o 1 1 OP Code Irrelevant Data (NOTE 1) Return Address (Low Order Byte) Return Address (High Order Byte) 5 1 Stack Pointer - 2 o Index Register (Low Order Byte) 12 6 1 Stack Pointer - 3 o Index Register (High Order Byte) 7 1 Stack Pointer - 4 o Contents of Accumulator A 8 1 Stack Pointer - 5 o Contents of Accumulator B 9 1 Stack Pointer - 6 o Contents of Condo Code Register 10 o Stack Pointer - 7 1 Irrelevant Data (NOTE 1) 11 1 Vector Address FFFA (Hex) 1 Address of Subroutine (High Order Byte) 12 1 Vector Address FFFB (Hex) 1 Address of Subroutine (Low Order Byte) NOTE 1. If device which IS addressed dUring thiS cycle uses VMA, then the Data Bus will go to the high Impedance three-state condition. Depending on bus capacitance, data from the previous cycle may be retained on the Data Bus. NOTE 2. Data is ignored by the MPU. NOTE 3. While the MPU is waiting for the interrupt, Bus Available will go "High" indicating the following states of the control lines: VMA is "Low"; Address Bus, R/W, and Data Bus are all in the high impedance state. 30 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Table 9 Immediate Mode Cycle by Cycle Operation Address Mode Cycle Cycle VMA Address Bus R/W and Instructions Line Line Data Bus #' ADC EOR 1 1 Op Code Address 1 Op Code ADD LDA 2 1 Op Code Address + 1 1 Operand Data AND ORA 2 I BIT SBC CMP SUB CPX 1 1 Op Code Address 1 Op Code LDS 3 2 1 Op Code Address + 1 1 Operand Data (High Order Byte) LDX 3 1 Op Code Address + 2 1 Operand Data (Low Order Byte) • Direct and Extended Addressing Modes this case a value to be loaded into accumulator A, from that In the Direct and Extended modes of addressing, the operand location. For instructions requiring a two-byte operand such as field of the source statement is the address of the value that is LDX (Load the Index Register), the operand bytes would be to be operated on. The Direct and Extended modes differ only retrieved from locations 100 and 101. in the range of memory locations to which they can direct the Extended addressing, Fig. 35, is similar except that a two- MPU. Direct addressing generates a single 8-bit operand and, byte address is obtained from locations 5007 and 5008 after the hence, can address only memory locations 0 '" 255; a two byte LDAB (Extended) opcode shows up in location 5006. Extended operand is generated for Extended addressing, enabling the MPU addressing can be thought of as the "standard" addressing to reach the remaining memory locations, 256 '" 65535. An mode, that is, it is a method of reaching anyplace in memory. example of Direct addressing and its effect on program flow is Direct addressing, since only one address byte is required, illustrated in Fig. 34. provides a faster method of processing data and generates fewer Table 10 shows the cycle-by~ycle operations of this mode. bytes of control code. In most applications, the direct address- The MPU, after encountering the opcode for the instrution ing range, memory locations 0 '" 255, are reserved for RAM. LDAA (Direct) at memory location 5004 (program Counter = They are used for data buffering and temporary storage of 5004), looks in the next location, 5005, for the address of the system variables, the area in which faster addressing is of most operand. It then sets the program counter equal to the value value, Cycle-by~ycle operation is shown in Table 11 for Ex- found there (100 in the example) and fetches the operand, in tended Addressing. Table 10 Direct Mode Cycle by Cycle Operation Address Mode Cycle and Instructions Cycle # VMA Line Address Bus I R/W Line Data Bus ADC EOR 1 1 Op Code Address 1 Op Code ADD LDA 2 1 Op Code Address + 1 1 Address of Operand AND ORA 3 3 1 Address of Operand 1 Operand Data BIT SBC CMP SUB CPX 1 1 Op Code Address 1 Op Code LDS 2 1 Op Code Address + 1 1 Address of Operand 4 LDX 3 1 Address of Operand 1 Operand Data (High Order Byte) 4 1 Operand Address + 1 I 1 Operand Data (Low Order Byte) STA 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 ,1 Destination Address 4 3 0 Destination Address 1 Irrelevant Data (NOTE 1) 4 1 Destination Address 0 Data from Accumulator STS 1 1 Op Code Address 1 Op Code STX 2 1 Op Code Address + 1 1 Address of Operand 5 3 0 Address of Operand 1 Irrelevant Data (NOTE 1) 4 1 Address of Operand 0 Register Data (High Order Byte) 5 1 Address of Operand + 1 0 Register Data (Low Order Byte) NOTE 1. If device which is address during this cycle uses VM:A., then the Data Bus will go to the high impedance three~tate condition. Depending on bus capacitance, data from the previous cycle may be retained on the Data Bus. 31 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Table 11 Extended Mode Cycle by Cycle Address Mode Cycle Cycle VMA Address Bus R/W Data Bus and Instructions # Line Line STS 1 1 Op Code Address 1 Op Code STX 2 1 Op Code Address + 1 1 Address of Operand (High Order Byte) 3 1 Op Code Address + 2 1 Address of Operand (Low Order Byte) 6 4 0 Address of Operand 1 Irrelevant Data (NOTE 1) 5 1 Address of Operand 0 Operand Data (High Order Byte) 6 1 Address of Operand + 1 0 Operand Data (Low Order Byte) JSR 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 Address of Subroutine (High Order Byte) 3 1 Op Code Address + 2 1 Address of Subroutine (Low Order Byte) 4 1 Subroutine Starting Address 1 Op Code of Next Instruction 9 5 1 Stack Pointer 0 Return Address (Low Order Byte) 6 1 Stack Pointer - 1 0 Return Address (High Order Byte) 7 0 Stack Pointer - 2 1 Irrelevant Data (NOTE 1) 8 0 Op Code Address + 2 1 Irrelevant Data (NOTE 1) 9 1 Op Code Address + 2 1 Address of Subroutine (Low Order Byte) JMP 1 1 Op Code Address 1 Op Code 3 2 1 Op Code Address + 1 1 Jump Address (High Order Byte) 3 1 Op Code Address + 2 1 Jump Address (Low Order Byte) ADC EOR 1 1 Op Code Address 1 Op Code ADD LOA 2 1 Op Code Address + 1 1 Address of Operand (High Order Byte) AND ORA 4 3 1 Op Code Address + 2 1 Address of Operand (Low Order Byte) BIT SBC 4 1 Address of Operand 1 Operand Data CMP SUB CPX 1 1 Op Code Address 1 Op Code LOS 2 1 Op Code Address + 1 1 Address of Operand (High Order Byte) LOX 5 3 1 Op Code Address + 2 1 Address of Operand (Low Order Byte) 4 1 Address of Operand 1 Operand Data (High Order Byte) 5 1 Address of Operand + 1 1 Operand Data (Low Order Byte) STAA 1 1 Op Code Address 1 Op Code STA B 2 1 Op Code Address + 1 1 Destination Address (High Order Byte) 5 3 1 Op Code Address + 2 1 Destination Address (Low Order !3yte) 4 0 Operand Destination Address 1 Irrelevant Data (NOTE 1) 5 1 Operand Destination Address 0 Data from Accumulator ASL LSR 1 1 Op Code Address 1 Op Code ASR NEG 2 1 Op Code Address + 1 1 Address of Operand (High Order Byte) CLR ROL 3 1 Op Code Address + 2 1 Address of Operand (Low Order Byte) COM ROR 6 4 1 Address of Operand 1 Current Operand Data DEC TST 5 0 Address of Operand 1 Irrelevant Data (NOTE 1) INC 6 1/0 Address of Operand 0 New Operand Data (NOTE 2) (NOTE 2) NOTE 1. If device which IS addressed during this cycle uses VMA, then the Data Bus Will go to the high impedance three·state condition . .. Depending on bus capacitance, data from the previous cycle may be retained on the Data Bus. NOTE 2. For TST, VMA = 0 and Operand data does not change. MPU MPU ~ ~ ~ .JI ADDR = 100 AD DR = 300 ........;.;:;.....~I' ..........;;;.;...--f"l Program Program Program Memory Memory Memory PC PC = 5004 PC = 5006 ~;;';;';'''';''';;'--I 5005 I--=....;..;..~/ 5007 PC-1 5008 5009 1 - - - - - - 1 ADDR = 0 ~255 Example ADDR ~ 256 Example General Flow General Flow Figure 34 Direct Addressing Mode Figure 35 Extended Addressing Mode 32 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - • Relative Address Mode that is, the destination of the branch instruction must be In both the Direct and Extended modes, the address ob- within -126 to +129 memory locations of the branch instruc- tained by the MPU is an absolute numerical address. The Re- tion itself. For transferring control beyond this range, the un- lative addressing mode, implemented for the MPU's branch conditional jump (JMP), jump to subroutine (JSR), and return instructions, specifies a memory location relative to the Program from subroutine (RTS) are used. Counter's current location. Branch instructions generate two In Fig. 36, when the MPU encounters the opcode for BEQ bytes of machine code, one for the instruction opcode and one (Branch if result of last instruction was zero), it tests the Zero for the "relative" address (see Fig. 36). Since it is desirable to be bit in the Condition Code Register. If that bit is "0", indicating able to branch in either direction, the 8-bit address byte is inter- a non-zero result, the MPU continues execution with the next preted as a signed 7-bit value; the 8th bit of the operand is instruction (in location 5010 in Fig. 36). If the previous result treated as a sign bit, "0" = plus and "1" = minus. The remaining was zero, the branch condition is satisfied and the MPU adds the seven bits represent the numerical value. This result in a relative offset, 15 in this case, to PC+2 and branches to location 5025 addressing range of ±127 with respect to the location of the for the next instruction. branch instruction itself. However, the branch range is com- The branch instructions allow the programmer to efficiently puted with respect to the next instruction that would be ex- direct the MPU to one point or another in the control program ecuted if the branch conditions are not satisfied. Since two depending on the outcome of test results. Since the control byte are generated, the next instruction is located at PC+2. program is normally in read-only memory and cannot be If, D is defined as the address of the branch destination, the changed, the relative address used in execution of branch in- range is then; structions is a constant numerical value. Cyc1e-by-cyc1e opera- (PC+2) -128~ D~ (PC+2) + 127 tion is shown in Table 12 for relative addressing. or PC -126 ~ D ;£ PC + 1 29 MPU MPU RAM RAM Program Program Memory Memory PC ~-----I' PC 5008 (PC+2) ~-----I PC 5010 1-------1 (PC+2) + (Offset) PC 5025 ~------i Figure 36 Relative Addressing Mode 33 HD6800, HD68AOO, HD68BOO - - - - - - - - - - - - - Table 12 Relative Mode Cycle-by-Cycle Operation Address Mode Cycle VMA Address Bus R/W Data Bus Cycle and Instructions # Line Line BCC BHI BNE 1 1 Op Code Address 1 Op Code BCS BlE BPl 2 1 Op Code Address + 1 1 Branch Offset BRA 4 Op Code Address + 2 Irrelevant Data (NOTE 1) BEQ BlS 3 0 1 BGE BlT BVC 4 0 Branch Address 1 Irrelevant Data (NOTE 1) BGT BMI BVS BSR 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 Branch Offset 3 0 Return Address of Main Program 1 Irrelevant Data (NOTE 1) 4 1 Stack Pointer 0 Return Address (Low Order Byte) 8 5 1 Stack Pointer - 1 0 Return Address (High Order Byte) 6 0 Stack Pointer - 2 1 Irrelevant Data (NOTE 1) 7 0 Return Address of Main Program 1 Irrelevant Data (NOTE 1) 8 0 Subroutine Address 1 Irrelevant Data (NOTE 1) .. NOTE 1. If device which IS addressed dUring this cycle uses VMA, then the Data Bus Will go to the high Impedance three-state condition . Depending on bus capacitance, data from the previous cycle may be retained on the Data Bus. • Indexed Addressing Mode The operand field can also contain a numerical value that will With Indexed addressing the numerical address is variable and be automatically added to X during execution. This format is depend on the current contents of the Index Register. A source illustrat~d in Fig. 37. statement such as When the MPU encounters the LDAB (Indexed) opcode in Operator Operand Comment location 5006, it looks in the next memory location for the value to be added to X (5 in the example) and calculates the STAA X PUT A IN INDEXED LOCATION required address by adding 5 to the present Index Register value causes the MPU to store the contents of accumulator A in the of 400. In the operand format, the offset may be represented memory location specified by the contents of the Index Re- by a label or a numerical value in the range 0 '" 255 as in the gister (recall that the label X is reserved to designate the Index example. In the earlier example, STAA X, the operand is Register). Since there are instructions for manipulating X equivalent to 0, X , that is, the "0" may be omitted when the during program execution (LDX, INX, DEX, etc.), the Indexed desired address is equal to X. Table 13 shows the cycle-by-<:ycle addressing mode provides a dynamic "on the fly" way to operation for the Indexed Mode of Addressing. modify program activity. MPU MPU RAM RAM ADDR = INDX t--=-:~,....---v + OFFSET ADDR = 405t-~"---I1" Program Program Memory Memory PC PC = 5006 ~~=-I/ 1-";;;';;;'---4/ OFFSET;£ 255 Example General Flow Figure 37 Indexed Addressing Mode 34 HD6800, HD68AOO, HD68BOO Table 13 Indexed Mode Cycle by Cycle Address Mode Cycle Cycle VMA R/W Address Bus Data Bus and Instructions # Line Line JMP 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 Offset 4 3 0 Index Register 1 Irrelevant Data (NOTE 1) 4 0 Index Register Plus Offset (w/o Carry) 1 Irrelevant Data (NOTE 1) ADC EOR 1 1 Op Code Address 1 OpCode ADD LDA 2 1 Op Code Address + 1 1 Offset AND ORA 5 3 0 Index Register 1 Irrelevant Data (NOTE 1) BIT SBC 4 0 Index Register Plus Offset (w/o Carry) 1 Irrelevant Data (NOTE 1) CMP SUB 5 1 Index Register Plus Offset 1 Operand Data CPX 1 1 Op Code Address 1 Op Code LDS 2 1 Op Code Address + 1 1 Offset LDX 3 0 Index Register 1 Irrelevant Data (NOTE 1) 6 4 Index Register Plus Offset (w/o Carry) Irrelevant Data (NOTE 1) 0 1 5 1 Index Register Plus Offset 1 Operand Data (High Order Byte) 6 1 Index Register Plus Offset + 1 1 Operand Data (Low Order Byte) STA 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 Offset 3 0 Index Register 1 Irrelevant Data (NOTE 1) 6 4 0 Index Register Plus Offset (w/o Carry) 1 Irrelevant Data (NOTE 1) 5 0 Index Register Plus Offset 1 Irrelevant Data (NOTE 1) 6 1 Index Register Plus Offset 0 Operand Data ASL LSR 1 1 Op Code Address 1 Op Code ASR NEG 2 1 Op Code Address + 1 1 Offset CLR ROL 3 0 Index Register 1 Irrelevant Data (NOTE 1) COM ROR 7 4 0 Index Register Plus Offset (w/o Carry) 1 Irrelevant Data (NOTE 1) DEC TST 5 1 Index Register Plus Offset 1 Current Operand Data INC 6 0 Index Register Plus Offset 1 Irrelevant Data (NOTE 1) 7 1/0 Index Register Plus Offset 0 New Operand Data (NOTE 2) (NOTE 2) STS 1 1 Op Code Address 1 Op Code STX 2 1 Op Code Address + 1 1 Offset 3 0 Index Register 1 Irrelevant Data (NOTE 1) 7 4 0 Index Register Plus Offset (w/o Carry) 1 Irrelevant Data (NOTE 11 5 0 Index Register Plus Offset I 1 Irrelevant Data (NOTE 1) 6 1 Index Register Plus Offset 0 Operand Data (High Order Byte) 7 1 Index Register Plus Offset + 1 0 Operand Data (Low Oder Byte) JSR 1 1 Op Code Address 1 Op Code 2 1 Op Code Address + 1 1 Offset 3 0 Index Register 1 Irrelevant Data (NOTE 1) 4 1 Stack Pointer 0 Return Address (Low Order Byte) 8 5 1 Stack Pointer - 1 0 Return Address (High Order Byte) 6 0 Stack Pointer - 2 1 Irrelevant Data (NOTE 1) 7 0 Index Register 1 Irrelevant Data (NOTE 1) NOTE 1. 8 0 Index Register Plus Offset (w/o Carry) I 1 Irrelevant Data (NOTE 1) .. If DevIce whIch IS addressed durmg thIs cycle uses VMA, then the Data Bus WIll go to the hIgh Impedance three-state condItIon . Depending on bus capacitance, data from the previous cycle may be retained on the Data Bus. NOTE 2. For TST, VMA = 0 and Operand data does not change. 35 HD6800, HD68AOO, HD68BOO - - - - - - - -_ _ _ __ 2 3 4 5 6 7 8 9 10 I 11 I 12 I 13 I MPU~l AddressBus-,~__~__~~__~~__~~~~__~~__~~__~~~~__~~__~~__~,-~ IMMEDIATE I I II VMA ----l---~---J--- .,. : --"1 R/W --, --41----~1----~:----~----~----~--~----_T----~----r_----11~--_+-----1 I II I I -' I I I I I I I: = [ 1 Data Bus : I I LOA Data ~:~~ I I I I I I I DIRECT I I VMA----~--~---I~II--~--~~-~ : I I I R/W J I ~.L.f7 : [ Data BUS ______ x:::::x i LOA Address Data ST A Address ACCA Next I Data Inst. I INDEXED I I I I I ~~~____t~i---~--~---t~.~~__~__+-__~r~·i~--~:--~--~ i .) : I : : ::i' t_'---.b-....----~ [ Data Bus ~'-_ _ _ _ _ _ x:=x::::::x_________I_c:x::: LOA Offset Data ST A Offset Data Next Inst. EXTENDED : : : VMA -...L..--.....L----4----;..----;--r---;..cL.l7 : I I I I R/W J l.L.l7,.---i---+---+\---1 [ Data Bus I ' LOA Address Address Data STA Address Address ACCA Data IMPLIED I I VMA ::J--+---L--......i--~....... t.Ll7 I I I R/W 7""-....--~:---.:---+lLJ7,.......-+---!--~-......I---i- 1 I I I I , [ Data Bus::::X:::=::X::: ~_ _ _ __ ABA PSH Data (l ":;::1 Next Inst. RELATIVE I I I I\~~---~~·/-~---------.--------- ,. •• - I I I DataBus:::~::::)C::::~::::)(::::~::::)(::::~::::)C::::~:: Branch PC ± Next Inst. Offset Inst. Figure 38 Example of Execution Timing in Each Addressing Mode 36 HD&a02 MPU (Microprocessor with Clock and RAM) The HD6802 is a monolithic 8-bit microprocessor that contains all the registers and accumulators of the present HD6800 plus an internal clock oscillator and driver on the same chip. In addition, the HD6802 has 128 bytes of RAM on the chip located at hex addresses 0000 to 007F. The first 32 bytes of RAM, at hex addresses 0000 to 001F, may be retained in a low power mode by utilizing Vee standby, thus facilitating memory retention during a power-down situation. The HD6802 is completely software compatible with the HD6800 as well as the entire HMCS6800 family of parts. Hence, the HD6802 is expandable to 6SK words. • FEATURES • On-Chip Clock Cjrcuit • 128 x 8 Bit On-Chip RAM • 32 Bytes. of RAM are Retainable • Software-Compatible with the HD6800 • Expandable to 65K words • Standard TTL-Compatible Inputs and Outputs • 8 Bit Word Size • 16 Bit Memory Addressing • Interrupt Capability • Compatible with MC6802 (DP-40) • MINIMUM SYSTEM • PIN ARRANGEMENT Vee Vee Standby Vee Vee RES EXTAL XTAL RE Counterl { ! Timer 110 Vee standby R/W 1m 0, Parallel 0, 1/0 0, 2 0, i c:J Crystal 2 0, Control { 0, Au e, 'f e• -:- Vss An -....._ _ _ _ _-r-' VSS (Top View) 37 ------------------------------------HD6802------------------------------------ • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3'" +7.0 V Vee Standby* Input Voltage Vin * -0.3'" +7.0 V Operating Temperature Topr -20'" +75 °c Storage Temperature Tstg -55'" +150 °c * With respect to Vss (SYSTEM GND) (NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. II RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V Vee Standby* V IL * -0.3 - 0.8 V Input Voltage V IH * 2.0 - Vee V Operation Temperature Topr -20 25 75 °c * With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vee=5.0V±5%, Vee Standby=5.0V±5%, Vss=OV, Ta=-20"'+75°C, unless otherwise noted.) Item Symbol Test Condition min typ** max Unit Except RES 2.0 - Vee Input "High" Voltage V IH V RES 4.25 - Vee Except RES *** -0.3 - 0.8 Input "Low" Voltage V 1L V RES -0.3 - 0.8 OQ",07, E 10 H = -205J,LA, 2.4 - - Output "High" Voltage ~"'A15, R/W, VMA VOH 10H = -145J,LA, 2.4 - - V BA 10H = -100J,LA 2.4 - - Output "Low" Voltage VOL 10L = 1.6mA - - 0.4 V Three State (Off State) Input Current 0 0 "'0 7 ITS1 Vin = 0.4"'2.4 V - 2.0 10 J,LA Input Leakage Current Except Do "'0 7 lin **** Vin = Q-5.25V - 1.0 2.5 J,LA Power Dissipation Po * - 0.6 1.2 W 0 0 "'0 7 Vin=OV, Ta=25°C - 10 12.5 Input Capacitance ~n f=1.0MHz pF Except 0 0 "'0 7 - 6.5 10 Output Capacitance ~~::A15' R/W, BA Cnll~ Vin=OV, Ta=25°C - - 12 pF "=1 nI\AU_ I VIVII"\ * In power-down mode, maximum power dissipation is less than 42mW. ** Ta= 2So C, Vee =5V *** As RES input has histeresis character, applied voltage up to 2.4V is regarded as "Low" level when it goes up from OV. *** * Does not include Extal and Xtal, which are crystal inputs. 38 -------------------------------------HD6802------------------------------------- • AC CHARACTERISTICS (Vee =5.0V±5%, Vee Standby=5.0V±5%, Vss=OV, Ta=-20~+75°C, unless otherwise noted.) 1. CLOCK TIMING CHARACTERISTICS Item Symbol Test Condition min typ max Unit !Input Clock -;- 4 f 0.1 - 1.0 Frequency of Operation MHz ! Crystal Frequency fXTAL 1.0 - 4.0 Cycle Time !eye 1.0 - 10 p.s !"High" Level PWcpH at 2.4V ns Clock Pulse Width I "Low" Level PWcpL at 0.8V 450 - 4500 Clock Fall Time 1(p 0.8V - 2.4V - - 25 ns 2. READ/WRITE TIMING Item Symbol Test Condition min typ max Unit Address Delay tAo Fig. 2, Fig. 3 - - 270 ns Peripheral Read Access Time tace Fig. 2 - - 530 ns Data Setup Time (Read) tOSR Fig. 2 100 - - ns Input Data Hold Time tH Fig. 2 10 - - ns Output Data Hold Time tH Fig. 3 20 - - ns Address Hold Time (Address, R/W, VMA) tAH Fig. 2, Fig. 3 10 - - ns Data Delay Time (Write) toow Fig.3 - 165 225 ns Processor Controls tpcs Fig. 7 200 - - ns Processor Control Setup Time Processor Control Rise and Fall Time tPCr tPCf Fig. 7, Fig. 8, Fig. 11 - - 100 ns (Measured at O.BV and 2.0V) 3. POWER DOWN SEQUENCE TIMING, POWER UP RESET TIMING AND MEMORY READY TIMING Item Symbol Test Condition min typ max Unit RAM Enable Reset Time (1) tRE1 Fig. 8 150 - - ns RAM Enable Reset Time (2) tRE2 Fig. 8 E-3 cycles - - Reset Release Time tLRES Fig. 7 20* - - ms RAM Enable Reset Time (3) tRE3 Fig. 7 0 - - ns Memory Ready Setup Time tSMR Fig. 11 300 - - ns Memory Ready Hold Time tHMR Fig. 11 0 - 200 ns *tRES = 20 msec min. for S type, 50 msec min. for R type. ------------------------------------HD6802----------------------------------__ 5.0V RL = 2.4kn -,......--t...- .. Test Point o-..... c= 130pF for 0 0 -0,. E = 90pF for Ao -A 15 • RIW. and VMA = 30pF for BA C R R = 11 kn for Do -0,. E = 16kn for Ao -A 15 • R/W. and VMA = 24kn for BA C includes stray Capaci:$llnce. All diodes are 152074 \I:Y • Figure 1 Bus Timing Test load ~-----------------------tcyC--------------------~ E R/W Address From MPU VMA Data 2.0V -~-+-~~=:::=!""-- From Memory or Peripherals --------------------------------~~ 0.8V--=-t--===~ ~ Data Not Valid Figure 2 Read Data from Memory or Peripherals ~-------------------tcyc----------------------~ E 0.4V R/W Address From MPU VMA Data 2.4V ---=~~=:::::::=:::==t:~ From MPU 0.4V ~ Data Not Valid Figure 3 Write Data in Memory or Peripherals ------------------------------------ HD6802------------------------------------ • MPU REGISTERS • Index Register (IX) A general block diagram of the HD6802 is shown in Fig. 4. The index register is a two byte register that is used to store As shown, the number and configuration of the registers are the data or a sixteen bit memory address for the Indexed mode of same as for the HD6800. The 128 x 8 bit RAM has been memory addressing. added to the basic MPU. The first 32 bytes may be operated in a • Accumulators (ACCA, ACCB) low power mode via a Vee standby. These 32 bytes can be The MPU contains two 8-bit accumulators that are used to retained during power-up and power-down conditions via the hold operands and results from an arithmetic logic unit(ALU). RE signal. • Condition Code Register (CCR) The MPU has three 16-bit registers and three 8-bit registers The condition code register indicates the results of an available for use by the programmer (Fig. 5). Arithmetic Logic Unit operation: Negative(N), Zero(Z), Over- • Program Counter (PC) flow(V), Carry from bit7(C), and half carry from bit3(H). These The program counter is a two byte (16-bit) register that bits of the Condition Code Register are used as testable points to the current program address. conditions for the conditional branch instructions. Bit 4 is the • Stack Pointer (SP) interrupt mask bit(I). The used bits of the Condition Code The stack pointer is a two byte (16-bit) register that contains Register (B6 and B7) are ones. the address of the next available location in an external Fig. 6 shows the order of saving the microprocessor status push-down/pop-up stack. This stack is normally a random access within the stack. Read/Write memory that may have any location (address) that is convenient. In those applications that require storage of information in the stack when power is lost, the stack must be non-volatile. MR 3 E 37 R"ES 40 NMI 6 HALT 2 Clock ~4 Instruction EXTAL 39 Decode and XTAL 38 Control BA 7 VMA 5 R/W 34 26 27 28 29 30 31 32 33 Vee = Pins 8,35 07 06 Os 04 03 O 2 D) Do VSS = Pins 1,21 Figure 4 Expanded Block Diagram 41 HD6802---------------------------------- 7 0 I ACCA I Accumulator A 7 0 I ACCB I Accumulator B 15 0 I15 IX 0 I Index Register I15 PC I 0 Program Counter I SP I Stack Pointer 0 ' - - - - Interrupt mask ' - - - - - H a l f Carry (From Bit3) Figure 5 Programming Model of The Microprocessing Unit !.....--/ ~ m- 9 m-8 m-7 SP m-6 CC -- SP = Stack Pointer m- 5 ACCB CC = Condition Codes (Also called the Processor Status Byte) ACCB = Accumulator B m-4 ACCA ACCA = Accumulator A m-3 IXH IXH = Index Register, Higher Order 8 Bits IXl = Index Register, lower Order 8 Bits m- 2 m-2 IXl PCH = Program Counter, Higher Order 8 Bits m_1 "'c.>" C\l PCl = Program Counter, lower Order 8 Bits m-1 PCH en r m SP m PCl m+1 -- m+ 1 m +2 m +2 "'1l" V"-I en V---I Before After Figure 6 Saving The Status of The Microprocessor in The Stack 42 ------------------------------------H06802------------------------------------ • HD6802 MPU SIGNAL DESCRIPTION outputs to their normally inactive level. Proper operation of the MPU requires that certain control The processor is removed from the wait state by the and timing signals be provided to accomplish specific functions occurrence of a maskable (mask bit 1=0) or nonmaskable and that other signal lines be monitored to determine the state interrupt. This output is capable of driving one standard TTL of the processor. These control and timing signals for the load and 30pF. HD6802 are similar to those of the HD6800 except that • Interrupt Request (IRQ) TSC, DBE, ¢l, ¢2 input, and two unused pins have been elimi- This level sensitive input requests that an interrupt sequence nated, and the following signal and timing lines have been be generated within the machine. The processor will wait, until added. it completes the current instruction that is being executed RAM Enable (RE) before it recognizes the request. At that time, if the interrupt Crystal Connections EXTAL and XTAL mask bit in the Condition Code Register is not set, the machine Memory Ready(MR) will begin an interrupt sequence. The index Register, Program Vee Standby Counter, Accumulators, and Condition Code Register are stored Enable ¢2 Output(E) away on the stack. Next the MPU will respond to the interrupt The following is a summary of the HD6802 MPU signals: request by setting the interrupt mask bit high so that no further • Address Bus (Ao -- A 1S ) interrupts may occur. At the end of the cycle, a 16-bit address Sixteen pins are used for the address bus. The outputs are will be loaded that points to a vectoring address which is located capable of driving one standard TTL load and 90pF. in memory locations FFF8 and FFF9. An address loaded at • Data Bus (Do -- 0 7 ) these locations causes the MPU to branch to an interrupt Eight pins are used (or the data bus. It is bidirectional, routine in memory. transferring data to and from the memory and peripheral The HALT line must be in the "High" state for interrupts to devices. It also has three-state output buffers capable of driving be serviced. Interrupts will be latched internally while HALT is one standard TTL load and 130pF. "Low". Data Bus will be in the output mode when the internal RAM A 3kn external register to Vee should be used for wire-OR is accessed. This prohibits external data entering the MPU. It and optimum control of interrupts. should be noted that the internal RAM is fully decoded from • Reset (RES) $0000 to $007F. External RAM at $0000 to $007F must be This input is used to reset and start the MPU from a disabled when internal RAM is accessed. power-down condition, resulting from a power failure or an • HALT initial start-up of the processor. When this line is "Low", the When this input is in the "Low" state, all activity in the MPU is inactive and the information in the registers will be lost. machine will be halted: This input is level sensitive. If a "High" level is detected on the input, this will signal the In the halt mode, the machine will stop at the end of an MPU to begin the restart sequence. This will start execution of a instruction. Bus Available will be at a "High" state. Valid routine to initialize the processor from its reset condition. All Memory Address will be at a "Low" state. The address bus will the higher order address lines will be forced "High". For the display the address of the next instruction. restart, the last two(FFFE, FFFF) locations in memory will be To insure single instruction operation, transition of the used to load the program that is addressed by the program HALT line must not occur during the last 250ns of E and the counter. During the restart routine, the interrupt mask bit is set HALT line must go "High" for one Clock cycle. and must be reset before the MPU can be interrupted by IRQ. HALT should be tied "High" if not used. This is good Power-up and reset timing and power-down sequences are engineering design practice in general and necessary to insure shown in Fig. 7 and Fig. 8 respectively. proper operation of the part. • Non-Maskable Interrupt (NMt) • ReadlWrite (RIW) A low-going edge on this input requests that a non-mask- This TTL compatible output signals the peripherals and inter~sequence be generated within the processor. As with memory devices whether the MPU is in a Read ("High") or the IRQ signal, the processor will complete the current Write ("Low") state. The normal standby state of this signal is instruction that is being executed before it recognizes the NMI Read ("High"). When the processor is halted, it will be in the signal. The interrupt mask bit in the Condition Code Register logical one state. has no effect on NMI. This output is capable of driving one standard TTL load and The Index Register, Program Counter, Accumulators, and 9OpF. Condition Code Register are stored away on the stack. At the • Valid Memory Address (VMA) end of the cycle, a 16-bit address will be loaded that points to a This output indicates to peripheral devices that there is a vectoring address which is located in memory locations FFFC valid address on the address bus. In normal operation, this signal and FFFD. An address loaded at these locations causes the should be utilized for enabling peripheral interfaces such as the MPU to branch to a non-maskable interrupt routine in memory. PIA and ACIA. This signal is not three-state. One standard TTL A 3kn external resistor to Vee should be used for wire-OR load and 90pF may be directly driven by this active high signal. and optimum control of interrupts. • Bus Available (BA) Inputs IRQ and"NMI are hardware interrupt lines that are The Bus Available signal will normally be in the "Low" state. sampled when E is "High" and will start the interrupt routine When activated, it will go to the "High" state indicating that the on a "Low" E following the completion of an instruction. IRQ microprocessor has stopped and that the address bus is available and NMI should be tied "High" if not used. This is good en- (but not in a three-state condition). This will occur if the HALT gineering design practice in general and necessary to insure line is in the "Low" state or the processor is in the wait state proper operation of the pact. Fig. 9 is a flowchart describing the as a result of the execution of a WAI instruction. At such time, major decision paths and interrupt vectors of the microproces- all three-state output drivers will go to their off state and other sor. Table I gives the memory map for interrupt vectors. 43 -----------------------------------HD6802----------------------------------- Vcc E I--tpcs >4.25V _----------c 1 - - - - - - - . 1 4 - - - - - - _______l ___ - RES ------~--~ Option 1 (See Note below) RES -----1 Option 2 See Figure 8 for Power Down condition Jt ~~2~.O~V~----------~f~--------, O.8V O.8V RE ------------------ tPCr 01-------\ VMA --------'/ ~-------------------- (NOTE) If option 1 is chosen, RES and RE pins can be tied together. Figure 7 Power-up and Reset Timing Vcc E tPCf --l EtRE1 RE -----2-.0-V~ --tRE2 O.8V~;......._ _ _ __ Figure 8 Power-down Sequence Figure 9 MPU Flow Chart 44 -----------------------------------HD6802----------------------------------- Conditions for Crystal (4 MHz) Table 1 Memory Map for Interrupt Vectors • AT Cut Parallel resonant Vector • Co =7 pF max. MS LS Description • Rl =80n max. FFFE FFFF Restart (RES) FFFC FFFD Non-Maskable Interrupt (NMI) FFFA FFFB Software Interrupt (SWI) FFF8 FFF9 Interrupt Request (IRQ) Co Crystal Equivalent Circuit • RAM Enable (RE) A TTL-compatible RAM enable input controls the on-chip RAM of the HD6802. When placed in the "High" state, the on-chip memory is enabled to respond to the MPU controls. In the "Low" state, RAM is disabled. This pin may also be utilized to disable reading and writing the on-chip RAM during a power-down situation. RAM enable must be "Low" three cycles before Vcc goes below 4.7SV during power-down. RE should be tied to the correct "High" or "Low" state if not used. This is good engineering design practice in general and necessary to insure proper operation of the part. • EXTAL and XTAL The HD6802 has an internal oscillator that may be crystal C l = c2 = 22pF ± 20% controlled. These connections are for a parallel resonant fundamental crystal (AT cut). A divide-by-four circuit has been * R, =80n max for S type, SOn max for R type. In addition 56kn resistance shall be put externally between 38 pin and 39 pin in para- added to the HD6802 so that a 4MHz crystal may be used in llel with Crystal for R type. lieu of a IMHz crystal for a more cost-effective system. Pin39 of the HD6802 may be driven externally by a TTL input signal if ~ Figure 10 Crystal Oscillator a separate clock is required. Pin38 is to be left open in this mode. An RC network is not directly usable as a frequency source When using the crystal, see the note for Board Design of the on pins 38 and 39. An RC network type TTL or CMOS Oscillation Circuit in HD6802. oscillator will work well as long as the TTL or CMOS output • Memory Ready (MR) drives the HD6802. MR is a TTL compatible input control signal which allows If an external clock is used, it may not be halted for more stretching of E.. When MR is "High", E will be in normal than 4.5~s. The HD6802 is a dynamic part except for the operation. When MR is "Low", E may be stretched integral internal RAM, and requires the external clock to retain multiples of half periods, thus allowing interface to slow information. memories. Memory Ready timing is shown in Fig. 11. MR should be tied "High" if not used. This is good engineering design practice in general and necessary to insure proper operation of the part. A maximum stretch is 4.5~s. E 2.4V J ~0.4V ~tSMR f tPCf tPCr MR Figure 11 Memory Ready Control Function 45 ------------------------------------HD6802--------~-------------------------- • Enable (E) • MPU INSTRUCTION SET This pin supplies the clock for the MPU and the rest of the The HD6802 has a set of 72 different instructions. Included system. This is a single phase, TTL compatible clock. This clock are binary and decimal arithmetic, logical, shift, rotate, load, may be conditioned by a Memory Ready Signal. This is store, conditional or unconditional branch, interrupt and stack equivalent to <1>2 on the HD6800. manipulation instructions. • Vee Standby This instruction set is the same as that for the This pin supplies the dc voltage to the first 32 bytes of RAM 6800MPU(HD6800 etc.) and is not explained again in this as well as the RAM Enable (RE) control logic. Thus retention of data sheet. data in this portion of the RAM on a power up, power-down, or standby condition is guaranteed at the range of 4.0 V to 5.25 V. • NOTE FOR BOARD DESIGN OF THE OSCILLATION Maximum current" drain at 5.25V is 8mA. CIRCUIT IN HD6802 In designing the board, the following notes should be taken when the crystal oscillator is used. 56kn resistance shall be put externally between 38 pin and 39 pin in parallel with crystal for R type. ______ Crystal oscillator and load capacity CL must be placed near ____ the LSI as much as possible. ~ [NOrmal oscillation may be disturbed when external noise is] 39 F-=---__-~. rh induced to pin 38 and 39. 38 ~';";';;:..4----I~ HD6802 ~ Pin 38 signal line should be wired apart from pin 37 signal line as much as possible. Don't wire them in parallel, or normal oscillation may be disturbed when E signal is feedbacked to XTAL. The following design must be avoided. Must be avoided ii ~ ~ / \\ -+__----l._....:.-_ _ _ _ _ Signal C A signal line or a power source line must not cross or go near the oscillation circuit line as shown in the left figure to prevent the induction from these lines and perform the correct oscillation. The resistance among XTAL, EXT AL and other pins 38 should be over 10Mn. HD6802 46 -----------------------------------H06802----------------------------------- Example of Board Design using the crystal oscillator ~Other signals are not wired in this area . . / E signal is wired apart from 38 pin /' and 39 pin. HD6802 47 HD6809, HD68A09, HD68B09---- MPU (Micro Processing Unit) The H06809 is a revolutionary high performance 8-bit microprocessor which supports modern programming tech- niques such as position independence, reentrancy, and modular programming. This third-generation addition to the HMCS6800 family has major architectural improvements which include additional registers, instructions and addressing modes. The basic instructions of any computer are greatly enhanced by the presence of powerful addressing modes. The HD6809 has the most complete set of addressing modes available on any 8-bit microprocessor today. The H06809 has hardware and software features which make it an ideal processor for higher level language execution or standard controller applications. HD6809P, HD68A09P, HD68B09P HD46800D COMPA TI BLE • Hardware - Interfaces with All HMCS6800 Peripherals • Software - Upward Source Code Compatible Instruc- tion Set and Addressing Modes • ARCHITECTURAL FEATURES • Two l6-bit Index Registers • Two l6-bit Indexable Stack Pointers • Two 8-bit Accumulators can be Concatenated to Form One l6-Bit Accumulator • Direct Page Register Allows Direct Addressing Through- out Memory • PIN ARRANGEMENT HALT XTAL • HARDWARE FEATURES EXTAL 1m • On Chip Oscillator MRDY • DMA/BREQ Allows DMA Operation or Memory Refresh Q E • Fast Interrupt Request Input Stacks Only Condition HD6809 Ao Code Register and Program Counter A, R/W D. • MRDY Input Extends Data Access Times for Use With 0, Slow Memory (Top View) 0, 0, • Interrupt Acknowledge Output Allows Vectoring By D. Devices A, 15 0, ~:, • SYNC ACknowledge Output Allows for Synchronization to External Event ::oLJ:: All 1 A14 • Single Bus-Cycle RESET Au Au • Single 5-Volt Supply Operation • NMI Blocked After RESET Until After First Load of • SOFTWARE FEATURES Stack Pointer • 10 Addressing Modes • Early Address Valid Allows Use With Slower Memories • HMCS6800 Upward Compatible Addressing Modes • Early Write-Data for Dynamic Memories • Direct Addressing Anywhere in Memory Map • Compatible with MC6809, MC68A09 and MC68B09 • Long Relative Branches • Program Counter Relative • True Indirect Addressing 48 • Expanded Indexed Addressing: HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - 0, 5, 8, or 16-bit Constant Offsets 8, or 16-bit Accumulator Offsets Auto-Increment/Decrement by 1 or 2 • Improved Stack Manipulation • 1464 Instructions with Unique Addressing Modes • 8 x 8 Unsigned Multiply • 16·bit Arithmetic • Transfer/Exchange All Registers • Push/Pull Any Registers or Any Set of Registers • Load Effective Address • BLOCK DIAGRAM ,......--_ DMA/BREQ R/W HALT BA BS """'---XTAL EXTAL MRDY ~-......;~E "-----~ Q • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3-+7.0 V Input Voltage Vin * -0.3- +7.0 V Operating Temperature Topr -20 - +75 °c Storage Temperature Tstg -55 - +75 °c * With respect to Vss (SYSTEM GND) (NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. 49 HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V V'L * -0.3 - O.S V Input Voltage I Logic 2.0 - Vee * V'H * V I~ 4.0 - Vee * Operating Tempe-rature Topr -20 25 75 °c * With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vcc=5V±5%, VSS=O, Ta=-20"'+75°C, unless otherwise noted.) Item Symbol Test Condition min typ* max Unit Logic, EXTAL 2.0 - Vee Input "High"Voltage V'H V RES 4.0 - Vee IFlput "Low" Voltage Logic, EXTAL, RES V'L -0.3 - O.S V I nput Leakage Current Logic lin Vin=0"'5.25V, Vee max. - 1.0 2.5 pA Do"'D7 l'oad=-205pA, Vee min. 2.4 - - Output "High" Voltage VOH A o"'A 15 , R/W, - - l'oad=-145pA, Vee min. 2.4 V 0, E BA, BS l'oad=-100pA, Vee min. 2.4 - - Output "Low" Voltage VOL I'oad= 2.0mA, Vee min. - - 0.5 V Power Dissipation Po - - 1.0 W Do"'D7 - 10 15 Vin=OV, Ta=25°C, pF Input Capacitance Logic Inputs, Cin f=1.0MHz - 7 10 EXTAL A o"'A 15 , R/w, Vin=OV, Ta=25°C, - - 12 pF Output Capacitance BA, BS Cout f=1.0MHz Three-State (Off State) Do"'D7 - 2 10 ITs, Vin =0.4"'2.4V, Vee max. pA I nput Current Ao"'A15, R/W - - 100 • AC CHARACTERISTICS 1. READ/WRITE TIMING HD6S09 HD6SA09 HD68B09 Item Symbol Test Condition Unit min typ max min typ max min typ max Frequency of Operation - - 8 MHz fXTAL - - 4 - 6 - (Crystal or External Input) Cycle Time tcye 1000 - - 667 - - 500 - - ns Total Up Time tUT 975 - - 640 - - 480 - - ns Peripheral Read Access Time tAee 695 - - 440 - - 330 - - ns (tuT-tAo-tosR=tAee) Data Set Up Time (Read) tOSR SO - - 60 - - 40 - - ns Input Data Hold Time tOHR 10 - - 10 - - 10 - - ns (to be continued) 50 HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - HD6809 HD68A09 HD68B09 Item Symbol Test Condition Unit min typ max min typ max min typ max Output Data Hold Time tOHW 20 - - 20 - - 20 - - ns Address Hold Time (Address. R/W) tAH 10 - - 10 - - 10 - - ns Address Delay tAO --- - 200 - - 140 - - 110 ns Data Delay Time (Write) toow - - 225 - - 180 - - 145 ns E10w to '4,igh Time t AVS - - 250 - - 165 - - 125 ns Address Valid to '4,igh tAo 50 - - 25 - - 15 - - ns Processor Clock" Low" tpwEL 450 - - 295 - - 210 - - ns Processor Clock "High" tpWEH 450 - - 280 - - 220 - - ns MRDY Set Up Time tpCSM 125 - - 125 - - 125 - - ns Interrupts Set Up Time tpcs 200 - - 140 - - 110 - - n,s HAL T Set Up Time tpCSH 200 - - 140 - - 110 - - ns RES Set Up Time t pCSR 200 - - 140 - - 110 - - ns DMA/BREQ Set Up Time t pcso 125 - - 125 - - 125 - - ns Crystal Osc Start Time t RC 100 - - 100 - - 100 - - ms E Rise and Fall Time t Er • tEf - - 25 - - 25 - - 20 ns Processor Control Rise/Fall t pCr • tpCf --- - 100 - - 100 - - 100 ns Q Rise and Fall Time tOr. tOf - - 25 - - 25 - - 20 ns Q Clock "High" tpwo H 450 - - 280 - - 220 - - ns ' " - - - - - - - - - - - - tcyc - - - - - - - - - 2.4V 2.4 E O.5V O.5V 1 - - - - - tpWE H ------1-1 ~-----------tUT------------~ Q R/W ADDR BA.BS* ______~~~~-~~--~------------------------------~~~~-- ~-~------tACC------~ 1----"'-'='-'-'--.1 Data---------------------------------------c~ ~~ NotValid *Hold for BA. BS not specified Figure 1 Read Data from Memory or Peripherals 51 HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - E ----~-----tpWOH+-----~ tOr tOf Q .5V R/W AOOR BA,BS* --~~~~---~~--~--------------------------------_r~- tDDW-----~ Data Data Valid ~~ Not Valid *Hold time for BA, BS not specified Figure 2. Write Data to Memory or Peripherals • Accumulators (A, B, D) The A and B registers are general purpose accumulators S.OV which are used for arithmetic calculations and manipulation of data. . Certain instructions concatenate the A and B registers to RL=1.8k form a single 16·bit accumulator. This is referred to as the D register, and is formed with the A register as the most significant b~~ . Test Point ~~.........--Mt--i • Direct Page Register (DP) c The Direct Page Register of the HD6809 serves to enhance the Direct Addressing Mode. The content of this register appears at the higher address outputs (As-AI 5) during Direct Address- ing Instruction execution. TQ.is allows the direct mode to be used at any place in memory, under program control. To ensure C = 30pF for BA, BS R= 11knfor 0 0 -0 7 H046800D compatibility, all bits. of this register are cleared 130pF for 0 0 -0 7 , E, Q 16kn for Ao-A ls ' E, Q, R/W 90pF for Ao-A ls ' R/W 24kn for BA, BS during Processor Reset. All diodes are 1S2074 @or equiv. • Index Registers (X, Y) Figure 3 Bus Timing Test Load The Index Registers are used in indexed mode of addressing. The 16·bit address in this register takes part in the calculation of effective addresses. This address may be used to point to data directly or may be modified by an optional constant or register • PROGRAMMING MODEL offset. During some indexed modes, the contents of the index As shown in Figure 4, the HD6809 adds three registers to the register are incremented and decremented to point to the next set available in the HD 6800. The added registers include a item of tabular type, data. All four pointer registers (X, Y, U, S) Direct Page Register, the User Stack pointer and a second Index may be used as index registers. Register. 52 HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - - 15 o x - Index Register Y - Index Register } Po;n", Rog;",,, U - User Stack Pointer S - Hardware Stack Pointer PC Program Counter \ A I B I Acuu mu lators v D 7 0 .I. _____D_P_ _ _ _~I Direct Page Register 7 0 I ElF I H II I Iz I I I cc - N V C Condition Code Register Figure 4 Programming Model of The Microprocessing Unit • Stack Pointer (U, S) • CONDITION CODE REGISTER DESCRIPTION The Hardware Stack Pointer (S) is used automatically by the processor during subroutine calls and interrupts. The stack • Bit 0 (C) pointers of the HD6809 point to the top of the stack, in Bit 0 is the carry flag, and is usually the carry from the contrast to the HD46800D stack pointer, which pointed to the binary ALU. C is also used to represent a 'borrow' from subtract next free location on the stack. The User Stack Pointer (U) is like instructions (CMP, NEG, SUB, SBC) and is the complement controlled exclusively by the programmer thus allowing argu- of the carry from the binary ALU. ments to be passed to and from subroutines with ease. Both Stack Pointers have the same indexed mode addressing capabil- • Bit 1 (V) ities as the X and Y registers, but also support Push and Pull Bit 1 is the overflow flag, and is set to a one by an operation instructions. This allows the HD6809 to be used efficiently as a which causes a signed two's complement arithmetic overflow. stack processor, greatly enhancing its ability to support higher This overflow is detected in an operation in which the carry level languages and modular programming. from the MSB in the ALU does not match the carry from the MSB-l. • Program Counter The Program Counter is used by the processor to point to the • Bit 2 (Z) address of the next instruction to be executed by the processor. Bit 2 is the zero flag, and is set to a one if the resul t of the Relative AddreSSing is provided allowing the Program Counter previous operation was identically zero. to be used like an index register in some situations. • Bit 3 (N) Bit 3 is the negative flag, which contains exactly the value of • Condition Code Register the MSB of the result of the preceding operation. Thus, a The Condition Code Register defines the State of the negative two's-complement result will leave N set to a one. Processor at any given time. See Fig. 5. • Bit 4 (I) Bit 4 is the IRQ mask bit. The processor will not recognize interrupts from the IRQ line if this bit is set to a one. NMI, FIRQ, iRQ, RES, and SWI all are set I to a one; SWI2 and SW13 Carry do not affect I. Overflow '-----Zero • Bit 5 (H) ' - - - - - - - Negative '--------IRQMask Bit 5 is the half-carry bit, and is used to indicate a carry· from ' - - - - - - - - - - Half Carry bit 3 in the ALU as a result of an 8-bit addition only (ADC or ' - - - - - - - - - - - FIRQ Mask ADD). This bit is used by the DAA instruction to perform a ' - - - - - - - - - - - - Entire Flag BCD decimal add adjust operation. The state of this flag is undefined in all subtract-like instructions. Figure 5 Condition Code Register Format • Bit 6 (F) Bit 6 is the FIRQ mask bit. The processor will not recognize interrupts from the FIRQ line if this bit is a one. NMI, FIRQ, SWI, and RES all set F to a one. IRQ; SWI2 and SWI3 do not HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - - affect F. "Low" while "RES is still "Low". IfDAM/BREQ and HALT are both pulled "Low", the processor will reach the last cycle of the • Bit 7 (E) instruction (by reverse cycle stealing) where the machine will Bit 7 is the entire flag, and when set to a one indicates that then become halted. See Figs. 8 and 16. the complete machine state (all the registers) was stacked, as opposed to the subset state (pC and CC). The E bit of the • Bus Available, Bus Status (BA, BS) stacked CC is used on a return from interrupt (RTI) to The BA output is an indication of an internal control signal determine the extent of the un stacking. Therefore, the current which makes the MOS buses of the MPU high impedance. This E left in the Condition Code Register represents past action. signal does not imply that the bus will be available for more than one cycle. When BA goes "Low", an additional dead cycle • SIGNAL DESCRIPTION will elapse before the MPU acquires the bus. The BS output signal, when decoded with BA, represents the • Power (Vss, Vcd MPU state (valid with leading edge of Q). Two pins are used to supply power to the part: VSS is ground or 0 volts, while VCC is +5.0V ±5%. • Address Bus (A o-A 15 ) Table 1 MPU State Definition Sixteen pins are used to output address information from the BA BS MPU State MPU onto the Address Bus. When the processor does not require the bus for a data transfer, it will output address 0 0 Normal (Running) FFFF 16, R/W = "High", and BS = "Low"; this is a "dummy 0 1 Interrupt or RESET Acknowledge access" or VMA cycle. Addresses are valid on the rising edge of 1 0 SYNC Acknowledge Q (see Figs. 1 and 2). All address bus drivers are made high 1 1 HALT or Bus Gfant impedance when output Bus Availalbe (BA) is "High". Each pin will drive one Schottky TTL load or four LS TTL loads, and typically 90 pF. Interrupt Acknowledge is indicated during both cycles of a hardware-vector-fetch (RES, NMI, FIRQ, IRQ, SWI, SWI2, • Data Bus (Do -0 7 ) SWB). This signal, plus decoding of the lower four address lines, These eight pins provide communication with the system can provide the user with an indication of which interrupt level bi-directional data bus. Each pin will drive one Schottky TTL is being serviced and allow vectoring by device. See Table 2. load or four LS TTL loads, and typically 130 pF. Sync Acknowledge is indicated while the MPU is waiting for external synchronization on an interrupt line. • ReadlWrite (RIW) Halt/Bus Grant is true when the HD6809 is in a Halt or Bus This signal indicates the direction of data transfer on the data Grant condition. bus. A "Low" indicates that the MPU is writing data onto the data bus. R/W is made high impedance when BA is "High". R/W Table 2 Memory Map for I nterrupt Vectors is valid on the rising edge of Q. Refer to Figs. 1 and 2. Memory Map For • Reset (RES) Vector locations Interrupt Vector A "Low" level on this. Schmitt-trigger input for greater than Description MS lS one bus cycle will reset the MPU, as shown in Fig. 6. The Reset vectors are fetched from locations FFFE16 and FFFF 16 (Table FFFE FFFF RES 2) when Interrupt Acknowledge is true, (BA • BS=I). During FFFC FFFD NMI initial power-on, the Reset line should be held ~'Low" until the FFFA FFFB SWI clock oscillator is fully operational. See Fig. 7. FFF8 FFF9 IRQ Because the HD6809 Reset pin has a Schmitt-trigger input FFF6 FFF7 FIRQ FFF4 FFF5 SWI2 with a threshold voltage higher than that of standard peripherals, a simple R/C network may be used to reset the entire system. FFF2 FFF3 SWI3 This higher threshold voltage ensures that all peripherals are out FFFO FFFl Reserved of the reset state before the Processor. • HALT • Non Maskable Interrupt (NMI)* A "Low" level on this input pin will cause the MPU to stop A negative edge on this input requests that a nonmaskable running at the end of the present instruction and remain halted interrupt sequence be generated. A non-maskable interrupt indefinitely without loss of data. When halted, the BA output is cannot be inhibited by the program, and also has a higher driven "High" indicating the buses are high impedance. BS is priority than FIRQ, IRQ or software interrupts. During recogni- also "High" which indicates the processor is in the Halt or Bus tion of an NMI, the entire machine state is saved on the Grant state. While halted, the MPU will not respond to external hardware stack. After reset, an NMI will not be recognized until real-time requests (FIRQ, IRQ) although DMA/BREQ will the first program load of the Hardware Stack Pointer (S). The always be accepted, and NMI or RES will be latched for later pulse width of NMI "Low" must be at least one E cycle. If the response. During the Halt state Q and E continue to run NMI input does not meet the minimum set up with respect to normally. If'the MPU is not running (RES, DMA/BREQ), a Q, the interrupt will not be recognized until the next cycle. See halted state (BA· BS=l) can be achieved by pulling HALT Fig. 9. 4.75V Voo A~".::,' '\\\'0.~\~Yf '-------.J\"ew PC + }C'"--.J' '-_-',_--' '--_.I ,_--' Rm$SS\\\\\\sf~ ~~ sst\\\\\\\~ f~ BA0§\§\~~ VMJI Hr--------------------------------------------- \\\\\ill\{~ I \ rf ,- \ ....._ _ __ % C (I) at Figure 6 RES Timing o JD % C (I) 0'1 0'1 ~ Voo 4.75V $ % C (I) E at ---1---4 III o CD RES tRC HD6809 Yt C in Cout 38 Y, 39 8 MHz 6 MHz 4 MHz 18 pF 20 pF 22pF 18 pF 20 pF 22 pF D GnI T Cout Figurtl 7 Crystal Connections and Oscillator Start Up 2f1d To Last Last Cycle CYcle Of Of r" Current Inst. I Current Inst. Dead 'I_ Cycle .1' If- Halted Dead Cycle. Instructiof\lnstruction I Fetch _I Execute I Dead Cycle 'I_ Halted a---uL~ HALT M f \ /I BS / Sf \ :x: c en ~~!a ==X=~J <=JC:)~- C» C) I nstruct ion !P Opcode :x: Figure 8 HALT and Single Instruction Execution for System Debug c m 01 en ~ C) 1_ Im+l Im+21 m+3 !P ,- T l- T :x: C Q~ m C» CD C) CD Address ~~r----"\.r--~r----"\.r---'"\.~~r----"\.~r----"\.r--\r--\.~r----"\.r---"-~~r---'"\.~r-­ Bus Instruction PCl PCH USl USH IYL IYH IXl IXH DP ACCB ACCA CCR VMA New PCH New PCl VMA 1s1InSI. 01 Interrupt Service Routine R/W ~ \ I ~ BA 0SSSSS\ BS §\\\\\\ / \'------- Figure 9 I RQ and NMT Interrupt Timing HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - a Addreu Bus _,r-'"T""'\.,.-.....,.r_-. . . ,-___,._-. . . J--'\.,.-.....,.~- . . . ,-___,._-. . . ~--~,...-_,r_-'\.r-- Data Bus Instruction PCL PCH CCR New PCH New PCL VMA 1st Inst. Of Interrupt Service Routine RIW~ \..._____.J! BA~ §\\\\\\\ BS ! \~-------- Figure 10 FIRO Interrupt Timing • Fast-Interrupt Request (FIRO)* • XTAL, EXTAL A "Low" level on this input pin will initiate a fast interrupt These inputs are used to connect the on-chip oscillator to an sequence provided its mask bit (F) in the CC is clear. This external parallel-resonant crystal. Alternately, the pin EXTAL se~nce has priority over the standard Interrupt Request may be used as a TTL level input for external timing by (IRQ), and is fast in the sense that it stacks only the contents of grounding XTAL. The crystal or external frequency is four the condition code register and the program counter. The times the bus frequency. See Fig. 7. Proper RF layout interrupt service routine should clear the source of the interrupt techniques should be observed in the layout of printed circuit before doing an RTI. See Fig. 10. boards. • Interrupt Request (lRQ)* • E,Q A "Low" level input on this pin will initiate an interrupt E is- similar to the HD6800 bus timing signal C/J2; Q is a Request sequence provided the mask bit (I) in the CC is clear. quadrature clock signal which leads E. Q has no parallel on the Since IRQ stacks the entire machine state it provides a slower HD6800. Addresses from the MPU will be valid with the response to interrupts than FIRQ. IRQ also has a lower priority leading edge of Q. Data is latched on the falling edge of E. than FIRQ. Again, the interrupt service routine should clear the Timing for E and Q is shown in Fig. 11. source of the interrupt before doing an RTI. See Fig. 9. • MRDY * NMI, FIRQ and IRQ requests are latched by the falling This input control signal allows stretching of E and Q to edge of every Q, except during cycle stealing operations extend data-access time. E and Q operate normally while MRDY (e.g., DMA) where only NMI is latched. From this point, is "High". When MRDY is "Low", E and Q may be stretched in a delay of at least one bus cycle will occur before the integral multiples of quarter (1/4) bus cycles, thus allowing interrupt is serviced by MPU. interface to slow memories, as shown in Fig. 12. A maximum Start of Cycle End of Cycle! Latch Datal I I E ---x_O_.s_V_ _ _ _ _ _ 1 ~ o.sv Q l-- 1~~------..... I I tAVS 2~ \ ~.--~I---- :I I Address Valid I Figure 11 E/Q Relationship 57 HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - \1 ff-~ r \_.-----J/ -\-2.4V , _ _ _ ~ ,'-.:_----- 1 Q / \'--_---J/ \: fS~_-----J/ ~ tPCSM I '\\\\\i .! \. MRDY O.8V I Figure 12 MRDY Timing stretch is 10 microseconds. During nonvalid memory access and trailing dead cycle. See Fig. 14. (WA cycles) MRDY has no effect on stretching E and Q; this, Typically, the DMA controller will request to use the bus by inhibits slowing the processor during "don't care" bus accesses. asserting DMA/BREQ pin "Low" on the leading edge of E. MRDY may also be used to stretch docks (for slow memory) When the MPU replies by setting BA and BS to a one, that cycle when bus control has been transferred to an external device will be a dead cycle used to transfer bus mastership to the DMA (through the use of HALT and DMA/BREQ). controller. False memory accesses may be prevented during and dead • DMA/BREQ cycles by developing a system DMAYMA signal which is "Low" The DMA/BREQ input provides a method of suspending in any cycle when BA has changed. execution and acquiring the MPU bus for another use, as shown When BA goes "Low" (either as a result of DMA/BREQ = in Fig. 13. Typical uses include DMA and dynamic memory "High" or MPU self-refresh), the DMA device should be taken refresh. off the bus. Another dead cycle will elapse before the MPU Transition of.DMA/BREQ should occur during Q. A "Low" accesses memory, to allow transfer of bus mastership without level on this pin will stop instruction execution at the end of the contention. current cycle. The MPU will acknowledge DMA/BREQ by setting BA and BS to a one. The requesting device will now have • MPU Operation up to 15 bus cycles before the MPU retrieves the bus for During normal operation, the MPU fetches an instruction self-refresh. Self-refresh requires one bus cycle with a leading from memory and then executes the requested function. This MPU DEAD DMA DEAD MPU E Q DMA/BREQ 2.0V ~tPcsc BA, BS \_-- DMAVMA* \'--_--1/ ADDR (MPU) ______~)~-------------------~c ADDR ( ) (DMAC) ----------------------~~_______________________________________J~---------- *DMAVMA is a signal which is developed externally. but is a system requirement for DMA. Figure 13 Typical DMA Timing «14 Cycles) 58 HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - IOEAOIl-oo-----------14 OMA CyCleS------------II-~IOEAOI MPU IOEA~OMA _ _ 1 I I I I I 1 I I E Q 1 1 I DMA/BREQ \1 I 1 I I I I I SA, SS ---YI I I I ~I I 1 I rI I I I DMAVMA*~ v---\J *DMAVMA is a signal which is developed externally, but is a system requirement for DMA. Figure 14 Auto - Refresh DMA Timing (Reverse Cycle Stealing) sequence begins at RES and is repeated indefinitely unless • Immediate Addressing altered by a special instruction or hardware occurrence. Soft- In Immediate Addressing, the effective address of the data is ware instructions that alter normal MPU operation are: SWI, the location immediately following the opcode (Le., the data to SWI2. SWI3. CWAI, RTI and SYNC. An interrupt, HALT or be used in the instruction immediately follows the opcode of DMA/BREQ can also alter the normal execution of instructions. the instruction). The HD6809 uses both 8 and 16-bit immediate Fig. 15 illustrates the flow chart for the HD6809. values depending on the size of argument specified by the opcode. Examples of instructions with Immediate Addressing are: • ADDRESSING MODES LDA #$20 The basic instructions of any computer are greatly enhanced LDX #$FOOO by the presence of powerful addressing modes. The HD6809 has LDY:OCAT the most complete set of addressing modes available on any (NOTE) # signifies Immediate addressing, $ signifies hexa- microcomputer today. For example, the HD6809 has 59 basic decimal value. instructions; however, it recognizes 1464 different variations of instructions and addressing modes. The addressing modes • Extended Addressing support modern programming techniques. The following ad- In Extended Addressing, the contents of the two bytes dressing modes are available on the FID6809: immediately following the opcode fully specify the l6-bit Inherent (Includes Accumulator) effective address used by the instruction. Note that the address Immediate generated by an extended instruction defines an absolute Extended address and is not position independent. Examples of Extended Extended Indirect Addressing include: Direct LDA CAT Register STX MOUSE Indexed LDD $2000 Zero-Offset Constant Offset • Extended Indirect Accumulator Offset As a special case of indexed addressing ( discussed below). Auto Increment/Decrement " 1" level of indirection may be added to Exten.ded Addressing. Indexed Indirect In Extended Indirect, the two bytes following the postbyte of Relative an Indexed instruction contain the address of the data. Short/Long Relative Branching LDA [CAT] Program Counter Relative Addressing LDX [$FFFE] STU [DOG] • Inherent (Includes Accumulator) In this addressing mode, the opcode of the instruction • Direct Addressing contains all the address information necessary. Examples of Direct addressing is similar to extended addressing except Inherent Addressing are: ABX, DAA, SWI, ASRA, and CLRB. that only one byte of address follows the opcode. This byte specifies the lower 8-bit of the address to be used. The upper 8-bit of the address are supplied by the direct page register. Since only one byte of address is required in direct addressing, this mode requires less memory and executes faster than extended addressing. Of course, only 256 locations (one page) can be 59 'FiRQ.'F Logic Disarm NMI ----,.- % C G) CD 0 !P % C G) 0> 0 I~;;~;i F"F;j: I 1 I~ ISWI IFFFAII ~ 0 !P % C G) CD m 0 U) HD6809 I nterrupt Structure Bus State BA BS Running o o I nterrupt or Reset Acknowledge o Sync o Halt/Bus Grant (NOTE) Asserting RES will result in entering the reset sequence from any point in the flow chart. Figure 15 Flowchart for HD6809 Instruction HD6809, HD68A09, HD68B09 - - - - - - - - - - - - - accessed without redefining the contents of the DP register. Post-Byte Register Bit Indexed Since the DP register is set to $00 on Reset, direct addressing on Addressing 7 6 5 4 3 2 1 0 Mode the HD6809 is compatible with direct addressing on the 0 R R x x x x x EA = ,R + 5 Bit Offset HD6800. Indirection is not allowed in direct addressing. Some examples of direct addressing are: 1 R R 0 0 0 0 0 ,R + LDA $30 1 R R 0/1 0 0 0 1 ,R ++ SETDP $10 (Assembler directive) 1 R R 0 0 0 1 0 ,-R LDB $1030 1 R R 0/1 0 0 1 1 ,- - R LDD 2 Clock. the corresponding Data Direction Register bit for those lines This signal must be continuous clock pulse. which are to be outputs. A "0" in a bit of the Data Direction • PIA ReadlWrite (RIW) Regist~r causes the corresponding peripheral data line to act as This signal is generated by the MPU to control the direction an input. During an MPU Read Peripheral Data Operation, the of data transfers on the Data Bus. A "Low" state on the PIA data on peripheral lines programmed to act as inputs appears line enables the input buffers and data is transferred from the directly on the corresponding MPU Data Bus lines. MPU to the PIA on the E signal if the device has been selected. The data in Output Register A will appear on the data lines A "High" on the R/W line sets up the PIA for a transfer of data that are programmed to be outputs. A logical "1" written into to the bus. The PIA output buffers are enabled when the proper the register will cause a "High" on the corresponding data line address and the enable pulse E are present. while a "0" results in a "Low". Data in Output Register A may • Reset (RES) be read by an MPU "Read Peripheral Data A" operation when The active "Low" RES line is used to reset all register bits in the corresponding lines are programmed as outputs. This data the PIA to a logical zero "Low". This line can be used as a will be read properly if the voltage on the peripheral data lines is power-on reset and as a master reset during system operation. greater than 2.0 volts for a logic "I" output and less than 0.8 • PIA Chip Select (CS o , CS l and CS 2 ) volt for a logic "0" output. Loading the output lines such that These three input signals are used to select the PIA. CS o and the voltage on these lines does not reach full voltage causes the CS l must be "High" and CS2 must be "Low" for selection of data transferred into the MPU on a Read operation to differ the device. Data transfers are then performed under the control from that contained in the respective bit of Output Register A. of the E and RfWsignals. The chip select lines must be stable • Section B Peripheral Data (PB o"'PB7 ) for the duration of the E pulse. The device is deselected when The peripheral data lines in the B Section of the PIA can be any of the chip selects are in the inactive state. programmed to act as either inputs or outputs in a similar • PIA Register Select (RS o and RS 1 ) manner to PAo"'PA 7 • However, the output buffers driving The two register select lines are used to select the various these lines differ from those driving lines PAo-PA7 • They have registers inside the PIA. These two lines are used in conjunction three-state capability, allowing them to enter a high impedance with internal Control Registers to select a particular register that state when the peripheral data line is used as a input. In is to be written or read. addition, data on the peripheral data lines PBo'" PB 7 will be The register and chip select lines should be stable for the read properly from those lines programmed as outputs even if duration of the E pulse while in the read or write cycle. the voltages are below 2.0 volts for a "High". As outputs, these • Interrupt Request (I RnA and IROB) lines are compatible with standard TTL and may also be used as The active "Low" Interrupt Request lines (IRQA and IRQB) a source of up to 2.5 milliampere (typ.) at 1.5 volts to directly act to interrupt the MPU either directly or through interrupt drive the base of a transistor switch. priority circuitry. These lines are "open drain" (no load device • Interrupt Input (CAl and CB 1 ) on the chip). This permits all interrupt request lines to be tied Peripheral Input lines CAl and CB l are input only lines that together in a wire-OR configuration. set the interrupt flags of the control registers. The active Each IRQ...line has two internal interrupt flag bits that can transition for these signals is also programmed by the two cause the IRQ line to go "Low". Each flag bit is associated with control registers. a particular peripheral interrupt line. Also four interrupt enable • Peripheral Control (CA2 ) bits are provided in the PIA which may be used to inhibit a The peripheral control line CA2 can be programmed to act as particular interrupt from a peripheral device. an interrupt input or as a peripheral control output. As an Servicing an interrupt by the MPU may be accomplished by a output, this line is compatible with standard TTL. The function software routine that, on a prioritized basis, sequentially reads of this signal line is programmed with Control Register A. and tests the two control registers in each PIA for interrupt flag • Peripheral Control (CB 2 ) bits that are set. Peripheral Control line CB2 may also be programmed to act as an interrupt input or peripheral control output. As an input, HD6821, HD68A21, HD68B21 - - - - - - - - - - - - - this line has "High" input impedance and is compatible with • INTERNAL CONTROLS standard TTL. As an output it is compatible with standard TTL There are six locations within the PIA accessible to theMPU and may also be used as a source of up to 2.5 milliampere (typ) data bus: two Peripheral Registers, two Data Direction Re- at 1.5 volts to directly drive the base of a transistor switch. This gisters, and two Control Registers. Selection of these locations is line is programmed by Control Register B. controlled by the RS o and RS l inputs together with bit 2 in the (NOTE) 1. Interrupt inputs CAt, CA2 , CB t and CB2 shall be Control Register, as shown in Table 1. used at normal "High" level. When interrupt inputs are "Low" at reset (RES = "Low"), interrupt flags CRA6, CRA7, CRB6 and CRB7 may' be set. Table 1 Internal Addressing 2. Pulse width of interrupt inputs CAt, CA2 ,CB t and Control CB2 shall be greater than a E cycle time. In the case Register Bit that "High" time of E signal is not contained in RS, RS o CRA2 CRB2 Location Selected Interrupt pulse, an interrupt flag may not be set. 0 0 1 x Peripheral Register A* 0 0 0 x Data Direction Register A 0 l x x Control Register A 1 0 x 1 Peripheral Register B* 1 0 x 0 Data Direction Register B 1 1 x x Control Register B • The equivalent Circuit of the Lines on Peripheral side x = Don't Care * Peripheral interface register is a generic term containing peripheral The equivalent circuit of the lines on Peripheral side is shown data bus and output register. in Fig. 15. The output circuits of A port is different from that of B port. When the port is used as input, the input is pullup to Vee side through load MOS in A port and B port becomes "Off' (high impedance). • Initialization A "Low" reset line has the effect of zeroing all PIA registers. This will set PAo-PA" PBo-PB" CA2 and CB2 as inputs, and all interrupts disabled. The PIA must be configured during the +5V restart program which follows the reset. Details of possible configurations of the Data Direction and Control Register are as follows. To Data Bus -----I~< t - - - - - - - + - - + - + P A x • Data Direction Registers (DORA and DDRB) FromORA>-_ _~~_~ ~~_~ The two Data Direction Registers allow the MPU to control the direction of data through each corresponding peripheral data line. A Data Direction Register bit set at "0" configures the corresponding peripheral data line as an input; a "I" results in an output. (a) Section A • Control Registe" (CRA and CRB) The two Control Registers (CRA and CRB) allow the MPU to control the operation of the four peripheral control lines CAl, CA2 ,CB t and CB2 • In addition they allow the MPU to enable the interrupt lines and monitor the status of the interrupt flags. From DDR B Bits 0 through 5 of the two registers may be written or read by the MPU when the proper chip select and register select signals ~ +5V are applied. Bits 6 and 7 of the two registers are read only and f are modified by external interrupts occurring on control lines CAl, CA2 , CB l or CB2 • The format of the control words is shown in Table 2. To Data Bus Table 2 Control Word Format ~~~-~---~-~-'--.PBx CRA From ORB >-----------.,1...-' CRB (b) Section B Figure 15 Peripheral Data Bus 84 HD6821, HD68A21, HD68B21 - - - - - - - - - - - - - Data Direction Access Control Bit (CRA2 and CRB2) CRBO are used to enable the MPU interrupt signals IRQA and Bit 2 in each Control register (CRA and CRB) allows IRQB, respectively. Bits CRAt and CRB1 determine the active selection of either a Peripheral Interface Register or the Data transition of the interrupt input signals CAl and CB I (Table 3) Direction Register when the proper register select signals are Control of CA2 and CB2 Peripheral Control Lines (CRA3, applied to RS o and RS I . CRA4, CRA5, CRB3, CRB4, and CRB5) Interrupt Flags (CRA6, CRA7, CRB6, and CRB7) Bits 3, 4 and S of the two control registers are used to The four interrupt flag bits are set by active transitions of control the CA2 and CB 2 Peripheral Control lines. These bits signals on the four Interrupt and Peripheral Control lines when determine if the control lines will be an interrupt inout or an those lines are programmed to be inputs. These bits cannot be output control signal. If bit CRAS (CRBS) is "0" CA 2 (CB 2 ) set directly from the MPU Data Bus and are reset indirectly by a is an interrupt input line similar to CAl (CBI) (Table 4), When Read Peripheral Data Operation on the appropriate section. CRAS (CRBS) is "I", CA2 (CB 2 ) becomes an output signal Control of CAl and CB l Interrupt Lines (CRAO, CRBO. CRA1, that may be used to control peripheral data transfers. When in and CRB1) the output mode, CA2 and CB2 have slightly different The two lowest order bits of the control registers are used to characteristics (Table S and 6). control the interrupt input lines CAl and CB I . Bits CRAO and Table 3 Control of Interrupt Inputs CAl and CB I I MPU Interrupt CRA1 CRAO Interrupt Input Interrupt Flag Request (CRB1) (CRBO) CAl (CB I ) CRA7 (CRB7) IRQA (lRQB) 0 0 ~ Active Set "1" on ~ of CAl Disabled - I Rd remains (CB I ) "High" 0 1 ~ Active Set "1" on ~ of CAl Goes " Low" when the inter- (CB I ) rupt flag bit CRA7 (CRB7) goes "1" 1 0 t Active Set "1" on t of CAl Disabled - I RQ remains (CB I ) "High" 1 1 t Active Set "1" on t of CAl Goes "Low" when the inter- (CB I ) rupt flag bit CRA7 (CRB7) goes 1'1II, (Notes) 1. t indicates positive transition ("Low" to "High") 2 . .j. indicates negative transition ("High" to "Low") 3. The I nterrupt flag bit CRA 7 is cleared by an MPU Read of the A Peripheral Register and CRB7 is cleared by an MPU Read of the B Peripheral Register. 4. If CRAO (CRrO) is "0" when an interrupt occurs (Interrupt disabled) and is later brought "1", IROA (lROB occurs after CRAO (CRBO) is written to a "1". Table 4 Control of CA 2 and CB 2 as Interrupt Inputs - CRAS (CRBS) is "0" MPU Interrupt CRA5 CRA4 CRA3 Interrupt Input Interrupt Flag (CRBS) (CRB4) --B.!quest (CRB3) CA2 (CB 2 ) CRA6 (CRB6) IRQA (lRQB) 0 0 0 ~ Active Set "1" on ~ of CA 2 Disabled - I RO remains (CB 2 ) "High" 0 0 1 ~ Active Set "1" on ~ of CA2 Goes "Low" when the inter- (CB 2 ) rupt flag bit CRA6 (CRB6) goes "1" 0 1 0 t Active Set "1" on t of CA 2 Disabled - I RO remains (CB 2 ) "High" 0 1 1 t Active Set "1" on t of CA 2 Goes "Low" when the inter- (CB 2 ) rupt flag bit CRA6 (CRB6) goes "1" (Notes) 1. t indicates positive transition ("Low" to "High") 2 . .j. indicates negative. transition ("High" to "Low") 3. The interrupt flag bit CRA6 is cleared by an MPU Read of the A Peripheral Register and CRB6 is cleared by an MPU Read of the B Peripheral Register. 4. If CRA3 (CRB3) is "0" when an interrupt occurs (Interrupt disabled) and is later brought "1", IROA (lROB) occurs after CRA3 (CRB3) is written to a "1". 85 HD6821, HD68A21, HD68B21 - - - - - - - - - - - - - Table 5 Control of CB2 as an Output - CRB5 is "1" CB 2 CRB5 CRB4 CRB3 Cleared Set 1 0 0 "Low" on the positive transition of "High" when the interrupt flag bit the first E pulse after MPU CRB7 is set by an active transition Write "B" Data Register operation. of the CB l signal. (See Figure 16) 1 0 1 "Low" on the positive transition of "High" on the positive edge of the the first E pulse"after an MPU Write first "E" pulse following an "E" "B" Data Register operation. pulse which occurred while the part was deselected. (See Figure 16) 1 1 0 " Low" (The content of CRB3 is output on CB2) 1 1 1 "High" (The content of CRB3 is output on CB2 ) Table 6 Control of CA2 as an Output - CRA5 is "1" CA2 CRA5 CRA4 CRA3 Cleared Set 1 0 0 " Low" on negative transition of E "High" when the interrupt flag bit after an MPU Read" A" Data Opera- CRA7 is set by an active transition tion. of the CAl signal. (See Figure 16) 1 0 1 "Low" on negative transition of E "High" on the negative edge of the after an MPU Read "A" Data opera- first "E" pulse which occurs during tiQn. a deselect. (See Figure 16) 1 1 0 "Low" (The content of CRA3 i~ output on CA2 ) 1 1 1 "High" (The content of CRA3 is output on CA2 ) 86 HD6821, HD68A21, HD68B21 - - - - - - - - - - - - - • PIA OPERATION • Initialization When the external reset input RES goes "Low", all internal registers are cleared to ''0''. Periperal data port (PAo-PA7, PBo-PB 7 ) is defmed to be input and control lines (CAl' CA2 , CB I and CB2 ) are defmed to be the interrupt input lines. PIA is also initialized by software sequence as follows. Clear the control register • Program the data direction register access bit of the control register to "0" to allow to access the dada direction register. Load input/output direction data into ACC Store the contents of ACC into the data direction register Load the control data to be written into ACC • The data of the oontrolline function is set into the accwnu- lator, of which Data Direction Register Access Bit shall be progranuned to "1". Store the contents of ACC into the control register • Transfer the control data from the accwnulator into the control register. Input/output processing • ReadJWrite Operation Not Using Control Lines Set the data direction register to "00" CLR CRA • Clear the DDRA access bit of the control register to "0". CLR DORA • Clear all bits of the dada direction register. LOAA #$04 • Set DDRA access bit of the control register to "1" to allow Initialize the control register STAA CRA to access the peripheral interface register. Load the contents of the peripheral interface register into the accumulator LOAA PIRA CLR CRA • Set DDRB access bit of the control register to "0". Set the data direction register to "FF" ~~:B}. Set all bits of the data direction--register to "FF". LOAA STAA Initialize the control register LOAA ~:::: }. Set DDRB access bit of the control register to "1" to allow to STAA I access the peripheral interface register. I I Store the data in the accumulator into I output register LOAA DATA} • Write the data into the peripheral interface register. STAA PIRB 87 HD6821, HD68A21, HD68821 • ReadlWrite Operating Using Control Lines Read/write request from peripherals shall be put into the control lines as an interrupt signal, and then MPU reads or writes after detecting interrupt request. The following case is that Port A is used and that the rising edge of CAl indicates the request for read from peripherals. CLR CRA • Set the OORA access bit to "0". Set the data direction register to "00" CLR DORA. Set all bits of the data direction register to "0". LDAA #$06 • Program the rising edge of CAl to be active. IRQA is masked Initialize the control register STAA CRA and OORA access bit is set to 1. LOOP LDAA CRA } Load the contents of the control register BPL LOOP • Check whether the read request comes from peripherals into the accumulator or not. No Load the contents of the peripherel LDAA PIRA • Load the data from the peripheral interface register into the interface register into the accumulator accumulator. CRA flag is reset after this read operation. To read the peripheral data, the data is directly transfered to the data buses 0 0 -0, through PAo-PA, or PBo-PB, and they are not latched in the PIA. If necessary, the data should be held in the external latch until MPU completes reading it. When initializing the control register, interrupt flag bit (CRA7, CRA6, CRB7, CRB6) cannot be written from MPU. If necessary the interrupt flag must be reset by dummy read of Peripheral Register A and B. Write operation using the interrupt signal is as follows. In this caseJ!.port is used and interrupt request is input to CB I . And the IRQ flag is set at the rising edge of CB 1 • 88 HD6821, HD68A21, HD68B21 - - - - - - - - - - - - - CLA CAB • Set DDRB access bit to "0" Set the data direction register to "FF" LOAA #$FF } STAA OOA B • Set all bits of DDRB to output" I". LOA A #$06 • Program the rising edge of CB I to be active. IRQB is masked Initialize the control register STAA CAB and DDRB access bit is set to "I". LOOP LOAA CAB • Check whether the write request comes from peripherals Load the contents of the control BPL LOOP register into the accumulator or not. No Load the contents of the output LOAA PIAB • Reset the CRB7 flag by the dummy read of the register in the accumulator peripheral interface register. Store the contents of the accumulator into the output register STAB PIAB • Store the data of the accumulator B to the peripheral interface register. Interrupt request flag bits (CRA7, CRA6, CRB7 and CRB6) (3) CRA7 flag is set and CA2 becomes "High" (CA2 auto- cannot be written and they cannot be also reset by write matically becomes "High" by the interrupt CAl). This operation to the peripheral interface register. So dummy read of indicates the peripheral to maintain the current data and peripheral interface register is needed to reset the flags. not to transfer the next data. To accept the next interrupt, it is essential to reset indirectly (4) MPU accepts the read request by IRQA hardware interrupt the interrupt flag by dummy read of peripheral interface or CRA read. Then MPU reads the peripheral register A. register. (5) CA2 goes "Low" on the following edge of read Enable Software poling method mentioned above requires MPU to. pulse. This informs that the peripheral can set the next data continuously monitor the control register to detect the read/ to port A. write request from peripherals. So other programs cannot run at the same time. To avoid this problem, hardware interrupt may be used. The MPU is interrupted by IlUIA or mmr when the CRB5 = "I", CRB4 = "0" and CRB3 = "0" (1) A peripheral device requests MPU to write the data by using read/write request is occurred from peripherals and then MPU analyzes cause of the interrupt request during interrupt pro- CB I input. CB2 output remains "High" until MPU write cessing. data to the peripheral interface register. • Handshake Mode (2) CRB7 flag is set and MPU accepts the write request. The functions of CRA and CRB are similar but not identical (3) MPU reads the peripheral interface register to reset CRB7 in the hand-shake modes. Port A is used for read hand-shake (dummy read). operation and Port B is used for write hand-shake mode. (4) Then MPU write data to the peripheral interface register. CAl and CB I are used for interrupt input requests and CA 2 The data is output to port B through the output register. and CB2 are control outputs (answer) in hand-shake mode. (5) CB2 automatically becomes "Low" to tell the peripheral that new data is on port B. Fig. 16, Fig. 17 and Fig. 18 show the timing of hand-shake (6) The peripheral read the data on Port B peripheral data lines mode. and set CB I to "Low" to tell MPU that the data on the < Read Hand-shake Mode> peripheral data lines has been taken and that next data can CRA5=" 1", CRA4="0" and CRA3="0" be written to the peripheral interface register. (1) A peripheral device puts the 8-bit data on the peripheral data lines after the control output CA2 goes "Low". CRA5 = "I", CRA4 = "0" and CRA3 = "I" (2) !he peripheral requests MPU to read the data by using CAl CRB5 = "I", CRB4 = "0" and CRB3 = "I" mput. This mode is shown in Figure 16, Figure 19 and Figure 20. 89 HD6821, HD68A21, HD68B21 CRAS CRA4 CRA3 Timing E R/W CS·RS. ·RS o / / / /r----' t:: READ Request o Q.. CRA7 1~:.::...:.;.::~ooooTJ o The chan~e of PAo-PA71 is not allowed. I I PA o -PA7\ are Busy I I allowed to ,be set. Next PA o -PA are allowed to setr'~_ _ _ __ o o CA 2 Ready Ready 7 I ~ ________ ~-J CRBS CRB4 CRB3 Timing E R/W PB o -PB _ _ _ _ _ _ _ _ _--<.. 7 CB'~/// WRITE Request dummy Read Reset CRB7 ~-------~----~---~ o ". UU2 .. PB o -PB 7 data is old. o o ,.....'----~B-us-y----... PB o -PB 7 data is new. Ready Figure 16 Timing of Hand-shake Mode and Pulse Mode 90 HD6821. HD68A21. HD68B21 - - - - - - - - - - - - - Goes "High" on Goes "Low" when data on pAl transition of CAl "A" side has been read by (I RQA 1 Flag bit set) MPU after falling edge of enable signal _CA_2____ ~_~--------~ff L Enable Signal (E) Handshaking with peripheral on 'A' side Data PIRA CAl PIA Peripheral CA 2 7 CRA 0 I x 0 II 0 0 0 Peripheral Says: Here's new data (Sets eRA7) Figure 17 Bits 5,4, 3 of eRA = 100 (Hand-shake Mode) 91 HD6821, HD68A21, HD68B21 - - - - - - - - - - - - - Goes "Low" on first Goes "High" or transition positive edge of enable ocfBC2Bl (lRa~Blfl.'. ~ bi.t.se.t.)_ _ _ _ _ _ _-4,',L: _ _ _ _ _ _ _ _ _ r :!~~:~ ~fa~: :~~h~~.~" side. (STA A PIRB) ( Enable signal (E) L Handshaking with peripheral on 'B' side Data ~/ I PIRB I CBI ... ~ .. PIA Peripheral CB 2 . I I I I I I I I I ~~ 7 CRB 0 ;/ 0 1 0 0 1 0 1 x Says. Here s new data Peripheral (STA A PIRB) Request for data Figure 18 Bits 5, 4, 3 of eRB = 100 (Hand-shake Mode) 92 HD6821, HD68A21, HD68B21 C~ Normally Goes "Low" after a "Read a side Goes "High" on "High" data" Instruction (LOA) the negative (Negative transition of E) edge of the next E pulse after a "Read a side data" Instruction (LOA) Enable signal ( E ) - - - - ' Pulse mode Pulse output on 'A' side Oata .Jr If I PIRA I PIA Peripheral ~ CA 2 CRA 0 A 7 I 1 1 1 11 1 1 1 I x 0 1 0 1 x x Pu., initi""'''' ",.. It Dol, ..R'..... by MPU of reading 'A' side (LOA A PIRA) Figure 19 Bits 5,4,3 of eRA = 101 (Pulse Mode) Q3 HD6821, HD68A21, HD68B21 CB 2 Normally "High" Goes "High" on the next positive E pulse after A Goes "Low" on the positive "write B transition of the first side data" E pu Ise after a "write B instruction side data" instruction (STA) (STA) Enable signal (E) 1 ..______. . Pulse mode Pulse output on 'B' side Data tl ~ I PIRB I PIA Peripheral CB 2 ... _ Xow" " 7 CRB 0 I x 1 0 1 1 10 11 1 1 1 x 1 x I Pulse initiated as a result P''''''''''' at port of writing into 'B' side for peripheral (STA A PIRB) Figure 20 Bits 5,4,3 of CRB=101 (Pulse Mode) 94 HD6821. HD68A21. HD68821 - - - - - - - - - - - - - • SUMMARY OF CONTROL REGISTERS CRA AND CRB • Active Low Outputs Control registers CRA and CRB have total control of CAl, CA 2 , CB I , and CB 2 lines. The status of eight bits of the control When all the outputs of given PIA port are to be active "Low" registers may be read into the MPU. However, the MPU can only (True~ 0.4 volts), the following procedure should be used. write into Bit 0 through Bit 5 (6 bits), since Bit 6 and Bit 7 are set only by CAl, CA 2 , CB I , or CB 2 • a) Set Bit 2 in the control register. b) Store all Is ($FF) in the peripheral interface register. • Addressing PIAs c) Clear Bit 2 in the control register. Before addressing PIAs, the data direction (DDR) must first d) Store allIs ($FF) in the data direction register. be loaded with the bit pattern that defines how each line is to e) Store control word (Bit 2 = I) in control register. function, i.e., as an input or an output. A logic "I" in the data direction register defines the corresponding line as an output while a logic "0" defines the corresponding line as an input. Since the DDR and the peripheral interface resister have the same The B side of PIAl is set up to have all active low outputs. address, the control register bit 2 determines which register is CB 1 and CB 2 are set up to allow interrupts in the HAND- being addressed. If Bit 2 in the control register is a logic "0", SHAKE MODE and CB 1 will respond to positive edges then the DDR is addressed. If Bit 2 in the control register is a ("Low"-to-"High" transitions). Assume reset conditions. Ad- logic "1", the peripheral interface register is addressed. There- dresses are set up and equated to the same labels as previous fore, it is essential that the DDR be loaded first before setting example. Bit 2 of the control register. 1. LOA A#4 2. STA A PIAIBC Set Bit 2 in PIAIBC (control register) Given a PIA with an address of 4004, 4005, 4006, and 4007. 3. LOA B#$FF 4004 is the address of the A side peripheral interface register. 4. STA B PIAIBD All Is in peripheral interface register 4005 is the address of the A side control register. 4006 is the S. CLRPIAIBC Clear Bit 2 address of the B side peripheral interface register. 4007 is the 6. STA B PIAIBD All 1s in data direction register address of the B side control register. On the A side, Bits 0, 1, 2, 7. LOA A #$27 and 3 will be defined as inputs, while Bits 4, 5, 6, and 7 will be 8. STA A PIAIBC 00 100 III ~ control register used as outputs. On the B side, all lines will be used as outputs. The above procedure is required in order to avoid outputs going "Low", to the active "Low" TRUE STATE, when allIs are stored to the data direction register as would be the case if the normal configuration procedure were followed. PIA lAD = 4004 (DORA, PIRA) PIAIAC =4005 (CRA) PIA I BD =4006 (DDRB, PIRB) • Interchanging RSo And RS 1 PIAIBC =4007 (CRB) Some system applications may require movement of 16 bits of data to or from the "outside world" via two PIA ports (A 1. LOA A #%11110000 (4 outputs, 4 inputs) side + B side). When this is the case it is an advantage to 2. STAA PIAIAD (Loads A DDR) interconnect RS 1 and RS o as follows. 3. LOA A #% 11111111 (All outputs) 4. STA A PIAIBD (Loads BOOR) RS o to Al (Address Line AI) S. LOA A #0/000000100 (Sets Bit 2) RS 1 to AO (Address Line AO) 6. STAA PIA lAC (Bit 2 set in A control register) 7. STAA PIAIBC (Bit 2 set in B control register) This will place the peripheral interface registers and control registers side by side in the memory map as follows. Statement 2 addresses the DDR, since the control register Table Example Address (Bit 2) has not been loaded. Statements 6 and 7 load the control registers with Bit 2 set, so addressing PIAIAD or PIAIBD PIA lAD $4004 (DORA, PIRA) accesses the peripheral interface register. $4005 PIAIBD (DDRB, PIRB) PIAIAC $4006 (CRA) • PIA Programming Via The Index Register PIAIBC $4007 (CRB) The program shown in the previous section can be accom- The index register or stackpointer may be used to move the plished using the Index Register. 16-bit data in two 8-bit bytes with one instruction. As an example: 1. LOX #$ F004 $FO-+PIA lAD .;$04-+PIA I AC LDX PIAIAD PIA lAD -++ IXl-r.: PIA IBD ~ IXL 2. STX PIA lAD 3. WX #$FF04 4. STX PIAIBD $FF-+PIA I BD ;$04-+PIA 1BC • PIA - After Reset When the RES (Reset Line) has been held "Low" for a Using the index register in this example has saved six bytes of minimum of one microsecond, all registers in the PIA will be program memory as compared to the program shown in the cleared. previous section. Because of the reset conditions, the PIA has been defined as 95 HD6821, HD68A21, HD68821 - - - - - - - - - - - - - follows. • SUMMARY OF CA2-CB2 PROGRAMMING 1. All I/O lines to the "outside world" have been defined as Bits 5, 4, and 3 of the control registers are used to program inputs. the operation of CA2-CB2. 2. CAl, CA2 , CB,. , and CB2 have been defmed as interrupt input lines that are negative edge sensitive. 3. All the interrupts on the control lines are masked. Setting of b5 b4 b3 interrupt flag bits will not cause m'OA or 'MOB to go "Low". CA,-CB, Input ~ I [g0 g:=: 1(+) 1 o 2 (Mask) CA -CB2 Input Mode (Allow) b4 = Edge (0 = -, 1 = +) o (Mask) b3 = Mask (0 = Mask, Mode 0 1(+) 1 (Allow) 1 = Allow) • SUMMARY OF CAl-CB l PROGRAMMING Bits 1 and 0 of the respective control registers are used to program the interrupt input contr.ollines CAl and CB l . CA2 -CB 2 Output ~ Mode W 1 1 0 0 1 o - Handshake Mode 1 - Pulse Mode ~ } b3 Following Mode 1 1 b1 bO o o b1 ~ Edge (0 = -, 1 = +) o 1 bO = Mask (0 = Mask, 1 = Allow) 1 o 1 1 Note that this is the same logic as Bits 4 and 3 for CA2-CB2 when CA2-CB2 are programmed as inputs. .. ...... 1/0 As Follow: .. Control Lines: ....- CAl - Positive Edge, Allow Interrupt .p "A" CAt - Pulse Mode .. ...... CBI - Negetive Edge, Mask Interrupt CB t - Hand Shake Mode .. -.. Assume Reset Condition ....- PIA1AD PIA1AC - .... PIA1BD PIA1BC ~------------ PIA Confiauration Solytion ..- . LDA A #$BC 10111100 -.. STA A PIA1AD 1/0 to DDRA . --.. ··· LDA A #$FF 11111111 STA A PIA1BD 1/0 to DDRB LDA A #$2F 00101111 "B" · STA A PIA1AC To "A" Control LDA A #$24 00100100 STA A PiAi8C To "8" Controi I------.~ PB o Figure 21 PIA Configuration Problem 96 HDS840, HDS8A40, HDS8B40---- PTM (Programmable Timer Module) The HD6840 is a programmable subsystem component of the HMCS6800 family designed to provide variable system time intervals. The HD6840 has three 16-bit binary counters, three correspond- ing control registers and a status register. These counters are under software control and may be used to cause system interrupts and/or generate output signals. The HD6840 may be utilized for such tasks as frequency measurements, event counting, interval measuring and similar tasks. The device may be used for square wave generation, gated delay signals, single pulses of controlled duration, and pulse width modulation as well as system interrupts. • FEATURES • Operates from a Single 5 Volts Power Supply • Fully TTL Compatible HD6840P, HD68A40P, HD68840P • Single System Clock Required (E) • Selectable Prescaler on Timer 3 Capable of 4 MHz for the HD6840, 6 MHz for the HD68A40 and 8 MHz for the HD68840 • Programmable Interrupts (I RQ) Output to MPU • Readable Down Counter Indicates Counts to Go to Time-Out • Selectable Gating for Frequency or Pulse-Width Comparison • RES Input • Three Asynchronous External Clock and Gate/Trigger Inputs Internally Synchronized (DP-28) • Three Maskable Outputs • BLOCK DIAGRAM • PIN ARRANGEMENT E (SvstemrP,) E CSt CSo (Top View) rt 1 1 Vss Vee RES G, c. 0, 13; C, 0, G, Co 0, 97 HD8840, HD88A40, HD88B40 - - - - - - - - - - - - - - • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3-+7.0 V Input Voltage V in * -0.3-+7.0 V Operating Temperature Topr - 20-+ 75 °c Storage Temperature Tstll - 55-+150 °c * With respect to Vss (SYSTEM GND) [NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V V 1L * -0.3 - 0.8 V Input Voltage V 1H * 2.0 - Vee V Operating"Temperature Topr - 20 25 75 °c * With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vee = 5V ± 5%, Vss = OV, Ta = -20 - +75°C, unless othMWise noted.) Item Symbol Test Condition min typ* max Unit Input "High" Voltage V 1H 2.0 - Vee V Input "Low" Voltage V 1L -0.3 - 0.8 V Input Leakage Current lin V in = 0 - 5.25V (Except Do ..... 0 7 ) -2.5 - 2.5 J.l.A Three-State Input Current V in = 0.4 - 2.4V (off-state) I TS1 Vee = 5.25V (Do - 0 7 ) - 10 - 10 J.l.A I LOAD = -205 J.l.A (Do - 0 7 ) Output "High" Voltage V OH 2.4 - - V I LOA D = -200 J.l.A (Other Outputs) I LOAD = 1.6 mA (Do - 0 7 ) Output "Low" Voltage VOL - - 0.4 V I LOAD = 3.2 mA (0 1 - 0 3 , IRQ) Output Leakage Current I LOH V OH = 2.4V (I RQ) - - 10 J.l.A (off-state) Power Dissipation Pn - 330 550 mW V in = OV Input Capacitance Do - 0 7 - - 12.5 Cin Ta = 25°C pF f = 1 MHz Other Input - - 7.5 V in = OV Output Capacitance IRQ - - 5.0 Cout Ta = 25°C pF f = 1 MHz 0 1 , O2 , 0 3 - - 10 * Ta = 2SoC, vee = S.OV 98 HD6840, HD68A40, HD68B40 - - - - - - - - - - - - - - • AC CHARACTERISTICS (Vee = 5V ± 5%, Vss = OV, Ta = -20 '" +75°C, unless otherwise noted.) 1. MPU READ TIMING Test HD6840 HD68A40 HD68B40 Item Symbol Unit Condition min typ max min typ max min typ max Enable Cycle Time tcycE 1.0 - 10 0.666 - 10 0.5 - 10 IlS Enable "High" Pulse Width PW EH 0.45 - 4.5 0.280 - 4.5 0.22 - 4.5 IlS Enable "Low" Pulse Width PWEL 0.43 - - 0.280 - - 0.21 - - IlS Enable Rise and Fall Time tEp tEf - - 25 - - 25 - - 25 ns Address Set Up Time tAS Fig. 1 160 - - 140 - - 70 - - ns Data Delay Time tOOR - - 320 - - 220 - - 180 ns Data Hold Time tH 10 - - 10 - - 10 - - ns Address Hold Time tAH 10 - - 10 - - 10 - - ns Data Access Time t ACC - - 480 - - 360 - - 250 ns 2. MPU WR ITE TIMING Test HD6840 HD68A40 HD68B40 Item Symbol Unit Condition min typ max min typ max min typ max Enable Cycle Time tcycE 1.0 - 10 0.666 - 10 0.5 - 10 IlS Enable "High" Pulse Width PWEH 0.45 - 4.5 0.280 - 4.5 0.22 - 4.5 IlS Enable "Low" Pulse Width PW EL 0.43 - - 0.280 - - 0.21 - - IlS Enable Rise and Fall Time t Ep tEf Fig. 2 - - 25 - - 25 - - 25 ns Address Set Up Time tAS 160 - - 140 - - 70 - - ns Data Set Up Time tosw 195 - - 80 - - 60 - - ns Data Hold Time tH 10 - - 10 - - 10 - - ns Address Hold Time tAH 10 - - 10 - - 10 - - ns 3. TIMING OF PTM SIGNAL HD6840 HD68A40 HD68B40 Item Symbol Test.Condition Unit min max min max min max Input Rise and Fall Times C, G. RES t r , tf Fig. 3, Fig. 4 - 1.0" - 0.666" - 0.5" j.ls Fig. 3 Input "Low" Pulse Width C,G,REs PWL ( Asynchronous ) teveE+tsu+tHo - teyeE + tsu +t H0 - tcveE+tSU+tHO - ns Mode Fig. 4 Input "High" Pulse Width C,G PWH ( Asynchronous ) teveE + tsu +t H0 - teveE+tsu+tHo - teyeE +tsu +t H0 - ns Mode C, G, RES 200 - 120 - 75 - Fig. 5 Input Setup Time C, ("'8 Pre· tsu ( Synchronous ) ns scaler Model Mode 200 - 120 - 75 - C, G, RES Fig.5 50 - 50 - 50 - Input Hold Time CJ ("'8 Pre· tHO ( SynChrOnOUS) 50 - 50 - 50 - ns Mode scaler Model CJ ("'8 Pre· PW L , (ASynChrOnOUS) Input Pulse Width scaler Model PWH Mode . 125 - 84 - 62.5 - ns VoH =2.4V, TTL teo - 700 - 460 - 340 ns Load B Output Delay Time O. - OJ VOH=2.4V. MOS tem Fig. 6 - 450 - 450 - 340 ns Load 0 VOH=0. 7xV cC. CMOS t cmos - 2.0 - 1.35 - 1.0 !1S Load D Interrupt Release Time tlR Fig. 7 - 1.2 - 0.9 - 0.7 !1S * I r • tf ~ leveE 99 HD6840, HD68A40, HD68B40 - - - - - - - - - - - - - E RS, CS, RtW Data Bus Figure 1 Bus Read Timing Figure 2 Bus Write Timing (Read Information from PTM) (Write Information into PTM) ~-c; G;-G; RES Figure 3 Input Pulse Width "Low" Figure 4 Input Pulse Width "High" ~2DV \~- tcmos* ~ -C;,G.-G; RES * VOH(CMOS) = 0.7 x vcc Figure 5 Input Setup and Hold Times Figure 6 Output Delay E r r--lIR=* OBV IRQ ______________- J , , 2.4V Figure 7 I RQ Release Time 100 HD6840, HD68A40, HD68B40 - - - - - - - - - - - - - - Load B Load A (0 1 .0 2 .0 3 ) (Do - 0,) (TTL Load) 5.0V S.OV ---..----i.._-. Test Point O-.... Test Point o-....---..---I'e--. Adjust RL 130 pF All diodes are 40 pF 12 kn so that IOL = 3.2 rnA IS2074@. then test VOL All diodes are = 152074 ®. Load C d (IRQ Only) 5.0V Load ° (0 1 .0 2 .0 3 ) (CMOS Load) 1 (MOS) Ton Po;", 1.3 k!1 Test Point 100pF I 1 30PF Figure 8 Bus Timing Test Loads The three timers in the H06840 may be independently MPU to control the PTM. VMA should be utilized in con- programmed to operate in modes which fit a wide variety junction with an MPU address line into a Chip Select of of applications. The device is fully bus compatible with the PTM. HMCS6800 system and is accessed by load and store operations from the MPU in much the same manner as a • Bidirectional Data (Do '" 0 7 ) memory device. In a typical application, a Timer will be The bidirectional data lines (0 0 "'0 7 ) allow the transfer loaded by first storing two bytes of data into an asso- of data between the MPU and PTM. The data bus output ciated Counter Latch. This data is then transferred into drivers are three-state devices which remain in the high- the counter via a Counter Initialization cycle. The counter impedance (off) state except when the MPU performs a decrements on each subsequent clock period which may PTM read operation (ReadlWrite and Enable lines "High" be an external clock or Enable (System cf>2) until one of and PTM Chip Selects activated). several predetermi-ned conditions causes it to halt or re- cycle. The timers are thus programmable, cyclic in nature, • Chip Select (CS o , CSt) controllable by external inputs or the MPU program, and These two signals are used to activate the Data Bus in- accessible by the MPU at any time. terface and allow transfer of data from the PTM. With CS;; = "Low" and CSt = "High", the device is selected and • PTM INTERFACE SIGNALS FOR MPU data transfer will occur. The Programmable Timer Module (PTM) interfaces to the HMCS6800 Bus with an eight-bit bidirectional data • ReadlWrite (R/W) bus, two Chip Select lines, a ReadlWrite line, an Enable This signal is generated by the MPU to control the direc- (System cf>2) line, an Interrupt Request line, an external tion of data transfer on the Data Bus. With the PTM Reset line, and three Register Select lines. These signals, in selected, a "Low" state on the PTM R/W line enables the conjunction with the H06800 VMA output, permit the input buffers and data is transferred from the MPU to the 101 HD6840, HD68A40, HD68840 - - - - - - - - - - - - - PTM on the trailing edge of the Enable (System <1>2 ) signal. an additional Enable period is required if setup times are Alternately, (under the same conditions) RiW = "High" not met. The RES input must be stable "High"/"Low" and Enable "High" allows data in the PTM to be read by for the minimum time stated in the AC Characteristics. the MPU. Recognition of a "Low" level at this input by the PTM causes the following action to occur: • Enable (E) a. All counter latches are preset to their maximal This signal synchronizes data transfer between the count values. MPU and the PTM. It also performs an equivalent syn- b. All Control Register bits are cleared with the excep- chronization function on the external clock, reset, and tion of CR 10 (internal reset bit) which is set. gate inputs of the PTM. c. All counters are preset to the contents of the latches. d. All counter outputs are reset and all counter clocks • Interrupt Request (J RQ) are disabled. The active "Low" Interrupt Request signal is normally e. All Status Register bits (interrupt flags) are cleared. tied directly (or through priority interrupt circuitry) to the TROinput of the MPU. This is an "open drain" output • Register Select Lines (RS o , RS 1 , RS 2 ) (no load device on the chip) which permits other similar These inputs are used in conjunction with the R/W line interrupt request lines to be tied together in a wire-OR to select the internal registers, counters and latches as configuration. shown in Table 1. The I RQ line is activated if, and only if, the Composite It has been previously stated that the PTM is accessed Interrupt Flag (Bit 7 of the Internal Status Register) is via MPU Load and Store operations in much the same asserted. The conditions under which the I RQ line is acti- manner as a memory device. The instructions available vated are discussed in conjunction with the Status with the HMCS6800 family of MPUs which perform Register. operations directly on memory should not be used when the PTM is accessed. These instructions actually fetch a • External Reset (RES) byte from memory, perform an operation, then restore it A "Low" level at this input is clocked into the PTM by to the same address location. Since the PTM used the R/iN the Enable (System <1>2) input. Two Enable pulses are line as an additional register select input, the modified required to synchronize and process the signal. The PTM data may not be restored to the same register if these then recognizes the active "Low" or inactive "High" on instructions are used. the third Enable pulse. If the RES signal is asynchronous, Table 1 Register Selection Register * Select Inputs Operations RS, RS! RS. R/W = "Low" R/W = "High" CR20 = "0" Write Control Register #3 L L L No Operation CR20 = "1" Write Control Register #1 L L H Write Control Register #2 Read Status Register L H L Write MSB Buffer Register Read Timer #1 Counter L H H Write Timer #1 Latches Read LSB Buffer Register H L L Write MSB Buffer Register Read Timer #2 Counter H L H Write Timer #2 Latches Read LSB Buffer Register H H L Write MSB Buffer Register Read Timer #3 Counter H H H Write Timer #3 Latches Read LSB Buffer Register * L; "Low"level. H; "High" level • PTM ASYNCHRONOUS INPUT/OUTPUT SIGNALS the limit Imposed by Enable (System ¢2) Setup, and Hold Each of the three timers within the PTM has external time. clock and gate inputs as well as a counter output line. The The external clock inputs are clocked in by Enable inputs are high impedance, TTL compatible lines and (System ¢2) pulses. Three Enable periods are used to outputs are capable of driving two standard TTL loads. synchronize and process the external clock. The fourth Enable pulse decrements the internal counter. This does • Clock Inputs (~ , C2 , C 3 ) not affect the input frequency, it merely creates a delay Input pins Ct , C2 , and C3 will accept asynchronous TTL between a clock input transition and internal recognition voltage level signals to decrement Timers 1, 2, and 3, of that transition by the PTM. All references to C inputs respectively. The "High" and "Low" levels of the external in this document relate to internal recognition of the clocks must each be stable for at least one system clock input transition. Note that a clock "High" or "Low" level period plus the sum of the setup and hold times for the which does not meet setup and hold time specifications inputs. The asynchronous clock rate can vary from de to may require an additional Enable pulse for recognition. 102 HD6840, HD68A40, HD68B40 - - - - - - - - - - - - - When observing recurring events, a lack of synchroniza- dent of the -=-8 prescaler selection. tion will result in "jitter" being observed on the output of the PTM when using asynchronous clocks and gate input • Timer Outputs (0 1 , O2 , 0 3 ) signals. There are two types of jitter. "System jitter" is Timer outputs 0 1 , O2 , and 0 3 are capable of driving the result of the input signals being out of synchroniza- up to two TTL loads and produce a defined output wave- tion with the Enable (System Counter Time Out Single Shot Mode: Gate t or Reset Causes Counter Initialization Pulse Width Comparison Mode: Interrupt If Gate L-J is> Counter Time Out Interrupt Flag Masked (fAll) Interrupt Flag Enabled (IRQ) Timer Output Masked "1" Timer Output Enable (NOTE) Reset is Hardware or Software Reset (RES = "Low" or CR10 = "1 "). 105 HD6840, HD68A40, HD68B40 - - - - - - - - - - - - - condition (RES = "Low" or CR10 = "1") is recognized. It and 5 of the corresponding control register. Assuming that can also occur - depending on Timer Mode - with a the timer output is enabled (CRX7 = "1 "), either a square Write Timer Latches command or recognition of a nega- wave or a variable duty cycle waveform will be generated tive transition of the Gate input. at the Timer Output, OX. The type of output is selected Counter recycling or re-initialization occurs when a via Control Register Bit 2. negative transition of the clock input is recognized after Either a Timer Reset (CR 10 = "1" or External RES the counter has reached an all-zero state. In this case, data = "Low") condition or internal recognition of a negative is transferred from the Latches to the Counter. transition of the Gate input results in Counter Initializa- tion. A Write Timer Latches command can be selected as • TIMER OPERATING MODES a Counter Initialization signal by clearing CRX4 . The HD6840 has been designed to operate effectively The counter is enabled by an absence of a Timer Reset in a wide variety of applications. This is accomplished condition and a "Low" level at the Gate input. The by using three bits of each control register (CRX3, CRX4, counter will then decrement on the first clock signal and CRX5) to defined different operating modes of the recognized during or after the counter initialization cycle. Timers. These modes are outlined in Table 4. It continues to decrement on each clock signal so long as G remains "Low" and no reset condition exists. A Table 4 Operating Modes Counter Time Out (the first clock after all counter bits = "0") results in the Individual Interrupt Flag being set Control Register and re-initialization of the counter. CRX3 CRX4 CRX5 Timer Operating Mode A special condition exists for the dual 8-bit mode 0 * 0 Continuous (CRX2 = "1") if L = "0". In this case, the counter will 0 * 1 Single-Shot revert to a mode similar to the single 16-bit mode, except 1 0 * Frequency Comparison Time Out occurs after M+l clock pulses. The output, if 1 1 * Pulse Width Comparison enabled, goes "Low" during the Counter Initialization * Defines Additional Timer Functions. cycle and reverses state at each Time Out. The counter In addition to the four timer modes in Table 4, the remains cyclical (is re-initialized at each Time Out) and remaining control register bit is used to modify counter the Individual Interrupt Flag is set when Time Out occurs. initialization and enabling or interrupt conditions. If M = L = "0", the internal counters do not change, but the output toggles at a rate of 1/2 the clock frequency. • Continuous Operating Mode (Table 5) In the dual 8-bit mode (CRX2 = "1") [Refer to the Any of the timers in the PTM may be programmed to example in Fig. 9] the MSB decrements once for every operate in a continuous mode by writing "O"s into bits 3 full countdown of the LSB + 1. When the LSB = "0", the Table 5 Continuous Operating Modes CONTINUOUS MODE (CRX3 = "0", CRX5 = "a") Control Register Initialization/Output Waveforms CRX2 CRX4 Counter Initialization *Timer Output (OX) (CRX7 = "1") 0 0 - G~+W+R r- 1N + lJ(Tl--j--IN +lI1TITIN + 1)ITl1 I I I I-VoH I VOL - I 0 1 G~+R to TO TO TO - f-- IL + 111M + lilT) -r--IL + 111M + ll1Tl---l V 1 0 G~+W+R ~-OH VOL - I --i I Ll IT) f-- --l I L)IT) r-- 1 I 1 G~+R to TO TO - G~ = Negative transition of Gate input. W = Write Timer Latches Command. R = Timer Reset (CRlC = "1" or External RES = "Low") N = 16-Bit Number in Counter Latch. L = 8-Bit Number in LSB Counter Latch. M = 8·Bit Number in MSB Counter Latch. T = Clock Input Negative Transitions to Counter. to = Counter Initialization Cycle. TO= Counter Time Out (All Zero Condition). * All time intervals shown above assume the Gate (3) and Clock (C) signals are synchronized to Enable (System cf>2 ) with the specified setup and hold time requirements. I 106 HD6840, HD68A40, HD68840 - - - - - - - - - - - - - *Time Example: Contents of MSB = 03 = M Out Contents of LSB = 04 = L t M(L + 1) + 1 Algebraic Expression 03(04 + 1) + 1 = 16 Enables - - - - - - - f l , - - - - - - 2.4 V Counter Output - - - - - + ' 1 - - - - 0.4 V E (System 4>2 ) : I I I I I I I I 1 + L - - - I....~---- 1 + L --~.~I._-- 1 + L ~ ~ 5 Enable 5 Enable I 5 Enable I 4 Enable Pulses Pulses Pulses Pulses I _l+L- : 5 Enable I Pulses I I (M+il(~~+1l ,: I I I :.--.., ~ ~ -.! I* I I ** t I ** I ! ** I * I Algebraic Expression (04 + 1) (03 + 1) = 20 Enable or (M + 1) (L + 1) = Period External Clock Pulses M(L + 1) + 1 = "Low" portion of period L = Pulse width * Preset LSB and MSB to Respective Latches on the negative transition of the E. ** Preset LSB to LSB Latches and Decrement MSB by one on the negative transition of the E. Figure 9 Timer Output Waveform Example (Continuous Dual 8-Bit Mode using Internal Enable) MSB is unchanged; on the next clock pulse the LSB is ble are shown in Table 6. reset to the count in the LSB Latches and the MSB is As indicated in Table 6, the internal counting mecha- decremented by 1 (one). The output, if enabled, remains nism remains cyclical in the Single-Shot Mode. Each "Low" during and after initialization and will remain Time Out of the counter results in the setting of an "Low" until the counter MSB is all "O"s. The output will Individual Interrupt Flag and re-initialization of the go "High" at the beginning of the next clock pulse. The counter. output remains "High" until both the LSB and MSB of The second major difference between the Single-Shot the counter are all "O"s. At the beginning of the next and Continuous modes is that the internal counter enable clock pulse the defined Time Out (TO) will occur and the is not dependent on the Gate input level remaining in the output will go "Low". In the normal 16-bit mode the "Low" state for the Single-Shot mode. period of the output of the example in Fig. 9 would span Another special condition is introduced in the Single- 1546 clock pulses as opposed to the 20 clock pulses using Shot mode. If L = M = "0" (Dual 8-bit) or N = "0" (Single the Dual 8-bit-mode. 16-bitl, the output goes "Low" on the first clock received The discussion of the Continuous Mode has assumed during or after Counter Initialization. The output remains that the application requires an output signal. It should be "Low" until the Operating Mode is changed or nonzero noted that the Timer operates in the same manner with data is written into the Counter Latches. Time Outs con- the output disabled (CRX7 = "0"). A Read Timer tinue to occur at the end of each clock period. Counter command is valid regardless of the state of CRX7. The three differences between Single-Shot and Con- tinuous Timer Modes can be summarized as attributes of • Single-8hot Timer Mode the Single-Shot mode: This mode is identical to the Continuous Mode with 1. Output is enabled for only one pulse until it is three exceptions. The first of these is obvious from the reinitialized. name - the output returns to a "Low" level after the 2. Counter Enable is independent of Gate. initial Time Out and remains "Low" until another 3. L = M = "0" or N = "0" disables output. Counter Initialization cycle occurs. The waveforms availa- Aside from these differences, the two modes are identical. 107 HD6840, HD68A40, HD68840 - - - - - - - - - - - - - • Frequency Comparison or Period Measurement Mode tion cycle, an Individual Interrupt Flag is set. The counter (CRX3 ="1", CRX4 = "0") is disabled, and a Counter Initialization cycle cannot begin The Frequency Comparison Mode with CRX5 = "1" is until the interrupt flag is cleared and a negative transition straightforward. If Time Out occurs prior to the first nega- on "IT is detected. tive transition of the Gate input after a Counter Initializa- Table 6 Single-Shot Operating Modes Single-Shot Mode (CRX3 ="0", CRX7 = "1". CRX5 = "1") Control Register Initialization/Output Waveforms CRX2 CRX4 Counter Initialization Timer Output (OX) 0 0 G~+W+R II (N+1 )(T) ~(N+1 )(T) I--(N)(T) 1 0 1 1 0 1 1 G~+R G~+W+R G~+R r' ~ to I TO L+lI1M+l) 1T);",'j::L+lI1M+l) --j(L)(T) / lTO ITl TO to TO Symbols are as defined in Table 5 . • Time Interval Modes If CRX5 = "0", as shown in Table 7 and Table 8, an The Time Interval Modes are provided for those applica- interrupt is generated if Gate input returns "Low" prior tions which require more flexibility of interrupt genera- to a Time Out. If Counter Time-Out occurs first, the tion and Counter Initialization. Individual Interrupt Flags counter is recycled and continues to decrement. A bit is are set in these modes as a function of both Counter Time set within the timer on the initial Time Out which pre- Out and transitions of the Gate input. Counter Initializa- cludes further individual interrupt generation until a new tion is also affected by Interrupt Flag status. Counter Initialization cycle has been completed. When The counter does operate in either Single 16-bit or this internal bit is set, a negative transition of the Gate Dual 8-bit modes as programmed by CRX2. Other input starts a new Counter Initialization cycle. (The features of the Time Interval Modes are outlined in Table condition of G,j..·T·TO is satisfied, since a Time Out has 7. occurred and no individual Interrupt has been generated.) Table 7 Time Interval Modes CRX3 = "1" CRX4 CRX5 Application Condition for Setting Individual Interrupt Flag 0 0 Frequency Comparison Interrupt Generated if Gate Input Period (1/F) is less than Counter Time Out (TO) 0 1 Frequency Comparison Interrupt Generated if Gate Input Period (1 IF) is greater than Counter Time Out (TO) 1 0 Pulse Width Comparison Interrupt Generated if Gate Input "Down Time" is less than Counter Time Out (TO) 1 1 Pulse Width Comparison Interrupt Generated if Gate Input "Down Time" is greater than Counter Time Out (TO) Any of the timers within the PTM may be programmed dition will be generated if CRX5="0" and the period of to compare the period of a pulse (giving the frequency the pulse (single pulse or measured separately repetitive after calculations) at the Gate input with the time period pulses) at the Gate input is less than the Counter Time required for Counter Time-Out. A negative transition of Out period. If CRX5 = "1", an interrupt is generated if the Gate input enables the counter and starts a Counter the reverse is true. Initialization cycle - provided that other conditions as Assume now with CRX5 = "1" that a Counter Initiali- noted in Table 8 are satisfied. The counter decrements zation has occurred and that the Gate input has returned on each clock signal recognized during or after Counter "Low" prior to Counter Time Out. Since there is no Initialization until an Interrupt is generated, a Write Timer Individual Interrupt Flag generated, this automatically Latches command is issued, or a Timer Reset condition starts a new Counter Initialization Cycle. The process occurs. It can be seen from Table 8 that an interrupt con- will continue with frequency comparison being performed 108 HD6840, HD68A40, HD68B40 - - - - - - - - - - - - _ on each Gate input cycle until the mode is changed, or the time period required for Counter Time Out. With a cycle is determined to be above the predetermined limit. CRX5 = "1", the interrupt is generated when the reverse condition is true . • Pulse Width Comparison Mode (CRX3 = "1", CRX4 As can be seen in Table 9, a positive transition of the = "1") Gate input disables the counter. With CRX5 = "0", it is This mode is similar to the Frequency Comparison therefore possible to directly obtain the width of any Mode except for a positive, rather than negative, transi- pulse causing an interrupt. Similar data for other Time tion of the Gate input terminates the count. With CRX5= Interval Modes and conditions can be obtained, if two "0", an Individual Interrupt Flag will be generated if the sections of the PTM are dedicated to the purpose. "Low" level pulse applied to the Gate input is less than Table 8 Frequency Comparison Mode CRX3 = "''', CRX4 = "0" Control Reg Counter Counter Enable Counter Enable Interrupt Flag BitS (CRXS) Initialization Flip-Flop Set (CE) Flip-Flop Reset (CE) Set (I) 0 G~·T·(CE+TO)+R G~,w·R·T W+R+I G~ Before TO 1 G~:j"+R G~'W'R'I W+R+I TO Before G~ I represents the interrupt for a given timer. Table 9 Pulse Width Comparison Mode CRX3 = "''', CRX4 = "'" Control Reg Counter Counter Enable Counter Enable Interrupt Flag BitS (CRXS) Initialization Flip-Flop Set (CE) Flip-Flop Reset (CE) Set (I) 0 G~'I+R G~;W'R'I W+R+I+G Gt Before TO 1 G~·T+R ca .. OJ IX! (/) ::> II I II III e» w ~ D• IX! 00 :::t Os <{ FI C o. 0, l- <{ 0 lOX TRZ WPT .. ca ~ w (I) EFIA ROY lnl CS I- HoR RS o uw .J.J Hlo RS, ~o WGT RS, ffi~ 1-2 R/W (/)0 _u .. VFOC (!) E w WoT a: Bo oCK ROT Figure 13 Block Diagram ofthe FDC HD6843S, HD68A43S • GENERAL DESCRIPTION operations is stored in the LTAR by the bus interface. The HD6843SP FDC consists of four primary sections; the Register, Serializing. Bus Interface, and Control sections. The • Serializing Section following explanation of these sections can be followed in the The serializing section handles the serial-to-parallel and block diagram of Figure 13. parallel-to-serial conversions for Read/Write operations as well as CRC generation/checking and the generation/detection of the • Register Section clock pattern. The Data Output Shift Register (DOSR), Data The register section consists of twelve user accessible registers Input Shift Register (DISR) , CRe Generator/Checker, and used for controlling a floppy disk drive. All twelve are Clock Shift Register (CSR) comprise the serializing section of connected by the internal data bus to allow the processor access the FOC. to them. • Bus Interface Data Output Register (DOR) The Bus Interface section provides the timing and control The DOR is an 8-bit register which holds the data to be logic that allows the FDC to operate with the 6800 bus, and is written onto the disk. The information is stored here by the bus comprised of the Data Buffers. Request Control, and the interface. Register Select circuitry. Data Input Register (DIR) • Control The data words read from the disk are stored in the 8-bit The internal timing and control signals which sequence the DIR until read by the bus interface. FDC are derived from the macro instructions by the control section. Current Track Address Register (CTAR) CTAR is a 8-bit register containing the address of the track • HD6843SP PIN DESCRIPTION over which the R/W head is currently positioned. • Power Pins Command Register (CMR) Vee: +5 volt (±5%) power input. The macro commands are written to the 8-bit CMR to begin Vss: Power Supply Ground. their execution. Interrupt Status Register (lSR) • Bus Pins The four bits of the ISR represent the four conditions that can cause an interrupt to occur. Reset (RES) Input The RES input is used to initialize the FOC. When RES Set-Up Register (SUR) becomes "Low", the state of the outputs is defined by the table Variable Seek and Settling times are programmed by the below: SUR: Four bits are used to program the track to track seek time and four bits are used to program the head settling time for the floppy disk drive used with the FOC. Output State of Output Output State of Output Status Register A (STRA) FIR "Low" HLD "Low" The eight bits of STRA are used to indicate the state of the WGT "Low" TxRQ "Low" floppy disk interface. HDR "Low" IRQ "High" STP "Low" WDT "Low" Sector Address Register (SAR) SAR contains the five bit sector address associated with the Registers which are affected by RES are shown in Table 7. current data transfer. Status Register B (STRB) The eight error flags of STRB are used to signify error Interrupt Request (I RQ) Output conditions detected by the FDC or generated by the floppy disk The IRQ line is an open drain output that becomes a "Low" drive. level (logic "O") when the FDC requests an interrupt. Interrupt requests are controlled by the interrupt enables in CMR General Count Register (GCR) (Command Register) with the function causing the interrupt The seven bits of GCR contain the destination track address shown in ISR (Interrupt Status Register). when a SEK (seek) macro command is being executed. If a multi-sector Read or Write macro command is being executed, Data Bus O-Data Bus 7 (Do -0 7 ) Bidirectional GCR contains the number of sectors to be read or written. The 8 bidirectional data lines allow the transfer of data between the FOC and the controlling system. The output CRC Control Register (CCR) buffers are three-state drivers that are enabled when the FDC is The two bits of the CCR are used to enable the CRC and transferring data to the data bus. shift the CRC for the Free Format Commands. Enable (E) Input Logical Track Address Register (LTAR) The E input to the FDC causes data transfers to occur The seven bit track address used for read and write between the FDC and the system controlling the FDC 119 HD6843S, HD68A43S - - - - - - - - - - - - - - (HMCS6800 MPU, OMA Controller, etc.) E must be a logic "1" causes the FDC to neglect the state of RSo...... RS2 causing thl ("High" level) for any transfer to be enabled on 0 0 ......0,. The E FDC to select the DOR (Data Output Register) or DIR (Dat~ input is normally connected to system (/)2 • Input Register) to the data bus (00-0,) as shown in Table 2 CS = "0" and TxAK = "I" cannot be permitted at the samE Chip Select (CS) Input time. The CS input in conjunction with the E input, is used to enable data transfers on 0 0 ...... 0,. E must be a "High" level and CS must be a "Low" level (logic "0") to enable the transfer. Table 2 Register Selection for DMA Transfers The TxAK input being a "High" level (logic "1 ") performs a Register similar function as CS being a "Low" level. TxAK RSo-R~ CS RIW Selected ReadlWrite (RJW) Input 1 x 1 1 DOR The R/W input is issued by the system controlling the FDC 1 x 1 0 DIR (HMCS6800 MPU, OMA Controller, etc.) to signify if a read or write operation is to be performed on the FDC. When TxAK is a "Low" level, R/W is used in conjunction with CS and RSO ...... RS 2 to determine which register is accessed by the bus as shown in This mode of operation is normally used for DMA (Direct Table 1. When TxAK is a "High" level, R/W is used to select Memory Access) transfer with the FDC. either the OOR or DIR to the data bus (see description of When TxAK is a "Low" level the registers are selected by CS, TxAK input). R/W and RSo-RS2 as shown in Table 1. Register Select O...... Register Select 2 (RSo...... RS2 ) Input • Bus Direction (BD) Output RS o-RS 2 , in conjunction with the R/W input, are used The BD output is provided to control external bidirectional to select one of the user accessible registers in the FDC as buffers on the data bus (Oo-D,) as shown in Figure 14. Its shown in Table I. polarity is shown by Table 3. Transfer Request (TxRQ) Output TxRQ is used in the OMA mode to request a data transfer Table 3 Bus Direction (BD) States from the DMAC. TxRQ is a "High" level if the FDC is in the DMA mode (CMR bit 5 is set) when a data transfer request TxAK CS BD occurs (STRA bit 0 is set). It is reset to a "Low" level (logic 1 1 RIW "0") when TxAK becomes a "High" level (logic "1"). Data 0 1 0 transfer errors will occur if TxAK does not reset TxRQ before 0 0 RIW the next data transfer is required. (Operation of BO as defined by this chart allows the FOe to function Transfer Acknowledge (TxAK) Input with the DMA Controller H D6844P.) TxAK is generated by the system controlling the FDC (HMCS6800 MPU, DMA Controller, etc.) and is a response to a TxRQ issued by the FDC. A "High" level (logic "I") on TxAK Table 1 Address Codes for User Accessible Registers TxAK CS RS2 RS. RSo R/W Registers 0 DOR (Data Output Register) 0 0 0 0 0 1 01 R (Data Input Register) 0 0 0 0 1 1/0 CTAR (Current Track Address Register) ,. v CMR (Command Register; 0 0 0 1 0 1 ISR (Interrupt Status Register) 0 SUR (Set Up Register) 0 0 0 1 1 1 STRA (Status Regiser A) 0 SAR (Sector Address Register) 0 0 1 0 0 1 STRB (Status Register B) 0 0 1 0 1 0 GCR (General Count Register) 0 0--_._----- 1 1 0 0 CCR (CRC Control Register) 0 0 1 1 1 0 LTAR (Logical Track Address Register) 120 HD6843S, HD68A43S - - - - - - - - - - - - - - ,----------, Din I , MPU +-~~--~--~--~ ~~---+-~-+-- FOe Rout, , , , ,I I I I _________ _ L HDST26 Enable Figure 14 Bus Buffer Control • I/O and Control Pins B is read. Head load (HlO) Output File Inoperable (FI) Input HLD is used to notify the disk drive that the RfW head FI is an input to the FDC from the drive. A "High" level should be loaded (placed in contact with the media). When the indicates the drive is in an inoperable state. Its current state can FDC is ready for the head to load, HLD is a "High" level (logic be examined by reading bit 5 of Status Register B (STRB). "1 "). A "Low" level (logic "0") HLD indicates the head should be unloaded. Track Zero (TRZ) Input The TRZ input is reflected by bit 3 of STRA (Status Register Step (STP) Output A). The TRZ input must be a "High" level (logic "I") when the The STP output, in conjunction with HDR, is used to control R/W head of the drive is positioned over track zero. A logic" 1" head movement. A 32 IlS wide positive (logic "1") pulse is on this input inhibits step pulses during a Seek Track Zero generated on STP, to move the R/W head one track in the command. direction defined by the HDR output. The period of the STP signal is programmable by the SUR (Set-Up Register). The Index (lOX) Input number of pulses generated on STP is the difference between The index input is received from the floppy disk drive and is the contents of the CTAR (Current Track Address Register), used to sense the index hole in the disk media. The IDX signal is and the GCR (General Count Register) which contains the track used to initialize the intemalFDC timing. The state of the lOX address to which the head is to be moved. input is reflected by bit 6 of Status Register A (STRA). A "High" level (logic "1") is to indicate the index hole is under the Head Direction (HOR) Output index sensor. The index input is used to count the number of The HDR signal controls the direction of head movement. A disk revolutions while searching for the address 10 field (see "High" level (logic "1") signifies the head should step to the description of STRB bit 3). inside (toward the hub) of the disk. A "Low" level (logic "0") indicates the direction of head movement should be to the Ready (ROY) Input outside of the disk. The ready input is received from the disk drive and can be read as bit 2 of STRA (Status ReJtister A). A "Hidt" level (logic low Current Track (lCT) Output "1") indicates the drive is ready and allows the FDC to operate The LCT signal is used to control the level of write current the drive. used by the disk. drive. LCT is a "Low" level (logic "0") when the write head is positioned over tracks 0~43. If it is over tracks Write Protect (WPT) Input 44-76, LCT is a "High" level (logic "1 "). LCT is determined WPT is an input indicating when the media is Write from the contents of the Current Track Address Register Protected. A "High" level during an FDC write operation results (CTAR). in a Write Error (STRB bit 6) but the FDC continues to perform the write function. The state of the WPT input can be read by Write Gate (WGT) Output examining bit 4 of the Status Register A (STRA). When a write operation is being performed, WGT is a logic "I" ("High" level). For a read operation, WGT is a "Low" level Clock (ClK) Input (logic "0"). The CLK input is used to generate various timing sequences internal to the FDC. The head settling, seek time, step pulse File Inoperable Reset (FIR) Output width and write data pulse width, etc., are generated from the FIR is an output from the FDC to the floppy disk drive to CLK input signal. The CLK is 1 MHz frequency and the duty is reset it from an inoperable status. If the FI input is a "High" 50%. level, a pulse, of which width almost equals to E pulse "Low" width, is generated on the FIR output whenever Status Register 121 HD8843S, HD88A43S - - - - - - - - - - - - - - • Data Pins Data Clock (OCK) Input OCK is used to clock data from the drive into the FOC. It is generated from the read data received from the drive. Read Data (ROT) Input Clock RDT is the serial data input from the drive. The data stream f = Frequency of the ClK Input. To insure IBM3740 compatibility the clock frequency must be 1 MHz. includes both the clock and data bits. Write Data (WOT) Output Figure 15 WDT Output Timing WDT is the double frequency modulated data output from the FOC. The time between clock bits is 4/f where f is the frequency of the clock input. The pulse width for both clock and data is I/f (see Figure 15). For the normal clock frequency • FORMAT of I MHz the clock period is 4 IlS, the clock pulse width is. 1 IlS The format used by the HD6843SP, shown in Figure 18, and the data pulse width is I IlS. Figure 15 shows the compatible with the soft sector format of the IBM3740. relationship between the WDT output and the frequency of the eLK inputs. • MACRO COMMAND SET The macro command set shown in Table 4 is discussed in th Variable Frequency Oscillator Control (VFOC) Output following paragraphs. VFOC is used as a sync signal during system diagnostics. Waveforms are shown in Figure 16. SSR, RCR, MSR Command lOX DiSk~~ ~~-,O--' _ _G"S_....iI.;.Gl....i1 "High" GJ !----~ Data 10 G3 WGT VFOC 2 bits 2 bit. SSW, SWO, MSWCommand lOX o;'k~ IG'~~-'-O- WGT G. ~--------------~ "rl ~ ~ ~'bvm G I"--o-a-ta--', G. ~-------- 10 In FFW Command, VFOC becomes "High" when WGT is at "High" level. In FFR Command, VFOC remains "High". Figure 16 Variable Frequency Oscillator Control Waveform (Relation Between WGT and VFOC) 122 HD6843S, HD68A43S SSW, SWD and MSW commands (Single Sector Write, Single Sector Write with Delet Data Mark, and Multi-Sector Write) WGT--~ C D C D C ~b, WDT ---~ (1) 1.0 jJS (typ) (2) 0 jJS (min) 0.7 jJS (min) 0.3 jJS (max) 1.3 jJS (max) Figure 17 Write Data versus Write Gate Timing Index ...-II1.o..--------------fHI------------rL Gap Gap 2 Preamble (Post-Index) Track Format r=::-l 46 Bytes ~ 32 Bytes Sector 2 Sector 25 o Index Address Mark 'sector l' 'sectorJ IJ ~ector 2~ s!ctor 2 6 U Gas 5 274 Bytes Data = FC (Pre-Index Gap) Clock = D7 ID A~~~~ss Gap 3 Gap 4 Data = FE (lD Gap) (Data Gap) Clock = C7 1 7 Bytes 33 Bytes Sector Format 8:=v:=H~ ~,-- Address ID Field Data ____--" I~~ Data CRC 6 Bytes Address Mark 128 Bytes 2 Bytes Next 10 Data=FB or F8 Address Mark 1 - Track Address Clock = C7 2 - 00 Byte 3 - Sector Address 4 - 00 Byte 5- CRC 6-CRC Figure 18 Soft Sector Format Table 4 Macro Command Set CMR Bits Hex Macro Command Bit 3 Bit 2 Bit 1 Bit 0 Code 1 STZ Seek Track Zero 0 0 1 0 2 2 SEK Seek 0 0 1 1 3 3 SSR Single Sector Read 0 1 0 0 4 4 S9N Single Sector Write 0 1 0 1 5 5 RCR Read CRC 0 1 1 0 6 6 9ND Single Sector Write with Delete Data Mark 0 1 1 1 7 7 MSW Multi Sector Write 1 1 0 1 D 8 MSR Multi Sector Read 1 1 0 0 C 9 FFW Free Format Write 1 0 1 1 B 10 FFR Free Format Read 1 0 1 0 I A 123 HD6843S, HD68A43S • Seek Track Zero (STZ) • Address Search Operation The STZ command causes the R/W head to be released from The flow chart of Figure 20 shows the operation of t} the surface of the disk (HLD is reset) and positioned above address search operation. track 00. The FDC issues step pulses on the STP output until the TRZ input becomes a "High" level or until 82 pulses have been sent to the drive. When the TRZ input becomes "High", the step pulses are inhibited on the STP output but the FDC remains busy until ail 82 have been generated internally. If the TRZ input remains "Low" (logic "0") after all 82 pulses have been generated, the seek error flag (STRB bit 4) is set. After all 82 pulses have been generated, the head is loaded (HLD becomes a "High"). After the settling time specified in the SUR has expired, the Seek Command End flag is set (ISR bit 1), Busy STRA7 is reset, CTAR and GCR are cleared. The head remains in contact with the disk. A command such as RCR (Read CRC) may be issued following a STZ if the head Thil Operetion II Conducted in Perellel must be released. with ell Other Operationl. • Seek (SEK) The SEK command is used to position the R/W head over the track on which a Read/Write operation is to be performed. The contents of the GCR are taken as the destination address and the content of the CTAR is the source address; therefore, the number of pulses (N) on the STP output are given by: Set Treck NOI Equal N = I(CTAR) - (GCR)I HDR is a "High" for (GCR) > (CTAR) otherwise it is a "Low". Set RWCE IISR Bit 01 TreckBil51 SloreICMR AdG-... 'r--t--"'IiiO£~5~~~ InDIR When a SEK command is issued, Busy is set, the head is raised from the disk, HDR is set as described above, and N number of pulses appear on the STP output. After the last step pulse is used, the head is placed in contact with the disk. Once the head settling time has expired, the Seek Command End flag (ISR bit 1) is set, Busy is reset, and the contents of the GCR are transferred to the CTAR. • SINGLE SECTOR READ/WRITE COMMANDS The single sector Read/Write commands (SSR, RCR, SSW, and SWD) are used to Read/Write data from a single 128 byte sector on the disk. As shown in Figure 19 these types of instructions can be divided into two sections. The first section, which is common to all instructions, is the address search operation, while the second sec:tion is unique to the require- ments of each instruction. Figure 20 Operational Flow of the Address Search Sequenc • Single Sector Read (SSR) The single sector read command follows the address searc. procedure as defined in the previous flowchart. If the search i successful, status sense request is set and the operatio continues as described by the flowchart of Figure 21 . • Read CRC (RCR) Figure 19 Basic Single Sector Command Flow Chart The RCR command is used to verify that correct data wa written on a disk. The operation is the same as for the SS] 124 HD6843S, HD68A43S Set Data Address Mark Undetected (STAB Bit2) Set RWCE IISR Bit 0) Set CRC Error (STRB Bit 1) Set RWCE IISR Bit(l) Figure 21 Operational Flow of the SSR Command 125 HDI843S, HD68A43S command with the exception that the data transfer request • Single Sector Write with Delete Data Mark (SWD) (STRA bit 0) is not set. The Status Sense Request interrupt can The operation flow of SWD is exactly like that of SSW. F< be disabled by using the DMA flag of CMR. SWO, the data pattern of the Data Address Mark becomes F instead of FB. The clock pattern remains C7. • Single Sector Write (SSW) Single sector write is used to write 128 bytes of data on the • Multi-Sector Commands (MSRIMSW) disk. After the command is issued, the address search is MSR is used for sequential reading of one or more sector performed. The remainder of the instruction's operation is If S sectors are to be read, S - 1 must be written into.the GC shown.in Figure 22. before the command is issued. Write the Data AddreaMark (Cloc:k -C7, Oate. FB) Figure 22 Operational Flow of the SSW Command 126 HD6843S, HD68A43S The basic operation for the MSR and MSW is the same as • REGISTER DEFINITIONS that for the SSR and SSW respectively. The basic operation begins with an address search operation, which is followed by a single sector read or write operation. This completes the operation on the first sector. The SAR is incremented, the GCR is decremented, and if no overflow is detected from the GCR (i.e., GCR become negative) the sequence is repeated until S When one of the four write macro commands (SSW, SWD, number of sectors are read or written. MSW, and FFW) is executed, the information contained in the The completion of an MSR or MSW is like that of an SSR or DOR is loaded into the DOSR, and is shifted out on the WDT SSW command. First RWCE is set and Busy is reset, after the line using a double frequency (FM) format. settling time has expired, the head is released. If a delete data mark is detected during an MSR command, • Data Input Register (DIR); Hex address 0, read only STRA bit 1 (Delete Data Mark Detected) remains set through- out the commands operation. When a multi-sector instruction is issued, the sum of the SAR and GCR must be less than 27. If SAR + GCR > 26, an address error (STRB bit 3 set) will occur after the contents of SAR One of the three read macro commands (SSR, MSR, FFR) becomes greater than 26. executed, will cause the information on the RDT input to be clocked into the DISR. When 8 clock pulses have occurred, the • Free Format Write (FFW) 8 bits of information in the DISR are transferred to the DIR The FFW has two modes of operation which are selected by where it can be read by the bus interface. FWF (Free Format Write Flag) which is dat,a bit 4 of the CMR. When FWF = "0", the data bits of the DOR are written di- • Current Track Address (CTAR); Hex address 1 , read/write rectly to the disk without first writing the preamble, address mark, etc. The contents of the DOR are FM modulated with a Bit 7 I Bit 6 I Bit 5 I Bit 4 I Bit 31 Bit 2 TBit 1 TBit a clock pattern of all ones. Track Address of Current Head position If FWF = "1" the odd bits of the OOR are used as clock bits and even bits are used for data bits. In this mode, the DOSR The address of the track over which the R/W head is clock is twice a normal write operation and one byte of DOR is currently positioned is contained in the CTAR. At the end of a one nibble (four bits of data) on the disk. SEK command, the contents of the GCR are transferred to the The two modes of the FFW command allow formatting a CTAR. CT AR is cleared at the completion of a STZ command. disk with either the IBM3470 format or a user defined format. CTAR is a read/write register so that the head position can be After the FFW command is loaded into the CMR, WGT updated when several drives are connected to one FDC. Bit 7 is becomes a "High" level, the contents of DOR are transferred to read as a "0". the DOSR, data transfer request (STRA bit 0) is set, and the serial bit pattern is shifted out on the WDT line. Therefore, OOR • Command Register (CMR); Hex address 2, write only must be loaded before the FFW command is issued. Data from the DOR is continually transferred to the DOSR and 'shifted out Bit 7 Bit 6 Bit 5 Bit 4 Bit 3*1 Bit 2* 1 Bit 1 * 1 Bit 0* on WDT until the CMR has been written with an all zero Function ISR3 DMA Macro Command Interrupt Interrupt FWF pattern. When CMR becomes zero, WGT becomes a "Low" Mask Mask Flag level, but RWCE is not set and the R/W head is left in contact with the disk. *Bit 0 - 3 are clt:ared by RES. The commands that control the FDC are loaded into the • Free Format Read (FFR) lower four bits of the CMR. Information that controls the data FFR is used to btput all data (including Address marks) from transfer mode and interrupt conditions are loaded into bits four a disk. Once the FFR command is set into the CMR, the head is through seven. loaded and after the settling time has expired the serial data from the FDC is brought into the DISR. After 8 bits have Bit Q-Bit 3: Macro Command accumulated, it is transferred to the DIR and Data Transfer The Macro Command to be executed by the FDC is written Request (STRA bit 0) is set. to bits 0--3. This operation continues until a zero pattern is stored in the Bit 4: Free Format Write Flag (FWF) CMR, terminating the FFR command. As in the case of the If a Free Format Write command is issued, the state of bit 4 FFW command, RWCE is not set and the head remains in of the CMR determines what clock source will be used. The contact with the disk. FWF is defined in the FFW (Free Format Write) command The first data that enters the DISR is not necessarily the first explanation. bit of a data word since the head may be lowered at any place Bit 5: DMA Flag on the disk. To prevent the FDC from remaining un- If bit 5 is a "1" the FDC is in the DMA mode. -Bit 5 being a synchronized to the data, the FFR command will synchronize "1" inhibits setting of Status Sense Request (lSR bit 2) thereby to an ID address mark (FE) or a Data Address mark (FB or F8) preventing its associated interrupt. A logic" 1" DMA flag also or an Index Address Mark (FC). enables the TxRQ output allowing it to request DMA transfers when the Data Transfer Request flag (STRA bit 0) is set. A logic "0" DMA flag indicates the program controlled I/O (PC I/O) mode. 127 ~ Command Set "Command End GCR, CTAR; ch!ar HLO ---- I ----- HOR ----, ----- Settling time LCT -----, ----- .~seek time 321-15 l Seek time z c ...... I\) STP -- 1 -min,Ons 2 3 n-1 !'1• H : i n , 21-15 '1 I• n~l :\ 82 . G) CIt w !IJ co z TRZ I c G) ROY "'" ~ t STRA7 (Busy) ---' , en II ISR' (Seek Command End) • STP output is masked when TRZ becomes "High", But if TRZ falls to "Low" again before 82 pulse outputs are all provided, STP output become available again from that time point, •• When ROY i,; "Low" with Command Set, the execution is postponed until ROY becomes "High", Figure 23 Timing Sequence of STZ Command GCR Set ,. "" I Command Set Command End ~~eek--r--Se~tling_ CTAR Determined time time ~ HLD ---_\ I ---- ---- ==~~~:-_t( "High"; toward the hub HDR \ "Low" ; away from the hub --- ------- "High" GCRL 44 J: LCT --- -------1. -" STP min.L Ons Seek---l time l}- ~ -r f----min.32I.1s "Low" GCRS; 43 C G) C» ~ Co) !IJ I\) 1 2 n CD (Difference between J: C * "1" GCR and CTAR) G) RDY ; ~ STRA7 -IJ , Co) tn (Busy) II ISRl (Seek Co "-- mand End) Time for calculation of relative address Max lms. * When RDY is "Low" with Command Set, the execution is postponed until RDY becomes "High". Figure 24 Timing Sequence of SEK Command LTARSAR Next Command Set Set Set Start Address Search ~Y...I I " ~\ Command Set A Command End (Address Error) HLO === =t.-S".';n.~ tIme r---se~ling_1 tIme Unless a new command is issued during the settling time after Command End, HLO becomes" Low", lOX ~~,...J Unless the address is detected :::t before the c k revolves three C STRA7 (Busy) J "- times after I Immand Set, it results in Cc mmand End with Address Err G) : Co) ...... Il: 0=1 !R Co) ISRO STF 3 =1 :::t o (R/We )mmand End) C ROT Va lid '( \ E Co) en * If HLO has already been "High" when the command is set, the FOC starts the address search immediately, When ROY is "Low" with Command Set, the FOC waits for the execution until ROY becomes "High", Figure 25 Timing Sequence of SSR, SSW, RCR, SWO, MSR, MSW Command (Relation with HLO and lOX) I- ID .. I Data from FF 00 00 00 00 00 00 IDAM Track 00 Sector 00 CRC CRC I FF FF the diskette -, Check Timing of Data r--------------.-- I ---~----, -----,----, --- ---.--- -I ----.-- I IDAM detection CD '\ \~~ _______ _'l.® _______ ____ _ Reset Reset Track Compare with ® ------------------------------.J·~~s-;;;--------~:t------ ------ LTAR 1 \ \ Equal :z: , c Q) Sector Compare with 00 \ SAR Equal @ "., ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~----------- Co) ...... ------ !b c.l ...... ID CRC @ :z: "0" c Q) Track Sector Not Equal Not Equal ~ "., I Co) ..\ Command End en ~ _:i~ ~~:E.:.r~ ~r_w~t~~rack Not Equal ® (R/W Command End) I ISRO (Sense Request) , ISR2 set by address ISR2 detection (1i) In the case of Track Not Equal, ® is not set and ,if CRC equals to the one calculated by FDC, STRAS is set. @ In the case of Sector Not Equal, c:v is not set and CD & ® are reset to search the next IDAM. @ In the case of CRC Error, @ is not set and CD,® & @are reset. (ISRO: Set, STRB1: Set, STRB3: Set) When CD, ®. @, & @) are all set,ISR2 is Set. These four signals are reset with Command End. When @ is "1 ", go to the data transfer routine. Figure 26 Internal Timing Sequence of Address Search Routine ~ -I Data or DAM 1st 2nd 3rd 127th 128th :RC FF FF F~+- I~ PDAM Data Data Data Data Data CRC CRC FF FF Data from the diskette ~ GAP ---- / , +== '------------ --------------_\ I IDCRC "0" Command End with DAM'Undetected Reset with Co Read Data \ (t Valid n n 11 fl I n ~ It ~ m ¥R STRAO (Data ansfer Request) 11\ Set Pulse ~rf of RCR, STRAQ ated to nerated Read % DIR oG) STRBO (Da Transfer Error! Transfer : Coo) .... W N STRB2 IDA I· undetected) 32 bytes ,,------------ ~----- ------------~-l M Undetected !II % o G) ; I STRBl (CR Error) r---~l Error t (I) I (R/W :ommand End) ;-.,--------- ~-------------I ISRO STRAl (DO I " detected) Command End with DAM Undetected ~ is 'FS'. "if DAM I. I. ISR2 (Sense Reque A - I ISR l'lead Unless DAM(FB) or DDAM(FS) is detected within 32 bytes after 10 field has been detected,STRB2 is set to end the command. Figure 27 Data Transfer Timing of SSR, RCR Command -10- Data DAM* or 1st 2nd 127th 12Sth CRC CRC CRC FF FF 00 00 FF Data from DDAM Data Data Data Data FF the diskette IDCRC -11 bytes I 6 bytes I T "0" WGT -) Write Data \ ...... (,.) (,.) STRAO Transfer Writing _1 (Data Transfer Request) DOR---.DOSR ~ U rutl rr -ru ~tl J1 It .-J ~ J: C G) CD ~ Co) !I» J: C on DOR STRBO , Transfer Error G) ~ ~ Co) (Data Transfer Error) en ISRO Command End (R/WComman :I End) ISR2 _If \ (Sense Request) A'" ISR Read * As Data Address Mark, SSW command writes 'FB' and SWD command writes 'FS', Figure 28 Data Transfer Timing of SSW, SWD Command Sector Sector I Sector Co mmandSet ~ J~ 1 ~, Command End 10 I GAP I Data GAP 101 GAP I Data 10 I GAP 1 Data GAP I Addre!;5 Address Address FOC Search Data Transfer Search Data Transfer Search Data Transfer Operation I I J: C 0) CO GCR decremen t GCR- 1 SAR+1 1 GCR- 1 SAR+1 1 GCR-1 SAR+1 (GCR)=O ~ Co) ..... SAR increment !b Co) ~ r--------------,------------- L 1_ ~-..,. c: -- --------- J J: C ·ISRO (R/W Comma ,rI ~n"'l \ ,---- Command End with Address Error Command End 0) ~ ~ Co) Address Search and Data Transfer in each sector is the same as those of SSR or SSW command. en When Address Error occurs. it results in Command End. If an error relating to Data Transfer occurs, Error flag is set. But the command continues to be executed to shift into the next sector. Figure 29 Timing Sequence of MSR, MSW Command Command Set Set "00" Command into CMR HLD Se.ttling I tIme ~'~------------------------------------------1 WGT 1st 2nd ~ Data Data C DOSR m CO ~ w ..... Co) DOR -+ DOSR '\.---,.,I\..--...I"--J'----I"--J ' - - - ' ' - - - ' !.n 01 Transfer ~ c m STRAO (Data Transfer Request) ~ ~ w Writing on en DOR 2nd 1st Data Data DOR • The first one-byte data must be set into DOR before Command Set. • If H LD has already been "High" when the command is set, WGT becomes "High" immediately. • When '00' command is set into CMR, an interrupt of Command End is not generated. Figure 30 Timing Sequence of FFW Command Command Set ___ ~ . Set "00" oommand 'nto CMR Irl--------------------+--------- Settling time Read Data _ _ _ _ _ _ _ _ _ _ _ _....J Valid 1st % Data C DSR 0) at ~ Co) ..... DISR ..... DIR Transfer - - - - . - - - - - - - - -......'~'+__I~""'_r__I'_r___''_+__' !P (0) % m C 0) DIR ; ~ Co) Reading out tJ) ofDIR --------------------------~ STRAO (Data Transfer Request) If HLD has already been "High" when the command is set, Read operation starts immediately without waiting for the settling time. When "00" command is set into CMR, an interrupt of Command End is not generated. Figure 31 Timing Sequence of FFR Command HD6843S, HD68A43S Bit 6: ISR31nterrupt Mask times. For MSR and MSW commands, it is set for each sector. CMR bit 6 (ISR3 Mask) is used to control the operation of In the PC I/O mode, an interrupt occurs when Status Sense ISR bit 3. A logic "1" in CMR bit 6 inhibits output of STRB- Request becomes a logic" 1". In the DMA mode, (DMA flag of OR·Interrupt signal to mo. If CMR bit 6 (ISR3 Mask) and CMR is set) Status Sense Request is unchanged and does not CMR bit 7 are "0" STRB-OR·Interrupt signal will be output to generate an interrupt when the address ID field has been iRQ. verified. Bit 7: Function Interrupt Mask Bit 3: STRB-OR When CMR bit 7 is a logic "1" all interrupts are inhibited. STRB·OR is an "OR" of all of the bits of Status Register B. STRB·OR =STRBO + STRBI + STRB2 + STRB3 + Table 5 STRB4 + STRB5 + STRB6 + STRB7 Command Register Masks STRB·OR-Interrupt =STRBI + STRB2 + STRB3 + That Affect Interrupts STRB4 + STRB5 + STRB6 + STRB7 Causes of CMR7 STRB-OR-Interrupt signal causes IRQ. STRB-OR is read (Function CMR6 CMR5 by Read ISR. STRBO (Data Transfer Error) sets ISR Bit 3 but Interrupt Interrupt (lSR3 Mask) (DMA Flag) does not cause Interrupt. Mask) ISRO ISRO, ISRl, and ISR2 are cleared when the Interrupt Status (Read write M X X Register is read, but ISR3 is cleared only after Status Register B Command End) has been read except when FI input is "High". ISR1 (Seek Command M X X End) ISR2 (Status Sense M X M Request) The SUR is not affected by a reset operation; therefore, once ISR3 it is initialized, the information remains until power is removed (STRB-OR- M M X from the FDC. Interrupt) Bit 0 '" Bit 3: Head Settling Time x = No effect M = Bits that are used as masks The. head settling time is used to generate a delay after the head is placed in contact with the disk. This allows the head to stop bouncing before any operations are performed. The delay • Interrupt Status Register (lSR); Hex address 2, read only is programmed by bits 0-3 and is specified by the equation: Bit 71Bit 61Bit 51 Bit 4 Bit 3 Bit 2* Bit 1* Bit 0* Delay = 4096 •B Status Seek Read Write f Not Used STRB Sense Command Command (Read as "0") ·OR B =Number contained in bits 0-3 of SUR Request End End f =Frequency of ClK input • Cleared by REs For IBM3740 compatibility f = 1 MHz and the timing range is 4.096 ms for a "0001" to 61.44 ms for a "1111". A "0000" code prevents Settling Time complete from being set and the Bit 0: Read Write Command End (RWCE) FDC must be Reset. When an SSR, RCR, SSW, SWO, MSR or MSW Macro Command has completed execution, bit 0 becomes set (logic Bit 4 '" Bit 7: Track to Track Seek Time "1 "). If the function interrupts are enabled (bit 7 of CMR is a The frequency of STP is detennined by bit 4- bit 7 of SUR logic "0"), the conclusion of a Macro Command's execution will as shown below. cause an interrupt. Bit 1: Seek Command End (SCE) Seek Command End is set on SEK and STZ commands to II------A 1024 _ _ _ _--..11 ~3f2f- indicate the head has been loaded and the settling time specified in SUR has expired. Since RWCE is not set for the SEK or STZ f command, SCE can be used as an interrupt to signify the SEK or STZ command has fmished. SCE is not set for any of the ufl~ ________ ~~ R/W commands. A = Number specified in bits 4-7 of SUR. f = Frequency of elK input. Bit 2: Status Sense Request For an SSR, SSW, SWO, MSR, or MSW Command, Status Sense Request indicates that the specified address ID field has For IBM compatible operation, f is 1 MHz. This results in an been detected and verified by a CRC check. This is used as an STP pulse width of 32 J.LS and an STP interval of 1.024 ms for a early indication that data transfers will occur after 18 more byte "0001" to 15.36 ms for a "1111". 137 HD6843S, HD68A43S • Status Register A (STRA); Hex address 3, read only of STRB bit 3) during the address search phase of a non-free format read/write command. Bit 7* Bit6 Bit 5* Bit 4 Bit 3 Bit 2 Bit 1 * Bit 0* Bit 7: Busy Track Write Delete When Busy is a logic "1", the FDC is executing a command Track Drive Data Busy Not Pro- Data and no new commands can be issued. Busy should be confirmed Index Transfer Equal Zero Ready Mark tect Request to be "0" before reading ISR or. STRB as well as issuing a Detected command. * Clear~ by RES • Sector Address Register (SAR); Hex address 4, write only Bit 0: Data Transfer Request For a write operation (SSW, SWD, MSW, FFW) the transfer request bit indicates that the DOR is ready to accept the next data word to be written on the disk. If data is not written into * Cleared by RES the DOR before the last data bit in the DOSR is shifted out to Before a data transfer macro command (SSW, SWD, SSR, the WDT line; the data transfer error bit (bit 0 of STRB) will be RCR, MSW, MSR) is issued, the address of the sector on which set. After a write command has been issued, the first transfer the operation is to be performed must be written into the SAR. request occurs simultaneously with the Status Sense Request. The address in the sector address byte of an Address ID field of For a write operation, transfer request is reset after the DOR the disk is compared with the contents of the SAR. During an haS been written from the data bus. MSW or MSR command, the SAR is incremented after each During a read operation (SSR, MSR, FFR) the transfer sector is read or written. When execution is complete, the SAR request bit signifies data from the DISR has been transferred to contains the address of the last sector on which an operation the DIR. The DIR must be read before the DISR is full again or was performed plus one. the data transfer error bit (bit 0 of STRB) will be set. For read operations, transfer request is reset by a read of the DIR. • Status Register B(STRB); Hex address 4, read only Bit 1: Delete Data Mark Detected Bit 7* 'Bit 6* Bit 5 Bit 4 * Bit 3* Bit 2* Bit 1 * Bit 0* A Single Sector Read operation that detects a delete data code (F8) instead of a general data code (FB) as a Data Address File Sector Data Data Hard Write Inoper- Seek Address Mark CRC Trans- Mark will set the'Delete Data Mark Detected bit. For the MSR Error Error Error Unde- Unde- Error fer command, bit 1 is set the first time an "F8" code is found and able tected tected Error remains set throughout the execution of the command. Bit 1 is reset whenever an SSR, SSW, SWD, MSR, MSW, or RCR * Cleared by RES command is issued. The bits of the STRB represent possible error conditions that Bit 2: Drive Ready may occur during execution of macro commands. Whenever The Drive Ready bit indicates the state of the Ready input STRB is reset, ISR bit 3 is also reset. from the floppy disk drive. If a command is issued with Ready at logic "0", its execution will be inhibited until Ready becomes Bit 0: Data Transfer Error a logic "I". If ready becomes a "0.:' during the execution of a Data Transfer Error indicates an underflow or overflow of command the Hard Error Flag (STRB bit 7) is set. data. If a Write operation is being performed, it signifies that data was not presented to the DOR before the DOSR became Bit 3: Track Zero empty. In this case, the current contents of the DOR are trans- The state of the Track Zero input from the floppy disk drive ferred to the DOSR and the write operation continues. The is reflected in this bit of STRA. A logic" 1" on the Track Zero data transfer error temains set until STRB is read, and the data input inhibits step pulses during an STZ command. transfer request remains set until data is written into the DOR. The operation of the CRC is unchanged. Bit 4: Write Protect For read commands, a data transfer error indicates that data The Write Protect input from the floppy disk drive is in the DIR was not read before the next data word from the reflected by bit 4 of STRA. A "High" level (logic" 1") on the disk was transferred to the DIR. The read operation contimH~8 WPT input during the execution of any write command results until sufficient data has been read from the disk to satisfy the in a write error (bit 6 of STRB set). requirements of the command (I28 bytes for SSR). The error indication remains set until STRB is read, and the transfer Bit 5: Track Not Equal request remains set until data is read from the DIR. If the track address read from the address ID field does not coincide with the address in the LTAR in spite ofCRC matching Bit 1: CRC Error the one calculated by FDC, the Track Not Equal bit is set. A CE.C error occurs when the CRC read from the disk does Track Not Equal applies to all non-free format read/write com- not match that calculated by the FDC on the data it reads from mands, and is reset after -a non-free format read/write com- the disk. A CRC error can occur in two different situations; mand is issued. checking the address ID field, checking the data field. Bit 6: Index If the CRC error occurs during the check of an address ID . The. state ~f the index input appears in bit 6 .of STRA. !he field, Sector Address Undetected (STRB bit 3) will also be mdex mput IS used to count the number of disk revolutIOns indicated (see Table 6). A CRC error of a data field is indicated while the FOe is looking for the address ID field (see operation 138 by a CRC Error and no Sector Address Undetected. HD6843S, HD68A43S Bit 2: Data Mark Undetected The GCR contains the destination track address for the R/W If a valid data mark is not detected in the data block of a head on an SEK Macro Command. The contents of the GCR are sector, it is indicated by a Data Mark Undetected error. transferred to the CTAR at the end of the SEK Command. For multi-sector read or write operations (MSR, MSW), the GCR Bit 3: Sector Address Undetected contains the number of sectors to be read minus one. During the The Sector Address Undetected bit can be set on two condi- MSR or MSW execution the GCR is decremented after each tions; not finding the sector address and a CRC error on an sector is read or written_ address ID field. If the disk makes three revolutions during an address search • CRC Control Register (CCR) ; Hex address 6, write only operation and the sector address specified in the sector address register is not found in any of the address ID fields, a Sector Bit 7 I Bit 61 Bit 51 Bit 41 Bit 3 I Bit 2 Bit 1 Bit 0 Address Undetected condition is indicated. Shift CRC Not Used A CRC error that occurs on an address ID field will set bit 3 CRC Enable also_ Table 6 shows how bits 1 and 3 are related. The CCR information is used only in the free format commands; for all other commands this register is masked and Table 6 Relationship of CRC Error and has no function. Sector Address Undetected Bit 0: CRC Enable Sector During an FFW command, CRC Enable is set by software CRC Error Address and CRC generation takes effect on the next transfer of data Undetected Condition from DOR to DOSR (see figure 32). The CRC generation (STRB1) (STRB3) continues until Shift CRC (CCR bit 1) is set. 0 0 No Error For an FFR command, CRC Enable is set by software and 0 1 Sector Address not Detected CRC generation takes effect on the next data read from DIR. The calculation continues for all data bytes read from DIR until 1 0 CRC Error on a Data Field CRC Enable is reset. The bytes read previous to resetting CRC 1 1 CRC Error on Address 10 Field Enable are considered the CRC information bytes and the CRC check is made against them. Bit 4: Seek Error Bit 1: Shift CRC An STZ (Seek Track Zero) command that never receives a Bit 1 is valid only for the FFW command. After setting, it track zero indication on the track zero input will result in a takes effect on the next transfer of data from DOR to DOSR Seek Error (see description of STZ command). (see Figure 33)_ Setting Shift CRC terminates the CRC calculation and causes the CRC calculated on all the data Bit 5: File Inoperable written into DOR up to the setting of bit 1, to be shifted out The state of the File Inoperable input appears in bit 5. If the the WDT output. The CRC calculation will not include any data File Inoperable input is a "High" level, a pulse of width equals written to DOR after Shift CRe is set. to Enable pulse width PWEL is issued on the FIR output when • LTAR (Logical Track Address); Hex address 7, write only STRB is read. FI is not latched but the input is gated to the bus when STRB is read. Bit 7 Bit 61 Bit 51 Bit 41 Bit 3 I Bit 2 I Bit 1 1 Bit 0 Not Bit 6: Write Error 7 Bit Logical Track Address Used If the WPT input becomes a "High" level (logic "1") during the execution of a write command the Write Error bit is set. When a read or write macro command (SSW, SWD, SSR, RCR, MSW, MSR) is issued, the address of the track on which Bit 7: Hard Error the operation is to be performed must be written into the If the Ready input becomes a "Low" level during the opera- LTAR. The address in the track address byte of an Address ID tion of a command (Busy is set), a Hard Error indication will field of the disk is compared with the contents of the LTAR. result. The contents of LTAR are not affected by the execution of any of the commands. • General Count Register (GCR); Hex address 5, write only Bit 7 Bit 61 Bit 51 Bit 41 Bit 31 Bit 2 1 Bit 1 1 Bit 0 Not 7 Bit Count for Track Number on SE K Command Used and Sector Count for MSR or MSW Command 139 HD6843S, HD68A43S CRC CRC Enable Enable Reset Set (CCRO=O) (CCRO=1) DCK (Data Clock Input) Load Signal from DISR to DIR DTR CRC Enable_...-oif-_ _......" (CCRO) CAC valid DISR DIR CRC Calculation includes Data Byte 1 through Data Byte n. Figure 32 CCR Control Register Timing for an FFR Command (READ) Shift CCR Enable Set CCR Set Write Byte (CCRO=1) (CCRO=1) n+2 to DOR (CCR1=O) Write (CCR1=1) (Data n+2) Byte n CCR Set to DOR (CCRO=O) (Data n) (CCR1=O) Shift Clock Load signal from DOR to DOSR STRAO (DTR) CCRO (CRC Enable) CCR1 (Shift CRC) CRCvaiid DOR DOSR WDT Output Data 2 The CRC Calculation includes Data Byte 1 through Data Byte n-1. Figure 33 CCR Control Register Timing for an FFW Command (WRITE) 140 HD6843S, HD68A43S Table 7 Programming Reference Data Table 7 is a summary of the information in the data sheet and can be used as a reference when programming the HD6843S Hex R/W Data Bits Registers Address Mode Bit 7 Bit6 Bit 5 Bit 4 Bit 3 * I Bit 2 * I Bit 1 * I Bit 0 * Function ISR3 DMA CMR 2 WO Interrupt Interrupt Flag FWF Macro Command Mask Mask Bit 7 I Bit6 I Bit 5 I Bit4 Bit 3 Bit 2 * Bit 1 * Bit 0 * Status Seek Read Write ISR 2 RO Not Used STRB Sense Command Command -OR Request End End Bit 7 * Bit6 Bit 5 * Bit 4 Bit 3 Bit2 Bit 1 * Bit 0 * Track Delete Data Busy Index Write Track Drive Not Protect Zero Ready Data Mark Transfer STRA 3 RD Equal Detected Request Bit 7 * Bit 6 * Bit 5 Bit4 * Bit3 * Bit2 * Bit 1 * Bit 0 * File Sector Data Hard Write Seek Address CRC Data Error Error Inoperable Error Mark STRB 4 RO Undetected Undetected Error Transfer Error RO - Read Only * Cleared by RES WO - Write Only R/W - Read/Write 141 HD6843S, HD68A43S MACRO COMMANDS Hex Code Instruction Hex Code Instruction 2 STZ A FFR 3 SEK B FFW 4 SSR C MSR 5 SSW D MSW 6 RCR 7 SWD Table 8 Error Condition, Command Execution, Interrupt, and Head Control Error Flag Set Condition Reset Condition Command Command Execution Interrupt Head Control Track information of I D field Issuing of SSR,RCR, The execution of a command Track Not STRA5 is not equal to the content of MSR, SSW, SWD or SSR,RCR,MSR is interrupted and R/W Request Unchanged** Equal MSW Command SSW, SWD, MSW (lSRO) LTAR. Command End (lSRO) is set. Data SSR, MSR, SSW, Overrun or underflow during Read/Write command con- No Transfer STRBO Reading of STR B SWD, MSW, FFR Unchanged** the data transfer tinues to be executed. interrupt Error FFW SSR, RCR, MSR, The execution of a command Request CRC CRC Error on ID field or Date STRB1 Reading of STRB SSW, SWD, MSW is interrupted and R/W (lSRO, Unchanged" Error field (FFR) Command End USRO) is set. ISR3) DAM or DDAM is undetected The execution of a command Request Data Mark STRB2 within 32 bytes after ID field Reading of STRB SSR, RCR, MSR is interrupted and R/W (lSRO, Unchanged·· Undetected has been detected. Command End (lSRO) is set. ISR3) Unchanged (1) Sector Address of ID Sector Reading of STRB The execution of a command Request (Head remains Address field is not equal to the SSR, RCR, MSR STRB3 after Busy (STRA7) is interrupted and R/W ((SRO, loaded after content of SAR. SSW, SWD, MSW Undetected is reset. Command End ((SRO) is set. ISR3) settling time (2) CRC Error on ID field has expired.) TRZ signal semains "Low" level The execution of a command though eighty-two STP pulse Request Seek Error STRB4 Reading of STRB STZ is interrupted and Seek outputs are prcvided in STZ Unchanged Command End (lSR1) is set. (lSR1, command. ISR3) FI signal of the The execution of a command Unload the FDD is reset when Request File is interrupted. If it is a head imediatel A "High" level input of FI "High" pulse out- Inoperable STRB5 terminal is reflected. put is provided by All commands Read/Write command, ISRO ((SRO or (HLD="Low") ISR1, reading of STRB is set. If it is a seek command, SetWGT to ISR3) atFI="1". ISR1 is set. "Low" Write operation (WGT="High") The execution of a command Request Unload the Write SSW, SWD, MSW is performed when the input of Reading of STRB is interrupted and R/W ((SRO, head imediatel y Error FFW STRB6 WPT terminal is "High" level. Command End ((SRO) is set. ISR3) (HLD="Low" Set WGTto "Low" - --_.. _._- The execution of a command Unload the RDY input signal becomes Request head imediatel y is interrupted. If it is a Read/ Hard Error STRB7 "Low" level during the execu- Reading of STRB All commands Write command, ISRO is set. (lSRO or (HLD="Low") tion of a command (Busy="1".) If it is a seek command, ISR1 ISR1, Set WGT to ISR3) is set. " Low" Not Ready Unload the during the idling STRA2 - - - - No head imediatel y interrupt (HLD="Low") * These errors except STRB5 and STRA2 are reset by RES inputs. ** Head is unloaded if the new command is not issued during the settling time after ReadlWrite command ends. 142 HDS844P,HDS8A44P DMAC {Direct Memory Access Controller} The HD6844P Direct Memory Access Controller (DMAC) performs the function of transferring data directly between memory and peripheral device controllers. It controls the address and data buses in place of the MPU in bus organized systems such as the HMCS6800 Microprocessor System. The bus interface of the HD6844P includes select, read/ write, interrupt, transfer request/grant, and bus interface logic to allow the data transfer over an 8-bit bidirectional data bus. The functional configuration of the DMAC is programmed via the data bus. The internal structure provides for control and handling of four individual channels, each of which is separately configured. Programmable control registers provide control for the transfer location and length, individual channel control and transfer mode configuration, priority of servicing, data chaining, HD6844P, HD68A44P and interrupt control. Status and control lines provide control to the peripheral controllers. The mode of transfer for each channel can be programmed as cycle-stealing or a burst transfer mode. Typical applications would be with the Floppy Disk Con- troller (FDC), etc .• • FEATURES • Four DMA Channels, Each Having a 16-Bit Address Register and a 16-Bit Byte Count Register • 1 M Byte/Sec (HD6844P), 1.5 M Byte/Sec (HD68A44P) (DP·40) Maximum Data Transfer Rate • Selection of Fixed or Rotating Priority Service Control • Separate Control Bits for Each Channel • PIN ARRANGEMENT • Data Chain Function • Address Increment or Decrement Update • Programmable Interrupts and DMA End to Peripheral DGRNT i5'RciT Controllers DRQH • Compatible with MC6844 • BLOCK DIAGRAM T~Ra, T~RQ, Address/Control and Interrupt D. 0, 0, D. 0, 0, 0, (Top View) Data Bus 143 HD6844P, HD68A44P - - - - - - - - - - - - - - - • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3 - +7.0 V Input Voltage Yin * -0.3 -+7.0 V Operating Temperature Topr -20 -+75 °c Storage Temperature TS1g, -55-+150 °c • With respect to Vss (SYSTEM GND) (NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Power Supply Voltage Vee * 4.75 5 5.25 V Input Voltage V 1L * -0.3 - 0.8 V V 1H * 2.0 - Vee V Operating Temperature Topr -20 25 75 °c • With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vcc=SV±5%, Vss=OV, Ta=-20-+7SoC, unless otherwise noted.) Item Symbol Test Condition min typ* max Unit Input "High" Voltage V 1H 2.0 - Vee V Input "Low" Voltage V 1L -0.3 - 0.8 V TxRQo-3, ~2 OMA, I nput Leakage Current RES,OGRNT lin Vin=Q-S.2SV - - 2.S IJA Three-State (off state) Leakage Current Ao-A lS , 0 0 -0 7 , R/W I TS1 V ln =0.4-2.4V -10 - 10 IJA 0 0 -0 7 IOH=-205IJA 2.4 - - Output "High" Voltage A o-A 15 , R/W V OH IOH=-1451JA 2.4 - - V All Other Outputs IOH=-10{)IJA 2.4 - - Output "Low" Voltage VOL IOL =1.6mA - - 0.4 V Source Current CS/TxAKB less Vin::!(JV, Fig. 10 - 10 16 rnA Power Dissipation Po - 500 1000 mW ~20MA - - 20 0 0 -0 7 , CS, Ao-~, Input Capacitance R/W Cin Vin=OV, Ta=25°C - - 12.5 pF f=1.0MHz TvC"_ _ cce ..... ..." ''''''~U'''''''''3, OGRNT - - 10 Output Capacitance Cout Vin=OV, T.";'25°C, f=1MHz - - 12 pF • V ee =5.0V, T.=25"c 144 HD6844P, HD68A44P - - - - - - - - - - - - - - - • AC CHARACTERISTICS (Load Condition Fig. 9) 1. CLOCK TIMING HD6844P HD68A44P Item Symbol Test Condition Unit min typ max min typ max lP2 DMA Cycle Time 1'.cy c Fig. 2 1,000 - - 666 - - ns lP2DMA Pulse Width I "High" Level "Low" Level PWI/>H PWI/>L Fig. 2 Fig. 2 450 400 - - - - 280 230 - - - - ns ns lP2DMA Rise and Fall Time 1(pr,\pt Fig. 2 - - 25 - - 25 ns 2. DMA TIMING (Load Condition Fig. 9) HD6844P HD68A44P Item Symbol Test Condition Unit min typ max min typ max lP2DMA Rising Edge t TOS1 120 - - 120 - - TxROSetup Time ns lP2DMA Falling Edge t TOS2 210 - - 210 - - Fig. 3 lP2 DMA Rising 20 - - 10 - - Edge t TOH1 TxRO Hold Time ns lP2 DMA Falling Edge tTOH2 20 - - 10 - - DGRNT Setup Time DGRNT tOGS Fig. 4 155 - - 125 - - ns DGRNT Hold Time DGRNT tOGH 10 - - 10 - - Address Output Ao-A 1S , R/W, Delay Time TxSTB tAD Fig. 6 - - 270 - - 180 ns Address Output Ao-A 1S , R/W 30 - - 20 - - tAHO Fig. 6 ns Hold Time TxSTB 35 - - 35 - - Address Three-State Delay Time Ao-A lS , R/W tATSO Fig. 7 - - 270 - - 270 ns Address Three-State Recovery Time Ao-A 1S , R/W t ATSR Fig. 7 - - 270 - - 270 ns Delay Time DROH,DROT tooo Fig. 5 - - 375 - - 250 ns lP2DMA Rising Edge tTK01 Fig. 5 - - 400 - - 310 TxAK Delay Time ns DG RNT Rising Edge tTK02 Fig. 8 - - 190 - - 160 lP2DMA Falling I RO/DEND Delay Edge tOE01 Fig.6 - - 300 - - 250 Time ns DGRNT Rising Edge tO Eo2 Fig. 8 - - 190 - - 160 3. BUS TIMING 1) READ TIMING HD6844P HD68A44P Item Symbol T-est Condition Unit min typ max min typ max Address Setup Time Ao-~,R/W,CS t AS 140 - - 140 - - ns Address Input Hold - - I Time A o-A 4 , R/w,CS tAHI 10 - I 10 - ns Data Delay Time D o-D 7 tOOR Fig. 2 - - 320 - - 220 ns Data Access Time Do -D 7 tACC - - 460 - - 360 ns Data Output Hold Time D o-D 7 tOHR 10 - - 10 - - ns 145 HD6844P, HD68A44P - - - - - - - - - - - - - - - 2) WRITE TIMING H068A44P H06844P Item Symbol Test Condition Unit min typ max min typ max Address Setup Time Ao-~,R/W,~ tAS 140 - - 140 - - ns Address Input Hold Time Ao-A4,R/W,CS tAHI 10 - - 10 - - ns Fig. 2 Data Setup Time 0 0 -0 7 tosw 195 - - 80 - - ns Data Input Hold Time 0 0 -0 7 tOHW 10 - - 10 - - ns csrrxAKB 2 ----t--,r"'+I 00 28 01 27 O2 26 03 25 04 24 Os 23 06 22 07 21 32 TxRClo 31 TxRQ. Transfer Requestl 30 TxR~ Acknow· ledge 29 TxRQ 3 Request, OGRNT 38 Grant, 35 TxAKA Timing 39 Control ~34 Tx5TB q,2 0MA 40 ~ I· 1~·--v-s-s-=-p-in-1------"" ~ Voo=Pin20 Figure 1 Expanded Block Diagram 146 HD6844P, HD68A44P - - - - - - - - - - - - - - - ~-------------------tcyc~------------------~ r------ PW~H --------+t~f r--------PWc/>L ------~ 2.0V 2.0V !/>lOMA Ao-A" (Input) R/W (Input) CS (Input) tOOR tOHR ~------tACC------~ 2.4V DO -0, (Output) (Read Operation) OAV DO -0, (Input) _ (Write Operation) Figure 2 ReadlWrite Sequence !/>2 0MA Figure 3 Timing of TxRQ Input 147 HD6844P, HD68A44P - - - - - - - - - - - - - - - Set Up Timing 1/1 2 DMA ~ __________ J2.0V ---------- --------- 2.0V '0:.-1 DGRNT Hold Timing DGRNT Figure 4 Timing of DGRNT Input toaD 2.4V O.4V 2.4V TxAKA CslTxAKB (Output) O.4V Figure 5 Timing of DROH, DROT, TxAK Outputs 148 HD6844P, HD68A44P - - - - - - - - - - - - - - - 4>2DMA 2.4V A,-A~5 (Output) - R W (uutput) iXSTB O.4V t DED ------------------- x 2.4V O.4V -------------------------- Figure 6 Timing of Address and IRQ/DEND Outputs Recovery Time of Address Three-state 4>2 DMA (or DGRNTI 2.4V O.4V Delay Time of Address Three-state Ao-A,s R/W tAHO Figure 7 Timing of Address Three-state 149 HD6844P, HD68A44P - - - - - - - - - - - - - - - DGRNT CS/TxAKB (Output) 0.4V .OE021 24V - -- /1 . IRQ/DEND --------------------~ Figure 8 Timing of Synchronous OGRNT Output 5.0V 2.4kn Test terminal C R 0 0 -0, 130 pF 11 kil Test terminal o---~- ......-",--~ Ao -A 15 • R/W 90pF 16 kil CS/TxAKB 50 pF 24kil 01 All other outputs 30pF 24 k!2 C 0 1 -0 4 : 1S2074(8) Figure 9 load Circuit r-- ----- --- ------------------, , HD6844P I Vee ,I , ~~ON ~s I I TxAKBoutput ~ '" 1- "0" • OFF • D.C. Ammeter I I Vss ,I TxAK ENABLE , Vss I, CSinput I I ____________ .... _____________ JI L Figure 10 Source Current Measurement Circuit for CS/TxAKB Terminal 150 HD6844P, HD68A44P - - - - - - - - - - - - - - - • DEVICE OPERATION The DGRNT signal must cause the address control and data The DMAC has fifteen addressable registers, eight of them lines to go to the high impedance state. The DMAC now are sixteen bits in length. Each channel has a separate Address supplies the address from the Address Register of the channel Register and a Byte Count Register, each of which is sixteen requesting. It also supplies the R/W signal as determined from bits. There are also four Channel Control Registers. The three the Channel Control Register. After one byte is transferred, General Control Registers common to all four channels are the control is returned to the MPU. This method stretches the cPl Priority Control Register, the Interrupt Control Register, and and cP2 clocks while the DMAC uses the memory. the Data Chain Register. The second method of cycle-stealing is the Halt Steal mode. To prepare a channel for DMA, the Address Registers must This method actually halts the MPU instead of stretching the cPl be loaded with the starting memory address and the Byte Count clock for the transfnIfQnod. This mode is initiated by the Register loaded with the number of bytes to be transferred. The DMAC bringing the line "Low". This line connects to bits in the Channel Control Register establish the direction of the MPU HALT input. The MPU Bus Available (BA) line is the the transfer, the mode, and the address increment or decrement DGRNT input to the DMAC. While the MPU is halted, its after each cycle. Each channel can be set for one of three Address Bus, Data Bus, and RjW are in the high impedance transfer modes: Three-State Control (TSC) Steal, Halt Steal, or state. The DMAC now supplies the address and R/W line. After Halt Burst. Two read-only status bits in the Channel Control one byte is transferred, the HALT line is returned "High" and Register indicate when the channel is busy transferring data and the MPU regains control. In this mode, the MPU stops internal when the DMA transfer is completed. activity and is removed from the system while the DMAC uses The Priority Control Register enables the transfer requests the memory. from the peripheral controllers and establishes either a fIxed The third mode of transfer is the Halt Burst mode. This priority or rotating priority scheme of servicing these requests. mode is similar to the Halt Steal mode, except that the transfer When the DMA transfer for a channel is complete (the Byte does not stop with one byte. The MPU is halted while an entire Count Register is zero), a DMA End signal is directed to the block of data is transferred. When the channel's Byte Count peripheral controller and an IRQ goes to the MPU. Enabling of Register equals zero, the transfer is complete and control is these interrupts is done in the interrupt Control Register. The returned to the MPU. This mode gives the highest data transfer IRQ flag bit is read from this register. rate, at the expense of the MPU being inactive during the Chaining of data transfers is controlled by the Data Chain transfer period. Register. When enabled, the contents of the Address and Byte Count Registers for channel #3 are put into the registers of the • INPUT/OUTPUT FUNCTIONS channel selected for chaining when its Byte Count Register • DMAC Interface Signals for the MPU becomes zero. This allows for repetitively reading or writing a The DMAC interfaces with the HMCS6800 MPU through the block of memory. eight-bit bidirectional data bus, the CS line, fIve address lines, During the DMA mode, the DMAC controls the address bus an IRQ line, the Read/Write line, and the RES line. These sig- and data bus for the system as well as providing the R/W nals, in conjunction with the HMCS6800 VMA output, permit line and a signal to be used as VMA. When a peripheral the MPU to have access to the DMAC. Four other lines as- device controller desires a DMA transfer, it is requested by a sociated with the MPU and the clock driver are the DRQT, Transfer Request. Assuming this request is enabled and meets DRQH, DGRNT, and the cP2 DMA. the test of highest priority, the DMAC will issue a DMA Request. When the DMAC receives the DMA Grant, it gives a Bidirectional Data (Do -0, ) Transfer Acknowledge to the peripheral device controller, at The Bidirectional Data lines (Do .... D,) allow for data transfer which time the data is transferred. When the channel's Byte between the DMAC and the MPU. The data bus output drivers Count Register equals zero, the transfer is complete and a DMA are three-state devices that remain in the high impedance state tma is given to the peripheral device controller, and an IRQ is except when the MPU performs DMAC read operations. given to the MPU. Chip SelectlTransfer Acknowledge B (CSIT x AKB) • Initialization This line is multiplexed, serving both as an input and an During a power-on sequence, the DMAC is reset via the RES output. CS/TxAKB is an output in the four-channel mode input. All registers, with the exception of the Address and Byte during the DMA transfer. At all other times, it is a high Count Registers, are- set to a logic "0" state. This disables all impedance TTL compatible input used to address the DMAC. requests and the Data Chain function while masking all The DMAC is selected when CS/TxAKB is "Low". VMA must interrupts. The Address, Byte Count, and Channel Control be used in generating this input to insure that false selects will Registers must be programmed before the respective transfer not occur. Transfers of data to and from the DMAC are then request bit is enabled in the Priority Control Register. performed under the control of the cP2 DMA, Read/Write, and Ao '"~ address lines. In the four-chan riel mode when TxAKB is • Transfer Modes needed, the CS gate must· have an open-collector output (a There are three ways in which a DMA transfer may be done. pull-up resistor should not be used). In the two-channel mode, The one used is determined by the data transfer rate required, CS/TxAKB is always an input. the number of channels attached, and the hardware complexity allowable. Refer to Figures 11 through 13. Address Lines Ao - A4 (Ao - A4 ) Two of the modes, TSC Steal and Halt Steal, are done by Adaress lines Ao-A 4 are both input and output lines. In the cycle-stealing from the MPU. The Three-State Con~SC) MPU mode, these are high impedance inputs used to address the Steal mode is initiated by the DMAC bringing the DRQT line DMAC registers. In the DMA mode, these lines are outputs "Low". This line goes to the system clock driver which returns a which are set to the contents of the Address Register of the "High" on DGRNT on the rising edge of the system 2DMA ;~rL...r"""1 MPU '~I Last Cycle of Instruction t::.. -I tTQS1 Dead ---.. tTQS1,~:-L--r--~ tTQH~- r- f- r-L DMA ead ,- MPU QH1r/"'~ If\.' , " ~-'lL 1\ ~ DRQH ~t ~QO ~O "- tOGS_ ~ ~ tGOS I- DGRNT (MPU BA) H,.tTKOl -." - I tA'6 ""- - t:::1 JI t- tAD tTK0 1 TxAKA "- HtTK01 TxAKB JI (Output) -j I-tAS ·trAHI- I TTTK 02 CS (Input) X JII. Y "- Y tATS~ !t- - tAHO j Ao-A ,s • R/W (Output) Ao-A •• R/W (Input) MPU X MPl -j JII. ~tAS IMl"l tAHI IMA - tATSO MI" X MPl ~ 110.. READ Do -D 7 (Output) tOOR- 1=: II-- tOH R -- r- roEO;- ItoE01 -- ~ r-tOE01 . - ru-. \ ------------------------ tOE02 DMA END .~** '1-:.--- [NOTE] * I RQ of another channel or its own TRC! (remainins Its own IRQ (put out) or its own rm:I (remaining) or mn of another channel This is the last cy.lce of transfer. Figure 12 HALT Cycle Steal Mode First-byte Second-byte Final-byte Dummy DRQH DGRNT (MPU BA) TxSTB TxAKA TxAKB (Output) CS (Input) Ao-Au • R/W (Output) A o -A 4 • R/W (Input) IRQ/DEND Figure 13 HALT Burst Mode 153 HD6844P, HD68A44P - - - - - - - - - - - - - - - Interrupt RequestlDMA End (lRO/DEND) indicating that the MPU has halted and turned control of its IRQ/DEND is a TTL compatible, active "Low" output that busses over to the DMAC. For a design involving TSC Steal and is used to interrupt the MPU and to signal the peripheral Halt mode transfers, this input must be the OR of the clock controller that the data block transfer has ended. If the driven DMA Grant and the MPU BA. Interrupt has been enabled, the IRQ/DEND line will go "Low" after the last DMA cycle of a transfer. An open collector gate 2 ,.... 4>. IRQ VMA - ~ BA -- H~LT ~ t-- 4>2 MPU tP.MPU tP2 TTL CLOCK GENERATOR LOGIC - ~ (CPGJ ~~ '" :s CD S CI) is 1"0 1 DGRNT - - DRQH "t:l « 0 IRQ Decoder A I R/W Ao-A4 5 ~ y I [' As-A. s 11 1" t-- - CS E HD6843SP (FDC) DO-D? A 8 H A II. 0 0 -0 7 " r-v .. HD6844P (DMAC) TxSTB ---{> I-- TxAK TxRQo ~ ~ TxRQ R/W t-- I-- r--. II ~ RES A CS/TxAKB ~ K.v Vee Floppy Disk VSS Decoder Drive tP2DMA ~ I-- II II I I I I Figure 17 Example of DMA System Structure (1) (minimum) 158 HD6844P, HD68A44P - - - - - - - - - - -_ _ __ VMA DB AB R/W iRO A o-A 15 ~ HD6800 0 0 -0, A ... .. " ~ I I III . DB (MPU) AB HM4681 0 RIW ~ ~ I- " RAM 4>MEM .----.. 4>. ~ VMA ~ MEMORY HN46B30 ~ IRO ~ ROM ~ 1/>2 etc. TSC BA HAL:T READY I t r-- REFRESH REO REF GRNT I....- 4>.MPU I/>MEM I-- r-- L..-- 4>2 MPU MRDY t-- RRO t-- CLOCK G~NERATOR LOGIC RGRNT I-- K> r0o- t-- OGRNT I-- t-~ ~ ~ t--- L:=J ORO t ·I~ i'~ ~ ~ ~~ tit :s en :::Gl l!Io- u IRO/DEND r-- r-- trQ: OMAENO TxAK R/W TxSTB --{>o- H074155 I III~ CS I/O DEVICE , H06843S TxAKA r--"cl....- 0 TxAK ~r "' DB TxRO CONTROLLER (FOC) etc. ----. A b #0-3 -CJ~: RES :D- E #2 Vee CS/TxAKB Vss TxROo- TxR0 3 CS V ~ , I I #3 tP20MA R/W t-- - r---- I-- r-- * Open Collector Figure 18 Example of DMA System Structure (2) (maximum) 159 HDS845S,HDS8A45S, HDS8B45S CRTC (CRT Controller) The CRTC is a LSI controller which is designed to provide an interface for microcomputers to raster scan type CRT displays. The CRTC belongs to the HMCS6800 LSI Family and has full compatibility with MPU in both data lines and control lines. Its primary function is to generate timing signal which is necessary for raster scan type CRT display according to the specification programmed by MPU. The CRTC is also designed as a programmable controller, so applicable to wide·range CRT display from small low.functioning character display up to raster type full graphic display as well as large high·functioning limited graphic display. • FEATURES • Number of Displayed Characters on the Screen, Vertical HD6845SP, HD68A45SP, HD68B46SP Dot Format of One Character, Horizontal and Vertical Sync Signal, Display Timing Signal are Programmable • 3.7 MHz High Speed Display Operation • Line Buffer-less Refreshing • 14-bit Refresh Memory Address Output (16k Words max. Access) • Programmable Interlace/Non-interlace Scan Mode • Built-in Cursor Control Function • Programmable Cursor Height and its Blink • Built-in Light Pen Detection Function • Paging and Scrolling Capability • PIN ARRANGEMENT • TTL Compatible • Single +5V Power Supply Vss g;- VSYNC mg HSYNC • Upward compatible with MC6845 LPSTS RA, MA, RA, MA, RA, • SYSTEM BLOCK DIAGRAM MA, RAJ MA, RA. MA. D, I---~-----r------- ~8u1 MA, D, MA.l HD6845S D, MA, 0, MA. D. MA. D. MAIO 4 D. MAli 1 0, a- G MAlt 1 MA u 17 DIi!lPTMG~ CUDISP~ RS E R/W vccli--..._ _ _ _ _...r- CLK (Top View) • ORDERING INFORMATION D'''T'''' ICUOI" HaVNe VSYNC LPSTB ~:t CRTC Bus Timing CRT Display Timing HD6845SP 1.0 MHz HD68A45SP 1.5 MHz 3.7 MHz max. HD68B45SP 2.0 MHz 160 HD6845S, HD68A45S, HD68845S • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3 - +7.0 V Input Voltage Vin * -0.3 - +7.0 V Operating Temperature Topr - 20- + 75 °c Storage Temperature Tstg - 55- +150 °c • With respect to Vss (SYSTEM GND) [NOTE] Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI • • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V V 1L * -0.3 - 0.8 V Input Voltage V 1H * 2.0. - Vee V Operating Temperature Topr - 20 25 75 °c • With respect to Vss (SYSTEM GND) I ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vee = 5V ± 5%, Vss =OV, Ta = -20-+75°C, unless otherwise noted.) Item Symbol Test Condition min typ max Unit Input "High" Voltage V 1H 2.0 - Vee V Input "Low" Voltage V 1L -0.3 - 0.8 V Input Leakage Current I in Vin = 0 - 5.25V (Except 0 0 -0,) -2.5 - 2.5 p.A Three-State Input Current V in = 0.4 - 2.4V (off-state) ITS1 Vee = 5.25V (0 0 - 0,) - 10 - 10 p.A I LOAD = -205 p.A (0 0 - 0,) Output "High" Voltage V OH I LOAD = -100 p.A (Other Outputs) 2.4 - - V Output "Low" Voltage VOL ILOAD = 1.6 mA - - 0.4 V V in =0 Input Capacitance Do - 0, - - 12.5 pF Cin Ta = 25°C f = 1.0 MHz Other Inputs - - 10.0 pF Output Capacitance Cout Vin =OV, Ta = 25°C, f = 1.0 MHz - - 10.0 pF Power Dissipation Po - 600 1000 mW 161 HD6845S, HD68A45S, HD68B45S • AC CHARACTERISTICS (Vee = 5V ±5%, Vss =OV, Ta = -20-+75°C, unless otherwise noted.) 1. TIMING OF CRTC SIGNAL Item Symbol Test Condition min typ max Unit Clock Cycle Time tCycc 270 - - ns Clock "High" Pulse Width PWCH 130 - - ns Clock "Low" Pulse Width PWCL 130 - - ns Rise and Fall Time for Clock Input tCr, tCf - - 20 ns Memory Address Delay Time t MAO - - 160 ns Raster Address Delay Time tAAO Fig. 1 - - 160 ns DISPTMG Delay Time tOTo - - 250 ns CUDISP Delay Time tcoo - - 250 ns Horizontal Sync Delay Time tHso - - 200 ns Vertical Sync Delay Time tvso - - 250 ns Light Pen ~trobe Pulse Width PW LPH 60 - - ns Light Pen Strobe t LPo1 Fig. 2 - - 70 ns Uncertain Time of Acceptance t LPo2 - - 0 ns 2. MPU READ TIMING Test HD6845SP HD68A45SP HD68B45SP Item Symbol Unit Condition min typ max min typ max min typ max Enable Cycle Time ttycE 1.0 - - 0.666 - - 0.5 - - (J.s Enable "High" Pulse Width PW EH 0.45 - - 0.280 - - 0.22 - - fJ.S Enable "Low" Pulse Width PWEL 0.40 - - 0.280 - - 0.21 - - fJ.S Enable Rise and Fall Time tEr, tEf - - 25 - - 25 - - 25 ns Address Set Up Time t AS Fig. 3 140 - - 140 - - 70 - - ns Data Delay Time too A - - 320 - - 220 - - 180 ns Data Hold Time tH 10 - - 10 - - 10 - - ns Address Hold Time tAH 10 - - 10 - - 10 - - ns Data Access Time tAcc - - 460 - - 360 - - 250 ns 3. MPU WRITE TIMING Test HD6845SP HD68A45SP HD68B45SP Item Symbol Unit Condition min typ max min typ max min typ max Enable Cycle Time tCYc:C 1.0 - - 0.666 - - 0.5 - - (J.s Enable "High" Pulse Width PW EH 0.45 - - 0.280 - - 0.22 - - (J.s Enable "Low" Pulse Width PW EL 0.40 - - 0.280 - - 0.21 - - (J.s Enable Rise and Fall Time tEr, tEf Fig. 4 - - 25 - - 25 - - 25 ns Address Set Up Time tAs 140 - - 140 - - 70 - - ns Data Set Up Time tosw 195 - - 80 - - 60 - - ns Data Hold Time tH 10 - - 10 - - 10 - - ns Address Hold Time tAH 10 - - 10 - - 10 - - ns 162 HD6845S, HD68A45S, HD68B45S 2.0V 2.0V PW CL O.8V PWCH tCr 2.4V MAo-MAt3----------------------~~----J 2.4V RAo-RA. -------------------------+-----' 2.4V DISPTMG ________________________ ~------J tOTO 2.4V CUDISP tCDD teDD 2.4V HSYNC VSYNC tHSD tVSD lPSTB __________ ~~~2-.0-V----------P-W--LP-H---------~~------------------------- This Figure shows the relation in time between ClK signal and each output signals. Output sequence is shown in Figs. 9 - 15. Figure 1 Time Chart of the CRTC 163 HD6845S, HD68A45S, HD68B45S elK _ _--J M M+2 lPSTB -------10-11 \_- lPSTB _________~~-------J"--~--------------~I~----------~L 2.0V ~ When LPSTB rises in this period,) Refresh Memorv Address "M+2" is set into the light pen register. tLPD1, tLPD2: lPSTB's uncertain time of acceptance. Figure 2 LPSTB Input Timing & Refresh Memory Address that is set into the light pen register. ~-----------t~e 2.0V E -----~~--.l1 cs----.. RIW,RS---....I 00-07-________________ ~ Figure 3 Read Sequence 164 HD6845S, HD68A45S, HD68B45S 1-------tc:vcE - - - - - - - . t E tEr tosw CS R/W 2.0V RS (Address Register) O.8V RS (Control Register) Figure 4 Write Sequence • SYSTEM DESCRIPTION Linear address generator generates refresh memory address MAo The CRTC is a LSI which is connected with MPU and CRT -MA I3 to be used for refreshing the screen. By these address display device to control CRT display. The CRTC consists of signals, refresh memory is accessed periodically. As 14 refresh internal register group, horizontal and vertical timing circuits, memory address signals are prepared, 16k words max are linear address generator, cursor control circuit, and light pen accessible. Moreover, the use of start address register enables detection circuit. Horizontal and vertical timing circuit generate paging and scrolling. Light pen detection circuit detects light RAo ....~, DISPTMG, HSYNC, and VSYNC. RAo ....~ are pen position on the screen. When light pen strobe signal is raster address signals and used as input signals for Character received, light pen register memorizes linear address generated Generator. DISPTMG, HSYNC, and VSYNC signals are received by linear address generator in order to memorize where light by video control circuit. This horizontal and vertical timing pen is on the screen. Cursor control circuit controls the position circuit consists of internal counter and comparator circuit. of cursor, its height, and its blink. 165 HD6845S, HD68A45S, HD68B45S Vee vss t t l elK -4--..--.1 Horizontal Displayed Register Horizontal Total Register Horizontal Sync Position Register HSYNC Sync Width Register Maximum Raster Address Register Vertical Displayed Register Vertical Total Register Vertical Total Adjust Register DISPTMG Vertical Sync Position Register Start Address Register Cursor Start Raster Register CUDISP Cursor End Raster Register Cursor Register VSYNC Interlace & Skew Register LPSTB . ~~--------------~~~==========~~~~~~ ____ _.J MA" -MA" Figure 5 Internal Block Diagram of the CRTC 166 HD6845S, HD68A45S, HD68B45S • FUNCTION OF SIGNAL liNE • Interface Signals to CRT Display Device The CRTC provides 13 interface signals to MPU and 25 Character Clock (ClK) interface signals to CRT display. CLK is a standard clock input signal which defmes character timing for the CRTC display operation. This signal is normally • Interface Signals to MPU derived from the external high-speed dot timing logic . Bi-directional Data Bus (0 0 -0,) Bi-directional data bus(Do-D,) are used for data transfer Horizontal Sync (HSYNC) between the CRTC and MPU. The data bus outputs are 3-state HSYNC is an active "High" level signal which provides buffers and remain in the high-impedance state except when horizontal synchronization for display device. MPU performs a CRTC read operation. Vertical Sync (VSYNC) Read/Write (R/W) VSYNC is an active "High" level signal which provides verti- R/W signal controls the direction of data transfer between cal synchronization for display device. the CRTC and MPU. When R/W is at "High" level, data of CRTC is transfered to MPU. When R/W is at "Low" level, data Display Timing (DISPTMG) of MPU is transfered to CRTC. DISPrMG is an active "High" level signal which defines the display period in horizontal and vertical raster scanning. It is Chip Select (CS) necessary to enable video signal only when DISPTMG is at Chip Select signal (CS) is used to address the CRTC. When "High" level. CS is at "Low" level, it enables R/W operation to CRTC internal registers. Normally this signal is derived from decoded address Refresh Memory Address (MA o-MA 13 ) signal of MPU under the condition that VMA signal of MPU is at MAo-MA 13 are refresh memory address signals which are "High" level. used to access to refresh memory in order to refresh the CRT screen periodically. These outputs enables 16k words max. Register Select (RS) refresh memory access. So, for instance, these are applicable up Register Select signal (RS) is used to select the address to 2000 characters/screen and 8-page system. register and 18 control registers of the CRTC. When RS is at "Low" level, the address register is selected and when RS is at Raster Address (RAo-RA4 ) "High" level, control registers are selected. This signal is RAo -RA4 are raster address signals which are used to select normally a derivative of the lowest bit (AO) of MPU address bus. the raster of the character generator or graphic pattern generator etc. En~le(E) Enable signal (E) is used as strobe signal in MPU R/W Cursor ·Display (CUDISP) operation with the CRTC internal registers. This signal is CUDISP is an active "High" level video signal which is used normally a derivative of the HMCS6800 System ~2 clock. to display the cursor on the CRT screen. This output is in- hibited while DISPI'MG is at "Low" level. Normally this output Reset (RES) is mixed with video signal and provided to the CRT display Reset s.P (RES) is an input signal used to reset the CRTC. device. When RES is at "Low" level, it forces the CRTC into the light_Pen Strobe (lPSTB) following status. LPSTB is an active "High" level input signal which accepts 1) All the counters in the CRTC are cleared and the device strobe pulse detected by the light pen and control circuit. When stops the display operation. this signal is activated, the refresh memory .address (MAo '" 2) All the outputs go down to "Low" level. MA 13 ) which are shown in Fig. 2 are stored in the 14-bit light 3) Control registers in the CRTC are not affected and remain pen ,egister. The stored refresh memory address need to be unchanged. corrected in software, taking the delay time of the display This signal is. different from other HMCS6800 family LSls in the device, light pen, and light pen control circuits into account. following functions and has restrictions for usage. 1) RES signal has capability of reset function only when LPSTB is at "Low" level. 2) The CRTC starts the display operation immediately after RES signal goes "High". 167 HD6845S, HD68A45S, HD68B45S • REGISTER DESCRIPTION Table 1 Internal Registers Assignment Register Register Name Program Unit READ WR ITE 1--,----,----,------,..---.,----.---.--- # 0 AR Address Register X 0 0 RO Horizontal Total • Character X 0 0 R1 Horizontal Displayed Character X 0 Horizontal Sync· 0 R2 Character X 0 Position Vertical-Raster, 0 R3 Sync Width Horizontal- X 0 wv3 wv2 wv1 wvO wh3 wh2 wh1 whO Character 0 R4 Vertical Total • Line X 0 0 R5 Vertical Total Adjust Raster X 0 0 R6 Vertical Displayed Line X 0 Vertical Sync • 0 R7 Position Line X 0 0 RS Interlace & Skew X 0 V S Maximum Raster 0 R9 Address Raster X 0 0 R10 Cursor Start Raster Raster X 0 0 R11 Cursor End Raster Raster X 0 0 R12 Start Address(H) 0 0 0 R13 Start Address( L) 0 0 0 R14 CursorlH) 0 0 0 R15 Cursor (L) 0 0 0 R16 Light Pen(H) 0 X 0 R17 Light Pen( L) 0 X [NOTE) 1. The Registers marked *: (Written Value) = (Specified Value) - 1 2. Written Value of R9 is mentioned below. 1) Non-interlace Mode } (Written Value Nr) = (Specified Value) - 1 Interlace Sync Mode 2) Interlace Sync & Video Mode (Written Value Nr) = (Specified Value) - 2 3. eo and C1 specify skew of CUDISP output signal. DO and D1 specify skew of DISPTMG output signal. When Sis "1", V specifies video mode. S specifies the Interlace Sync Mode. 4. S specifies the cursor blink. P specifies the cursor blink period. 5. wvO-wv3 specify the pulse width of Vertical Sync Signal. whO-wh3 specify the pulse width of Horizontal Sync Signal. 6. RO is ordinally programmed to be odd number in interlace mode. 7. 0; Yes, x; No 168 HD6845S, HD68A45S, HD68B45S • Address Register (AR) Table 2 Pulse Width of Vertical Sync Signal This is a S-bit register used to select 18 internal control registers (RQ-R17). Its contents are the address of one of 18 VSW Pulse Width internal control registers. Programming the data from 18 to 31 27 26 25 24 produces no results. Access to RQ-RI7 requires, first of all, to write the address of corresponding control register into this 0 0 0 0 16H register. When RS and 'CS are at "Low" level, this register is 0 0 0 1 1 selected. 0 0 1 0 2 • Horizontal Total Register (RO) 0 0 1 1 3 This is a register used to program total number of horizontal 0 1 0 0 4 characters per line including the retrace period. The data is 8-bit 0 1 0 1 5 and its value should be programmed according to the specifi- 0 1 1 0 6 cation of the CRT. When M is total number of characters, (M-I) shall be programmed to this register. When programming for 0 1 1 1 7 interlace mode, M must be even. 1 0 0 0 8 1 0 0 1 9 • Horizontal Displayed Register (R 1) 1 0 1 0 10 This is a register used to program the number of horizontal displayed characters pet line. Data is 8·bit and any number that 1 0 1 1 11 is smaller than that of horizontal total characters can be 1 1 0 0 12 programmed. 1 1 0 1 13 1 1 1 0 14 • Horizontal Sync Position Register (R2) This is a register used to program horizontal sync position as 1 1 1 1 15 multiples of the character clock period. Data is 8·bit and any H; Raster period number that is lower than the horizontal total number can be programmed. When H is character number of horizontal Sync Position, (H.1) shall be programmed to this register. When pro- grammed value of this register is increased, the display position Table 3 Pulse Width of Horizontal Sync Signal on the CRT screen is shifted to the left. When programmed HSW value is decreased, the position is shifted to the right. Therefore, Pulse Width the optimum horizontal position can be determined by this 23 22 21 2° value. 0 0 0 0 - (Note) • Sync Width Register (R3) This is a register used to program the horizontal sync pulse 0 0 0 1 1 CH width and the vertical sync pulse width. The horizontal sync 0 0 1 0 2 pulse width is programmed in the lower 4-bit as multiples of the 0 0 1 1 3 character clock period. "0" cannot be programmed. The 0 1 0 0 4 vertical sync pulse width is programmed in higher 4·bit as multiples of the raster period. When "0" is programmed in 0 1 0 1 5 higher 4-bit, 16 raster period (16H) is specified. 0 1 1 0 6 0 1 1 1 7 • Vertical Total Register (R4) This is a register used to program total number of lines per 1 0 0 0 8 frame including vertical retrace period. The data is within 7·bit 1 0 0 1 9 and its value should be programmed according to the specifica· 1 0 1 0 10 tion of the CRTC. When N is total number of lines, (N-I) shall 1 0 1 1 11 be programmed to this register. 1 1 0 0 12 • Vertical Total Adjust Register (RS) 1 1 0 1 13 This is a register used to program the optimum number to 1 1 1 0 14 adjust total number of rasters per field. This register enables to 1 1 1 1 15 decide the number of vertical deflection frequency more strictly. CH; Character clock period (Note) HSW = "0" cannot be used. • Vertical Displayed Register (R6) This is a register used to program the number of displayed character rows on the CRT screen. Data is 7-bit and any number that is smaller than that of vertical total characters can be programmed. 169 HD6845S, HD68A45S, HD68B45S • Vertical Sync Position Register (R7) Skew function is used to delay the output timing c This is a register used to program the vertical sync position CUDISP and DISPTMG signals in LSI for the time to acce on the screen as multiples of the horizontal character line peri- refresh memory, character generator or pattern generato od. Data is 7-bit and any number that is equal to or less than and to make the same phase with serial video signal. vertical total characters can be programmed. When V is charac- ter number of vertical sync position, (V-I) shall be programmed • Maximum Raster Address Register (R9) to this register. When programmed value of this register is in- This is a register used to program maximum raster addrel creased, the display position is shifted up. When programmed within 5-bit. This register dermes total number of rasters pc value is decreased, the position is shifted down. Therefore, the character including space. This register is programmed as fo: optimum vertical position may be determined by this value. lQws. Non-interlace Mode, I nterlace Sync Mode • Interlace and Skew Register (Ra) When total number of rasters is RN, (RN-l) shall b This is a register used to program raster scan mode and skew programmed. (delay) of CUDISP signal and DISPTMG signal. I nterlace Sync & Video Mode Interlace Mode Program Bit (V, S) When total number of rasters isRN, (RN-2) shall b Raster scan mode is programmed in the V, S bit. programmed. This manual dermes total number of rasters in non-intedac Table 4 Interlace Mode (2 1 , 2°) mode, interlace sync mode and interlace sync & video mode l follows: v S Raster Scan Mode Non-interlace Mode o o } Non-interlace Mode 0----- Total Number of Rasters 5 1 o 1----- Programmed Value Nr = 4 o Interlace Sync Mode 2----- (The same as displayed I total number of rasters Interlace Sync & Video Mode 4----- Raster Address In the non-interlace mode, the rasters of even number I nterlace Sync Mode field and odd number field are scanned duplicatedly. In the interlace sync mode, the rasters of odd number field are 0 - - - - - - Total Number of Rasters 5 -------------- 0 Programmed Value Nr =4 scanned in the middle of even number field. Then it is 1----- In the interlace sync mode, , controlled to display the same character pattern in two -------------- 1 2 - -- total number of rasters in fields. In the interlace sync and video mode, the raster scan -------------- 2 both the even and odd fields 3----- method is the same as the interlace sync mode, but it is -------------- 3 is ten. On programming, controlled to display different character pattern in two field. 4 ----- ( the half of it is dermed as -------------- 4 Skew Program Bit (C1, CO, 01, DO) Raster Address total number of rasters. ) These are used to program the skew (delay) of CUDISP signal and DISPTMG signal. I nterlace Sync & Video Mode Skew of these two kinds of signals are programmed o Total Number of Rasters 5 separately. =3 2 - - - - - - - - - - - - 1 Programmed Value Nr ------------ 3 (Total number of rasters ) 4 displayed in the even field Raster Address and the odd field. Table 5 DISPTMG Skew Bit (2 7 ,26 ) 01 DO 01 SPTMG Signal • Cursor Start Raster Register (R10) This is a register used to program the cursor start raste 0 0 Non-skew address by lower 5-bit (2° -24) and the cursor display mode b~ 0 1 One-character skew higher 2-bit (25 , 26). 0 Two-character skew Non-output Table 7 Cursor Display Mode (26 , 2 5 ) B P Cursor Display Mode 0 0 Non-blink 0 1 Cursor Non-display Table 6 Cursor Skew Bit (25 • 24) 0 Blink, 16 Field Period C1 CO Non-skew Blink, 32 Field Period 0 0 Non-skew Blink Period 0 1 One-character skew 0 Two-character skew Non-output light . 16 or 32 Field Period dark 170 HD6845S, HD68A45S, HD68B45S • Cursor End Raster Register (R 11) 6) 2 ~Nr ~30 This is register used to program the cursor end raster address. 7) 3 ~ Nht (Except non-interlace mode) 5 ~ Nht (Non-interlace mode only) • Start Address Register (R12, R13) * In the interlace mode, pulse width is changed ±Jfz raster time when These are used to program the first address of refresh vertical sync signal extends over two fields. memory to read out. Paging and scrolling is easily performed using this register. This register can be read but the higher 2-bit (2 6 ,2 7) ofR12 are Notes for Use always "0". The method of directly using the value programmed in the internal register of LSI for controlling the CRT is adopted. • Cursor Register (R14, R15) Consequently, the display may flicker on the screen when the These two read/write registers stores the cursor location. The contents of the registers are changed from bus side asyncronous- higher 2-bit (2 6 , 27) of R 14 are always "0". ly with the display operation. Cursor Register • Light Pen Register (R16, R17) Writin~ into this register at frequent intervals for moving the These read only registers are used to catch the detection cursor should be performed during horizontal and vertical address of the light pen. The higher 2-bit (2 6 , 27) of R16 are retrace period. always "0". Its value needs to be corrected by software because Start Address Register there is time delay from address output of the CRTC to signal Writing into the start address register at frequent intervals for input LPSTB pin of the CRTC in the process that raster is lit scrolling and paging should be performed during horizontal and after address output and light pen detects it. Moreover, delay vertical display period. time shown in Fig. 2 needs to be taken into account. It is desirable to avoid programming other registers during display operation. Restriction on Programming Internal Register 1) o ca -0 ~ Q. ~ u ca 0 ~ 1: 1;; () B of: ca ] a: X ca ~ QI >~ '0 E l& ~ .t:. '0 z () !E ~ z I - - - Vertical Retrace Period Vertical Total Ad/ust (Nad/I Figure 6 CRT screen Format 171 HD684SS, HD68A4SS, HD68B4SS Table 8 Programmed Values into the Registers Register Register Name Value Register Register Name Value RO Horizontal Total Nht R9 Max. Raster Address Nr· Rl Horizontal Displayed Nhd Rla Cursor Start Raster R2 Horizontal Sync Position Nhsp Rll Cursor End Raster R3 Sync Width Nvsw, Nhsw R12 Start Address (H) a R4 Vertical Total Nvt R13 Start Address (L) a R5 Vertical Total Adjust Nadj R14 Cursor (H) R6 Vertical Displayed Nvd R15 Cursor (L) R7 Vertical Sync Position Nvsp R16 Light Pen (H) R8 Interlace & Skew R17 Light Pen (L) [NOTE] Nhd RM Access + CG Access + tMAD Fig. 17 0 0 0 0 2 RM Access + CG Access + tMAD ~ tCH > RM Access + tMAD Fig. 18 0 1 0 1 3 RM Access + tMAD ~ tCH > RM Access Fig. 19 1 0 1 0 tCH :. CHCP Period; tMAD: MA Delay F1 CUDISP CHCP·N - _ - - I F2 DISPTMG CRTC MA Refresh CG RA ClK CHCP·P L-_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ I DOT COUNTER ....--+---1 Figure 18 Display Control Unit (2) F1 ~-C~U~D~I~S-P---------------_iD Q~---------, CHCP·N-_.......... T DISPTMG CRTC MA Refresh P Memory 1==:::>1-1- 5 RA ClK L-----------------~C~H~C~P~~~DOTCOUNTER·....--4-~ Figure 19 Display Control Unit (For high·speed display operation) (3) 180 HD6845S, HD68A45S, HD68B45S CHCP-P MA DISPTMG ---1----\-' CUDISP ----~----~--~+-----------~-----' F2 -Q F1-Q VIDEO \ CRT Display ••••••• Figure 20 Time Chart of Display Control Unit (1) CHCP-P ----, - - ~ MA 0 X 1 X 2 3 X 4 X DISPTMG y--_. ----1 CUDISP I-- one-Character~ Skew r---- ~----'-\ F2-Q '\ " \"" Fl-Q \ V ~ RMOUT 'IIlllll!f. 0 'I1l7llli. - 1 YllllllJI 2 tllll7lJI.. - 3 'Illlllll!!. - 4 X ~ LATCH (1) 0 1 2 3 - - - - "-~- "--r--- ~ , " " " , , - -"-- CGOUT - J_X_ X X 0 X I"""""-~ 1 " " " " " - -r-- 1 X - i:2 ~X-2. X 1"""""- VIDEO CRT Disp lay " ••••••• Figure 21 Time Chart of Display Control Unit (2) HD6845S, HD68A45S, HD68B45S VIDEO \ CRT Display •••• •• Figure 23 Time Chart of Display Unit (3) • HOW TO DECIDE PARAMETERS SET ON THE CRTC • How to Decide Parameters Based on Specification of CRT (Nvt + 1) (Nr + 2) + 2Nadj Rt = 2 ............. (a) Display Unit (Monitor) Number of Horizontal Total Characters Horizontal deflection frequency fh is given by specification Rt =(Nvt + l)(Nr + 2) + 2Nadj +1 ............. (b) of CRT display unit. Number of horizontal total characters is 2 determined by the following equation. (a) is applied when both total numbers of vertical characters (Nvt + 1) and that of rasters in a line (Nr + 2) are odd. fh = I (b) is applied when total number of rasters (Nr + 2) is even, or tc (Nht + 1) when (Nr + 2) is odd and total number of vertical characters where, (Nvt + 1) is even. tc : Cycle Time of CLK (Character Clock) where, Nht : Programmed Value of Horizontal Total Register Rt Number of Total Rasters per frame (RO) (Including retrace period) Number of Vertical Total Characters Nvt Programmed Value of Vertical Total Vertical deflection frequency is given by specification of Register (R4) CRT display unit. Number of vertical Total characters is Nr Programmed Value of Maximum Raster determined by the following equation. Address Register (R9) 1) Non-interlace Mode Nad~ Programmed Value of Vertical Total Adjust = Rt (Nvt + 1) (Nr + 1) + Nadj Register (R5) 2) Interlace Sync Mode Horizontal Sync Pulse Width Rt = (Nvt + 1) (Nr + 1) + Nadj + 0.5 Horizontal sync pulse width is programmed to low order 3) Interlace Sync & Video Mode - 4-bit of horizontal sync width register (R3) in unit of horizontal character time. Programmed value can be selected within from 1 to 15. 182 HD6845S, HD68A45S, HD68B45S Horizontal Sync Position Vertical Sync Position As shown in Fig. 24, horizontal sync position is nonnally As shown in Fig. 25, vertical sync position is nonnally· selected to be in the middle of horizontal blank period. But selected to be in the middle of vertical blank period. But there there are some cases where its optimum sync position is not are some cases where its optimum sync position is not located in located in the middle of horizontal blank period according to the middle of vertical blank period according to specification of specification of CRT. Therefore, horizontal sync position CRT. Therefore, vertical sync position should be detennined by should be detennined by specification of CRT. Horizontal sync specification of CRT. Vertical sync pulse position is pro- pulse position is programmed in unit of horizontal character grammed to vertical sync position register (R 7) in unit of line time. period. I" lH "I • How to Decide Parameters Based on Screen Format Dot Number of Characters (Horizontal) DISPTMG -.J " L- I - Horizontal -+HOrjZO"t81~ Horizontal ~ Dot number of characters (horizontal) is detennined by r--- Video Period BI.n~ Video Period HSVNC.n~---_ _ _ _ -,nl_ _ _ _ _ _- - - character font and character space. An example is shown in Fig. 26. More strictly, dot number of characters (horizontal) N is Figure 24 Time Chart of HSYNC determined by external N-counter. Character space is set by means shown in Fig. 27. Dot Number of Characters (Vertical) Vertical Sync Pulse Width Dot number of characters (vertical) is detennined by Vertical Sync Pulse Width is programmed to high order 4-bit characters font and line space. An example is shown in Fig. 26. of vertical sync pulse width register (R3) in unit of raster Dot number of characters (vertical) is programmed to maximwn period. Programmed value can be selected within from 1 to 16. raster address (register R9) of CRTC. When Nr is programmed f-- Vertical I Video Period ----I""'.~ Vertical __ Blank Vertical Video Period t,___ --I I OISPTMG--.J I I U"'--I-----,&...I_ _ _.......Ii-......_I---4J~ I. 1 Frame .1 VSYNC------------------------~n~-------------------------- Figure 25 Time Chart of VSYNC Don Number of ,HOd,O,'" Ch"'''''Oh aracter L I Character Fo nt S~ace "-. • •• • • • • • • • • • • • • • •• • • • • • • ••••••• • • Dot Number of Vertical Characters • • • • • (Number of Rasters) • • • • • ••••• Dot Number of Horizontal Characters 10 j Line Space Dot Number of Vertical Characters 13 ( 7X9 Character generator is used. Figure 26 Dot Number of Horizontal and Vertical Characters 183 HD6845S, HD68A45S, HD68845S Character Font \ ••••• • • • • • • •••• • • • • • • ••••• "0" ..0 ....0" I I I I Seria I Data Shift Register Figure 27 How to Make Character Space Horizontal Deflection Period (th) = Horizontal Display Period * _I Horizontal Retrace Period I '[' ' Number of Horizontal Displayed Characters tc ~ Horizontal Display Period Horizontal Character Time = - - - - - - - - - - - : - : : - c : - - - - Number of Horizontal Displayed Characters Figure 28 Number of Horizontal Displayed Characters value of R9, dot number of characters (vertical) is (Nr+l). cal retrace period and the relation between number of vertical Number of Horizontal Displayed Characters displayed character and total number of rasters on a screen is Number of horizontal displayed characters is programmed to as mentioned above, CRT which is suitable for desired screen horizontal displayed register (Rl) of the CRTC. Programmed format should be selected. value is based on screen format. Horizontal display period, For optimum screen format, it is necessary to adjust number which is given by specification of horizontal deflection fre- of rasters per line, number of vertical displayed characters, and quencyand horizontal retrace period of CRT display unit, total adjust raster (Nadj) within specification of vertical determines horizontal character time, being divided by number deflection frequency. - of horizontal displayed characters. Moreover, its cycle time and Scan Mode access time which are necessary for CRT display system are The CRTC can program three-scan modes shown in Table 11 determined by horizontal character time. to interlace mode register (R8). An example of character display Number of Vertical Displayed Characters in each scan mode is shown in Fig. 7. N umber of vertical displayed characters is programmed to vertical displayed register (R6). Programmed value is based on screen format. As specification of vertical deflection frequency of CRT determines number of total rasters (Rt) including verti- 184 HD6845S, HD68A45S, HD68B45S Table 11 Program of Scan Mode Cursor Display Method Cursor start raster register and cursor end raster register 21 2° Scan Mode Main Usage (RIO, Rll) enable programming the display modes shown in 0 0 Normal Display of Characters Table 7 and display patterns shown in Fig. 8. Therefore, it is Non-interlace possible to change the method of cursor display dynamically 1 0 & Figures according to the system conditions as well as to realize the Fine Display of Characters cursor display that meets the system requirements. 0 1 Interlace Sync & Figures Start Address Start address resisters (RI2, R13) give an offset to the Display of Many Characters address of refresh memory to read out. This enables paging and Interlace Sync 1 1 & Figures Without Using scrolling easily. & Video High-resolution CRT Cursor Register Cursor registers (RI4, R1S) enable programming the cursor display position on the screen. As for cursor address, it is not X, [NOTE] In the interlace mode, the number of times per Y address but linear address that is programmed. sec. in raster scanning on one spot on the screen is half as many as that in non-interlace mode. • EXAMPLES OF APPLIED CIRCUIT OF THE CRTC Therefore, when persistence of luminescence is Fig. 30 shows an example of application of the CRTC to short, flickering may happen. It is necessary to monochrome character display. Its specification is shown in select optimum scan mode for the system, taking Table 12. Moreover, specification of CRT display unit is shown characteristics of CRT, raster scan speed, and in Table 13 and initializing values for the CRTC are shown in number of displayed characters and figures into Table 14. account. Table 12 Specification of Applied Circuit Item Specification Character Format 5 x 7 Dot Character Space Horizontal: 3 Dot Vertical : 5 Dot One Character Time 1 J,LS Number of Displayed Characters 40 characters x 16 lines = 640 characters Access Method to Refresh Memory Snychronous Method (DISPTMG Read) Refresh Memory 1 kB 2 15 214 :2 13 212 211 2 10 2 9 28 27 26 25 24 23 22 21 2° Refresh Memory 0 0 0 0 0 0 * * * * * * * * * * CRTC Address Map Address 0 0 0 1 0 0 x x x x x x x x x 0 Register CRTC Control 0 0 0 1 0 0 x x x x x x x x x 1 Register x ... don't care, * ... 0 or 1 Synchronization Method HVSYNC Method Table 13 Specification of Character Display Item Specification Scan Mode Non-interlace Horizontal Deflection Frequency 15.625 kHz Vertical Deflection Frequency 60.1 Hz Dot Frequency 8MHz Character Dot (Horizontal x Vertical) 8 x 12 (Character Font 5 x 9) Number of Displayed Characters (Row x Line) 40x 16 HSYNCWidth 4J,Ls VSYNCWidth 3H Cursor Display Raster 9 ....... 10, Blink 16 Field Period Paging, Scrolling· Not used 185 HD6845S, HD68A45S, HD68B45S Table 14 Initializing Values for Character Display Initializing Value Register Name Symbol Hex (Decimal) RO Horizontal Total Nht 3F (63) R1 Horizontal Displayed Nhd 28 (40) R2 Horizontal Sync Position Nhsp 34 (52) R3 Sync Width Nvsw, Nhsw 34 R4 Vertical Total Nvt 14 (20) RS Vertical Total Adjust Nadj 08 ( 8) R6 Vertical Displayed Nvd 10 (16) R7 Vertical Sync Position Nvsp 13 (19) RS Interlace & Skew 00 R9 Maximum Raster Address Nr OB (11 ) R10 Cursor Start Raster B, P, NCSTART 49 R11 Cursor End Raster NCEND OA (10) R12 Start Address (H) 00 ( 0) R13 Start Address (L) 00 ( 0) R14 Cursor (H) 00 ( 0) R15 Cursor (L) 00 ( 0) tc 1 IJS 10123456710123466,1012345671 ~1111111 ! ~ B \ Cursor Figure 29 Non-interlace Display (Example) 186 ~ fiE .fTTL VMA Au A.. Au Au A" :" \.11 i i t i i ~ 1 O~D.D.D 0:0.0.0' r ri;;;1 rJ;;~ ~ - I,-- Vee ~~1 II L=1!, ;:6 I d' iiiC ~ ~!I!!!~ ...... ~ ". HD74LSOO ~E L s • H~.14.LS1~~. RMAft-RMA~ +-+--.--\0, ~• ~: o. 0, 0, 0, o. ::1 E-+---+----------, ru ~i~;1 Uk.1 .. ::E: C r G) CIt CIt $0 ::E: C t: ..... ~ .. o .Vee G) rrl "7 ; L..-----,..,--Jkt-Rttf¥hh. 0) ...... CIt $0 Vee MelJ CI7ITITl CGA,-CGA, ::E: C I ~·"G' .. HD74021 G) s CIt III -mT , I CIt en ~ [[2,.;.. .. i ~ VIDEO~ H07486 I' )D...------- HVSYNC·P R, :510 os; ~~t I~',! aRz ,I' .zJf-----W Figure 30 Example of Applied Circuit of the CRTC (Monochrome Character Display) HD6845S, HD68A45S, HD68B45S Differences between the HD6845R (Motorola MC6845 Compatible) and the HD6845S (Enhanced) No. Functlona' Difference HD8845R HD8845S Interlace Programming Character line address Character line address Sync Methoti num~r of 0 ~_B_C_ - - - - - - - - - - - Programming o ABC } Programming & unit for 1 ______________ unit for vertical number of 2 number of Video Mode characters 1--------------- vertical Display characters 43 _______________ ~~:~~~~ers 2--------------- 5 ________________ 6 _ _ _ _ _ _ _ _ _ _ _ __ 3--------------- 7 _______________ 8 _ _ _ _ _ _ _ _ _ _ _ __ 4--------------- 9 _______________ In HD6845R. number of characters is vertically In HD6845S. number of characters is vertically programmed in units of two lines. as illustrated programmed in unit of one line. as illustrated above. (Number of vertical total characters. above. (Number of vertical total characters. Number of vertical displayed characters. Number of vertical displayed characters. Vertical Sync Position) Vertical Sync Position) Example of above figure ... Example of above figure ... Programmed number into Vertical Displayed Programmed number into Vertical Displayed Register = 5 Register = 10 Number of Both even number and odd number can be raster per Only even number can be specified. specified. character Character Character! line line address --G---~~=~~-:: ~ ~i~~~~~~~~~I~ {r\ Number of raster o 2 4 _! _________ ~- t eeeee :dJdrss 3 ~ =t=========1= 4 eeeee -"2"---------t- ~} 0 ,--------------<} Ch,,,,,., 0 --E)-----------E)-- 5 : =!=========~= : 0 6 5 2 -t-e--e--o-- O--l ~ line address ~ =;=~==~==~=~= ~J 4 -t---------g--3 6 -t---------8"-5 --E)--e--e--G-----7 ::E~~:t: :{ , 3 5 --E)-----------E)-- 2 _! _________ e ~- 4 e --E)-----------E)-- 6 1 : =~=~~=~==== :~ 8---------------9 ------ 9 e e e e --------------- 8 Number of raster = 10 scanline (specified) When number of raster When number of raster However. number which is programmed into per character line per character line register is calculated as follows. is EVEN is ODD. Programmed number (Nr) Number of raster Number of raster = 10 scan line '" 9 scan line = (Number specified) - 1 (specified) (specified) However. number which is programmed into register is calculated as follows. Programmed number (NR) = (Number specified) - 2 Cursor Cursor is displayed in either EVEN field Cursor is displayed in both EVEN field Display or ODD field. and ODD field. 0------ --------------- 1 2 e e e e e -+- EVEN number 0------ --9-9--Ei--9-0-- 1 ~ EVEN number 4 -t-t=g-1-t- 3 6 -t-t=g-1-t- ~ EVEN number 2 --------------- 3 4 eeeee --------------- 7 6 --9-9--Ei--9-0-- 5--+- EVEN number 8------ --------------- 7 O---~-- 8------ --------------- 1 2 ------ 0--------------- ------ 1 4 -t-t~-1-t- 3 ~ ODD number 6 --G--e--e--o---E)-- 5 ~ ODD number 2 --G--&--e--G---E)-- 3 ~ ODD number --------------- 7 4 --G--&--e--G---E)-- 5 ~ ODD number 8------ 6--------------- ------ 7 0------ 8 ------ 2 --9-0--0--9-'9-- 1~ EVEN number --G--e--e--G---E)-- 3 4 -!-~~--S.-!- 5-+ ODD number 6 ------ --------------- 7 8 188 HD8845S, HD68A45S, HD68B45S No. Functional DIHerence HD6845R HD6645S 2 Vertical Sync Fixed at 16 raster scan cycle (16H) Programmable (1 -16 raster scan cycle) Pulse Width ~specified by ~ (VSYNC output) r-Fixed at 16 ~ high order scan cycle 4 bits of R3 VS~ I V~ I R3 I I I I I I I I I R3 IWV31wV21WV11wvOi I I I I ~~ ~ ~ Vertical Sync Horizontal Sync Not used Horizontal Sync Width Width Width 3 SKEW Function Not included SKEW capability is included in DISPTMG. CUDISP signals. Attached byte ~ R8 I C, ICo ID, IDo I I I I I V S R8 I I I I I I Ivisl '-.,-' ' - . , - ' ~ CUDISP DISPTMG Not used Example of DISPTMG output ~ Not skewed _ ~ One character skew _~ Two character skew H 1 character time 2 character time 4 Start Address Register Write Only Read or Write 5 RESET Signal (RES) MAD N M'3 Output { -----Synchronous reset RAo N ~A4 Output MAo - MA" 0",.", } RAo N RA4 Output ___ - Asynchronous reset Other Outputs--------Asynchronous reset Other Outputs Output signals of MAD MA,3. RAo RA 4• N N synchronized with CLK "LOW' level. go to Output signals of MAo ~ MA,3. RAo RA4 and N "LOW" level. after RES has gone to "LOW." others go to "LOW" level immediately after Other outputs go to "LOW" immediately after RES has gone to "LOW" level. RES has gone to "LOW" level. AC Characteristic Differences between HD6845R (Motorola MC6845 Compatible) and HD6845S (Enhanced) HD46505R HD46505S No. Characteristic Difference Symbol Unit min. typo max. min. typo max. 1 Clock Cycle Time tcyce 330 - - 270 - - ns 2 Clock Pulse Width "High" PWCH 150 - - 130 - - ns 3 Clock Pulse Width "Low" PWCL 150 - - 130 - - ns 4 Rise and Fall Time for Clock Input T cR , TeF - - 15 - - 20 ns 5 Horizontal Sync Delay Time THSD - - 250 - - 200 ns 6 Light Pan Strobe Pulse Width PWLPH 80 - - 60 - - ns Light Pan Strobe. TLPDl - - 80 - - 70 ns 7 Uncertain Time of Acceptance T LPD2 - - 10 - - 0 ns 189 HDS84& COMBO (Combination ROM 1/0 Timer) The HD6846 combination chip provides the means, in conjunction with the HD6802, to develop a basic 2-chip microcomputer system. The H06846 consists of 2048 bytes of mask-programmable ROM, an 8-bit bidirectional data port with control lines, and a 16-bit programmable timer-counter. This device is capable of interfacing with the HD6802 (basic H06800, clock and 128 bytes of RAM) as well as the H06800 if desired. No external logic is required to interface with most peripheral devices. • FEATURES • 2048 8-Bit Bytes of Mask-Programmable ROM • 8-Bit Bidirectional Data Port for Parallel Interface plus Two Control Lines • Programmable Interval Timer-Counter Functions • Programmable liD Peripheral Data, Control and Direc- tion Registers • Compatible with the Complete HMCS6800 Microcom- puter Product Family • TTL-Compatible Data and Peripheral Lines • Single 5-Volt Power Supply • Compatible with MC6846 (DP-40) • TYPICAL MICROCOMPUTER Vee Vee Vee $landb'( Vee Vee • PI N AR RANG EMENT A, CTO 1o-L---+--4iiEs A. Coun.rlTimer I/O { CTG r - - -.....--tiRa CTC A.. p. 1-----1VMA REs P, 1-----1E iiiQ H06802 P, 1-----1RIW (CPU) cpI P, CP, ParaUell/O p. 1V_ _oov"I O. - O , Ao P, A, p. A, {C:: A, Control CP, Vee P, 40 pins P, ... Vss P, P, This is. block diegram of e typical cost effactive microcomputer. The MPU is P, the center of the microcomputer system and is shOW'n in I minimum system inter· P, facing with e ROM combination chip. It is not intended that this system be limited to this function but thet it be expandable with other perts in the HMCS6800 Micro- P, computer family. Po (Top View) 190 -------------------------------------HD6846------------------------------------- • ABSOLUTE MAXIMUM RATINGS • RECOMMENDED OPERATING CONDITIONS Item Symbol Value Unit Item Symbol min typ max Unit Supply Voltage Vee * -0.3 ~ +7.0 V Supply Voltage Vee * 4.75 5.0 5.25 V Input Voltage Vin * -0.3~ +7.0 V VIL * -0.3 - 0.8 V Input Voltage Operating Temperature Topr -20 ~ +75 °c VIH * 2.0 - Vee V Storage Temperature Tstg -55 ~ +150 °c Operating Temperature Topr -20 25 75 °c * With respect to Vss (SYSTEM GND) * With respect to VSS (SYSTEM GND) (NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vcc=5.0V±5%, VSS=OV, Ta=-2~+75°C, unless otherwise noted.) Item Symbol Test Condition min. typo max. Unit Input "High" Voltage All Inputs V IH 2.0 - Vee V Input "Low" Voltage All Inputs VIL -0.3 - 0.8 V Input "High" Level Vee - Vee -0.5 +0.5 Clock Overshoot/Undershoot Vos V Input "Low" Level Vee - Vee -0.5 +0.5 R/W, RES, CSo , Input Leakage Current CSt, CPt, CTG, lin Vin = 0 ~ 5.25V - - 2.5 pA CTC, E, Ao~A10 Three-State (Off State) Do~D7' PO~P7' ITSI Vin = 0.4 ~ 2.4V - - 10 pA I nput Current CP 2 Do~D7 IOH = -205pA 2.4 - - V Output "High" Voltage CP 2 , PO~P7 VOH IOH = -200pA ' 2.4 - - V CTO IOH = -200pA 2.4 - - V Do~D7 loi.. = 1.6mA - - 004 V Output "Low" Voltage VOL Other Outputs IOL = 3.2mA - - 0.4 V Output "High" Current Do~D7 IOH VOH = 204V 205 - - pA (Sourcing) CTO, CP 2 , PO~P7 VOH = 204V 200 - - pA Output "High" Current (Sourcing) CP 2 , PO~P7 IOH VOH = 1.5V -1.0 - -10 mA (the current for driving other than TTL, e.g., Darlington Base) Output "Low" Current Do~D7 1.6 - - IOL VOL = O.4y mA (Sinking) Other Outputs 3.2 - - Output Leakage Current - (Off State) IRQ ILOH VOH = 2.4V - - 10 pA Power Dissipation Po - - 800 mW E Cin - - 20 pF Do~D7 Cin Vee = OV - - 12.5 pF PO~P7' CP 2 , CTO Gout Vin = OV - - 10 pF Capacitance Ao~A10, R/W Cin Ta = 25°C - - 7.5 pF RES, CSo , CSt, Cin f = 1 MHz - - 10 pF CPt, Ef'G IRQ Cout - - 7.5 pF 191 -----------------------------------HD6846----------------------------------- • AC CHARACTERISTICS (Vcc=5.0V±5%, VSS=OV, Ta=-20'"'-'+75°C, unless otherwise noted.) 1. BUS TIMING Item Symbol Test Condition min typ max Unit Enable Cycle Time teyeE 1.0 - 10 #J.S Enable Pulse Width, "Low" PWEL 430 - 4500 ns Enable Pulse Width, "High" PWEH 430 - 4500 ns Address Set Up Time tAS 140 - - ns Data Delay Time tOOR - - 320 ns Data Hold Time tH Fig. 1 10 - - ns Address Hold Time tAH 10 - - ns Enable Rise and Fall Time tEf,tEr - - 25 ns Data Set Up Time tosw 195 - - ns Reset "Low" Time tRL 2 - - p.s Interrupt Release Time tlR Fig. 2 - - 1.6 p.s 2. PALLAREL PERIPHERAL I/O LINE TIMING Item Symbol Test Condition min typ max Unit Peripheral Data Setup Time tposu Fig.3 200 - - ns Rise and Fall Times CPt. CP 2 tpr, tpf Fig. 5 - - 1.0 #J.S Delay Time E to CP 2 Fall tCP2 - - 1.0 p.s Delay Time I/O Data CP 2 Fall toc Fig.4 20 - - ns Delay Time E to CP 2 Rise tRS1 - - 1.0 p.s Delay Time CPt to CP 2 Rise tRS2 Fig.5 - - 2.0 p.s Peripheral Data Delay tpow Fig.4 - - 1.0 p.s Peripheral Data Setup Time for Latch tpsu Fig.9 100 - - ns Peripheral Data Hold Time for Latch tpDH 15 - - ns 3. TIMER/COUNTER LINE TIMING Item Symbol Test Condition min typ max Unit CTC, CTG Rise and Fall Time tCr. tCf - - 100 ns CTC, CTG Pulse Width, "High" (Asynchronous Mode) ~~58 tpWH - - ns Fig. 6 CTC, CTG Pulse Width, "Low" (Asychronous Mode) tpWL ~~~ - - ns CTC, CTG Setup Time (Synchronous Mode) tsu Fig. 7 200 - - ns CTC, CTG Hold Time (Synchronous Mode) thd 50 - - ns CTO Delay Time tCTO Fig. 8 - - 1.0 #J.S 192 -------------------------------HD6846-------------------------------- E E R/W Ao~Alo CS o , CS 1 CP 2 (Output) Figure 5 CP 2 (Output) Delay Time Do~D7 (Read) COM BO..... MPU ------- Do ~D7 (Write) MPU-->COMBO ------ Figure 1 Bus ReadlWrite Timing Figure 6 CTG, CTC Pulse Width E \'--- E IRQ t'R---F~' 2.4V --------------~ Figure 2 I RQ Release Time Figure 7 CTG, CTC Setup Time and Hold Time ~.OV E _tiov \~ ~~:~p:~su--~--,--------------- 'I--tCTO~~ p.-p, ------- E !2.0V ~ 2.4V CTO_________ ~O~.4~V~_____ Figure 3 Peripheral Data Set Up Time Figure B CTO Delay Time E PO~P7 (Output) _ _ _ _--' 1\--1-___ tpSUJ..-----~tpDH 2.0V CP 2 (Output) O.8V Figure 4 Peripheral Data and CP 2 (Output) Delay Time Figure 9 Peripheral Port Latch Setup and Hold Time 193 ------------------------------------HD6846------------------------------------ The timer/counter control register allows control of th interrupt enable, output enable, selection of an internal 0 external clock source, a -:- 8 prescaler, and operating mode LOAD A 10,-0" CTO, LOA~B S.OV ITImI Input pin CTC (counter-timer clock) will accept an asytl CP" P,-P,I I.Skll chronous clock pulse to decrement the internal register for th, Test POint Test Point counter-timer. If the divide-by-8 prescaler is used, the maximun clock rate can be four times the master clock f~ency with aJ absolute maximum of 4 MHz. Gate input (CTG) accepts aJ asynchronous TIL-compatible Signal which may be used as l~' trigger or gating function to the counter-timer. A counter-time output (CTO) is also available and is under software contra being dependent on the timer control register, the gate input and the clock source. C - 13()pF for 0,-0, • Parallel I/O Port 3()pF forCTO,CP"P,-P, The parallel bidirectional I/O port has functional operationa R-ll kfl forD,-D, 12kll forCTO,CP"Po-P, characteristics similar to the B port on the HD6821 PIA. Thi: includes 8 bidirectional data lines and two handshake contra RL - 2.4 kll for 0 0 -0, 1.2 kll for CTO, CP" P,-P, signals. The control and operation of these lines are completel; All diode. ara IS2074@ . software programmable. The interrupt input (CP I) will set the interrupt flag CSRI 0 Figure 10 BusTiming Test Loads the composite status register. The peripheral control (CP 2 ) rna; be programmed to act as an interrupt input (set CSR2) or as : peripheral control output. p. P, P, P, • GENERAL DESCRIPTION Do p. The HD6846 combination chip may be partitioned into 0, 0, P, p. three functional operating sections: programmed storage, timer- 0, D. P, counter functions, and a parallel I/O port. 0, 0, CP, 0, • Programmed Storage CP, The mask-programmable ROM section is similar to other es o es, Vee ROM products of the HMCS6800 family. The ROM is organized Ao Vss A, in a 2048 by 8-bit array to provide read only storage for a A, A, minimum microcomputer system. Two mask-programmable A. chip selects are available for user deflnition. A, A, Address inputs Ao '" A IO allow any of the 2048 bytes of A, A, ROM to be uniquely addressed. Bidirection~ data lines (Do '" A, D,) allow the transfer of data between the MPU and the HD A" 6846. • Timer-Counter Functions Under software control this 16-bit binary counter may be Figure 11 Combination ROM I/O Timer (COMBO) programmed to count events, measure frequencies, time inter- Basic Block Diagram vals, or similar tasks. Internal registers associated with the I/O functions may be selected with Ao, A I and A 2 • It may also be used for square wave generation, single pulses of controlled duration, and gated signals. Interrupts may be generated from a number of conditions selectable by software programming. 194 -----------------------------------HD6846----------------------------------- CP, CP, fRO Buffer & Status Register Po P, Peripheral P, Data P, Register P, P, P, ....--P, Figure 12 Parallel I/O Port Block Diagram Figure 13 Timer/Counter Block Diagram • SIGNAL DESCRIPTION • Reset (RES) The active "Low" state of the RES input is used to initialize • Bus Interface all register bits in the I/O section of the device to their proper The HD6846 interfaces to the HMCS6800 Bus via an eight values. (See the section on Initialization for Reset conditions for bit bidirectional data bus, two Chip Select lines, a Read/Write timer and peripheral registers.) line, and eleven address lines. These signals, in conjunction with the HMCS6800 VMA output, permit the MPU to control the • Enable (E) HD6846. This. signal synchronizes data transfer between the MPU and the HD6846. It also performs an equivalent synchronization • Bidirectional Data Bus (Do ~D7 ) function on the external clock, reset, and gate inputs of the The bidirectional data lines (Do ~ D 7 ) allow the transfer of HD6846 Timer section. data between the MPU and the HD6846: The data bus output drivers are three-state devices which remain in the high- • Read/Write (R/W) impe¢mce (Off) state except when the MPU performs an This signal is generated by the MPU and is used to control HD6846 register or ROM read (R/W = 1 and I/O Registers or the direction of data transfer on the bidirectional data pins. A ROM selected). "Low" level on the R/W input enables the HD6846 input buffers and data is transferred to the circuit during the E pulse • Chip Select (CS o , CSt) when the part has been selected. A "High" level on the R/W The CS o and CS 1 inputs are used to select the ROM or I/O input enables the output buffers and data is transferred to the timer of the HD6846. They are mask programmed to be active MPU during E when the part is selected. "High" or active "Low" as chosen by the user. • Interrupt Request (I RQ) • Address Inputs (Ao ~ A 1 0 ) The active "Low" IRQ output acts to interrupt the MPU The Address Inputs allow any of the 2048 bytes of ROM to through logic included on the HD6846. This output utilizes an be uniquely selected when the circuit is operating in the ROM open drain configuration and permits other interrupt request mode. In the I/O-Timer mode, address inputs Ao , AI, and A2 outputs from other circuits to be connected in a wire-OR select the proper I/O Register, while A3 through A I 0 (together configuration. with CS o and CSd can be used as additional qualifiers in the I/O Select circuitry. (See the section on I/O-Timer Select for • Peripheral Data (PO~P7) additional details.) The peripheral data lines can be individually programmed as either inputs or outputs via the Data Direction Register. When programmed as outputs, these lines will drive two standard TTL 195 -----------------------------------HD6846----------------------------------- loads (3.2 rnA). They are also capable of sourcing up to 1.0 rnA CTC inputs in this document relate to internal recognition 01 at 1.5 Volts (Logic" 1" output.) . the input tranSition. Note that a clock transition which does n01 When programmed as inputs, the output drivers associated meet setup and hold time specifications may require all with these lines enter a three-state (high impedance) mode. additional Enable pulse for recognition. Since there is no internal pull-up for these lines, they represent When observing recurring events, a lack of synchronization a maximum 1OIlA load to the circuitry driving them - will result in either "System jitter" or "Input jitter" being regardless of logic state. observed on the output of the HD6846 when using an A logic zero at the RES input forces the peripheral data lines asynchronous clock and gate input signal. "System jitter" is the to the input configuration by clearing the Data Direction result of the input signals being out of synchronization with Register. This allows the system designer to preclude the Enable, permitting signals with marginal set-up and hold time to possibility of having a peripheral data output connected to an be recognized by either the bit time nearest the input transition external driver output during power-up sequence. or subsequent bit time. "Input jitter" can be as great at the time between the negative going transitions of the input signal plus • Interrupt Input (CP l ) the system jitter if the first transition is recognized during one Peripheral input line CP 1 is an input-only that sets the system cycle, and not recognized the next cycle or vice-versa. Interrupt Flags of the Composite Status register. The active transition for this signal is programmed by the peripheral • Gate Inputs (CTG) control register for the parallel port. CP 1 may also act as a The input pin CTG accepts an asynchronous TTL-compatible strobe for the peripheral data register when it is used as an input signal which is used as a trigger or a clock gating function to the latch. Details for programming CP I are in the section on the Timer. The gating input is clocked into the HD6846 by the parallel peripheral port. Enable signal in the same manner as the previously discussed clock inputs. That is, a CTG transition is recognized on the • Peripheral Control (CP 2 ) fourth Enable pulse (provided setup and hold time requirement! Peripheral Control line CP 2 may be programmed to act as an are met), and the "High" or "Low" levels of the CTG inpu1 Interrupt input or Peripheral Control output. As an input, this must be stable for at least one system cloc~riod plus the sum line has high impedance and is compatible with standard TTL of setup and hold times. All references to CTG tra~sition in thi! voltage levels. As an output, it is also TTL compatible and may document relate to internal recognition of the input transition. be used as a source of 1 rnA at 1.5 V to directly drive the base The CTG input of the timer directly affects the internal of a Darlington transistor switch. This line is programmed by 16-bit counter. The operation of CTG is therefore independen1 the Peripheral Control Register. of the + 8 prescaler selection. • Counter Timer Output (CTO) • FUNCTIONAL SELECT CIRCUITRY The Counter Timer Output is software programmable by selected bits in the timer/counter control register. The mode of • I/O-Timer Select Circuitry operation is dependent on the Timer control register, the gate CS o and CS 1 are user programmable. Any of the four binar} input, and the clock source. The output is TTL compatible. combinations of CSo and CSl can be used to select the ROM, Likewise, any other combination can be used to select thE • External Clock Input (CTC) I/O-Timer. In addition, several address lines are used ru Input pin eTC will accept asynchronous TTL voltage level qualifiers for the I/O-Timer. Specifically, A3 = A4 '= As = signals to be used as a clock to decrement the Timer. The "High" logical "0". A6 can be programmed to a "1", "0", or don't care, and "Low" levels of the external clock must be stable for at A, = As = A9 = AlO = don't care or one line only may be least one system clock period plus the sum of the setup and programmed to a logical "1". Figure 14 outlines in diagram hold times for the inputs. The asynchronous clock rate can vary matic form the available chip select options. from dc to the limit imposed by System E, setup, and hold times. • Internal Addressing The external clock input is clocked in by Enable pulses. Seven I/O Register locations within the HD6846 are Three Enable periods are used to synchronize and process the accessible to the MPU data bus. Selection of these registers i! external clock. The fourth Enable pulse decrements the internal controlled by Ao , AI, and A2 (as shown in Table 1) provided counter. This does not affect the input frequency; it merely the I/O timer is selected. The combination status register i! creates a delay between a clock input transition and internal Read-only; all other Registers are Read and Write. recognition of that transition by the HD6846. All references to Input Output E ~ ,...---------1:1-- ~i~y~~ ill Input ......- - - ' J~ 1-----1 Jitter Recog. Input .----\ I --.J ____ J either I or Here here 196 -------------------------------------HD6846------------------------------------- ~--.. I/O·TIMER SELECT A 10 A9 0----0 As 0----0 A, Q---{) Figure 14 I/O-Timer Select Circuitry Table 1 Internal Register Addresses combination of the chip select inputs. REGISTER SELECTED Az At Ao ROM Select Combination Status Register 0 0 0 The active levels of CS o and CSt for ROM and I/O select are Peripheral Control Register 0 0 1 a user programmable option. Either CS o or CSl may be pro- Data Direction Register 0 1 0 grammed active "High" or active "Low", but different codes Peripheral Data Register 0 1 1 must be used for ROM or I/O select. CSo and CSl are mask Combination Status Register 1 0 0 programmed simultaneously with the ROM pattern. The ROM Timer Control Register 1 0 1 Select Circuitry is shown in Figure 15. Timer MSB Register 1 1 0 Timer LSB Register 1 1 1 ROM Address x x x Initialization When the RES input has accepted. a "Low" signal, all registers are initialized to the reset state. The data direction and peripheral data registers are cleared. The Peripheral Control Register is cleared except for bit 7 (the RES bit). This forces the parallel port to the input mode with Interrupts disabled. To Figure 15 ROM Select Circuitry remove the RES condition from the parallel port, a "0" must be written into the Peripheral Control Register bit 7 (PCR7). The counter latches are preset to their maximal count, the • TIMER OPERATION Timer control register bits are reset to zero except for Bit 0 The Timer may be programmed to operate in modes which (TCRO is set), the counter output is cleared, and the counter fit a wide variety of applications. The device is fully bus clock disabled. This state forces the timer counter to remain in compatible with the HMCS6800 system, and is accessed by an inactive state. The combination status register is cleared of all Load and Store operations from the MPU. interrupt flags. During timer initialization, the reset bit (CCRO) In a typical application, the timer will be loaded by storing must be cleared. two bytes of data into the counter latch. This data is then transferred into the counter during a Counter Initialization ROM cycle. The counter decrements on each subsequent clock cycle The Mask Programmable ROM section is similar in operation (which may be Enable or an external clock) until one of several to other ROM products of the HMCS6800 Microprocessor predetermined conditions causes it to halt or recycle. Thus the family. The ROM is organized as 2048 words of 8-bits to timer is programmable, cyclic in nature, controllable by external provide read-only storage for a minimum microcomputer inputs or MPU program, and accessible to the MPU at any time. system. The ROM is active when selected by the unique 197 -----------------------------------HD6846----------------------------------- • Counter Latch Initialization the index register or stack pointer may be transferred direct] The Timer consists of a 16-bit addressable counter and two into a selected counter latch with a single instruction. 8-bit addressable latches. The function of the latches is to store A logic zero at the RES input also initializes the countc a binary equivalent of the desired count value minus one. latches. All latches will assume maximum count (65,535 Counter initialization results in the transfer of the latch values. It is important to note that an internal reset (Bit zero ( contents of the counter. It should be noted that data transfer to the Timer/Control Register Set) has no effect on the countc the counters is always accomplished via the latches. Thus, the latches. counter latches may be accurately described as a 16-bit "counter initialization data" storage register. • Counter Initialization In some modes of operation, the initialization of the latches Counter Initialization is defined as the transfer of data frol will cause simultaneous counter initialization (i.e. immediate the latches to the counter with attendant clearing of th transfer of the new latch data into the counters). It is, therefore, Individual Interrupt Flag associated with the counter. Count~ necessary to insure that all-16-bit of the latches are updated Initialization always occurs when a reset condition (exterm simultaneously. Since the HD6846 data bus is 8-bit wide, a RES = "0" or TCRO = "1") is recognized. It can also occ\: temporary register (MSB Buffer Register) is provided for in the (dependent on The Timer Mode) with a Write Timer Latch~ Most Significant Byte of the desired latch data. This is a command or recognition of a negative transition of the CT4 "write-only" register selected via address lines Ao, A I , and A2 . input. Data is transferred directly from the data bus to the MSB Buffer Counter recycling or reinitialization occurs when a cloc when the chip is selected, R/W is "Low", and the timer MSB input is recognized after the counter has reached an all-zer register is selected (Ao = "0", Al =A2 = "1 "). state. In this case, data is transferred from the Latches to th The lower 8-bit of the counter latch can also be referred to as Counter, but the Interrupt Flag is unaffected. a "write-only" register. Data Bus information will be transferred directly to the LSB of a counter latch when the chip is selected, • Timer Control Register R/W is "Low" and the Timer LSB Register is selected (Ao =Al The Timer Control register (see Table 2) in the HD6846 il = A2 = "1 "). Data from the MSB Buffet will automatically be used to modify timer operation to suit a variety of application: transferred into the Most Significant Byte of the counter latches The Timer Control Register has a unique address space (Ao' simultaneously with the transfer of the Data Bus information to "1, Al = "0", A2 = "J ") and therefore may be written into a the Least Significant Byte of the Counter Latch. For brevity, any time. The least sigruficant bit of the Control Register is use the conditions for this operation will be referred to henceforth as an Internal Reset bit. When this bit is a logic zero, all timel as a "Write Timer Latches Command." are allowed to operate in the modes prescribed by the rernainin The HD6846 has been designed to allow transfer of two bits of the timer control register. bytes of data into the counter latches from any source, provided Writing" 1" into Timer Control Register Bit 0 (TCRO) cause the MSB is transferred first. In many applications, the source of the counter to be preset with the conents of the counter latchel data will be an HMCS6800 MPU. It should therefore be noted all counter clocks are disabled, and the timer output an that the 16-bit store operations of the HMCS6800 family interrupt flag (Status Register) are reset. The Counter Latch an microprocessors (STS and STX) transfer data in the order Timer/Control Register are undisturbed by an Internal Rese required by the HD6846. A Store Index Register instruction, and may be written into regardless of the state of TCRO. for example, results in the MSB of the index register being Timer Control Register Bit 1 (TCRl) is used to select th transferred to the selected address, then the LSB of the index clock source. When TCRI = "0", the external clock input CT4 register being written into the next higher location. Thus, either is selected, and when TCRI ="1 ", the timer uses Enable. Table 2 Format for Timer/Counter Control Register CONTROL REGISTER BIT STATE BIT DEFINITION STATE DEFINITION TCRO 0 Internal Reset Timer Enabled 1 Timer in Preset State TCRl 0 Clock Source Timer uses External Clock (CTC) 1 Timer uses ¢J2 System Clock TCR2 0 +8 Prescaler Clock is not Prescaled Enabler Clock is prescaled by +8 Counter 1 TCR3 x Operating Mode TCR4 x See Table 3 Selection TCR5 x TCR6 0 Timer Interrupt I RQ Masked from Timer 1 Enable I RQ Enabled from Timer TCR7 0 Timer Output Enable Counter Output (CTO) Set "LOW" 1 Counter Output Enabled 198 ------------------------------------- HD6846------------------------------------- Table 3 Counter/Timer Operation Modes Counter Interrupt Flag Counter Enable Counter Clock Mode TCR3 TCR4 TCR5 Initialization "CE" "CC" Set Clear "CI" Continuous 0 0 0 G.j.. +W+R (G=Low)' R CE' C TO RS-RT orCI Mode 0 1 0 G t +R (G=Low) • R CE' C TO RS-RT or CI Cascaded Single Shot Mode 0 0 1 G.j.. +W+R R CE'C TO RS-RT or CI Normal Single Shot Mode 0 1 1 G.j.. +R R CE' C TO RS-RT or CI 1 0 0 CE+TOF·CE)·G.j...j CE set=G .j..·W· R·T G.j.. before RS-RTorCI CE' C Frequency Com· +R CE reset=W+R+1 TO orW parison Mode 1 0 1 G.j..·T+R CE set=G.j..·W·'R·T G.j.. before RS-RT orCI CE' C CE reset=W+R+1 TO orW 1 1 0 G.j..·T+R CE set=G.j..·W· R' T·G Gt before RS-RT or CI Pulse Width CE' C CE reset=W+R+I+(G=High) TO orW Comparison Mode 1 1 1 G .j..·I+R CE set=G.j.. 'W' R·T·G Gt before RS-RT or CI CE' C CE reset=W+R+I+(G=High) TO orW R = External RES or Internal Reset TCRO TO = Counter Time Out W = Write Timer Latch I = I~rupt Flag ~=CTG C = Clock selected in the internal register G .j, = Negative transition of CTG signal G t = Positive transistion of CTG signal RS-RT = Read Operation of Timer Counter after the read of Status Register (Normal operation to clear the interrupt) CI = Counter Initialization (I nternal Signal) TOF = Time Out Flag (Set by a'TO, Reset by CIl Timer Control Register Bit 2 (TCR2) enables the -:- 8 Table 4 Continuous Operating Modes prescaler (TCR2 = "1 "). In this mode, the clock frequency is divided by eight before being applied to the counter. When CONTINUOUS MODE TCR2 ="0" Enable is applied directly to the counter. (TCR3=O, TCR7=1, TCR5=O) TCR3, 4, 5 select the Timer Operating Mode, and are ~~~~'i~~ INITIALIZATION/OUTPUT WAVEFORMS discussed in the next section. Timer Control Register Bit 6 (TCR6) is used to mask or TCR4 Counter CTO enable the Timer Interrupt Request. When TCR6 = ''0'', the Interrupt Flag is masked from the timer. When TCR6 = "1", the 0 Initialization ~.j, +W+R Ie-'N+' J m-'I~'N+ll m~ I~IN+' J 'T1 Interrupt Flag is enabled into Bit 7 of the Composite Status 1 G.j..+R II I r I VOL ~H Register (Composite IRQ Bit), which appears on the IRQ to TO* TO* TO* output pin. ~ .j, = Negative Transition CTG Input. Timer Control Register Bit Seven (TCR7) has a special W = Write Timer Latches Command. function when the timer is in the Cascaded Sinl!1e Shot mode. R = Timer Reset (TCRO=1 or External REs=O) N = 16 Bit Number in Counter Latch. (This function is explained in detail in the section describing the T = Period of Clock Input to Counter. mode.) In all other modes, TCR7 merely acts as an output to = Counter Initialization Cycle. enable bit. If TCR7 = "0", the Counter Timer Output (' :TO) is TO = Counter Time Out (All Zero Condition,) forced "Low". Writing a logic one into TCR7 enables C1 O. * Point at which an interrupt may occur. • Timer Operating Modes The HD6846 has been designed to operate effectively in a wide variety of applications. This is accomplished by using three Either a Timer Reset (TCRO = "I" or External RES = "0") bits of the control register (TCR3, TCR4, and TCRS) to define condition or internal recognition of a negative transition of the different operating modes of the Timer, outlined in Table 3. CTG input results in Counter Initialization. A Write Timer Latches command can be selected as a Counter Initialization • Continuous Operating Mode (TCR3 = 0, TCR5 = 0) Signal by clearing TCR4. The timer may be programmed to operate in a continuous The discussion of the Continuous Mode has assumed the counting mode by writing zeros into bits 3 and 5 of the timer application requires an output signal. It should be noted the control register. Assuming that the timer output is enabled Timer operates in the same manner with the output disabled (TCR7 = "1 "), a square wave will be generated at the Timer (TCR7 = "0"). A Read Timer Counter command is valid Output CTO (See Table 4). regardless of the state of TCR7. 199 ------------------------------------HD6846------------------------------------ • Normal Single-8hot Timer Mode (TCR3 = 0, TCR4 = 1, • Cascaded Single-shot Mode (TCR3=0, TCR4=0, TCRS=l) TCR5 =1) This mode is identical to the single-shot mode with two 1bis mode is identical to the Continuous Mode with two exceptions. First, the output waveform does not return to a exceptions. The first of these is obvious from the name - the "Low" level and remain "Low" after timeout. Instead, the out- output returns to a "Low" level after the initial Time Out and put level remains at its initialized level until it is re-programmed remains "Low" until another Counter Initialization cycle occurs. and changed by timeout. The output level may be changed at The output waveform (CTO) is shown in Figure 16. any timeout or may have any number of timeouts between As indicated in Figure 16, the internal counting mechanism changes. remains cyclical in the Single-Shot Mode. Each Time Out of the The second difference is the method used to change the counter results in the setting of an Individual Interrupt Flag and output level. Timer Control Register Bit 7 (TCR7) has a special re-initialization of the counter. function in this mode. The timer output (CTO) is equal to The second major difference between the Single-Shot and TCR7 clocked by timeout. At every timeout, the content of Continuous modes is that the internal counter enable is not TCR7 is clocked to and held at the CTO output. Thus, output dependent on the CTG input level remaining in the "Low" state pulses of length greater than one timer cycle can be generated for the Single-Shot mode. Aside from these differences, the two by cascading timer cycles and counting timeouts with a software modes are identical. program (See Figure 16). An interrupt is generated at each timeout. To cascade timer to cycles, the MPU would need an interrupt routine to: 1) count each timeout and determine when to change TCR7: 2) write into TCR7 the state corresponding to the next desired state of CTO the output waveform (only necessary during the last timer cycle (N +') before the output is to change state): and 3) clear the interrupt flag by reading the combination status register followed by (A) NORMAL SINGLE-SHOT MODE OUTPUT WAVEFORM Read Timer MSB. It is also possible, if desired, to change the length of the timer cycle by reinitializing the timer latches. This allows more flexibility for obtaining desired times. TCR7 = Output • Time Interval Modes (TCR3 = 1) After Timeout The Time Interval Modes are provided for applications eTO requiring more flexibility of interrupt generation and Counter Initialization. The Interrupt Flag is set in these modes as a function of both Counter Time Out and transitions of the CTG input. Counter Initialization is also affected by Interrupt Flag (B) CASCADED SINGLE-SHOT MODE OUTPUT WAVEFORM status. The output signal is not defined in any of these modes. Other features of the Time Interval Modes are Outlined in Table , = Write a "'" into TCR7 0= Write a "0" into TCR7 5. *Point at which an interrupt may occur. • Frequency Comparison Mode (TCR3 = 1, TCR4 = 0) (NOTE) All time intervals shown above assume the Gate (CTG) The timer within the HD6846 may be programmed to and Clock (CTC) signals are synchronized to Enable with the specified setup and hold time requirements. compare the perio~ a pulse (giving the frequency after calculations) at the CTG input with the time period required for Figure 16 Single-Shot Modes Counter Time Out. A negative transition of the CTG input enables the counter and starts a Counter Initialization cycle - provided that other conditions as noted in Table 3 are satisfied. The counter decrements on each clock signal recognized during or after Counter Initialization until an Interrupt is generated, a Table 5 Time Interval Modes TCR3 = 1 TCR4 TCRS APPLICATION CONDITION FOR SETTING INDIVIDUAL INTERRUPT FLAG 0 0 Frequency Interrupt Generated if CTG Input Period (1 IF) Comparison is Less Than Counter TimeOut (TO). 0 1 Frequency Interrupt Generated if CTG Input Period (1 IF) Comparison is Greater Than Counter Time Out (TO). 1 0 Pulse Width Interrupt Generated if CTG Input "Down Time" Comparison is Less Than Counter Time Out (TO). 1 1 Pulse Width Interrupt Generated if CTG Input "Down Time" Comparison is Greater Than Counter Time Out (TO). 200 ------------------------------------HD6846------------------------------------ Write Timer Latches command is issued, or a Timer Reset clearing CSRI and CSR2 are detailed in a later section. The condition occurs. It can be seen from Table 3 that an interrupt Timer Interrupt Flag (CSRO) is cleared under the following condition will be generated if TCR5 ="0" and the period of the conditions: pulse (single pulse or measured separately repetative pulses) at 1) Timer Reset - Internal Reset Bit (TCRO) = "1" or External the CTG input is less than the Counter Time Out period. If RES = "0". TCR5 ="1", an interrupt is generated if the reverse is true. 2) Any Counter Initialization condition. Assume now with TCR5 = "1" that a Counter Initialization 3) A Write Timer Latches command if Time Interval modes has occurred and that the CTG input has returned "Low" prior (TCR3 ="1") are being used. to Counter Time Out. Since there is no Individual Interrupt Flag 4) A Read Timer Counter command, provided this is preceded generated, this automatically starts a new Counter Initialization by a Read Composite Status Register while CSRO is set. This Cycle. The process will continue with frequency comparison latter condition prevents misSing an Interrupt Request being performed on each CTG input cycle until the mode is generated after reading the Status Register and prior to changed, or a cycle is determined to be above the predetermined reading the counter. limit. The remaining bits of the Composite Status Register (CSR3"'CSR6) are unused. They default to a logic zero when read. • Pulse Width Comparison Mode (TCR3 = 1, TCR4 = 1) This mode is similar to the Frequency Comparison Mode except for the limiting factor being a positive, rather than • 1/0 OPERATION negative, transition of the CTG input. With TCR5 = "0", an Individual Interr2!£!. Flag will be generated if the zero level pulse • Parallel Peripheral Port applied to the CTG input is less than the time period required The peripheral port of the HD6846 contains 8 Peripher~ for Counter Time Out. With TCR5 = "1", the interrupt is Data lines (Po-P,), two Peripheral Control lines (CPt and CP l ), generated when the reverse condition is true. a Data Direction Register, a Peripheral Data Register, and a As can be seen in Table 3, a positive transition of the CTG Peripheral Control Register. The port also directly affects two input disables the counter. With TCR5 = "0", it is therefore bits (CSRI and CSR2) of the Composite Status Register. possible to directly obtain the width of any pulse causing an The Peripheral Port is similar to the "B" side of a PIA interrupt. (HD46821) with the following exceptions: 1) All registers are directly accessible in the HD6846 Data Direction and Peripheral Data in the HD6821 are located at the same address, with Bit Two of the Control Register used • Composite Status Register for register sele~ti9n. _ __ The Composite Status Register (CSR) is a read-only register 2) Peripheral Control Register Bit Two (PRC2) of the HD6846 which is shared by the Timer and the Peripheral Data Port of is used to select an optional input latch function. This option the HD6846. Three individual interrupt flags in -the register-are is not available with HD6821 PIA's. set directly via the appropriate conditions in the timer or 3) Interrupt Flags are located in the HD6846 composite status peripheral port. The composite interrupt flag - and the IRQ register rather than Bits 6 and 7 of the Control Register as Output - respond to these individual interrupts only if used in the HD6821. corresponding enable bits are set in the appropriate Control 4) Interrupt Flags are cleared in the HD6821 by reading data Registers. (See Figure 17.) The sequence of assertion is not from the Peripheral Data Register. HD6846 Interrupt Flags detected. Setting TCR6 while CSRO is "High" will cause CSR7 are cleared by either reading or writing to the Peripheral Data to be set, for example. Register - provided that this sequence is followed a) Flag The Composite Interrupt Flag (CSR7) is clear only if all Set, b) Read Composite Status Register, c) Read/Write enabled Individual Interrupt Flags are clear. The conditions for Peripheral Data Register is followed. IRQ (NOTE) Bits CSR3 - CSR6 are not used. Figure 17 Composite Status Register & Associated Logic 201 ------------------------------------HD6846------------------------------------ 5) Bit 6 of the HD6846 Peripheral Control Register is not • Peripheral Port Reset (PCR7) used. Bit 7 (PeR7) is an Internal Reset Bit not available on Bit 7 of the Peripheral Control Register (PeR7) may be uSed the HD6821. to initialize the peripheral section of the HD6846. When this 6) The Peripheral Data lines (and CP2 ) of the HD6846 features bit is set "High", the' peripheral data register, the peripheral data internal current limiting which allows them to directly drive direction register, and the interrupt flags associated with the the base of Darlington NPN transistors. peripheral port (CSR1 & CSR2) are all cleared. Other bits in the peripheral control register are not affected by PCR7. _ • Data Direction Register PeR7 is set by either a logic zero at the External RES input The MPU can write directly to this eight-bit register to or under program control by writing a "1" into' the location. In configure the Peripheral Data lines as either inputs or outputs. any case, PeR7 may be cleared only by writing a zero into the A particular bit within the register (DDRn) is used to control location while RES is "High". The bit must be cleared to acti- the corresponding Peripheral Data line (Pn). With DDRn = "0", vate the port. Pn becomes an input; if DDRn = "1", Pn is an output. As an example, writing Hex $OF into the Data Direction Register • Control of CPI Peripheral Control Line results in Po thru P 3 becoming outputs and P 4 thru P 7 being CPI may be used an interrupt reguest to the HD6846, as a inputs. Hex $55 in the Data Direction Register results in alter- strobe to allow latching of input data" or both. In any case, the nate outputs and inputs at the parallel port. input can be programmed to be activated by either a positive or negative transition of the signal. Thes options are selected via • Peripheral Data Register Control Register Bits PCRO, RCR1 & PCR2. This eight-bit register is used for transferring data between Control Register Bit 0 (PCRO) is used to enable the interrupt the peripheral data port and the MPU. Any bit corresponding to transfer circuitry of the HD6846. Regardless of the state of an output line will be used to drive the output buffer associated PCRO, and active transition of CPI causes the Composite Status with that line. Data in these output bits is normally provided by Register Bit One (CSR1) to be set. if PCRO ="1", this interrupt an MPU Write function. (Input bits - those associated with will be reflected in the Composite Interrupt Flag (CSR7), and input lines - are unchanged by a Write Command.) Any input thus at the IRQ output. CSR1 is cleared by a Peripheral Port bit will reflect the state of the associated input line if the input Reset condition or by either reading or writing to the peripheral latch function is deselected. If the Control Register is pro- data register after the Composite Status Register is read. The grammed to provide input latching, the input bit will retain the latter alternative is conditional - CSR1 must have been a logic state at the time CP I was activated until the Peripheral Data one when the Composite Status Register was lart read. This pre- Register is read by the MPU. cludes inadvertent clearing of interrupt flags generated between the time the Status Register is read and the manipulation of • Peripheral Control Register peripheral data. This eight-bit register is used to control the reset function as Control Register Bit One (PeRl) is used to select the edge well as for selection of optional functions of the two peripheral which activates. CP I. When PCRI = "0", CP I is active on control lines (CP I and CP2 ). The Peripheral Control Register negative transitions ("High" to "Low"). "Low" to "High" functions are outlined in Table 6. transitions are sensed by CP I when PCR1 ="1". Table 6 Peripheral Control Register Format (Expanded) PCR7 l PCR6 I PCR5 I PCR4 PCR3 I PCR2 I PCR1 I PCRO 1 I I I 0= CP2 DIRECTION CONTROL CP2 Is INPUT I 0= CPI INT. ENABLE CPI INT. MASKED 1 = CP2 Is OUTPUT 1 = CPt INT. ENABLED I RESET (SET BY EXT. RES = 0 OR WRITING ONE INTO LOCATION; CLEARED BY WRITING ZERO TO THIS LOCATION) l CPt ACTIVE EDGE SELECT o = NEGATIVE (.J.) EDGE 1 = POSITIVE (t) EDGE I ~-------------------------- o = NORMAL OPERATION 1 = RESET CONDITION (CLEARS PERIPHERAL I CPI INPUT LATCH CONTROL 0= INPUT DATA NOT LATCHED DATA & DATA DIRECTION REG + CSR1 & CSR2) 1 = INPUT DATA LATCHED ON ACTIVE CPI I I I CP2 IS INPUT(PCR5 = 0) I PCR4 PCR3 CP2 IS OUTPUT (PCR5 = 1) l PCR4 I PCR3 I 0 0 0 1 INTERRUPT ACKNOWLEDGE INPUT/OUTPUT ACKNOWLEDGE I I PROGRAMMABLE OUTPUT CP ACTIVE EDGE SELECT CP2 INT. ENABLEj o =2 NEGATIVE (.J.) EDGE o = CP2 INT. MASKED 1 OOR 1 (CP 2 REFLECTS DATA I 1 = POSITIVE (t) EDGE II 1 = CP z INT. ENABLED WRITTEN INTO PCR3) 202 ------------------------------------HD6846------------------------------------ In addition to its use as an interrupt input, CP 1 can be used manner as those lines selected as outputs by the Data Direction as a strobe to capture input data in an internal latch. This option Register. is selected by writing a one into Peripheral Control Register Bit The handshaking mode (PCRS = "1", PCR4 = "0") allows Two (PCR2). In operating, the data at the pins designated by CP 2 to perform one of two functions as selected by PCR3. With the Data Direction Register as inputs will be captured by an PCR3 = "I", CP2 will go "Low" on the first Enable positive active transition of CP 1. An MPU Read of the Peripheral Data transition after a Read or Write to the Peripheral Data Register. Register will result in the captured data being transferred to the This Input/Output Acknowledge signal is released (returns MPU - and it also releases the latch to allow capture of new "High") on the next positive transition of the Enable signal. data. Note that successive active transitions with no Read In the Interrupt Acknowledge mode (PCRS = "1", PCR4 = Peripheral Data Command between does not update the input PCR3 = "0"), CP 2 is set when CSRI is set by an active latch. Also, it should be noted that use of the input latch transition of CP 1. It is released (goes "Low") on the first function (which can be deselected by writing a zero into PCR2) positive transition of Enable after CSRI has been cleared via an has no effect on output data. It also does not affect Interrupt MPU Read or Write to the Peripheral Data Register. (Note that function of CP 1 • the previously described conditions for clearing CSRI still apply.) • Control of CP2 Peripheral Control Line CP z may be used as an input by writing a zero into PCRS. In • Restart Sequence this configuration, CP 2 becomes a dual of CP 1 in regard to A typical restart sequence for the HD6846 will include generation of interrupts. An active transition (as selected by initialization of both the Peripheral Control & Data Direction PCR4) causes Bit Two of the Composite Status Register to be Registers of the parallel port. It is necessary to set up the set. PCR3 is then used to select whether the CP 2 transition is to Peripheral Control Register first, since PCR7 = "0" is a cause CSR7 to be set - and thereby cause IRQ to go "Low". condition for writing data into the Data Direction Register. (A CP2 has no effect on the input latch function of the HD6846. logic zero at the external RES input automatically sets PCR7.) Writing a one into PCRS causes CP 2 to function as an output. PCR4 then determines whether CP 2 is to be used in a • Summary handshake or programmable output mode. With PCR4 = "1", The HD6846 has several optional modes of operation which CP 2 will merely reflect the data written into PCR3. Since this allow it to be used in a variety of applications. The following can readily be changed under program control, this mode allows tables are provided for reference in selecting these modes. CP 2 to be a programmable output line in much the same Table 7 HD6846 Internal Register Addresses R/W A2 Al Ao REGISTER SELECTED R 0 0 0 Combination Status Register R/W 0 0 1 Peripheral Control Register R/W 0 1 0 Data Direction Register R/W 0 1 1 Peripheral Data Register R 1 0 0 Combination Status Register R/W 1 0 1 Timer Control Register R/W 1 1 0 Timer MSB Register R/W 1 1 1 Timer LSB Register R x x x ROM Address Table 8 Composite Status Register CSR7 I CSR3-CSR6 NOT USED DEFAULT TO ZERO WHEN READ I CSR2 I CSR1 I CSRO j I I I COMPOSITE INTERRUPT FLAG 0= NO ENABLED INTERRUPT FLAG SET I 0= CP, INTERRUPT FLAG III TIMER INTERRUPT FLAG I NO INT REQ o = NO INT REQ. 1 = ONE OR MORE ENABLED INTERRUPT FLAGS SET* 1 = INT REQUESTED 1 = INT REQUESTED INVERSE OF THIS BIT APPEARS AT IRQ OUTPUT CPI INTERRUPT *STATUS OF THIS BIT CAN BE EXPRESSED AS: o = NO INT REQ. CSR7 = CSRO· TCR6 + CSR1· PCRO + CSR2· PCR3 I 1 = INT REQUESTED I 203 ------------------------------------HD6846------------------------------------ Table 9 Timer Control Register TCR7 I TCR6 J TCR5 I TCR4 TCR3 I TCR2 I TCR1 I TCRO l INTERNAL RESET J IINTERRUPUT ENABLE o = IRQ MASKED 0= TIMER ENABLED 1 = IRQ ENABLED I 1 = INT REQUESTED TIMER OUTPUT ENABLE I oCLOCK SOURCE = EXTERNAL CLOCK (CTC) o = OUTPUT DISABLED (LOW) 1 = INTERNAL CLOCK (41 2 ) • 1 = OUTPUT ENABLED -------------------------- FOR CASCADED SINGLE-SHOT o = OUTPUT GOES LOW AT TIME OUT I +o =8 PRESCALE ENABLE CLOCK NOT PRESCALED 1 = OUTPUT GOES HIGH AT TIME OUT 1 = CLOCK PRESCALED (+ 8) I TCR3 TCR4 TCR5 TIME OPERATING MODE COUNTER INITIALIZATION INTERRUPT FLAG SET 0 0 0 CONTINUOUS CTG'(' + W + R TO 0 0 1 CASCADED SINGLE SHOT CTG.(, + W + R TO 0 1 0 CONTINUOUS CTG .(, + R TO 0 1 1 NORMAL SINGLE SHOT CTG .(, + R TO 1 0 0 FREQUENCY COMPARISON CTG .(,. r· (CE + TOF·CE) + R CTG .(, BEFORE TO 1 0 1 CTG '('·1 + R TO BEFORE CTG 1 1 0 CTG '('·1 + R CTG t BEFORE TO PULSE WIDTH COMPARISON 1 1 1 CTG'(' . 1 + R TO BEFORE CTG t R = RESET CONDITION CTG'(' = NEG TRANSISTION OF PIN 17 W = WRITE TIMER LATCHES CTGt = POS TRANSITION OF PIN 17 TO = COUNTER TIME OUT 1 = INTERRUPT FLAG (CSRO) = 0 CE = COUNTER ENABLE Table 10 Peripheral Control Register l PCR7 I PCR6 I PCR5 I PCR4 PCR3 J I PCR2 I PCR1 I PCRO I I I I oCP=z CP DIRECTION CONTROL Is INPUT I oCPt= CPt INT. ENABLE INT. MASKED z 1 = CPz Is OUTPUT 1 = CPt INT. ENABLED RESET (SET BY EXT. RES = 0 OR WRITING CP1 ACTIVE EDGE SELECT ONE INTO LOCATION; CLEARED BY 0= NEGATIVE (.(,) EDGE WRITING ZERO TO THIS LOCATION) I 1 = POSITIVE (t) EDGE I 1-------- - - - - - - - - - - - - - - - - - - - - - - - 0= NORMAL OPERATION CPt INPUT LATCH CONTROL 1 = RESET CONDITION (CLEARS PERIPHERAL o = INPUT DATA NOT LATCHED DATA & DATA DIRECTION REG + CSR1 & CSR2) I 1 = INPUT DATA LATCHED ON ACTIVE CPt I I CPz' IS INPUT (PCR5 = 0) I PCR4 0 PCR3 0 CP z IS OUTPUT (PCR5 = 1) INTERRUPT ACKNOWLEDGE I PCR4 I PCR3 j 0 1 INPUT/OUTPUT ACKNOWLEDGE I I CP ACTIVE EDGE SELECT o =z NEGATIVE (.(,) EDGE I CP 2 INT. ENABLE o = CPz INT. MASKED 1 OOR 1 PROGRAMMABLE OUTPUT (CP z REFLECTS DATA WRITTEN INTO PCR3) I 1 = POSITIVE (t) EDGE I 1 = CP z INT. ENABLED 204 ------------------------------------HD6846------------------------------------ • CUSTOM PROGRAMMING shown in Figure 18 and Figure 19. By the programming of a single photomask for the Information for custom memory content may be sent to HD6846, the customer may specify the content of the IDTACHI in one of two forms (shown in order of preference): memory and the method of enabling the outputs. 1) Paper tape output of the HMCS6800 Load Module Format Information on the general options of the HD6846 should or of the BNPF Format be submitted on an Organizational Data form such as that 2) Hexadecimal coding using IBM Punch Cards ORGANIZATIONAL DATA HD46846 COMBINATION ROM-I/O-TIMER Customer: Hitachi Use Only: Company Part No. Quote: Originator Part No.: Phone No. Specif. No.: Enable Options: (ROM ENABLE MUST DIFFER FROM I/O-TIMER) CHECK ONE COLUMN ONLY 1 0 1 0 I/O-TIMER SELECT 1 ~2.0V CS o DD 0 0 1 A6 0 x A 10 Ag x' x 1 x x 1 x x x x OSO.SV x= cS l DO D D DDD Aa A? x x x x x X 1 x x 1 NOT USED ROM SECTION I/O-TIMER SECTION Figure 18 Format for Programming General Options DATE I COMPANY ENGINEER SECTION CUSTOMERS PIN (if you need) TYPE NO. OF ROM I I I I I I I I I I I I DATA FORMAT 1. HMCS6S00 load module format 2. BNPF format coding media total bytes of data (decimal) 01. paper tape 02. 1MB SO column card initial ROM address (decimal) parity (for paper tape) 01. even o 2. odd 0 3. none total number of cards designed for HITACHI reference only ref. No. ~ mask ROM No. processed data approved approved data Figure 19 Confirmation sheet of specification for HD6846 series ROM 205, ------------------------------------HD6846------------------------------------ • PAPER TAPE 1) Anyone inch width tape usually available in market can be used but tape in black color is recommended. 2) Both leader and trailer have more than 600 frames. (Example) ooooooooooooooooooooooooooooooooo~oooooo leader data trailer more than more than 600 frames 600 frames 3) One me data of each chip shall be contained in one reel of paper tape. One me data shall not be divided into more than column contents two reels. 1 to 71 Free format of data column 4) Parity 72 Blank Parity shall be indicated in "Confirmation sheet of specifica· 73 to 80 Sequential card number, not free format. tion". Parity forms are grouped; Least significant digit of decimal sequential (1) With parity EVEN or ODD number is located in column 80. (2) Without parity No alphabet letters. 5) 8·bit ASCII code shall be used. Any sequential number more than 1 can be used • • CARD ,1) Use IBM 80 column card. • DATA FORMAT 2) Use EBCDIC code. 3) Card format is as follows; • HMCS6800 LOAD MODULE FORMAT 4) Total number of cards shall be written in "Confirmation This is object format obtained from HMCS6800 assembler. sheet of specification". 1) 8·bit code is divided into upper and lower 4 bits and transformed into hexadecimal number. (Example) Binary number if 11000010 is transformed as follows. upper lower 0, 0 6 Os D. 03 O2 0 1 Do bit weight . (corresponding to 1 1 0 0 ,0 1 1 0 ROM output) I I \ C 6 2) Load module structure of paper tape is shown as an example. <'~" 1(( 50 51 51 51 5, 206 ------------------------------------HD6846------------------------------------ SO is the header record, Sl is data record and S9 is end of me record. Each data record corresponds to each ROM data as ROM 51 shown below. Continuous memory address shall be devided into Address several records due to limitation of maximum frame number (70 frames = 35 bytes) in one record. SO, Sl or S9 is distinguished by CC following start of the record S. 51 51 51 } ""."NUUSI 00 (CR) OA (LF) 00 00 00 frame 00 53 S: start of the record CC: type of CC record (0.10r9) 1 70 frames max I-- - } Byte oount Hexa Oicimal (2 frames = 1 byte) I-- - Start address of data in this record Check I-- - ) sum I-- - }"" Byte count I I-- - }"" . I-- - v---- Check sum is complement of 1 for sum of each S-bit. 207 HD6846 3) Example of load module format CC=30 CC=31 CC=39 header data end of file frame record record record 1 start of record 53 S 53 S 53 S 2 type of record 30 0 31 39 9 3 30 31 30 03 byte count 06 16 33 4 36 36 5 30 31 30 start address of 30 31 30 6 0000 1100 0000 7 data in this 30 30 30 8 record 30 30 30 9 34 39 46 FC (check sum) data 48-H 98 43 10 38 38 data 34 30 02 34 44-0 32 35 52-R data n check sum 32 32 42 28 (check sum) 6a 38 A8 (check sum) Check sum of header record above is complement of 1 of (06 4) Four types of data of ROM code are able to be processed. In + 00 + 00 + 48 + 44 + 52)16 i.e., 2B. any case, header record before data record is needed and so The start address of data record is incremented for each one as end of ftle record after data record. byte data, then is compared to the next address in data record (a) No vacancy in ROM and is checked to be sequential or not. Data record is filled with full ROM record of one chip. When it is not sequential, hexadecimal 00 is ftlled as data for Therefore address is sequential. Initial ROM address in "Con- that address automatically. ftrmation sheet of speciftcation" is O. A example of type out of paper tape in HMCS6800 load (b) .Vacancy in former part of ROM module format is shown below. Desired initial address shall be filled in initial ROM address column in "Conftrmation sheet of speciftcation". Data of 00 are filled automatically for vacant address. header record ... SOO6000048445228 (c) Vacancy in the middle of ROM data record ...... Sl13F0007EF5587EF7897EF AA 77EF9C07EF9C4 7E24 Data of 00 are filled in for vacant address. Initial ROM data record ...... S 112FO lOFA657EFA887EFAA07EF9OC7EFA24 7E06 address for data I is 0 and desired initial address for data II shall end of file record .... S9030000FC . be descnbed in "Conftrmation sheet of speciftcation". (d) Vacancy in later part of ROM When end of ftle record is read out, data of 00 are filled in thereafter. ROM vacancy (filled with 00) vacency (filled with 00) (a) (b) (c) (d) 208 ------------------------------------HD6846------------------------------------ (Example) Paper tape whose data record is S1141920B6FC ..... 000 00 0 o 0 00000 0 0 OOOOOOOOOOOOOOOOOOO~OOOOO~~O~~~~~~OOOOOOOOOOOOOOOOOOOO000 o 00000000 0 00000 0000000 0 00000 o 0 000 0000 0 00000 0 5 2BFF44 14906C466 • BNPF format 1) Each word is expressed as BNPF slice which begins word opening mark B, has 8 character bit contents shown by P or Nand fmishes with end mark F. (E xam p Ie) OF in hexadecimal code is expressed as shown below (paper tape). 00000 0 0000 0 00000000000000 0 0000000000000000000 0000 0000 0000000000 o bit weight 2) Any contents between F of the fIrst slice and B of next slice informed to the customer in confIrmation table. are disregarded. Note 2) Expression of B*nF can be used for indicating that 3) Bit pattern (BNPF) slice for all ROM address shall be the same contents of foregoing slice are applicable indicated. Initial ROM address in "ConfIrmation sheet of from this word to following n words. specification" is, therefore always 0 for BNPF. For example, when B*4F is indicated at 10th word B shows beginning of the word position, the contents of 9th word are repeated for N shows 0 of one bit data 10, 11, 12 and 13th word. P shows 1 of one bit data (Content of X is not always repeated even in this F shows end of the word case.) Note 1) X can be used expect for P and N for indication of n is grater than 1 and less than fInal address of ROM. word contents of BNPF slice. This X means that bit Note 3) When vacancy of ROM exists, combination of Note can be either P or N (don't care). X shall be I) and Note 2) is usefull. determined by HITACHI for testing and shall be 209 -----------------------------------HD6846----------------------------------- Customer HITACHI ROM code Customers PIN chip select & other informa- tion Choice of Media "Organizational Data" "Specification Conf- irmation Sheet" "ROM code" or same as input medium information Customer's HITACHI's responsibilitY responsibi lity Mask making report Figure 20 Flow chart of Mask ROM Development 210 HD&850, H D & 8 A 5 0 - - - - - - - - - ACIA (Asynchronous Communication Interface Adapter) The HD6850 Asynchronous Communications Interface Adapter provides the data formatting and control to interface serial asynchronous data communications information to bus organized systems such as the HMCS6800 Microprocessing Unit. The bus interface of the HD6850 includes select, enable, read/write, interrupt and bus interface logic to allow data transfer over an 8-bit bi-directional data bus. The parallel data of the bus system is serially transmitted and received by the asynchronous data interface, with proper formatting and error checking. The functional configuration of the ACIA is programmed via the data bus during system initialization. A programmable Control Register provides variable word lengths, clock division ratios, transm'it control, receive control, and interrupt control. H D6850P, H D68A50P For peripheral or modem operation three control lines are provided. • FEATURES • Serial/Parallel Conversion of Data • Eight and Nine·bit Transmission • Insertion and Deleting of Start and Stop Bit • Optional Even and Odd Parity • Parity, Overrun and Framing Error Checking • Peripheral/Modem Control Functions (Clear to Send (DP-24) CTS, Request to Send RTS, Data Carier Detect DCD) • Optional + 1, + 16, and + 64 Clock Modes • PIN· ARRANGEMENT • Up to 500kbps Transmission • Programmable Control Register • N-channel Silicon Gate Process • Compatible with MC6850 and MC68A50 • BLOCK DIAGRAM Tx ClK 4 E 14 13 8 1---+ 6 Tx Data ~o 11 24 CTS D. 22 0, 21 0, 20 03 7 IRQ 19 D. 18 ~--......- - - - - 23 DCD Os 17 0, 16 5 RTS 0, 15 (Top View) I--t-- 2 Rx Data Rx elK 3 -----------1 ?11 -------------------------------HD6850, HD68A50------------------------------- • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3 - +7.0 V Inpu'l: Voltage Vin * -0.3 - +7.0 V Operating Temperature Topr -20- +75 °c Storage Temperature Tstg -55 - +150 °c * With respect to Vss (SYSTEM GND) (NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect relia- bility of LSI. • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V V 1L * -0.3 - 0.8 V Input Voltage V 1H * 2.0 - Vee V Operating Temperature Topr -20 25 75 °c * With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vcc=5V±5%, VSS=OV, Ta=-2o-+75°C, unless otherwise noted.) Item Symbol Test Condition min typ* max Unit Input "High" Voltage All Inputs VIH 2.0 - Vee V Input "Low" Voltage All Inputs V 1L -0.3 - 0.8 V Input Leakage Current RAN,CSo,CS1,CSz,E lin V in =o-5.25V - - 2.5 JlA Three-State (Off State) Input Current 0 0 ""0 7 ITS1 Vin =0.4-2.4V - - 10 JlA 0 0 -0 7 IOH=-205JlA, Enable Pulse Width ~ 25Jls 2.4 - - Output "High" Voltage V OH V IOH=-100llA, Enable TxOata, RTS Pulse Width ~ 25Jls 2.4 - - IOL =1.6mA,Enable Output "Low" Voltage All outputs VOL Pulse Width ~ 25Jls - - 0.4 V Output Leakage Current (Off State) IRQ I LOH VoH =2.4V - - 10 JlA Power Oissipation Po - 300 525 mW 0 0 -0 7 - - 12.5 E, TxCLK, RxCLK, Vin=OV, Ta =25°C, Input Capacitance Cin pF RAN, RS, RxOata, CS o , f=1.0MHz - - 7.5 CS 1, CS 2 , ~ OCO RTS", TxOata Vin=OV, Ta=25°C, - - 10 Output Capacitance Cout pF IRQ f=1.0MHz - - 5.0 212 --------------------------------HD6850, HD68A50------------------·-------------- • AC CHARACTERISTICS 1. TIMING OF DATA TRANSMISSION Test Item Symbol min typ max Unit Condition +16, +64 Modes PW CL Fig. 1 600 - - ns Minimum Clock Pulse Width +16, +64 Modes PW CH Fig. 2 600 - - ns +1 Mode - - 500 Clock Frequency fc kHz +16, +64 Modes - - 800 Clock-to-Data Delay for Transmitter t TOO Fig.3 - - 1.0 J..Ls Receive Data Setup Time + 1 Mode t ROSU Fig.4 500 - - ns Receive Data Hold Time + 1 Mode tROH Fig. 5 500 - - ns IRQ Release Time tlR Fig. 6 - - 1.2 J..Ls RTS Delay Time tRTS Fig. 6 - - 1.0 J..Ls Rise Time and Fall Time Except E t r , tf - - 1.0* J..Ls * 1.0 IlS or 10% of the pulse width, whichever is smaller. 2. BUS TIMING CHARACTERISTICS 1) READ Test HD6850 HD68A50 Item Symbol Unit Condition min typ max min typ max Enable Cycle Time t cycE Fig.7 1.0 - - 0.666 - - J..Ls Enable "High" Pulse Width PW EH Fig. 7 0.45 - 25 0.28 - 25 J..Ls Enable "Low" Pulse Width PW EL Fig.7 0.43 - - 0.28 - - J..Ls Setup Time, Address and R/W valid tAS Fig.7 140 - - 140 - - ns to Enable positive transition Data Delay Time tOOR Fig.7 - - 320 - - 220 ns Data Hold Time tH Fig. 7' 10 - - 10 - - ns Address Hold Time tAH Fig. 7 10 - - 10 - - ns Rise and Fall Time for Enable tEr,tEf Fig. 7 - - 25 - - 25 ns Input 2) WRITE Test HD6850 HD68A50 Item Symbol Unit Condition min typ max min typ max Enable Cycle Time tcycE Fig.8 1.0 - - 0.666 - - J..Ls Enable "High" Pulse Width PW EH Fig.8 0.45 - 25 0.28 - 25 J..Ls Enable "Low" Pulse Width PW EL Fig.8 0.43 - - 0.28 - - J..Ls Setup Time, Address and R/W tAS Fig.8 140 - - 140 - - ns valid to Enable positive transition Data Setup Time tosw Fig.8 195 - - 80 - - ns Data Hold Time tH Fig. 8 10 - - 10 - - ns Address Hold Time tAH Fig.8 10 - - 10 - - ns Rise and Fall Time for Enable t Er, tEf Fig.8 - - 25 - - 25 ns Input 213 ------------------------------HD6850, HD68A50------------------------------ Tx elK or or Rx elK Rx elK Figure 1 Clock Pulse Width, " Low" State Figure 2 Clock Pulse Width, "High" State tTDD~ 2.4V Tx Data __________-J. ~.-~O~.4~V--------- Figure 3 Transmit Data Output Delay Figure 4 Receive Data Setup Time (+1 Mode) tlR-----1- Figure 5 Receive Data Hold Time (+1 Mode) ______J___ 22. 44VV Figure 6 RTS Delay and I RQ Release Time Enable RS, CS, R/W Data Bus Figure 7 Bus Read Timing Characteristics (Read information from ACIA) 214 -------------------------------HD6850, HD68A50------------------------------- Enable Data Bus Figure 8 Bus Write Timing Characteristics (Write information into ACIA) Load A Load B ~ 5.0V (Vee) 5'OV (Do -0 7 , RTS. Tx Data) ORQ Only) RL=2.4kn 3kn Test Point O-~"""-""--1 Test point r~F C R C = 130pF for 0 0 -0 7 R=11knforD o-D 7 = 30pF for RTS and Tx Data = 24kn for RTS and Tx Data All diodes are 1S2074 ® or Equiv. Figure 9 Bus Timing Test Loads START Do 06 PARITY STOP STOP BIT BIT BIT BIT t----------CHARACTER TIME @ 10 CPS (11 BITS) ----------.-j 100 msec Figure 10 110 Baud Serial ASCII Data Timing 215 --------------------------------HD6850, HD68A50-------------------------------- START Do PARITY STOP BIT BIT BIT t--------CHARACTER TIME @ 15 & 30 CPS (10 BITS)--------1-f (SEE TABLE BELOW) BAUD RATE 150 300 CHARACTERSfflEC 15 30 BIT TIME (msecl 6.67 3.33 BIT TIME = _---'S=E=C'------_ CHARACTER TIME (msec) 66.7 33.3 BAUD RATE Figure 11 150 & 300 Baud Serial ASCII Data Timing MARK I I NEXT START I D6 PARITY STOP STOP CHAR. SPACE Figure 12 Send a 7 Bit ASCII Char. "H" Even Parity - 2 Stop Bits H = 48 16 = 10010002 • DATA OF ACIA • ACIA OPERATION HD6850 is an interface adapter which controls transmission • Master Reset and reception of Asynchronous serial data. Some examples of The master reset (CRO, CRt) should be set during system serial data are shown in Figs. 10 - 12. initialization to insure the reset condition and prepare for programming the ACIA functional configuration when the • INTERNAL STRUCTURE OF ACIA communications channel is required. Control bits CR5 and CR6 HD6850(ACIA) provides the following; 8-bit Bi-directional should also be programmed to define the state of RTS whenever Data Buses (Do-D 7 ), Receive Data Input (Rx Data), Transmit master reset is utilized. After master resetting the ACIA, the Data Output (Tx Data), three Chip Selects (CSo ,CS I ,CS;), programmable Control Register can be set for a number of Register Select Input (RS), Two Control Input (Read/Write options such as variable clock divider ratios, variable word (R/W), Enable(E», Interrupt Request Output(IRQ), Clear-to- length, one or two stop bits, parity (even, odd, or none), etc. Send (rn) to control the modem, Request-to-Send (RTS), Data Carrier Detect(DCD) and Clock Inputs(Tx CLK, Rx CLK) used for synchronization of received and transmitted data. This ACIA also provides four registers; Status Register, Control Register, Receive Register and Transmit Register. 24-pin dual-in-line type package is used for the ACIA. Inter- nal Structure of ACIA is illustrated in Fig. 13. 216 --------------------------------HD6850, HD68A50-------------------------------- ACIA r - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --., (~;to) --i TRANSMIT DATA REGISTER (TOR) I y+C5~ ~ WRITE ONLY / 0, / D.' 0./ 0./ 0./ 0, / 0./ 0./ JJ SERIAL DATA OUT T. Da.. ; i :w.,,,, }.~.~JJ/ i LINES (PARALLEL TO SERIAL CONVERTER) DATA READ ONLY LINES TO OR FROM MPU CONTROL REGISTER (CR) : I I I WRITE ONLY I I R.CLK ifI r----r---l---r-- -r-rr-r I READ SERIAL DATA IN R. Da .. I I ONLY Do 01 D:a OJ D. Os 06 0, TxCLK RECEIVE DATA REGISTER (RDR) I I cs, DcD I r -r- IRQ R/W E RS CTS CS. CS. RTS J L_ ~~g~~VE ~~:; i~;:L ~ ~~:~EST UPT INTjiu ENABLE TRANSMIT MPU (AO) ~~%~M CHIP SELECT MODEM CLOCK REGISTER FROM MPU DATA ~~~~T ~I~~~ESS g~~:6~R MPU FROM ADDRESS MODEM LINE Figure 13 Internal Structure of ACIA • Transmit the detection of the leading mark-space transition of the start A typical transmitting sequence consists of reading the ACIA bit. False start bit delection capability insures that a full half bit Status Register .either as a result of an interrupt or in the of a start bit has been received before the internal clock is ACIA's tum in a polling sequence. A character may be written synchronized to the bit time. As a character is being received, into the Transmit Data Register if the status read operation has parity (odd or even) will be checked and the error indication indicated that the Transmit Data Register is empty. This will be available in the Status Register along with framing error, character is transferred to a Shift Register where it is serialized overrun error, and Receive Data Register full. In a typical and transmitted from the Transmit Data output preceded by a receiving sequence, the Status Register is read to determine if a start bit and followed by one or two stop bits. Internal parity character has been received from a peripheral. If the Receiver (odd or even) can be optionally added to the character and will Data Register is full, the character is placed on the 8-bit ACIA occur between the last data bit and the flrst stop bit. After the bus when a Read Data command is received from the MPU. flrst character is written in the Data Register, the Status When parity has been selected for an 8-bit word (7 bits plus Register can be read again to check for a Transmit Data Register parity), the receiver strip the parity bit (07="0") so that data Empty condition and current peripheral status. If the register is alone is transferred to the MPU. This feature reduces MPU empty, another character can be loaded for transmission even programming. The Status Register can continue to be read again though the flrst character is in the process of being transmitted to determine when another character is available in the Receive (because of double buffering). The second character will be Data Register. The receiver is also double buffered so that a automatically transferred into the Shift Register when the flrst characttr can be read from the data register as another character character transmission is completed. This sequence continues is being received in the Shift register. The above sequence con- until all the characters have been transmitted . tinues until all characters have been received. • Receive • ACIA INTERNAL REGISTERS Data is received from a peripheral by means of the Receive The ACIA provides four registers; Transmit Data Register Data input. A divide-by-one clock ratio is provided for an (TDR), Receive Data Register(RDR), Control Register(CR) and externally sync~ronized clock (to its data) while the divide-by- Status Register(SR). The content of each of the registers is 16 and 64 ratios are provided for internal synchronization. Bit summarized in Table 1. synchronization in the divide-by-16 and 64 modes is initiated by 217 -------------------------------HD6850, HD68A50------------------------------- Table 1 Definition of ACIA Register Contents **** Buffer RS=1 • R/W=O RS=1 • R/W=1 RS=O· R/W=O RS=O· R/W=1 Address Transmit Data Receiver Data Data Bus Control Register Status Register Register Register (Write Only) (Read Only) (Write Only) (Read Only) Counter Divide Rx Data Reg. Full 0 Data Bit 0* Data Bit 0 Select (CRO) (RDRF) Counter Divide Tx Data Reg. Empty 1 Data Bit 1 Data Bit 1 Select ·(CR1) (TORE) Word Select 1 Data Carrier Detect 2 Data Bit 2 Data Bit 2 (CR2) (DCD) Word Select 2 Clear to Send 3 Data Bit 3 Data Bit 3 (CTS) (CR3) Word Select 3 Framing Error 4 Data Bit 4 Data Bit 4 (FE) (CR4) Tx Control 1 Overrun 5 Data Bit 5 Data Bit 5 (CR5) (OVRN) Tx Control 2 Parity Error 6 Data Bit 6 Data Bit 6 (PE) (CR6) Rx Interrupt Enable Interrupt Request 7 Data Bit 7*** Data Bit 7** (CR7) (IRQ) * Leading bit = LSB = Bit 0 ** Data bit will be zero in 7-bit plus parity modes. *** Data bit is "don't care" in 7-bit plus parity modes. **** 1 ... "High" level,O ... "Low" level • Transmit Data Register (TOR) interrupt enables, and the Request-to-Send (RTS) peripheral/ Data is written in the Transmit Data Register during the modem control output. negative transition of the enable (E) when the ACIAhas been addressed and RS· R/W is selected. Writing data into the Counter Divide Select Bits (CRO and CR 1) register causes the Transmit Data Register Empty bit in the The Counter Divide Select Bits (CRO and CR1) determine Status Register to go "0". Data can then be transmitted. If the the divide ratios utilized in both the transmitter and receiver transmitter is idling and no character is being transmitted, then section of the ACIA. Additionally, these bits are used to provide the transfer will take place within one bit time of the trailing a master reset for the ACIA which clears the Status Register edge of the Write command. If a character is being transmitted, (except for external conditions on CTS and DCD) and initializes the new data character will commence as soon as the previous both the receiver and transmitter. Master reset does not affect character is complete. The transfer of data causes the Transmit other Control Register bits. Note that after power-on or a power Data Register Empty (TDRE) bit to indicate empty. fail/restart, these bits must be set "1" to reset the ACIA. Mter resetting, the clock divide ratio may be selected. These counter • Receive Data Register (RDR) select bits provide for the following clock divide ratios: Data is automatically transferred to the empty Receive Data Register (RDR) from the receiver deserializer (a shift register) Table 2 Function of Counter Devide Select Bit upon receiving a complete character. This event causes the Receive Data Register Full bit (RDRF) on the status buffer to CR1 CRO Function go "1" (full). Data may then be read through the bus by ad- dressing the ACIA and R/W "High" when the ACIA is enabled. 0 0 +1 The non-destructive read cycle causes the RDRF bit to be 0 +16 cleared to empty although the data is retained in the RDR. The 0 +64 status is maintained by RDRF as to whether or not the data is current. When the Receive Data Register is full, the automatic Master Reset transfer of data from the Receiver Shift Register to the Data Register is inhibited and the RDR contents remain valid with its current status stored in the Status Register. Word Select Bits (CR2, CR3, and CR4) - The Word Select bits are used to select word length, parity, • Control Register and the number of stop bits. The encoding format is as follows: The ACIA Control Register consists of eight bits of write- only buffer that are selected when RS and R/W are "Low". This register controls the functon of the receiver, transmitter, 218 ------------------------------ HD6850, HD68A50------~---------------------- • Status Register Table 3 Function of Word Select Bit Information on the status of the ACIA is available to the MPU by reading the ACIA Status Register. This read-only CR4 CR3 CR2 Function register is selected when RS is "Low" and R/W is "High". a a 0 7 Bits + Even Parity + 2 Stop Bits Information stored in this register indicates the status of the Transmit Data Register, the Receive Data Register and error a a 1 7 Bits + Odd Parity + 2 Stop Bits logic, and the peripheral/modem status inputs of the ACIA. a 1 a 7 Bits + Even Parity + 1 Stop Bit a 1 1 7 Bits + Odd Parity + 1 Stop Bit Receive Data Register Full (RDRF), Bit 0 1 a a 8 Bits + 2 Stop Bits RDRF indicates that received data has been transferred to the Receive Data Register. RDRF is cleared after an MPU read 1 a 1 8 Bits + 1 Stop Bit of the Receive Data Register or by a master reset. The cleared or 1 1 a 8 Bits + Even Parity + 1 Stop Bit empty state indicates that the contents of the Receive Data 1 1 1 8 Bits + Odd Parity + 1 Stop Bit Register are not current. Data Carrier Detect (OCD) being "High" also causes RDRF to indicate empty. Word length, Parity Select, and Stop Bit changes are not Transmit Data Register Empty (TDRE), Bit 1 buffered and therefore become effective immediately. The Transmit Data Register Empty bit being set "1" indicates that the Transmit Data Register contents have been Transmitter Control Bits (CR5 and CR6) transferred and that new data may be entered. The "0" state Two Transmitter Control bits provide for the control of indicates that the register is full and that transmission of a new the interrupt from the Transmit Data Register Empty condition, character has not begun since the last write data command. the Request-to-Send (RTS) output, and the transmission of a Break level (space). The following encoding format is used: Data Carrier Detect (DCD), Bit 2 The DCD bit will be "1" when the DCD input from a modem has gone "High" to indicate that a carrier is not present. This bit going" 1" causes an Interrupt Request to be generated when the Table 4 Function of Transmitter Control-Bit Receive Interrupt Enable is set. It remains" 1" after the DCD input is returned "Low" until cleared by first reading the Status eR6 CR5 Function Register and then the Data Register or until a master reset o a RTS = "Low", Transmitting Interrupt Disabled. occurs. If the DCD input remains "High" after read status and o 1 RTS = "Low", Transmitting Interrupt Enabled. read data or master reset has occurred, the interrupt is cleared, the DCD status bit remains" 1" and will follow the DCD input. a RTS = "High", Transmitting Interrupt Disabled. Clear-to-Send (CTS), Bit 3 RTS = " Low", Transmits a Break level on The CTS bit indicates the state of the CTS input from a modem. A "Low" CTS indicates that there is a CTS from the the Transmit Data Output. modem. In the "High state, the Transmit Data Register Empty Transmitting Interrupt Disabled. bit is inhibited and the CTS status bit will be "1". Master reset does not affect the Clear-to-Send Status bit. Receive Interrupt Enable Bit (CR7) Framing Error (FE), Bit 4 . The following interrupts will be enabled by a "1" in bit FE indicates that the received character is improperly framed position 7 of the Control Register (CR7): Receive Data by a start and a stop bit and is detected by the absence of the Register Full, Overrun, or a "Low" to "High" transistion on the 1st stop bit. This error indicates a synchronization error, faulty Data Carrier Detect (DCD) signal line. transmission, or a break condition. The FE flag is set or reset during the receive data transfer time. Therefore, this error RoRF Flag RIE indicator is present throughout the time that the associated character is available. Internal RoRF Flog Receiver OVAN Flag Receiver Overrun (OVRN), Bit 5 [ OeD Flag _ _ __ Overrun is an error flag that indicates that one or more characters in the data stream were lost. That is, a character or a Internal TORE Flag number of characters were received but not read from the Transmitter Receive Data Register (RDR) prior to subsequent characters [ being received. The overrun condition begins at the midpoint of the last bit of the second character received in succession CTs Input TORE Flag without a read of the RDR having occurred. The overrun does not occur in the Status Register until the valid character prior to Overrun has been read. The RDRF bit remains set until the Fig. 14 I RQ Internal Circuit Overrun is reset. Character synchronization is maintained during the Overrun condition. The Overrun indication is reset after the reading of data from the Receive Data Register or by a Master Reset. 219 -------------------------------HD6850, HD68A50------------------------------- Parity Error (PE), Bit 6 Clock Inputs The PE flag indicates that the number of "1 "s (highs) in the Separate high impedance TTL compatible inputs are pro- character does not agree with the preselected odd or even vided for clocking of transmitted and received data. Clock parity. Odd parity is defined to be when the total number of frequencies of 1, 16 or 64 times the data rate may be selected. ones is odd. The parity error indication will be present as long as the data character is in the RDR. If no parity is selected, then Transmit Clock (Tx CLK) both the transmitter parity generator output and the receiver The Tx CLK input is used for the clocking of transmitted parity check results are inhibited. data. The transmitter initiates data on the negative transition of the clock. Interrupt Request (IRQ), Bit 7 The IRQ bit indicates the state of the IRQ output, Any Receive Clock (Rx CLK) interrupt condition with its applicable enable will be-indicated The Rx CLK input is used for synchronization of received in this status bit. Anytime the IRQ output is "Low" the- IRQ bit data. (In the -:- 1 mode, the clock and data must be will be "1" to indicate the interrupt or service request status. synchronized externally.) The receiver samples the data on the IRQ is cleared by a read operation to the Receive Data Register positive transition of the clock. or a write operation to the Transmit Data Register. • Serial Input/Output Lines • SIGNAL FUNCTIONS Receive Data (Rx Data) • Interface Signal for MPU The Rx Data line is a high impedance TTL compatible input through which data is received in a serial format. Synchroniza- Bi-Directional Data Bus (0 0 "'0 7 ) tion with a clock for detection of data is accomplished internal- The bi-directional data bus (Do "'D 7 ) allow for data transfer ly when clock rates of 16 or 64 times the bit rate are used. Data between the ACIA and the MPU. The data bus output drivers rates are in the range of 0 to 500 kbps when external are three-state devices that remain in the high impedance (off) synchronization is utilized. state except when the MPU performs an ACIA read operation. Transmit Data (Tx Data) Enable (E) The Tx Data output line transfers serial data to a modem or The Enable signal, E, is a high impedance TTL compatible other peripheral. Data rates in the range of 0 to 500 kbps when input that enables the bus input/output data buffers and clocks external synchronization is utilized. data to and from the ACIA. This signal will normally be a derivative of the HMCS6800 ¢2 Clock. Modem Control The ACIA includes several functions that permit limited ReadlWrite (RIW) control of a peripheral or modem. The functions included are The R/W line is a high impedance input that is TTL CTS, RTS and DCD. compatible and is used to control the direction of data flow through the ACIA's input/output data bus interface. When R/W Clear-to-Send (CTS) is "High" (MPU Read cycle), ACIA output drivers are turned on This high impedance TTL compatible input provides auto- and a selected register is read. When it is "Low", the ACIA matic control of the transmitting end of a communications link output drivers are turned off and the MPU writes into a selected via the modem CTS active "Low" output by inhibiting the register. Therefore, the R/W signal is used to select read-only or Transmit Data Register Empty (TDRE) status bit. write-only registers within the ACIA. Chip Select (eS o , CS 1 , CS 2 ) Request-to-Send (RTS) These three high impedance TTL compatible input lines are The RTS output enables the MPU to control a peripheral or used to address the ACIA. The ACIA is selected when CSo and modem via the data bus. The RTS output corresponds to the CS 1 are "High" and CS2 is "Low". Transfers of data to and state of the Control Register bits CR5 and CR6. When CR6=O from the ACIA are then performed under the control of the or both CR5 and CR6=1, the RTS output is "Low" (the active Enable signal, Read/Write, and Register Select. state). This output can also be used for Data Terminal Ready (OTR). Register Select (RS) The RS line is a high impedance input that is TTL Data Carrier Detect (DCD) compatible. A "High" level is used to select the Transmit/ This high impedance TTL compatible input provides auto- Receive Data Registers and a "Low" level the Control/Status matic control, such as in the receiving end of a communications Registers. The R/W signal line is used in conjunction with link by means of a modem DeD output. The DCD input inhibits Register Select to select the read-only or write-only register in and initializes the receiver section of the ACIA wheri "High". A each register pair. "Low" to "High" transition of the DCD initiates an interrupt to the MPU to indicate the occurrence of a loss of carrier when the Interrupt Request (IRQ) Receive Interrupt Enable bit is set. IRQ is a TTL compatible, open-drain (no internal- pullup), active "Low" output that is used to interrupt the MPU. The IRQ output remains "Low" as long as the cause of the interrupt is present and the appropriate interrupt enable within the ACIA is set. 220 HD6852,HD68A52 SSDA (Synchronous Serial Data Adapter) The HD6852 Synchronous Serial Data Adapter provides a bi-directional serial interface for synchronous data information interchange. It contains interface logic for simultaneously transmitting and receiving standard synchronous communica- tions characters in bus organized systems such as the HMCS6800 Microprocessor systems. The bus interface of the HD6852 includes select, enable, read/write, interrupt, and bus interface logic to allow data transfer over an 8-bit bi-directional data bus. The parallel data of the bus system is serially transmitted and received by the synchronous data interface with synchronization, fill character, insertion/deletion, and. error checking. The functional con- figuration of the SSDA is programmed via the data bus during system initialization. HD6852P, HD68A52P Programmable control registers provide control for variable word length, transmit control, receive control, synchronization control and interrupt CO!ltrol. Status, timing and control lines provide peripheral or modem control. Typical applications include data communications terminals, floppy'disk controllers, cassette or cartridge tape controllers and numerical control systems. • FEATURES • Programmable Interrupts from Transmitter, Receiver, and Error Detection Logic (DP-24) • Character Synchronization on One or Two Sync Codes • External Synchronization Available for Parallel·Serial Operation • PIN ARRANGEMENT • Programmable Sync Code Register • Up to 600kbps Transmitter • Peripheral/Modem Control Functions • Three Bytes of FIFO Buffering on Both Transmit and Receive • 6, 7, or 8 Bit Data Transmission • Optional Even and Odd Parity • Parity, Overrun, and Underflow Status • Compatible with MC6852 and MC68A52 • BLOCK DIAGRAM CS 10 6 TxOata 24 ill 23 DCO 7 iFiQ (Top View) 0, 17 D. 16 0, 15 REi 9 2 Rx Data 3 Rx elK 5 SM/iS'fR -------------------------------HD6852, HD68A52------------------------------- • ABSOLUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3- +7.0 V Input Voltage Yin * -0.3 - +7.0 V Operating Temperature Topr - 20 - + 75 °c Storage Temperature T stg -55 - +150 °c * With respect to Vss (SYSTEM GND) (NOTE) Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V V 1L * -0.3 - 0.8 V Input Voltage V 1H * 2.0 - Vee V Operating Temperature ToP!' - 20 25 75 °c * With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS (Vee = 5V ± 5%, Vss = OV, Ta = -20-+75°C, unless otherwise noted.) Item Symbol Test Condition min typ* max Unit Input "High" Voltage All Input VIH - 2.0 - - V Input "Low" Voltage All Input VIL - - - 0.8 V IOH = -205 ~A, Do-D 7 V OH 2.4 - - V PW EH , PWEL~ 25~s Output "High" Voltage Tx Data IOH = -100~A, V OH 2.4 - - V DTR,TUF PW EH , PWEL~25~s IOL = 1.6 mA, Output "Low" Voltage All Output VOL - - 0.4 V PW EH , PWEL~25~s TxCLK, RxCLK, Rx Data, E, Input Leakage Current lin Yin = 0 - 5.25V - - 2.5 ~A RES, RS, R/W CS, DCD, CTS Three·State Input Current Yin = 0.4 ..... 2.4V, Do- D7 ITS1 - - 10 ~A (Off State) Vee = 5.25V Output Leakage Current IRO I LOH V OH = 2.4V - - 10 ~A (Off State) Power Dissipation Po - 300 525 mW Do ..... D7 - - 12.5 RxData, RxCLK, Yin = OV, Input Capacitance TxCLK, RES, Ta = 25°C pF Cin - - 7.5 CS, RS, R/W, E, f = 1 MHz DCD,CTS TxData, DTR, TUF, Yin =OV, Ta=25°C - - 10 Output Capacitance Cout pF IRO f = 1 MHz - - 5.0 * Ta = 25"C, vee = 5V 222 -------------------------------HD6852, HD68A52------------------------------- • AC CHARACTERISTICS 2). The Receiver Data Available status bit 226 -------------------------------HD6852, HD68A52------------------------------- (RDA) indicates when data is available to be read from the last Control, Parity Error status bit, and DCD interrupt. The FIFO location (#3) when in the I-byte transfer mode. The Receiver Shift Register is set ones. The Rx Rs bit must be 2-byte transfer mode causes the RDA status bit to indicate data cleared after the occurrence of a "Low" level on RES in order is available when the last two FIFO register locations are full. to enable the receiver section of the SSDA. Data being available in the Receive Data FIFO causes an interrupt request if the Receiver Interrupt Enable (RIE) bit is Transmitter Reset (Tx Rs), Cl Bit 1 set. The MPU will then read the SSDA Status Register, which The Transmitter Reset control bit provides both a reset and will indicate that data is available for the MPU read from the inhibit to the transmitter section. When Tx Rs is set, it clears Receiver Data FIFO register. The IRQ and RDA status bits are the transmitter control section, Transmitter Shift Register, Tx :eset by a read from the FIFO. If more than one character has Data FIFO Control (the Tx Data FIFO can be reloaded after been received and is resident in the Receive Data FIFO, one E clock pulse), the Transmitter Underflow status bit, and subsequent E clocks will cause the FIFO to update and the the CTS interrupt, and inhibits the TDRA status bit (in the RDA and IRQ status bits will again be set. The read data one-sync-character and two-sync-character modes). The Tx Rs operation for the 2-byte transfer mode requires an intervening E bit must be cleared after the occurrence of a "Low" level on clock between reads to allow the FIFO data to shift. Optional RES in order to enable the transmitter section of the SSDA. If parity is automatically checked as data is received, and the the Tx FIFO is not preloaded, it must be loaded mediately parity status condition is maintained with each character until after the Tx Rs release to prevent a transmitter underflow the data is read from the Receive Data FIFO. Parity errors will condition. cause an interrupt request if the Error Interrupt Enable (EIE) has been set. The parity bit is not transferred to the data bus Strip Synchronization Characters (Strip Sync), Cl Bit 2 but must be checked in the Status Register. NOTE: In the If the Strip Sync bit is set, the SSDA will automatically strip 2-byte transfer mode, parity should be chel.:ked prior to reading all received characters which match the contents of the Sync the second byte, since a FIFO read clears the error bit. Code Register. The characters used for synchronization (one or Other status bits which pertain to the receiver section are two characters of sync) are always stripped from the received Receiver Overrun and Data Carrier Detect (DCD). The Overrun data stream. status bit is automatically set when a transfer of a character to the Receive Data FIFO occurs and the first register of the Clear Synchronization (Clear Sync), Cl Bit 3 Receive Data FIFO is full. Overrun causes an interrupt if Error The Clear Sync control bit provides the capability of Interrupt Enable (EIE) has been set. The transfer of the dropping receiver character synchronization and inhibiting overrunning character into the FIFO causes the previous resynchronization. The Clear Sync bit is set to clear and inhibit character in the FIFO input register location to be lost. The receiver synchronization in all modes and is reset to zero to Overrun status bit is cleared by reading the Status Register enable resynchronization. (when the overrun condition is present), followed by a Receive Data FIFO Register read. Overrun cannot occur and be cleared Transmitter Interrupt Enable (TIE), Cl Bit 4 without providing an opportunity to detect its occurrence via TIE enable both the Interrupt Request (IRQ) output and the Status Register. Interrupt Request status bit to indicate a transmitter service A positive transition on the DCD input causes an interrupt if request. When TIE is set and the TDRA status bit is "1 ", the the EIE control bit has been set. The interrupt caused by DCD IRQ output will go "Low" (the active state) and the IRQ status is cleared by reading the Status Register when the DCD status bit will go "1". bit is "1", followed by a Receive Data FIFO read. The DCD status bit will subsequently follow the state of the DCD input Receiver Interrupt Enable (RIE), Cl Bit 5 when it goes "Low". RIE enable both the Interrupt Request output (IRQ) and the Interrupt Request status bit to indicate a receiver service request. When RIE is set and the RDA status bit is "1 ", the IRQ • SSDA REGISTERS output will go "Low" (the active state) and the IRQ status bit Seven registers in the SSDA can be accessed by means of the will go "1 ". bus. The registers are defmed as read-only or write-only according ,to the direction of information flow. The Register Address Control 1 (AC1) and Address Control 2 (AC2), C1 Select (RS) input selects two registers in each state, one being Bits 6 and 7 read-only and the other write-only. The Read/Write (R/W) input ACI and AC2 select one of the write-only registers - Control defmed which of the two selected registers will actually be 2, Control 3, Sync Code, or Tx Data FIFO - as shown in Table accessed. Four registers (two read-only and two write-only) can I, when RS = "High" and R/W = "Low". be addressed via the bus at any particular time. These registers and the required addressing are defined in Table 1. • Control Register 2 (C2) Control Register 2 is an 8-bit write-only register which can be • Control Register 1 (Cl) programmed from the bus when the Address Control bits in Control Register 1 is an 8-bit wirte-only register that can be Control Register 1 (ACI and AC2) are reset, RS = "High" and directly addressed from the data bus. Control Register 1 is R/W= "Low". addressed when RS = "Low" and R/W = "Low". Peripheral Control 1 (PC1) and Peripheral Control 2 (PC2), Receiver Reset (Rx Rs), Cl Bit 0 C2 Bits 0 and 1 The Receiver Reset control bit provides both a reset and Two control bits, PCl and PC2~ermine the operating inhibit function to the receiver section. When Rx Rs is set, it characteristics of the Sync Match/DTR output. PC 1, when clears the receiver control logic, error logic, Rx Data FIFO "High", selects the Sync Match mode. PC2 provides the inhibit/ 227 --------------------------------HD6852, HD68A52-------------------------------- enable control for the SM/DRT output in the Sync Match mode. a character with DCD "Low". Both the transmitter and receiver A one-bit-wide pulse is generated at the output when PC2 is "0", sections operate as parallel - serial converters in the External and a match occurs between the contents of the Sync Code Sync mode. The Clear Sync bit in Control Register 1 acts as a Register and the incoming data· even if sync is inhibited (Clear receiver sync inhibit when "High" to provide a bus controllable Sync bit = "1 "). The Sync Match pulse is referenced to the inhibit. The Sync Code Register can serve as a transmitter fill negative edge of Rx CLK pulse causing the match. character register and a receiver match register in this mode. A The Data Terminal Ready (1jTR) mode is selected when PCl "Low" on the RES input resets the E/[ Sync Mode bit placing is "0". When PC2 = "1" the SM/iTI'R output = "Low" and vice the SSDA [n the internal sync mode. versa. The operation of PC2 and PCl is summarized in Table 4. One-Sync-Character /Two-Sync-Character Mode, Control (1 1-Byte/2-Byte Transfer (1-Byte/2-Byte), C2 Bit 2 Sync/2 Sync), C3 Bit 1 When I-Byte/2-Byte is set, the TDRA and RDA status bits When the 1 Sync/2 Sync bit is set, the SSDA will will indicate the availability if their respective data FIFO synchronize on a single match between the received data and registers for a single byte data transfer. Alternately, if I-Byte/ the contents of the Sync Code Register. When the 1 Sync/2 2-Byte is reset, the TDRA and RDA status bits indicate when Sync bit is reset, two successive sync characters must be two bytes of data can be moved without a second status read. received prior to receiver synchronization. [f the second sync An intervening Enable pulse must occur between data transfers. character is not detected, the bit by bit search resumes from the frrst bit in the second character. See the description of the Sync Word Length Selects (WS1, WS2, WS3), C2 Bits 3, 4, 5 Code Register for more details. Word length Select bits WSl, WS2, and WS3 select word length of 7, 8, or 9 bits including parity as shown in Table 3. Clear CTS Status (Clear CTS), C3 Bit 2 When a "1" is written into the Clear CTS bit, the stored Transmit Sync Code on Underflow (Tx Sync), C2 Bit 6 status and interrupt are cleared. Subsequently, the CTS status When Tx Sync is set, the transmitter will automatically send bit reflects the state of the CTS input. The Clear CTS control a sync character when data is not available for transmission. If bit does not affect the CTS· input nor its inhibit of the Tx Sync is reset, the transmitter will transmit a Mark character transmitter secton. The Clear CTS command bit is self-clearing, (including the parity bit position) on underflow. When the and writing a ''0'' into this bit is a nonfunctional operation. underflow is detected, a pulse approximately a Tx CLK "High" period wide will occur on the underflow output if the Tx Sync Clear Transmit Underflow Status (CTUF), C3 Bit 3 bit is "1". Internal parity generation is inhibited during When a "1" is written into the CTUF status bit, the CTUF underflow except for sync code fill character transmission in 8 bit and its associated interrupt are reset. The CTUF command bit plus parity word lengths. bit is self-clearing and writing a "0" into this bit is a nonfunctional operation. Error Interrupt Enable (EIE), C2 Bit 7 When EIB is set, the IRQ status bit will go "1" and the IRQ • Sync Code Register output will go "Low" if: The Sync Code Register is an 8-bit register for storing the 1) A receiver overrun occurs. The interrupt is cleared by reading programmable sync code required for received data character the Status Register and reading the Rx Data FIFO. synchronization in the one-sync-character and two-sync- 2) DCD input has gone to a "High". The interrupt is cleared by character modes. The Sync Code Register also provides for reading the Status Register and reading the Rx Data FIFO. stripping the sync/fill characters from the received data (a 3) A parity error exists for the character in the last location programmable option) as well as automatic insertion of fill (#3) of the Rx Data FIFO. The interrupt is cleared by characters in the transmitted data stream. The Sync Code reading the Rx Data FIFO. The interrupt is cleared by Register is not utilized for teceiver character synchronization in reading the Rx Data FIFO. the external sync mode; however, it provides storage of receiver 4) The CTS input has gone to a "High". The interrupt is cleared match and transmit fill characters. by writing a "1" in the Clear CTS bit, C3 bit 2, or by a Tx The Sync Code Register can be loaded when AC2 and ACI Reset. are a "1" and "0" respectively, and R/W = "Low" and RS = S) The transmitter has underflowed (in the Tx Sync on "High". Underflow mode). The interrupt is cleared by writing a "1" The Sync Code Register may be changed after the detection into the Clear Underflow, C3 bit 3, or Tx Reset. of a match with the received data (the first sync code having When EIE is a "0", the IRQ status bit and the [RQ output been detected) to synchronize with a double-word sync pattern. are disabled for the above error conditions. A "Low" level on (This sync code change must occur prior to the completion of the RES input resets EIB to "0". the second character.) The sync match (SM) output can be used to interrupt the MPU system to indicate that the first eight bits • Control Register 3 (C3) have matched. The service routine would then change the sync Control Register 3 is a 4-bit write-only register which can be match register to the second half of the pattern. Alternately, the programmed from the bus when RS = "High" and R/W = one-sync-character mode can be used for sync codes for 16 or "Low" and Address Control bit ACI ="1" and AC2 ="0". more bits by using software to check the second and subsequent bytes after reading them from the F[FO. External/Internal Sync Mode Control (E/I Sync), C3 Bit 0 The detection of the sync code can be programmed to appear When the E/[ Sync Mode bit is "1", the SSDA is in the on the Sync Match/DTR output by writing a "1" in PCl (C2 bit external sync mode and the receiver synchronization l0tcg 0) and a "0" in PC2 (C2 bit 1). The Sync Match output will go disabled. Synchronization can be achieved by means of the "High" for one bit time beginning at the character interface input or by starting Rx CLK at the midpoint of data bit "0" of between the sync code and the next character. 228 -------------------------------HD6852, HD68A52------------------------------- • Parity for Sync Character bit. The Overrun bit will be set when the overrun occurs and Transmitter remains set until the Status Register is read, followed by a read Transmitter does not generate parity for the sync character of the Rx Data FIFO. except 9-bit modt. Unused data bits for short word lengths (including the parity 9-bit (8-bit + parity) - 8-bit sync character + parity bit) will appear as "O"s on the data bus when the Rx Data FIFO 8-bit (7-bit + parity) - 8-bit sync character (no parity) is read. 7-bit (6-bit + parity) - 7-bit sync character (no parity) Receiver • Transmit Data First-In First-Out Register At Synchronization (Tx Data FIFO) Receiver automatically strips the sync character(s) (two sync The Transmit Data FIFO Register consists of three 8-bit characters if '2 sync' mode is selected) which is used to establish registers which are used for buffer storage of data to be synchronization. And parity is not checked for these sync transmitted. Each 8-bit register has an internal status bit which characters. monitors its full or empty condition. Data is always transferred After Synchronization is Established from a full register to an adjacent empty register. The transfer is When 'strip sync' bit is selected, the sync characters (ftIl clocked by E pulses. characters) are stripped and parity is not checked for the The TDRA status bit will be "High" if the Tx Data FIFO is stripped sync (fill) characters. When 'strip sync' bit is not available for data. selected (0), the sypc character is assumed to be normal data Unused data bits for short word lengths will be handled as and it is transferred into FIFO after parity checking. (When "don't cares". The parity bit is not transferred over the data non-parity format is selected, parity is not checked.) bus since the SSDA generates parity at transmission. When an Underflow occurs, the Underflow character will be either the contents of the Sync Code Register or an all "l"s character. The underflow will be stored in the Status Register Strip Sync Data Format Operation until cleared and will appear on the Underflow output as a pulse (C1 Bit 2) (C2 Bit 3-5) approximately a Tx CLK "High" period wide. No transfer of sync code. • Status Register 1 x No parity check of The Status Register is an 8-bit read-only register which sync code. provides the real-time status of the SSDA and the associated *Transfer data and serial data channel. Reading the Status Register is a non-destruc- 0 With Parity sync codes. tive process. The method of clearing status bits depends upon Par ity check. the function each bit represents and is discussed for each bit in *Transfer data and the register. () Without Parity sync codes. Receiver Data Available (RDA), S Bit 0 No parity check. The Receiver Data Available status bit indicates when receiver data can be read from the Rx Data FIFO. The receiver * Subsequent to synchronization data being present in the last register (#3) of the FIFO causes x ..... don't care RDA to be "1" for the I-byte transfer mode. The RDA bit being "1" indicates that the last two registers (#2 and #3) are It is necessary to pay attention to the selected sync character full when in the 2-byte transfer mode. The second character can in the following cases. be read without a second status rad (to determine that the 1) Data format is (6 + parity), (7 + parity), character is available). And E pulse must occur between reads of 2) Strip sync is not selected ("0"). the Rx Data FIFO to allow the FIFO to shift. Status must be 3) After synchronization when sync code is used as a ftIl read on a word-by-word basis if receiver data error checking is character. important. The RDA status bit is reset automatically when data Transmitter sends sync character without parity, but receiver is not available. checks the parity as if it is. normal data. Therefore, the sync character should be chosen to match the parity che~k selected Transmitter Data Register Available (TDRA), S Bit 1 for the receiver in this special case. The TDRA status bit indicates that data can be loaded into the Tx Data FIFO Register. The first register (#1) of the Tx • Receive Data First-In First-Out Register Data FIFO being empty will be indicated by a "1" in the TDRA (Rx Data FIFO) status bit in the I-byte transfer mode. The first two registers The Receive Data FIFO Register consists of three 8-bit (#1 and #2) must be empty for TDRA to be "1" when in the registers which are used for buffer storage of received data. Each 2-byte transfer mode. The Tx Data FIFO can be loaded with 8-bit register has an internal status bit which monitors its full or two bytes without an intervening status read; however, one E empty condition. Data is always transferred from a full register pulse must occur between loads. TDRA is inhibited by the Tx to an adjacent empty register. The transfer from register to Reset or RES. When Tx Reset is set, the Tx Data FIFO is register occurs on E pulses. The RDA status bit will be "1" cleared and then released on the next E clock pulse. The Tx when data is available in the last location of the Rx Data FIFO. Data FIFO can then be loaded with up to three characters of In an Overrun condition, the overrunning character will be data, even though TDRA is inhibited. ThiS' feature allows transferred into the full first stage of the FIFO register and will preloading data prior to the release of Tx Reset. A "High" level cause the loss of that data character. Successive overruns on the CTS input inhibits the TDRA status bit in either sync continue to overwite the first register of the FIFO. This mode of operation (one-sync-character or two-sync-character). destruction of data is indicated by means of the Overrun status CTS does not affect TDRA in the external sync mode. This 229 -------------------------------HD6852, HD68A52------------------------------- enables the SSDA to operate under the control of the input crs the Tx Rs bit. TUF indicates that a sync character will be with TDRA indicating the status of the Tx Data FIFO. The crs transmitted as the next character. A TUF is indicated on the input does not clear the Tx Data FIFO in any operating mode. output only when the contents of the Sync Code Register is to be transferred (transmit sync code on underflow = "I"). Data Carrier Detect (DCD), S Bit 2 A positive transition on the DCD input is stored in the SSDA Receiver Overrun (Rx Ovrn), S Bit 5 until cleared by reading both Status and Rx Data FIFO. A "1" Overrun indicates data has been received when the Rx Data written into Rx Rs also clears the stored DCD status. The DCD FIFO is full, resulting in data loss. The Rx Ovrn status bit is set status bit, when set, indicates that the DCD input has gone when Overrun occurs. The Rx Ovrn status bit is cleared by "High", The reading of both Status and Receive Data FIFO reading Status followed by reading the Rx Data FIFO or by allows Bit 2 of subsequent Status reads to indicate the state of setting the Rx Rs control bit. the beD input until the next positive transition. Receiver Parity Error (PE), S Bit 6 Clear-to-8end (CTS), S Bit 3 The parity error status bit indicates that parity for the A positive transiton on the CTS input is stored in the SSDA character in the last register of the Rx Data FIFO did not agree until cleared by writing a "1" into the Clear CTS control bit or with selected parity. The parity error is cleared when the the Tx Rs bit. The CTS status bit, when set, indicates that the character to which it pertains is read from the Rx Data FIFO or CTS input has gone "High". The Clear crs command (a "1" when Rx Rs occurs. The DCD input does not clear the Parity into C3 Bit 2) allows Bit 3 of subsequent Status reads to Error or Rx Data FIFO status bits. indicate the state of the CTS input until the next positive transition. Interrupt Request (iFiQ), S Bit 7 The Interrupt Request status bit indicates when the IRQ Transmitter Underflow (TUF), S Bit 4 output is in the active state (IRQ output = "Low"). The IRQ When data is not available for the transmitter, an underflow status bit is subject to the same interrupt enables (RIE, TIE, and occurs and is so indicated in the Status Register (in the Tx Sync EIB) as the IroJ output. The IRQ status but simplifies status on underflow mode). The underflow status bit is cleared by inquiries for polling systems by providing single bit indication of writing a "1" into the Clear Underflow. (CTUF) control bit or service requests. Table 1 SSDA Programming Model Control* Address Inputs Register Content Register Control RS R/W AC2 AC1 Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Status (S) 0 1 X X Interrupt Receiver Receiver Transmitter Clear-to- Data Carrier Transmitter Receiver Request Parity Overrun Underflow Send Detect Data Data (iRa) Error (Rx Ovrn) (TUF) (CTS) (DCD) Register Available (PE) Available (RDA) (TDRA) Control 1 0 0 X X Address Address Receiver Transmitter Clear Strip Sync Transmitter Receiver (C1) Control 2 Control 1 Interrupt Interrupt Sync Characters Reset Reset (AC2) (AC1) Enable Enable (Strip Sync) (TxRs) (Rx Rs) (RIE) (TIE) *** Receive 1 1 X X 07 06 Os 04 03 O2 01 Do Data ·FIFO Control 2 1 0 0 0 Error Transmit Word Word Word 1-Byte/2-Byte Peripheral Peripheral (C2) Interrupt Sync Code Length Length Length Transfer Control 2 Control 1 Enable on Select 3 Select 2 Select 1 (1-Byte/2-Byte) (PC2) (PC1) (EIE) Underflow (WS3) (WS2) (WS1) (Tx Sync) Control 3 1 0 0 1 Not Used Not Used Not Used Not Used Clear Clear CTS One-Sync- External! (C.;2) Transmitter Status Character! Internal Underflow (Clear CTS) Two-Sync Sync Mode Status Character Control (CTUF) Mode Control (E!I Sync) (1 Sync/ 2 Sync) Sync Cod:* 1 0 1 0 07 06 Os 04 Dg O2 0 0 0_ w** Transmit Data FIFO 1 0 1 1 07 06 Os 04 03 O2 01 00 * 0; "Low" level, 1; "High" level ** "FF" should not be used as Sync Code. *** When the SSDA is used in applications requiring the MSB of data to be receive and transmitted first, the data bus inputs to the SSDA may be reversed (Do to 0 7 , etc.). Caution must be used when this is done since the bit positions in this table will be reversed, and the parity should not be selected. 230 --------------------------------HD6852, HD68A52-------------------------------- Table 2 Functions of SSDA Register Register Bit Symbol Function 7 IRQ The IRQ flag is cleared when the source of the IRQ is cleared. The source is determined by the enables in the Control Registers: TIE, RIE, EIE. t---- PE When parity error is detected in 9 Read Rx Data FIFO, or a "1" into rece ive data. Rx Rs (C1 Bit 0). t---- 5 ----------- Rx Ovrn ~------------------- When receive data FIFO overruns. ~----------------------- Read Status and then Rx Data FI FO, or a "1" into Rx Rs (C1 Bit 0). 4 ---------- TUF When under flow is occurred in t-------------------------- A "1" into CTUF (C3 Bit 3) or into the transm itter. Tx Rs (C1 Bit 1). t---- 3 -65------ ----==--------------- When CTS signal rises. t-----------~----------- A "1" into Clear CTS (C3 Bit 2) or a "1" into Tx Rs (C1 Bit 1) Status --------- Conditions r----------------- When DCD signal rises. Conditions t------------------------ Read Status and then Rx Data FIFO Register 2 DCD for Set for Reset (5) -------------- r-, Byte T;a~sfe~ M;d~;~h-;;;- - - - the transmit data FIFO (#1) or a "1" into Rx Rs (C1 Bit 0) r----------------------- is empty. TDRA ------------------ 2 Byte Transfer Mode; when the Write into Tx Data FIFO. transmit data FIFO (#1, #2) is empty. ------------- r---- - - - - - - - - - - - - - - ~-------------------- 1 Byte Transfer Mode; when the data is received in the receive data FIFO (#3), o RDA r-- -------- ------- Read Rx Data FIFO. 2 Byte Transfer Mode; when the data is received in the receive data FIFO (#2, #31. 7 AC2 Used to access other registers, as shown Table 1. ---~--- --~~~---------------- ------------------------------------------------------------------------------------------------------------------------------------------ 5 RIE When "1", enables interrupt on RDA (5 Bit 0). Control Register 1 :::~::: ::!(~::::::::::::::::: :::~:~~~:~':~~':,:~:~~:~~~~:~~~~~~~~~:~:~:i~~~:(~:~~~:~L:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: (C1) ___ ~ _____ ~I_~~~_ ?X~_~ ___________ '!!_~~_~ _~'_~ :'-,_ ~_I!:~~~ _~~~_~~~~!_ ~_~~!_~~~~:_ os'!. ~_~~:_~~_i_~~~!~_~: _____________________________________________________________________ _ ___ ~ _____ ~_t!_i~ _~~ ~_~ ___________ ~_~~_~ _~'_~ :'-,_ ~:!_i~~ _~~I_ ~~~_~ _~~~_s_ !!_~~_ ~_~~ _~~~~~~~~ _~~~~ _~!~~~_~: _________________________________________________________ _ ____1______ !.~_ ~~ _________________ '!'!.~r:.~ _ :'_~ :>_ !r:.~~~~_ ~~~_ !~_~ !~i:_s_ :_~~_ ~~~_~~~_i::_~~ _~~~:!?~: ____________________________________________________________________ _ o Rx Rs When "1", resets and inhibits the receiver section. 7 EIE When "1 ", enables the PE, Rx Ovrn, TUF, CTS, and DCD interrupt flags (5' Bits 6 through 21. ---~ --- ----------------------- ---i.iiili;';ri -;;,-;;: iilio~~ -Sy~C -c;;d~ -~~;rit~-rit~ -t,; b~- t~~-ri~f~-r-~~d- ;;~- ~~d~~f-I;;~ :-~~-ci -~;'-~bl~; -th~-Ti.i F----- -------------. ---- Tx Sync Status bit and output. When "0", an all mark character is transmitted on underflow. Control 5 WS3 Register 2 4 WS2 Word Length Select (C2) 3 WS1 When "1", enables the TDRA and RDA bits to indicate when a 1-byte transfer can occur; when 2 1-Byte/2-Byte "0", the TDRA and RDA bits indicate when a 2-byte transfer can occur. ~ --- ---- ----- ------. - ----- -_.. - ----- ------- -... -- ---... ------- ------- --. -- ----. -- ------- .... -_.... _................................................................................................................................................. .. 1 PC2 SM/DTR Output Control o PC2 3 CTUF When "1", clears TUF (S Bit 4), and IRQ if enabled. Control ---2--- --Cl~~~-m-------- ---\~ih;;ri-;;,-·;;:~-I~~~~-rn-(S-Bit-3"):~-rid--I-FlQ-if-~-ri~-bi~d.-------------------------·--------------------------------------------- Register 3 (C3) ----,---- --; :s~;rici2:Sy;;~ --- ---Wh~~ -;;1;;'- ~~I~cts- tt;~ -~;.;~:~y-~~-~h~-;~~t~; -~~d~-;-~h-~~-~;O-';: -;~i~~-t; t-h~- t~~:;yh~:~h~~~-~t~~- ~-~d~: ---------------- ---0--- --i:-jj -Sync ---------- ---i.iiiliiiri -;.-,-;;: SE;le~is -ii·ie -exie~ na i -s-y~-~ -mode;- \.';ili;iri -'-'0;'-: siili;~is -ii-ie -i-rit;;r-ri~i -Sy-ric-iTiode: -------------- ---------------- Table 3 Word Length Bit 5 Bit 4 Bit 3 WS3 WS2 WS1 Word Length 0 0 0 6 Bits + Even Parity 0 0 1 6 Bits + Odd Parity 0 1 0 7 Bits 0 1 1 8 Bits 1 0 0 7 Bits + Even Parity 1 0 1 7 Bits + Odd Parity 1 1 0 8 Bits + Even Parity 1 1 1 8 Bits + Odd Parity --------------------------------HD6852, HD68A52-------------------------------- • Register Select (RS) Table 4 SM/OTR Output Control The Register Select line is a high impedance input that is Bit 1 Bit 0 TTL compatible. A "High" level is used to select Control PC2 PCl SM/OTR Output at Pin 5 Registers C2 and C3, the Sync Code Register, and the Transmit/Receive Data Registers. A "Low" level selects the 0 0 "High" Level Control 1 and Status Registers (see Table 1). 0 1 PulseSL1-Bit Wide, on SM 1 0 "Low" Level • Interrupt Request (I RQ) 1 1 SM Inhibited, "Low" IRQ is a TTL compatible, open-drain (no internal pullup), active "Low" output that is used to interrupt the MPU. The RDA'PE IRQ remains "Low" until cleared by the MPU. Rx Ovrn CTS • Reset (RES) DCD The RES input provides a means of resetting the SSDA from TUF an external source. In the "Low" state, the RES input causes TDRA the following: 1) Receiver Reset (Rx Rs) and Transmitter Reset (Tx Rs) bits are set causing both the receiver and transmitter sections to RDA be held in a reset condition. 2) Peripheral Control bits PCl and PC2 are reset to zero, causing the SM/DTR output to be "High". 3) The Ertor Interrupt Enable (EIE) bit is reset. 4) An internal synchronization mode is selected. 5) The Transmitter Data Register Available (TDRA) status bit is • INTERFACE SIGNALS FOR MPU cleared and inhibited. The SSDA interfaces to the HD6800 MPU with an 8-bit When RES returns "High" (the inactive state), the transmit- bi-directional data bus, a chip select line, a register select line, an ter and receiver sections will remain in the reset state until the interrupt request line, read/write line, an enable line, and a reset Receiver Reset and Transmitter Reset bits are cleared via the line. These signals, in conjunction with the HD6800 VMA bus under software control. The control Register bits affected output, permit the MPU to have complete control over the by RES (Rx Rs, Tx Rs, PCl, pc2, BIE, and ElI Sync) cannot be SSDA. cha'"nged when RES is "Low". • Bi-Directional Data Bus (0 0 ""07 ) • CLOCK INPUTS The bi-directional data bus (Do ""0 7 ) allow for data transfer Separate high impedance TTL compatible inputs are pro- between the SSDA and the MPU. The data bus output drivers vided for clocking of transmitted and received data. are three-state devices that remain in the high impedance (off) state except when the MPU performs an SSDA read operation. • Transmit Clock (Tx ClK) The Transmit Clock input is used for the clocking of • Enable (E) transmitted data. The transmitter shifts data on the negative The Enable signal, E, is a high impedance TTL compatible transition of the clock. input that enables the bus input/output data buffers, clocks data to and from the SSDA, and moves data through the FIFO • Receive Clock (Rx ClK) Registers. This signal is normally the continuous HMCS6800 The Receive Clock input is used for clocking in received data. System cp2 clock, so that incoming data characters are shifted The clock and data must be synchronized externally. The through the FIFO. receiver samples the data on the positive transition of the clock. • ReadlWrite (RIW) • SERIAL INPUT/OUTPUT LINES The Read/Write line is a high impedance input that is TTL • Receive Data (Rx Data) compatible and is used to control the direction of data flow The Receive Data line is a high impedance TTL compatible through the SSDA's input/output data bus interface. When input through which data is received in a serial format. Data Read/Write is "High" (MPU read cycle), SSDA output drivers rates are from 0 to 600 kbps. are turned on if the chip is selected and a selected register is read. When it is "Low", the SSDA output drivers are turned off • Transmit Data (Tx Data) and the MPU writes into a selected register. The Read/Write The Transmit Data output line transfers serial data to a signal is also used to select read-only or write-only registeres modem or other peripheral. Data rates are from 0 to 600 kbps. within the SSDA. • PERIPHERAL/MODEM CONTROL • Chip Select (CS) The SSDA includes several functions that permit limited 'This high impedance TTL compatible input line is used to control of a peripheral or modem. The functions included are address the SSDA. The SSDA is selected when CS is "Low". crs, SM/DTR, DCD, and TUF. VMA should be used in generating the CS input to insure that false selects will not occur. Transfers of data to and from the • Clear-to-Send (CTS) SSDA are then performed under the control of the Enable The CTS input provides a real-time inhibit to the transmitter Signal, Read/Write, and Register Select. -------------------------------HD6852, HD68A52------------------------------- section (the Tx Data FIFO is not disturbed). A positive CTS status bit subsequently follows the DCD input when it goes transition resets the Tx Shift Register and inhibits the TDRA "Low". The om input provides character synchronization status bit and its associated interrupt in both the one-sync- timing for the receiver during the external sync mode of character and two-sync~haracter modes of operation. TDRA is operation. The receiver will be initialized and data will be not affected by the CTS input in the external sync mode. sampled on the positive transition of the fust full Receive Clock The positive transition of CTS is stored within the SSDA to cycle after release of I>CD (see Figure 7). insure that its occurrence will be acknowledged by the system. The stored CTS information and its associated IRQ (if enabled) • Sync Mach/Data Terminal Ready (SM/DTR) are cleared by writing a "1" in the Clear CTS bit. The CTS The SM/DTR output provides four functions (see Table 4) status bit subsequently follows the CTS input when it goes depending on the state of the PC1 and PC2 control bits. When "Low". the Sync Match mode is selected (pcl = "1 ", PC2 = "0"), the The CTS input provides character timing for transmitter data output provides a one-bit-wide pulse when a sync code is when in the external sync mode. Transmission is initiated on the detected. This pulse occurs for each sync code match even if the negative transition of the fust full positive clock pulse of the receiver has already attained synchronization. The SM output is transmitter clock (Tx CLK) after the release of CTS (see Figure inhibited when PC2 = "1". The DTR mOde (PC1 = "0") 6). provides an output level corresponding to the complement of PC2 (DTR = "0" when PC2 = "1 ".) (see Table 4.) • Data Carrier Detect (OCD) The DCD input provides a real-time inhibit to the receiver • Transmitter Underflow (TUF) section (the Rx FIFO is not disturbed). A positive DCD The Underflow output indicates the occurrence of a transfer transition resets and inhibits the receiver section except for the of a "fill character" to the Transmitter Shift Register when the Receive FIFO and the RDRA status bit and its associated IRQ. last location (#3) in the Transmit Data FIFO is empty. The The positive transition of 0CI5 is stored within the SSDA to Underflow output pulse is apprOximately a Tx CLK "High" insure that its occurrence will be acknowledged by the system. period wide and occurs during the last half of the last bit of the The stored 0Cij information and its associated fRO (if enabled) character preceding the "Underflow" (see Figure 4). The are cleared by reading the Status Register and then the Receiver Underflow output pulse does not occur when the Tx Sync bit is FIFO, or by writing a "1" into the Receiver Reset bit. The DCD in the reset state. 233 HD4&50B, HD4&50B-1 ADU (Analog Data Acquisition Unit) PRELIMINARY The HD46508 is a monolithic NMOS device with a lO-bit analog-to-digital converter, a programmable voltage comparator, HD46508P, HD46508P-l, HD46508PA, HD46508PA-l a 16-channel analog multiplexer and HMCS6800 microprocessor family compatible interface. Each of 16 analog inputs is either converted to a digital data by the analog-to-digital converter or compared with the speci- fied value by the programmable comparator. The analog-to- digital converter uses successive approximation method as the conversion technique. It's intrinsic resolution is lO bits but it can be 8 bits if the programmer so desires. The programmable voltage comparator compares the input voltage with the value specified by the programmer. The result (greater than, or smaller than) is reflected to the flag in the status register. The device can expand its capability by controlling the external circuits such as sample holder, pre-amplifier and • PIN ARRANGEMENT external multiplexer. AI, With these features, this device is ideally suited to applica- AI, tions such as process control, machine control and vehicle AI, 0, AI, control. 0, AI, 0, AI, • FEATURES 0, AI, 0, AI, • l6-channel Analog multiplexer AI, • Programmable AID Converter resolution (lO-bit or 8-bit) 0, AI, AI IO • Programmable Voltage comparison (PC) Alii • Conversion Time 100tls (AID), l3tls(PC) AI12 • External Sample and Hold Circuit Control All) All .. • Auto Range-switching Control of External Amplifier Alu REF(+) • Waiting Function for the Settling Time of External 2 COMMON Amplifier CDMPIN ......_ _ _ _ _~- REFH • Interrupt Control (Only for AID conversion) • Single +5V Power Supply (Top View) • Compatible with HMCS6800 Bus (The connection with other Asynchronous Buses possible) • BLOCK DIAGRAM • ORDERING INFORMATION ADU Bus Timing Non linearity· Comparator 5V (Vee) r--Input l (COMPIN) --1--------.. " GND (Vss) HD46508PA HD4650BPA-l 1 MHz 1.5 MHz ±1 LSB L ___ Common ..... +-----..., ClK (lMHz) HD4650BP 1 MHz ±3 LSB Output HD4650BP-l 1.5MHz (COMMON) • Specification for 10 bit AID conversion AI, AI, AnllOil Inpull AIlS t-----I--(~; RS. ~--~--~ ~~ L-_ _ _ _ _ _ _ _+--. rna ExterNI Control Signltl (GAINSEL) 5V Analog GND [NOTE J PC Data: Data for programmable voltage ~omparison (REF(+)I (REF(-)I 234 0 0 -0, IRQ ® ClK CD (Reg. 0) BASIC TIMING GENERATOR SUCCESSIVE D/A APPROXIMATION (1024 lADDER REGISTER RESISTANCE & J\) Co) DECODER) (J1 @ PC, GS, GO, G1 @, @ EXPAND ST (Reg. 0, 1) CONTROL (Reg. 0) MODE SELECT & GAINSEl CONTROL loe AI,s COMPARATOR ® 00-03 (Reg. 1) MI GAINSEl REF(+) REF (-) COMPIN COMMON "206": Fixed Data for Auto Range-Switching x 4 "410": Fixed Data for Auto Range-Switching x 2 Figure 1 Internal Block Diagram HD46508, HD46508-1 • ABSO.LUTE MAXIMUM RATINGS Item Symbol Value Unit Supply Voltage Vee * -0.3- +7.0 V Input Voltage Yin * -0.3 - +7.0 V Analog Input Voltage VAin * -0.3 - +7.0 V Operating Temperature Topr - 20- + 75 °c Storage Temperature T stg - 55 - +150 °c With respect to Vss (SYSTEM GNO) * [NOTE] Permanent LSI damage may occur if maximum ratings are exceeded. Normal operation should be under recommended operating conditions. If these conditions are exceeded, it could affect reliability of LSI. • RECOMMENDED OPERATING CONDITIONS Item Symbol min typ max Unit Supply Voltage Vee * 4.75 5 5.25 V Input "High" Voltage V ,H * 2.0 - Vee V Input "low" Voltage V ,L * -0.3 - 0.8 V Analog Input Voltage VAin * 0 - 5.0 V V REF (+) * - 5.0 Vee+ 0 . 25 Reference Voltage V V REF (-) * -0.1 0 - V REF (+) + V REF (-) * Voltage Center of ladder - Vee -2- V~e+0.25 V 2 Operating Temperature Topr - 20 25 75 °c *With respect to Vss (SYSTEM GND) • ELECTRICAL CHARACTERISTICS • DC CHARACTERISTICS <1> (Vee = 5V ± 5%, Ta = -20 -. +75°C, unless otherwise noted.) Item Symbol Test Condition min typ max Unit .Input "High" Voltage V ,H 2.0 - Vee V Input "low" Voltage V ,L -0.3 - 0.8 V Do - D7 IOH = -205J,LA 2.4 - - Output "High" Voltage V OH IOH = -200J,LA 2.4 - - V GAINSEl IOH = -10J,LA Vee -1.0 - - Output "low" Voltage 0 0 -0 7 , GAINSEL IOL = 1.6 mA - - 0.4 VOL V IRO IOL = 3.2 mA - - 0.4 E, ClK, R/W -- Input leakage Current RES, RS o , RS 1 lin Yin = 0- 5.25V - - 2.5 J,LA CSo , CS 1 Three-State (off state) Input Current Do - D7 ITSI Yin = 0.4 - 2.4V - - 10 J,LA Output leakage IRO I LoH VOH = 2.4V - - 10 J,LA Current Power Dissipation Po - - 500 mW Do - D7 - - 12.5 pF E, ClK, R/W Yin = OV, Ta = 25°C Input Capacitance RES, RS o , RS 1 Cin f = 1 MHz - - 10.0 pF CSo , CS 1 Yin = OV, Ta = 25°C Output Ca~acitance IRO, GAINSEl Cout f = 1 MHz - - 10.0 pF 236 HD46508, HD46508-1 • DC CHARACTERISTICS <2> (Vee = 5V ± 5%, Ta = -20'" +75°C, unless otherwise noted.) Item Test Condition min typ max Unit VAin = 5.0V, Analog Multiplexer ON Resistance - - 3 kn. Vee = 4.75V, Ta = 25°C /). ON Resistance Between any 2 VAin = 5.0V, - - 300 n. Channels Vee = 4.75V, Ta = 25°C VAin = 5.0V Vee = 4.75V, Ta = 25°C - 10 100 nA OFF Channel Leakage Current COMMON = OV VAin = OV, Ta = 25°C -100 -10 - nA Vee = 4.75V, COMMON = 5V Analog Multiplexer Input Capacitance - - 7.5 pF Ladder Resistance V REF (+) = 5.0V 10 - 60 kn. (from REF(+) to REF(-)) VREF H = OV, Ta = 25°C • CONVERTER SECTION (Ta = 25°C, Vee = V REF (+) = 5.0V, unless otherwise noted.) 1. 10-BIT AID CONVERSION HD46508PA, HD46508PA-l HD46508P, HD46508P-l Item Unit min typ max min typ max Resolution - 10 - - 10 - bits Non-linearity Error * - ±1/2 ±1 - ±1 ±3 LSB Zero-Error - ±112 ±3/4 - ±1/2 ±1 LSB Full-Scali Error - ±1/4 ±1/2 - ±1/2 ±1 LSB Quantization Error - - ±1/2 - - ±1/2 LSB Absolute Accuracy * - ±1 ±3/2 - ±2 ±4 LSB 2. 8-BIT AID CONVERSION HD46508PA, HD46508PA-l HD46508P, HD46508P-l Item Unit min typ max min typ max Resolution - 8 - - 8 - bits Non-linearity Error * - ±1/8 ±1/4 - ±1/4 ±3/4 LSB Zero-Error - ±1/4 ±3/8 - ±3/8 ±1/2 LSB Full-Scali Error - ±1/4 ±3/8 - ±3/8 ±1/2 LSB Quantization Error - - ±1/2 - - ±1/2 LSB Absolute Accuracy * - ±5/8 ±3/4 - ±3/4 ±5/4 LSB 3. PROGRAMMABLE VOLTAGE COMPARISON (PC) H D46508PA, H D46508PA-l HD46508P, HD46508P-l Item Unit min typ max min typ max Resolution - 8 - - 8 - bits Non-linearity Error * - ±1/8 ±1/4 - ±1/4 ±3/4 LSB Zero-Error - ±1/4 ±3/8 - ±3/8 ±1/2 LSB Full-Scali Error - ±1/4 ±3/8 - ±3/8 ±1/2 LSB Absolute Accuracy * - ±3/8 ±5/8 - ±1/2 ±1 LSB *Temperature Coefficient; 25 ppm of FSRfc (max) 237 HD46508, HD46508-1 • AC CHARACTERISTICS (Ta =-20 "" +7SoC) 1. CLOCK WAVEFORM Test CO* = 0 CO* = 1 Item Symbol Unit Conditions min tYP max min typ max ClK Cycle Time t cvcc 1.0 - 10 0.5 - 5 J.l,s C.LK "High" Pulse Width PW CH 0.45 - 4.5 0.22 - 2.2 J.l,s ClK "low" Pulse Width PWCL Fig. 2 0.40 - 4.0 0.21 - 2.1 J.l,s Rise and Fall Time of tCr, tCf - - 25 - - 25 ns ClK * CD: ClK Divider bit 2.0V ClK O.8V ~-----PWCH--------~tCf~------PWCL--------~ ~----------------------tcvcc--------------------~ Figure 2 ClK Waveform 2. IRQ, GAINSEl OUTPUT Item Symbol Test condition min typ max Unit IRQ Release Time tlR Fig. 3 - - 650 ns t GS01 - - 750 ns GAINSEl Oelay Time Fig.4 tGS02 - - 750 ns tGS01: TTL load tGS 02: CMOS load E tiR/ iRCl _ _ _ _ _ _ _ _ _ _....J _ 2.4V Figure 3 I RQ Release Time 238 HD46508, HD46508-1 - - - - - - - - - - - - - - - ( 1) Sample & Hold ClK " .. - -- - - -- ------- GAINSEl *CMOS load (2) x2, x4 Auto Range-Switching, Programmable Gain ClK O.8V VCCxO.7* ,/ ~/~----------------- *CMOS load Figure 4 GAINSEL Delay Time 2. BUS TIMING CHARACTERISTICS READ OPERATION SEQUENCE HD46508P HD46508P-1 Test HD46508PA HD46508PA-1 Item Symbol Unit Condition min typ max min typ max Enable Cycle Time tcYCE 1.0 - - 0.666 - - J.l.s Enable "High" Pulse Width PWEH 0.45 - - 0.28 - - J.l.s Enable "Low" Pulse Width PWEL 0.40 - - 0.28 - - J.l.s Rise and Fall Time of Enable tErtEf - - 25 - - 25 ns Address Set Up Time tAS Fig. 5 140 - - 140 - - ns Data Delay Time tOOR - - 320 - - 220 ns Data Access Time tACC - - 460 - - 360 ns Data Hold Time tH 10 - - 10 - - ns Address Hold Time tAH 10 - - 10 - - ns 239 HD46508, HD46508-1 - - - - - - - - - - - - - - WRITE OPERATION SEQUENCE HD4650SP HD4650SP·1 Symbol Test HD4650SPA HD4650SPA·1 Item Unit Condition min typ max min typ max Enable Cycle Time t~cE 1.0 - - 0.666 - - IJ,s Enable "High" Pulse Width PW EH 0.45 - - 0.2S0 - - IJ.S Enable "Low" Pulse Width PW EL 0.40 - - 0.2S0 - - IJ,s Rise and Fall Time of Enable tEr,tEf Fig. 6 - - 25 - - 25 ns Address Set Up Time t AS 140 - - 140 - - ns Data Set Up Time tosw 195 - - SO -- - ns Data Hold Time tH 10 - - 10 - - ns Address Hold Time tAH 10 - - 10 - - ns ,....--------tcycE----------~ 2.0V o.sv E ~----PWEL---~ CS 1 R/W, CS o Figure 5 Read Timing 240 HD46508, HD46508-1 ~-------------------tcycE------------------------~ 2.0V E ~--------PWEL------~ CSt. R/W - - - - - , . Figure 6 Write Timing 5.0V 5.0V R Test Point 0----.----.-----+__--. Test Point 0-------<.--.----1...--.... RL R LOAD A IDo-D,. GAINSEL) = 2.4kn r LOAD B (IRQ) RL = 2.4kn j R = 11kn R = 3kn jC = 130pF Diode = lS2074® C = 100pF Diode = lS2074(@ or Equiv. or Equiv. LOAD C (GAINSEL) Figure 7 Test Load 241 HD46508, HD46508-1 - - - - - - - - - - - - - - • SIGNAL DESCRIPTION • Analog Data Interface Analog Input (Alo"'Al ls ) • Processor Interface The Input Analog Data to be measured is applied to thel Data Bus (0 0 "'0 7) Analog Input (Alo -AI IS)' These are multiplexed by intem The Bi-directional data lines (Oo-D 7 ) allow data transfer 16 channel multiplexer and output to COMMOM pin. , between the ADU and MPU. Data bus output drivers are particular input channel is selected when the multiplexE three state buffers that remain in the high-impedance state channel address is programmed into the control Register except when MPU performs a ADU read operation. (Rl). Enable (E) Multiplexer Common Output (COMMON) The Enable signal (E) is used as strobe signal in MPU R/W This signal is the output of the 16 channel analog mult: operation with the ADU internal registers. This signal is plexer, and may be connected to the input of pre-amplifi~ normally derived from the HMCS6800 system clock (lP2 ). or sample/hold circuit according to user's purposes. When n Chip Select (CSo, CSI) external circuit needed, this output should be connected t The Chip Select lines (CS o , CS I ) are used to address the the COMPIN input. ADU. The ADU is selected when CS o is at "High" and CS I is Comparator Input (COMPIN) at "Low" level. This is a high impedance input line that is used to transmi Read/Write (RIW) selected analog data to comparator. The COMMON line i The R/W line controls the direction of data transfer be- usually connected to this input. When external Pre-amplifie tween the ADU and MPU. When R/W is at "High" level, data or Sample/hold circuit is used, output of these circuits rna: of ADU is transferred to MPU. When R/W is at "Low" level, be connected to this input. data of MPU is transferred to ADU. Reference Voltage (+) (REF (+» Register Select (RS o, RS I ) This line is used to apply the standard voltage to the in The Register Select line (RS o , RS I) are used to select one ternalladder resistors. of the 4 ADU internal registers. Table 1 shows the relation Reference Voltage (-) (REF (-» between (RS o , RS I) address and the selected register. The This line is connected to the analog ground. lowest 2 address lines of MPU are usually used for these signals. • ADU Control Reset (RES) Conversion Clock (ClK) This input is used to reset the ADU. An input "Low" level The CLK is a standard clock input signals which define on RES line forces the ADU into following status. internal timing for A/D conversion and PC operation. 1) All the shift-registers in ADU are cleared and the conver- Gain Select (GAINSEl) (CMOS Compatible Output) sion operation is stopped. This output is used to control the pre-amplifier gait 2) All the outputs go down to "Low" level. according to the range of analog input signal. By using thi Interrupt Request (IRQ) (Open Drain Output) output, high accuracy preciSion A/D conversion is possible . This output line is used to inform the AID conversion end signal to the MPU. This signal becomes active "Low" level when IE bit in the control register I is "1" and IRQ bit in [NOTE] This LSI is different from other HMCS6800 famil) the control register 2 goes "1" at the end of conversion. Pro- LSls in flo owing function granunable voltage comparison does not affect this signal. • RES doesn't affect IE bit of RO • FUNCTION OF INTERNAL REGISTERS • Structure Table 1 Internal Registers of the ADU 242 HD46508, HD46508-1 Control Register 0 (RO) "1" "0" Mode Select See Table 2 Not Used Not Used Not Used Settling Time Available Not Available ClK Divider ClK/2 ClK Interrupt Enable* Enable IRQ Mask IRQ Figure 8 Control Register 0 *RES doesn't affect IE bit. Control Register 1 (R1) 17161514131211101 rsc I GS I PC I MI I D3 I D2 I D1 I DO I [I L---_~ MPX Channel Address See Table 3 "1" "0" MPX Inhibit Inhibited Not Inhibited Prog. Comparator Select Prog. Comparator mode AID Converter mode GAINSEl Enable GAINSEl Enable GAINSEl Disable Short-cycle Conversion 8-bit length 10-bit length Figure 9 Control Register 1 Status & AID Data Register (H) "1" "0" L Upper bit (10 bit data) Data Weight See Table 4. Data Over Scale flag Data is over scale Within the scale Not Used Programmable Comparator Output VAin >Vp VAin Vp 1 ENABLE* Output) "0" -+ pea VAin < Vp 1 x PROG. COMP (8 bit) x DISABLE VAin: Analog Input x = Do not care Voltage to be * = See Table 6 compared [NOTE] CD bit and ST bit are effective in every case. Vp : Programmed Voltage (R4) Status & AID Data Register (H) (R2) This register is a 7 -bit read only register that is used to BSY bit This bit indicates that the ADU is now store the upper 2-bit data (C8, C9), data weight (DW), data (Busy) under conversion. overscale (OV), programmable comparator output (PCO), busy (BSY) and interrupt request(IRQ). IRQ bit This bit is set when the AID conversion (Interrupt has completed and cleared by reading (C8, C9) These bits store upper 2-bit data mea- Request) the R3. (Upper bit data) sured by 10 bit length conversion. AID Data Register (L) (R3) DWbit This bit indicates data weight when This register is an 8-bit read-only register that is used to (Data weight) Auto range-switching mode is selected. store the lower 8 bits data of lO-bit conversion or full 8 bits This bit is set or reset when the con- data of the 8-bit conversion. version has completed. The conditions PC Data Register (R4) are shown in following Table. This register is an 8-bit write-only register prepared for In this mode GAINSEL output also goes Programmable Voltage comparison. Stored data is converted "High" or "Low" on the same condi- to digital voltage, and compared with analog input to be tion shown in Table 5. measured. The result of comparison is set into PCO bit. Other status of DW bit is shown in Table 6. Table 5 Data Weight (OW) Set or Reset Condition ~ Mode 410 Set ("1") 410 Reset ("0") Auto Range-Switching (x2) VA"In < 1024 _ . VREF ()+ VAin> 1024 • V REF (+) Auto Range-Switching (x4) V " < 206 • V V " > 206 • V Am 1024 REF(+) Aln 1024 REF(+) VAin : Analog Input Voltage to be measured VREF(+) : Voltage Applied to REF(+) READ READ WRITE WRITE Reg. 2 Reg. 3 ,Reg. ~ Reg: I , I , I I , I I I I I I I I , I , _ I': i: ' ~ ~ I R~~.CS,,~ I : I --~ i ~.:.:~;n;H:~;tmmm~~~~~~~~~~~~~~~~~~~~~.~~~~~~~~~~~~~~ ~~ g~;~t~lro~ mOl (Rl) \ K j ) .I I. I. % C ~ CD CIt ClK o I\) ~ !» m.~ . % g~~I~erslor MSB(29) 28 ~~ lSB(20 ) ~ C ~ CD CIt ~~~06ut ~) L I II o CD .!.. H 1 Conversion end ===~------------------------~I:l==~: BSy _ _ _ _ _....... IRQ Status & AID ~:;~ Register (H)~ AID Data .~~",~~ 7;~;ster (l) WdW~ Figure 13 AID Conversion Timing Chart (Basic Sequence) HD46508, HD46508-1 - - - - - - - - - - - - - - - • AID Conversion and PC sequence (1'c:yc=1tL s) 10 bits AID Conversion Conversion Start Conversion End 1) Basic Sequence SC = ( ST = "0" "0") 2° (LSB) GS= "0" 2) Basic Sequence (When overscale is detected) Overscale check Cycle (Analog Input is com- pared with V REF (+).) 3) Expanded Sequence SC = ( ST = "1" "0") GS= "0" MSB cycle is expanded to compensate external amplifier's settling delay. 4) Auto Range- Switching Control Sequence SC = "0" ST = "0" GS = "1" ~---- Auto Range- switching cycle GO= "0" (G1 = "1") (Analog Input is compared with 1/2 V REF (+) or 1/4 V REF (+) at this cycle) or ( GO = "1") G1 = "0" 5) Auto Range- a) Analog Input < 1/2 V REF (+) or 1/4 V REF (+) Switching & Expansion Control .-----~ "GAINSEL" goes "High" Sequence SC = "0" ST = "1" GS = "1" 1"",,a.u.;~~~~~L:.:.:=':'+-_--+_---.JL-_...L._--L_---.JL-_..L._--L_--.JL.:.:=.:..J GO= "0" (G1="1") or b) Analog Input> 1/2V REF (+) or 1/4VREF (+) 6) Sample & Hold Control Sequence ~~: ::~::) ( GS = "1" GO = "0" G1 = "0" 247 HD46508, HD46508-1 7) Programmable Gain Control "GAINSEL" always goes "High" Sequence ~~: ::~::) ( GS= "1" GO= "1" Gl = "1" 8) Programmable Gain & Expansion Control Sequence ST = SC = "1" GS= "1" "0") ( GO= "1" Gl ="1" 8 Bit AID Conversion 1) Basic Sequence ~~: ::~::) ( GS= "0" Additional conversion cycle for rounding the LSB - 1 Bit . 2) Expanded Sequence ./. SC = "1") ( ST = "1" GS= "0" Programmable Voltage Comparison 1) Basic Sequence PC = "1") ~ ~ (. ST = "0" 2) Expanded Sequence ( PC = "1") ST = "1" • HOW TO USE THE ADU 1) Auto Range-Switching (Auto Gain) Control 2) Programmable Gain control • Functions of GAINSEL 3) Sample & Hold control The ADU is equipped with programmable GAINSEL out- GAINSEL output is controlled by Mode Select bit (GO, put signal. By using GAINSEL output and external circuit, G 1) when GAINSEL enable bit (GS) is "1". the ADU is able to implement following control. Table 6 GAINSEL Control GS Gl GO GAINSEL Control Mode OW 0 x x "Low" Normal Use (GAINSEL is not used) 0 1 0 0 "High" Sample & Hold control 0 1 0 1 * Auto Range Switching x 2 control ** 1 1 0 * Auto Range Switching x 4 control ** 1 1 1 "High" Programmable Gain control 1 • GAINSEL goes "High" or "Low" according to the condition shown in Table 5. See, Table 5. 248 HD46508, HD46508-1 • Additional Circuits for GAINSEL Use x1, x4 Auto/Pragrammable Gain +8V Voo HD10466 OR Eav r I 20k I I I I I I I L' GAIN REF (-) COMPIN COMMON Vss SEL ADU Figure 14 Pre-amplifier Circuit (x1, x4 Auto-Range Switching) OV DATA NOTE 0 11 ............ 1 NOT OVERSCALE x1 Sample & Hold 1 11 ............ 1 OVERSCALE +8V HA 17902 __---4t--~ HD14066 Figure 16 Overscale Check Flow OR EDV. r------------------- I ideal transition 2 n -1 111: , (/) UJ Cl 1101 , : overseale area I of t~e ADU 8 101 1 ...J ,I ,I COMMON Vss GAINSEL REF(-) COMPIN ~ 100, I (!) I I , ,, (5 011' ADU I I- 010' ::::> c.. I- I I ,I ::::> 001, I o , I I Figure 15 Sample & Hold Circuit 8/8 oversea Ie refers voltage ~WV\jt.-v\MIWM~.".."'lNlr+'I/IA.,.....VVv......_'\I\I\r_+-_. @ I "'" ~~ I-@ .~ l~ """ '<>' ~ r-- Cll< / -~ ~~ I'-- ~ '---- . >@-o ~-----! @).. -@. .@.. ~---- r-~ ~ 'C' ~---- I-~ ~J@~ ~@ ~f®--t ~ ~r- lI- I - - ~.lJDS Read Cye Ie ~---- ~IL@ I--®" ,. ~ ,.... ~ lOS. ODS Write CyeIe ~--- ~@ 18 I-@":"'" R/W Read Cye Ie ~--- ~1- ~3- ...@- """ """ R/WWritl CyeIe r-@-'" ~--- (f)- I +-- ... ~ .. ISla Date Out 11 Asynchronous Inpu ts Note r-------- @-=1 ~ I-- 1>------ , HALT. RES IInput 1-------------------- M@ - r------- ~ R ______________________ ~ I-- J ~ ~ K------------- --------~ "'" ~ Aill .J "'" "'" ] Date in---- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ~ J--- [NOTE) 1. Setup time for the asynchronous inputs BERR, ~. SR, DTACK, IPLo -IPL • and VPA guarantees 2 their recognition at the next falling edge of the clock. 2. Waveform measurements for all inputs and outputs are specified at: logic high'" 2.0 volts, logic low" 0.8 ,,"olts Figure 5 AC Electrical Waveforms 258 These waveforms should only be referenced in regard to the edge-to-edge measurement of the timing specifications. They are not intended as a functional description of the input and output signals. Refer to other functional descriptions and their related diagrams for device operation. Strobes and R/W - - - - - - - - - - - - - - - - - - - - ___ - . I I~ @ ~I BR 1--- ~ CO BGACK 1m L @ 1 t I @I~ t~ i @ 1- J: c en CIC» Q Q Q CLK [NOTE] 1. Setup time for the asynchronous inputs BERR, BGACK, BR, DTACK, IPLo -IPL 2 , and VPA guarantees their recognition at the next falling edge of the clock. 2. Waveform measurements for all inputs and outputs are specified at: logic high = 2.0 volts, logic low = 0.8 ~olts Figure 6 AC Electrical Waveforms - Bus Arbitration -----------------------------------H068000---------------------------------- • DATA ORGANIZATION AND ADDRESSING CAPABILI- The data types supported by the HD68000 are: bit data, TIES integer data of 8, 16, or 32-bit, 32-bit addresses and binary The following paragraphs describe the data organization and coded decimal data. Each of these data types is put in memory, addressing capabilities of the HD68000. as shown in Figure 8. • OPERAND SIZE • ADDRESSING Operand sizes are defined as follows: a byte equals 8-bits, a Instructions for the HD68000 contain two kinds of inform- word equals 16-bit, and a long word equals 32-bit. The operand ation: the type of function to be performed, and the location of size for each instruction is either explicity encoded in the the operand(s) on which to perform that function. The methods instruction or implicity defined by the instruction operation. used to locate (address) the operand(s) are explained in the All explicit instructions support byte, word or long word following paragraphs. operands. Implicit instructions support some subset of all three Instructions specify an operand location in one of three sizes. ways: Register Specification - the number of the register is • DATA ORGANIZATION IN REGISTERS given in the register field of the instruction. The eight data registers support data operands of 1, 8,16, or Effective Address - use of the different effective address 32-bit. The seven address registers together with the active stack modes. pointer support address operands of 32-bit. Implicit Reference - the definition of certain instructions implies the use of specific registers. • DATA REGISTERS Each data register is 32-bit wide. Byte operands occupy the • INSTRUCTION FORMAT low order 8·bit, word operands the low order 16·bit, and long Instructions are from one to five words in length, as shown in word operands the entire 32-bit. The least significant bit is Figure 9. The length of the instruction and the operation to be addressed as bit zero; the most significant bit is addressed as bit performed is specified by the first word of the instruction which 31. is called the operation word. The remaining words further When a data register is used as either a source or destination specify the operands. These words are either immediate operand, only the appropriate low-order portion is changed; the operands or extensions to the effective address mode specified remaining high-order portion is neither used nor changed. in the operation word. • ADDRESS REGISTERS • PROGRAM/DATA REFERENCES Each address register and the stack pointer is 32-bit wide and The HD68000 separates memory references into two classes: holds a full 32-bit address. Address registers do not support byte program references, and data references. Program references, as sized operands. Therefore, when an address register is used as a the name implies, are references to that section of memory that source operand, either the low order word or the entire long contains the program being executed. Data references refer to word operand is used depending upon the operation size. When that section of memory that contains data. Generally, operand an address register is used as the destination operand, the entire reads are from the data space. All operand writes are to the data register is affected regardless of the operation size. If the space. operation size is word, any other operands are sign extended to 32-bit before the operation is performed. • REGISTER SPECIFICATION The register field within an instruction specifies the register • DATA ORGANIZATION IN MEMORY to be used. Other fields within the instruction specify whether Bytes are individually addressable with the high order byte the register selected is an address or data register and how the having an even address the same as the word, as shown in Figure register is to be used. 7. The low order byte has an odd address that is one count higher than the word address. Instructions and multibyte data are accessed only on word (even byte) boundaries. If a long word datum is located at address n (n even), then the second word of that datum is located at address n + 2. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Word 000000 Byte 000000 I Byte 000001 I Word 000002 Byte 000002 Byte 000003 ·· • • 1 • ~ Word FFFFFE Byte FFFFFE J Byte FFFFFF Figure 7 Word Organization In Memory 260 HD68000 Bit Data 1 Byte = a-Bit 7 6 5 4 3 2 0 Integer Data 1 Byte = a-Bit 15 14 13 12 11 10 9 a 6 5 4 3 2 0 Byte 0 Byte 1 IMS' LSBI Byte 2 Byte 3 1 Word = 16-Bit 15 14 13 12 11 10 9 a 6 5 4 3 2 0 Word 0 IMS' Word 1 LSBI Word 2 1 Long Word = 32-Bit 15 14 13 12 11 10 9 a 7 6 5 4 3 2 0 MSB High Order --- Long Word 0- - - - - - - - - - - - - - - Low Order - - - - - - - - - - - - - - -- LSB ---LongWord1---- - --- ---- -- -- - -- - --- - -- --- -- - - -Long Word 2- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Addresses 1 Address = 32-Bit 15 14 13 12 11 10 9 a 7 6 5 4 3 2 o MSB High Order - - - Address 0- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -- Low Order LSB -- - Address 1_ - - - - - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ - ___ Address2. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ MSB = Most Significant Bit LSB = Least Significant Bit Decimal Data 2 Binary Coded Decimal Digits = 1-Byte 15 14 13 12 11 10 9 a 7 6 5 4 3 2 1 0 MSD BCD 0 BCD 1 BCD 2 BCD 3 LSD BCD 4 BCD 5 BCD 6 BCD 7 MSD = Most Significant Digit LSD = Least Significant Digit Figure 8 Data Organization in Memory 261 ------------------------------------ HD68000----------------------------------- • EFFECTIVE ADDRESS Address Register Indirect With Postincement Most instructions specify the location of an operand by using The address of the operand is in the address register specified the effective address field in the operation word. For example, by the register field. After the operand address is used, it is Figure 10 shows the general fonnat of the single effective incremented by one, two, or four depending upon whether the address instruction operation word. The effective address is size of the operand is byte, word, or long word. If the address composed of two 3-bit fields: the mode field, and the register register is the stack pointer and the operand size is byte, the field. The value in the mode field selects the different address address is incremented by two rather than one to keep the stack modes. The register field contains the number of a register. pointer on a word boundary. The reference is classified as a data The effective address field may require additional infonn- reference. ation to fully specify the operand. This additional infonnation, called the effective address extension, is contained in the Address Register Indirect With Predecrement following word or words and is considered part of the The address of the operand is in the address register specified instruction, as shown in Figure 9. The effective address modes by the register field. Before the operand address is used, it is are grouped into three categories: register direct, memory decremented by one, two, or four depending upon whether the addressing, and special. operand size is byte, word, or long word. If the address register is the stack pointer and the operand size is byte, the address is REGISTER DIRECT MODES decremented by two rather than one to keep the stack pointer These effective addressing modes specify that the operand is on a word boundary. The reference is classified as a data in one of the 16 multifunction registers. reference. Data Register Direct Address Register Indirect With Displacement The operand is in the data register specified by the effective This address mode requires one word of extension. The address register field. address of the operand is the sum of the address in the address register and the sign-extended 16-bit displacement integer in the Address Register Direct extension word. The reference is classified as a data reference The operand is in the address register specified by the with the exception of the jump and jump to subroutine effective address register field. instructions. MEMORY ADDRESS MODES Address Register Indirect With Index These effective addressing modes specify that the operand is This address mode requires one word of extension. The in memory and provide the specific address of the operand. address of the operand is the sum of the address in the address register, the signextended displacement integer in the low order Address Register Indirect eight bits of the extension word, and the contents of the index The address of the operand is in the address register specified register. The reference is classified as a data reference with the by the register field. The reference is classified as a data exception of the jump and jump to subroutine instructions. reference with the exception of the jump and jump to subroutine instructions. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Operation Word (First Word Specifies Operation and Modes) Immediate Operand (If Any. One or Two Words) Source Effective Address Extension (If Any. One or Two Words) Destination Effective Address Extension (If Any. One or Two Words) Figure 9 Instruction Format 5 4 3 2 o Effective Address Mode Register Fig 10 Single· Effective-Address Instruction Operation Word General Format 262 HD68000---------------------------------- SPECIAL ADDRESS MODES Table 4 Effective Address Encoding Summary The special address modes use the effective address register field to specify the special addressing mode instead of a register Addressing Mode Mode Register number. Data Register Direct 000 register number Address Register Direct 001 register number Absolute Short Address Address Register Indirect 010 register number This address mode requires one word of extension. The Address Register Indirect with 011 register number address of the operand is the extension word. The 16-bit address Posti ncrement is sign extended before it is used. The reference is classified as a Address Register Indirect with Predecrement 100 register number data reference with the exception of the jump and jump to subroutine instructions. Address Register Indirect with 101 register number Displacement Absolute Long Address Address Register Indirect with Index 110 register number This address mode requires two words of extension. The Absolute Short 111 000 address of the operand is developed by the concatenation of the Absolute Long 111 001 extension words. The high-order part of the address is the first Program Counter with Displacement 111 010 extension word; the low-order part of the address is the second Program Counter with Index 111 011 extension word. The reference is classified as a data reference Immediate or Status Register 111 100 with the exception of the jump and jump to subroutine instructions. Table 5 Implicit Instruction Reference Summary Program Counter With Displacement This address mode requires one word of extension. The Implied address of the operand is the sum of the address in the program Instruction Register (s) counter and the sign-extended 16-bit displacement integer in the Branch Conditional (Bee), Branch Always (BRA) PC extension word. The value in the program counter is the address Branch to Subroutine (BSR) PC,SP of the extension word. The reference is classified as a program Check Register against Bounds (CH K) SSP, SR "-~--.- reference. -- , -' ... - Test Condition, Decrement and Branch (DBee) PC -_._------..- - - Signed Divide (DIVS) SSP,SR Program Counter With Index Unsigned Divide (DIVU) SSP,SR This address mode requires one word of extension. The address is the sum of the address in the program counter, the Jump (JMP) PC sign-extended displacement integer in the lower eight bits of the Jump to Subroutine (JSR) PC,SP extension word, and the contents of the index register. The Link and Allocate (LINK) SP value in the program counter is the address of the extension Move Condition Codes (MOVE CCR) SR word. This reference is classified as a program reference. Move Status Register (MOVE SRI SR Move User Stack Pointer (MOVE USP) USP Immediate Data Push Effective Address (PEA) SP This address mode requires either one or two words of Return from Exceotion (RTE) PC, SP,SR extension depending on the size of the operation. Return and Restore Condition Codes IRTR) PC, SP,SR Byte operation - operand is low order byte of extension Return from Subroutine (RTS) PC,SP word Trap (TRAP) SSP,SR Word operation - operand is extension word Long word operl!-tion - operand is in the two extension Trap on Overflow (TRAPV) SSP,SR words, high-order 16 bits are in the first extension Unlink (UNLK) SP word, low-order 16 bits are in the second extension word. Condition Codes or Status Register • IMPLICIT REFERENCE A selected set of instructions may reference the status Some instructions make implicit reference to the program register by means of the effective address field. These are: counter (PC), the system stack pointer (SP), the supervisor stack AND! toCCR pointer (SSP), the user stack pointer (USP), or the status AND! toSR register (SR). Table 5 provides a list of these instructions and EORI toCCR the registers implied. EORI to SR ORI to CCR • SYSTEM STACK ORI to SR The system stack is used implicitly by many instructions; user stacks and queues may be created and maintained through EFFECTIVE ADDRESS ENCODING SUMMARY the addressing modes. Address register seven (A 7) is the system Table 4 is Ii summary of the effective addressing modes stack pointet (SP). The system stack pointer is either the discussed in the previous paragraphs. supervisor stack pOinter (SSP) or the user stack pointer (USP), depending on the state of the S-bit in th~ status registar. If the S-bit indicates supervisor state, SSP is the active system stack 263 pointer, and the USP cannot be referenced as an address ------------------------------------ HD68000----------------------------------- register. If the S-bit indicates user state, the USP is the active • INTEGER ARITHMETIC OPERATIONS system stack pointer, and the SSP cannot be referenced. Each The arithmetic operations include the four basic operations system stack fills from high memory to low memory. of add (ADD), subtract (SUB), multiply (MUL), and divide (DIY) as well as arithmetic compare (CMP), clear (CLR), and • INSTRUCTION SET SUMMARY negate (NEG). The add and subtract instructions are available The following paragraphs contain an overview of the form for both address and data operations, with data operations and structure of the HD68000 instruction set. The instructions accepting all operand sizes. Address operations are limited to form a set of tools that include all the machine functions to legal address size operands (16 or 32 bits). Data, address, and perform the following operations: memory compare operations are also available. The clear and Data Movement negate instructions may be used on all sizes of data operands. Integer Arithmetic The mUltiply and divide operations are available for signed Logical and unsigned operands using word multiply to produce a long Shift and Rotate word product, and a long word dividend with word divisor to Bit Manipulation produce a word quotient with a word remainder. Binary Coded Decimal Multiprecision and mixed size arithmetic can be accom- Program Control plished using a set of extended instructions. These instructions System Control are: add extended (ADDX), subtract extended (SUBX), sign The complete range of instruction capabilities combined with extend (EXT), and negate binary with extend (NEG X). the flexible addressing modes described previously provide a A test operand (TST) instruction that will set the condition very flexible base for program development. codes as a result of a compare of the operand with zero is also available. Test and set (T AS) is a synchronization instruction • DATA MOVEMENT OPERATIONS useful in multiprocessor systems. Table 7 is a summary of the The basic method of data acquisition (transfer and storage) is integer arithmetic operations. provided by the move (MOVE) instruction. The move instruc- tion and the effective addressing modes allow both address and data manipulation. Data move instructions allow byte, word, Table 7 Integer Arithmetic Operations and long word operands to be transferred from memory to memory, memory to register, register to memory, and register Instruction Operand Size Operation to register. Address move instructions allow word and long word 8,16,32 On + (EA) -+ On operand transfer and ensure that only legal address manipula- (EA) + On -+ EA tions are executed. In addition to the general move instruction ADD (EA) + #Xxx -+ EA there are several special data movement instructions: move 16,32 An + (EA) -+ An multiple registers (MOVEM), move peripheral data (MOVEP), 8,16,32 Ox + Dy + X -+ Ox ADD X exchange registers (EXG), load effective address (LEA), push 16,32 Ax@- + Ay@ -+X-+ Ax@ effective address (PEA), link stack (LINK), unlink stack CLR 8,16,32 0-+ EA (UNLK), and move quick (MOVEQ). Table 6 is a summary of 8,16,32 On - (EA) the data movement operations. (EA) - #xxx CMP Ax@ + - Ay@+ 16,32 An - (EA) Table 6 Data Movement Operations DIVS 32+ 16 On/lEA) -+ On Instruction Operand Size Operation DIVU 32+ 16 Dn/(EA) -+ On EXG 32 Rx.-. Ry 8-+ 16 (Dn)s -+ Dn 16 EXT LEA 32 EA -+ An 16- 32 (On) 16 - Dn 32 An-+ SP@- MULS 16 M 16 - 32 On IE (EA) -+ On LINK - SP-+ An MULU 16_ 16 - 32 On IE (EAl .... On SP + d -+ SP NEG o -.(EA) .... EA 8,16,32 MOVE 8,16,32 (EA)s-+ EAd NEGX 8,16,32 0- (EA) - X - EA (EA) -+ An, On MOVEM 16,32 8,16,32 On - (EA) - On An, On -+ EA lEA) - On -+ EA (EA) -+ On SUB MOVEP 16,32 lEA) - #xxx -+ EA On -+ EA 16,32 An - (EA) - An MOVEQ 8 #xxx ...... On Dx-Dy -X .... Ox SUBX 8,16,32 PEA 32 EA ...... SP@- Ax@ - - Ay@ - - X .... Ax@ SWAP 32 Dn[31 :16) ...... Dn[15:0) TAS 8 lEA) - 0, 1 -+ EA [7) An -+ SP TST 8,16,32 lEA) -0 UNLK - SP@ + ...... An [NOTE] [ ) = bit number [NOTES) s = source d = destination [ ) = bit numbers @ - = indirect with predecrement @ + = indirect with postincrement 264 -----------------------------------HD68000---------------------------------- • LOGICAL OPERATIONS • BIT MANIPULATION OPERATIONS Logical operation instructions AND, OR, EOR, and NOT are Bit manipulation operations are accomplished using the available for all sizes of integer data operands. A similar set of following instructions: bit test (BTST), bit test and set (BSET), immediate instructions (AN 01 , ORI, and EORI) prcvide these bit test and clear (BCLR), and bit test and change (BCHG). logical operations with all sizes of immediate data. Table 8 is a Table 10 is a summary of the bit manipulation operations. (Bit summary of the logical operations. 2 of the status register is Z.) Table 8 Logical Operations Table 10 Bit Manipulation Operations Instruction Operand Size Operation Instruction Operand Size Operation Dn,,(EA)-+ Dn BTST 8.32 - bit of (EA) -+ Z AND 8.16.32 (EA)" Dn -+ EA - bit of (EA) -+ Z (EA)" #Xxx -+ EA BSET 8.32 1 -+ bit of EA Dn v (EA) -+ On - bit of (EA) -+ Z OR 8.16.32 (EA) v Dn -+ EA BClR 8.32 0-+ bit of EA (EA) v #xxx -+ EA - bit of (EA) -+ Z (EA)EIl Dy -+ EA BCHG 8.32 EOR 8.16.32 - bit of (EA) -+ bit of EA (EA) Ell #xxx -+ EA NOT 8.16.32 - (EA) -+ EA [NOTE) - = invert • BINARY CODED DECIMAL OPERATIONS Multiprecision arithmetic operations on binary coded deci- mal numbers are accomplished using the following instructions: • SHIFT AND ROTATE OPERATIONS add decimal with extend (ABCD), subtract decimal with extend Shift operations in both directions are provided by the (SBCD), and negate decimal with extend (NBCD). Table 11 is a arithmetic instructions ASR and ASL and logical shift instruc- summ ary of the binary coded decimal operations. tions LSR and LSL. The rotate instructions (with and without extend) available are ROXR, ROXL, ROR, and ROL. All shift and rotate operations can be performed in either registers or Table 11 Binary Coded Decimal Operations memory. Register shifts and rotates support all operand sizes and allow a shift count specified in the instruction of one to Instruction Operand Size Operation eight bits, or 0 to 63 specified in a data register. Dx lO + Dy,o + X -+ Dx Memory shifts and rotates are for word operands only and ABCD 8 Ax@ -10 + Ay@ -10 + X -+ Ax@ allow only single-bit shifts or rotates. Dx 10 - DYlo - X -+ Dx Table 9 is a summary of the shift and rotate operations. SBCD 8 Ax@ - 10 - Ay@ - 10- X --+ Ax@ NBCD 8 0- (EA)IO - X -+ EA Table 9 Shift and Rotate Operations Instruction Operand Size Operation • PROGRAM CONTROL OPERATIONS Program control operations are accomplished using a series of ~. 1- conditional and unconditional branch instructors and return . ASl 8.16.32 0 instructions. These instructions are summarized in Table 12 . ASR 8.16.32 ~ ~ The conditional instructions provide setting and branching for the following conditions: lSl 8.16.32 §£H- 1- 0 CC CS carry clear carry set LS - low or same LT - less than lSR 8.16.32 0--1 .~ EQ equal MI - minus ROl 8.16.32 ~ . I::J F never true GE - greater or equal NE - not equal PL - plus ROR 8.16.32 q .~ GT - greater than HI - high T VC always true no overflow ROXl 8.16.32 coY. j..fxl-J LE - less or equal VS overflow ROXR 8.16.32 l.j X H .~ • SYSTEM CONTROL OPERATIONS System control operations are accomplished by using privi- leged instructions, trap generating instructions, and instructions that use or modify the status register. These instructions are summarized in Table 13. 265 ----------------------------------HD68000--------------------------------- Table 12 Program Control Operations Instruction Operation Conditional Bee Branch conditionally (14 conditions) 8- and 16-bit displacement DBee Test condition, decrement, and branch 16-bit displacement HD68000 Bus Sec Set byte conditionally (16 conditions) Processor { icroprocesso Status Control Unconditional B'RA Branch always 8- and 16-bit displacement E BR Bus BSR JMP Branch to subroutine 8- and 16-bit displacement Jump HMCS6800{ Peripheral Control VMA -P- BG } Arbitration Control JSR Jump to subroutine BERR ~ System { RES } Interrupt Returns Control HALT Control RTR Return and restore condition codes RTS Return from subroutine Figure 11 Input and Output Signals Table 13 System Control Operations DATA BUS (Do THROUGH 0 15 ) This 16-bit, bidirectional, three-state bus is the general Instruction Operation purpose data path. It can transfer and accept data in either word Privileged or byte length. During an interrupt acknowledge cycle, the RESET Reset external devices external device supplies the vector number on data lines RTE Return from exception STOP Stop program execution Do"'D7' ORI to SR Logical OR to status register MOVE USP Move user stack pointer ASYNCHRONOUS BUS CONTROL ANDI to SR Logical AND to status register Asynchronous data transfers are handled using the following EORI to SR Logical EOR to status register control signals: address strobe, read/write, upper and lower data MOVE EAto SR Load new status register strobes, and data transfer acknowledge. These signals are Trap Generating explained in the following paragraphs. TRAP Trap TRAPV Trap on overflow Address Strobe (AS) CHK Check register against bounds This signal indicates that there is a valid address on the Status Register address bus. ANDI to CCR Logical AND to condition codes EORI to CCR Logical EOR to condition codes ReadIWrite (RIW) MOVE EA to CCR Load new condition codes This signal defmes the data bus transfer as a read or write ORI to CCR Logical OR to condition codes MOVE SR to EA Store status register cycle. The R/W signal also works in conjunction with the upper and lower data strobes as explained in the following paragraph. Upper And Lower Data Strobes (UDS, LOS) • SIGNAL AND BUS OPERATION DESCRIPTION These signals control the data on the data bus, as shown in The following paragraphs contain a brief description of the Table 14. When the R/W line is "High", the processor will read input and output signals. A discussion of bus operation during from the data bus as indicated. When the R/W line is "Low", the the various machine cycles and operations is also given. processor will write to the data bus as shown. • SIGNAL DESCRIPTION Data Transfer Acknowledge (DTACK) The input and output signals can be functionally organized This input indicates that the data transfer is completed. into the groups shown in Figure 11. The following paragraphs When the processor recognizes DTACK during a read cycle, data provide a brief description of the signals and also a reference (if is latched and the bus cycle terminated. When DTACK is applicable) to other paragraphs that contain more detail about recognized during a write cycle, the bus cycle is terminated. the function being performed. BUS ARBITRATION CONTROL ADDRESS BUS (AI THROUGH A 23 ) These three signals form a bus arbitration circuit to deter- This 23-bit, unidirectional, three-state bus is capable of mine which device will be the bus master device. addressing 8 megawords of data. I t provides the address for bus ?peration during all cycles except interrupt cycles. During Bus Request (BR) mterrupt cycles, address lines AI. A2 , and Aj provide informa- This input is wire ORed with all other devices that could be tion about what level interrupt is being serviced while address bus masters. This input indicates to the processor that some lines A4 through A23 are all set to a logic high. other device desires to become the bus master. 266 HD68000 - - - - - - - - - - - - - - - - - Table 14 Data Strobe Control of Data Bus Reset (RES) This bidirectional signal line acts to reset (initiate a system UOS LOS R/W DB~D1S DO~07 initialization sequence) the processor in response to an external High High - No valid data No valid data reset signal. An internally generated reset (result of a RESET Valid data bits Valid data bits instruction) causes all external devices to be reset and the Low Low High 0~7 8~15 internal state of the processor is not affected. A total system Valid data bits reset (processor and external devices) is the result of external High Low High No valid data 0~7 halt and reset signals applied at the same time. Refer to RESET Valid data bits No valid data OPERATION paragraph for additional information about reset Low High High 8-15 operation. Valid data bits Valid data bits Low Low Low 8-15 0-7 Halt (HALT) Valid data bits Valid data bits When this bidirectional line is driven by an external device, it High Low Low 0-7* 0-7 will cause the processor to stop at the completion of the current Valid data bits Valid data bits bus cycle. When the processor has been halted using this input, Low High Low 8-15 8~15* all control signals are inactive and all three-state lines are put in .. are a result of current Implementation and may * These conditions their high-impedance state. Refer to BUS ERROR AND HAL T not appear on future devices. OPERATION paragraph for additional information about the interaction between the halt and bus error signals. When the processor has stopped executing instructions, such Bus Grant (BG) as in a double bus fault condition, the halt line is driven by the This output indicates to all other potential bus master processor to indicate to external devices that the processor has devices that the processor will release bus control at the end of stopped. the current bus cycle. HMCS6800 PERIPHERAL CONTROL Bus Grant Acknowledge (BGACK) These control signals are used to allow the interfacing of This input indicates that some other device has become the synchronous HMCS6800 peripheral devices with the asyn- bus master. This signal cannot be asserted until the following chronous HD68000. These signals are explained in the following four conditions are met: paragraphs. 1. a bus grant has been received 2. address strobe is inactive which indicates that the micro- Enable (E) processor is not using the bus This signal is the standard enable signal common to all 3. data transfer acknowledge is inactive which indicates that HMCS6800 type peripheral devices. The period for this output either memory or the peripherals are not using the bus. is ten HD68000 clock periods (six clocks "Low", four clocks 4. bus grant acknowledge is inactive which indicates that no "High"). other device is still claiming bus mastership. Valid Peripheral Address (VPA) INTERRUPT CONTROL UPl oI IPl l , IPl 2 ) This input indicates that the device or region addressed is a These input pins indicate the encoded priority level of the HMCS 6800 family device and that data transfer should be device requesting an interrupt. Level seven is the highest priority synchronized with the enable (E) signal. This input also while level zero indicates that no interrupts are requested. The indicates that the processor should use automatic vectoring for least significant bit is given in IPLo and the most significant bit an interrupt. Refer to INTERFACE WITH HMCS6800 is contained in IPL2 • PERIPHERALS. SYSTEM CONTROL Valid Memory Address (VMA) The system control inputs are used to either reset or halt the This output is used to indicate to HMCS6800 peripheral processor and to indicate to the processor that bus. errors have devices that there is a valid address on the address bus and the occurred. The three system control inputs are explained in the processor is synchronized to enable. This signal only responds to following paragraphs. a valid peripheral address (VPA) input which indicates that the peripheral is a HMCS6800 family device. Bus Error (BERR) This input informs the processor that there is a problem with PROCESSOR STATUS (FC o , FC 1I FC 2 ) the cycle currently being executed. Problems may be a result of: These function code outputs indicate the state (user or 1. nonresponding devices supervisor) and the cycle type currently being executed, as 2. interrupt vector num ber acquisition failure shown in Table 15. The information indicated by the function 3. illegal access request as determined by a memory manage- code outputs is valid whenever address strobe (AS) is active. ment unit 4. other application dependent errors. CLOCK (ClK) The bus error signal interacts with the halt signal to The clock input is a TTL compatible signal that is internally determine if exception processing should be performed or the buffered for development of the internal clocks needed by the current bus cycle should be retried. processor. The clock input shall be a constant frequency. Refer to BUS ERROR AND HALT OPERATION paragraph for additional information about the interaction of the bus error and halt signals. 267 ----------------------------------- HD68000---------------------------------- Table 15 Function Code Outputs The address and data buses are separate parallel buses used to transfer data using an asynchronous bus structure. In all cycles, FC 2 FC! FC o Cycle Type the bus master assumes responsibility for deskewing all signals it (Underfined, Reserved) issues at both the start and end of a cycle. In addition, the bus Low Low Low master is responsible for deskewing the acknowledge and data Low Low High User Data signals from the slave device. Low High Low User Program The following paragraphs explain the read, write, and Low High High (Undefined, Reserved) read-modify-write cycles. The indivisible read-modify-write High Low Low (Undefined, Reserved) cycle is the method used by the HD68000 for interlocked High Low High Supervisor Data multiprocessor communications. High High Low Supervisor Program [NOTE] The terms assertion and negation will be used ex- High High High Interrupt Acknowledge tensively. This is done to avoid confusion when dealing with a mixture of "active-low" and "active- high" signals. The term assert or assertion is used to indicate that a signal is active or true independent of SIGNAL SUMMARY whether that voltage is "Low" or "High". The term Table 16 is a summary of all the signals discussed in the negate or negation is used to indicate that a signal is previous paragraphs. inactive or false . • BUS OPERATION Read Cycle The following paragraphs explain control signal and bus During a read cycle, the processor receives data from operation during data transfer operations, but arbitration, bus memory or a peripheral device. The processor reads bytes of error and halt conditions, and reset operation. data in all cases. If the instruction specifies a word (or double word) operation. the processor reads both bytes. When the DATA TRANSFER OPERATIONS instruction specifies byte operation, the processor uses an Transfer of data between devices involves the following internal AO bit to determine which byte to read and then issues leads: the data strobe required for that byte. For byte operations, Address Bus Al through A23 when the AO bit equals zero, the upper data strobe is issued. Data Bus Do through 015 When the AO bit equals one, the lower data strobe is issued. Control Signals When the data is received, the processor correctly positions it Table 16 Signal Summary Signal Name Mnemonic Input/Output Active State Three State Address Bus A I -A23 Output High Yes Data Bus 0 0 -0 15 Input/Output High Yes Address Strobe AS Output Low Yes Read-High ReadlWrite Rm Output Yes Write-Low Upper and Lower Data Strobes UDS, LOS Output Low Yes Data Transfer Acknowledge DTACK Input Low No Bu.s Request BR Input Low No Bus Grant BG Output Low No Bus Grant Acknowledge BGACK Input Low No Interrupt Priority Level IPL o , IPL I , IPL2 Input Low No Bus Error BERR Input Low No Reset RES Input/Output Low No* Halt HALT Input/Output Low. No* Enable E Output High No Valid Memory Address VMA Output Low Yes Valid Peripheral Address VPA Input Low No Function Code Output FCo , FC I , FC 2 Output High Yes Clock ClK Input High No Power Input Vee Input - - Ground Vss Input - - * Open dram 268 HD68000--------------------------------- internally. A word read cycle flow chart is given in Figure 12. A byte read cycle flow chart is given in Figure 13. Read cycle timing is BUS MASTER SLAVE given in Figure 14 and Figure 15 details word and byte read cycle operation. Address pevice 1) Set R/W to Read BU,; MASTER SLAVE 2) Place Address on AI - A23 3) Place Function Code on FC o - FC, Address Device 4) Assert Address Strobe (AS) 1) Set R/W to Read 5) Assert Upper Data Strobe (UDS) or Lower 2) Place Address on AI - A'3 Data Strobe (LOS) (based on Ao ) 3) Pillce FUl'lction Code on FC o - FC, 4) Assert A,oj-!ress Strobe (AS) I 5) Assert Up'.r Data Strobe (UDS) and Lower Data Strobe (LOS) t 1) Decode Address 2) Place Data on Do - 0 7 or De - 015 (based on UDS or ~) 3) Assert Data Transfer Acknowledge (DTACK) Decode Address I t 1) 2) Place Data on Do - 015 3) Assert Data Transfer Acknowledge (DiACK) I 1) Latch Data Acquire Data 2) Negate ODS or [l)S" V Acquire Data 3) Negate AS 1) Latch Data 2) Negate 015S and a>s 3) Negate ~ Terminate Cycle 1) Remove Data from Do - 0 7 or De - 0 1 , 2) Negate of ACK Terminate Cycle 1) Remove Data from Do - 015 I 2) Negate of ACK Start Next Cycle Figure 13 Byte Read Cycle Flow Chart Start Next Cycle Figure 12 Word Read Cycle Flow Chart >-< >-< >- AS \ I H \ I H \ >- r- ODS \ I \ I \ r- 05S \ I \ I \ r- R/W \ I OTACK \ I \ I \ r 0 8 -0 15 0 0-°7 < > ) < > ) ( ( >- >- < < FCo -FC 2 :::::>--< H H >- I--- ---- -Read - - - - +- ------ Write - - - - -+- ------- Slow Read - - - - - - ~ Figure 14 Read and Write Cycle Timing Diagram 269 * Internal Signal Only ~ - - - Word Read - - + -- -Odd Byte Read - - + -- Even Byte Read - - ~ Figure 15 Word and Byte Read Cycle Timing Diagram Write Cycle BUS MASTER SLAVE During a write cycle, the processor sends data to memory or a peripheral device. The processor writes bytes of data in all Address Device cases. If the instruction specifies a word operation, the 1) Place Address on AI -A l3 2) Place Function Code on FC o - FC, processor writes both bytes. When the instruction specifies a 3) Assert Address Strobe (AS) byte operation, the processor. uses an internal AO bit to 4) Set R/W to Write determine which byte to write and then issues the data strobe 5) Place Data on Do-DIS required for that byte. For byte operations, when the AO bit 6) Assert Upper Data Strobe (UDS) and equals zero, the upper data strobe is issued. When the AO bit Lower Data Strobe (LDS) equals one, the lower data strobe is issued. A word write cycle flow chart is given in Figure 16. A byte write cycle flow chart is given in Figure 17. Write cycle timing is given in Figure 14 and Figure 18 details word and byte write cycle operation. Read-Modify-Write Cycle 1) Decode Address 2) Store Data on 0 0 -0 15 The read-modify-write cycle performs a read, modifies the 3) Assert Data Transfer Acknowledge data in the arithmetic-logic unit, and writes the data back to the (DTACK) same address. In the HD68000 this cycle is indivisible in that the address strobe is asserted throughout the entire cycle. The I test and set (TAS) instruction uses this cycle to provide meaning- ful communication between processors in a mUltiple processor Terminate 01put Transfer environment. This instruction is the only instruction that uses 1) Negate ~ and iJ)S the read-modify-write cycles and since the test and set instruc- 2) Negate AS tion only operates on bytes, all read-modify-write cycles are 3) Remove Data from Do -0 15 4) Set R/W to ~ead byte operations. A read-modify-write cycle flow chart is given in Figure 19 and a timing diagram is given in Figure 20. I BUS ARBITRATION Bus arbitration is a technique used by master-type devices to Terminate Cycle request, be granted, and acknowledge bus mastership. In its 1) Negate OT ACK simplest form, it consists of: 1. Asserting a bus mastership request. I 2. Receiving a grant that the bus is available at the end of the current cycle. t Start Next Cycle 3. Acknowledging that mastership has been assumed. Figure 21 is a flow chart showing the detail involved in a request from a single device. Figure 22 is a timing diagram for Figure 16 Word Write Cycle Flow Chart the same operations. This technique allows processing of bus requests during data transfer cycles. 270 ------------------------------------H068000----------------------------------- BUS MASTER SLAVE Address Device 1) Place Address on AI -A 23 2) Place Function Code on FC o -FC 2 3) Assert Address Strobe (AS) 4) Set R/W to Write 5) Place Data on Do - 0, or 0 8 - DIS (according to Ao) 6) Assert Upper Data Strobe (UDS) or Lower Data Strobe (LOS) (based on Ao) ~ Input Data 1) Decode Address 2) Store Data on Do -0, if LOS is asserted. Store Data on 0 8 -0 1 S if UDS is asserted. 3) Assert Data Transfer Acknowledge 1) Negate UDS and LOS ~ Terminate Output Transfer 2) Negate AS 3) Remove Data from Do -0, or 0 8 -DIS 4) Set R/W to Read ~ Terminate Cycle 1) Negate DTACK I Start Next Cycle Figure 17 Byte Write Cycle Flow Chart H H ) H H ) A0 * AS~ I \ I \ r UDS \ I \ r LOS \ I \ I ~./\ f\ f\ r DTACK \ I \ I \ r- D'-DIS =:::>--< ) ( > < > 0 0 -0, ::::>-< ) ( > < > FCo -FC 2 )-< H H ) * Internal Signal Only ~ - - - - Word Write - - - -+- --- Odd Byte Write - - --+- --- Even Byte Write - - ~ Figure 18 Word and Byte Write Cycle Timing Diagram 271 ------------------------------------H068000----------------------------------- BUS MASTER SLAVE Address Device 1) Place Address on Al -Au 2) Set R/W to Read 3) Assert Address Strobe (AS) 4) Assert Upper Data Strobe (UDS) or Lower Data Strobe (U>S) Input Data t 1) Decode Address 2) Place Data on Do -0 7 or DB -DIS 3) Assert Data Transfer Acknowledge (DTACK) Acquire Data 1) Latch Data 2) Negate ODS or ~ 3) Start Data Modification I J Terminate Cycle 1) Remove Data from Do -0 7 or 0 8 -0 15 2) Negate l5i"Aa< I t Start Output Transfer 1) Set R/W to Write ' 2) Place Data on Do -0 7 or 0 8 -0 15 3) Assert Upper Data Strobe (D'DS) or Lower Data Strobe (LOS) I Input Data J 1) Store Data on Do -0 7 or Os -0 15 , Terminate Output Transfer 2) Assert Data Transfer Acknowledge (DTACK) 1) Negate UDS or LOS 2) Negate AS' 3) Remove Data from Do -0 7 or 0, -0 15 4) Set R/W to ReadLI_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _- , Terminate Cycle l 1) Negate~ I Start Next Cycle Figure 19 Read-Modify-Write Cycle Flow Chart 272 -------------------------------------HD68000------------------------------------ \ I UDSor LOS \ I \ I R/W \ r- DTACK \ I \ r- Os-D,s < > < >-- 0 0 -0 7 ( > ( >- FC o -FC,-=>--< >-C ~ - - - - - - - - - - -Indivisible Cycle- - - - - - - - - - ~ Figure 20 Read-Modify-Write Cycle Timing Diagram PROCESSOR REQUESTING DEVICE The timing diagram shows that the bus request is negated at the time that an acknowledge is asserted. This type of operation Request the Bus would be true for a system consisting of the processor and one 1) Assert Bus Request (BR) device capable of bus mastership. In systems having a number of I devices capable of bus mastership, the bus request line from t Grant Bus Arbitration each device is wire ORed to the processor. In this system, it is easy to see that there could be more than one bus request being 1) Assert Bus Grant (BG) made. The timing diagram shows that the bus grant signal is negated a few clock cycles after the transition of the acknowl- t Acknowledge Bus Mastership edge (BGACK) signal. However, if the bus requests are still pending, the processor 1) External arbitration determines next bus will assert another bus grant within a few clock cycles after it master was negated. This additional assertion of bus grant allows 2) Next bus master waits for current cycle to external arbitration circuitry to select the next bus master complete 3) Next bus master asserts Bus Grant before the current bus master has completed its requirements. Acknowledge (BGACK) to become new The following paragraphs provide additional information about master the three steps in the arbitration process. 4) Bus master negates BR I Requesting the Bus t Terminate Arbitration External devices capable of becoming bus masters request the bus by asserting the bus request (BR) signal. This is a wire ORed 1) Negate BG (and wait for BGACK to be negated) signal (although it need not be constructed from open collector devices) that indicates to the processor that some external device requires control of the external bus. The processor is t Operate as Bus Master effectively at a lower bus priority level than the external device and will relinquish the bus after it has completed the last bus 1) Perform Data Transfers (Read and Write cycle it has started. cycles) according to the same rules the When no acknowledge is received before the bus request procassor uses. signal goes inactive, the processor will continue processing when t Release Bus Mastership it detects that the bus request is inactive. This allows ordinary processing to continue if the arbitration circuitry responded to 1) Negate BGACK noise inadvertently. Receiving the Bus Grant The processor asserts bus grant (BG) as soon as possible. Re·Arbitrate or Resume Processor Operation Normally this is immediately after internal synchronization. The only exception to this occurs when the processor has made an Figure 21 Bus Arbitration Cycle Flow-Chart internal decision to execute the next bus cycle but has not progressed far enough into the cycle to have asserted the address strobe (AS) signal. In this case, bus grant will not be asserted until one clock after address strobe is asserted to indicate to 273 ------------------------~--------- HD68000---------------------------------- CLK UDS LOS R/W----- DTACK \ BGACK -----~\====~~I \~------I _------------~\====~-I \~____________ Processor - - ¥ - - DMA Device- -+ ---- Processor- - - - - -+- --- -DMA Device- - - Figure 22 Bus Arbitration Cycle Timing Diagram external devices that a bus cycle is being executed. bus error signal. When a bus error signal is received, the The bus grant signal may be routed through a daisy-chained processor has two options: initiate a bus error exception network or through a specific priority-encoded network. The sequence or try running the bus cycle again. processor is not affected by the external method of arbitration as long as the protocol is obeyed. Exception Sequence The bus error exception sequence is entered when the Acknowledgement of Mastership processor receives a bus error signal and the halt pin is inactive. Upon receiving a bus grant, the requesting device waits until Figure 23 is a timing diagram for the exception sequence. The address strobe, data transfer acknowledge, and bus grant sequence is composed of the following elements: acknowledge are negated before issuing its own BGACK. The 1. Stacking the program counter and status register negation of the address strobe indicates that the previous master 2. Stacking the error information has completed its cycle, the negation of bus grant acknowledge 3. Reading the bus error vector table entry indicates that the previous master has released the bus. (While 4. Executing the bus error handler routine address strobe is asserted no device is allowed to "break into" a The stacking of the program counter and the status register is cycle.) The negation of data transfer acknowledge indicates the the same as if an interrupt had occurred. Several additional previous slave has terminated its connection to the previous items are stacked when a bus error occurs. These items are used master. Note that in some applications data transfer acknowl- to determine the nature of the error and correct it, if possible. edge might not enter into this function. General purpose devices The bus error vector is vector number two located at address would then be connected such that they were only dependent $000008. The processor loads the new program counter from on address strobe. When bus grant acknowledge is issued the this location. A software bus error handler routine is then device is bus master until it negates bus grant acknowledge. Bus executed by the processor. Refer to EXCEPTION PROCES- grant acknowledge should not be negated until after the bus SING for additional information. cycle(s) is (are) completed. Bus mastership is terminated at the negation of bus grant acknowledge. Rs-Running the Bus Cycle The bus request from the granted device should be dropped When the processor receives a bus error signal and the halt when bus grant acknowledge is asserted. If bus request is still pin is being driven by an external device, the processor enters asserted after bus grant acknowledge is negated, the processor the re-run sequence. Figure 24 is a timing diagram for re-running performs another arbitration sequence and issues another bus the bus cycle. grant. Note that the processor does not perform any external The processor completes the bus cycle, then puts the address, bus cycles before it re-asserts bus grant. data and function code output lines in the high-impedance state. The processor remains "halted," and will not run another bus BUS ERROR AND HALT OPERATION cycle until the halt signal is removed by external logic. Then the In a bus architecture that requires a handshake from an processor will re-run the previous bus cycle using the same external device, the possibility exists that the handshake might address, the same function codes, the same data (for a write not occur. Since different systems will require a different operation), and the same controls. The bus error signal should maximum response time, a bus error input is provided. External be removed before the halt signal is removed. circuitry must be used to determine the duration between address strobe and data transfer acknowledge before issuing a 274 -------------------------------------HD68000------------------------------------ elK uos------~\ \~------------------------------~/ ~----~\ ,~------- ~---- __ ,~ ·r.-------~ I --------- '''''____ RM ~ OTACR--------------------------------------------------~ ~ \ oa-Ols----S{~~~~~~~~~~~~~~. .-_;:==== 0 ~====== 0 -0, :::>-< ( ~ FC o -FC 2 ~ \ '~----~======= ~,------------------ HALT .. fE-1 nltlate Read +- - - Response Failure- - -+ Bus Error Detection +yele C · -1-..... E- Initiate Termlnates..,....,-- - - - Bus -.- - - rror Stacking Figure 23 Bus Error Timing Diagram eLK ) ( \ I \ I ODS" \ I \ I lOS \ I \ I R/W oTACK ( ) \ r- oa-o,s ( }- 0 0 -0, Fe o -FC 2 ::J-< ( > ) ( >-- >-C < BERR HALT \ / \ I ~ - - - - - Read- - - - +- -- ------;-Halt - - - - - - - - - -+-- ---Rerun- - - - ~ Figure 24 Re-Run Bus Cycle Timing Information 275 HD68000--------------------------------- [NOTE] The processor will not re-run a read-modify-write processor is honoring the halt request, bus arbitration performs cycle. This restriction is made to guarantee that the as usual. That is, halting has no effect on bus arbitration. It is entire cycle runs correctly and that the write opera- the bus arbitration function that removes the control signals tion of a Test-and-Set operation is performed without from the buso ever releasing AS. The halt function and the hardware trace capability allow the hardware debugger to trace single bus cycles or single instruc- Halt Operation with No Bus Error tions at a time. These processor capabilities, along with a The halt input signal to the HD68000 performs a Halt/Run/ software debugging package, give total debugging flexibility. Single-Step function in a similar fashion to the HMCS6800 halt function. The halt and run modes are somewhat self ex- Double Bus Faults planatory in that when the halt signal is constantly active the When a bus error exception occurs, the processor will processor "halts" (does nothing) and when the halt signal is attempt to stack several words containing information about the constantly jnactive the processor "runs" (does something). state of the machine. If a bus error exception occurs during the The single-step mode is derived from correctly timed stacking operation, there have been two bus errors in a row. transitions on the halt signal input. It forces the processor to This is commonly referred to as a double bus fault. When a execute a single bus cycle by entering the "run" mode until the double bus fault occurs, the processor will halt. Once a bus error processor starts a bus cycle then changing to the "halt" mode. exception has occurred, any bus error exception occurring Thus, the single-step mode allows the user to proceed through before the execution of the next instruction constitutes a (and therefore debug) processor operations one bus cycle at a double bus fault. time. Note that a bus cycle which is re-run does not constitute a Figure 25 details the timing required for correct single-step bus error exception, and does not contribute to a double bus operations. Some care must be exercised to avoid harmful fault. Note also that this means that as long as the external interactions between the bus error signal and the halt pin when hardware requests it, the processor will continue to re-run the using the single cycle mode as a debugging tool. This is also true same bus cycle. of interactions between the halt and reset lines since these can The bus error pin also has an effect on processor operation reset the machine. after the processor receives an external reset input. The When the processor completes a bus cycle after recognizing processor reads the vector table after a reset to determine the that the halt signal is active, most three-state signals are put in address to start program execution. If a bus error occurs while the high-impedance state. These include: reading the vector table (or at any time before the first 1. address lines instruction is executed), the processor reacts as if a double bus 2. data lines fault has occurred and it halts. Only an external reset will start a 3. function code lines halted processor. This is required for correct performance of the re-run bus cycle operation. RESET OPERATION Note that when the processor honors a request to halt, the The reset signal is a bidirectional signal that allows either the function codes are put in the high-impedance state (their buffer processor or an external signal to reset the system. Figure 26 is a characteristics are the same as the address buffers). While the timing diagram for reset operations. Both the halt and the reset \ I \ I uos I urs \ \ / R/W \ I \ I DTACK \ I \ r- 0 8 -0 15 ( ) ( >-- 0 0 -0 7 :::>-< ( > ( >-- FC o -FC 2 HALT \ ) I < >-<= ~ - - - -Read- - - - - + ------- Halt - - - - - - + ----- Read - - - - ~ Figure 25 Halt Signal Timing Characteristics 276 ------------------------------------HD68000----------------------------------- ClK Plus 5 Volts Vee t > 100 Milliseconds~,....--------------- RES 1 I HALT 1 ~ t<4 Bus Cycles (2) (3) (4) (5) (6) [NOTES] (1) Internal start-uptime (4) PC High read in here (2) SSP High read in here (5) PC low read in here Bus State Unknown: '#:I::I::X (3) SSP low read in here (6) First instruction fetched here. All Control Signal Inactive. Data Bus in Read Mode: >---< Figure 26 Reset Operation Timing Diagram lines must be applied to ensure' total reset of the processor. interrupt, by a bus error, or by a reset. Exception processing is When the reset and halt lines are driven by an external designed to provide an efficient context switch so that the device, it is recognized as an entire system reset, including the processor may handle unusual conditions. processor. The processor responds by reading the reset vector The halted processing state is an indication of catastrophic table entry (vector number zero, address $000000) and loads it hardware failure. For example, if during the exception process- into the supervisor stack pointer (SSP). Vector table entry ing of a bus error another bus error occurs, the processor number one at address $000004 is read next and loaded into the assumes that the system is unusable and halts. Only an external program counter. The processor initializes the status register to reset can restart a halted processor. Note that a processor in the an interrupt level of seven. No other registers are affected by the stopped state is not in the halted state, nor vice versa. reset sequence. When a RESET sequence is executed, the processor drives • PRIVILEGE STATES the reset pin for 124 clock pulses. In this case, the processor is The processor operates in one of two states of privilege: the trying to reset the rest of the system. Therefore, there is no "user" state or the "supervisor" state. The privilege state effect on the internal state of the processor. All of the determines which operations are legal, is used by the external processor's internal registers and the status register are un- memory management device to control and translate accesses, affected by the execution of a RESET instruction. All external and is used to choose between the supervisor stack pointer and devices connected to the reset line. should be reset at the the user stack pointer in instruction references. completion of the RESET instruction. The privilege state is a mechanism for providing security in a When Vee is initially applied to the processor, an external computer system. Programs should access only their own code reset must be applied to the reset pin for 100 milliseconds. and data areas, and ought to be restricted from accessing information which they do not need and must not modify. • EXCEPTION PROCESSING The privilege mechanism provides security by allowing most The following paragraphs describe the actions of the HD68000 programs to execute in user state. In this state, the accesses are which are outside the normal processing associated with the controlled, and the effects on other parts of the system are execution of instructions. The functions of the bits in the limited. The operating system executes in the supervisor state, supervisor portion of the status register are covered: the has access to all resources, and performs the overhead tasks for supervisor/user bit, the trace enable bit, and the processor the user state programs. interrupt priority mask. Finally, the sequence of memory references and actions taken by the processor on exception SUPERVISOR STATE conditions is detailed. The supervisor state is the higher state of privilege. For instruction execution, the supervisor state is determined by the • PROCESSING STATES S-bit of the status register; if the S-bit is asserted (high), the The HD68000 is always one of three processing states: processor is in the supervisor state. All instructions can be normal, exception, or halted. The normal processing states is executed in the supervisor state. The bus cycles generated by that associated with instruction execution; the memory refer- instructions executed in the supervisor state are classified as ences are to fetch instructions and operands, and to store supervisor references. While the processor is in the supervisor results. A special case of the normal state is the stopped state privilege state, those instructions which use either the system which the processor enters when a STOP instruction is stack pointer implicitly or address register seven explicitly executed. In this state, no further memory references are made. access the supervisor stack pointer. The exception processing state is associated with interrupts, All exception processing is done in the supervisor state, trap instructions, tracing and other exceptional conditions. The regardless of the setting of the S-bit. The bus cycles generated exception may be internally generated by an instruction or by during exception processing are classified as supervisor refer- an usual condition arising during the execution of an instruc- ences. All stacking operations during exception processing use tion. Externally, exception processing can be forced by an the supervisor stack pointer. 277 -----------------------------------HD68000---------------------------------- USER STATE Table 17 Reference Classification The user state is the lower state of privilege. For instruction execution, the user state is determined by the S-bit of the status register; if the S-bit is negated (low), the processor is executing Function Code Output Reference Class instructions in the user state. FC2 FC! FCo Most instructions execute the same in user state as in the 0 0 0 (Unassigned) supervisor state. However, some instructions which have im- 0 0 1 User Data portant system effects are made privileged. User programs are not permitted to execute the STOP instruction, or the RESET 0 1 0 User Program instruction. To ensure that a user program cannot enter the 0 1 1 (Unassigned) supervisor state except in a controlled manner, the instructions 1 0 0 (Unassigned) which modify the whole status register are privileged. To aid in 1 0 1 Supervisor Data debugging programs which are to be used as operating systems, the move to user stack pointer (MOVE USP) and move from 1 1 0 Supervisor Program user stack pointer (MOVE from USP) instructions are also 1 1 1 Interrupt Acknowledge privileged. The bus cycles generated by an instruction executed in user state are classified as user state references. This allows an processing of an exception occurs in four steps, with variations external memory management device to translate the address for different exception causes. During the first step, a tem- and to control access to protected portions of the address space. porary copy of the status register is made, and the status register While the processor is in the user privilege state, those is set for exception processing. In the second step the exception instructions which use either the system stack pointer implicity, vector is determined, and the third step is the saving of the or address register seven explicity, access the user stack pointer. current processor context In the fourth step a new context is obtained, and the processor switches to instruction processing. PRIVILEGE STATE CHANGES Once the processor is in the user state and executing EXCEPTION VECTORS instructions, only exception processing can change the privilege Exception vectors are memory locations from which the state. During exception processing, the current setting of the processor fetches the address of a routine which will handle that S-bit of the status register is saved and the S-bit is asserted, exception. All exception vectors are two words in length (Figure putting the processing in the supervisor state. Therefore, when 27), except for the reset vector, which is four words. All instruction execution resumes at the address specified to process exception vectors lie in the supervisor data space, except for the the exception, the processor is in the supervisor privilege state. reset vector which is in the supervisor program space. A vector number is an eight-bit number which, when multiplied by four, REFERENCE CLASSIFICATION gives the address of an exception vector. Vector numbers are When the processor makes a reference, it classifies the kind generated internally or externally, depending on the cause of of reference being made, using the encoding on the three the exception. In the case of interrupts, during the interrupt function code output lines. This allows external translation of acknowledge bus cycle, a peripheral provides an 8-bit vector addresses, control of access, and differentiation of special number (Figure 28) to the processor on data bus lines DO processor states, such as interrupt acknowledge. Table 17 lists through 07. The processor translates the vector number into a the classification of references. full 24-bit address, as shown in Figure 29. The memory layout for exception vectors is given in Table 18. • EXCEPTION PROCESSING As shown in Table 18, the memory layout is 512 words long Before discussing the details of interrupts, traps, and tracing, (1024 bytes). It starts at address 0 and proceeds through address a general description of exception processing is in order. The 1023. This provides 255 unique vectors; some of these are Word 0 New Program Counter (High) Word 1 New Program Counter (Low) Figure 27 Exception Vector Format Ignored Iv, Iv·1 v, Iv·1 v, Iv, Iv, Iv·1 Where: V 7 is the MSB of the Vector Number Vo is the LSB of the Vector Number Figure 28 Peripheral Vector Number Format 278 ------------------------------------H068000----------------------------------- All Zeroes Figure 29 Address Translated from 8-Bit Vector Number Table 18 Exception Vector Assignment Vector Address Assignment Number(s) Dec Hex Space 0 0 000 SP Reset: Initial SSP - 4 004 SP Reset: Initial PC 2 8 008 SO Bus Error 3 12 OOC SO Address Error 4 16 010 SO Illegal Instruction 5 20 014 SO Zero Divide 6 24 018 SO CHK Instruction 7 28 01C SO TRAPV Instruction ---- 8 32 020 SO Privilege Violation ._-"---- 9 36 024 SO Trace 10 40 028 SO Line 1010 Emulator 11 44 02C SO Line 1111 Emulator 12* 48 030 SO (Unassigned, reserved) 13* 52 034 SO (Unassigned, reserved) 14* 56 038 SO (Unassigned, reserved) 15 60 03C SO Unitialized Interrupt Vector 16-23* 64 04C SO (Unassigned, reserved) 95 05F - 24 96 060 SO Spurious Interrupt 25 100 064 SO Level 1 Interrupt Autovector 26 104 068 SO Level 2 Interrupt Autovector 27 108 06C SO Level 3 Interrupt Autovector 28 112 070 SO Level 4 Interrupt Autovector 29 116 074 SO Level 5 Interrupt Autovector 30 120 078 SO Level 6 Interrupt Autovector 31 124 07C SO Level 7 Interrupt 'Autovector 32-47 128 080 SO TRAP Instruction Vectors 191 08F - 48-63* 192 OCO SO (Unassigned, reserved) 255 OFF - 64-255 256 100 SO User Interrupt Vectors 1023 3FF - * Vector numbers 12, 13, 14, 16 through 23 and 48 through 63 are reserved for future enhancements by Hitachi_ No user peripheral devices should be assigned these numbers. 279 ------------------------------------HD68000----------------------------------- reserved for TRAPS and other system functions. Of the 255, as part of the normal processing of instructions. The TRAP, there are 192 reserved for user interrupt vectors. However, there TRAPV, CHK, and zero divide exceptions are in this group. For is no protection on the first 64 entries, so user interrupt vectors these exceptions, the normal execution of an instruction may may overlap at the discretion of the systems designer. lead to exception processing. Group 0 exceptions have highest priority, while Group 2 KINDS OF EXCEPTIONS exceptions have lowest priority. Within Group 0, reset has Exceptions can be generated by either internal or external highest priority, followed by bus error and then address error. causes. The externally generated exceptions are the interrupts Within Group I, trace has priority over external interrupts, and the bus error and reset requests. The interrupts are requests which in turn takes priority over illegal instruction and privilege from peripheral devices for processor action while the bus error violation. Since only one instruction can be executed at a time, and reset inputs are used for access control and processor there is no priority relation within Group 2. restart. The internally generated exceptions come from instruc- The priority relation between two exceptions determines tions, or from address errors or tracing. The trap (TRAP), trap which is taken, or taken first, if the conditions for both arise on overflow (TRAPV), check register against bounds (CHK) and simultaneously. Therefore, if a bus error occurs during a TRAP divide (DIV) instructions all can generate exceptions as part of instruction, the bus error takes precedence, and the TRAP their instruction execution. In addition, illegal instructions, instruction processing is aborted. In another example, if an word fetches from odd addresses and privilege violations cause interrupt request occurs during the execution of an instruction exceptions. Tracing behaves like a very high priority, internally while the T-bit is asserted, the trace exception has priority, and generated interrupt after each instruction execution. is processed first. Before instruction processing resumes, how- ever, the interrupt exception is also processed, and instruction EXCEPTION PROCESSING SEQUENCE processing commences finally in the interrupt handler routine. Exception processing occurs in four identifiable steps. In the A summary of exception grouping and priority is given in Table first step, an internal copy is made of the status register. After 19. the copy is made, the S-bit is asserted, putting the processor into the supervisor privilege state. Also, the T-bit is negated Table 19 Exception Grouping and Priority which will allow the exception handler to execute unhindered by tracing. For the reset and interrupt exceptions, the interrupt Group Exception Processing priority mask is also updated. Reset In the second step, the vector number of the exception is Exception processing begins at determined. For interrupts, the vector number is obtained by a 0 Bus Error the next minor cycle processor fetch, classified as an interrupt acknowledge. For all Address Error other exceptions, internal logic provides the vector number. Trace This vector number is then used to generate the address of the exception vector. Interrupt Exception processing begins 1 The third step is to save the current processor status, except II/egal before the next instruction for the reset exception. The current program counter value and Privilege the saved copy of the status register are stacked using the supervisor stack pointer. The program counter value stacked TRAP, TRAPV, Exception processing is started usually points to the next unexecuted instruction, however for 2 CHK, bus error and address error, the value stacked for the program by normal instruction execution Zero Divide counter is unpredictable, and may be incremented from the address of the instruction which caused the error. Additional information derming the current context is stacked for the bus • EXCEPTION PROCESSING DETAILED DISCUSSION error and address error exceptions. Exceptions have a number of sources, and each exception has The last step is the same for all exceptions. The new program processing which is peculiar to it. The following paragraphs counter value is fetched from the exception vector. The detail the sources of exceptions, how each arises, and how each processor then resumes instruction execution. The instruction at is processed. the address given in the exception vector is fetched, and normal instruction decoding and execution is started. RESET The reset input provides the highest exception level. The MU LTIPLE EXCEPTIONS processing of the reset signal is designed for system initiation, These paragraphs describe the processing which occurs when and recovery from catastrophic failure. Any processing in mUltiple exceptions arise simultaneously. Exceptions can be progress at the time of the reset is aborted and cannot be grouped according to their occurrence and priority. The Group recovered. The processor is forced into the supervisor state, and o exceptions are reset, bus error, and address error. These the trace state is forced off. The processor interrupt priority exceptions cause the instruction currently being executed to be mask is set at level seven. The vector number is internally aborted, and the exception processing to commence at the next generated to reference the reset exception vector at location 0 minor cycle of the processor. The Group 1 exceptions are trace in the supervisor program space. Because no assumptions can be and interrupt, as well as the privilege violations and illegal made about the validity of register contents, in particular the instructions. These exceptions allow the current instruction to supervisor stack pointer, neither the program counter nor the execute to completion, but preempt the execution of the next status register is saved. The address contained in the first two instruction by forcing exception processing to occur (privilege words of the reset exception vector is fetched as the initial violations and illegal instructions are detected when they are the supervisor stack pointer, and the address in the last two words next instruction to be executed). The Group 2 exceptions occur 2800f the reset exception vector is fetched as the initial program ------------------------------------H068000----------------------------------- counter. Finally, instruction execution is started at the address proceeds with the usual exception processing, saving the in the program counter. The power-up/restart code should be program counter and status register on the supervisor stack. The pointed to by the initial program counter. saved value of the program counter is the address of the The RESET instruction does not cause loading of the reset instruction which would have been executed had the interrupt vector, but does assert the reset line to reset external devices. not been present. The content of the interrupt vector whose This allows the software to reset the system to a known state vector number was previously obtained is fetched and loaded and then continue processing with the next instruction. into the program counter, and normal instruction execution commences in the interrupt handling routine. A flow chart for INTERRUPTS the interrupt acknowledge sequence is given in Figure 30; a Seven levels of interrupt priorities are provided. Devices may timing diagram is given in Figure 31. be chained externally within interrupt priority levels, allowing an unlimited number of peripheral devices to interrupt the PROCESSOR INTERRUPTING DEVICE processor. Interrupt priority levels are numbered from one to seven, level seven being the highest priority. The status register Request Interrupt contains a three bit mask which indicates the current processor priority, and interrupts are inhibited for all priority levels less t Grant Interrupt than or equal to the current processor priority. 1) Compare interrupt level in status register An interrupt request is made to the processor by encoding and wait for current instruction to complete the interrupt request level on the interrupt request.lines; a zero 2) Place interrupt level on AI • A 2 • A3 indicates no interrupt request. Interrupt requests arriving at the 3) Set R/W to read processor do not force immediate exception processing, but are 4) Set function code to interrupt acknowledge made pending. Pending interrupts are detected between instruc· 5) Assert address strobe (AS) tion executions. If the priority of the pending interrupt is lower 6) Assert lower data strobe (LOS) than or equal to the current processor priority, execution I continues with the next instruction and the interrupt exception . f PrOVide Vector Number processing is postponed. (The recognition of level seven is 1) Place vector number of Do -0 7 slightly different, as explained in a following paragraph.) 2) Assert data transfer acknowledge (OTACK) If the priority of the pending interrupt is greater than the I current processor priority, the exception processing sequence is started. First a copy of the status register is saved, and the + Acquire Vector Number priVilege state is set to supervisor, tracing is suppressed, and the 1) Latch vector number processor priority level is set to the level of the interrupt being 2) Negate LOS acknowledged. The processor fetches the vector number from 3) Negate AS the interrupting device, classifying the reference as an interrupt acknowledge and displaying the level number of the interrupt being acknowledged on the address bus. If external logic 1) Negate of ACK requests an automatic vectoring, the processor internally gener- ates a vector number which is determined by the interrupt level number. If external logic indicates a bus error, the interrupt is t . Start Interrupt Processing taken to be spurious, and the generated vector number references the spurious interrupt vector. The processor then Figure 30 Interrupt Acknowledge Sequence Flow Chart H AS \ I \ UOS \ I \ ms \ I \ R/W OTACK \ I OS-015 ( ) 0 0 -0, ( ) FC o -FC 2 ::>-< }-J IPLo -IPL 2 \ r=--- -Read Cycle- - - -+- -- -Vector Number Acquisition - - 4 Figure 31 Interrupt Acknowledge Sequence Timing Diagram 281 -----------------------------------HD68000---------------------------------- Priority level seven is a special case. Level seven interrupts TRACING cannot be inhibited by the interrupt priority mask, thus To aid in program development, the HD68000 includes a providing a "non-maskable interrupt" capability. An interrupt is facility to allow instruction by instruction tracing. In the trace generated each time the interrupt request level changes from state,. after each instruction is executed an exception is forced, some lower level to level seven. Note that a level seven interrupt allowing a debugging program to monitor the execution of the may still be caused by the level comparison if the request level is program under test. a seven and the processor priority is set to a lower level by an The trace facility uses the T-bit in the supervisor portion of instruction. the status register. If the T-bit is negated (oft), tracing is disabled, and instruction execution proceeds from instruction to INSTRUCTION TRAPS instruction as normal. If the T-bit is asserted (on) at the Traps are exceptions caused by instructions. They arise either beginning of the execution of an instruction, a trace exception from processor recognition of abnormal conditions during will be generated after the execution of that instruction is instruction execution, or from use of instructions whose normal completed. If the instruction is not executed, either because an behavior is trapping. interrupt is taken, or the instruction is illegal or privileged, the Some instructions are used specifically to generate traps. The trace exception does not occur. The trace exception also does TRAP instruction always forces an exception, and is useful for not occur if the instruction is aborted by a reset, bus error, or implementing system calls for user programs. The TRAPV and address error exception. If the instruction is indeed executed CHK instructions force an exception if the user program detects and an interrupt is pending on completion, the trace exception a runtime error, which may be an arithmetic overflow or a is processed before the interrupt exception. If, during the subscript out of bounds. execution of the instruction, an exception is forced by that The signed divide (DNS) and unsigned divide (DNU) instruction, the forced exception is processed before the trace instructions will force an exception if a division operation is exception. attempted with a divisor of zero. As an extreme illustration of the above rules, consider the arrival of an interrupt during the execution of a TRAP I LLEGAL AND UNIMPLEMENTED INSTRUCTIONS instruction while tracing is enabled. First the trap exception is Illegal instruction is the term used to refer to any of the processed, then the trace exception, and finally the interrupt word bit patterns which are not the bit pattern of the first word exception. Instruction execution resumes in the interrupt of a legal instruction. During instruction execution, if such an handler routine. instruction is fetched, an illegal instruction exception occurs. Word patterns with bits 15 through 12 equaling 10 10 or BUS ERROR 1111 are distinguished as unimplemented instructions and Bus error exceptions occur when the external logic requests separate exception vectors are given to these patterns to perm it that a bus error be processed by an exception. The current bus efficient emulation. This facility allows the operating system to cycle which the processor is making is then aborted. Whether detect program errors, or to emulate unimplemented instruc- the processor was doing instruction or exception processing, tions in software. that processing is terminated, and the processor immediately begins exception processing. PRIVILEGE VIOLATIONS Exception processing for bus error follows the usual se- In order to provide system security, various instructions are quence of steps. The status register is copied, the supervisor privileged. An attempt to execute one of the privileged state is entered, and the trace state is turned off. The vector instructions while in the user state will cause an exception. The number is generated to refer to the bus error vector. Since the privileged instructions are: processor was not between instructions when the bus error STOP AND (word) Immediate to SR exception request was made, the context, additional inform- RESET EOR (word) Immediate to SR ation is saved on the supervisor stack. The program counter and RTE OR (word) Immediate to SR the copy of the status register are of course saved .. The value MOVE to SR MOVE USP 15 14 13 12 11 10 9 8 7 6 5 4 3 2 o Lower Address Function Code High - - 'Access Address- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _. Low Instruction Register Status Register High ~ - - Program Counter - - - - - - - - - - - - - - - - - - - -- - -- - - - - - - - - - - - Low R/W (read/write): write = 0, read = 1, I/N (instruction/not); instruction = 0, not = 1 Figure 32 Supervisor Stack Order 282 -----------------------------------HD68000---------------------------------- saved for the program counter is advanced by some amount, two to ten bytes beyond the address of the first word of the PROCESSOR SLAVE instruction which made the reference causing the bus error. If Initiate Cycle the bus error occurred during the fetch of the next instruction, 1) The processor starts a normal Read or the saved program counter has a value in the vicinity of the Write cycle current instruction, even if the current instruction is a branch, a jump, or a return instruction. Besides the usual infonnation, the t Define HMCS 6800 Cycle processor saves its internal copy of the first word of the instruction being processed, and the address which was being 1) External hardware asserts Vaidl Peripheral Address (VPA) accessed by the aborted bus cycle. Specific infonnation about the access is also saved: whether it was a read or a write, whether the processor was processing an instruction or not, and t Synchronize With Enable the classification displayed on the function code outputs when 1) The processor monitors Enable (E) until it is the bus error occurred. The processor is processing an instruc- low (Phase 1 ) tion if it is in the nonnal state or processing a Group 2 , 2) The processor asserts Valid Memory Address exception; th.e processor is not processing an instruction if it is (VMA) processing a Group 0 or a Group 1 exception. Figure 32 illustrates how this infonnation is organized on the supervisor stack. Although this information is not sufficient in general to Transfer Data 1) The. per.ipheral waits until E is active and then effect full recovery from the bus error, it does allow software transfers the data diagnosis. Finally, the processor commences instruction process- ing at the address contained in the vector. It is the responsibility of the error handler routine to clean up the stack and detennine + Terminate Cycle where to continue execution. 1) The processor waits until E goes low. If a bus error occurs during the exception processing for a (On a Read cycle the data is latched as bus error, address error, or reset, the processor is halted, and all E goes low internally) processing ceases. This simplifies the detection of catastrophic 2) The processor negates VMA system failure, since the processor removes itself from the 3) The processor negates~, Ol5S, and Ci5S system rather than destroy all memory contents. Only the RESET pin can restart a halted processor. ADDRESS ERROR • Start Next Cycle Figure 33 HMCS6800 Interfacing Flow Chart Address error exceptions occur when the processor attempts to access a word or a long word operand or an instruction at an odd address. The effect is much like an internally generated bus error, so that the bus cycle is aborted, and the processor ceases whatever processing it is currently doing and begins exception processing. After exception processing commences, the se- quence is the same as the for bus error including the • DATA TRANSFER OPERATION information that is stacked, except that the vector number Three signals on the processor provide the HMCS6800 refers to the address error vector instead. Likewise, if an address interface. They are: enable (E), valid memory address (VMA), error occurs during the exception processing for a bus error, and valid peripheral address (VPA). Enable corresponds to the E address error, or reset, the processor is halted. or < X >-< X AS~ 1\ I UOS~ I lOS~ R/W OTACK~ "" \ I r °S-015 --<:::) ( >--< >- 0 0 -0 7 FC o -FC 2 --<:::) X X C >--< K >- >-< E I L VISA \ 1\ r VMA \ I \ r ~ Normal ~ ---1-.. ....J (""'"" - Cvde - ~ - - -HMCS6800 Peripheral Read Cycle- - - -r HMCS6800 Peripheral Write Cycle i Figure 34 HMCS6800 Cycle Operation 284 HD68000 ClK HMCS6800* periPhera~, * 150 ns~ Type B HMCS6800 E Clock Freq. Type E t= 70 ns Type B 180 ns Type A 140 ns Type A 2.0 MHz B 270 ns .Std 140 ns Std HMCS6800 VMA, R/W ...----- 1.5 MHz 1.0MHz A Std HMCS6800 Address 'f(///~/1 ~ !E-- 10 ns HMCS6800* Perir-heral * ~ ~ 10 ns Peripheral * TypeB~180ns~ Type A 220 ns ~ ~ 10 ns HMCS6800· HMCS6800 R"'" D... Std 320 "' r .",.homl 10", --$#//$ I) r - - - - Type B ~peri~~e~:3'* I Type A SO ns Std 195 ns I\) HMCS6S00 Write Data ~~ )~_ _ _ _ _ _ __ % (X) C 01 G) CD o HD6S000 Address >--@"&'»)o---------- o o AS - II!!I VPA ~ HD68000 (S MHz) j.E-200ns~ ~ VMA Write Data HD68000 ClK * Times are expressed for different device clock frequencies. Figure 35 HD68000 to HMCS6800 Peripheral Timing Diagram -----------------------------------H068000---------------------------------- AS UOS LOS Rm--~===---~======================~~ OTACK'---I 08-015~~----------------------------------------- 0-0 ----<:::::>~----------------------------------------- 0 7 FC o -FC 2 )-(}-I '-C O IPL -IPL 2 ~,~::::::::::;---------------~::::::::~~---- E L- VMA VPA~~~~~__~_-_~_\==========\-----------~ \ - _ _ _ _ _ _1r-- _I I- -Normal _1- - - - - ---r- - - - - - - - Autovector Operation - - - - - - -----, Cycle Figure 36 Autovector Operation Timing Diagram Memory If an effective address mode may be used to refer to Table 20 shows the various categories to which each of the memory operands, it is considered a memory address- effective address modes belong. Table 21 is the instruction set ing effective address mode. summary. Alterable If an effective address mode may be used to refer to The status register addressing mode is not permitted unless it alterable (write able) operands, it is considered an is explicitly mentioned as a legal addressing mode. alterable addressing effective address mode. These categories may be combined, so that additional, more Control If an effective address mode may be used to refer to restrictive, classifications may be defined. For example, the memory operands without an associated size, it is instruction descriptions use such classifications as alterable considered a control addressing effective address memory or data alterable. The former refers to those addressing mode. modes which are both alterable and memory addresses, and the Table 20 Effective Addressing Mode Categories Effective Addressing Categories Address Mode Register Data Modes Memory Control Alterable Dn 000 Register number X - - X An 001 Register number - - - X An@ 010 Register number X X X X An@+ 011 Register number X X - X An@- 100 Register number X X - X An@(d) 101 Register number X X X X An@ (d, ix) 110 Register number xxx. W 111 000 X X X X xxx. L 111 001 X X X X PC@(d) 111 010 X X X - PC@ (d, ix) 111 all X X X - #xxx 111 100 X X - - 286 ------------------------------------ HD68000----------------------------------- Table 21 Instruction Set Condition Codes Mnemonic Description Operation X N Z V C ABCD Add Decimal with Extend (Destination)lO + (Source) 10 ~ Destination * U * U * ADD Add Binary (Destination) + (Source) ~ Destination * * * * * ADDA Add Address (Destination) + (Source) ~ Destination - - - - - ADDI Add Immediate (Destination) + Immediate Data ~ Destination * * * * * ADDQ Add Quick (Destination) + Immediate Data ~ Destination * * * * * ADDX Add Extended (Destination) + (Source) + X ~ Destination * * * * * AND AND Logical (Destination A (Source) ~ Destination - * * 0 0 ANDI AND Immediate (Destination) A Immediate Data ~ Destination - * * 0 0 ASL,ASR Arithmetic Shift (Destination) Shifted by ~ Destination * * * * * Bee Branch Conditionally If CC then PC + d ~ PC - - - - - ~«bit number» OF Destination ~ Z BCHG Test a Bit and Change ~ «bit number» OF Destination ~ - - * - - OF Destination ~ «bit number» OF Destination ~ Z BCLR Test a Bit and Clear - - * - - o~ OF Destination BRA Branch Always PC + d ~ PC - - - - - ~«bit number» OF Destination ~ Z BSET Test Bit and Set - - * - - 1 ~ OF Destination BSR Branch to Subroutine PC ~ SP@ -; PC + d ~ PC - - - - -- BTST Test a Bit ~«bit number» OF Destination ~ Z - - * - - CHK Check Register against Bound If Dn <0 or Dn> «ea» then TRAP - * U U U CLR Clear an Operand o ~ Destination - 0 1 0 0 CMP Compare (Destination) - (Source) - * * * * CMPA Compare Address (Destination) - (Source) - * * * * CMPI Compare Immediate (Destination) - Immediate Data - * * * * CMPM Compare Memory (Destination) - (Source) - * * * * Test Condition, DBee Decrement and Branch If ~ CC then Dn -1 ~ Dn; if Dn =f -1 then PC + d ~ PC - - - - - DIVS Signed Divide (Destination)/(Source) ~ Destination - * * * 0 DIVU Unsigned Divide (Destination)/(Source) ~ Destination - * * * 0 EOR Exclusive OR Logical (Destination) @ (Source) ~ Destination - * * 0 0 EORI Exclusive OR Immediate (Destination) @ Immediate Data ~ Destination - * l' 0 0 EXG Exchange Register Rx~Ry - - - - - EXT Sign Extend (Destination) Sign-extended ~ Destination - * * 0 0 JMP Jump Destination ~ PC - - - - - JSR Jump to Subroutine PC ~ SP@ -; Destination ~ PC - - - - - LEA Load Effective Address Destination ~ An - - - - - LINK Link and Allocate An ~ SP@ -; SP ~ An; SP + d ~ SP - - - - - LSL, LSR Logical Shift (Destination) Shifted by ~ Destination * * * 0 * Move Data from Source to MOVE (Source) ~ Destination - * * 0 0 Destination MOVE to Move to Condition Code (Source) ~ CCR * * * * * CCR MOVE to Move to the Status Register (Source) ~ SR * * * * * SR * = Affected 0'" Cleared U = Undefined - = Unaffected 1 = Set 287 HD88000-------------------------------- Table 21 Instruction Set (Cont.) Condition Codes Mnemonic Description Operation X N Z V C MOVE from SR Move from the Status Register SR ~ Destination - - - - - MOVE USP Move User Stack Pointer USP ~ An; An ~ USP - - - - - MOVE.A Move Address (Source) ~ Destination - - - - - Registers ~ Destination MOVEM Move Multiple Registers (Source) ~ Registers - - - - - MOVEP Move Peripheral Data (Source) ~ Destination - - - - - MOVEQ Move Quick Immediate Data -+ Destination - * * 0 0 MULS Signed Multiply (Destination) * (Source) ~ Destination - * * 0 0 MULU Unsigned Multiply (Destination) * (Source) ~ Destination - * * 0 0 NBCD Negate Decimal with Extend o- (Destination) 10 - X ~ Destination * U * U * NEG Negate 0- (Destination) ~ Destination * * * * * NEGX Negate with Extend 0- (Destination) - X ~ Destination * * * * * NOP No Operation - - - - - - NOT Logical Complement '" (Destination) ~ Destination - * * 0 0 OR Inclusive OR Logical (Destination) v (Source) ~ Destination - * * 0 0 ORI Inclusive OR Immediate (Destination) v Immediate Data -+ Destination - * * 0 0 PEA Push Effective Address Destination ~ SP@ - - - - - - RESET Reset External Devices - - - - - - ROL, ROR Rotate (Without Extend) (Destination) Rotated by -+ Destination - * * 0 * ROXL, Rotate with Extend (Destination) Rotated by ~ Destination * * * 0 * ROXR RTE Return from Exception SP@ +-+ SR; SP@ +~ PC * * * * * Return and Restore Condition RTR SP@ +~ CC; SP@+~ PC * * * * * Codes RTS Return from Subroutine SP@+~PC SBCD Subtract Decimal with Extend (Destinationho - (Sourceho - X -+ Destination * U * U * See Set According to Condition If CC then 1's -+ Destination else O's -+ Destination - - - - - STOP Load Status Register and Stop Immediate Data ~ SR; STOP * * * * * SUB Subtract Binary (Destination) - (Source) ~ Destination * * * * * SUBA Subtract Address (Destination) - (Source) -+ Destination - - - - - SUBI Subtract Immediate (Destination) - Immediate Data -+Destination * * * * * SUBQ Subtract Quick (Destination) - Immediate Data -+ Destination * * * * * SUBX Subtract with Extend (Destination) - (Source) - X -+ Destination * * * * * &NAP Swap Register Halves Register [31 :16] ~ Register [15:0] - * 0 0 * TAS Test and Set and Operand (Destination) Tested -+ CC; 1 ~ [7] OF Destination - * 0 0 * TRAP Trap PC ~ SSP@- ; SR ~ SSP@-; (Vector) ~ PC - - - - - TRAPV Trap on Overflow If V then TRAP - - - - - TST Test an Operand (Destination) Tested ~ CC - * * 0 0 UNLK Unlink An ~ SP; SP@+-+ An - - - - - ] .. Bit number 288 ------------------------------------- HD68000------------------------------------ latter refers to addressing modes which are both data and In Table 25, the headings have the following meanings: An = alterable. address register operand, Dn = data register operand, ea = an operand specified by an effective address, and M = memory • INSTRUCTION EXECUTION TIMES effective address operand. The following paragraphs contain listings of the instruction execution times in terms of external clock (eLK) periods. In • IMMEDIATE INSTRUCTION CLOCK PERIODS this timing data, it is assumed that the memory cycle time is no The number of clock periods shown in Table 26 includes the greater than four periods of the external processor clock input, time to fetch immediate operands, perform the operations, store which prevents the insertion of wait states in the bus cycle. The the results, and read the next operation. The number of bus number of bus read and write cycle for each instruction is also read and write cycles is shown in parenthesis as: (R/W). The included with the timing data. This data is enclosed in number of clock periods plus the number of read and write parenthesis following the execution periods and is shown as: cycles must be added to those of the effective address (R/W) where R is the number of read cycles and W is the calculation where indicated. number of write cycles. In Table 26, the headings have the following meanings: # = [NOTE] The number of periods includes instruction fetch and immediate operand, Dn = data register operand, M = memory all applicable operand fetches and stores. operand, and SR =status register. • EFFECTIVE ADDRESS OPERAND CALCULATION • SINGLE OPERAND INSTRUCTION CLOCK PERIODS TIMING Table 27 indicates the number of clock periods for the single Table 22 lists the number of clock periods required to operand instructions. The number of bus read and write cycles compute an instruction's effective address. It includes fetching is shown in parenthesis as: (R/W). The number of clock periods of any extension words, the address computation, and fetching plus the number of read and write cycles must be added to of the memory operand. The number of bus read and write those of the effective address calculation where indicated. cycles is shown in parenthesis as (R/W). Note there are no write cycles involved in processing the effective address. • SHIFT/ROTATE INSTRUCTION CLOCK PERIODS Table 28 indicates the number of clock periods for the shift • MOVE INSTRUCTION CLOCK PERIODS and rotate instructions. The number of bus read and write Table 23 and 24 indicate the number of clock periods for the cycles is shown in parenthesis as: (R/W). The number of clock move instruction. This data includes instruction fetch, operand periods plus the number of read and write cycles must be added reads, and operand writes. The number of bus read and write to those of the effective address calculation where indicated. cycles is shown in parenthesis as: (R/W). • BIT MANIPULATION INSTRUCTION CLOCK PERIODS • STANDARD INSTRUCTION CLOCK PERIODS Table 29 indicates the number of clock periods required for The number of clock periods shown in Table 25 indicates the the bit manipulation instructions. The number of bus read and time required to perform the operations, store the results, and write cycles is shown in parenthesis as: (R/W). The'number of read the next instruction. The number of bus read and write clock periods plus the number of read and write cycles must be cycle is shown in parenthesis as: (R/W). The number of clock added to those of the effective address calculation where periods plus the number of read and write cycles must be added indicated. to those of the effective address calculation where indicated. Table 22 Effective Address Calculation Timing Addressing Mode Byte, Word Long Register Dn Data Register Direct 0(0/0) 0(0/0) An Address Register Direct 0(0/0) 0(0/0) Memory An@ Address Register Indirect 4 (1/0) 8 (2/0) An@+ Address Register Indirect with Postincrement 4 (1/0) 8 (2/0) An@- Address Register Indirect with Predecrement 6 (1/0) 10 (2/0) An@(d) Address Register Indirect with Displacement 8 (2/0) 12 (3/0) An@ (d, ix)* Address Register Indirect with Index 10 (2/0) 14 (3/0) xxx. W Absoiute Short 8 (2/0) 12 (3/0) xxx. L Absolute Long 12 (3/0) 16 (4/0) PC@(d) Program Counter with Displacement 8 (2/0) 12 (3/0) PC@ (d, ix)* Program Counter with Index 10 (2/0) 14 (3/0) #xxx Immediate 4 (1/0) 8 (2/0) * The size of the Index register hx) does not affect execution time. 289 -----------------------------------HD68000---------------------------------- Table 23 Move Byte and Word Instruction Clock Periods Destination Source On An An@ An@+ An@- An@(d) An@(d,ix)* xxx.W xxx.L On 4 (1/0) 4«1/0) 9 (1/1) 9 (1/1) .9 (111) 13 (211) 15 (2/1) 13 (211) 17 (311) An 4 (1/0) 4 (1/0) 9 (1/1) 9 (1/1) 9 (1/1) 13 (2/1) 15 (2/1) 13 (2/1) 17 (311) An@ 8 (2/0) 8 (2/0) 13 (2/1) 13 (2/1) 13 (2/1) 17 (3/1) 19 (3/1) 17 (3/1) 21 (4/1) An@+ 8 (2/0) 8 (2/0) 13 (2/1) 13 (2/1) 13(2/1) 17 (311) 19 (3/1) 17 (3/1) 21 (411) An@- 10 (2/0) 10 (2/0) 15 (2/1) 15 (2/1) 15 (3/1) 19 (3/1) 21 (3/1) 19 (3/1) 23 (411) An@(d) 12 (3/0) 12 (3/0) 17 (3/1) 17 (3/1) 17(3/1) 21 (4/1) 23 (4/1) 21 (4/1) 25 (5/1) An@ (d, ix)* 14 (3/0) 14 (3/0) 19 (3/1) 19 (3/1) 19(3/1) 23 (4/1) 25 (4/1) 23 (4/1) 27 (511) xxx.W 12 (3/0) 12 (3/0) 17 (3/1) 17 (3/1) 17 (3/1) 21 (4/1) 23 (4/1) 21 (4/1) 25 (5/1) xxx. L 16 (4/0) 16 (4/0) 21 (4/1) 21 (4/1) 21 (4/1) 25 (511) 27 (5/1) 25 (5/1) 29 (611) PC@(d) 12 (3/0) 12 (3/0) 17 (3/1) 17 (3/1) 17 (3/1) 21 (4/1) 23 (411) 21 (4/1) 25 (5/1) PC@ (d, ix)* 14 (3/0) 14 (3/0) 19 (3/1) 19 (3/1) 19 (3/1) 23 (4/1) 25 (4/1) 23 (4/1) 27 (5/1) #Xxx 8 (2/0) 8 (2/0) 13 (2/1) 13 (2/1) 13 (211) 17 (311) 19 (3/1) 17 (3/1) 21 (4/1) • The size of the index register (ix) does not affect execution time. Table 24 Move Long Instruction Clock Periods Destination Source On An An@ An@+ An@- An@(d) An@(d,ix)* xxx.W xxx.L On 4 (1/0) 4 (1/0) 14 (1/2) 14 (1/2) 16 (1/2) 18 (2/2) 20 (2/2) 18 (2/2) 22 (3/2) An 4 (1/0) 4 (1/0) 14 (1/2) 14 (1/2) 16 (1/2) 18 (2/2) 20 (2/2) 18 (2/2) 22 (3/2) An@ 12 (3/0) 12 (3/0) 22 (3/2) 22 (3/2) 22 (3/2) 26 (4/2) 28 (4/2) 26 (4/2) 30 (5/2) An@+ 12 (3/0) 12 (3/0) 22 (3/2) 22 (3/2) 22 (3/2) 26 (4/2) 28 (4/2) 26 (4/2) 30 (5/2) An@- 14 (3/0) 14 (3/0). 24 (3/2) 24 (312) 24 (3/2) 28 (4/2) 30 (4/2) 28 (4/2) 32 (5/2) An@(d) 16 (4/0) 16 (4/0) 26 (4/2) 26 (4/2) 26 (4/2) 30 (5/2) 32 (5/2) 30 (5/2) 34 (6/2) An@ (d, ix)* 18 (4/0) 18 (4/0) 28 (4/2) 28 (4/2) 28 (4/2) 32 (5/2) 34 (5/2) 32 (5/2) 36 (6/2) xxx.W 16 (4/0) 16 (4/0) 26 (4/2) 26 (4/2) 26 (4/2) 30 (5/2) 32 (5/2) 30 (5/2) 34 (6/2) xxx. L 20 (5/0) 20 (5/0) 30 (5/2) 30 (5/2) 30 (5/2) 34 (6/2) 36 (6/2) 34 (6/2) 38 (7/2) PC@(d) 16 (4/0) 16 (4/0) 26 (4/2) 26 (4/2) 26 (4/2) 30 (5/2) 32 (5/2) 30 (5/2) 34 (6/2) PC@ (d, ix)* 18 (4/0) 18 (4/0) 28 (4/2) 28 (412) 28 (4/2) 32 (5/2) 34 (5/2) 32 (5/2) 36 (6/2) #xxx 12 (3/0) 12 (3/0) 22 (3/2) 22 (3/2) 22- (3/2) 26 (4/2) 28 (4/2) 26 (4/2) 30 (5/2) • The size of the index register (ix) does not affect execution time. 290 HD68000---------------------------------- Table 25 Standard Instruction Clock Periods Instruction Size op, An op , Dn op Dn, Byte, Word 8 (1/0)+ 4 (1/0)+ 9(1/1)+ ADD Long 6 (1/0)+** 6 (1/0)+** 14 (1/2)+ Byte, Word - 4 (1/0)+ 9 (1/1)+ AND Long - 6 (1/0)+** 14 (1/2)+ Byte, Word 6 (1/0)+ 4 (1/0)+ - CMP Long 6 (1/0)+ 6 (1/0)+ - DIVS - - 158 (1/0)+* - DIVU - - 140 (1/0)+* - Byte, Word - 4 (1/0)*** 9 (1/1)+ EOR Long - 8 (1/0)*** 14 (112)+ MULS - - 70 (1/0)+* - MULU - - 70 (1/0)+* - Byte, Word - 4 (1/0)+ 9(1/1)+ OR Long - 6 (1/0)+** 14 (1/2)+ Byte, Word 8 (1/0)+ 4 (1/0)+ 9 (1/1)+ SUB Long 6 (1/0)+** 6 (1/0)+** 14 (112)+ + Add effective address calculation time Indicates maximum value Total of 8 clock periods for instruction if the effective address is register direct *** Only available effective address mode is data register direct. Table 26 Immediate Instruction Clock Periods Instruction Size op #, Dn op#, M op #, SR Byte, Word 8 (2/0) 13(2/1)+ - ADDI Long 16 (3/0) 22 (3/2)+ - Byte, Word 4 (1/0) 9 (1/1)+ - ADDQ Long 8 (1/0) 14 (1/2)+ - Byte, Word 8 (2/0) 13 (2/1)+ 20 (3/0) ANDI Long 16 (3/0) 22 (3/2)+ - Byte, Word 8 (2/0) 8 (2/0)+ - CMPI Long 14 (3/0) 12 (3/0)+ - Byte, Word 8 (2/0) 13 (2/1)+ 20 (3/0) EORI Long 16 (3/0) 22 (3/2)+ - MOVEQ Long 4 (1/0) - - Byte, Word 8 (2/0) 13 (2/1)+ 20 (3/0) ORI Long 16 (3/0) 22 (312)+ - Byte, Word 8 (2/0) 13(2/1)+ - SUBI Long 16 (3/0) 22 (3/2)+ - Byte, Word 4 (1/0) 9 (1/1)+ - SUBQ Long 8 (1/0) 14(1/2)+ - + Add effective address calculation time 291 ------------~-------------------- HD68000--------------------------------- Table 27 Single Operand Instruction Clock Periods Instruction Size Register Memory Byte, Word 4 (1/0) 9 (1/1)+ CLR Long 6 (1/0) 14 (1/2)+ NBCD Byte 6 (1/0) 9 (1/1)+ Byte, Word 4 (1/0) 9 (111)+ NEG Long 6 (1/0) 14 (1/2)+ Byte, Word 4 (1/0) 9 (1/1)+ NEGX Long 6 (1/0) 14 (1/2)+ Byte, Word 4 (1/0) 9 (111)+ NOT Long 6 (1/0) 14 (1/2)+ Byte, False 4 (1/0) 9 (1/1)+ See 9(111)+ Byte, True 6 (1/0) TAS Byte 4 (1/0) 11 (1/1)+ Byte, Word 4 (1/0) 4 (1/0)+ TST Long 4 (1/0) 4 (1/0)+ + Add effective address calculation time. Table 28 Shift/Rotate Instruction Clock Periods Instruction Size Register Memory Byte, Word 6 + 2n (1/0) 9 (1/1)+ ASR,ASL Long 8 + 2n (1/0) - Byte, Word 6 + 2n (1/0) 9 (1/1)+ LSR, LSL Long 8 + 2n (1/0) - Byte, Word 6 + 2n (1/0) 9 (1/1)+ ROR, ROL Long 8 + 2n (1/0) - Byte, Word 6 + 2n (1/0) 9 (1/1)+ ROXR, ROXL Long 8 + 2n (1/0) - Table 29 Bit Manipulation Instruction Clock Periods Dynamic Static Instruction Size Register Memory Register Memory Byte - 9(1/1)+ - 13 (2/1)+ BCHG Long 8 (1/0)* - 12 (2/0)* - BCL~ Byte - 9 (1/1)+ - 13 (2/1)+ Long 10 (1/0) * - 14 (2/0)* - BSET Byte - 9 (1/1)+ - 13 (2/1)+ Long 8 (1/0)* - 12 (2/0)* - Byte - 4 (1/0)+ - 8 (2/0)+ BTST Long 6 (1/0) - 10 (2/0) - + Add effective address calculation time Indicates maximum value 292 ------------------------------------HD68000----------------------------------- • CONDITIONAL INSTRUCTION CLOCK PERIODS • MULTI-PRECISION INSTRUCTION CLOCK PERIODS Table 30 indicates the number of clock periods required for Table 32 indicates the number of clock periods for the the conditional instructions. The number of bus read and write multi-precision instructions. The number of clock periods cycles is indicated in parenthesis as: (R/W). The number of includes the time to fetch both operands, perfonn the opera- clock periods plus the number of read and write cycles must be tions, store the results, and read the next instructions. The added to those of the effective address calculation where number of read and write cycles is shown in parenthesis as: indicated. (R/w). In Table 32, the headings have the following meanings: Dn = • JMP, JSR, LEA, PEA, MOVEM INSTRUCTION CLOCK data register operand and M = memory operand. PERIODS Table 31 indicates the number of clock periods required for • MISCELLANEOUS INSTRUCTION CLOCK PERIODS the jump, jump to subroutine, load effective address, push Table 33 indicates the number of clock periods for the effective address, and move multiple registers instructions. The following miscellaneous instructions. The number of bus read number of bus read and write cycles is shown in parenthesis as: and write cycles is shown in parenthesis as: (R/W). The number (R/W). of clock periods plus the number of read and write cycles must be added to those of the effective address calculation where indicated. Table 30 Conditional Instruction Clock Periods Instruction Displacement Trap or Branch Trap or Branch Taken Not Taken Byte 10 (1/0) 8 (1/0) Bee Word 10 (1/0) 12 (2/0) Byte 10 (1/0) - BRA Word 10 (1/0) - Byte 20 (212) - BSR Word 20 (2/2) - CC true - 12 (2/0) DBee CC false 10 (2/0) 14 (3/0) CHK - 43 (5/3)+* 8 (1/0)+ TRAP - 37 (4/3) - TRAPV - 37 (5/3) 4 (1/0) + Add effective address calculation time Indicates maximum value Table 31 JMP, JSR, LEA, PEA, MOVEM Instruction Clock Periods Instruction Size An@ An@+ An@- An@(d) An@(d,ix)* xxx. W xxx.L PC@(d) PC@(d,ix)* JMP - 8 (2/0) - - 10 (2/0) 14 (3/0) 10 (2/0) 12 (3/0) 10 (2/0) 14 (3/0) JSR - 18 (2/2) - - 20 (2/2) 24 (2/2) 20 (2/2) 22 (3/2) 20 (2/2) 24 (2/2) LEA - 4 (1/0) - - 8 (2/0) 12 (2/0) 8 (2/0) 12 (3/0) 8 (2/0) 12 (2/0) PEA - 14 (1/2) - - 18 (2/2) 22 (212) 18 (2/2) 22 (3/2) 18 (2/2) 22 (2/2) 12 + 4n 12 + 4n - 16 + 4n 18 + 4n 16 + 4n 20 +4n 16 + 4n 18 +4n MOVEM Word (3+n/0) (3+n/0) - (4+n/0) (4+n/0) (4+n/0) (5+n/0) (4+n/0) (4+n/0) 12 + 8n 12 + 8n - 16 + 8n 18 + 8n 16 + 8n 20 + 8n 16 + 8n 18 + 8n M--. R Long (3+2n/0) (3+2n/0) - (4+2n/0) (4+2n/0) (4+2n/0) (6+2n/0) (4+2n/0) (4+2n/0) 8 + 5n - 8+ 5n 12 + 5n 14 + 5n 12 + 5n 16 + 5n - - MOVEM Word (2/n) - (2/n) (3/n) (3/n) (3/n) (4/n) - - 8 + 10n - 8 + 10n 12+10n 14 + 10n 12+10n 16+10n - - R~M Long (2I2n) - (2/2n) (3/2n) (3I2n) (3I2n) (4/2n) - - n is the number of registers to move * is the size of the index register Ox) does not affect the instruction's execution time. 293 HD68000--------------------------------- Table 32 Multi-Precision Instruction Clock Periods Instruction Size op On, On opM, M Byte, Word 4 (1/0) 19 (3/1) ADDX Long 8 (1/0) 32 (5/2) Byte, Word - 12 (3/0) CMPM long - 20 (5/0) Byte, Word 4 (1/0) 19 (3/1) SUBX Long 8 (1/0) 32 (5/2) ABCD Byte 6 (1/0) 19 (3/1) SBeD Byte 6 (1/0) 19 (3/1) Table 33 Miscellaneous Instruction Clock Periods Instruction Size Register Memory Register -+ Memory Memory -+ Register MOVE from SR - 6 (1/0) 9 (1/1)+ - - MOVE to CCR - 12 (2/0) 12(2/0)+ - ... MOVE to SR - 12 (2/0) 12 (2/0)+ - - Word - - 18 (2/2) 16 (4/0) MOVEP Long - - 28 (2/4) 24 (6/0) EXG - 6 (1/0) - - - EXT Word 4 (1/0) - - - Long 4 (1/0) - - - LINK - 18 (2/2) - - - MOVE from USP - 4 (1/0) - - - MOVE to USP - 4 (1/0) - - - NOP - 4 (1/0) - - - RESET - 132 (1/0) - - - RTE - 20 (5/0) - - - RTR - 20 (5/0) - - - RTS - 16 (4/0) - - - STOP - 4 (0/0) - - - SWAP - 4 (1/0) - - - UNLK - 12 (3/0) - - - + Add effectIve address calculatIon tIme Table 34 Exception Processing Clock Periods • EXCEPTION PROCESSING CLOCK PERIODS Table 34 indicates the number of clock periods for exception processing. The number of clock periods includes the time for Exception Periods all stacking, the vector fetch, and the fetch of the first Address Error 57 (417) instruction of the handler routine. The number of bus read and Bus Error 57 (417) write cycles is shown in parenthesis as: (R/W). 47 (5/3)* Interrupt I "egal Instruction 37 (4/3) Privileged Instruction 37 (4/3) Trace 37 (4/3) * The interrupt acknowledge bus cycle is assumed to take four external clock periods. HITACHI reserves the right to make changes to any products herein to improve functioning or design. Although the information in this document has been carefully reviewed and is believed to be reliable, HITACHI does not assume any liability arising out of the application or use of any product or circuit described herein, neither does it convey any license under its patent rights nor the rights of others. 294 [ APPENDIX I 295 PACKAGE INFORMATION Packages are classified into 3 types; dual-in-line plastic, dualin- line ceramic (glass-sealed) and dual-in-line ceramic (with lid), according to the quality of material used for packaging. Package* Type Function Pin No. C** G P HD6800 0 0 HD68AOO Micro Processing Unit 40 0 0 HD68BOO 0 0 HD6802S Microprocessor with Clock and RAM 40 0 0 HD6809 0 0 HD68A09 8/16 Bit Micro Processing Unit 40 0 0 HD68B09 0 0 HD6821 0 0 HD68A21 Peripheral Interface Adapter 40 0 0 HD68B21 0 0 HD6840 HD68A40 Programmable Timer Module 40 0 0 HD68B40 HD6850 0 0 Asynchronous Communications Interface Adapter 24 HD68A50 0 0 HD6852 0 0 Synchronous Serial Data Adapter 24 HD68A52 0 0 HD6846 Combination ROM I/O Timer 40 0 0 HD6843S 0 0 Floppy Disk Controller 40 HD68A43S 0 0 HD6844 0 0 Direct Memory Access Controller 40 HD68A44 0 0 HD6845 0 0 HD68A45 CRT Controller 40 0 0 HD68B45 0 0 HD46508 0 Analog Data Acquisition Unit 40 HD46508-1 0 HD68000-4 HD68000-6 16/32 Bit Microprocessor 64 O-std. HD68000-S HD6S450-4 HD68450-6 16 Bit Direct Memory Access Controller 64 O-std. HD68450-S * The package codes of C, G and P are applied to the package materials as follows. C; Ceramic with Lid G; Glass - Sealed Ceramic P; Plastic ** Special Order Only 296 • DUAL-IN-LINE CERAMIC (with Lid) DC-24 DC-40 II~i~ (Dimensions in mm) (Dimensions in mm) • DUAL-IN-LINE CERAMIC (Glass-sealed) DG-16 DG-16A ~I ft O'~\5° 0.20-0.38 (Dimensions in mm) (Dimensions in mm) • DUAL-IN-LlNE PLASTIC DP-16 DP-24 (Dimensions in mm) (Dimensions in mm) DP-28 DP-40 'I~ ; : ,~ ~ (Dimensions in mm) "".A ",.~~~ -- - ,,,m. (Dimensions in mm) 297 HMCS6800 FAMILY INSTRUCTIONS • ACCUMULATOR AND MEMORY OPERATIONS HD6800 HD6801 HD6805 HD6809 HD6802 HD6803 Boolean/Arithmetic Operations Mnemonic Operation Add ADDA A+M-+A o 0 0 0 000 0 000 0 o 0 0 0 0 ADDB B+M-+B o 0 0 0 o 0 0 0 00000 Add Double ADDD A:B + M:M+1--+ A:B o 0 0 0 o 000 0 Add Accumulators ABA A + B -+A o o Add with Carry ADCA A+M+C-+A o 000 o 0 0 0 000 0 00000 ADCB B+M+C-+B o 0 0 0 o 0 0 0 00000 Subtract SUBA A -M-+A o 0 0 0 o 0 0 0 000 0 00000 SUBB B - M -+ B o 0 0 0 o 0 0 0 o 0 000 Subtract Double SUBD A:B - M:M+1 -+ A:B o 000 o 0 0 0 0 SBA A - B-+ A o o Subtract with SBCA A - M - C ..... M 000 0 o 0 0 0 o 0 0 0 o 0 000 Carry SBCB B - M - C -+ M o 0 0 0 000 0 o 0 000 Multiply MUl A x B-+ A:B o o Decimal Adjust A DAA Decimal Adjust Accumulator o o o INC M+ 1-+ M o 0 o 0 o 0 000 0 Increment INCA A + 1 -+ A o o o o INCB B + 1 -+ B o o o Decrement DEC M -1-+ M o 0 o 0 o 0 o 000 DECA A -1-+ A o o o o DECB B -1 -+ B o o o Clear ClR 0 -+ M o 0 o 0 o 0 o 0 0 0 ClRA 0 -+ A o o o o ClRB 0 -+ B o o o Compare CMPA A - MOO 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ~------~----------------------+-~~-+~--~+-~-+~--~+-~~-+~--~+--b-+~--~+-~~-- CMPB B-M 0000 0000 00000 Compare Double CMPD A:B-M:M+1 0 0 0 0 0 CompXgcumulators CBA A-B o o Test Zero or TST M -00 o 0 o 0 o 0 000 0 Minus TSTA A -00 o o o o TSTB B -00 o o o And ANDA A·M-A o 0 0 0 o 0 0 0 o 0 0 0 00000 ANDB o 0 0 0 o 000 o 0 0 0 0 Or ORAA ORA A+M-+A o 0 0 0 o 00 0 o 000 00000 ORAB ORB B+M-+B o 0 0 0 o 0 0 0 o 0 0 0 0 Exclusive Or EORA A® M-+ A o 0 0 0 o 0 0 0 000 0 o 0 000 EORB o 000 o 0 0 0 o 0 000 Complement 1's COM o 0 o 0 o 0 000 0 COMA A-+A o o o o COMB o o o Complement.2's NEG 00 -M-+M o 0 o 0 o 0 000 0 (Negate) NEGA OO-A-+A o o o o NEGB OO-B-B o o o Bit Test BITA A·M 000 0 o 000 o 0 0 0 o 0 0 0 0 BITB B·M o 0 0 0 o 0 0 0 o 0 0 0 0 Bit Clear BClR n 0-+ M· Bit (n) 01 Bit Set BSET n 1 -+ M • Bit (n) o SEX Sign Extend B into A o 298 (to be continued) H06800 H06801 H06805 HD6809 H06802 H06803 Operations Booleanl Mnemonic Arithmetic Operation Load LDAA LDA M-+A 000 0 o 0 0 0 o 000 00000 LOAB M-+B 000 0 o 0 0 0 00000 LDB LDD M:M+1 -+ A:B 000 0 00000 Store STAA STA A-+M 000 000 000 o 0 0 0 STAB B-+M 000 000 000 0 5TB 5TD A:B-+M:M+1 000 o 0 0 0 Transfer TFR Register 1 -+ Register 2 o TAB A-+B o o TBA B -+A o o Exchange EXG Register 1 --> Register 2 o Push Data P5HA A --> Ms 5 -1 --> 5 o o P5HB B -->Ms 5-1-->5 o o P5H5 Registers ..... Ms 5 - n --> 5 o P5HU Registers --> Mu U - n ..... U o Pull Data PULA Ms ..... A 5 + 1 --> 5 o o PULB Ms--> B 5 + 1 --> 5 o o PUL5 Ms -+ Registers 5 + n ..... 5 o PULU Mu ..... Registers U + n ..... U o 5hift Left A5L Arithmetic ASLA A5LB A5LD 5hift Right A5R o 0 o 0 o 0 000 0 Arithmetic A5RA I I-->D~~1-+0~+-~-+~O+-~-+-r+0-r1-+4~-r~O+- ASRB L5B COO 0 5hift Right L5R o 0 o 0 o 0 o 0 0 0 Logical L5RA LSRB 0 ..... _--ll-JI--> 1-1 1 ....... Dt---;r-t-+-+-~-t--+--r-t---1--+-~+-~f----t-+-+-°-t--+--r-t---1--+-+~-+- Rotate Left L5RD ROL ROLA M A lCo ' M5B L5B -I'----L-.I_-----'"I-JIJ C~+-+-1-~-+-+~--~+-+-O~-+-+~~--~+-1-~-+-+~--~+-- 0 0 0 0 0 0 0 0 ~-+--r-+--O0 +--t-+-r~+O--+-~+-I--+~O---+-+-+--t--+--+--+-O+-- 0 0 ROLB B C MSB LSB 0 0 Rotate Right ROR RORA RORB 299 • JUMP AND BRANCH INSTRUCTIONS H06800 H06801 HD6805 H06809 H06802 HD6803 w I- w Operations Mnemonic Branch Test UJ UJ U > > a I- > a I- > a I- u x a a I- u x a u x a u x a w ~ a: a I- a.. ~ ~ a: a I- a.. ~ ~ a: 0 I- a.. UJ W W Z ...J UJ UJ UJ Z ...J UJ W UJ Z ...J ~ ~ a: 0 ~ I-~...J ~ UJ W W ~ Ci ~ UJ ~ a: ~ 15 ~ UJ ~ a: ~ a ~ w ~ a: ~ 15 ~ ~ ~~ ~ a: x UJ x UJ x w UJ Branch if Carry BCC C=O 0 0 0 0 Clear LBCC 0 Branch if Carry BCS C=1 0 0 0 0 Set LBCS 0 Branch SEQ Z=O 0 0 0 0 if = Zero LBEQ 0 Branch if Not BNE Z'IO 0 0 0 0 Equal Zero LBNE 0 Branch BGE N®V=O 0 0 0 if ~ Zero LBGE 0 Branch BGT Z + (N ® V) =0 0 0 0 if> Zero LBGT 0 Branch BLT N ® V = 1 0 0 0 if < Zero LBLT 0 Branch BLE Z + (N ® V) = 1 0 0 0 if ~ Zero LBLE 0 Branch BHI C+Z=O 0 0 0 0 if Higher LBHI 0 Branch BLS C+Z=1 0 0 0 0 if Lower or Same LBLS 0 Branch BPL N=O 0 0 0 0 if Plus LBPL 0 Branch BMI N=1 0 0 0 0 if Minus LBMI 0 Branch BVC V=O 0 0 0 if overflow Clear LBVC 0 Branch BVS V= 1 0 0 0 if Overflow Set LBVS 0 Branch if Half H=O BHCC 0 Carry Clear Branch if Half BHCS H= 1 0 Carry Set Branch if Interrup BMC 1=0 0 Mask Clear Branch if Interrupt BMS 1=1 0 Mask Set Branch if Interrupt Line High BIH I INT= 1 0 Branch if Interrupt BIL INT =0 0 Line Low Branch if Bit n of BRCLR n M (n) =0 0 MClear Branch if Bit n of BRSET n M (n) = 1 0 M Set Branch Always BRA 0 0 0 0 LBRA 0 Branch Never BRN 0 0 0 LBRN 0 Branch to BSR 0 0 0 0 Subroutine LBSR 0 Jump JMP 0 0 0 0 0 0 0 0 0 0 0 (to be continued) 300 HD6800 HD680' HD6805 HD6809 HD6802 HD6803 Operations Mnemonic Branch Test Jump to Subroutine JSR o 0 000 000 000 0 Return from o o Subroutine RTS o o No Operation NOP o o o o Software SWI o o o o Interrupt SWI2 o SWI3 o Return from o Interrupt RTI o o o Wait WAI o o CWAI o Synchronize to Interrupt SYNC o • INDEX REGISTER AND STACK POINTER INSTRUCTIONS HD6800 HD680' HD6805 HD6809 HD6802 HD6803 Boolean/ Operations Mnemonic Arithmetic Operation Increment INX x +, . . . X o o o Decrement DEX X-1 ..... X o o o ADD with B ABX B+X ..... X o o Clear CLRX 0 .... X o Negate NEGX OO-X ..... X o Complement 1 '5 COMX FF - X ..... X o Shift Left ASLX Arithmetic o ~'''',s'''''BI,---_...,...IL~...,i,SBI4 9 Shift Right ASRX Arithmetic o Shift Right Logical LSRX o Rotate Left ROLX o Rotate Right RORX o Test TSTX X -00 o Compare CPX 000 0 00000 X -M:M+1 000 0 000 0 CMPX CMPY Y - M:M+1 00000 Load LDX M:M+1 ..... X 000 0 000 0 000 0 o 0 0 0 0 LDY M:M+1 ..... Y o 0 0 0 0 Store STX X ..... M:M+1 000 000 000 o 0 0 0 STY Y ..... M:M+1 o 0 0 0 Load effective LEAX Effective address ..... X o Address Effective address .... Y o LEAY Push PSHX X ..... Ms o Pull PULX Ms .... X o Ito be continued) 301 Transfer X, A TAX A-+X 0 TXA X -+A 0 Transfer X, S TSX S-+ X 0 0 TXS X-+S 0 0 Increment INS S+1-+S 0 0 Decrement DES S-1-+S 0 0 Reset RSP $7F -+ S 0 Compare CMPS S - M: M+1 0 0 0 0 0 CMPU U -M: M+1 0 0 0 0 0 Load LDS M: M+1 ..... S 0 0 0 0 0 0 0 0 0 0 0 0 0 LDU M : M+1 -+ U 0 0 0 0 0 Store STS S -+ M :M*-1 0 0 0 0 0 0 0 0 0 0 STU U-+ M : M+1 0 0 0 0 Load effective LEAS Effective Address -+ S 0 Address 0 LEAU Effective Address -+ U • CONDITION CODE REGISTER INSTRUCTIONS HD6800 HD6801 HD6805 HD6809 HD6802 HD6803 Operations Mnemonic Boolean Operation w w W I- W I- Cl U Cl > Cl I- U 'X Cl > Cl I- Cl > Cl I- Cl U w > ~ ~ ~ X U X ~ w w U X Z Z ~ I-~...J w I- W W W W W W Z ...J W W ...J ...J W ~ a::: Cl el. ~ a::: Cl I- el. ~ a::: Cl I- el. ~ a::: Cl a::: ~ Cl ~ w ~ a::: ~ 0 ~ ~ ~~~ w w ~ Cl ~ X w ~ a::: ~ 0 ~ w ~ w X w X a::: Clear Carry CLC O-+C 0 0 0 Clear Interrupt Mask CLI 0-+1 0 0 0 Clear InterruptMask CLV O-+V 0 0 0 Set Carry SEC 1-+C 0 0 0 Set InterruptMask SEI 1 -+ I 0 0 0 Set Overflow SEV 1-+V 0 0 Transfer A. CC TAP A -> CC 0 0 TPA CC-+ A 0 0 And CC ANDCC CC· imm-> CC 0 Or CC ORCC CC+imm-> CC 0 LEGEND A Accumulator A H Half Carry from 3 bit B Accumulator B Interrupt Mask X Index Register N Negative y Index Register (6809 only) Z Zero S Stack Pointer V Overflow U User Stack Pointer (6809 only) C Carry Bit from 7 bit Transfer into MSB Most Signification bit + Arithmetic Plus LSB Least Signification bit Arithmetic Minus IMMED Immediate Boolean AND DIRECT Direct + Boolean Inclusive OR INDEX Indexed $ Boolean Exclusive OR EXTND Ext~nded Connection Area EXT INDIRECT Extended indirect I\lI Complement of M IMPL Inplied (Inherent. Accumulator) Ms Stack area pointed by S. RELATIVE Relative Mu Stack area pointed by U. CC Condition Code Register 302 MEMORIES • MOS MEMORI ES • SELECTION GUIDE TO MOS RAMs Access Cycle Supply Power Organi- Package * * Total Time Time Voltage Dissipa- Cross- Mode Type No. Process zation Bit (ns) (ns) tion reference (word xbit) Pin No_ max. min. C G P (V) (mW) HM472114A-1 150 150 • • HM472114A-2 NMOS 1024 x4 200 200 +5 200 18 • • 2114L-2 HM472114-3 300 300 • • 2114L-3 HM472114-4 450 450 • • 2114L-4 HM4334-3 CMOS 1024x 4 300 460 +5 20 18 • HM-6514 HM4334-4 450 640 • HM6148 70 70 • 2148 4k-bit HM6148-6 CMOS 1024 x 4 85 85 +5 200 18 • 2148-6 HM6148L 70 70 • HM6148L-6 85 85 • Static HM4315 CMOS 4096'>< 1 450 640 +5 20 18 • HM6147 70 70 • • 2147 HM6147-3 CMOS 4096 x 1 55 55 +5 75 18 • • 2147-3 HM6147L 70 70 • HM6147L-3 55 55 • HM6116-2 120 120 • HM6116-3 150 150 180 • 16k-bit HM6116-4 CMOS 2048 x8 200 200 +5 24 • HM6116L-2 120 120 • HM6116L-3 150 150 160 • HM6116L-4 200 200 • HM4716A-1 120 320 +12, • • HM4716A-2 NMOS 16384 x 1 150 320 +5, 350 16 • • MK4116-2 16k-bit HM4716A-3 200 375 -5 • • MK4116-3 Dynamic HM4716A-4 250 410 • • MK4116-4 HM4816 NMOS 16384 x 1 100 200 +5 250 16 • 64k-bit HM4864-2* NMOS 65536 x 1 150 270 +5 170 16 • HM4864-3* 200 335 • • SELECTION GUIDE TO MOS ROMs Access Supply Power Organi- Package * * Total Time Voltage Dissipa- Cross- Program Type No. Process zation Bit (ns) tion reference (word x bit) max. (V) Pin No. C G P (mW) Mask 16k-bit 32k-bit HN462316E HN46332 2048 x 8 4096 x 8 350 350 350 250 24 24 ·• 2316E 64k-bit HN48364 8192 x8 350 225 24 • UV Erasable & 16k-bit HN462716 NMOS 2048 x8 450 +5 310 24 • • 2716 Electrically 32k-bit HN462532 4096 x8 450 450 24 • TMS2532 HN462732 • 2732 Electrically Erasable & Programmable 16k-bit HN48016 2048)( 8 350 160 24 • * Preliminary ** The package codes of C, G, and P are applied to the package materials as follows. C : Ceramic with Lid, G: Glass-sealed Ceramic, P: Plastic 303 • BIPOLAR MEMORIES • SELECTION GUIDE TO BIPOLAR RAMs Access Supply Power Organi- Time Voltage Dissipa- Package** Cross- Total Type No. zation Level Output (ns) Bit tion reference (word xbit) Pin No. G P max. (V) (mW/bit) C HM2105 35 1.8 • F10410 256-bit HM2106 256x1 15 1.8 16 • HM10414* 10 -5.2 2.8 • F10414 HM10414-1 * 8 2.8 • HM10422* 256x4 10 0.8 24 • F10422 HM100422* Open 10 -4.5 • F1oo422 ECL HM2110 Emitter 35 • F10415 1k-bit HM2110-1 25 0.5 16 • F10415A HM2110-2 1024 x 1 20 -5.2 • HM2112 10 HM2112-1 8 0.8 16 • HM10470* 25 F10470 4k-bit HM10470-1* 4096 x 1 15 0.2 18 • 256-bit HM2504 256 x 1 55 1.8 16 • 93411 HM2504-1 Open 45 • 93411A HM2510 Collector 70 • TTL HM2510-1 45 +5 0.5 16 • 93415 1k-bit HM251 0-2 1024x 1 35 • 93415A HM2511 3-State 70 0.5 16 • HM2511-1 45 • 93425 • SELECTION GUIDE TO BIPOLAR PROM Access Supply Power Organi- Time Voltage Dissipa- Package** . Cross- Total Type No. Level zation Output (ns) tion reference Bit (word x bit) max. (V) (mW/bit) Pin No. C G P 4k:t>it HN25044 1024 x4 OIC 50 500 18 • 82S136 HN25045 3-S • 82S137 TTL HN25084* 2048 x 4 OIC 60 +5 600 18 • 82S184 8k-bit HN25085* 3-S • 82S185 HN25088* 1024x 8 OIC 60 600 24 • 825180 HN25089* 3-5 • 82S181 * Preliminary ** The package codes of C, G, and P are applied to the package materials as follows. C : Ceramic with Lid, G : Glass-sealed Ceramic, P: Plastic 304 • OUTLINE , I OP-16 I IOP-181 I OP-24 , ~ I OG-16 I I OG-16A I I OG-18 I I OG-24 , I OG-24A , I OG-24B I , OC-16 I I DC-24C , • APPLICABLE ICs Dp·16 HM4716Ap·1, HM4716AP·2, HM4716AP·3, HM4716AP·4 HM472114AP·1, HM472114AP·2, HM472114P·3, HM472114P-4, HM4334P·3, HM4334p·4, HM6148P, DP·18 HM6148P·6, HM6148LP, HM6148LP·6, HM4315P, HM6147P, HM6147p·3, HM6147LP, HM6147Lp·3 HM6116P·2, HM6116p·3, HM6116p·4, HM6116LP·2, HM6116LP·3, HM6116LP·4, HN462316EP, HN46332P, Dp·24 HN48364P, HN48016P DG·16 HM2105, HM2106, HM10414, HM10414·1, HM2504, HM2504·1 HM4716A·1, HM4716A·2, HM4716A·3, HM4716A-4, HM2110, HM2110·1, HM2110·2, HM2112, HM2112·1, DG·16A HM2510, HM2510·1, HM2510·2, HM2511, HM2511·1 HM472114A-1, HM472114A-2, HM472114·3, HM472114·4, HM6147, HM6147·3, HM10470, HM10470·1, DG-18 HN25044, HN25045, HN25084, HN25085 DG-24 HN25088, HN25089 DG·24A HM10422, HM100422 DG-24B HN462716G DC-16 HM4816, HM4864·2, HM4864-3 DC-24C HN462716, HN462532, HN462732 305 LINEAR IC & INTERFACE CIRCUITS • LINEAR les Package Code Functions Type No. Cross·reference M P PS G GS General Purpose HAl774l DP·8 DG-8 Fairchild ~A741C High Speed HAl77l5 T-l00 Fairchild ~A7l5C Operational HA17458 DP·8 DG-8 NS LM1458 Amplifiers Dual HAl7747 DP-14 DG·14 Fairchild ~A747C HA17904 DP·8 DG-8 NS LM2904 HA17301 DP·14 DG·14 Motorola MC3301 Quad. HA17902 DP·14 DG·14 NS LM2902 Single HA18l3 DP·8 Universal HA18l2 DP·8 DG-8 Voltage HA17903 DP·8 DG-8 NS LM2903 Comparators Dual HAl807 DG·14 Quad. HA1790l DP·14 DG·14 NS LM2901 Variable 2-37V, l50mA HA17723 DG·14 Fairchild ~A 723C 5V,lA HA17805 T·220AB Fairchild ~A7805C 6V,lA HA17806 T-220AB Fairchild ~A7806C 7V,lA HA17807 T-220AB 8V,lA HA17808 T·220AB Fairchild ~A7808C l2V,lA HA178l2 T·220AB Fairchild ~A 78l2C l5V,lA HA178l5 T·220AB Fairchild ~A78l5C l8V,lA HA178l8 T-220AB Fairchild ~A78l8C 24V,lA HA17824 T·220AB Fairchild ~A7824C Voltage Fixed 5V,O.5A HA178M05 T·220AB Fairchild ~A78M05C Regulators 6V,O.5A HA178M06 T·220AB Fairchild ~A78M06C 7V,O.5A HA178M07 T·220AB 8V,O.5A HA178M08 T-220AB Fairchild ~A78M08C l2V,O.5A HA178M12 T·220AB Fairchild ~A78M12C l5V,O.5A HA178M15 T·220AB Fairchild ~A78M15C l8V,O.5A HA178M18 T·220AB Fairchild ~A78M18C 20V,O.5A HA178M20 T·220AB Fairchild ~A 78M20C 24V,O.5A HA178M24 T·220AB Fairchild ~A78M24C Switching Regulator Controller HA17524 DP·16 DG·16 Silicon General SG3524 AID, D/A 8·bit Double Integral Type AID HA16613 DP·28 Converters 8-bit D/A HA17408 DP·16 DG·16 AMD AM1408 Differential Video Amp. HAl7733 T·100 Fairchild ~A733C 5 Transistor Arrays HA1127 DG·14 RCA CA3045 Precision Timers HA17555 DP·8 DG-8 Signetics NE555 Monostable Multivibrators HA1607 DP·8 Other Micromotor Speed Controller HA16503 DP-14 Function Light·measu rement Amp_ HA16506 DP·14 for Camera HA16564 DP·14 Coin Sensor HA16603 DP·16 Electric Leakage Breaker HA16604 SP-8 Burner Controller HA16605W DP·20 306 • INTERFACE CIRCUITS Package Code Functions Type Cross-reference P G HD75109 DP-14 DG-14 Texas SN75109 Dual HD75110 DP-14 DG-14 Texas SN75110 Driver Triple HD2904 DG-16 Line Driver! Quad. HD75188 DP-14 DG-14 Texas SN75188 Receiver HD75107A DP-14 DG-14 Texas SN75107A Dual HD75108A DP-14 DG-14 Texas SN75108A HD2905 DG-16 Receiver Triple HD2915 DG-16 HD75154 DP-16 DG-16 Texas SN75154 Quad. HD75189 DP-14 DG-14 Texas SN75189 Dual NAND + NPN Transistor HD75450A DP-14 DG-14 Texas SN75450A Dual AND HD75451A DP-8 DG-8 Texas SN75451A Peripheral HD75452 DP-8 DG-8 Texas SN75452 Dual NAND Driver Dual OR HD75453 DP-8 DG-8 Texas SN75453 Dual NOR HD75454 DP-8 DG-8 Texas SN75454 Core Memory Dual Sense Amplifier HD1902 DG-16 Texas SN7524 Memory Quad. TTL-MaS Clock Driver HD2912 DG-16 Suport IC DG-16A Quad. TTL-MaS Clock Driver HD2916 Memory Quad. ECl-TTl Driver HD2923 DG-16A Other Printer Driver HD2919 DP-16 • OUTLINE [DP-161 I DG-14 I I DG-16 I I DG-16A I I T-1 00 I l!-220AB I 307 TTLHD74/HD74S/HD74LS SERIES • PERFORMANCE (per gate) • MAIN CHARACTERISTICS (Ta = -20 -- +7SoC) ~ HD74 HD74S HD74LS HD74 Series HD74S Series HD74LS Series Performance Series Series Series Parameter min. max. min. max. min. max. Propagation Delay Time 10ns 3ns 10ns VOL (lOL max.) - O.4V - 0.5V - 0.5V V OH Power 10mW 20mW 2mW (loH=-400,uA) 2.4V - 2.7V - 2.7V - Dissipation Speed-Power 100pJ 6,DpJ 20pJ V IL - O.BV - O.BV - O.BV Product V IH 2V - 2V - 2V - IlL - -1.6mA - -2mA - -0.4mA IIH (VII..pmin.) - 40,uA - 50,uA - 20,uA • SELECTION GUIDE • NAND/NOR/AND/OR GATES Function HD74 Series HD74S Series HD74LS Series Quad. 2-input Positive NAND Gates 00 00 00 Quad. 2-input Positive NAND Gates (with Open Collector Output) 01 - 01 Quad. 2-input Positive NOR Gates 02 02 02 Quad. 2-input Positive NAND Gates (with Open Collector Output) 03 03 03 Hex Inverters 04 04 04 Hex Inverters (with Open Collector Output) 05 05 05 Hex Inverter Buffers/Drivers (with Open Collector High-voltage Output) 06 - - Hex Buffers/Drivers (with Open Collector High-voltage Output) 07 - - Quad. 2-input Positive AND Gates OB - 08 Quad. 2-input Positive AND Gates (with Open Collector Output) 09 - 09 Triple 3-input Positive NAND Gates 10 10 10 Triple 3-input Positive AND Gates - 11 11 Triple 3-input Positive NAND Gates (with Open Collector Output) 12 12 12 Dual 4-input Schmitt NAND Gates 13 - 13 Hex Schmitt-trigger Inverters 14 - 14 Triple 3-input Positive AND Gates (with Open Collector Output) - 15 15 Hex Inverter Buffers/Drivers (with Open Collector High-voltage Output) 16 - - Hex Buffers/Drivers (with Open Collector High-voltage Output) 17 - - Dual 4-input Positive NAND Gates 20 20 20 Dual 4-input Positive AND Gates - - 21 Dual 4-input Positive NAND Gates (with Open Collector Output) 22 22 22 Expandable Dual 4-input Positive NOR Gates (with Strobe) 23 - - Dual 4-input Positive NOR Gates 25 - - Quad. 2-input High-voltage Interface NAND Gates 26 - 26 Triple 3-input Positive NOR Gates 27 - 27 8-input Positive NAND Gate 30 - 30 Quad. 2-input Positive OR Gates 32 - 32 Quad. 2-input Positive NAND Buffers 37 - 37 Quad. 2-input Positive NAND Buffers (with Open Collector Output) 38 - 38 Dual 4-input Positive NAND Buffers 40 40 40 Quad. Bus Buffer Gates with 3-state Output (Inverting) 125 - 125A Quad. Bus Buffer Gates with 3-state Output (Noninverting) 126 - 126A Quad. 2-input Positive NAND Schmitt Triggers 132 - 132 13-input Positive NAND Gate - 133 - 12-input Positive NAND Gate (with 3-state Out.) - 134 - (to be continued) 308 Function HD74 Series HD74S Series HD74LS Series Dual 4-input Positive NAND Line Drivers - 140 - Octal Bus Transceivers (with Noninverted 3-state Output) - - 245 Hex Bus Buffers/Drivers (with 3-state Output) - - 365A Hex Bus Buffers/Drivers (with 3-state Output) - - 366A Hex Bus Buffers/Drivers (with 3-state Output) - - 367A Hex Bus Buffers/Drivers (with 3-state Output) - - 368A • AND-OR-INVERT GATES Function HD74 Series H D74S Series HD74LS Series Expandable Dual2-wide 2-input AND-DR-INVERT Gates 50 - - Dual 2-wide 2-inpl.!t AND-DR-INVERT Gates 51 - 51 Expandable 4-wide 2-input AND-DR-INVERT Gate i 53 - - 4-wide 2-input AND-DR-INVERT Gate 54 - 54 2-wide 4-input AND-DR-INVERT Gate - - 55 4-2-3-2-input AND-DR-INVERT Gate - 64 - 4-2-3-2-input AND-DR-INVERT Gate (with Open Collector Output) I - 65 - • EXPANDER Function HD74 Series HD74S Series HD74LS Series Dual 4-input Expanders 60 • FLIP FLOPS Function HD74 Series HD74S Series HD74LS Series J-K Master-Slave Flip Flop (AND Inputs) 72 - I - Dual J-K Flip Flops 73 - 73 Dual D-type Edge-triggered Flip Flops 74 74 74A Dual J-K Flip Flops (with PR and CLR) 76 - 76 Dual J-K Flip Flops (with PR, Common CLR, and Comm~n CK) - - 78 Dual J-K Flip Flops 107 - 107 Dual J-K Positive Edge-triggered Flip Flops (With PR and CLR) - - 109A Dual J-K Negative-edge-triggered Flip Flops (with PR and CLR) - 112 112 Dual J-K Negative-edge-triggered Flip Flops (with PRj - 113 113 Dual J-K Negative-edge-triggered Flip Flops (with PR, Common CLR, - 114 114 and Common CK) Monostable Mu Itivibrator 121 - - Retriggerable Monostable Multivibrator - - 122 Dual Retriggerable Monostable Multivibrators 123 - 123 Hex D-type Flip Flops (with CLR) 174 174 174 Quad, D-type Flip Flops (with CLR) 175 175 175 Dual Monostable Multivibrators (with Schmitt Trigger) 221 - 221 • COUNTERS Function HD74 Series HD74S Series HD74LS Series Decade Counter 90A - 90 Divide-by-Twelve Counter 92A - 92 4-bit Binary Counter 93A - 93 Presettable Decade Counter/Latch 176 - - 4-bit Binary Counter/Latch 177 - - Synchronous Decade Counter 160 - 160 Synchronous 4-bit Binary Counter 161 - 161 Fully Synchronous Decade Counter 162 - 162 309 Function HD74 Series HD74S Series HD74LS Series Fully Synchronolls 4-bit Binary Counter 163 I 163 Synchronous Decade Decimal Rate Multiplier 167 I i --1 Synchronous Decade Up/Down Counter 190 190 Synchronous 4-bit Binary Up/Down Counter 191 191 Synchronous Decade Up/Down Counter 192 192 Synchronous 4-bit Binary Up/Down Counter 193 193 Decade Counter 4-bit Binary Counter Dual 4-bit Decade Counters 290 293 =-J I I 290 293 390 Dual 4-bit Binary Counters 393 Dual 4-bit Decade Counters 490 Synchronous Decade Up/Down Counter 668 Synchronous 4-bit Binary Up/Down Counter 669 • 4-BIT, 5-BIT SHIFT/STORAGE REGISTERS Function HD74 Series HD74S Series HD74LS Series 4-bit Right-Shift, Left-Shift Register 95A - 95B 5-bit Shift Register (Dual Parallel-in, Parallel-out) 96 - 96 4-bit D-type Register (with 3-state Output) 173 - 173 4-bit Parallel-in, Parallel-out Bidirectional Shift Register 194 - 194A 4-bit Parallel-in, Parallel-out Shift Register (J-K Inputs for First Stage) 195 - 195A 4-bit Right-shift, Left-shift Register - - 295B • a-BIT SHIFT REGISTERS Function HD74 Series HD74S Series HD74LS Series 8-bit Shift Register 91A - 91 8-bit Parallel-out Shift Register 164 - 164 Parallel-load 8-bit Shift Register 166 - 166 8-bit Parallel-in, Parallel-out Bidirectional Shift Register 198 - - 8-bit Parallel-in, Parallel-out Shift Register (J-K Inputs for First Stage) 199 - - 8-bit Universal Shift/Storage Register - - 299 • ENCODERS Function HD74 Series HD74S Series HD74LS Series 10-line-to-4-line Priority Encoder 147 - - 8-line-t~-3-line Priority Encoder 148 - 148 • DECODERS/DEMULTIPLEXERS Function HD74 Series HD74S Series HD74LS Series BCD-to-Decimal Decoder 42A - 42 Excess 3-to-Decimal Decoder 43A - - Excess 3-Gray-to-Decimal Decoder 44A - - 3-to-8-line Decoder - - 138 Dual 2-to-4-line Decoders/Demultiplexers - - 139 4-line-to-16-line Decoder/Demultiplexer 154 - 154 Dual 2-line-to-4-line Decoders/Demultiplexers 155 - 155 Dual 2~line-to-4-line Decoders/Demultiplexers (With Open 156 156 Collector Output) 4-line-to-16-line Decoder/Demultiplexer (wi,th Open Collector Output) 159 - I - (to be continued) 310 • DECODERS/LAMP DRIVERS/BUFFERS Function HD74 Series HD74S Series HD74LS Series BCD-to-Decimal Decoder/Driver (with 30V Out.) 45 - - BCD-to-Decimal Decoder/Driver (with 15V Out.) 145 - 145 BCD-to-Seven Segment Decoder/Driver (with 30V Output) 46A - - BCD-to-Seven Segment Decoder/Driver (with 15V Output) 47A - 47 BCD-to·Seven Segment Decoder - - 48 BCD-to-Seven Segment Decoder - - 49 BCD-to-Decimal Decoder/Driver (with 60V Out.) 141 - - BCD-to-Seven Segment Decoder/Driver (with 15V Output) - - 2".7 BCD-to-Seven Segment Decoder/Driver - - 248 / BCD-to-Seven Segment Decoder/Driver - - 249 • LATCHES Function HD74 Series HD74S Series HD74LS Series Quad. Bistable Latches 75 - 75 4-bit Bistable Latch - - 77 Quad. S-R Latches 279 - 279 8-bit Addressable Latch - - 259 4-bit Bistable Latch - - 375 • RANDOM ACCESS MEMORIES (less than 256-bit) Function HD74 Series HD74S Series HD74LS Series 64-bit Random Access Memory (16w by 4b) 89 • ARITHMETIC ELEMENTS Function HD74 Series HD74S Series HD74LS Series 4-bit Binary Full Adder 83A - 83A 4-bit Magnitude Comparator 85 - 85 Quad. 2-input Exclusive-OR Gates 86 86 86 Quad. Exclusive-OR/NOR Gates - 135 - Quad. 2-input Exclusive-OR Gates (with Open Collector Output) 136 - 136 8-bit Odd/Even Parity Generator/Checker 180 - - 4-bit Arithmetic Logic Unit/Function Generator - 181 181 Look-Ahead Carry Generator (for ALU) 182 182 - Dual Carry Save Full Adders H183 - - Quad. 2-input Exclusive-NOR Gates (with Open Collector Output) - - 266 9-bit Odd/Even Parity Generator/Checker - 280 280 4-bit Binary Full Adder (with Fast Carry) 283 - 283 Quad. 2-input Exclusive-OR Gates - - 386 (to be continued) 311 • DATA SELECTORS/MULTIPLEXERS Function HD74 Series HD74S Series HD74LS Series 16-bit Data Selector/Multiplexer 150 - - 8-bit Data Selector/Multiplexer (with Strobe) 151A 151 151 8-bit Data Selector/Multiplexer - - 152 DuaI4-line-to-1-line Data Selectors/Multiplexers 153 - 153 Quad. 2~line-to-1-line Data Selectors/Multiplexers 157 157 157 Quad. 2-line-to-1-line Data Selectors/Multiplexers - 158 158 8-bit Data Selector/Multiplexer (with Strobe and 3-state Output) 251 251 251 Dual 4-line-to-1-line Data Selectors/Multiplexers (with 3-state Output) - - 253 Quad. 2-line-to-1-line Data Selectors/Multiplexers (with 3-state Output) - 257 257 Quad. 2-line-to-1-line Data Selectors/Multiplexers (with 3-state Output) - 258 258 Quad. 2-input Multiplexers (with Storage) - - 298 • MICROPROCESSOR SUPPORT FUNCTIONS Function HD74 Series HD74S Series HD74LS Series Octal Buffers/Line Drivers/Line Receivers (Inverted 3-state Output) - - 240 Octal Buffers/Line Drivers/Line Receivers (Noninverted 3-state Output) - - 241 Octal Buffers/Line Drivers/Line Receivers (Inverted 3-state Output) - - 244 • OUTLINE IDP-161 I DG-16 I I DG-16A I I DG-20 I 312 ,' . .. ~ REGIONAL O·FFI'CES For furth~r information, contact your Regional Sales Office: Eastern Westerr 9700 Re~da Blvd. •• Central 594 Marrett Road, Suite 22 1 6200 Savoy Drive, Suite 704 Lexington, MA 02173 Suite 208 (617) 861-1642 Northridge, CA 91324 Houston, TX 77036 (713) 974-0534 TWX 710-326-1413 (213) 70l-p606 TWX 910-881-7043 j " ~ !tac~ ~me!a~2!:!r 1800 Bering Drive, San Jose, CA 95112 !nd Ie Sales and Sewice Division (408).292-6404 . . Symbol of Semiconductor Quolity, Worldwide PIlIt-JTFn 1"-1 II ~ A