1986_Microsystem_Components_Handbook_Peripherals_Volume_2 1986 Microsystem Components Handbook Peripherals Volume 2
User Manual: 1986_Microsystem_Components_Handbook_Peripherals_Volume_2
Open the PDF directly: View PDF .
Page Count: 1283
Download | |
Open PDF In Browser | View PDF |
LITERATURE To order Intel Literature write or call: Intel Literature Sales: (800) 548-4725 Other Inquiries: (800) 538-1876 Intel Literature Sales P.O. Box 58130 Santa Clara, CA 95052-8130 Use the order blank on the facing page or call oLir Toll Free Number listed above to order literature. Remember to add your local sales tax and a 10% handling charge for U.S. customers, 20% for Canadian customers. 1986 HANDBOOKS Product Line handbooks contain data sheets, application notes, article reprints and other design information. ORDER NUMBER *PRICE IN U.S. DOLLARS COMPLETE SET OF 9 HANDBOOKS Get a 30% discount off the retail price of $171.00 231003 $120.00 MEMORY COMPONENTS HANDBOOK 210830 $18.00 MICRO COMMUNICATIONS HANDBOOK 231658 $18.00 MICROCONTROLLER HANDBOOK 210918 $18.00 MICROSYSTEM COMPONENTS HANDBOOK Microprocessor and peripherals (2 Volume Set) 230843 $25.00 DEVELOPMENT SYS~S HANDBOOK 210940 $18.00 OEM SYSTEMS HANDBOOK 210941 $18.00 SOFTWARE HANDBOOK 230786 $18.00 MILITARY HANDBOOK 210461 $18.00 QUALITY/RELIABILITY HANDBOOK 210997 $20.00 PRODUCT GUIDE Overview of Intel's complete product lines 210846 No charge LITERATURE GUIDE Listing of Intel Literature 210620 No charge INTEL PACKAGING SPECIFICATIONS Listing of Packaging types, number of leads, and dimensions 231369 No charge NAME *These prices are for the U. S. and Canada only. In Europe and other international locations, please contact your local Intel Sales Office or Distributor for literature prices. u.s. LITERATURE ORDER FORM NAME: _______________________________________________________ COMPANY: ___________________________________________________ ADDRESS: ____________________________________________________ CITY: _______________________________ STATE: _ _ _ _ ZiP: _ _ __ COUNTRY: PHONE NO.: (___"--_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ____ TITLE ORDER NO. 1 I· 1 QTY. PRICE 1 1 1- ,--I'-----'--' __ x __ L-I--L-..L1--L-..l.-..L---.l1 - L-I--L-..L--..J -'----L.1--L-..L-.L.---.l1 -I'---'----L.--..J __ x __ TOTAL __ x __ ,--I 1,--'----'.I-.I..--'--J._I - ,--I",,---"-----, ...J.........l.1-----L-...J.........l._1 - __ x __ --L-..L--..J __ x __ ,--I...J.........l.--<--...J.........l._1 - ,--I-'----L.----' __ x __ ,--,----,-----,--,----,----,1 - '- .1-'---'---' __ x __ ,--I L-I Add appropriate postage and handling to subtotal 10% U.S. 20% Canada ~------------~ Subtotal ______ Your Local Sales Tax ________ - - - - - - - . . Postage & Handling __________ Total __________ Allow 2-4 weeks for delivery Pay by Visa, MasterCard, Check or Money Order, payable to Intel Books. Purchase Orders have a $50.00 minimum o Visa 0 MasterCard Expiration Date ________ Account No. ________________________________________________ Signature: ____________________________________________________ Mail To: Intel Literature Sales P.O. Box 58130 Santa Clara, CA 95052-8130 Customers outside the U.S. and Canada should contact the local Intel Sales Office or Distributor listed in the back of most I ntelliterature. Call Toll Free: (800) 548-4725 for phone orders Prices good until 12/31/86. Source HB Mall To: Intel Literature Sales P.O. Box 58130 Santa Clara, CA 95052-8130 . MICROSYSTEM COMPONENTS HANDBOOK 1986 About Our Cover: The design on our front cover is an abstract portrayal of the unlimited interface linking options available with Intel microsystem components. Intel microprocessors and associated peripherals are the building blocks which provide total systems development solutions. Intel's superior technology, reliability and support provides easier solutions to specific development problems. Thereby, cutting "time-to-market" and creating a greater market share. Intel Corporation makes no warranty for the use of its products and assumes no responsibility for any errors which may appear in this document nor does it make a commitment to update the information contained herein. Intel retains the right to make changes to these specifications at any time, without notice. Contact your local sales office to obtain the latest specifications before placing your order. The following are trademarks of Intel Corporation and may only be used to identify Intel Products: t. ICE, Above, BITBUS, COMMputer, CREDIT, Data Pipeline, GENIUS, i, iCEL, iCS, iDBp, iDIS, 12 1CE, iLBX, im , iMDDX.. iMMX, Insite, Intel, intel, intelBOS, Intelevision, inteligent Identifier, inteligent Programming, Intellec, Intellink, iOSP, iPOS, iPSC, iRMX, iSBC, iSBX, iSOM, iSXM, KEPROM, Library Manager, MCS, Megachassis, MICROMAINFRAME, MULTIBUS, MULTICHANNEL, MULTIMODULE, ONCE, Open NET, Plug-A-Bubble, PROMPT, Promware, QUEST, QueX,Ripplemode, RMX/80, RUPI, Seamless, SLO, UPI, and VLSiCEL, and the combination of ICE, iCS, iRMX, iSBC, iSBX, MCS, or UPI and a numerical suffix. MOS is an ordering code only and is not used as a product name or trademark. MOSII!> is a registered tr;ldemark of Mohawk Data Sciences Corporation. *MULTIBUS is a patented Intel bus. Additional copies of this manual or other Intel literature may be obtained from: I ntel Corporation Literature Distribution Mail Stop SC6-59 3065 Bowers Avenue Santa Clara, CA 95051 "INTEL CORPORATION 1985 Table of Contents NUMERIC INDEX ....................................................................... vi CHAPTER 1 OVERVIEW Introduction ......................................... '. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-1 CHAPTER 2 8080, 8085 MICROPROCESSORS DATA SHEETS 8080A/8080A-1/8080A-2 8-Bit N-Channel Microprocessor ............................. 2-1 8085AH/8085AH-2/8085AH-1 8-Bit HMOS Microprocessor ............................ 2-10 8155H/8156H/8155H-2/8156H-2 2048-Bit Static HMOS RAM with I/O Ports and Timer .... 2-26 8185/8185-2 1024 x 8-Bit Static RAM for MCS®-85 .................................... 2-38 8224 Clock Generator and Driver for 8080A CPU ..................................... 2-43 8228/8238 System Controller and Bus Driver for 8080A CPU ........................... 2-48 8237A/8237A-4/8237A-5 High Performance Programmable DMA Controller............. 2-52 82C37A-5 CHMOS High Performance Programmable DMA Controller................ .. 2-67 8257/8257-5 Programmable DMA Controller .......................................... 2-78 8259A/8259A-2/8259A-8 Programmable Interrupt Controller......................... .. 2-95 82C59A-2 CHMOS Programmable Interrupt Controller........................... ... .. 2-113 8755A/8755A-2 16, 384-Bit EPROM with I/O .......................................... 2-133 APPLICATION NOTES AP-59 Using the 8259A Programmable Interrupt Controller ............................ 2-144 CHAPTER 3 8086, 8088, 80186, 80188 MICROPROCESSCORS DATA SHEETS 8086 16-Bit HMOS Microprocessor .................................................. 80C86/80C86-2 16-Bit CHMOS Microprocessor ...................................... 80186 High Integration 16-Bit Microprocessor ........................................ iAPX 88/10 8-Bit HMOS Microprocessor ............................................. 80C88/80C88-2 8-Bit CHMOS Microprocessor ........ : .............................. 80188 High Integration 8-Bit Microprocessor ......................................... 8087/8087-2/8087-1 Numeric Data Coprocessor ....................................... 8282/8283 Octal Latch ............................................................. 8284A/8284A-1 Clock Generator and Driver for iAPX 86, 88 Processors ................. 82C84A/82C84A-5 CHMOS Clock Generator and Driver for 80C86, 80C88 Processors ... 8286/8287 Octal Bus Transceiver .................................................... 8288 Bus Controller for iAPX 86, 88 Processors . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. . . . . . . . .. 82C88 CHMOS Bus Controller for 80C86, 80C88 Processors .......................... 82188 Integrated Bus Controller for iAPX 86, 88,186,188 Processors ..•................ 8289/8289-1 Bus Arbiter ............................................................ APPLICATION NOTES AP-67 8086 System Design ......................................................... AP-113 Getting Started with the Numeric Data Processor .............................. AP-186 Introduction to the 80186 .................................................... 3-1 3-25 3-52 3-106 3-133 3-162 3-218 3-241 3-246 3-254 3-263 3-268 3-275 3-283 3-299 3-310 3-373 3-435 CHAPTER 4 80286 MICROPROCESSORS DATA SHEETS iAPX 286/10 High Performance Microprocessor 4-1 with Memory Management and Protection ......................................... 80287 80-Bit HMOS Numeric Processor Extension ............................. , .. '. . .. 4-56 82258 Advanced Direct Memory Access Coprocessor ................................. 4-82 82284 Clock Generator and Ready Interface for iAPX 286 Processors ................... 4-139 82288 Bus Controller for iAPX 286 Processors ........................................ 4-148 82289 Bus Arbiter for iAPX 286 Processor Family ..................................... 4-167 CHAPTER 5 80386 MICROPROCESSORS DATA SHEETS 80386 High Performance Microprocessor with Integrated Memory Management.. . . . . . .. 82384 Clock Generator and Reset Interface for 80386 Processors ...................... iii 5-1 5-2 -VOLUME 2CHAPTER 6 MEMORY CONTROLLERS DATA SHEETS 8202A Dynamic RAM Controller ................................................... . 8203 64K Dynamic RAM Controller ............................................•..... 8206/8206-2 Error Detection and Correction Unit ....•....................•........... 8207 Dual-Port Dynamic RAM Controller ....•.•..........•.•.•.•.................... 8208'Dynamic RAM Controller ..... " ......................... , ..............•....... 82C08 CHMOS Dynamic RAM Controller ..•...............•.... ~ ..•................. USERS M A N U A L ' , Introduction ...................................................................... . Programming the 8207 ............................................................ . RAM Interface .. ; ........... '...................................................... . Microprocessor Interfaces .............................................•...•........ 8207 with ECC (8206) •............•................................................ Appendix .......•.. '.............................................................. " APPLICATION NOTES AP-97A Interfacing Dynamic RAM to iAPX 86/88 Using the 8202A & 8203 ....•.......... AP-141 8203/8206/2164A Memory Design ........................................... . AP-167 Interfacing the 8207 Dynamic RAM Controller to the iAPX 186 ................. . AP-168 Interfacing the 8207 Advanced Dynamic RAM Controller to the iAPX 286 .•...... ARTICLE REPRINTS AR-364 FAE News 1/84 "8208 with 186" ............................................•. AR-231 Dynamic RAM Controller Orchestrates Memory Systems ...................... . SUPPORT PERIPHERALS DATA SHEETS 8231 A Arithmetic Processing Unit ............................ : ..................... . 8253/8253-5Programmable Interval Tim,er ......•..............•..•.................. 8254 Programmable Interval Timer ................................. : ............... '. 82C54 CHMOS Programmable Interval Timer .....................•...... , .......... . 8255A/8255A-5 Programmable Peripheral Interface ...•............................... 82C55A CHMOS Programmable Peripheral Interface .....•........................... 8256AH Multifunction Microproces,sor Support Controller ............................ . 8279/8279-5 Programmable Keyboard/Display Interface .............................. . APPLICATION NOTES AP-153 Designing with the 8256 .................................................... . AP-183 8256AH Application Note ' FLOPPY DISK CONTROLLERS DATA SHEETS 8272A Single/Double Density Floppy Disk Controller ..................•.............. " APPLICATION NOTES AP-116 An Intelligent Data Base System Using the 8272 .............................. . AP-121 Software Design and Implementation of Floppy Disk Systems ................. . HARD DISK CONTROLLERS DATA SHEETS 82062 Winchester Disk Controller .................................................. . 82064 Winchester Disk Controller with On-Chip Error Detection and Correction ........ . APPLICATION NOTES AP-182 Multimode Winchester Controller Using the 82062 .. ',' ........................ . UNIVERSAL PERIPHERAL INTERFACE SLAVE MICROCONTROLLERS DATA SHEETS UPI-452 Slave Microcontroller (8051) ............................................... . UPI-41 8-Bit Slave Microcontroller ................................................. . UPI-42 8-Bit Slave Microcontroller ............•..................................... 8243 MCS-48 Input/Output Expander .............................................. . iv 6-1 6-15 6-30 6-52 6-98 6-121 6-151 6-152 6-157 6-166 6-174 6-177 6-181 6-217 6-223 6-228 6-235 6-246 6-253 6-263. 6-274 6-290 6-307 6-328 6-351 6-374 6-386 6-461 ~-478 6-497 6-538 6-608 6-635 6-667 6-729 6-768 6-780 6-799 UPI-41/42 USERS MANUAL Introduction .........•.......•..............•................•................. '•..• 6-805 Functional Description .....................•................•...................... 6-810 Instruction Set .. "...........................................•. ~ .................... 6-827 Single-Step, Programming, and Power-Down Modes .........................•..•..•. 6-854 System Operation ...........................•............•....•..•................ 6-859 Applications ....................................................................... 6-865 AP-161 or 61 Complex Peripheral Control with the UPI-42 ........•.•................•. 6-939 AP-90 An 8741 A/8041 A Digital Cassette Controller ..................................... 6-995 APPLICATION NOTES Applications Using the 8042 UPI T• Microcontroller ................•..............•.... 6-1003 SYSTEM SUPPORT ICE-42 8042 In-Circuit Emulator ....•..•................•.•.........•............... 6-1007 MCS-48 Diskette-Based Software Support Package .................................•. 6-1015 iUP-200/iUP-201 Universal PROM Programmers ..........•.•.......••....•..........• 6-1017 CHAPTER 7 ALPHANUMERIC TERMINAL CONTROLLERS DATA SHEETS 8275H Programmable CRT Controller ................................•.............. 8276H Small System CRT Controller ................................................ APPLICATION NOTES AP-62 A Low Cost CRT Terminal Using the 8275 ..................................... ARTICLE REPRINTS AR-178 A Low Cost CRT Terminal Does More with Less ............................... GRAPHICS DISPLAY PRODUCTS DATA SHEETS 82720 Graphics Display Controller ....................................•............. ARTICLE REPRINTS AR-255 Dedicated VLSI Chip Lightens Graphic Display Design Load ................... AR-298 Graphics Chip Makes Low Cost High Resolution, Color Displays Possible... .... TEXT PROCESSING PRODUCTS DATA SHEETS 82730 Text Coprocessor.. .. . .. ... .. . .. ... ...... .... ..... . ..•.•.. . .. .. ........•... .. ARCHITECTURAL OVERVIEW The 82786 CHMOS Graphics Coprocessor. . . . . . . . . . . . . . . . . • . . • . . . . • . . • . • . • . . . . . . . . .. ARTICLE REPRINTS AR-305 Text Coprocessor Brings Quality to CRT Displays ...•.•...•................... AR-297 VLSI Coprocessor Delivers High Quality Displays .........•.........•......... AR-296 Mighty Chips ......................•.........•.•.....•....•.•..•........... 7-1 7-25 7-42 7-84 7-91 7-128 7-136 7-143 7-187 7-205 7-213 7-216 CHAPTER 8 ERASABLE/PROGRAMMABLE LOGIC DEVICES DATA SHEETS 5C1211200 Gate CHMOS H-Series Eraseable/Programmable Logic Device ............. 5C060 600 Gate CHMOS H-Series Erasable/Programmable Logic Device............... v 8-1 8-15 Numeric Index 5C121 1200 Gate CHMOSH-Series Eraseable/Programmable Logic Device ............... 8-1 5C060 600 Gate CHMOS H-Series Eraseable/Programmable Logic Device .: ............ 8-15 80186 (iAPX 186) High Integration 16-Bit Microprocessor ....................... 3-52, 3-435 80188 (iAPX 188) High Integration 8-Bit Microprocessor ............................. 3-162 80286 (iAPX 286/10) High Performance Microprocessor with Memory Management and Protection ...................................................• 4-1, 6-228, 6-247 80287 80-Bit HMOS Numeric Processor, Extension ................................... .4-56 80386 High Performance Microprocessor with Integrated Memory Management ..........• 5-1 8041A/8641A/8741A UlJiversal Peripheral Interface 8-Bit Slave Micro Controller ................................ : .......... 6-768, 6-805, 6-994 8042/8742 Universal Peripheral Interface 8-Bit Slave Micro Controller ...................... ; ..... 6-780, 6-805, 6-939, 6-1002, 6-1006 80452/83452/87452 Universal Peripheral Interface 8-Bit Slave Micro Controller ... 6-729, 6-805 8080Al8080A-1/8080A-2, 8-Bit N-Channel Microprocessor ....•...... , ................... 2-1 8085AH/8085AH-2/8085AH-1 8-Bit HMOS Microprocessors ....................•........ 2-10 8086 (iAPX 86/10) 16-Bit HMOS Microprocessor .•......................•.. 3-1, 3-310, 6-181 80C86/80C86-2 16-Bit Microprocessor ............... ; ............•................... 3~25 8087/8087-2/8087-1 Numeric Data Coprocessor ................................ 3-218, 3-373 8088 (iAPX 88/10) 8-Bit HMOS Microprocessor .........................•.. ; .. 3-106, 6-181 80C88/80C88-2 8-Bit CHMOS Microproces~or ....................................... 3-133 8155H/8156H/8155H-2/8156H-2 2048-8it Static HMOS RAM with I/O Ports and Timer .... 2-26 8185/8185-2 1024 x 8-Bit Static RAM for MCS®-85 ..................................... 2-38 8202A Dynamic RAM Controller ..............................................• 6-1, 6-181 820364K Dynamic RAM Controller ....•................................. 6-15, 6-181, 6-217 8205 High Speed 1 out of 8 Binary Decoder .................. : ...........•............... 8206 Error Detection and Correction Unit ................................ 6-30, 6-217, 6-247 82062 Winchester Disk Controller ............................ ; ~ .............. 6-608, 6-667 82064 Winchester Disk Controller with On-Chip Error Detection and Correction ....... 6-635 8207 Dual-Port Dynamic RAM Controller ................... 6-52, 6-150, 6-223, 6-228, 6-247 8208 Dynamic RAM Controller ................................................ 6-98, &235 82C08 Dynamic RAM Controller ................................................... 6-121 82188 Integrated Bus Controller for iAPX86, 88, 186, 188 Processors ................. 3-283 8224 Clock Generator And Driver for 8080A CPU ......................•............. ,2-43 82258 Advanced Direct Memory Access Coprocessor ................................. .4-82 8228/8238 System Controller and Bus Driver for 8080ACPU ........................... 2-48 82284 Clock Generator and Ready Interface for iAPX 286 Processors .•...•........... 4-139 82288 Bus Controller for iAPX 286 Processors ...................................... 4-148 82289 Bus Arbiter for iAPX 286 Processor Family ............................. ; ..... 4-167 8231 A Arithmetic Processing Unit .................................................. 6-253 8237A/8237A-4/8237A-5 High Performance Programmable DMA Controller .............. 2-52 82C37A-5 CHMOS High Performance Programmable DMA Controller .................. 2-67 82384 Clock Generator And Reset Interface for 80386 Processors ....................... 5-2 8243 MCS-48 Input/Output Expander ......................................... 6-799,6-805 vi 8253/8253-5 Programmable Interval Timer .......................................... 6-263 8254 Programmable Interval Timer ................................................. 6-274 82C54 CHMOS Programmable Interval Timer ....................................... 6-290 8255A/8255A-5 Programmable Peripheral Interface .................................. 6-307 82C55A CHMOS Programmable Peripheral Interface ................................ 6-328 8256AH Multifunction Microprocessor Support Controller ................ 6-357, 6-386, 6-461 8257/8257-5 Programmable DMA Controller ........................................... 2-78 8259A/8259A-2/8259A-8 Programmable Interrupt Controller ..................... 2-95, 2-144 82C59A-2 CHMOS Programmable Interrupt Controller ............................... 2-113 8272A Single/Double Density Floppy Disk Controller .............. ~ ..... 6-478, 6-497, 6-538 82720 Graphics Display Controller ................... 7-91,7-128,7-136,7-205,7-213,7-216 82730 Text Coprocessor 7-136, 7-143, 7-205, 7-213, 7-216 .. , ......... , .................... , . 8275H Programmable CRT Controller ......................... ~ ................. 7-1, 7-42 8276H Small System CRT Controller ....................................•...... 7-25, 7-84 82786 ............................................................................ 7-187 8279/8279-5 Programmable Keyboard/Display Interface ................... , .......... 6-374 8282/8283 Octal Latch ................................................. " . . . . . . . . .. 3-241 8284A/8284A-1 Clock Generator and Driver for iAPX 86, 88 Processors ............... 3-246 82C84A/82C84A-5 CHMOS Clock Generator And Driver For 80C86, 80C88 Processors ................................................ ,..... 3-254 8286/8287 Octal Bus Transceiver 3-263 ................................................... . 8288 Bus Controller for iAPX 86, 88 Processors ..................................... 3-268 82C88 CHMOS Bus Controller for 80C86, 80C88 Processors ................... '...... 3-275 8289/8989-1 Bus Arbiter ........................................................... 3-299 8755A/8755A-2 16,384-Bit EPROM with I/O ......................................... 2-133 vii CUSTOMER SUPPORT CUSTOMER SUPPORT Customer Support is Intel's complete support service that provides Intel customers with Customer Training, Software Support and Hardware Support; After a customer purchases any system hardware or software product, service and support become major factors in determining whether that product will continue to meet a customer's expectations. Such support requires an international support organization and a breadth of programs to meet a variety of customer needs. intel's extensive customer support includes factory repair services as well as worldwide field service offices providing 'hardware repair services, software support services and customer training classes. HARDWARE SUPPORT. Hardware Support Services provides maintenance on Intel supported products at board and system level. Both field and factory services are offered. Services include several types of field maintenance agreements, instailation and warranty services, hourly contracted services (factory return for repair) and specially negotiated support agreements for system integrators and large volume end-users having unique service requirements. FO,r more information contact your local Intel Sales Office. SOFTWARE SUPPORT . Software Support Service provides maintenance on software packages via software support contracts which include subscription services, information phone support, and updates. Consulting services can be arranged for on-site assistance at the customer's location for both short-term and long-term needs. For complex products such as NDS II or PICE, orientation/ installation packages are available through membership in Insite User's Library, where customer-submitted programs are catalogued and made available for a minimijm fee to members. For more information contact your local Intel Sales Office. CUSTOMER TRAINING Customer Training provides workshops at customer sites (by agreement) and on a regularly scheduled basis at Intel's facilities. Intel offers a breadth of workshops on microprocessors, operating systems and programming languages, etc. For more information on these classes contact the Training Center nearest you. TRAINING CENTER LOCATIONS To obtain a complete catalog of our workshops, call the nearest Training Center in your area. Boston Chicago San Francisco Washington, D.C. Israel Tokyo Osaka (Call Tokyo) Toronto, Canada (617) 692-1000 (312) 310-5700 (415) 940-7800 (301) 474-2878 (972) 349-491-099 03-437-6611 03-437-6611 (416) 675-2105 London Munich Paris Stockholm Milan Benelux (Rotterdam) Copenhagen Hong Kong viii (0793) 696-000 (089) 5389-1 (01) 687-22-21 (468) 734-01-00 39-2-82-44-071 (10) 21-23-77 (I) 198-033 5-215311-7 OVERVIEW INTRODUCTION Intel microprocessors and peripherals provide a complete solution in increasingly complex application environments. Quite often, a single peripheral device will replace anywhere from 20 to 100 TTL devices (and the associated design time that goes with them). Built-in functions and standard Intel microprocessor/ peripheral interface deliver very real time and performance advantages to the designer of microprocessorbased systems. REDUCED TIME TO MARKET When you can purchase an off-the-shelf solution that replaces a number of discrete devices, you're also replacing all the design, testing, and debug time that goes with them. INCREASED RELIABILITY At Intel, the rate offailure for devices is carefully tracked. Highest reliability is a tangible goal that translates to higher reliability for your product, reduced downtime, and reduced repair costs. And as more and more functions are intergrated on a single VLSI device, the resulting system requires less power, produces' less heat, and requires fewer mechanical connections-again resulting in greater system reliability. LOWER PRODUCTION COST By minimizing design time, increasing reliability, and replacing numerous parts, microprocessor and peripheral solutions can contribute dramatically to lower product costs. HIGHER SYSTEM PERFORMANCE Intel microprocessors and peripherals provide the highest system performance for the demands of today's (and tomorrow's) microprocessor-based applications. For example, the 80386 32 bit offers the highest performance for multitasking, multiuser systems. Intel's peripheral products have been designed with the future in mind. They support all of Intel's 8, 16 and 32 bit processors. HOW TO USE THE GUIDE The following application guide illustrates the range of microprocessors and peripherals that can be used for the applictions in the vertical column of the left. The peripherals are grouped by the I/O function they control. CRT datacommunication, universal (user programmable), mass storage dynamic RAM controllers, and CPU/bus support. An "X" in a horizontal application row indicates a potential peripheral or CPU, depending upon the features desired. For example, a conversational terminal could use either of the three display controllers, depending upon features like the number of characters per row or font capability. A "Y" indicates a likely candidate, for example, the 8272A Floppy Disk Controller in a small business computer. The Intel microprocessor and peripherals family provides a broad range of time-saving, high performance solutions. inter Intel's Microsystem Components Kit Solution [1 ex:> c c c CD ex:> ..... c ex:> CD CD N C ex:> ex:> ex:> ex:> . DATA COMMUNICATIONS MICROPROCESSORS DISPLAY~ ..... ..... ....... < ex:> ex:> M N N 0> N 0> N CD UPI ;g ....... ... .... .... DISK DRAM CONTROL N C C M II) N ex:> a, CD CD II) ex:> iD ex:> II) II) N N ex:> ... N C ~ ...~ ... N C C ex:> ex:> ex:> PERIPHERALS ~ N .... N c N X: X.II Printers Plotters Keyboards X X MASS STORAGE . M CD ..... N CD ex:> N N c .1. J ex:> I X X c ... ...~ ex:> ex:> ex:> C ~ ex:> N II) II) II) II) ~ II) .;, :J: .... N ~ .... N .0> CD I. LX X Hard Disk Mini Winchester Tape Cassette Floppy/Mini .X Y X X X X X Y COMMUNICATIONS j( X x. PBX LANS Modems Bisync SOLC/HOLC Serial Backplane Central Office Network Control X X X X X X xl IX. X X X X Copier/FAX Word processor Typewriter Electronic Mail Transaction System Data Entry X X X Jf, ~ - ~ COMPUTERS X X X Y X X X X X X X X X X X X X y Y Y Y y Y X X X y X X Ix X. I Y y ){ X y y , X X X X ~~I XIX, X X X X X OFFICE/BUS SM Bus Computer PC Portable PC Home Computer c c . SUPPORT X X X ·X X X X X y X X xIX y y X Y. Y X y y X Y Y X ...,... APPLICATION CD CD CD 0 CD CD CD 0 CD ... ... CD CD CD CD 0 CD 0 CD CD CD N 0 CD y y 5;... N CD . ..... DATA COMMUNICATIONS MICROPROCJ;..SSORS DISPLAY '" N ... ..... . c'" ... ..,... ...on ..,... ....... ;;; ..,on 0 N 0 N CD N CD c( N CD 0 N CD N CD N CD UPI DISK DRAM CONTROL N 0 N CD . ~ CD CD 5 on CD CD N CD N CD on on N ~ ...!!!!.... !!!!....... N .... .... .... 0 0 CD CD .... N CD CD 0 N CD 0 N CD X X X X c( ... N ..... ..., 0 N CD CD 0 N CD .... 0 N CD SUPPORT m .... 0 on ~ 0 m ~ 0 on N CD N CD on on on 0 iii on N CD ::t a.... N CD c( CD Gi N CD N CD on ... TERMINALS Conversational Graphics CRT Editing Intelligent Videotex Printing, Laser, Impact Portable INDUSTRIAL AUTO y. )( I X xiX f"X;1 y y y X X y X X X X y ,&.I,p" X ,~iX7dx,,, X 1<. .~ "~T' X "'XP'lt X X .X y yrX' .X .Y. )S =~,,~''''~, ,S7' '7' ",. Robotics Network Numeric Control Process Control Instrumentation Aviation/Navigation )( .K )(. 2<. X '( 'I',':'· r":': y =X X _X. .X .)(. X )(. )s.. ,;"'; X X Y. X ...... ;~ I' X r,J' ,;.," ...':; 'Y.' 7v', ·X X ,.,,'; X X X X X X )C.X 1··...·:< X f'; ..···, "K' .~:' INDUSTRIAUDATA ACO. Laboratory Instrumentation Source Data Auto Test Medical Test Instrumentation Security' COMMERCIAL DATA PROCESSING POS Terminal Financial Transfer Automatic Teller Document Processing WORKSTATIONS ·X[X: ·YT)( X 'x\X Ix ·xlx· X :X:I'X'li¥;~ y l OuTO-i5Uf6 ""X AH, Vee AH, AHs AH, AH, AH, ROW AHa ADDRESS ALa 60 REFRESH COUNTER ........... RiSIS1-------I ... - - - - - - - 1 iiCs-----oj RA'So aiJTo m, m2 M1 RAs3 AL, AL, M2 AL, CAS TIMING GENERATOR N.C. REFRO/AlE WE 0iJf3 AL4 0iJf4 SACK REFRO/ALE --------1 ALS 5lJfs XACK ALO 0uT6 GNO Figure 1. 8202A Block Diagram Figure 2. Pin Configuration 6-1 205215-001 8202A Table 1. Pin Descriptions Name and Function Symbol Pin No. Type Name and Function I I I I I I I Address Low: CPU address in· puts used to generate memory' row address. RASO RAS1 RAS2 RAS3 21 22 23 26 0 0 0 0 Row Address Strobe: Used to latch the Row Address into the bank of dynamic RAMs, select· ed by the 8202A Bank Select pins (BO, Bl/0Pl). XACK 29 0 5 4 3 2 1 39 38 I I I I I I I Address High: CPU address in· puts used to generate memory column address. Transfer Acknowledge: This output is a strobe indicating val· id data during a read cycle or data written during a write cycle. XACK can be used to latch valid data from the RAM array. SACK 30 0 BO Bl/ 0P l 24 25 I I Bank Select Inputs: Used to gate the appropriate RASO· RAS3 output for a memory cy· cle. B 1/ OP 1 option used to se· lect the Advanced Read Mode. PCS 33 I Protected Chip Select: Used to enable the memory read and write inputs. Once a cycle is started, it will not abort even if PCS goes inactive before cycle completion. System Acknowledge: This output indicates the beginning of a memory access cycle. It can be used as an advanced trans· fer acknowledge to eliminate wait states. (Note: If a memory access request is made during a refresh cycle, SACK is delayed until XACK in the memory ac· cess cycle). (XO) OP2 (XI) ClK 36 37 110 110 Oscillator Inputs: These inputs are designed for a quartz crystal to control the frequency of the oscillator. If XO/ OP2 is connect· ed to a 1Kfl resistor pulled to + 12V then XI / ClK becomes a TTL input for an external clock. N.C. 35 Reserved for future use. Vce 40 Power Supply:+5V. GND 20 Ground. Symbol Pin No. Type ALo ALI Al2 AL3 AL4 Al5 Al6/ 6 8 10 12 14 16 18 AHO AHI AH2 AH3 AH4 AH5 AH6 WR 31 I Memory Write Request. RD/Sl 32 I Memory Read Request: SI function used in Advanced Read mode selected by OP 1 (pin 25). REFRQ/ ALE 34 OUTO OUTI OUT2 OUT3 OUT4 OUT5 OUT6 7 9 11 13 15 17 19 I 0 0 0 0 0 0 0 External Refresh Request: ALE function used in Advanced Read mode, selected by OP 1 (pin 25). NOTE: Crystal mode for the B202A·l or 8202A·3 only. Output of the Multiplexer: These outputs are designed to drive the addresses olthe Dynamic RAM array. (Note that the OUT0.6 pins do not require inverters or drivers for proper operation.) I--.....-~--I Xo cs* I I I lKn ±5% I x, 8202A-l or 8202A-3 WE CAS 28 27 0 0 Write En,able: Drives the Write Enable inputs of the Dynamic RAM array. Cs < 10pF FUNDAMENTAL XTAl Column Address Strobe: This output is used to latch the Col· umn Address into the Dynamic RAM array. Figure 3. Crystal Operation for the 8202A-1 and the 8202A-3 6-2 205215-001 inter 8202A Functional Description the memory's rows. The 8-bit counter is incremented after every refresh cycle. The 8202A provides a complete dynamic RAM controller for microprocessor systems as well as expansion memory boards. All of the necessary control signals are provided for 2117 and 2118 dynamic RAMs. Address Multiplexer The address multiplexer takes the address inputs and the refresh counter outputs, and gates them onto the address outputs at the appropriate time. The address outputs, in conjunction with the RAS and CAS outputs, determine the address used by the dynamic RAMs for read, write, and refresh cycles. During the first part of a read or write cycle, ALo-ALa are gated to OUTO-OUTS, then AHo-AHa are gated to the address outputs. All 8202A timing is generated from a single reference clock. This clock is provided via an external oscillator or an on chip crystal oscillator. All output signal transitions are synchronous with respect to this clock reference, except for the CPU handshake signals SACK and XACK (trailing edge). CPU memory requests normally use the RD and WR inputs. The advanced READ mode allows ALE and S 1 to be used in place of the RD input. During a refresh cycle, the refresh counter is gated onto the address outputs. All refresh cycles are RAS-only refresh (CAS inactive, RAS active). Failsafe refresh is provided via an internal refresh timer which generates internal refresh requests. Refresh requests can also be generated via the REFRQ input. To minimize buffer delay, the information on the address outputs is inverted from that on the address inputs. An on-chip synchronizer / arbiter prevents memory and refresh requests from affecting a cycle in progress. The READ, WRITE, and external REFRESH requests may be asynchronous to the 8202A clock; on-chip logic will synchronize the requests, and the arbiter will decide if the requests should be delayed, pending completion of a cycle in progress. OUTO-OUT a do not need inverters or buffers unless additional drive is required. Synchronizer / Arbiter The 8202A has three inputs, REFRQ / ALE (pin 34), RD (pin 32) and WR (pin 31). The RD and WR inputs allow an external CPU to request a memory read or write cycle, respectively. The REFRQ/ ALE allows refresh requests to be requested external to the 8202A. Option Selection The 8202A has two strapping options. When OP,is selected (1SK mode only). pin 32 changes from a RD input to an S 1 input, and pin 34 changes from a REFREQ input to an ALE input. See "Refresh Cycles" and "Read Cycles" for more detail. OP1 is selected by tying pin 25 to +12V through a 5.1 K ohm resistor on the 8202A-1. or 8202A-3 only. All three of these inputs may be asynchronous with respect to the 8202A's clock. The arbiter will resolve conflicts between refresh and memory requests, for both pending cycles and cycles in progress. Read and write requests will be given priority over refresh requests. System Operation When OP2 is selected, by connecting pin 3a to + 12V through a 1K ohm resistor, pin 37 changes from a crystal input (X 1) to the CLK input for an external TIL .clock. The 8202A is always in one of the following states: a) b) c) d) e) Refresh Timer The refresh timer is used to monitor the time since the last refresh cycle occurred. When the appropriate amount of time has elapsed, the refresh timer will request a refresh cycle. External refresh requests will reset the refresh timer. IDLE TEST Cycle REFRESH Cycle READ Cycle WRITE Cvcle The 8202A is normally in the IDLE state. Whenever one of the other cycles is requested, the 8202A will leave the IDLE state to perform the desired cycle. If no other cycles are pending, the 8202A will return to the IDLE state. Refresh Counter The refresh counter is use'd to sequentially refresh all of Description Pin # Normal Function B1/0P1 25 Bank (RAS) Select Advanced-Read Mode (see text) XO/OP2 36 Crystal Oscillator (8202A-1 or 8202A-3) External Oscillator Option Function .... igure 4. 8202A Option Selection 6-3 205215-001 8202A Test Cycle The TEST Cycl!;! is used to check operation of several 8202A internal functions. TEST cycles are requested by activating the RD and WR inputs, independent of PCS. The TEST Cycle will reset the refresh address counter. It will perform a WRITE Cycle if PCS is low. The TEST Cycle should not be used in normal system operation, since it would affect the dynamic RAM refresh. SO~ - - - - REFRQ -"" 8202A '-_ _________ Refresh Cycles Figure 5. The 8202A has two ways of providing dynamic RAM refresh: ~:;Kor Hidden Refresh Read Cycles The 8202A can accept two different types of memory, Read requests: 1) Internal (failsafe) refresh 2) External (hidden) refresh 1) Normal Read, via the RD input 2) Advanced Read, using the S1 and ALE inputs Both types of 8202A refresh cycles activate all of the RAS outputs, while CAS, WE, SACK, and XACK remain inactive. . The user can select the desired Read request configuration via the B1 /OP1 hardware strapping option on pin 25. Internal refresh is generated by the on-chip refresh timer. The timer uses the 8202A clock to ensure that refresh of all rows of the dynamic RAM occurs every 2 milliseconds. If REFRQ is inactive, the refresh timer will request a refresh cycle every 10-16 microseconds. Pin 25 Pin 32 Pin 34 # RAM banks Ext. Refresh Req. External refresh is requested via the REFRQ input (pin 34). External refresh control is not available when the Advanced-Read mode is selected. External refresh requests are latched, then synchronized to the 8202A clock. Normal Read Advanced Read 81 input RD input REFRQ input 4 (RAS 0.3) Yes +12 Volt Option Sl input ALE input 2 (RAS 2-3) No Figure 6. 8202A Read Options The arbiter will allow the refresh request to start a refresh cycle orily if the 8202A is not in the middle of a cycle. Normal Reads are requested by activating the RD input, and keeping it active until the 8202A responds with an XACK pulse. The RD input can go inactive as soon as the command hold time (tCHS) is met. Simultaneous memory request and external refresh request will result in the memory request being honored first. This 8202A characteristic can be used to "hide" refresh cycles during system operation. A circuit similar to Figure 5 can be used to decode the CPU's instruction fetch status to generate an external refresh request. The refresh request is latched while the 8202A performs the instruction fetch; the refresh cycle will start immediately after the memory cycle is completed, even if the RD input has not gone inactive. If the CPU's instruction decode time is long enough, the 8202A can complete the refresh cycle before the next memory request is generated. Advanced Read cycles are requested by pulsing ALE while S 1 is active; if S 1 is inactive (low) ALE is ignored. Advanced Read timing is similiar to Normal Read timing, except the falling edge of ALE is used as the cycle start reference. If a Read cycle is requested while a refresh cycle is in progress, then the 8202A will set the internal delayedSACK latch. When the Read cycle is eventually started, the 8202A will delay the active SACK transition until XACK goes active, as shown in the AC timing diagrams. This de-' lay was designed to compensate for the CPU's READY setup and hold times. The delayed-SACK latch is cleared after every READ cycle. Certain system configurations require complete external refresh requests. If external refresh is requested faster than the minimum internal refresh timer (tREF), then, in effect, all refresh cycles will be caused by the external refresh request, and the internal refresh timer will never generate a refresh request. Based on system requirements, either SACK or XACK can be used to generate the CPU READY signal. XACK will 6-4 205215-001 8202A normally be used; if the CPU can tolerate· an advanced READY, then SACK can be used, but only if the CPU can tolerate the amount of advance provided by SACK. If SACK arrives too early to provide the appropriate number of WAIT states, then either XACK or a delayed form of SACK should be used. A microprocessor system is concerned with the time data is valid after RD goes low. See Figure 7. In order to calculate memory read access times, the dynamic RAM's A.C. specifications must be examined, especially the RAS-access time (tRAC) and the CAS-access time (tCAC). Most configurations will be CAS-access limited; i.e., the data from the RAM will be stable tcc,max (8202A) + tCAC (RAM) after a memory read cycle is started. Be sure to add any delays (due to buffers, data latches, etc.) to calculate the overall read access time. Write Cycles Write cycles are similiar to Normal Read cycles, except for the WE output. WE is held inactive for Read cycles, but goes active for Write cycles. All 8202A Write cycles are "early-write" cycles; WE goes active before CAS goes active by an amount of time sufficient to keep the dynamiC RAM output buffers turned off. Since the 8202A normally performs "early-write" cycles, the data must be stable at the RAM data inputs by the time CAS goes active, including the RAM's data setup time. If the system does not normally guarantee sufficient write data setup, you must either delay the WR input signal or delay the 8202A WE output. General System Considerations All memory requests (Normal Reads, Advanced Reads, Writes) are qualified by the PCS input. PCS should be stable, either active or ·inactive, prior to the leading edge of RD, WR, or ALE. Systems which use battery backup should pullup PCS to prevent erroneous memory requests, and should also pullup WR to keep the 8202A out of its test mode. Delaying the WR input will delay all 8202A timing, including the READY handshake signals, SACK and XACK, which may increase the number of WAIT states generated by the CPU. If the WE output is externally delayed beyond the CAS active transition, then the RAM will use the falling edge of WE to strobe the write data into the RAM. This WE transition should not occur too late during the CAS active transition, or else the WE to CAS requirements of the RAM will not be met. In order to minimize propagation delay, the 8202A uses an inverting address multiplexer without latches. The system must provide adequate address setup and hold times to guarantee RAS and CAS setup and hold times for the RAM. The 8202A tAD AC parameter should be used for this system calculation. The BO-B 1 inputs are similiar to the address inputs in that they are not latched. BO and B 1 should not be changed during a memory cycle, since they directly control which RAS output is activated. Ro~I ~----~--------~I ~ DATA The 8202A uses a two-stage synchronizer for the memory request inputs (RD, WR, ALE), and a separate two stage synchronizer for the external refresh input (REFRQ). As with any synchronizer, there is always a finite probability of metastable states inducing system errors. The 8202A synchronizer was designed to have a system error rate less than 1 memory cycle every three years based on the full operating range of the 8202A. ______ / -J _ _ _ II "':q-----tRlDV !IE B-- -----------« I : t-tRAC-.......J I I RAS i ;- ------""""'~ I I tCAC I 1;- 4----+1 CAS - - - - - - - - - - - - - - " ' ' \ Figure 7. Read Access Time 6-5 205215-001 8202A 2118 DYNAMIC RAM ARRAY AS-15 ALE 8088 ADO-7 RO WR ~ ALO-6 ...... r--AO-6 r OTITO-6 AHO-6 80-1 8202A {16K MODE) ~ WE CAS r=p RAS, -< f- RASa RD/S1 WR E- RAS2t:: RAS3 SACK ."..-- ~ r' BAL l - WE CAS RAS DIN DOUl -1 ~ .. ::: U + AO-6 XACK ~ t---- O'N DOU1 WE CAS RAS DIN DOUT D'N DOUT :u '1, II AO-. WE - ,TT. CAS RAS D'N IT DIN DOUT ~ AO-• BAL D'N ~S~ DATA-BUS c.-===: CAS RAS DIN DOUT 1" T V --1\ D'N WE D'N DOUT I DATA LATCH IN D'N DOUT J ,ID'NDOUT DIN DOUT Dour DOUT DOUT .--- J j Figure 8. Typical 8088 System 6-6 205215-001 inter 8202A ABSOLUTE MAXIMUM RATINGS' •NOTE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Ambient Temperature Under Bias ............ O'C to 70'C Storage Temperature ................ -6S0C to +150°C Voltage On any Pin With Respect to Ground ................ -0.5V to +7V4 Power Dissipation ............................ 1.5 Watts D.C. CHARACTERISTICS TA = O°C to 70°C; VCC = 5.0V ± Min 10%, VCC Parameter Vc Input Clamp Voltage -1.0 V ICC Power Supply Current 270 rnA IF Forward Input Current ClK All Other Inputs 3 -2.0 -320 IR Reverse Input Current 3 VOL Output low Voltage SACK,XACK All Other Outputs VOH Output High Voltage SACK,XACK All Other Outputs Vil Input low Voltage VIHI Input High Voltage VIH2 Option Voltage CIN Input Capacitance Max = 5.0V ± Symbol Units 5% for 8202A-3, GND IC = -S rnA rnA p.A VF VF = 0.45V = O.4SV 40 p.A VR =Vee (Note 1) 0.45 0.45 V V 10l 10l V. V 10H 10H V VCC = 5.0V (Note 2) 2.4 2.6 0.8 2.0 30 = OV Test Conditions = 5 rnA = 3 rnA Vil = 0.65V =; -1 rnA = -1 rnA V VCC = 5.0V V (Note 4) pF F = 1 MHz VB lAS = 2.SV, VCC = 5V TA = 2S'C NOTES: 1. IR = 200l'A for pin 37 (elK) for external clock mode. 2. For test mode RD & WR must be held at GND. 3. Except for pin 36. 4. 8202A-l and 8202A-3 supports both OP, and OP,. 8202A only supports OP,. +12 Volt ±10% ' K 36 OP, 8202A 1 5.1 K 2S OPI Resistor Tolerance: ±5% 6-7 205215-001 8202A A.C. CHARACTERISTICS TA = O'C to 70'C, vcc "" 5V ± 10%, VCC = 5V ± 5% for 8202A-3 Measurements made with respect to RASO-RAS3, CAS, WE,OUTo-OUTe are at 2.4V and 0.8V. All other pins are measured at 1.5V. All times are in nsec. Symbol Parameter Min Max tp Clock Period 40 54 tpH External Clock High Time 20 tpL External Clock Low Time-above (» 20 mHz 17 tpL External Clock Low Time-below «) 20 mHz 20 tRC Memory Cycle Time tREF Refresh Time (128 cycles-16K mode) 10tp - 30 12tp 264tp 288tp Notes 4,5 tRP RAS Precharge Time 4tp - 30 tRSH RAS Hold After CAS 5tp - 30 3 tASR Address Setup to RAS tp - 30 3 tRAH Address Hold From RAS tp - 10 3 tASC Address Setup to CAS tp - 30 3 tCAH Address Hold from CAS 5tp - 20 3 tCAS 5tp - 10 'CAS Pulse Width twcs WE Setup to CAS tp - 40 tWCH WE Hold After CAS 5tp - 35 tRS RD, WR, ALE, REFRQ delay from RAS tMRP RD, WR setup to RAS tRMS REFRQ setup to RD, WR 2tp tRMP REFRQ setup to RAS 2tp tpcs PCS Setup to RD, WR, ALE 20 tAL S 1 Setup to ALE 15 tLA S 1 Hold from ALE 30 tCR RD, WR, ALE to RAS Delay tp tcc RD, WR, ALE to CAS Delay 3tp tsc CMD Setup to Clock 15 tMRS RD, WR setup to REFRQ 5 + 30 + 25 tCA RD, WR, ALE to SACK Delay CAS to XACK Delay 5tp - 25 tcs CAS to SACK Delay 5tp - 25 tACK XACK to CAS Setup 10 XACK Pulse Width tCK SACK, XACK turn-off Delay 5 0 tcx txw 8 5tp 5 2tp 4tp + 70 + 85 2 2 1 + 47 + 20 5tp + 40 2tp 2,9 5tp tp - 25 2,10 7 35 tKCH CMD Inactive Hold after SACK, XACK 10 tLL REFRQ Pulse Width 20 tCHS CMD Hold Time 30 tRFR REFRQ to RAS Delay tww WR to WE Delay tAD CPU Address Delay 11 + 100 e 0 50 8 0 40 3 4tp 6-8 205215-001 8202A WAVEFORMS Normal Read or Write Cycle tRS -----+- Advanced Read Mode ALE IAS- ~~1~- __ ~'i~_I'-------_---J ICC -MAX XACK SACK -tCA- 6-9 205215-001 intJ 8202A WAVEFORMS (cont'd) Memory Compatibility Timing ~~ _______________V_A_lI_D_AD_D_RE_S_S________________ ~~~ ~~~~ ------+ ____________________________ -~~- !\ :1 tRSH I tCAS / !\ !---tASR_ ~ !--tRAH ..... ROW -tASC-- X I-tCAH- K COLUMN Write Cycle Timing I \ I 1\ .1 ~~C~-\ MIN -~'i~-I' \ --1/ _twcs_ . tcc MIN . tcc MAX - + - - - - tWCH 6-10 . tww - I 205215-001 inter 8202A WAVEFORMS (cont'd) Read or Write Followed By External Refresh \ RD, WR \. ...- tMRS---' ........- tLl ______ REFRQ I It \ \ . 1\ . . . tMIccN tcc MAX __ tRP_. tRMP l~tRS_ .---~'i~~ tRC .r\ .1 ~ External Refresh Followed By Read or Write iffi,WR _tRMS - . l+=========-tM-R-P==========o-I.-I-----------.. ,----"""' REFRQ -tLL I··--- tRs ....... J---:-----tRC - - - - - - 1 \'----- 6-11 205215-00) intJ 8202A WAVEFORMS (cont'd) Clock And System Timing elK RD, \YR, ALE Table 2 8202A Output Test Loading A.C. TESTING LOAD CIRCUIT Test Load Pin SACK.XACK OUTo-OUTe RASo-RAS3 WE CAS CL=30pF CL = leo pF CL=60pF CL = 224 pF CL = 320 pF . NOTES: 1. tsc Is a reference point only. ALE. RO. WR. and REFRQ inputs do not have to be externally synchronized to 8202A clock. 2. If tRS min and tMRS min are met then. tCA. tCR. and tcc are valid. otherwise tcs Is valid. 3. tASR. tRAH. tASC. tCAH. and tRSH depend upon 80-81 and CPU .address remaining stable throughout the memory cycle. The address Inputs are not latched by the 8202A. 4. For back-to-back refresh cycles. tRC max = 13tp 5. tRC max Is valid only if tRMP min Is met (READ. WRITE followed by REFRESH) or tMRP min Is met (REFRESH followed by READ. WRITE). 8. tRFR Is valid only If tRS min and tRMS min are met. 7. txw min applies when RD. WR has already gone high. Otherwise XACK follows RD. WR. 8. WE goes high according to tWCH or tWW. whichever occurs first.· DEVICE UNDER TEST I C ' C, INCLUDES JIG CAPACITANCE 9. tCA applies only when In normal SACK mode. 10. tcs applies only when in delayed SACK mode. 11. tCHS must be met only to ensure a SACK active pulse when In delayed SACK mode. XACK will always be activated for at least txw (tp-25 nS). Violating tCHS min does not otherwise affect device operation. 6-12 205215-001 inter 8202A The typical rising and falling characteristic curves for the OUT, RAS, CAS and WE output buffers can be used to determine the effects of capacitive loading on the A.C. Timing Parameters. Using this design tool in conjunction ""lith the timing waveforms, the designer can determine typical timing shifts based on system capacitive load. A.C. CHARACTERISTICS FOR DIFFERENT CAPACITIVE LOADS 5.0 , _ _ _, -_ __+---.,-----,----,------,----,----,---'C::.A,PA"'C::.'T"'A;.:NC:::E::.'.:.:,PF 0.81----1----J,~~3..s~~--_1__---1-----I---_J---_1___-_I__ __....j O.O~--~---_+---~---~---L---~---~----L---~--~ ~5n'-1 TIME 5.0 . -_ _---,_---+-----r---,-----r------,-----.------.----C-A.,.PA-C-'T-A-NC-E-',-!PF ~ ...~ "o 2A~----_4----4__+4-~~~--~~~~~~~----_4------_+----~----+----~ TIME NOTE: MEASUREMENT CONDITIONS: Use the Test Load as the base capacitance for estimating timing shifts for system critical timing parameters. TA = 25'C Vee = +5V tp = 50 ns 6-13 Pins not measured are loaded with the Test Load capacitance. 205215-001 8202A Example: Find the effect on teR and tee using 64 2118 Dynamic RAMs configured in 4 banks. 1. Determine the typical RAS and CAS capacitance: From the data sheet RAS = 4 pF and CAS = 4 pF. :. RAS load = 64 pF + board capacitance. CAS load = 256 pF + board capacitance. Assume 2 pF/in (trace length) for board capacitance. 2. From the waveform diagrams, we determine that the fallins. edge timing is needed for teR and tee. Next find the curve that best app~oximates the test load; i.e., 68 pF for RAS and 330 pF for CAS. 3. If we use 72 pF for RAS loading, then the teR (max.) spec should be increased by about 1 ns. Similarly if we us~ 288 pF for CAS, then tee (min.) and (max.) should decrease about 1 ns. 6-14 205215-001 8203 64K DYNAMIC RAM CONTROLLER • Provides All Signals Necessary to Control64K (2164) and 16K (2117, 2118) Dynamic Memories • Fully Compatible with Intel® 8080A, 808SA, iAPX 88, and iAPX 86 Family Microprocessors • Directly Addresses and Drives Up to 64 Devices Without External Drivers • Decodes CPU Status for Advanced Read Capability in 16K mode with the 8203-1 and the 8203-3. • Provides Address Multiplexing and Strobes • Provides a Refresh Timer and a Refresh Counter • Provides Refresh/ Access Arbitration • Internal Clock Capability with the 8203-1 and the 8203-3 • Provides System Acknowledge and Transfer Acknowledge Signals • Refresh Cycles May be Internally or Externally Requested (For Transparent Refresh) • Internal Series Damping Resistors on All RAM Outputs The Intel® 8203 is a Dynamic Ram System Controller designed to provide all signals necessary to use 2164, 2118 or 2117 Dynamic RAMs in microcomputer systems. The 8203 provides multiplexed addresses and address strobes, refresh logic, refresh/access arbitration. Refresh cycles can be started internally or axternally. The 8203-1 and the 8203-3 support an internal crystal oscillator and Advanced Read Capability. The 8203-3 is a ±5% Vee part. ~ AH4 Vee AH3 AH, OiJTo--OiJT1 AH. AH, x,/elK AH. oow 'DD"'" .... oo REFRESH AH, RAJ, a1/OPt ..., COUNTER W2 00/51 _ _ _ _ _- - / "'-------/ OB-------t .. on ~OR .... - Figure 1. 8203 Block Diagram AL. ODTo AL, lftlf, AL, 16K/64I( REFRQ/ALE PeS 00151 Wo iIDf2 SACK AL3 XACK 0uT3 AL4 M4 Al, OUTs Al. we CAs RAS3 (801 D,/0P, (AH71 Bo (AL7) AAS2 (M71 0iJi6 RAS1 GNO RASo Figure 2. Pin Configuration Intel Corporation Assumes No Responsibility for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied. ©INTELCORPORATION.1982 6-15 JANUARY 1985 ORDER NUMBER: 210444-004 8203 'NOTE: Stresses above those listed under "Absolute Maximu'!' Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for exten'ded periods may affect device reliability. ABSOLUTE MAXIMUM RATINGS' Ambient Temperature Under Bias ............ O°C to 70'C Storage Temperature ..... . .... -65°C to +150'C Voltage On any Pin With Respect to Ground ................ -0.5V to + 7V4 Power Dissipation ............................ 1.6 Watts D.C. CHARACTERISTICS TA = O°C to 70'C' VCC = 50V + - 10% (5 OV +- 5% for 8203-3)' GND = OV Symbol Parameter Max Units Vc Input Clamp Voltage -1.0 V ICC Power Supply Current 290 rnA IF Forward Input Current ClK. 64K/16K Mode select All Other Inputs 3 -2.0 -320 rnA /lA VF = 0.45V VF = 0.45V 40 /lA VR = VCC; Note 1,5 0.45 0.45 V V 10l = 5 rnA 10l = 3 rnA V V Vil = 0.65 V 10H = -1 rnA 10H = -1 rnA 0.8 V VCC = 5.0V (Note 2) VCC V VCC = 5.0V VCC V (Note 4) 30 pF Min IR Reverse Input Current 3 VOL Output low Voltage SACK,XACK All Other Outputs Output High Voltage SACK,XACK All Other Outputs VOH Vil Input low Voltage VIH1 Input High Voltage VIH2 Option Voltage CIN Input Capacitance 2.4 2.6 2.0 Test Conditions IC =-5 rnA F = 1 MHz NOTES: 1. IR = 200 p.A for pin 37 (elK). 2. For test mode RD & WR must be held at GND. 3. Except for pin 36 in XTAl mode. 4. 8203-1 and 8203-3 supports both OPI and OP2, 8203 only supports OP2. +12 Volt ±10% 8203 1K 36 L---'INI~--I 0,," Resistor Tolerance: ± 5'% L..._ _--I 5. IR = 150/lA for pin 35 (Mode Select 16K/64K) 6-16 VBIAS = 2.5V, VCC = 5V TA = 25'C 8203 Table Symbol Pin No. ALa AL1 AL2 AL3 AL4 AL5 AL6 Type 1. Pin Descriptions Pin No. Type Name and Function RASa RAS1 RAS21 OUT7 RAS3/BO 21 22 23 0 0 0 26 1/0 Row Address Strobe: Used to latch the Row Address into the bank of dynamic RAMs, selected by the 8203 Bank Select pins (BO, B1/OP1). In 64K mode, only RASa and RAS 1 are available; pin 23 operates as OUT 7 and pin 26 operates as the BO bank select input. XACK 29 0 Transfer Acknowledge: This output is a strobe indicating valid data during a read cycle or data written during a write cycle. XACK can be used to latch valid data from the RAM array. SACK 30 0 System Acknowledge: This output indicates the beginning of a memory access cycle. It can be used as an advanced transfer acknowledge to eliminate wait states. (Note: If a memory access request is made during a refresh cycle, SACK is delayed until XACK in the memory access cycle). XOIOP2 X1 /CLK 36 37 1/0 110 Oscillator Inputs: These inputs are designed for a quartz crystal to control the frequency of the oscillator. If XOIOP2 is shorted to pin 40 (VCC) or if XOIOP2 is connected to + 12V through a 1KQ resistor then X 1/ CLK becomes a TTL input for an external clock. (Note: Crystal mode for the 8203-1 and the 8203-3 only). 16K/64K 35 I Mode Select: This input selects 16K mode (2117,2118) or 64K mode (2164). Pins 23-26 change function based on the mode of operation. VCC 40 Power Supply: +5V. GND 20 Ground_ Name and Function Symbol 6 8 10 12 14 16 18 Address Low: CPU address inputs used to generate memory row address_ AHa AH1 AH2 AH3 AH4 AH5 AH6 5 4 3 2 1 39 38 Address High: CPU address inputs used to generate memory column address_ BO/AL7 24 25 Bank Select Inputs: Used to gate the appropriate RAS output for a memory cycle. B 11 OP 1 option used to select the Advanced Read Mode. (Not available in 64K mode.) See Figure 5. When in 64K RAM Mode, pins 24 and 25 operate as the AL 7 and AH7 address inputs. B1 /OP 1 1 AH7 PCS 33 I Protected Chip Select: Used to enable the memory read and write inputs. Once a cycle is started, it will not abort even if PCS goes inactive before cycle completion. WR 31 I Memory Write Request. RD/S1 32 I Memory Read Request: S1 function used in Advanced Read mode selected by OP1 (pin 25). REFRQI ALE 34 I External Refresh Request: ALE function used in Advanced Read mode, selected by OP 1 (pin 25). OUTo OUT1 OUT2 OUT3 OUT4 OUT5 OUT6 7 9 11 13 15 17 19 0 0 0 0 0 0 0 Output of the Multiplexer: These outputs are designed to drive the addresses of the Dynamic RAM array. (Note that the OUTO_7 pins do not require inverters or drivers for proper operation.) WE 28 0 Write Enable: Drives the Write Enable inputs of the Dynamic RAM array. 0 Column Address Strobe: This output is used to latch the Column Address into the Dynamic RAM array. CAS 27 Functional Description The 8203 provides a complete dynamic RAM controller for microprocessor systems as well as expansion memory boards. All of the necessary control signals are provided for2164, 2118 and 2117 dynamic RAMs. The 8203 has two modes, one for 16K dynamic RAMs and one for 64Ks, controlled by pin 35. 6-17 8203 Other Option Selections WE Xa I I CS* 1KU I I I = ±S% -- X, .... RASa C!!.L 8203-1 T 8203·3 6800 ":" I ±5% or < HAS1 RAS2 .J RAS3 ":" Cs The 8203 has two strapping options. When OP, is selected (16K mode only), pin 32 changes from a RD input to an Sl input, and pin 34 changes from a REFRQ input to an ALE input. See "Refresh Cycles" and "Read Cycles" for more detail. OP, is selected by tying pin 25to+12Vthrough a5.1K ohm resistor on the 8203~1 or 8203-3 only. CAS When OP2 is selected, the internal oscillator is disabled and pin 37 changes from a crystal input (X1) to a ClK input for an external TTL clock. OP2 is selected by shorting pin 36 (XO/OP2) directly to pin 40 (VCC). No current limiting resistor should be used. OP2 may also be selected by tying pin 36 to +12V through a 1Kn resistor. XACK 10pF FUNDAMENTAL XTAL SiCK Figure 3. Crystal Operation for the 8203-1 and 8203-3 All 8203 timing is generated from a single reference clock. This clock is provided via an external oscillator or an onchip crystal oscillator. All output signal transitions are synchronous with respect to this clock reference, except for the trailing edges of the CPU handshake signals SACK and XACK. Refresh Timer The refresh timer is used to monitor the time since the last refresh cycle occurred. When the appropriate amount of time has elapsed, the refresh timer will request a refresh cycle. External refresh requests will reset the refresh timer. CPU memory requests normally use the RD and WR inputs. The Advanced-Read mode allows ALE and S1 to be used in place of the RD input. Refresh Counter The refresh counter is used to sequentially refresh all of the memory's rows. The a-bit counter is incremented after . every refresh cycle. Failsafe refresh is provided via an internai timer which generates refresh requests. Refresh requests can also be generated via the REFRQ input. . . An on-chip synchronizer I arbiter prevents memory and refresh requests from affecting a cycle in progress. The READ, WRITE, and external REFRESH requests may be asynchronous to the 8203 clock; on-chip logiC will synchronize the requests, and the arbiter will decide if the requests should be delayed, pending completion of a cycle in progress .. Pin # 16K Function 64K Function '23 24 25 26 RAS2 Bank Select (BO) Bank Select (B,) RAS3 Address Output (OUT?) Address Input (AL?) Address Input (AH?) Bank Select (BO) Figure 4. 16K/64K Mode Selection 16K/64K Option Selection Inputs Pin 35 is a strap input that controls the two 8203 modes. Figure 4 shows the four pins that are multiplexed. In 16K mode (pin 35 tied to VCC or left open), the 8203 has two Bank Se'lect inputs to select one of four RAS outputs. In this mode, the 8203 is exactly compatible with the Intel 8202A Dynamic RAM Controller. In 64K mode (pin 35 tied to GND), there is only'one Bank Select input (pin 26) to select the two RAS outputs. More than two banks of 64K dymimic RAM's can be used with external logic. 16K Mode 64K Mode Outputs B1 BO RASO RAS1 RAS2 RAS3 a a a a 1 1 1 a 1 1 1 a 1 1 1 1 - a 0 1 1 1 a a 1 1 " - 1 1 1 0' - - Figure 5. Bank Selection Description Pin # Normal Function Option Function B1/0P1 (16Konly)/AH? 25 Bank (RAS) Select . Advanced-Read Mode XO/OP2 36 Crystal Oscillator (8203-1 and 8203-3) Figure 6. 8203 Option Selection 6-18 External Oscillator (8203-~~ 8203 Address Multiplexer Refresh Cycles The address multiplexer takes the address inputs and the refresh counter outputs, and gates them onto the address outputs at the appropriate time. The address outputs, in coniunction with the RAS and CAS outputs, determine the address used by the dynamic RAMs for read, write, and refresh cycles. During the first part of a read or write cycle, ALO-AL7 are gated to OUTO-OUT7, then AHO-AH7 are gated to the address outputs. The 8203 has two ways of providing dynamic RAM refresh: 1) Internal (failsafe) refresh 2) External (hidden) refresh Both types of 8203 refresh cycles activate all of the RAS outputs, while CAS, WE, SACK, and XACK remain inactive. During a refresh cycle, the refresh counter is gated onto the address outputs. All refresh cycles are RAS-only refresh (CAS inactive, RAS active). Internal refresh is generated by the on-chip refresh timer. The timer uses the 8203 clock to ensure that refresh of all rows of the dynamic RAM occurs every 2 milliseconds (128 cycles) or every 4 milliseconds (256 cycles). If REFRQ is inactive, the refresh timer will request a refresh cycle every 10-16 microseconds. To minimize buffer delay, the information on the address outputs is inverted from that on the address inputs. OUTO-OUT7 do not need inverters or buffers unless additional drive is required. External refresh is requested via the REFRQ input (pin 34). External refresh control is not available when the Advanced-Read mode is selected. External refresh requests are latched, then synchronized to the 8203 clock. Synchronizer / Arbiter The 8203 has three inputs, REFRQI ALE (pin 34), RD (pin 32) and WR (pin 31). The RD and WR inputs allow an external CPU to request a memory read or write cycle, respectively. The REFRQ I ALE input allows refresh requests to be requested external to the 8203. The arbiter will allow the refresh request to start a refresh cycle only if the 8203 is not in the middle of a cycle. When the 8203 is in the idle state a simultaneous memory request and external refresh request will result in the memory request being honored first. This 8203 characteristic can be used to "hide" refresh cycles during system operation. A circuit similar to Figure 7 can be used to decode the CPU's instruction fetch status to generate an external refresh request. The refresh request is latched while the 8203 performs the instruction fetch; the refresh cycle will start immediately after the memory cycle is completed, even if the RD input has not gone inactive. If the CPU's instruction decode time is long enough, the 8203 can complete the refresh cycle before the next memory request is generated. All three of these inputs may be asynchronous with respect to the 8203's clock. The arbiter will resolve conflicts between 'refresh and memory requests, for both pending cycles and cycles in progress. Read and write requests will be given priority over refresh requests. System Operation The 8203 is always in one of the following states: a) b) c) d) e) IDLE TEST Cycle REFRESH Cycle READ Cycle WRITE Cycle If the 8203 is not in the idle state then a simultaneous memory request and an external refresh request may result in the refresh request being honored first. The 8203 is normally in the IDLE state. Whenever one of the other cycles is requested, the 8203 will leave the IDLE state to perform the desired cycle. If no other cycles are pending, the 8203 will return to the IDLE state. So Test Cycle 8085A The TEST Cycle is used to check operation of several 8203 internal functions. TEST cycles are requested by activating the PCS, RD and WR inputs. The TEST Cycle will reset the refresh address counter and perform a WRITE Cycle. The TEST Cycle should not be used in normal system operation, since it would affect the dynamic RAM refresh. ~,..-_ _ _ REFRO . S1 8203 SACK or CAS. Figure 7. Hidden Refresh 6-19 inter 8203 Write Cycles Certain system configurations require complete external refresh requests. If external refresh is requested faster than the minimum internal refresh timer (tREF), then, in effect, all refresh cycles will be caused by the external refresh request, and the internal refresh timer will never generate a refresh request. Write cycles are similiar to Normal Read cycles, except for the WE output. WE is held inactive for Read cycles, but goes active for Write cycles. All 8203 Write cycles are "early-write" cycles; WE goes active before CAS goes active by an amount of time sufficient to keep the dynamic RAM output buffers turned off. Read Cycles The 8203can accept two different types of memory Read requests: General System Considerations All memory requests (Normal Reads, Advanced Reads, Writes) are qualified by the PCS input. PCS should be stable, either active or inactive, prior to the leading edge of RD, WR, or ALE. Systems which use battery backup should pullup PCS to prevent erroneous memory requests. 1) Normal Read, via the RD input 2) Advanced Read, using the S1 and ALE inputs (16K mode only) The user can select the desired Read request configuration via the B 1 / OP 1 hardware strapping option on pin 25. Pin 25 Pin 32 Pin 34 # RAM banks Ext. Refresh Normal Read Advanced Read 81 input RD input REFRQ input 4 (RA8 0.3) Yes OPI (+12V) 81 input ALE input 2 (RA8 2.3) No In order to minimize propagation delay, the 8203 uses an inverting address multiplexer without latches. The system must provide adequate address setup and hold times to guarantee RAS and CAS setup and hold times for the RAM. The tAD AC parameter should be used for this system calculation. . The BO-B 1 inputs are similiar to the address inputs in that they are not latched. BO and B1 should not be changed during a memory cycle, since they directly control which RAS output is activated. Figure 8. 8203 Read Options Normal Reads are requested by activating the RD input, and keeping it active until the 8203 responds with an XACK pulse. The RD input can go inactive as soon as the command hold time (tCHS) is met. Advanced Read cycles are requested by pulsing ALE while S 1 is active; if S 1 is inactive (low) ALE is ignored. Advanced Read timing is similiar to Normal Read timing, except the falling edge of ALE is used as the cycle start reference. The 8203 uses a two-stage synchronizer for the memory request inputs (RD, WR, ALE), and a separate two stage synchronizer for the external refresh input (REFRQ). As with any synchronizer, there is always a finite probability of metastable states inducing system errors. The 8203 synchronizer was designed to have a system error rate less than 1 memory cycle every three years based on the full operating range of the 8203. A microprocessor system is concerned when the data is valid after RD goes low. See Figure 9. In order to calculate memory read access times, the dynamic RAM's A.C .. specifications must be examined, especially the RAS-access time (tRAC) and the CAS-access time (tCAC). Most configurations will be CAS-access limited; i.e., the data from the RAM will be stable tcc,max (8203) + tCAC (RAM) after a memory read cycle is started. Be sure to add any delays (due to buffers, data latches, etc.) to calculate the overall read access time. If a Read cycle is requested. while a refresh cycle is in progress, then the 8203 will set the internal delayedSACK latch. When the Read cycle is eventually started, the 8203 will delay the active SACK transition until XACK goes active, as shown in the AC timing diagrams. This delay was designed to compensate for the CPU's READY setup and hold times. The delayed-SACK latch is cleared after every READ cycle. Since the 8203 normally performs "early-write" cycles, the data must be stable at the RAM data inputs by the time CAS goes active, including the RAM's data setup time. If the system does not normally guarantee sufficient write data setup, you must either delay the WR input signal or delay the 8203 WE output. Based on system requirements, either SACK or XACK can be used to generate the CPU READY signal. XACK will normally be used; if the CPU can tolerate an advanced READY, then SACK can be used, but only if the CPU can tolerate the amount of advance provided by SACK. If SACK arrives too early to provide the appropriate number of WAIT states, then either XACK or a delayed form of SACK should be used. Delaying the WR input will delay all 8203 timing, including the READY handshake Signals, SACK and XACK, which 6-20 8203 may increase the number of WAIT states generated by the CPU. Ro~I~--------------~I---------' If the WE output is externally delayed beyond the CAS active transition, then the RAM will use the falling edge of WE to strobe the write data into the RAM. This WE transition should not occur too late during the CAS active transition, or else the WE to CAS requirements of the RAM will not be met. / .>------tRLDV .1 1-' I DATA BI -----------« I I I I t.---tRAC~ '\ i ;I tCAe The RASO-3, CAS, OUTO-7' and WE outputs contain onchip series damping resistors (typically 20m to minimize overshoot. I I i;- '-----t CAS - - - - - - - - - - - - - - - - - - \ Some dynamic RAMs require more than 2.4V VIH. Noise immunity may be improved for these RAMs by adding pullup resistors to the 8203's outputs. Intel RAMs do not require pull-up resistors. Figure g. Read Access Time 2118 DYNAMIC RAM ARRAY AS-1S ALE BOBS ADO_7 RO WR ~ ALO-6 - OUTO-6 AHO-6 BO-l 6203 WE (16K MODE) r-p RASa WR g=- RAS, -<: RAS2 SACK AO-6 =: WE - CAS ROiS, --v RAS3 ::j l' CAS RAS DIN Dour T - WE CAS RAS DIN DOUT I ::j-::::~ :::: - O'N DOUl Ll + AO-6 XACK =: - O'N r Dour ..1., O'N l- WE CAS RAS DIN Dour Dour n ;--l ~AO-6 BAL O'N ~~11 DATA BUS DATA LATCH IN --==== O'N WE CAS RAS DIN DIN Dour T V O'N Dour l ~ ~ '---- Figure 10. Typical 8088 System 6-21 DIN Dour :IOINDour Dour I j 1 Dour DOUl ~T 8203 MULTIBUS"! TYPE SYSTEM BUS 8288 READ MRDe WRITE MWTC 8086 BHEN ADRO I A9"' OTHER READY INPUTS ADo-AD15 A16-A19 ADRF A~'6 I I I READ ur= ~ WRITE A"i7-A19 HIGH BYTE WRITE WE t-_~"A_S~X_--"J MEMORY AD,. I SHE I I I I 00-15 8203 CAS 2'64 256K BYTeS 1>-----.1 DATA DO '6 Figure 11. 8086/256K Byte System 6-22 01 '6 8203 A.C. CHARACTERISTICS TJ = O°C 10 70°C; VCC = 5V ± 10% (5.0V ± 5% for 8203-3); GND = OV Measuremenls made wilh respecllo RASO-RAS3, CAS, WE, QUTO-QUT6 are al 2.4V and 0.8V. All olher pins are measured al 1 5V All limes are in nsec Symbol Parameter Min Max Ip Clock Period 40 54 IpH Exlernal Clock High Time 20 IPL Exlernal Clock Low Time-above (» 20 mHz 17 IpL Exlernal Clock Low Time-below (::S) 20 mHz 20 IRC Memory Cycle Time IREF Refresh Time (128 cycles) IRP RAS Precharge Time 41p - 30 tRSH RAS Hold After CAS 51p - 30 3 tASR Address Selup 10 RAS tp - 30 3 tRAH Address Hold From RAS tp - 10 3 IASC Address Selup 10 CAS Ip - 30 3 ICAH Address Hold from CAS 51p - 20 3 tCAS CAS Pulse Widlh 5tp - 10 IWCS IWCH IRS . IOtp - 30 121p 2641p 2881p Notes 4,5 WE Selup 10 CAS Ip - 40 WE Hold Afler CAS 51p - 35 8 51p 2,6 RD, WR, ALE, REFRQ delay from RAS IMRP RD, WR selup 10 RAS 0 5 IRMS REFRQ selup 10 RD, WR 21p 6 IRMP REFRQ selup 10 RAS 21p 5 IpCS PCS Selup 10 RD, WR, ALE 20 IAL S 1 Selup 10 ALE 15 tLA S l' Hold from ALE 30 + 30 + 25 + 70 + 85 ICR RD, WR, ALE 10 RAS Delay Ip ICC RD, WR, ALE 10 CAS Delay 31p ISC CMD Selup 10 Clock 15 1 IMRS RD, WR selup 10 REFRQ 5 2 ICA RD, WR, ALE 10 SACK Delay ICX CAS 10 XACK Delay 51p - 25 ICS CAS 10 SACK Delay 51p - 25 lACK XACK 10 CAS Selup 10 IXW XACK Pulse Widlh tCK SACK, XACK lurn-off Delay 21p 41p + 47 + 20 51p + 40 21p 2 2 2,9 51p Ip - 25 2,10 7 35 IKCH CMD Inaclive Hold after SACK, XACK 10 ILL REFRQ Pulse Widlh 20 30 11 ICHS CMD Hold Time IRFR REFRQ 10 RAS Delay IWW WR 10 WE Delay 0 50 8 lAD CPU Address Delay 0 40 3 41p 6-23 + 100 6 inter 8203 WAVEFORMS Normal Read or Write Cycle Advanced Read Mode 6-24 8203 WAVEFORMS (cont'd) Memory Compatibility Timing AL~~;~s'. ~ AHo-AHS ...._ _ _ _ _ _V_AL_'D_AD_DR_ES_S_ _ _ _ _ _ _ ~'-------------- -~"fx- -::,~- 1\ tRSH I teAs V \ _tASR __ CUTo-OUT6 }. !-IRAH- !--tASC .... X ROW I-tCAH- K COLUMN Write Cycle Timing \ I \ I 4-:li~ - ~I tCR ""-MAX----' \ / .... twcs __ ....--tWCH tcc MIN , tcc MAX 6-25 . tww MIN tww MAX H 'I - 8203 WAVEFORMS (cont'd) Read or Write Followed By External Refresh \ \. ..-tMRS--+ . - - - tLL - - - . . . \ / REFRQ J l - tRS - \ . _tRP_ tRMP -~Cj,~- \ tRC . . .1\ •1 tcc MIN tcc MAX \ External Refresh Followed By Read or Write RD.WR ---l:========-t - --------------------.. -,------------ RP M REFRQ 1 + - - - - - - tRC - - - - - - 1 \~ 6-26 inter 8203 WAVEFORMS (cont'd) Clock And System Timing A.C. TESTING LOAD CIRCUIT Table 2. 8203 Output Loading. All specifications are for the Test Load unless otherwise noted Pin Test Load SACK.XACK OUTO-OUTS RASO-RAS3 CL CL CL CL CL WE CAS OEVICE UNDER = 30 pF = lS0 pF = SO pF = 224 pF = 320 pF TEST NOTES: 1. tsc is a reference point only. ALE. RD. WR. and REFRQinputs do not have to be externally synchronized to 8203 clock. 2. If tRS min and tMRS min are met thentCA. tCR. and tcc are valid. otherwise tcs is valid. 3. tASR. tRAH. tASC. tCAH. and tRSH depend upon BO-B 1 and CPU address remaining stable throughout the memory cycle. The ad· dress inputs are not latched by the 8203. 4. For back·to·back refresh cycles.tRC max = 13tp 5. tRC max is valid only if tRMP min is met (READ. WRITE followed by REFRESH) or tMRP min is met (REFRESH followed by READ. WRITE). 6. tRFR is valid only if tRS min and tRMS min are met. 7. txw min applies when RD. WR has already gone high. Otherwise XACK follows RD. WR. 8. WE goes high according to tWCH or tWW. whichever occurs NOTE: CL includes jig capacitance 9. tCA applies only when in normal SACK mode. de. 10. tcs applies only when in delayed SACK mode. 11. tCHS must be be met only to ensure a SACK active pulse when in delayed SACK mode. XACK will always be activated for at least txw (tp- 25 nS). Violating tCHS min does not otherwise affect device operation. first. 6-27 8203 The typical rising and falling characteristic curves for the OUT, RAS, CAS and WE output buffers can be used to determine the effects of capacitive loading on the A. C. Timing Parameters. Using this design tool in conjunction with the timing waveforms, the designer can determine typical timing shifts based on system capacitive load. A.C. CHARACTERISTICS FOR DIFFERENT CAPACITIVE LOADS CAPACITANCE' p~ 5.Dr-----~------i-------r_----_r------~----_.------_r------r_----_r----~ D.' ~--+_~~II!=31Ii5;;:2j::--_+--_+--_t---f__--+_--+_-_I D.D~----~------;-------~----~------~----~------~------L-----_7----~ TIME f-5n.~ CAPACITANCE: pF •. Or-----~------;-------r_----_r------~----_.------_r------r_----~----~ NOTE: MEASUREMENT CONDITIONS: Pins not measured are loaded with TA = 25°C the Test Load capacitance VCC = +5V tp = 50 ns Use the Test Load as the base capacitance for estimating timing shifts for system critical timing parameters. 6-28 8203 Example: Find the effect on tCR and tcc using 32 2164 Dynamic RAMs configured in 2 banks. 2. From the waveform diagrams, we determine that the falling edge timing is needed for tCR and tCC. Next find the curve that best approximates the test load; i.e., 68 pF for RAS and 330 pF for CAS. 1. Determine the typical RAS and CAS capacitance: From the data sheet RAS = 5 pF and CAS = 5 pF. RAS load = 80 pF + board capacitance. CAS load = 160 pF + board capacitance. Assume 2 pF / in (trace length) for board capacitance and for this example 4 inches for RAS and 8 inches for CAS. 3. If we use 88 pF for RAS loading, then tCR (min.) spec should be increased by about 1 ns, and tCR (max.) spec should be increased by about 2 ns. Similarly if we use 176 pF for CAS, then tcc (min.) should decrease by 3 ns and tcc (max.) should decrease by about 7 ns. 6-29 8206 ERROR DETECTION AND CORRECTION UNIT • Detects All Single Bit, Double Bit and Most Multiple Bit Errors • Separate Input and Output Busses-No Timing Strobes Required • Corrects All Single Bit Errors • 3 Selections 8206-1 8206 Detection 35ns 42ns Correction 55ns 67ns • Expandable to Handle 80 Bit Memories • Supports Read With and Without Correction, Writes, Partial (Byte) Writes, and Read-Modify-Writes 8206-2 57ns 74ns • HMOS III Technology for Low Power • 8206-2 Timing Supports Single 8206 8M Hz iAPX 186, 188,86,88 and 8207-8 Systems • 68 Pin Leadless JEDEC Package • 68 Pin Grid Array Package • Syndrome Outputs for Error Logging The HMOS 8206 Error Detection and Correction Unit is a high-speed device that provides error detection and correction for memory systems (static and dynamic) requiring high reliability and performance. Each 8206 handles 8 or 16 data bits and up to 8 check bits. 8206's can be cascaded to provide correction and detection for up to 80 bits of data. Other 8206 features include the ability to handle byte writes. memory initialization. and error logging. 1. STB POS o_, --;::;C=: ,------1 I----_co C81/SY1 0.7 SYO/CBO/PPO O.1 ,. c:=t:.=~ DATA CORRECTION PPIIPOSINSL •pOSo_. NSLg., Mis 16 )---1-+----4--.1 GND SEOCU R/W ~5V 11 Vss Vee wz BMO~l Figure 1. 8206 Block Diagram Intel Corporation Assumes No Responsibilly for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied. JUNE 1985 © INTEL CORPORATION, 1982. 6-30 Order Number: 205220-007 intel 8206 16 01 0. 15 ,----------1 STB-~=L=: .-------1 Cal a.s SYNDROME SYO/CBO o_S }-----_CO 16 DECODER ¢:=-:t=~ }-----_ORROR DATA AND ERROR CORRECTION DETECTION 16 WRITE PARTIAL PARITY GENERATOR GND R/W +5V 11 Figure 2. 8206-2 Block Diagram Table 1. 8206 Pin Description Symbol Pin No. Name and Function Type 1,68-61, 59·53 I Data In: These inputs accept a 16 bit data word from RAM'for error detection and/or correction. CBI/SYlo CBI/SYI1 CBI/SYI2 CBI/SYI3 CBI/SYI4 CBI/SYls CBI/SYls CBI/SYI7 5 6 7 8 9 10 11 12 I I I I I I I I Check Bits In/Syndrome In: In a single 8206 system, or in the master in a multi8206 system, these inputs accept the check bits (5 to 8) from the RAM. ;n a single 8206 16 bit system, CBIO_5 are used. In slave 8206's these inputs accept the syndrome from the master. DOIWDlo DO/WDI 1 DOIWDI2 DOIWDI3 DOIWDI4 DO/WDls DO/WDIS DO/WDI7 DO/WDls DO/WDlg DO/WDI 1O DO/WDI 11 51 50 49 48 47 46 45 44 42 41 40 39 38 37 36 35 I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O I/O Data Out/Write Data In: I~ad cycle, data accepted~IO_15 appears~ these outputs corrected if CRCT is low, or uncorrected if CRCT is high. The BM inputs· must be high to enable the output buffers during the read cycle. In a write cycle, data to be written into the RAM is accepted by these inputs for computing the write check bits. In a partial-write cycle, the byte not to be modified appears at either DOO-7 if BMo is high, or DOS-1S if BM1 is high, for writing to the RAM. When WZ is active, it causes the 8206 to output all zeros at DOO-15, with the proper write check bits on CBO. Dl o. 15 ~O/wDI" DO/WDI 13 DO/WDI 14 DO/WDI 1S 6-31 8206 Table 1. 8206 Pin Description (Continued) Symbol SYO/CBO/PPOo SYO/CBO/PP01 SYO/CBO/PP02 SYO/CBO/PP03 SYO/CBO/PP04 .. -SYO/CBO/PP0 5-SYO/CBO/PP06 SYO/CBO/PP07 Pin No. Type Name and Function 23 24 25 27 28 29--· 30 31 0 0 0 0 0 0-0 0 Syndrome Out/Check Bits Out/Partial Parity Out: In a single 8206 system, or in the master in a multi-8206 system, the syndrome appears at these outputs during a read. During a write, the write check bits appear. In slave 8206's the partial parity bits used by the master appe~ at these outputs. The syndrome is latched (during read-modify-writes) by R/W going low. PPIO/POSo PPI1/POS1 13 14 I I Partial Parity In/Position: In the master in a multi-8206 system, these inputs accept partial parity bits 0 and 1 from the slaves. In a slave 8206 these inputs inform it of its position within the system (1 to 4). Not used in a single 8206 system. PPI2/NSLO PPI3/NSL1 15 16 I I Partial Parity In/Number of Slaves: In the master in a multi-8206 system, these inputs accept partial parity bits 2 and 3 from the slaves. In a multi-8206 system these inputs are used in slave number 1 to tell it the total number of slaves in the system (1 to 4). Not used in other slaves or in a single 8206 system. PPI4/CE 17 I/O Partial Parity In/Correctable Error: In the master in a multi-8206 system this pin accepts partial parity bit 4. In slave number 1 only, or in a sin*e 8206 system, this pin outputs the correctable error flag. CE is latched by R going low. Not used in other slaves. PPI5 PPls PPI7 18 19 20 I I I Partial Parity In: In the master in a multi-8206 system these pins accept partial parity bits 5 to 7. The number of partial parity bits equals the number of check bits. Not used in single 8206 systems or in slaves. ERROR 22 0 Error: This pin outputs the error flag in l!.§ingle 8206 system or in the master of a multi-8206 system. It is latched by R/w going low. Not used in slaves. CRCT 52 I Correct: When low this pin causes data correction during a read or readmodify-write cycle. When high, it causes error correction to be disabled, although error checking is still enabled. STB 2 I Strobe: STB is an input control used to strobe data at the 01 inputs and checkbits at the CBI/SYI inputs. The signal is active high to admit the inputs. The signals are latched by the high-to-Iow transition of STB. BMo BM1 33 32 I I Byte MarkS: When high, the Data Out pins are enabled for a read cycle. When low, th~ata Out buffers are tristated for a write cycle. BMo controls 000_7, while BM1 controls 008-15. In partial (byte) writes, the byte mark input is low for the new byte to be written. R/W 21 I Read/Write: When high this pin causes the 8206 to perform detection and correction (if CRCT is low). When low, it causes the 8206 to generate check bits. On the high-to-Iow transition the syndrome is latched internally for read.modify-write cycles. WZ 34 I Write Zero: When low this input overrides the BMO-1 and R/W inputs to cause the 8206 to output all zeros at 000-15 with the corresponding check bits at CBOO_7. Used for memory initialization. M/S 4 I Master/Slave: Input tells the 8206 whether it is a master (high) or a slave (low). SEOCU 3 I Single EDC Unit: Input tells the master whether it is operating as a single 8206 (low) or as the master in a multi-8206 system (high). Not used in slaves. Vee 60 I Power Supply: +5V Vss 26 I Logic Ground Vss 43 I Output Driver Ground - --- ------ 6-32 -- ---- -- ._- --- ----- 205220-007 8206 Table 2. 8206-2 Pin Description Differences over the 8206. Pin Type Name and Function 5-10 I Check Bits In: In an 8206-2 system. these inputs accept the check bits (5 to 6) from the RAM. SYO/CBOo SYO/CB0 1 SYOICB02 SYO/CB0 3 SYO/CB0 4 SYO/CBOs 23 24 25 27 28 29 0 0 0 0 0 0 Syndrome Out/Check Bits Out: In an 8206-2 system, the syndrome appears at these outputs during a read. During a write, the write check bits appear. The syndrome is latched (during read-modify·writes) by R/W going low. CE 17 0 Correctable Error: In an 8206-~system, this pin outputs the correctable error flag. CE is latched by R/W going low. WZ 34 I Write Zero: When low this input overrides the BMo_1 and R/W inputs to cause the 8206-2 to output all zeros at 000-15 with the corresponding check . bits at CBOo;s. Used for memory initialization. Strap High 4 I Must be tied High. Strap Low 3 I Must be tied Low. N.C. 11-16 18-20 I Note: These pins have internal pull-up resistors but if possible should be tied high or low. N.C. 30,31 0 Note: These are no connect pins and should be left open. Symbol CBlo-s FUNCTIONAL DESCRIPTION DATA WORD BITS The 8206 Error Detection and Correction Unit provides greater memory system reliability through its ability to detect and correct memory errors. It is a single chip device that can detect and correct all single bit errors and detect all double bit and some higher multiple bit errors. Some other odd multiple bit errors (e.g., 5 bits in error) are interpreted as single bit errors, and the CE flag is raised. While some even multiple bit errors (e.g., 4 bits in error) are interpreted as no error, most are detected as double bit errors. This error handling is a function of the number of check bits used by the 8206 (see Figure 2) and the specific Hamming code used. Errors in check bits are not distinguished from errors in a word. For more information on error correction codes, see Intel Application Notes AP-46 and AP-73. CHECK BITS 8 5 16 6 24 6 32 7 40 7 48 8 56 8 64 8 72 8 80 8 Figure 3. Number of Check Bits Used by 8206 A single 8206 or 8206-2 handles 8 or 16 bits of data, and up to 5 8206's can be cascaded in order to handle data paths of 80 bits. For a single 8206 8 bit system, the 01 8- 15, DOIWDI8-1S and BM1 inputs are grounded. See the Multi-Chip systems section for information on 24-80 bit systems. one to accept data from the RAM (DI) and the other to deliver corrected data to the system bus (DOl WDI). The logic is entirely combinatorial during a read cycle. This is in contrast to an architecture with only one bus, with bidirectional bus drivers that must first read the data and then be turned around to output the corrected data. The latter architecture typically requires additional hardware (latches andlor transceivers) and may be slower in a system due to timing skews of control signals. The 8206 has a "flow through" architecture. It supports two kinds of error correction architecture: 1) Flow-through, or correct-always; and 2) Parallel, or check-only. There are two separate 16-pin busses, 6-33 205220-007 inter READ CYCLE With the RiW pin high, data is received from the RAM outputs.into the 01 pins where it is optionally latched by the STB signal. Check bits are generated from the data bits and compared to the check bits read from the RAM into the CBI pins. If an error is detected the ERROR flag is activated and the correctable error flag (CE) is used to inform the system whether the error was correctable or not. With the BM inputs high, the word appears corrected.at the DO pins if the error was correctable, or unmodified if the error was uncorrectable. . If more than one 8206 is being used, then the check bits are read by the master. The slaves generate a partial parity output (PPO) and pass it to the master. The master 8206 then generates and returns the syndrome to the slaves (SYO) for correction of the data. The 8206 may alternatively be used in a "checkonly" mode with the eRe'i' pin left high. With the correction facility turned off, the propagation delay from memory outputs to 8206 outputs is significantly shortened. In this mode the 8206 issues an ERRORflag to the CPU, which can then perform one of several options: lengthen the current cyCle for correction, restart the instruction, perform a diagnostic routine, etc. A syndrome word, five to eight bits in length and containing all necessary information about the existence and location of an error, is made available to the system at the SYOO-7 pins. Error logging may be accomplished by latching the syndrome and the memory address of the word in error. WRITE CYCLE 8206 with the syndrome internally latched by RiW going low. Only that part of the word not to be modified is output onto the DO pins, as controlled by the Byte Mark inputs. That portion of the word to be overwritten is supplied by the system bus. The 8206 then calculates check bits for the new word, using the byte from the previous read and the new byte from the system bus, and writes them to the memory. READ-MODIFY-WRITE CYCLES Upon detection of an error the 8206 may be used to correct the bit in error in memory. This reduces the probability of getting multiple-bit errors in subsequent read cycles. This correction is handled by executing read-modify-write cycles. The read-modify-write cycle is controlled by the RNi input. After (during) the read cycle, the system dynamic RAM controller or CPU examines the 8206 ERROR and CE outputs to determine if a correctable error occurred. If it did, the dynamic RAM controller or CPU forces R/W low, telling the 8206 to latch the generated syndrome and drive the corrected check bits onto the CBO outputs. The corrected data .is available on the DO pins. The DRAM controller then writes the corrected data'and corresponding check bits into memory. The 8206 may be used to perform read-modifywrites in one or two RAM cycles. If it is done in two cycles, the 8206 latches are used to hold the data and check bits from the read cycle to be used in the following write cycle. The Intel 8207 Advanced Dynamic RAM controller allows read-modify-write cycles in one memory cycle. See the System Environment section. For a full write, in which an entire word is written to memory, the data is written directly to the RAM, bypassing the 8206. The same data enters the 8206 through the WDI pins where check bits are generated. The Byte Mark inputs must be low to tristate the DO drivers. The check bits, 5 to 8 in number, are then written to the RAM through the CBO pins for storage along with the data word. In a multi~chip system, the master writes the check bits using par~ tial parity information from the slaves. INITIALIZATION A memory system operating with ECC requires some form of initialization at system power-up in order to set valid data and check bit information in memory. The 8206 supports memory initialization by the write zero function. By activating the WZ pin, the 8206 will write a data pattern of zeros and the associated check bits in the current write cycle. By thus writing to all memory at power-up, a controller can set memory to valid data and check bits. Massive memory failure, as signified by both data and check bits all ones or zeros, will be detected as an uncorrectable error. In a partial write, part of the data word is overwritten, and part is retained in memory. Thisis accomplished by performing a read-modify-write cycle. The complete old word is read into the 8206 and corrected, 6-34 AFN·020098 intJ 8206 the syndrome. The syndrome is then returned by the master to the slave for error correction. In systems with more than one slave the above description continues to apply, except that the partial parity outputs of the slaves must be XOR'd externally. Figure 4 shows the necessary external logic for multi-chip systems. Write and read-modify-write cycles are carried out analogously. See the System Operation section for mUlti-chip wiring diagrams. MULTI·CHIP SYSTEMS A single 8206 handles 8 or 16 bits of data and 5 or 6 check bits, respectively. Up to 5 8206's can be cascaded for 80 bit memories with 8 check bits. When cascaded, one 8206 operates as a master, and all others as slaves. As an example, during a read cycle in a 32 bit system with one master and one slave, the slave calculates parity on its portion of the word-"partial parity"-and presents it to the master through the PPO pins. The master combines the partial parity from the slave with the parity it calculated from its own portion of the word to generate There are several pins used to define whether the 8206 will operate as a master or a slave. Tables 3 and 4 illustrate how these pins are tied. 3a. 48 BIT SYSTEM SLAVE 2 PPO 3b. 64 BIT SYSTEM SLAVE 3 PPO 3e. 80 BIT SYSTEM SLAVE 4 PPO Figure 4. External Logic For Mult-Chlp Systems 6-35 205220~007 8206 Table 3. Master/Slave Pin Assignments Pin No. 4 3 13 14 15 16 Slave 3 Slave 4 Gnd Gnd, Gnd Gnd +5V +5V +5V +5V Gnd +5V +5V +5V +5V +5V Shive 1 Master +5V +5V PPI PPI PPI PPI Pin Name MIS SEOCU PPlo/POSo PPl1/POS1 PPI2/NSLo PPI3/NSLl Gnd Gnd .. Slave 2 +5V +5V +5V Gnd +5V +5V ·See Table 3, NOTE: Pins 13, 14, lS, 16 have internal pull-up resistors and may be left as N.C. where specified as connecting to +Sv. Table 4. NSL Pin Assignments for Slave 1 Pin PPI 2/NSLo PPI3/NSL1 1 Gnd Gnd Number of Slaves 2 +5V Gnd Gnd +5V The timing specifications for multi-chip systems must be calculated to take account of the external XOR gating in 3, 4, and 5-chip systems. Let tXOR be the delay for a single external TTL XOR gate. Then the following equations show how to calculate the relevant timing parameters 'for 2-chip (n=O), 3-chip (n=1), 4-chip (n=2), and 5-chip (n=2) systems: Data-in to corrected data-out (read cycle) = TDVSV + TPVSV + TSVQV + ntXOR Data-in to error flag (read cycle) = TDVSV + TPVEV + ntXOR Data-in to correctable error flag (read cycle) = TDVSV + TPVSV + TSVCV + ntXOR Write data to check-bits valid (full write cycle) = TQVQV + TPVSV + ntXOR Data-in to check-bits valid (read-mod-write cycle) = TDVSV + TPVSV + TSVQV + TQVQV + TPVSV + 2ntXOR Data-in to check-bits valid (non-correcting readmodify-write cycle) = ' TDVQU + TQVQV + TPVSV + ntXOR 3 4 +5V +5V parallel. No 8206 requires more time for propagation through logic levels than any other one, and hence no one device becomes a bottleneck in the parity operation. However; one or two levels of external TTL XOR gates are required in systems with three to five chips. The code appears in Table 5. The check bits are derived from the table by XORing or XNORing together the bits indicated by 'X's in each row corresponding to a check bit. For example, check bit o in the MASTER for data word 1000110101101011 will be "0." It should be noted that the 8206 will detect the gross-error condi!ion of all lows or all highs. Error correction is accomplished by identifying the bad bit and inverting it. Table 5 can also be used as an error syndrome table by replacing the 'X's with '1's. Each column then represents a different syndrome word, and by locating the column corresponding to a particular syndrome the bit to be corrected may be identified. If the syndrome cannot be located then the error cannot be corrected. For example, if the syndrome word is 00110111, the bit to be corrected is bit 5 in the slave one data word (bit 21). The syndrome decoding is also summarized in Tables 6 and 7 which can be used for error logging. By finding the appropriate syndrome word (starting with bit zero" the least significant bit), the result is either: 1) no error; 2) an identified (correctable)' single bit error; 3) a double bit error; or 4) a multi-bit uncorrectable error. HAMMING CODE The 8206 uses a modified Hamming code which was optimized for multi-chip EDCU systems, The code is such that partial parity is computed by all 8206's in 6-36 205220-007 cf Table 5. Modified Hamming Code Check Bit Generation Check bits are generated by XOR'ing (except for the CBO and CBl data bits, which are XNOR'ed in the Master) the data bits in the rows corresponding to the check bits. Note there are 6 check bits in a l6-bit system, 7 in a 32-bit system, and 8 in 48-or-more-bit systems. BYTE NUMBER BIT NUMBER CBO= CB1 = CHECK CB2 = CB3 = BITS CB4 = CB5 = CB6 = CB7 = DATA BITS 0 01234567 ------- ----------- ------- - - x x - - x x x x - - - - x - x - - - x x x x x - - - - - x x x - - - - - - - - x x x x x x x x - - - - - . - - - - - - - - - - 16 BIT OR MASTER SLAVE #1 4 5 01234567 01234567 xx-x-xx- x - - x - x x-x--x-x -x-xx-x- - - x x - x - x x - - x - x - - x -- xxx - ---- x -- xxxxx--- - - xxx x x x x x x x x - - - - - - - - x x x x x x x x - - - - - - - - x - --- - x x x x x X x x 3 3 3 3 3 3 3 3 4 4 4 4 4 444 2 3 4 5 6 789 o 1 2 3 4 5 6 7 SLAVE #2 6 1 234 5 6 7 7 1 2 3 4 5 6 7 XOR XOR XOR XOR XOR XOR XOR ~ 8 8 9 OPERATION 1 2 3 4 5 6 7 01234567 x - x, - x x - - x - x x - - x - - x x x - x x - - x x - - x XOR - x x - x x x x x - - - x - - x x x - x x x - -~ x x XOR o x x x x x - --- - x x x - - x - x x x - - - x - x x x - x x x - - x x x x - - x - x x x - - x x - 1 1 1 1 2 2 2 2 22222233 67690 1 2 3 45676901 c.> - - - - - - XNOR XNOR XOR XOR XOR XOR XOR XOR 2 3 OPERATION 2 345 6 7 01234567 -xxx-xx- - x x - - x XOR o1 000 0 0 0 0 0 0 0 1 1 1 1 1 1 o 1 2 3 4 567 B 9 0 1 234 5 -J DATA BITS 1 OPERATION 2 345 6 7 x x - x - x x . x - - x - x - x-x--x-x - x - x x - x -xx-x-xx - - x - x - - x xxxxx--- x x x - - - - ---xxxxx - - - - - x x x - - - - - - - - x x x x 1< x x x cp BYTE NUMBER BIT NUMBER CBO= CB1 = CHECK CB2 = CB3 = BITS CB4 = CB5 = CB6= CB7 = o1 - o - x x x - x x - - x x - - x - - x - - x x - x x - - x x - - - x x x x x - - - - - x x x - - - x x x x x x x x x x x x x x x - - - - x x x x x x x x - --- - ----- o --x - x - x -- x x - - x - x x - - x x - - x x x x - - x x x - - x - x x - - - x x x x x - x - x x x x - x - - - x x x - -xxxx- - - - x - x - - - - - - - - x x x x x x x x 4 4 5 5 5 5 5 5 5 5 5 5 666 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 690 1 234 5 6 7 8 9 0 1 2 3 4 5 6 7 6 9 0 1 2 3 4 5 6 7 8 9 II SLAVE #3 . I. I SLAVE #4 XOR XOR XOR XOR XOR XOR '\§J 2& Iiiiil IF ~ ~ ~ ae1 ~ inter 8206 Table 6. 8206 Syndrome Decoding Syndrome BII. 7 6 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 5 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 4 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 1 0 0 0 0 0 1 0 2 0 3 0 0 1 0 0 CBO CBl N 1 1 0 0 0 0 1 0 1 0 1 0 0 1 1 0 1 1 1 0 0 0 0 1 1 0 0 1 0 CB2 5 0 0 18 CB3 0 6 7 0 0 3 32 BIT DATA BUS 0 0 0 1 2 0 16 4 0 0 17 I CBS 11 19 12 0 0 8 9 0 0 10 0 0 0 13 14 0 15 0 0 21 20 0 0 66 0 22 23 CB6 0 0 25 0 26 49 0 0 48 24 0 27 0 0 0 0 52 55 0 0 28 0 0 54 33 34 0 0 0 0 37 38 39 71 44 40 41 0 0 36 77 0 0 U 0 0 0 35 43 6B 0 0 0 0 53 69 0 0 65 64 0 0 0 0 70 31 0 0 51 29 0 0 74 72 56 0 0 73 60 0 0 u 58 0 0 0 0 U U 57 0 u u 0 61 0 0 76 0 0 u 0 u u u u u u 0 U 0 0 0 0 u u u u 0 0 u u 0 0 0 0 0 0 u u 0 0 u 0 u u 30 CB7 0 0 63 0 78 U 0 45 46 59 75 0 0 79 0 0 62 0 u u 0 u 0 0 U 0 0 U u u 0 0 U 47 0 0 0 U 0 DI 32 42 1 1 1 1 0 1 1 1 0 0 ~ ~ 1 0 1 1 0 0 67 0 50 0 0 U U 0 0 U 0 U U 0 SYSTEM ENVIRONMENT The 8206 interface to a typical 32 bit memory system is illustrated in Figure 5. For larger systems, the partial parity bits from slaves two to four must be DATAMEMDRY 16 BITS x 0 0 1 1 0 0 CB4 N = No Error . CBX = Error in Check Bit X X = Error in Data Bit X o = Double Bit Error U = Uncorrectable Multi-Bit Error OE 1 1 0 1 0 1 0 1 CHECK BITS 7 BITS DO DI DATAMEMDRY 16 BITS ·DO DI DO DO/WDI DI "1 C, V R -- I ~ ~ ~ T T !l I, DO/wDI DI SYOICBO CBI... SYID-a PP10-6 CONTROL { LINES CIIl:T PPI7 1ft CBI, STB 8206 MASTER ~l ~ Mil 1M, liM, rIt--- V-- T+ v--IEDCll R/W MARKS PP00-6 V Ir I-- mmIi POSo CIIl:T . POS 1 ViZ HILo 8206 SLAVE ~~ I- NSL, i- R/W MIS I- liM, smro ~, IVI, STB PPI5-7 ERROR SIGNALS CE ~ +5V J Figure 5. 32-81t 8206 System Interface 6-38 20522CHJ07 8206 XOR'ed externally, which calls for one level of XOR gating for three 8206's and two levels for four or five 8206's. RAM implementation using the 8206 and 8207. The 8206/8207 combination permits such features as automatic scrubbing (correcting errors in memory during refreSh), extending RAS and CAS timings for Read-Modify-Writes in single memory cycles, and automatic memory initialization upon reset. Together these two chips provide a complete dualport, error-corrected dynamic RAM subsystem. The 8206 is designed for direct connection to the Intel 8207 Advanced Dynamic RAM Controller. The 8207 has the ability to perform dual port memory control, and Figure 6 illustrates a highly integrated dual port 1 ACKB ACKB ADDR ~ CMDfPEA CAS WE CMD/PEB CMD/PEB DYNAMIC RAM ---'\ --,; 32 BITS -{>o-c WE 01 CSI DOlcao th 8207 MUX AORe WZ ADORB ClK>---- ClK PSEN - CE eRROR MUX CMD/PEA - l- i'" ADDR ACKA oBM R/W L PSEL IL~ LI CE R/W ERLR SYO/ ol/CBI RfW ADORA ACKA + 7 CHECK BITS - cao PPI ,5V- STB ~ CRCT MASTER wz BM BYTE MARK STB CRCT 8206 SLAVE - -5V WZ DO/WDI BM Q1 lit: r--"'- 01 PPO 8206 ¢' SYI DD/WDI Q .... V II r- DECODER '--- .11 - ~ L........, XCVR STB LATCH r- r-Ro eEl PORT A PORTS Figure 6. Dual Port RAM Subsystem with 8206/8207 (32-bit bus) 6-39 205220-007 inter 8206 Table. 7. .8206-2 Syndrome Decoding Syndrome 0 5 Bits 4 3 0 0 1 2 0 0 0 0 N 1 0 0 0 1 0 CBO CB1 1 1 0 0 0 1 1 1 1 D CB2 D 0 0 0 0 0 1 CB3 0 0 0 D 1 2 0 1 0 CB4 0 0 5 0 6 7 0 0 1 1 0 3 0 D 4 D D 0 1 0 0 CB5 0 0 11 0 0 12 0 1 0 1 0 8 9 D 10 0 0 0 1 1 0 0 13 14 0 15 0 0 0 1 1 1 0 0 0 0 0 D D 0 N= CBX = X= 0= The 8206-2 handles 8 or 16 bits of data. For 8 bit .8296-2 systems, the Dls-15, DO/WDls_15 and BM1.inputs are grounded. 1 1 0 1 1 0 The 8206-2 is designed for direct connection to the Intel 8207-2 Advanced Dynamic RAM Controller. The 8207-2 has the ability to perform dual port memory control, and Figure 7 illustrates a highly integrated iAPX 186 RAM implementation using the 8206-2 and 8207-2. The 8206-218207-2 combination permits such features as automatic scrubbing (correcting errors in memory during refresh), extending RAS and CAS timings for Read-Modify-Writes in single memory cycles, and automatic memory initialization upon reset. Together these two chips provide a complete dual-port; error-corrected dynamic RAM subsystems. No Error Error in Check Bit X Error in Data Bit X Double Bit Error OTHER Ai:K INPUTS eLK AACKi AOo-aRASO-3 000-3 ARDyeLK Eiilimi 140---1 t - - - - - - - - - - - - 1 PCTLA t---------~~ 11207·2 80188 ERROR 010-15 CB1o_5 ~ SlB +SV Figure 7. IAPX 186 RAM Correct Always Subsystem with the 8206-2 and the 8207-2 6-40 205221).007 8206 ciously choosing the proper data word to generate the desired check bits, through the use of the 8206 Hamming code. To read out the check bits it is first necessary to fill the data memory with all zeros, which may be done by activating WZ and incrementing memory addresses with WE to the check bits memory held inactive, and then performing ordinary reads. The check bits will then appear directly at the SYO outputs, with bits CSO and CS1 inverted. MEMORY BOARD TESTING The 8206 lends itself to straightforward memory board testing with a minimum of hardware overhead. The following is a description of four common test modes and their implementation. Mode O-Read and write with error correction. Implementation: This mode is the normal 8206 operating mode. Mode 1-Read and write data with error correction disabled to allow test of data memory. Implementation: This mode is performed with CRCT deactivated. Mode 3-Write data, without altering or writing check bits, to allow the storage of bit combinations to cause error correction and detection. Implementation: This mode is implemented by writing the desired word to memory with WE to the check bits array held inactive. Mode 2-Read and write check bits with error correction disabled to allow test of check bits memory. Implementation: Any pattern may be written into the check bits memory by judi- 6-41 205220·007 8206 BonOM 0 0 .0 ~ a ~ a " TOP ~ "~ "I; " ~ 8 wz BM. BMi T ""'[ Y0 7. 01, SY03 Vee Vss ~l JSYO, SYOo rnrDii AI'll ]PPI 7 01, PP1S aw !!! Ii E'l!!l .,,," PIN NO.1 MARK U> II it U U 0. BOTTOM i~ 0 ~ a " TOP ci ~ a 6 ~ "I; " wz ClICT BMO BMI N.C. N.C. JVO. SY03 V's J SYO , SYO o rnrDii AI'll ] ~ PIN NO.1 MARK o CD 0> tii §~ i " I~ II iii u i u N.C. zt.i NOTE: The 8206 and 8206-2 is packaged in a 68 pin JEDEC TYPE A hermetic chip carrier Figure Sa. 8206 and 8206-2 Pinout Diagram 6-42 , 205220·007 inter 8206 CERAMIC PIN GRID ARRAY PACKAGE TYPE A 68-LEAD CERAMIC PIN GRID ARRAY PACKAGE TYPE A C 1.165 (29.591) 1.135 (28.829) PINllD oooooo@)oo SWAGED PIN STANDOFF (4 PLACES) .070 TYP. (1.778) o@) @)@)@)@)@)@@@@) @@ o@) D @ @ o@ @)@) o@) @@) o@) @)@) o@) @)@) o@) @)@) .@@)@)@)@)@)@)@@ @)@)@@)@)@)@)@)@) 1.165 (29.591) 1.135 (28.829) I .122 (3.099) L-[r·09~8;(2;.4~89~);;~;;~~ .140 MAX ''1 (3.556)'--=;= 1 STANDOFFi!! L.090 (2.286) .060 (1.524) PIN GRID ARRAY (PGA) PIN-OUT TOP VIEW .~.~.~.~.~.~.~.~.~ -1 -2 '67'65-63'61'59'57-55'53'51 • 50' 49 ·. • 3 • 4 • 48 • 47 • 5 • 6 • 7 '46-45 '44'43 • 9 • 10 • 11 • 12 • 42 • 41 • 13' 14 -40'39 • 15' 16 • 38 • 37 • 17 • 19 • 21 • 23 • 25 • 27 • 29' 31 • 33' 36' 35 • 18 • 20 • 22 • 24 • 26 • 28 • 30' 32' 34 Figure 8b. 8206 Pin Grid Array Package and Pinout Diagram 6-43 205220-007 inter 8206 'NOTE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias ......... O°C to 70°C Storage Temperature ............... -65°C to +150°C Voltage On Any Pin With Respect to Ground ............. -0.5V to +7V Power Dissipation .......................... 1.5 Watts D,C. CHARACTERISTICS Symbol 1 VIH Parameter 1 Unit 270 mA 230 mA Test Conditions -0.5 0.8 V Input High Voltage 2.0 Vcc+ 0.5V V 0.45 0.45 V V 10l = 8mA 10l = 2.0mA V V 10H = -2mA 10H = -O.4mA Output Low Voltage -DO -All Others, VOH Output High Voltage -DO, CBO -All Other Outputs 2.6 2.4 I/O Leakage Current -PPI4/CE -DO/WDI0_15 III Max. Input Low Voltage VOL IlO Min. Power Supply Current -Single 8206, 8206-2 or Slave #1 -Master in Multi-Chip or Slaves #2,3,4 Icc Vil (TA = O°C to 70°C, Vcc = 5.0V ± 10%, Vss= GND) Input Leakage Current___ 2 -PPI0-3. 5-7. CBI6_7, SEDCU -All Other Input Only Pins ± 20 ± 10 /LA /LA 0.45V .;; VI 10 .;; Vcc ± 20 . ± 10 /LA /LA OV.;; VIN .;;VCC NOTES: 1. SEDCU (pin 3) and MIS (pin 4) are device strapping options and should be tied to Vee orGND. VIH min = Vee -O.5Vand VIL max = 0.5V. 2. PPIO-7 (pins 13-20) and CB16_7 (pins 11. 12) have internal pull-up resistors and if left unconnected will be pulled to Vee. A.C. TESTING LOAD CIRCUIT A.C. TESTING INPUT, OUTPUT WAVEFORM '. ~" > TEST POINTS 0.45 0.8 <"X= _~_~:_~s~_~_--,~, IL.· 0.8 A.C, TESTING; INPUTS ARE DRIVEN AT 2.4V FOR A LOGIC' l' AND OASV FOR A LOGIC 0." TIMING MEASUREMENTS ARE MADE AT 2.0V FOR A LOGIC 1 AND 0.8V FOR A LOGIC 0 CL INCLUOES JIG CAPACITANCE 6-44 205220-007 8206 A.C. CHARACTERISTICS (TA = O°C to 70°C. Vee all times are in nsec.) = +5V ± = OV, 10%, VSS 8206-1 Symbol Parameter Min. Max. = 220, RL 8206 = 50 pF; 8206-2 Max. Notes 25 40 4 44 49 44 54 66 1 32 42 46 1 35 42 57 CE Valid from Data/Check Bits In 50 70 76 Corrected Data Valid from Data/Check Bits In 55 67 74 TRHEV ERROR Valid from R/WI 20 TRHCV CE Valid from R/WI (Single 8206) 34 TRHQV Corrected Data Valid from R/WI TRVSV SYO/CBO/PPO Valid from R/W TDVEV ERROR Valid from Data/Check Bits In TDVCV TDVQV Min. CL Max. Min. TDVSV SYO/PPO Valid from Data/Check Bits In 40 55 65 TBHQV Corrected Data Access Time 35 37 37 TBXQX Hold Time From Data/Check Bits In TBLQZ Corrected Data Float Delay 0 TSHIV STB High to Data/Check Bits In Valid 30 TIVSL Data/Check Bits In to STBI Set-up 5 5 5 TSLIX Data/Check Bits In from STBI Hold 15 25 25 0 0 25 0 1 0 28 30 0 28 30 1 2 TPVEV ERROR Valid from Partial Parity In 21 30 TPVQV Corrected Data (Master) from Partial Parity In 46 61 1,3 TPVSV Syndrome/Check Bits Out from Partial Parity In 32 43 1,3 TSVQV Corrected Data (Slave) Valid from Syndrome 41 51 3 TSVCV CE Valid from Syndrome (Slave number 1) 43 48 3 TQVQV Check Bits/Partial Parity Out from Write Data In TRHSX Check Bits/Partial Parity Out from R/W, WZ Hold 0 0 0 TRLSX Syndrome Out from R/W Hold 0 0 0 TQXQX Hold Time from Write Data In 0 0 0 TSVRL Syndrome Out to RIWI Set-up 5 17 TDVRL Data/Check Bits to R/W Set-up 24 TDVQU Uncorrected Data Out from Data In 29 44 3,4 64 69 1 1 3 41 39 1 32 38 TTVQV Corrected Data Out from CRCTI 25 30 33 TWLQL WZI to Zero Out 25 30 34 TWHQX Zero Out from WZI Hold 0 0 1 4 0 NOTES: 1. A.C. Test Levels for CBO and DO are 2.4V and 0.8V. 2. TSH1V is required to guarantee output delay timings: TDVEV, TDVCV, TDVQV, T DVSV. TSH1V + T 1VSL guarantees a min STB pulse width of 35 ns (45 ns for the 8206-8). 3. Not required for 8/16 bit systems 4. 8206 S40037 has three parameters relaxed from full spec 8206: TRHEV = 35ns, TpVEV = 40ns, TWLQL = 40ns. 6-45 205220-007 8206 WAVEFORMS READ DO 6-46 205220-007 8206 WAVEFORMS (Continued) READ-MASTER/SLAVE STB 7r t\t--------- 1 1 l-lTsHlv 1 I 1 ---I't)Z1 R/W _ _ V I I 1 1 l:/t 8M _ _---L...I....J.1-:7 II ( TlVSL I H : I l......-l TSLIX I I I I I ~ f-- TBLQZ----.I : C~: ---<~,-Ji'-·---!-i I I I I '\L. . . __--1:_ _ -~f ---VAL-ID+-1 ::.~~:~::: i ~y/zvA . r---;~:;:v~ i I -~I DOIMASTER) _ - . - - - - : 1 I I 1 I-TPVQv-I I_TDXQX~ VALID +--- I I -}}- I SYIISLAVE)- : I l-TPvsv_1 4L 1 t--- ,,----I I...TSVQV--i I -~A//A r·TPVEV..! I ~4: VALID 1!SVCV.I ~I'~~~~~TR~HCV~~~~.~I_ _ _ _ X/////ft//////A CE _ _ _ _ 6-47 VALID I ~ VALID ~'~~~TR~HE;V~~~·I,LI_ _ _ _ __ _ ERROR _ _ _ _ I k, VALID 4 DOISLAVE)_--.!..: I 1 XII _~"""'-7A.,....-i-r~-r-.~.,.......r~~j{-tr--VAL-'D SYOIMASTER)~>V///WW/ I i I I k'--__ ~I X'--1 205220·007 inter 8206/820E WAVEFORMS (Continued) FULL WRITE !--TRvsv_1 I I , , , WI I I I I I I ~I RIW I I I ~ iiI.l I I TBLOZ , H DATA OUT , I I I I I I I I I 1: I Toxoxi WRITE DATA IN ~ .. , , I I_TOVOV I , , ~a SVN , I I I I I SVOICBO I TRHSX I r----+l . , ,I , , I rf I I I ~ DOIWDI TRLSX , X CB SVN FULL WRITE-MASTER/SLAVE J.---,TRYSV-...-..I RJW 11·La~ I I I m~: I: I DOIWDI DATA OUT r1 I -------..~ : I I I I : 'yRHSX. I I : : I , : -~TQVQv-------...1 I . I . I ~! : I I I : SyO/c.O_-:--SYN_ _ TRLSX -l I. I Taxaxl p:~~:~::: ---------~:>0:-"74 I-- : W. WRITEDATAlN} -;------'-1--------- k= ..~ TPV'V • , : -k= ----J~-r-:/h"T7~-r-l~r--c-. 6-48 20522D-007 inter 8206 WAVEFORMS (Continued) READ MODIFY WRITE ~t tt,..1 ---------,1 TS~'VII4"'------T'vsL---... -tt- 1-_---TSLIX---+j.1 II I I I I '{I'-----;-I...JA: I 1 R/WJ1 , I 14"1'...L.I-----'TDVR,L-L- - -...I_TRVSV---l !1 8M X-, I :: , 1 1 ---!.:-C 1 II - - - V A - L I D - :- - - . - : 1 j!RHSXII1,lTaL~i ----+-: -in-: I - TaHQV ---' , I cg: 1 1 1 I 1- I --.....;....-----..~ -VAL-'-ID: TRHQV'--+---l~1 " 1 ' : : J iI : 114.-;-1----'TDVQV--::';::;~~I~_ _ _ _-I-_ _TD_XQ_X_ 1-1 DO/wD'~11 ---~: 1--: , I 4 : «~ il- I ,""I_---TRVSV---~~I I M I TQXax-! '-TRLSX I I I I syo/cao 1 I II-'----'TDVSV'---+j.1 I I !--TQVQV-! 6-49 I --PC ----1...1~~,.....-r-Z~Z0..--rZ~Z$'-;"""c:~SYN~~~7"'t7--, CB I I I 205220-007 8206 WAVEFORMS (Continued). READ MODIFY WRITE-MASTER/SLAVE ;t _ _.-J , ' - - -_ _-...J '!---TRHSX I, ' , I J+', I I ~R'D7 ~ I , I' : 'i I I DDIWDI (SLAVE) ,I , rTSVRL~TRVSv1 I VALID I II ~"W_RITEL~~'!i---------+_'!1<= , "J--TPV~V----' . , :1 .1' "II I , I " I ! ~( ! I I I I , I SYO/CBD(M~/Z( SYI (SLAVE) , , , , I r-TP~s--1 .·1 I I I I I I ' I !--TBLQZ-r -I , - (IlI ii:rALlD , I . I-TIVSL I' TDVSV-l I ~TRVSV---; DDIWDI (MASTER) X,------+i , , , ' ,-,TSHIV' P::::::: , :," ski+,I-------------------+-r I: I , ----l I : ~TBHQV-' , DI CBI , , _~ STB, A .'{ , SYN I r, I , »i VALID :_TPVSV_, I' I I I >0?~ CB 'K I ~TQVQV~ I ~~20~~{----~L1-D--~~ 6-50 205220-007 inter 8206 WAVEFORMS (Continued) NON·CORRECTING READ CRCT--------------------~~ ~ ~I_---..J I I I I I I_TTVQV_I lI 1M=?: I I I :I ( 01 CBI I I I' I TWLQL 'i ¢: I I I I I UNCORRECTED CORRECTED } ·1 UNCORRECTED I I I ;1I I I I 1- TQVQV ----t I I i I I I I I I" ------------~--------~----------~~ I I I Wi I_ TBLQZ Iii ) ------------_~ WRITE ZERO n I TTVQV I !-TBHQV---I DO/WDI ~"I i f.>lo--TDVQU--..... 1 I I I ~ I I I~HQ!I I I I I :~ DO@0/#/ftff$~ i II~ I x= 1,....-_ _ 1 SYO'CBo~mff~/W~ 6-51 VALID 205220-007 8207 DUAL·PORT DYNAMIC RAM CONTROLLER • Provides All Signals Necessary to Control 16K, 64K and 256K Dynamic RAMs • Directly Addresses and Drives up to 2 Megabytes without External Drivers • Supports Single and Dual-Port Configurations • Automatic RAM Initialization in All Modes • Four Programmable Refresh Modes • Transparent Memory Scrubbing in ECC Mode • 80286 Fast cycle (CFS=1) 8086/186 Slow cycle (CFS=O) 8 MHz 8207-16 6 MHz 8 MHz 8207-12 8207-8 6 MHz 8207-6 • Provides Signals to Directly Control the 8206 Error Detection and Correction Unit • Supports Synchronous or Asynchronous Operation on Either Port • +5 Volt Only HMOSII Technology for High Performance and Low Power • 68 Lead JEDEC Type A Leadless Chip Carrier (LCC) and Pin Grid Array (PGA), Both in Ceramic. See Packaging Specifications, Order #: 231369 The Intel 8207 Advanced Dynamic RAM Controller (ADRC) is a high-performance, systems-oriented, Dynamic RAM controller that is designed to easily interface 16K, 64K and 256K Dynamic RAMs to I ntel and other microprocessor systems. A dual-port interface allows two different busses to independently access memory. When configured with an 8206 Error Detection and Correction Unit the 8207 supplies the necessary logic for designing large error-corrected memory arrays. This combination provides automatic memory initialization and transparent memory error scrubbing. ~ PCTLA P9 RFRQ .01---11---0-1 aSO.1C===~~ Figure 1. 8207 Block Diagram Intel Corporation Assumes No Responsibility forthe Use of AnyCircuilry Other Than Clrc'uitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied. Information Contained Herein Supercedes Previously Published Specifications On These Devices From Inlel. "'INTEL CORPORATION, 1983 JAN. 1986 6-52 ORDER NUMBER: 210463-005 intel· 8207 Table 1. Pin description Symbol Pin Type Name and Function LEN 1 0 ADDRESS LATCH ENABLE: In two-port configurations, when Port A is running with iAPX 286 Status interface mode, this output replaces the ALE signal from the system bus controller of port A and generates an address latch enable signal which provides optimum setup and hold timing for the 8207. This signal is used in Fast Cycle operation only. XACKA/ ACKA 2 0 TRANSFER ACKNOWLEDGE PORTA/ACKNOWLEDGE PORTA: In non-ECC mode, this pin is XACKA and inidcates that data on the bus is valid during a read cycle or that data may be removed from the bus during a write cycle for Port A. XACKA is a Multibus-compatible signal. In ECC mode, this pin is ACKA which can be configured, depending on the programming of th~ogram bit, as an XACK or AACK strobe. The SA programming bit determines whether the AACK will be an early EAACKA or a late LAACKA interface signal. XACKB/ ACKB 3 0 TRANSFER ACKNOWLEDGE PORT B/ACKNOWLEDGE PORT B: In non-ECC mode, this pin is XACKB and indicates that data on the bus is valid during a read cycle or that data may be removed from the bus during a write cycle for Port B. XACKB is a Multibus-compatible signal. In ECC mode, this~ ACKB which can be configured, depending on the programming of the X program bit, as an XACK or AACK strobe. The SB programming bit determines whether the AACK will be an early EAACKB or a late LAACKB interface signal. AACKA/ WZ 4 0 ADVANCED ACKNOWLEDGE PORT A/WRITE ZERO: In non-ECC mode, this pin is AACKA and indicates that the processor may continue processing and that data will be available when required. This signal is optimized for the system by programming the SA program bit for synchronous or asynchronous operation. In ECC mode, after a RESET, this signal will cause the 8206 to force the data to all zeros and generate the appropriate check bits. AACKB/ RiW 5 0 ADVANCED ACKNOWLEDGE PORT B/READ/WRITE: In non-ECC mode, this pin is AACKB and indicates that the processor may continue processing and that data will be available when required. This signal is optimized for the system by programming the SB program bit for synchronous or asynchronous operation. In ECC mode, this signal causes the 8206 EOCU to latch the syndrome and error flags and generate check bits. OBM 6 0 DISABLE BYTE MARKS: This is an ECC control output signal indicating that a read or refresh cycle is occurring. This output forces the byte address decoding logic to enable all 8206 data output buffers. In ECC mode, this output is also asserted during memory initialization and the 8-cycle dynamic RAM wake-up exercise. In non-ECC systems this signal indicates that either a read, refresh or 8-cycle ESTB 7 0 ERROR STROBE: In ECC mode, this strobe is activated when an error is detected and allows a negative-edge triggered flip-flop to latch the status of the 8206 EOCU CE for systems with error logging capabilities. ESTB will not be issued during refresh cycles. LOCK 8 I LOCK: This input instructs the 8207 to lock out the port not being serviced at the time LOCK was issued. Vcc 9 43 I DRIVER POWER: +5 Volts. Supplies Vcc for the output drivers. LOGIC POWER: +5 Volts. Supplies Vcc for the internal logic circuits. CE 10 I CORRECTABLE ERROR: This is an ECC input from the 8206 EDCU which instructs the 8207 whether a detected error is correctable or not. A high input indicates a correctable error. A low input inhibits the 8207 from activating WE to write the data back into RAM. This should be connected to the CE output of the 8206. ERROR 11 I ERROR: This is an ECC input from the 8206 EOCU and instructs the 8207 that an error was detected. This pin should be connected to the ERROR output of the 8206. MUX/ PCLK 12 0 MULTIPLEXER CONTROL/PROGRAMMING CLOCK: Immediately after a RESET this pin is used to clock serial programming data into the PDI pin. In normal two-port operation, this pin is used to select memory addresses from the appropriate port. When this signal is high, port A is selected and when it is low, port B is selected. This signal may change state before the completion of a RAM cycle, but the RAM address hold time is satisfied. PSEL 13 0 PORT SELECT: This signal is used to select the appropriate port for data transfer. When this signal is high port A is selected and when it is low port B is selected. PSEN 14 0 PORT SELECT ENABLE: This signal used in conjunction with PSEL provides contention-free port exchange on the data bus. When PSEN is low, port selection is allowed to change state. WE 15 0 WRITE ENABLE: This signal provides the dynamic RAM array the write enable input for a write operation. warm~up is in progress. 6-53 210463-005 8207 Table 1. Pin Description (Continued) Symbol Pin Type Name and Function FWR 16 I FULL WRITE: This is an ECC input signal that instructs the 8207, in an ECC configuration, whether the present write cycle is normal RAM write (full write) or a RAM partial write (read-modify-write) cycle. RESET 17 I RESET: This signal causes all internal counters and state flip-flops to be reset and upon release of RESET, data appearing at the POI pin is clocked in by the PCLK output. The states of the POI, PCTLA, PCTLB and RFRO pins are sampled by RESET going inactive and are used to program the 8207. An 8-cycle dynamic RAM warm-up is performed after clocking POI bits into the 8207. CASO CAS1 CAS2 CAS3 18 19 20 21 0 0 0 0 COLUMN ADbRESS STROBE: These outputs are used by the dynamic RAM array to latch the column address, present on the AOO-8 pins. These outputs are selected by the BSO and BS1 as programmed by program bits RBO arid RB1. These outputs drive the dynamic RAM array directly and need no external drivers. RASO RAS1 RAS2 RAS3 22 23 24 25 0 0 0 0 ROW ADDRESS STROBE: These outputs are used by the dynamic RAM array to latch the row address, present on the AOO-8 pins. These outputs are selected by the BSO and BS1 as programmed by program bits RBO and RB1. These outputs drive the dynamic RAM array directly and need no external drivers. Vss 26 60 I I DRIVER GROUND: Provides a ground for the output drivers. LOGIC GROUND: Provides a ground for the remainder of the device. AOO A01 A02 A03 A04 A05 A06 A07 A08 35 34 33 32 31 30 29 28 27 0 0 0 0 0 0 0 0 0 ADDRESS OUTPUTS: These outputs are designed to provide the row and column addresses of the selected port to the dynamic RAM array. These outputs drive the dynamic RAM array directly and need no external drivers'. BSO BS1 36 37 I I BANK SELECT: These inpulS are used to select one of four banks of the dynamic RAM array as defined by the program bits RBO and RB1. ALO AU AL2 AL3 AL4 AL5 AL6 AL7 AL8 38 39 40 41 42 44 45 46 47 I I I I I I I I I ADDRESS LOW: These lower-order address inputs are used to generate the row address for the internal address multiplexer. AHO AH1 AH2 AH3 AH4 AH5 AH6 AH7 AH8 48 49 50 51 52 53 54 55 56 I I I I I I I I I ADDRESS HIGH: These higher-order address inputs are used to generate the column address for the internal address multiplexer. POI 57 I PROGRAM DATA INPUT: This input programs the various user-selectable options in the 8207. The PCLK pin shifts programming data into the POI input from optional external shift registers. This pin may be strapped high or low to a default ECC (POI =Logic "I") or non-ECC (POI = Logic "0") mode configuration. RFRO 58 I REFRESH REQUEST: This input is sampled on the falling edge of RESET. If it is high at RESET, then the 8207 is programmed for internal refresh request or external refresh request with failsafe protection. If.it is low at RESET, then the 8207 is programmed for external refresh without failsafe protection or burst refresh. Once programmed the RFRO pin accepts signals to start an external refresh with failsafe protection or external refresh without failsafe protection or a burst refresh. 6-54 210463-005 8207 Table 1. Pin Description (Continued) Pin Type ClK Symbol 59 I CLOCK: This input provides the basic timing for sequencing the internal logic. Name and Function ROB 61 I READ FOR PORT B: This pin is the read memory request command input for port B.' This input also directly accepts the 51 status line from Intel processors. WRB 62 I WRITE FOR PORT B: This pin is the write memory request command input for port B. This input also directly accepts the SO status line from Intel processors. PEB 63 I PORT ENABLE FOR PORT B: This pin serves to enable a RAM cycle request for port B. It is generally decoded from the port address. PCTlB 64 I PORT CONTROL FOR PORT B: This pin is sampled on the falling edge of RESET. It configures port B to accept command inputs or processor status inputs. If low after RESET, the 8207 is programmed to accept command or iAPX 286 status inputs or Multibus commands. If high after RESET, the 8207 is programmed to accept status inputs from iAPX 86 or iAPX 186 processors. The S2 status line should be connected to this input if programmed to accept iAPX 86 or iAPX 186 status inputs. When programmed to accept commands or iAPX 286 status, it should be tied low or it may be used as a Multibus-compatible inhibit signal. RDA 65 I READ FOR PORT A: This pin is the read memory request command input for port A. This input also directly accepts the S1 status line from Intel processors. WRA 66 I WRITE FOR PORT A: This pin is the write memory request command input for port A. This input also directly accepts the SO status line from Intel processors. PEA 67 I PORT ENABLE FOR PORT A: This pin serves to enable a RAM cycle request for port A. It is generally decoded from the port address. peTlA 68 I PORT CONTROL FOR PORT A: This pin is sampled on the falling edge of RESET. It configures port A to accept command inputs or processor status inputs. If low after RESET, the 8207 is programmed to accept command or iAPX 286 status inputs or Multibus commands. If high after RESET, the 8207 is programmed to accept status inputs from iAPX 86 or iAPX 186 processors. The S2 status line should be connected to this input if programmed to accept iAPX 86 or iAPX 186 status inputs. When programmed to accept commands or iAPX 286 status, it should be tied low or it may be connected to INHIBIT when operating with Multibus. GENERAL DESCRIPTION FUNCTIONAL DESCRIPTION The Intel 8207 Advanced Dynamic RAM Controller (ADRC) is a microcomputer peripheral device which provides the necessary signals to address, refresh and directly drive 16K, 64K and 256K dynamic RAMs. This controller also provides the necessary arbitration circuitry to support dual-port access of the dynamic RAM array. Processor Interface The 8207 has control circuitry for two ports each capable of supporting one of several possible bus structures. The ports are independently configurable allowing the dynamic RAM to serve as an interface between two different bus structures. The ADRC supports several microprocessor interface options including synchronous and asynchronous connection to iAPX 86, iAPX 88, iAPX 186, iAPX 188, iAPX 286 and Multibus. Each port of the 8207 may be programmed to run synchronous or asynchronous to the processor clock. (See Synchronous/Asynchronous Mode) The 8207 has been optimized to run synchronously with Intel's iAPX 86, iAPX 88, iAPX 186, iAPX 188 and iAPX 286. When the 8207 is programmed to run in asynchronous mode, the 8207 inserts the necessary synchronization circuitry for the RD, WR, PE, and PCTl inputs. This device may be used with the 8206 Error Detection and Correction Unit (EDCU). When used with the 8206, the 8207 is programmed in the Error Checking and Correction (ECC) mode. In this mode, the 8207 provides all the necessary control signals for the 8206 to perform memory initialization and transparent error scrubbing during refresh. 6-55 210463-005 8207 The 8207 achieves high performance (Le. no wait states) by decoding the status lines directly from the iAPX 86, iAPX 88, iAPX 186, iAPX 188 and iAPX 286 processors. The 8207 can also be programmed to receive read or write Multibus commands or commands from a bus controller. (See Status/Command Mode) the iAPX 86,88, 186, 188, or 286. The.8207 adjusts its internal timing to allow for the different clock frequencies of these microprocessors. (See Microprocessor Clock Frequency Option) Figure 2 shows the different processor interfaces to the 8207 using the synchronous or asynchronous mode and status or command interface. The 8207 may be programmed to accept the clock of 8207 \-------1 All eLK 1-_ _ _.j\NRCLK 1----.jiiO :g::~ sa Sf 52 ADDR.JDATA Slow-Cycle Asynchronous-Status Interface Slow-Cycle Synchronous-Status Interface Slow-Cycle Synchronous-Command Interface Slow-Cycle Asynchronous-Command Interface Figure 2A. Slow-cycle (CFS=O) Port Interfaces Supported by the 8207 6-56 210463-005 8207 NOTE: ADDRESS LATCH NOT REQUIRED IN SINGLE-PORT MODE. NOTE: ADDRESS LATCH NOT REQUIRED IN SINGLE-PORT MODE. Fast-Cycle Synchronous-Status Interface Fast-Cycle AsynchronOUS-Status Interface SYNCHRONOUS 80286 ·MULTI·BUS OPTION Fast-Cycle Synchronous-Command Interface Fast-Cycle Asynchronous-Command Interface Figure 2B. Fast·cycle (CFS=1) Port Interfaces Supported by the 8207 Single-Port Operation Dynamic RAM Interface The use of an address latch with the iAPX 286 status interface is not needed since the 8207 can internally latch the addresses with an internal signal similar in behavior to the LEN output. This operation is active only in single-port applications when the processor is interfaced to port A. The 8207 is capable of addressing 16K, 64K and 256K dynamic RAMs. Figure 4 shows the connection of the processor address bus to the 8207 using the different RAMs. Dual-Port Operation The 8207 provides for two-port operation_ Two independent processors may access memory controlled by the 8207. The 8207 arbitrates between each of the processor requests and directs data to or from the appropriate port. Selection is done on a priority concept that reaSSigns priorities based upon past history. Processor requests are internally queued. The 8207 divides memory into as many as four banks, each bank having its own Row (RAS) and Column - (CAS) Address Strobe pair. This organization permits RAM cycle interleaving and permits error scrubbing during ECC refresh cycles_ RAM cycle interleaving overlaps the start of the next RAM cycle with the RAM Precharge period of the previous cycle. Hiding the precharge period of one RAM cycle behind the data access period of the next RAM cycle optimizes memory bandwidth and is effective as long as successive RAM cycles occur in alternate banks. Figure 3 shows a dual-port configuration with two iAPX 86 systems interfacing to dynamic RAM. One of the processor systems is interfaced synchronously using the status interface and the other is interfaced asynchronously also using the status interface. Successive data access to the same bank will cause the 8207 to wait for the precharge time of the previous RAM cycle. 6-57 210463-005 P 8284A· READY ROY 1 ~ OTHERACK INPUTS MEMORY MEMORY (LOWER) (UPPER) elK WE elK 52 51 WRB ~ 80861 80186 O'l AODR/DATA PCTlBfROB 8207 RoA WRA so a, AACKli PCTlA J 51 STU f<:-;> 8283 LATCH MUX AHo_sALo.a WE 01 DO ..- I----l WE T READY elK 52 P r'-' ;..-...J elK AACKA AC o•s RAS o_3 CASo-3 SO DO rP fill If I--- ALE 8288" DEN I-- DTtA 01 PSEN PSEl ....STB , ..-==- ~ :!];~ LATCH f-- f- - ~f,! elK ~ ffi~ :z: 8288* DEN OTfAI--ALE so 51 52 ~ rtti ~ so ~ B086I 80186 OE STB ~~ 8283 Bl I. ~~I ........ I. -r-" I I OE 8283 LATCH V ~ § PORT B-ASYNCHRON DUS STB 8283 LATCH I--- '-- "@ dQI I. Iffij] C '--- ~ ~ o ...., PORT A-SYNCHRONOUS; ~ - 5TB ADDRJDATA EXTENDED MEMORY UISING STATUS. t..::.~ OE I. , 8283 B BO READY 52 SI 74LS14 '-- 8283 CLK l' STB OE ~ CLK 5 l.....- 0> IQ~'-' I 74LS74 L }. t 8284A* NOTE: "These components are not necessary when_ using the 80186 components. These functions are provided directly by the 80186. Figure 3. 8086/80186 Dual Port System ~ ~ ~ dQI ~ 8207 A12-A20 AHO-AH8 8207 8207 8207 A3-A11 A1,A2 256K RAM INTERFACE 16K RAM INTERFACE 64K RAM INTERFACE NOTES: (1) Unassigned address input pins should be strapped high or low. (2) AO along with BHE are used to select a byte within a processor word. (3) Low order address bits ,are used as bank select inputs so that consecutive memory access requests are to alternate banks allowing bank interleaving oT memory cycles. Figure 4. Processor Address Interface to the 8207 Using 16K, 64K, and 256K RAMS Table 2. Bank Selection Decoding and Word Expansion If not all RAM banks are occupied, the 8207 reassigns the RAS and CAS strobes to allow using wider data words without increasing the loading on the RAS and CAS drivers. Table 2 shows the bank selection decoding and the word expansion, including RAS and CAS assignments. For example, if only two RAM banks are occupied, then two AAS and two CAS strobes are activated per bank. Program bits RB1 and RBO are not used to check the bank select inputs BS1 and BSO. The system design must protect from accesses to "illegal", non-existent banks of memory, by deactivating the PEA, PEB inputs when addressing an illegal bank. Bank Program Bits Input RB1 RBO BS1 BSe RAS/CAS Pair Allocation 0 0 0 0 RASo_3, CASO-3 to Bank 0 0 0 0 1 Illegal 0 0 1 0 Illegal 0 0 1 1 Illegal 0 1 0 0 RASo,1, CASO,1 to Bank 0 0 1 0 1 RAS2 3, CAS2,3 to Bank 1 Illegal The 8207 can interface to fast or slow RAMs. The 8207 adjusts and optimizes internal timings for either the fast or slow RAMs as programmed. (See RAM Speed Option.) 0 1 1 0 0 1 1 1 Illegal Memory Initialization 1 0 0 0 RASo, CASo to Bank 0 After programming, the 8207 performs eight RAM "warm-up" cycles to prepare the dynamic RAM for proper device operation. During "warm-up" some RAM parameters, such as tRAH, tASC, may not be met. This causes no harm to the dynamic RAM array. If configured for operation with error correction, the 8207 and 8206 EDCU will proceed to initialize all of memory (memory is written with zeros with corresponding check bits). 1 0 0 1 RAS1 , CAS1 to Bank 1 1 0 1 0 RAS2, CAS2 to Bank 2 1 0 1 1 Illegal 1 1 0 0 RASo, CASo to Bank 0 1 1 0 1 RAS1, CAS1 to Bank 1 1 1 1 0 RAS2, CAS2 to Bank 2 1 1 1 1 RAS3, CAS3 to Bank 3 6-59 210463-005 inter 8207 Because the time to initialize memory is fairly long, the 8207 may be programmed to skip initialization in ECC mode. The time required to initialize all of memory is dependent on the clock cycle time to the 8207 and can be calculated by the following equation: eq.1 Figure 6 illustrates the interface required to drive the CRCT pin of the 8206, in the case that one port (PORT A) receives an advanced acknowledge (not Multibuscompatible), while the other port (PORT B) receives XAGK (which is Multibus-compatible). TINIT = (:t3) TCLCL if TCLCL = Error Scrubbing 125 ns then TINIT = 1 sec. The 8207/8206 performs error correction during refresh cycles (error scrubbing). Since the 8207 must refresh RAM, performing error scrubbing during refresh allows it to be accomplished without additional performance penalties. 8206 ECC Interface For operation with Error Checking and Correction (ECC), the 8207 adjusts its internal timing and changes some pin functions to optimize performance and provide a clean dual-port memory interface between the 8206 EDCU and memory. The 8207 directly supports a master-only (16-bit word plus 6 check bits)' system. Under extended operation and reduced clock frequency, the 8207 will support any ECC master-slave configuration up to 80 data bits, which is the maximum set by the 8206 EDGU. (See Extend Option) Upon detection of a correctable error during refresh, the RAM refresh cycle is lengthened slightly to permit the 8206 to correct the error and for the corrected word to be rewritten into memory. Uncorrectable errors detected during scrubbing are ignored. Refresh Correctable errors detected during memory read cycles are corrected immediately and then written back into memory. In a synchronous bus environment, EGG system performance has been optimized to enhance processor throughput, while in an asynchronous bus environ- . ment (the Multibus), EGG performance has been optimized to get valid data onto the bus as quickly as possible. Performance optimization, processor throughput or quick data access may be selected via the Transfer Acknowledge Option. The main difference between the two EGC implementations is that, when optimized for processor throughput, RAM data is always corrected and an advanced transfer acknowledge is issued at a point when, by knowing the processor characteristics, data is guaranteed to be valid by the time the processor needs it. The 8207 provides an internal refresh interval counter and a refresh address counter to aliow the 8207 to refresh memory. The 8207 will refresh 128 rows every 2 milliseconds or 256 rows every 4 milliseconds, which allows all RAM refresh options to be supported. In addition, there exists the ability to refresh 256 row address locations every 2 milliseconds via the Refresh Period programming option. The 8207 may be programmed for any of four different refresh options: Internal refresh only, External refresh with failsafe protection, External refresh without failsafe protection, Burst Refresh mode, or no refresh. (See Refresh Options) It is possible to decrease the refresh time interval by 10%, 20% or 30%. This option allows the 8207 to compensate for reduced clock frequencies. Note that an additional 5% interval shortening is built-in in all refresh interval options to compensate for clock variations and non-immediate response to the internally generated refresh request. (See Refresh Period Options) When optimized for quick data access, (valid for Multibus) the 8206 is configured in the uncorrecting mode where the delay associated with error correction circuitry is transparent, and a transfer acknowledge is issued as soon as valid data is known to exist. If the ERROR flag is activated, then the transfer acknowledge is delayed until after the 8207 has instructed the 8206 to correct the data and the corrected data becomes available on the bus. Figure 5 illustrates a dual-port ECC system. External Ref~esh Requests after RESET External refresh requests are not recognized by the 8207 until after it is finished programming and preparing memory for access. Memory preparation includes 8 RAM cycles to prepare and ensure proper 6-60 210463-005 l J- DT/RB ~I CMD/PEA ADDR CMD/PEB WE j DENB J ACKB CMD/PEB ADDR B -V ~o~~ f-- 0) ~ CMD/PEA - V ADORA ACKA DENA DT/RA - rV -{r r-h 1WE V wz ClK PSEN ADDR CE ERROR DBM L R/W ACKA 71 L FWR PSEl 1I ~ Y • BYTE MARK DECODER ~ rV BYTE MARK lATCH ~~CT BM r- I l- WOI/DO PPO :::r: Jo---y G(M === ;=::=- XCVR 5l1~E DT/R IIJ 7 ~ -rc 7 , CE 'V WR WR ~a~~RRIDE - CRCT 8206 t=:= PORTA R/W R - I II- ERROR SY/CB 011 R/W CBI ECC PPI MASTER STB , 001 CBI CBO 01 8207 MUX DYNAMIC RAM SYNC 01 QI ~ o..... ECC SLAVE 8206 WOI/DO 5~ 1 "@ PORTB :m M F = ~ ~ ~ ~ ~ ~ :m Figure 5. Two-Port ECC Implementation Using the 8207 and the 8206 -------------«==lfA~L~ID=»--------t- 't AO ;:) v 8207 AH".sALo.s PSEN STB LATCH ~ Wo., r r1 CLK ADDRI DATA AACK CLK ~ S2 SlS0ALE Q~ 16/ 8287 ,Vl OE T 18 ~ 8287 NOTE: "These components are not necessary when using the 80186. These funCtions are provided directly by the 80186. Figure 16. 8086/80186, 8207 Single Port Non-ECC Synchronous Systems 6-72 210463-005 8207 62284 REAOY SROY {If: I OTHER ACK INPUTS ClK t ClK 62266 DEN t-- READY ClK OT/RrM/iOs1S0 ClK v: ~II 51 M/iO 1 SO 60266 AACK MEMORY (UPPER) 6207 + DATA f- TV} T WE I AO' +5V MEMORY (lOWER) WE r- RD WR AODRIN PSEN AODR ~ AOOR, STROBES PCTl ~I=D- 01 DO r II r-l I WE 01 DO 111 J ClK BO a r-- BHE' B1 Q r----- OE 16 8287 \7J T OE 16 L-.c.'--- 8287 Note: While the 8207 does not need the input addresses latched, must come from the latched address bus. AD, SHE Figure 17. 80286 Hook-up to 8207 Non-ECC Synchronous System-Single Port. 6-73 210463·005 inter 8207 Table 8. Processor Interface/Acknowledge Summary CYCLE FAST CYCLE CFS=1 SLOW CYCLE CFS=O PROCESSOR REQUEST TYPE SYNC/ASYNC INTERFACE ACKNOWLEDGE TYPE 80286 STATUS SYNC EAACK 80286 STATUS ASYNC LAACK 80286 COMMAND SYNC EAACK 80286 COMMAND ASYNC LAACK 8086/80186 STATUS ASYNC LAACK 8086/80186 COMMAND ASYNC LAACK MULTIBUS COMMAND ASYNC XACK EAACK 8086/80186 STATUS SYNC 8086/80186 STATUS ASYNC LAACK 8086/80186 COMMAND SYNC EAACK 8086/80186 COMMAND ASYNC LAACK MULTIBUS COMMAND ASYNC XACK Table 9. Memory Acknowledge Option Summary Synchronous Asynchronous XACK AACK Optimized for Remote 80286 Multibus Compatible Fast Cycle AACK Optimized for Local 80286 AACK Optimized for Local 8086/186 AACK Optimized for Remote 8086/186 Multibus Compatible Slow Cycle Test Modes Two special test modes exist in the 8207 to facilitate testing. Test Mode 1 (non-EGG mode) splits the refresh address counter into two separate counters and Test Mode 2 (EGG mode) presets the refresh address counter to a value slightly less than rollover. 8207 will normally be set in Test Mode 2. Test Mode 2 eliminates memory initialization in EGG mode. This allows quick examination of the circuitry which brings the 8207 out of memory initialization and into normal operation. Test Mode 1 splitsthe address counter into two, and increments both counters simultaneously with each refresh address update. By generating external refresh requests, the tester is able to check for proper operation of both counters. Once proper individual counter operation has been established, the 8207 must be returned to normal mode and a second test performed to checkthat the carry from the first counter increments the second counter. The outputs of the counters are presented-on the address out bus with the same timing as the row and column addresses of a normal scrubbing operation. During Test Mode 1, memory initialization is inhibited, since the 8207, by definition, is in non-EGG mode. General System Considerations The RAS o_3, GAS O_3, AO O-B, output buffers were designed to directly drive the heavy capacitive loads associated with dynamic RAM arrays. To keep the RAM driver outputsJrom ringing excessively in the system envi ron ment and causi ng noise in other output pi ns it is necessary to match the output impedance of the RAM output buffers with the RAM array by using series resistors and to add series resistors to other control outputs for noise reduction if necessary. Each application may have different impedance characteristics and may require .different series ~esistance values. The series resistance values should be determined for each application. In non-EGG systems unused EGG input pins should b.e tied high or low to improve noise immunity. Test Mode 2 sets the internal refresh counter to a value slightly less than rollover. During functional testing other than that covered in Test Mode 1, the 6-74 210463-005 8207 £~£~~~~~8~~~~9~~g «c« «« A::> 1\ 1\ xnw H 1 ~~~ -19 >I::>VV1 apow A~'W!M ~ ~ ~1~~©l ~::>VV~ ::>::>3 - lJe 4::> -19 tO~ tO~ t9 t9 H -IS -IS t9 t9 t9 t9 1 S~S3 6u!w!~ LO~8 9:) 5:) v:) 8:) ~:) ~:) 0:) u::> ~aaV10::: 'S £~ alqe~ ®Mu! 8207 8207 - DRAM Interface Parameter Equations WRITE CYCLE Several DRAM parameters, but not all, are a direct function of 8207 timings, and the equations for these parameters are given in the following tables. The following is a list of those DRAM parameters which have NOT been included in the following tables, with an explanation for their exclusion. tRC: tRAS: tCAS: tWCS: READ, WRITE, READ-MODIFY-WRITE & REFRESH CYCLES tRAC: tCAC: tREF: tCRP: response. parameter. response parameter. See "Refresh Period Options" must be met only if CAS-only cycles, which do not occur with 8207, exist. See "AC .. Characteristics" See "AC. Characteristics" See "AC. Characteristics" See "A.C. Characteristics" response parameter. tRAH: tRCD: tASC: tASR: tOFF: IDS: IDH: IDHR: guaranteed by tRWC. guaranteed by tRRW. guaranteed by tCRW. _ WE always activated after CAS is activated, except in memory initialization, hence tWCS is always negative (this is important for RMW only) except in memory initialization; in memory initialization tWCS is positive and has several clocks of margin. system-dependent parameter. system-dependent parameter. system-dependent parameter. READ-MODIFY-WRITE CYCLE tRWD: tCWD: don't lated don't lated care in 8207 write cycles, but tabufor 8207 RMW cycles. care in 8207 write cycles, but tabufor 8207 RMW cycles: READ & REFRESH CYCLES tRCH: WE always goes active after CAS goes active, hence tRCH is guaranteed by tCPN. Table 14, Non-ECC Mode - RD, RF Cycles Fast Cycle Configurations Slow Cycle Configurations Parameter Co C, C2 C3 C. Notes tRP 3TCLCL-T26 4TCLCL-T26 4TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tCPN 3TCLCL-T35 3TCLCL-T35 3TCLCL-T35 2.5TCLCL- T35 2.5TCLCL- T35 1 tRSH 2TCLCL-T34 3TCLCL-T34 3TCLCL-T34 3TCLCL~T34 4TCLCL-T34 1 tCSH 4TCLCL-T26 6TCLCL-T26 6TCLCL-T26 3TCLCL-T26 4TCLCL-T26 1 tCAH TCLCL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 3TCLCL-T26 3TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 IT 3/30 3/30 3/30 3/30 3/30 2 tRC 6TCLCL 8TCLCL 8TCLCL 5TCLCL 6TCLCL 1 tRAS 3TCLCL-T26 4TCLCL-T26 4TCLCL-T26 3TCLCL-T26 4TCLCL-T26 1 tCAS 3TCLCL-T34 5TCLCL'- T34 5TCLCL-T34 3TCLCL-T34 4TCLCL-T34 1 tRCS 2TCLCL-TCL 2TCLCL-TCL 2TCLCL-TCL 1.5TCLCL-TCL 1.5TCLCL-TCL -T36-TBUF -T36-TBUF -T36-TBUF -T36-TBUF 1 -cT36-TBUF 210463-005 6-90 ~6-9 gOO-£9pm~ tc: tc: tc: tc: tc: tc: tc: tc: tc: tc: HHHH- l::IM tc: ~8 tc: tC:- l::IM t8 tC:- al::l tv tC:- l::IM t8 tC:- al::l tv tC:- ~M t8 tC:- al::l t8 t8 tv t9 tv tS tv tS tc: t8 H tc: H tc: H tv t8 tS H tv tc: tS H tv tc: tv H H 1 !1 /I. xnll\l l::IM tc: ~8 ~8 t8 al::l al::l 1 >I::>"X H to H H >1::>""1 H tc: tc: tc: tc: t8 t8 t8 t8 tc: tc: to to to to to to to to to to 1 .!1 /I. to to H tc: H tc: H H tv tS tS tS 1 ~c: ~c: tc: tc: tc: tv tv to to tv tv to to tc: tc: to to tv t8 to to tv t8 to to tc: tc: to to tS t9 H tS tv to to tc: tc: to to tS t9 H tS tv to to tc: tc: to to to to tc: tc: to to H H tS H tS tv H t8 H 3M H 1 s,,::> H 1 s,,~ H 1 N31 V:) l::IM £:) :ll::l 'al::l l::IM G:) :ll::l 'al::l l::IM ~:) :ll::l 'al::l l::IM 0:) :ll::l 'al::l 31::>A::> u::> >1::>""3 I:IOO\f 10:> ! I -e C:~ alqel apOIl\l ::>::>3-uoN - IJell::> 6U!W!1 tv l::IM :ll::l'al::l to tv tv to to t8 to tv t8 to to to to t8 to tc: . to t9 to tS t9 to to tv tS to to t9 to tS t9 to to tv tS to to :ll::l'al::l tv to tS tv to to tv t8 to to :ll::l 'al::l tv H 1 wec /I. /I. 13Sd t8 t8 1 H l::IM I v:) :ll::l 'al::l l::IM I I I £:) :ll::l 'al::l l::IM G:) :ll::l 'al::l l::IM l::IM 31::>A::> ~:) 0:) I u::> N3Sd apoll\l ::>::>3-uON - J,lBlI::> 6UIW!1 ." C:~ alqBl A~w[M~IW\Il~'~~@] LO~9 @MU! 8207 Table 15. Non-ECC Mode - WR Cycle Slow Cycle Configurations Fast Cycle Configurations Parameter Co C, C2 C3 C4 tRP 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 2TCLCL-T26 2TCLCL-T26 tCPN 4TCLCL-T35 4TCLCL-T35 4TCLCL-T35 2.5TCLCL- T35 2.5TCLCL- T35 1 Notes 1 tRSH 4TCLCL-T34 4TCLCL-T34 4TCLCL-T34 4TCLCL-T34 4TCLCL-T34 1 tCSH 5TCLCL-T26 5TCLCL-T26 5TCLCL-T26 4TCLCL-T26 4TCLCL-T26 1 tCAH TCL.:CL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 3TCLCL~T26 3TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tT 3/30 3/30 3/30 3/30 3/30 2 tRWC 8TCLCL 8TCLCL 8TCLCL 6TCLCL 6TCLCL 1 tRRW 5TCLCL-T26 5TCLCL-T26 5TCLCL-T26 4TCLCL-T26 4TCLCL-T26 1 tCRW 4TCLCL-T34 4TCLCL-T34 4TCLCL-T34 . 4TCLCL- T34 4TCLCL-T34 1 tWCH 3TCLCL+TCL 3TCLCL+TCL 3TCLCL+TCL 3TCLCL+TCL 3TCLCL+TCL -T34 tWCR -T34 -T34 -T26 -T26 2TCLCL+TCL 2TCLCL+TCL 2TCLCL+TCL -T36-TBUF -T36-TBUF -T36-TBUF tRWL 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 -TBUF -TBUF -TBUF tCWL 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 -TBUF -TBUF -TBUF -T26 -T26 2TCLCL-T36 2TCLCL-T36 -TBUF -TBUF 3TCLCL-TCL 3TCLCL-TCL -T36-TBUF 1,3 1 1 -T36-TBUF 3TCLCL-TCL 3TCLCL-TCL -T36-TBUF 1,3 -T34 4TCLCL+TCL 4TCLCL+TCL 4TCLCL+TCL 3TCLCL+TCL 3TCLCL+TCL -T26 tWP -T34 1 -T36-TBUF 210463-005 6-92 8207 Table 16 A. ECC Mode - RD, RF Cycles Fast Cycle Mode Parameter Co C, C2 C3 Notes tRP 4TCLCL-T26 4TCLCL-T26 4TCLCL-T26 4TCLCL-T26 1 tCPN 3TCLCL-T35 3TCLCL-T35 3TCLCL-T35 3TCLCL-T35 1 tRSH 3TCLCL-T34 3TCLCL-T34 4TCLCL-T34 4TCLCL-T34 1 tCSH 6TCLCL-T26 6TCLCL-T26 7TCLCL-T26 7TCLCL-T26 1 tCAH TCLCL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 1 IT 3/30 3/30 3/30 3/30 2 tRC 8TCLCL 8TCLCL 9TCLCL 9TCLCL 1 tRAS 4TCLCL-T26 4TCLCL-T26 5TCLCL-T26 5TCLCL-T26 1 tCAS 5TCLCL-T34 5TCLCL-T34 6TCLCL-T34 6TCLCL-T34 1 tRCS TCLCL-T36 TCLCL-T36 TCLCL-T36 TCLCL-T36 1 -TBUF -TBUF -TBUF -TBUF Table 16 B. ECC Mode - RD, RF Cycles Slow Cycle Mode Parameter C4 Cs Ce Notes tRP 2TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tCPN tRSH 1.5TCLCL- T35 1.5TCLCL-T35 1.5TCLCL-T35 3TCLCL-T34 3TCLCL-T34 3TCLCL-T34 1 1 tCSH 4TCLCL-T26 4TCLCL-T26 4TCLCL-T26 1 tCAH 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tT 3/30 3/30 3/30 2 tRC 5TCLCL 5TCLCL 5TCLCL 1 tRAS 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 1 4TCLCL-T34 4TCLCL-T34 4TCLCL-T34 tCAS tRCS 0.5TCLCL-T36 0.5TCLCL- T36 0.5TCLCL- T36 -TBUF -TBUF 1 1 -TBUF 210463-005 6-93 8207 Table 17 A. ECC Mode - WR Cycle Fast Cycle Mode Parameters Co C1 C2 C3 Notes tRP 3TCLCL-T26 3TCLCL-'-T26 3TCLCL-T26 3TCLCL-T26 1 tCPN 4TCLCL-T35 4TCLCL-T35 4TCLCL-T35 4TCLCL-T35 1 tRSH 5TCLCL-T34 5TCLCL-T34 6TCLCL-T34 6TCLCL-T34 1 tCSH 6TCLCL-T26 6TCLCL-T26 7TCLCL-T26 7TCLCL-T26 1 tCAH TCLCL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 1 tT 3/30 3/30 3/30 3/30 2 tRWC 9TCLCL 9TCLCL 10TCLCL 10TCLCL 1 tRRW 6TCLCL-T26 6TCLCL-T26 7TCLCL-T26 7TCLCL-T26 1 tCRW 5TCLCL-T34 5TCLCL-T34 6TCLCL-T34 6TCLCL-T34 1 tWCH 5TCLCL-T34 5TCLCL-T34 6TCLCL-T34 6TCLCL-T34 1,4 tWCR 6TCLCL-T26 6TCLCL-T26 7TCLCL-T26 7TCLCL-T26 1,4 tWP 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 1 -TBUF -TBUF -TBUF -TBUF 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 -TBUF -TBUF -TBUF -TBUF 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 -TBUF -TBUF -TBUF -TBUF tRWL tCWL 1 1 210463-005 6-94 8207 Table 17 B. ECC Mode - WR Cycle Slow Cycle Mode Parameters tRP C. Cs Cs Notes 2TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tCPN 2.5TCLCL- T35 2.5TCLCL- T35 2.5TCLCL-T35 1 tRSH ·5TCLCL- T34 5TCLCL-T34 4TCLCL-T34 1 tCSH 5TCLCL-T26 5TCLCL-T26 4TCLCL-T26 1 tCAH 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tT 3/30 3/30 3/30 2 tRWO 7TCLCL 7TCLCL 6TCLCL 1 tRRW 5TCLCL-T26 5TCLCL-T26 4TCLCL-T26 1 tCRW 5TCLCL-T34 5TCLCL-T34 4TCLCL-T34 1 tWCH 5TCLCL-T34 5TCLCL-T34 4TCLCL-T34 1,4 5TCLCL-T26 5TCLCL-T26 4TCLCL-T26 1,4 tWCR tWP 3TCLCL-TCL 3TCLCL-TCL 3TCLCL-TCL tRWL 3TCLCL-TCL 3TCLCL-TCL 3TCLCL-TCL -T36-TBUF -T36-TBUF tCWL -T36-TBUF -T36-TBUF -T36-TBUF -T36-TBUF 1 -T36-TBUF 3TCLCL-TCL 3TCLCL-TCL 3TCLCL-TCL -T36-TBUF 1 1 -T36-TBUF 210463-005 6-95 8207 Table 18 A. ECC Mode - RMW Fast Cycle Mode Parameters Co C, C2 C3 Notes tRP 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 1 4TCLCL-T35 4TCLCL-T35 1 tCPN 4TCLCL-T35 4TCLCL-T35 tRSH 8TCLCL-T34 8TCLCL-T34 10TCLCL- T34 10TCLCL-T34 1 tCSH 9TCLCL-T26 9TCLCL-T26 11TCLCL- T26 11TCLCL- T26 1 tCAH TCLCL-T34 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 3TCLCL-T26 3TCLCL-T26 3TCLCL-T26 1 tT 3/30 3/30 3/30 3/30 2 14TCLCL 14TCLCL 1 tRWC 12TCLCL 12TCLCL tRRW 9TCLCL-T26 9TCLCL-T26 11TCLCL- T26 11TCLCL-T26 1 tCRW 8TCLCL-T34 8TCLCL-T34 10TCLCL-T34 10TCLCL- T34 1 tRCS TCLCL-T36 TCLCL-T36 TCLCL-T36 1 -TBUF -TBUF -TBUF -TBUF tRWD 6TCLCL-T26 6TCLCL-T26 8TCLCL-T26 8TCLCL-T26 1 tCWD 5TCLCL-T34 5TCLCL-T34 7TCLCL-T34 7TCLCL-T34 1 tWP 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 1 -TBUF -TBUF -TBUF -TBUF tRWL 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 -TBUF -TBUF -TBUF -TBUF tCWL 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 3TCLCL-T36 -TBUF -TBUF -TBUF -TBUF TCLCL-T36 1 1 210463-005 6-96 8207 Table 18 B. ECC Mode - RMW Slow Cycle Mode Parameters C4 Cs Cs Notes tRP 2TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tCPN tRSH 2.5TCLCL- T35 2.5TCLCL-T35 2.5TCLCL- T35 1 7TCLCL-T34 7TCLCL-T34 5TCLCL-T34 1 tCSH 7TCLCL-T26 7TCLCL-T26 5TCLCL-T26 1 tCAH 2TCLCL-T34 2TCLCL-T34 2TCLCL-T34 1 tAR 2TCLCL-T26 2TCLCL-T26 2TCLCL-T26 1 tT 3/30 3/30 3/30 2 tRWC 9TCLCL 9TCLCL 7TCLCL 1 tRRW 7TCLCL-T26 7TCLCL-T26 5TCLCL-T26 1 tCRW 7TCLCL-T34 7TCLCL-T34 5TCLCL-T34 1 0.5TCLCL- T36 0.5TCLCL- T36 0.5TCLCL-T36 tRCS -TBUF tRWD -T26 -T34 -T36-TBUF tRWL 3TCLCL-TCL 3TCLCL-TCL -T36-TBUF tCWL -T36-TBUF -T36-TBUF -T36-TBUF 1 -T36-TBUF 3TCLCL~TCL 1 -T36-TBUF 3TCLCL-TCL 3TCLCL-TCL 3TCLCL-TCL -T36-TBUF 1 -T34 3TCLCL-TCL 3TCLCL-TCL 3TCLCL-TCL tWP 1 -T26 4TCLCL+TCL 4TCLCL+TCL 2TCLCL+TCL -T34 1 -TBUF 4TCLCL+TCL 4TCLCL+TCL 2TCLCL+TCL -T26 tCWD -TBUF 1 -T36-TBUF NOTES: 1. Minimum 2. Value on right is maximum; value on left is minimum. 3. Applies to the eight warm-up cycles during in~ialization only. 4. Applies to the eight warm-up cycles and to the memory initilization cycles during initialization only. 5. TP = TCLCL T26 = TCLRSL T34 = TCLCSL T35 = TCLCSH T36 = TCLW TBUF = TTL Buffer delay 210463-005 6-97 inter 8208 DYNAMIC RAM CONTROLLER •o • • • • Wait State, 8 Mhz IAPX 286, IAPX 186/188, and iAPX 86/88 Interface Provides all Signals necessary to Control 64k and 256k Dynamic RAMs Support Synchronous or Asynchronous Microprocessor Interfaces Automatic RAM Warm-up • • • IAPX 286 8208-16 8208-12 CFS= 1 (fast cycle) 4-16 MHz 4-12 MHz IAPX 86/186 CFS=O (slow cycle) 8208 2-8 MHz 8208-6 2-6 MHz Directly Addresses and Drives up to 1 Megabyte without External Drivers Performs Early Write Cycles The Intel 8208 Dynamic RAM Controller is a high performance, systems oriented, Dynamic RAM controller that is designed to easily interface 64k and 256k Dynamic RAMs to Intel and other microprocessors. It is a 48 pin single-port version of the dual-port 8207. Al4 Al3 AL2 Al1 AlO BS AOO A01 A02 A03 A04 Vss AOS AOS A07 A08 Vss .'". PDI--+----l Vee AlS Al6 Al7 Al8 AHO AH1 AH2 AH3 AH4 AH5 AH6 Vss AH7 AH8 POI RFRQ ClK RASi ~ m5 em ~ i5ASO ALoeC==~ r----v""', PE pcn Vss RESET Vee AHO.C==::Jl '--------', AACK/XACK WEIPClK 230734-2 os 230734-1 Figure 1. Block Diagram and Pinout Diagram Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. March 1985 IE) Intel Corporation, 1985 6-98 Order Number: 230734-003 intJ 8208 Table 1. Pin Description Pin Type ALO AL1 AL2 AL3 AL4 AL5 AL6 AL7 AL8 5 4 3 2 1 47 46 45 44 I I I I I I I I I BS 6 I BANK SELECT: This input is used to select one of the two banks of the dynamic RAM array as defined by the program-bit RB. AOO A01 A02 A03 A04 A05 A06 AO? A08 7 8 0 0 0 0 0 0 0 0 0 ADDRESS OUTPUTS: These outputs are designed to provide the Symbol VSS 9 10 11 13 14 15 16 I I I I Name and Function ADDRESS LOW: These low order address inputs are used to generate the row address for the internal address multiplexer. In iAPX 286 mode (CFS = 1), these addresses are latched internally. row and column addresses, of either the CPU or the refresh counter, to the dynamic RAM array. These outputs drive the dynamic RAM array directly and need no external drivers. However, they typically need series resistors to match impedances. GROUND GROUND GROUND GROUND ROW ADDRESS STROBE: These outputs are used by the dynamic RASO RAS1 12 17 22 36 19 18 0 0 CASO CAS1 21 20 0 0 COLUMN ADDRESS STROBE: These outputs are used by the RESET 23 I RESET: This active high signal causes all internal counters to be RAM array to latch the row address, present on the AOO-8 pins. These outputs are selected by the BS pin as programmed by program-bit RB. These outputs drive the dynamic RAM array directly and need no external drivers. dynamiC RAM array to latch the column address, present on the AOO-8 pins. These outputs are selected by the BS pin as programmed by program-bit RB. These outputs drive the dynamic RAM array directly and need no external drivers. reset and upon release of RESET, data appearing at the POI pin is clocked-in by the PCLK output. The states of the POI, PCTL and RFRQ pins are sampled by RESET going inactive and are used to program the 8208. An 8 cycle dynamic RAM warm-up is performed after clocking POI bits into the 8208. WEI 25 0 VCC WRITE ENABLE/PROGRAMMING CLOCK: Immediately after a RESET this pin becomes PCLK and is used to clock serial programming data into the POI pin. After the 8208 is programmed this active high Signal provides the dynamic RAM array the write enable input for a write operation. PCLK 24 48 I I POWER: POWER: + 5 Volts. + 5 Volts. 6-99 8208 Table 1. Pin Description (Continued) Symbol AACK/ XACK Pin 26 Type 0 PCTl 27 I PE 28 I WR 29 I RO 30 I ClK 31 I RFRO 32 I POI 33 I AHO AH1 AH2 AH3 AH4 AH5 AH6 AH7 AH8 43 42 41 40 39 38 37 35 34 I I I I I I I I I , Name and Function ADVANCE ACKNOWLEDGE/TRANSFER ACKNOWLEDGE: When the X programming bit is set to logic 0 this pin is AACK and indicates that the processor may continue processing and that data will be available when required. This Signal is optimized for the system by programming the S program-bit for synchronous or asynchronous operation. The S programming bit determines whether this strobe will be early or late. If another dynamic RAM cycle is in progress at the time of the new request, the AACK is delayed. When the X programming bit is set to logic 1 this pin is XACK and indicates that data on the bus is valid during a read cycle or that data may be removed from the bus during a write cycle. XACK is a MUlTlBUS compatible signal. (See Figure 5) PORT CONTROL: This pin is sampled on the falling edge of RESET. It configures the 8208 to accept command inputs or processor status inputs. If PCTl is low after RESET the 8208 is programmed to accept bus/MUlTIBUS command inputs or iAPX 286 status inputs. If PCTl is high after RESET the 8208 is programmed to accept status inputs from iAPX 86 or iAPX 186 type processors. The S2 status line should be connected to this input if programmed to accept iAPX 86 or iAPX 186 status inputs. When programmed to accept bus commands or iAPX 286 status inputs, it should be tied low or it may be connected to INHIBIT when operating with MUlTIBUS. PORT ENABLE: This pin serves to enable a RAM cycle request. It is generally decoded from the address bus. WRITE: This pin is the write memory request command input. This input also directly accepts the SO status line from Intel processors. READ: This pin is the read memory request command input. This input also directly accepts the S1 status line from Intel processors. CLOCK: This input provides the basic timing for sequencing the internal logic. This clock requires MOS levels. REFRESH REQUEST: This input is sampled on the falling edge of RESET. If RFRO is high at RESET then the 8208 is programmed for internal-refresh request or external-refresh request with failsafe protection. If RFRO is low at RESET then the 8208 is programmed for external-refresh without failsafe protection or burst-refresh. Once programmed the RFRO pin accepts signals to start an external-refresh with failsafe protection or external-refresh without failsafe protection or a burst-refresh. PROGRAM DATA INPUT: This input is sampled by RESET going low. It programs the various user selectable options in the 8208. The PClK pin shifts programming data into the POI input from an external shift register. This pin may be strapped low to a default iAPX 186 mode configuration or high to a default iAPX 286 mode configuration. ADDRESS HIGH: These higher order address inputs are used to generate the column address for the internal address multiplexer. In iAPX 286 mode, these addresses are latched internally. 6-100 inter 8208 GENERAL DESCRIPTION The Intel 8208 Dynamic RAM Controller is a microcomputer peripheral device which provides the necessary signals to address, refresh and directly drive 64k and 256k dynamic RAMs. The 8208 supports several microprocessor interface options including synchronous and asynchronous operations for iAPX 286, iAPX 186/188, iAPX 86/88 and MULTIBUS. optimized to run synchronously with Intel'S iAPX 286, iAPX 186/188, and iAPX 86/88. When the 8208 is programmed to run in asynchronous mode, the 8208 inserts the necessary synchronization circuitry for the RD, WR, PE, -and PCTL inputs. The 8208 achieves high performance (i.e. no wait states) by decoding the status lines directly from the iAPX 286, iAPX 186/188, and the iAPX 86/88. The 8208 can also be programmed to receive read or write MULTIBUS commands or commands from a bus controller. (See Status/Command Mode.) The 8208 may be programmed to accept the clock of any Intel microprocessor. The 8208 adjusts its internal timing to allow for different clock frequencies of these microprocessors. (See Microprocessor Clock Frequency Option.) FUNCTIONAL DESCRIPTION Processor Interface The 8208 has control circuitry capable of supporting one of several possible bus structures. The 8208 may be programmed to run synchronous or asynchronous to the processor clock. (See Synchronous/ Asynchronous Mode.) The 8208 has been Figure 2 shows the different processor interfaces to the 8208 using the synchronous or asynchronous mode and status or command interface. 230734-3 Synchronous-Status Interface 230734-4 Asynchronous-Status Interface 230734-5 Synchronous-Command Interface - 230734-6 Asynchronous-Command Interface Figure 2A. Slow-Cycle (CFS = 0) Interfaces Supported by the 8208 6-101 8208 ClK ClK 80286 iYR RD S l i I - - - - -.... iYR Si RD AACK PE Pi: 8208 8208 230734-8 230734-7 Fast-Cycle Asynchronous-Status Interface Fast-Cycle Synchronous-Status Interface ClK ClK ClK ClK ClK ViR iYR PCTL PCTl RD RD' PE Pi: 8208 8208 230734-10 230734-9 Fast-Cycle Asynchronous-Command Interface Fast-Cycle Synchronous-Command Interface Figure 28. Fa~t-cycle (CFS = 1) Port Interfaces Supported by the 8208 Dynamic RAM Interface (NOTE 1) The 8208 is capable of addressing 64k and 256k dynamic RAMs. Figure 3 shows the connection of the processor address bus to the 8208 using the different RAMs. The 8208 directly supports the 2164A RAM family or any RAM with ,similar timing requirements and responses. The 8208 divides mem..2!Y!nto two banks, each bank having its own Row (RAS) and Column (CAS) Address Strobe pair. This organization permits RAM cycle interleaving. RAM cycle interleaving overlaps the start of the next RAM cycle with the RAM precharge period of the previous cycle. Hiding the precharge period of one RAM cycle behind the data access period of the next RAM cycle optimizes memory bandwidth and is effective as long as successive RAM cycles occur in the alternate banks. Successive data access to the same bank cause the 8208 to wait for the precharge time, of the previous RAM cycle. But when the 8208 is programmed in an iAPX 186 synchronous configuration consecutive read cycles to the same bank does not result in additional wait states (i.e. 0 wait state r~adsresult). AH8 All-A19 8208 256KRAM 'INTERFACE 8208 '64KRAM INTERFACE 230734-11 NOTES: 1. Unassigned address input pins should be strapped ,high or low. 2. AO along with SHE are used to select a byte within a processor word. 3. Low order address bit is used as a bank select input so that consecutive memory access requests are to alternate banks allowing bank interleaving of memory cycles. ' Figure 3. Processor Address Interface to the 8208 Using 64k. and 256k. RAMS 6-102 intJ 8208 If not all RAM banks are occupied, the 8208 reassigns the RAS and CAS strobes to allow using wider data words without increasing the loading on the RAS and CAS drivers. Table 2 shows the bank selection decoding and the horizontal word expansion, including RAS and CAS assignments. For example, if only one RAM bank is occupied, then the two RAS and CAS strobes are activated with the same timing. Table 2. Bank Selection Decoding and Word Expansion Program Bit RB Bank Input BS 0 0 RASo. 1, CASo. 1 to Bank 0 0 1 Illegal 1 0 RASo, CASo to Bank 0 1 1 RAS1, CAS1 to Bank 1 8208 RAS/CAS Pair Allocation Program bit RB is not used to check the bank select , input BS. The system design must protect from accesses to "illegal", non-existent banks of memory by deactivating the PE input when addressing an "illegal", non-existent bank of memory. The 8208 adjusts and optimizes internal timings for either the fast or slow RAMs as programmed. (See RAM Speed Option.) Memory Initialization After programming, the 8208 performs eight RAM "wake-up" cycles to prepare the dynamic RAM for proper device operation. Refresh The 8208 provides an internal refresh interval counter and a refresh address counter to allow the 8208 to refresh memory. The 8208 will refresh 128 rows every 2 milliseconds or 256 rows every 4 milliseconds, which allows all RAM refresh options to be supported. In addition, there exists the ability to refresh 256 row address locations every 2 milliseconds via the Refresh Period programming option. The 8208 may be programmed for any of five different refresh options: Internal refresh only, External refresh with failsafe protection, External refresh without failsafe protection, Burst Refresh modes, or no refresh. (See Refresh Options.) It is possible to decrease the refresh time interval by 10%, 20% or 30%. This option allows the 8208 to compensate for reduced clock frequencies. Note that an additional 5% interval shortening is built-in in all refresh interval options to compensate for clock variations and non-immediate response to the internally generated refresh request. (See Refresh Period Options.) External Refresh Requests after RESET External refresh requests are not recognized by the 8208 until after it is finished programming and preparing memory for access. Memory preparation includes 8 RAM cycles to prepare and ensure proper dynamic RAM operation. The time it takes for th_e 8208 to recognize a request is shown below. eq. 8208 System Response: TRESP = TPROG + TPREP where: TPROG = (40) (TCLCL) which is programming time TPREP = (8) (32) (TCLCL) which is the RAM warm-up time if TCLCL = 125 ns then TRESP = 37 us Reset RESET is an asynchronous input, the falling edge of which is used by the 8208 to directly sample the logic levels of the PCTL, RFRO, and POI inputs. The internally synchronized falling edge of reset is used to begin programming operations (shifting in the contents of the external shift register, if needed, into the POI input). Differentiated reset is unnecessary when the default synchronization programming is used. Until programming is complete the 8208 registers but does not respond to command or status inputs. A simple means of preventing commands or status from occurring during this period is to differentiate the system reset pulse to obtain a smaller reset pulse for the 8208. The total time of the 8208 reset Pulse and the 8208 programming time must be less than the time before the first command the CPU issues in systems that alter the default port synchronization programming bit (default is synchronous interface). The differentiated reset pulse would be shorter than the system reset pulse by at least the programming period required by the 8208. The differentiated reset pulse first resets the 8208, and system reset would reset the rest of the system. While the rest of the system is still in reset, the 8208 completes its programming. Figure 4 illustrates a circuit to accomplish this task. 6-103 8208 R"!!J 8208 8088, 80186 or 80188 status, called the 8086 Status interface. The Command interface can also directly interface to the command lines of the bus controllers for the 8086, 8088, 80186 and the 80286. I SYSTEM ~ ~11~ RESrul........._ _ _ _ __ The 80186 Status interface allows direct decoding of the status lines for the iAPX 86, iAPX 88, iAPX 186 and the iAPX 188. Table 3 shows how the status lines are decoded. Microprocessor bus controller read or write commands or MULTIBUS commands can also be directed to the 8208 when in Command mode. t1 PROGRAMMING TIME OF 8208 8208 RESET SYSTEM RESET Table 3A. Status coding of 8086, 80186 and 80286 DIFFERENTIATED RESET 230734-12 Status Code S2 S1 SO 0 0 0 0 0 1 0 1 0 0 1 1 1 0 0 NOTES: 1. Required only when the synchronization option is altered from its initial default value. 2. Vee must be stable before system reset is activated when using ,this circuit. Figure 4. 8208 Differentiated Reset Circuit Within four clocks after RESET goes active, all the 8208 outputs will go high, except for AOO-2, which will go low: OPERATIONAL DESCRIPTION Function INTERRUPT 110 READ 110 WRITE HALT INSTRUCTION FETCH ,1 1 MEMORY 0 READ 1 1 0 MEMORY WRITE IDLE 1 1 1 , • Refer 80286 pin deSCription table Programming the 8208 80286· 8086/80186 INTERRUPT 110 READ 110 WRITE IDLE HALT MEMORY READ MEMORY WRITE IDLE Table 3B. 8208 Response The 8208 is programmed after reset. On the falling edge of RESET, the logic states of several input pins are latched internally. The falling edge of RESET actually performs the latching, which means that the logic levels on these inputs must be stable prior to that time. The inputs whose logic levels are latched at the end of reset are the PCTL, HEFRQ, and POI pins. 8208 Command 8086/80186 80286 Status or PCTL RD WR Status/Command Mode The processor port of the 8208 is configured by the states of the PCTL pin. Which interface is selected depends on the state of the PCTL pin at the end of reset. If PCTL is high at the end of reset, the 80861 80186 Status interface is selected; if it is low, then the MULTIBUS or Command interface is selected. The status lines of the 80286 are,similar in code and timing to the Multibus command lines, while the status code and timing of the 8086 and 8088 are identical to those of the 80186 and 80188 (ignoring the differences in clock duty cycle). Thus there exists two interface configurations, one for the 80286 status or Multibus memory commands, which is called the Command interface, and one for 8086, Function Status Interface Command Interface IGNORE' READ 0 0 0 IGNORE 0 0 1 IGNORE 0 0 1 1 0 1 IGNORE IGNORE 1 0 0 1 0 1 READ READ 1 1 1 1 0 WRITE 1 IGNORE WRITE IGNORE IGNORE INHIBIT INHIBIT IGNORE ·lIIegal with CFS = 0 Refresh Options Immediately after system reset, the state of the REFRQ input pin is examined. If REFRQ is high, the 8208 provides the user with the choice between self-refresh and user-generated refresh with failsafe protection. Failsafe protection guarantees that if the user does not come back with another refresh 6-104 inter 8208 request before the internal refresh interval counter times out, a refresh request will be automatically generated. If the REFRQ pin is low immediately after a reset, then the user has the choice of a single external refresh cycle without failsafe, burst refresh or no refresh. Internal Refresh Only For the 8208 to generate internal refresh requests, it is necessary only to strap the REFRQ input pin high. External Refresh with Failsafe To allow user-generated refresh requests with failsafe protection, it is necessary to hold the REFRQ input high until after reset. Thereafter, a low-to-high transition on this input causes a refresh request to be generated and the internal refresh interval counter to be reset. A high-to-Iow transition has no effect on the 8208. A refresh request is not recognized until a previous request has been serviced. 186, 188, 86, or 88 systems. The remaining bits, PD1-PD8, may then be programmed to optimize a selected system configuration. A default of all zeros in the remaining program bits optimizes the 8208 timing for 8 MHz Intel CPUs using 150 ns (or faster) dynamic RAMs with no performance penalty. If the first program data bit is set to logic 1, the 8208 is configured to support iAPX 286 systems (Command mode). A default of all ones in the program bits optimizes the 8208 timing for an 8 MHz 286 using 120 ns DRAMs at zero wait states. Note that the programming bits PD1-8 change polarity according to PDO. This ensures the same choice of options for both default modes. Figure 5 shows the various options that can be programmed into the 8208. Figure 5. Program Data Word Program Data Bit Name PD~ = 0 PolarityIFunctlon PD~ = 1 CFS = 0 SLOW CYCLE CFS = 1 FAST CYCLE POO CFS CFS External Refresh without Failsafe P01 S S To generate single external refresh requests without failsafe protection, it is necessary to hold REFRQ low until after reset. Thereafter, bringing REFRQ high for one clock period will cause a refresh request to be generated. A refresh request is not recognized until a previous request has been serviced. S=O SYNCHRONOUS' 8=1 ASYNCHRONOUS P02 RFS RFS RFS = 0 FAST RAM' RFS = 1 SLOW RAM P03 RB RB RAM BANK OCCUPANCY SEE TABLE 2 Burst Refresh P04 CI1 CI1 Burst refresh is implemented through the same procedure as a single external refresh without failsafe (i.e., REFRQ is kept low until after reset). Thereafter, bringing REFRQ high for at least two clock periods will cause a burst of up to 128 row address locations to be refreshed. Any refresh request is not recognized until a previous request has been serviced (i.e. burst is completed). P05 CIO CIO COUNT INTERVAL BIT 1; SEE TABLE 6 COUNT INTERVAL BIT 0; SEE TABLE 6 P06 PLS PLS PLS = 0 LONG REFRESH PERIOD' PLS = 1 SHORT REFRESH PERIOD - PO? FFS FFS FFS = 0 FAST CPU FREQUENCY' FFS = 1 SLOW CPU FREQUENCY P08 X X X = OAACK' X = 1 XACK No Refresh It is necessary to hold REFRQ low until after reset. This is the same as programming External Refresh without Failsafe. No refresh is accomplished by keeping REFRQ low. • Default In both modes Using an External Shift Register Option Program Data Word The program data word consists of 9 program data bits, PDO-PD8. If the first program data bit, PDO is set to logic 0, the 8208 is configured to support iAPX The 8208 may be programmed by using an external shift register with asynchronous load capability such as a 74LS165. The reset pulse serves to parallel load the shift register and the 8208 supplies the clocking signal (PCLK) to shift the data into the POI 6-105 8208 the dynamic RAM array, it continues to clock the shift register. This does not present a problem because data at the POI pin is ignored after programming. Figure 7 illustrates the timing requirements of the shift register. programming pin. Figure 6 shows a sample circuit diagram of an external shift register circuit. Serial data is shifted into the 8208 via the POI pin (33), and clock is provided by the WE/PCLK pin (25), which generates a total of 9 clock pulses. After programming is complete, data appearing at the input of the POI pin is ignored. Default Programming Options After reset, the 8208 serially shifts in a program data word via the POI pin. This pin may be strapped low or high, or connected to an external shift register. Strapping POI low causes the 8208 to default to the iAPX 186 system configuration, while high causes a WE/PCLK is a dual function pin. Ouring programming, it serves to clock the external shift register, and after programming is completed, it reverts to the write enable RAM control output pin. As the pin changes state to provide the write enable signal to +5V O---{l. . . . . . ----O-O-O , I I I • I O>-_-IJ 8208 c 8208 RESET __- __ 0 E F G H SER ~~~~-~swrn 74LS165 QH \------1 WE/PCLJ( POI I--e-l.. CLK ~------~~--------------------------------~RESET 230734-13 Figure 6. External Shift Register Interface CLK ...... 4 ...... ~ ________~~~-+~~------------------------------ RESET ~ ~ ~~-;-+-1-----.--6-----.+--------"POI =:) X POO ~ POt. X P02 x= 230734-14 NOTES: TRTVCL Ti=>GVCL TCLPC TLOAO - Reset is an asychronous input, if reset occurs before TRTVCL, then it is guaranteed to be recognized. Minimum POI valid time prior to reset going low. MUX/PCLK delay. Asychronous load data propagation delay. Figure 7. Timing illustrating External Shift Register Requirements for Programming the 8208 6-106 8208 default to the iAPX 286 configuration. Table 4 shows the characteristics of the default configuration. If further system flexibility is needed, one external shift register, like a 74LS165, can be used to tailor the 8208 to its operating environment. Table 4. Default Programming circuitry can adjust its internal timing accordingly to produce a refresh request as programmed. Table 5. Microprocessor Clock Frequency Options Program Bits CFS FFS 0 0 Synchronous interface Fast RAM (Note 1) 2 RAM banks occupied Refresh interval uses 118 clocks 128 row refresh in 2ms; 256 row refresh in 4 ms Fast processor clock frequency (8 MHz) Advanced ACK strobe NOTE: 1. For iAPX 86/186 systems either slow or fast (150 or 100 ns) RAMS will run at 8 MHz with zero wait states. Synchronousl Asynchronous Mode (S program bit) The 8208 may be independently configured to ac~t synchronous or asynchronous commands (RD, WR, PCTL) and Port Enable (PE) via the S program bit. The state of the S programming bit determines whether the interface is synchronous or asynchronous. While the 8208 may be configured with either the Status or Command (MULTIBUS) interface in the Synchronous mode, certain restrictions exist in the Asynchronous mode. An Asynchronous-Command interface using the control lines of the MULTIBUS is supported, and an Asynchronous-80186 Status interface using the status lines of the 80186 is supported, with the use of TIL gates as illustrated in Figure 2. In the 80186 case, the TIL gates are needed to guarantee that status does not appear at the 8208's inputs too much before address, so that a cycle would start before address was valid. Microprocessor Clock Cycle Option (CFS and FFS program bits) The 8208 is programmed to interface with microprocessors with "slow cycle" timing like the 8086, 8088,80186, and 80188, and with "fast cycle" microprocessors like the 286. The CFS bit is used to select the appropriate timing. The FFS option is used to select the speed of the microprocessor clock. Table 5 shows the various microprocessor clock frequency options that can be programmed. The external clock frequency must be programmed so that the failsafe refresh repetition 0 1 1 1 0 1 Processor iAPX86, 88, 186, 188 iAPX86, 88,186,188 iAPX286 iAPX286 Clock Frequency 5MHz 8MHz 10MHz 16MHz RAM Speed Option (RFS program bit) The RAM Speed programming option determines whether RAM timing will be optimized for a fast or slow RAM. Whether a RAM is fast or slow is measured relative to 100 ns DRAMs (fast) or 150 ns DRAMs (slow). This option is only a factor in Command Mode (CFS = 1). Refresh Period Options (CIO, CI1 and PLS program bits) The 8208 refreshes with either 128 rows every 2 milliseconds or with 256 rows every 4 milliseconds. This translates to one refresh cycle being executed approximately once every 15.6 microseconds. This rate can be changed to 256 rows every 2 milliseconds or a refresh approximately once every 7.8 microseconds via the Period Long/Short, program bit PLS, programming option. The Count Interval 0 (CIO) and Count Interval 1 (CI1) programming options allow the rate at which refresh requests are generated to be increased in order to permit refresh requests to be generated close to the 15.6 or 7.8 microsecond period when the 8208 is operating at reduced frequencies. The interval between refreshes is decreased by 0%,10%,20%, or 30% as a function of how the count interval bits are programmed. A 5% guardband is built-in to allow for any clock frequency variations. Table 6 shows the refresh period options available. The numbers tabulated under Count Interval represent the number of clock periods between internal refresh requests. The percentages in parentheses represent the decrease in the interval between refresh requests. Note that all intervals have a built-in 5% (approximately) safety factor to compensate for minor clock frequency deviations and non-immediate response to internal refresh requests. 6-107 inter 8208 Table 6. Refresh Count Interval Table Ref. Period CFS PLS FFS (""S) Count Interval C11,C10 (8208 Clock Periods) 11 00 01 10 (0% ) (10%) (20%) (30%) 15.6 1 1 1 236 212 188 7.8 1 0 1 118 106 94 82 15.6 1 1 0 148 132 116 100 164. 7.8 1 0 0 74 66 58 50 15.6 0 1 1 118 106 94 82 7.8 0 0 1 59 53 47 41 15.6 0 1 0 74 66 58 50 7.8 0 0 0 37 33 29 25 Processor Timing In order to run without wait states, AACK must be used and connected to the SRDY input of the appro· priate bus controller. AACK is issued relative to a point within the RAM cycle and has no fixed relation· ship to the processors's request. The timing is such, however, that the processor will run without wait states, barring refresh cycles. In slow c~cl~, fast RAM configurations (8086, 80186), AACK IS Issued on the same clock cycle that issues RAS. . Port Enable (PE) set-up time requirements depend on whether the 8208 is configured for synchronous or asynchronous, fast or slow cycle o~ration. In a synchronous f~st cycle configuration, PE is required to be set-,!!E to the same clock edge ~s the co~ mands. If PE is true (low), a RAM cycle IS started; If not, the cycle is not started until the RD or WR line goes inactive. In asychronous operation, PE is required to be setup to the same clock edge as the internally.synchronized status or commands. Externally, thiS allows the internal synchronization delay to be added to the status (or command) -to-PE delay time, t"~.iS allowing for more external decode time than is available in synchronous operation. The minimum~nchronization delay is the additional amount that PE must be held valid. If PE is not held valid for the maximum synchronization delay time, it is possible that PE will go invalid prior to the status or command being synchronized. In such a case the 8208 does not start a memory cycle. If a memory cycle intended for the 8208 is not started, then no acknowledge (AACK or XACK) is issued and the processor locks up in endless wait states. Memory Acknowledge (AACK, XACK) Two types of memory acknowledge Signals are supplied by the 8208. They are the Advanced Acknowledge strobe (AACK) and the Transfer Acknowledge strobe (XACK). The S programming bit optimizes AACK for synchronous operation ("early" AACK) or asynchronous operation ("late" AACK). Both the early and late AACK strobes are two clocks long for CFS = 0 and three clocks. long for CFS = 1. The XACK strobe is asserted when data is valid (for reads) or when data may be removed (for writes) and meets the MULTIBUS requirements. XACK is removed asynchronously by the command going inactive. Since in an asynchronous operation the 82?8 removes read data before late AACK or XACK IS recognized by the CPU, the user must provide for data latching in the system 4ntil the CPU reads the data. In synchronous operation data latching is unn~ces sary, since the 8208 will not remove data until the CPU has read it. If the X programming bit is high, the strobe is confi~ ured as XACK, while if the bit is low, the strobe IS configured as AACK. Data will always be valid a fixed time after the occurrence of the advanced acknowledge. Thus, the advanced acknowledge may also serve as a RAM cycle timing indicator. Table 7. Memory Acknowledge Summary Synchronous Asynchronous XACK Fast Cycle AACK Optimized for Local 80286 (early) AACK Optimized for Remote 80286 (late) Multibus Compatible Slow Cycle AACK Optimized for Local 8086/186 (early) AACK Optimized for Remote 8086/186 (late) Multibus Compatible 6-108 intJ 8208 150 ns DRAM's. The only consideration is the refresh rate, which must be programmed if the CPU is run at less than 8 MHz. General System Considerations 1. The RASO, 1, CASO, 1 and AOO-8 output buffers are designed to directly drive the heavy capacitive loads associated with dynamic RAM arrays. To keep the RAM driver outputs from ringing excessively in the system environment it is necessary to match the output impedance with the RAM array by using series resistors. Each application may have different impedance characteristics and may require different series resistance values. The series resistance values should be determined for each application. For iAPX 286 systems (CFS = 1) the designer must choose between configuration CO (RFS = 0) and C1 (RFS = 1, FFS = 0). CO permits zero wait state, 8 MHz iAPX 286 operaton with 120 ns DRAM's. However, for consecutive reads, this performance depends upon interleaving between two banks. The C1 configuration trades off 1 wait state performance for the ability to use 150 ns DRAM's. 150 ns DRAMs can be supported by the CO configuration using 7 MHz iAPX 286. Finally, for non-Intel processors the usual choice is asynchronous, command mode (CO), since status lines are not available, Typically, to minimize the 8208's synchronization delay, the 8208 would be run as fast as possible. 2. Although the 8208 has programmable options, in practice there are only a few choices the designer must make. For iAPX 86/186 systems (CFS = 0), the C2 default mode (pin 33 tied low) is the best choice. This permits zero wait states at 8 MHz with OTHER AACK SIGNALS MEMORY 2184A-1& (lDWERI 80186 ADD'" pyiii OA'. I--JI.......J\I DiN PAT....US 230734-15 Figure 8A. 8208 Interface to an 80186 6-109 8208 +5Y RErRQ +-_r---ti1-~rt----_r-~ClK ClK RASO m CASO I-'--t----------I CiS EMCK S1C64/256-12 I=======~ ROY SO 51 ADDR 01/0 WE 80286 DATA. SYSTEM DATA BUS LATCHED ADDRESS BUS 230734-16 Figure 8B. 8208 Interface to iAPX 286 6-110 8208 Configuration Charts The 8208 operates. in three basic configurationsCO, C1, C2-depending upon ~ programming of CFS (PDO), RFS (PD2), and FFS (PD7). Table 8 shows these configurations. These modes determine the clock edges for the 8208's programmable signals, as shown in Table 9. Finally, Table 10 gives the programmable AC parameters of the 8208 as a fuction of configuration. The non-programmable parameters are listed under AC Characteristics. (n-1)1 nt nl (n + 1 )t (n + 1 ) 1 230734-17 The clock edges which trigger transitions on each 8208 output are tabulated in Table 9. "H" refers to the high-going transition, and "L" to low-going transition. Using the Timing Charts The notation used to indicate which clock edge triggers an output transition is "ni" or "n J, ", where "n" is the number of clock periods that have passed since clock 0, the reference clock, and " i " refers to rising edge and" J, " to falling edge. A clock period is defined as the interval from a clock falling edge to the following falling edge. Clock edges are defined as shown below. Clock 0 is defined as the clock in which the 8208 begins a memory cycle, either as a result of a port request which has just arrived, or of a port request which was stored previously but could not be serviced at the time of its arrival because the 8208 was performing another memory cycle. Clock 0 is identified externally by the leading edge of RAS, which is always triggered on O. Table 8. 8208 Configurations Timing Conf. CFS(PDO) RFS{PD2) FFS{PD7) Wait States' Co iAPX286(1) FASTRAM(1) 16 MHz(1) 0 Cl iAPX286(1) SLOW RAM(O) 16 MHz(1) 1 Co iAPX286(1) FASTRAM(1) 12 MHz (0) 0 Co iAPX286(1) SLOW RAM(O) 12 MHz (0) 0 C2 iAPX186(0) DON'T CARE DON'T CARE 0 • USing EAACK (synchronous mode) Table 9. Timing Chart RAS Cn 0 1 2 ADDRESS CAS EAACK WE Cycle L H Col Row L H RD,RF OJ, sJ, OJ, 2J, 1J, 4J, WR OJ, 5J, OJ, sJ, 2J, sJ, RD,RF OJ, 4J, OJ, sJ, 1J, 6J, WR OJ, sJ, OJ, sJ, 2J, sJ, RD,RF OJ, 2J, OJ, 2J, OJ, sJ, WR OJ, 4J, OJ, sJ, 1J, 4J, H 1J, 1J, oj, L sJ, sJ, 4J, LAACK XACK L H L H L H 1J, 4J, 2J, 5J, aJ, RD 1J, 4J, 1J, 4J, sJ, WR 2J, sJ, 2J, sJ, 4J, RD 1 J, 4J, 1J, 4J, sJ, WR oj, 2J, 1 J, aJ, 2J, RD OJ, 2J, 1J, sJ, 2J, WR NOTES FOR INTERPRETING THE TIMING CHART: 1. COLUMN ADDRESS is the time column address becomes valid. 2. The CAS, EAACK, LAACK and XACK outputs are not issued during refresh. 3. XACK-high is reset asynchronously by command ~inactive and not by a clock edge. 4. EAACK is used in synchronous mode, LAACK and XACK in asynchronous mode. 5. ADDRESS-Row is the clock edge where the 8208 AO switches from current column address to the next row address. 6. If a cycle is inhibited by PCTL= 1 (Multibus IIF mode) then CAS is not activated during write cycle and XACK is not activated in either read or write cycles. 6-111 inter 8208 8208-DRAM Interface Parameter Equations Several DRAM parameters, but not all, are a direct function of 8208 timings, and the equations for these parameters are given in the following tables. The following is a list of those DRAM parameters which have NOT been included in the following tables, with an explanation for their exclusion. WRITE tDS: tDH: tDHR: CYCLE system-dependent parameter. system-dependent parameter. system-dependent parameter. READ, WRITE REFRESH CYCLES tRAC: response parameter. tCAC: response parameter. tREF: See "Refresh Period Options". tCRP: must be met only if CAS-only cycles, which do not occur with 8208, exist. tRAH: See "A.C. Characteristics" tRCD:See "AC. Characteristics" tASC: See "AC. Characteristics" tASR: See "AC. Characteristics" tOFF: response parameter. Table 10. Programmable Timings Read and Refresh Cycles Parameter tRP tCPN tRSH tCSH tCAH tAR tT tRC tRAS tCAS tRCS tRCH C2-Slow Cycle 2TCLCL-T25 1.5TCLCL-T34 2TCLCL-T32 3TCLCL-T25 . 2TCLCL-T32 2TCLCL-T25 3/30 4TCLCL 2TCLCL-T25 3TCLCL-T32 1.5TCLCL-TCL-T36-TBUF TCLCL-T32 &T36 MIN CO-Fast Cycle 3TCLCL-T25 3TCLCL-T34 2TCLCL-T33 4TCLCL-T25 TCLCL-T33 2TCLCL-T25 3/30 6TCLCL 3TCLCL-T25 3TCLCL-T33 2TCLCL-TCL-T36-TBUF TCLCL-T32 C1-Fast Cycle 3TCLCL-T25 2TCLCL-T34 3TCLCL-T33 6TCLCL-T25 2TCLCL-T33 3TCLCL-T25 3/30 7TCLCL 4TCLCL-T25 5TCLCL-T33 2TCLCL-TCL-T36-TBUF TCLCL-T32 Notes 1 1 1 1 1 1 2 1 1 1 1 1 Write Cycles Parameter tRP tCPN tRSH tCSH tCAH tAR tT tRC tRAS tCAS tWCH tWCR tWP tRWL tCWL tWCS C2-Slow Cycle 2TCLCL-T25 2.5TCLCL-T34 3TCLCL-T32 4TCLCL-T25 2TCLCL-T32 3TCLCL-T25 3/30 6TCLCL 4TCLCL-T25 3TCLCL-T32· 3TCLCL-T32 4TCLCL-T25 4TCLCL-T36-TBUF 4TCLCL-T36-TSUF 4TCLCL-T36-TBUF TCLCL-T36-TBUF CO-Fast Cycle 3TCLCL-T25 4TCLCL-T34 3TCLCL-T33 5TCLCL-T25 TCLCL-T33 3TCLCL-T25 3/30 8TCLCL 5TCLCL-T25 3TCLCL-T33 3TCLCL-T33 5TCLCL-T25 4TCLCL-T36-TBUF 4TCLCL-T36-TBUF 4TCLCL-T36-TBUF TCLCL-T36-TBUF NOTES: 1. Minimum. 2. Value on right is maximum; value on left is minimum. 3. Applies to the eight warm-up cycles during initialization. 6-112 C1-Fast Cycle 3TCLCL-T25 4TCLCL-T34 3TCLCL-T33 5TCLCL-T25 TCLCL-T33 3TCLCL-T25 3/30 8TCLCL 5TCLCL-T25 3TCLCL-T33 3TCLCL-T33 5TCLCL-T25 4TCLCL-T36-TBUF 4TCLCL-T36-TBUF 4TCLCL-T36-TBUF TCLCL-T36-TBUF Notes 1 1 1 1 1 1 2 1 1 1 1,3 1,3 1 1 1 1 inter 8208 ABSOLUTE MAXIMUM RATINGS Ambient Temperature Under Bias Storage Temperature Voltage On Any Pin With Respect to Ground Power Dissipation - O°C to + 70°C - 65°C to + 150°C -0.5Vto +7V 1.7 Watts * Notice: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. NOTICE Specifications contained within the following tables are subject to change. D.C. CHARACTERISTICS TA = O°Cto 70°C; VCC = 5.0V ±10%;VSS = GND Min Max Units Input Low Voltage -0.5 +0.8 V VIH Input High Voltage 2.0 Vcc + 0.5 V VOL Output Low Voltage 0.45 V Note 1 V Note 1 V Note 1 V Note 1 Symbol Parameter Vil 2.4. Comments VOH Output High Voltage VROl RAM Output Low Voltage VROH RAM Output High Voltage Icc Supply Current 300 mA TA = O°C III Input Leakage Current +10 )J-A OV :s; VIN :s; Vcc VCl Clock Input Low Voltage -0.5 +0.6 V VCH Clock Input High Voltage 3.8 Vcc + 0.5 V CIN Input Capacitance 20 pF 0.45 2.6 fc = 1 MHz NOTE 1: IOL = 5 mA and IOH WE: IOL = 8 mA = -0.32 mA (Typically IOL = 10 mAl A.C. Testing Load Circuit· A.C. Testing Input, Output Waveform RASO_3 t----...;.;;;JV 0_2_:5_--,)\:: CAS0-3 I-::R-Ao--J\J" \,~........ AOo_8 >---"0.'''' Other Outputs 8208 :: x_ __ 230734-25 A.C. Testing inputs (except clock) are driven at 2.4V for a logic "1" and 0.45V for a logic "0" (clock is driven at 4.0V and 0.45V for logic "1" and "0" respectively). Timing measurements are made at 2.0V. 2.4V for logic "1" and 0.8V for logic "0". 230734-18 RRAS = 3911 RCAS = 3911 RAO = 2211 RL = 3311 CRAS = 150pF CCAS = 150 pF CAD = 200 pF CL = 50 pF 6-113 inter 8208 A.C. CHARACTERISTICS (TA = O·Cto70"C;Vcc = +5V±10%, vss =.OV) Measurements made with respect to. RASo_l, CASO_l, ACO_B, are at +2.4V and O.SV. All other pins are measured at 2.0V and O.SV. All times are ns unless otherwise indicated. Testing done with specified test load. Ref Symbol Parameter 8208-16, 8208 (FFS=l) Min 8208-12, 8208-6 (FFS=O) Max Min Units Notes Max CLOCK AND PROGRAMMING 1 2 3 IF Clock Fall TIme 10 10 ns 3 IR Clock Rise TIme 10 10 ns 3 TClCl Clock Period 8208·16 8208·12 8208 8208·6 ns ns ns ns 1 1 2 2 ns ns ·ns ns 1 .1. 2 2 1 1 2 2 4 TCl TCH Clock Low TIme 8208·16 8208·12 8208 8208·6 Clock High Time 8208·16 8208·12 8208 8208-6 62.5 125. 15 250 83.3 250 167 500 20 225 SOO 230 TClCLl2·12 - TClCLl2·12 TClCl/3+2 ns ns ns ns 40 65 ns Reset Pulse Width 4TClCl 4TClCl ns TPGVRTl PCTl, POI, RFRQ to RESET J. Selup 125 167 ns 7 TRTLPGX PCTl,RFRQ to RESET J. Hold 10 8 TClPC PClK Irom ClK J. Delay 9 TPDVCl POI to ClK J. Setup 60 85 ns 10 TClPDX POI to ClK J. Hold 40 55 ns 30 40 20 25 ns ·0 0 ns 20 30 ns 4 TRTVCl Reset to ClK J. Setup 5 TRTH 6 20 230 25 230 TClCLl3+2 10 45 5 ns 55 ns 6 SYNCHRONOUS "p PORT INTERFACE 11 TPEVCl 12 TKVCl 13 TClKX 14 TKVCH PE to ClK J. Setup r:m, WR", J5E, PCTl to ClK J. Setup r:m, WR", J5E, PCTl to ClK J. Hold RD,WR,PCTl 10 ClK i Setup 6-114 2 1 2 inter 8208 A.C. CHARACTERISTICS (Continued) Ref Symbol 8208-16,8208 (FFS=l) Parameter Min 8208-12,8208-6 (FFS=O) Max Min Units Notes ns 8.9 Max ASYNCHRONOUS ,.p PORT INTERFACE 15 TRWVCl RD. WR to ClK J. Setup 16 TRWl RD. WR Pulse Width 17 TRWlPEV PE from RD. WR J. Delay CFS=l CFS=O 20 2TClCl 30 + 30 2TClCl + 40 TClCl-20 TClCl-30 18 TRWlPEX TRWlPTV PE to RD. WR J. Hold PCTl from RD. WR J. Delay 2TClCl 19 20 TRWlPTX PCTl to RD. WR J. Hold 2TClCl 21 TRWlPTV PCTl from RD. WRJ. Delay 22 TRWlPTX PCTllo RD. WR J. Hold + 30 TClCl-30 TClCl-40 2TClCl + 40 TClCl-30 + 30 2TClCl + 30 ns ns 1 2 ns TClCl-40 + 40 2TClCl-20 3TClCl ns 2TClCl-30 3TClCl.+ 40 ns 2 ns 2 ns 1 ns 1 ns 10 RAM INTERFACE 23 TAVCl AL, AH. BS to ClK J. Setup 24 TCLAX Al. AH. BS to ClK J. Hold 25 TClRSl RAS J. from ClK J. Delay 26 TRCD RAS to CAS Delay CFS=l CFS=O CFS=O 27 TClRSH RAS t from ClK J. Delay 28 TRAH CFS=l CFS=O CFS=O 29 TASR Row AO to CAS Hold 30 TASC Column AO to CAS J. Setup CFS=l CFS=O 31 TCAH Column AO to CAS Hold 32 TClCSl CAS J. from ClK J. Delay 33 TClCSl CAS J. from ClK J. Delay CFS=l 34 TClCSH CAS 35 TClWl WE J. from ClK J. Delay 36 TClWH WE from ClK J. Delay CFS=O CFS=l CFS=O 37 TClTKl t 45 + IASR + IASR ns 0 35 45 ns TClCl-30 TClCl/2-30 60 TClCl-25 TClCl/2-25 75 50 ns ns ns 60 TClCl/2-13 TClCLl4-10 40 1.14 2.11.14 2.12.14 ns TClCl/2-15 TClCl/4-15 35 ns ns ns 1.13.15 2.11.15 2.12.15 10.16 2 5 5 5 ns ns 1.13.17.18 2.13.17.18 ns 2 1 (See DRAM Inlerface Tables) TClCLl4 + 30 from ClK J. Delay t XACK J. from ClK J. Delay 55 0 TClCl/4 + 30 TClCl/1.8 + 53 TClCl/4 + 30 TClCl/1.8 + 72 35 40 ns 50 60 ns 35 45 ns TClCl/l.8 35 35 6-115 + 53 TClCl/4 + 30 TClCl/l.8 45 45 + 72 ns ns ns 2 1 8208 , A.C. CHARACTERISTICS (Continued) Ref Symbol Parameter 8208-16, 8208 (FFS= 1) Min 8208-12,8208-6 (FFS=O) Max Min Units Notes Max RAM INTERFACE (Continued) 38 TRWlTKH XACK j Irom RD j , WRjDelay 50 55 ns 39 TCLAKl AACK.J. Irom CO< .J.. Delay 35 35 ns 40 TCLAKH AACK j from ClK.J. Delay 50 60 ns REFRESH REQUEST 41 TRFVCl RFRO to ClK.J. Setup 20 30 42 TClRFX RFRO to ClK.J. Hold 10 10 43 TFRFH Failsafe RFRO Pulse Width 44 TRFXCl Single RFRO Inactive to ClK.J. Setup 45 TBRFH Burst RFRO Pulse Width TClCl + 30 20 2TClCl TClCl ns ns + 50 30 + 30 2TClCl + 50 ns 19 ns 20 ns 19 The following RC loading is assumed: AOO_8 R = 220 C = 2001JF C = 150 pF RASO_l, CASO_l R = 390 C = 50 pF AACK, WE/PClK R = 330 NOTES: 1. Specification when programmed in the Fast Cycle processor mode (iAPX 286 mode). 8208-16, -12 only. 2. Specification when programmed in the Slow Cycle processor mode (iAPX 186 mode). 8208-8, -6 only. 3. tR and tF are referenced from the 3.5V and 1.0V levels. 4. RESET is internally synchronized to ClK. Hence a set-up time is required only to guarantee its recognition at a particular clock edge. 5. The first programming bit (PDO) is also sampled by RESET going low. 6. TClPDX is guaranteed if programming data is shifted using PClK. 8. TRWVCl is not required for an asynchronous command except to guarantee its recognition at a particular clock edge. 9. Valid when programmed in either Fast or Slow Cycle mode. 10. IASR is a user specified parameter and its value should be added accordingly to TAVCL. 11. When programmed in Slow Cycle mode and 125 ns :s; TClCl < 200 ns. 12. When programmed in Slow Cycle mode and 200 ns :s; TClCL. 13. Specification for Test load conditions. 14. tRCD (actual) = tRCD (specification) +0.06 (aCRAS) - 0.06(aCCAS) where aC = C (test load) - C (actual) in pF. (These are first order approximations.) 15. tRAH (actual) = tRAH(specification) + 0.06 (aCRAS) - 0:022 (aCAO) where aC = C (test load) - C (actual) in pF. (These are first order approximations.) 16. IASR (actual) = IASR (specification) +0.06 (aCAO) - 0.025 (aCRAS) where aC = C (test load) - C (actual) in pF. (These are first order approximations.) 17. IASC (actual) = IASC (specification) + 0.06 (aCAO) - 0.025 (aCCAS) where aC (test load) - C (actual) in pF. (These are first order approximations.) 18. IASC is a function of clock frequency and thus varies with changes in frequency. A minimum value is specified. 19. TFRFH and TBRFH pertain to asynchronous operation only. 20. Single RFRQ should be supplied synchronously to avoid burst refresh. 6-116 intJ ~OO[g!l.D~DOO~OOW 8208 WAVEFORMS Clock and Programming Timings ClK RESET PCTl ~ ·0 4 5 6 ® REFRQ POI WEJPClK @ POD POl ® :=..J ® \- r230734-1~ RAM Warm-up Cycles ~----------~;-WE-::J--r-~f~G----~~~G------------------------~,S~G------------------~'-- lAST RAM WARM-UP FIRST RAM WARM·UP CYCLE ----------------------4 230734-20 NOTE: The present example assumes a RAS four clocks long. Refresh Request Timing elK FAilSAFE REFRESH REQUEST -----,1 SINGLE REFRESH - - - - - - - - - - ' REQUEST BURST ~@: _ .:~6~~;~ ----------' __ 4S -------- 230734-21 6-117 inter 8208 WAVEFORMS (Continued) Synchronous Port Interface COMMAND MODEl FAST CYCLE AD. W1f.15"E" COMMAND MODEl FAST CYCLE PCTL (INHIBIT) ---+--;--"'" COMMAND MODEl FAST CYCLE INTERNAL INHIBIT _ _ -+__;-___.....;.;-_________________ SLOW CYCLE RO,WJi SLOW CYCLE fie SLOW CYCLE PCTL w---_ 230734-22 NOTE: Actual transitions are programmable. Refer to Tables 8 and 9. 6-118 8208 WAVEFORMS (Continued) Asynchronous Port Interface ClK FAST/SLOW CYCLE RD.WR ~---------QD--+-------~~ ~-=--------~+-------~~ FAST/SLOW CYCLE ---l~...::.i;:""'" PE ~------------~GD~'----~~ SLOW CYCLE PCTl ® ~----~~----+---QDI--4-------~ ~-----QDI----~~ FAST CYCLE PCTl (INHIBIT) ____________ -+~ __ ~----~L--------- r------------------------ FAST CYCLE INTERNAL INHIBIT liAS - - - - - - - - - _ 230734-23 6-119 8208 WAVEFORMS (Continued) RAM Interface Timing CLOCK 0 CLK~~~~ COMMAND \ ALO - ALS AHO-AHS BS O - BS 1 RAS / \ @--::::> " / r---@ K ~ ®-I--- -@---- ·-.@)r~ I I 2S AOO-AO S f{ ~i ·@---I -~ , - CAS ~ 1 - XACK -AACK -, €9 -- I{ -. 36 WE -. ®I-\. -. --+ , @-- ---@--~ ~l 230734-24 NOTE: Actual transitions are programmable. See Tables 8 and 9. 6-120 82C08 CHMOS DYNAMIC RAM CONTROLLER •o • Wait State with INTEL Microprocessors iAPX 286 } 82C08-20 4-20 MHz (10, 8, 6 MHz) 82C08-16 4-16 MHz 82C08-12 4-12 MHz iAPX 186/88 } 82C08-10 2-10 MHz 86/88 82C08-8 2-8 MHz • • Supports 64K and 256K DRAMS. Optimized for CMOS DRAMs Power Down Mode with Programmable Memory Refresh using Battery Backup • • • • • • Directly Addresses and Drives up to 1 Megabyte without External Drivers Microprocessor Data Transfer and Advance Acknowledge Signals Five Programmable Refresh Modes Automatic RAM Warm-up Pin-Compatible with 8208 Plastic DIP 48 Lead PLCC 68 Lead The Intel 82C08 Dynamic RAM Controller is a CMOS, high performance, systems oriented, Dynamic RAM controller that is designed to easily interface 64K and 256K Dynamic RAMs to Intel and other microprocessors. The 82C08 also has a power down mode where only the refresh logic is activated using battery backup. AL4 AL3 AL2 ALI ALO mil, 1!mI as AOO AOI A02 A03 A04 Vss A05 A06 A07 A08 POD RASi FiASO em CAsO PDCLK RESET Vce VCC/VPD AL5 AL6 AL7 ALB AHO AHI AH2 AH3 AH4 AH5 AH6 Vss AH7 AH8 POI RFRQ CLK Fm WJ!I PE PClL. AACKlXACK WE/PCLK 231357-2 85 ------I 231357-1 Figure 1. Block Diagram and Pinout lJagram Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. December 1985 © Intel Corporation, 1985 6-121 Order Number: 231357-003 Intel 82C08 Table 1. Pin Description . Symbol ALO AL1 AL2 AL3 AL4 AL5 AL6 AL7 AL8 AHO AH1 AH2 AH3 AH4 AH5 AH6 AH7 AH8 Pin Type 5 4 3 2 1 47 46 45 44 ADDRESS HIGH: These higher order address inputs are used to generate the row address for the internal address multiplexer. In iAPX 286 mode, these addresses are latched internally. 43 42 41 40 39 38 37 35 34 as AOO Naine and Function ADDRESS LOW: These lower order address inputs are used to generate the column address for the internal address multiplexer. In iAPX 286 mode (CFS = 1), these addresses are latched internally. BANK SELECT: This input is used to select one of the two banks of the dynamic RAM array. . 7 8 9 o o ADDRESS OUTPUTS: These outputs are designed to provide the row and column addresses, of either the CPU or the refresh counter, to the dynamic RAM· array. These outputs drive the dynamic RAM array directly and need no external drivers. However, they typically need series resistors to match impedances. A01 A02 A03 A04 A05 A06 A07 A08 11 12 RASO RAS1 19 18 o ROW ADDRESS STROBE: These outputs are used by the dynamic RAM array to latch the row address, present on the AOO-8 pins. These outputs are selected by the as pin. These outputs drive the dynamic RAM array directly and need no external drivers. 21 o COLUMN ADDRESS STROBE: These outputs are used by the dynamic RAM array to latch the column address, present on the AOO8 pins, These outputs are selected by the as pin. These outputs drive the dynamic RAM array directly and need no external drivers. 10 13 14 15 20 RESET 23 WEI 25 PCLK o o o o o o o o o RESET: This active high signal causes all internal counters to be reset. Upon release of RESET, data appe!iring at the POI pin is clocked-in by the PCLK output. The states of the POI, PCTL, and RFRQ pins are sampled by RESET going inactive and are used to program the 82C08. An 8~cycle dynamic RAM warm~up is performed after clocking POI bits into the 82C08. o WRITE ENABLE/PROGRAMMING CLOCK: Immediately after a RESET this pin becomes· PCLK and is used to clock serial programming data into the POI pin. After the 82C08 is programmed this active high signal provides the dynamic RAM array the write enable input for a write operation. . 6-122 inter 82C08 Symbol AACK/ XACK Pin 26 Type PCTL 27 I PE 28 I WR 29 I RD 30 I CLK 31 I RFRO 32 I POI 33 I 'PDD 17 I 'PDCLK 22 I 'VeeIVpD 48 I Vee Vss 24 12 36 I I I 0 Name and Function ADVANCE ACKNOWLEDGE/TRANSFER ACKNOWLEDGE: When the X programming bit is set to logic 0 this pin is AACK and indicates that the processor may continue processing and that data will be available when required. This signal is optimized for the system by programming the S program-bit for synchronous or asynchronous operation. The S programming bit determines whether this strobe will be early or late. If another dynamic RAM cycle is in progress at the time of the new request, the AACK is delayed. When the X programming bit is set to logic 1 this pin is XACK and indicates that data on the bus is valid during a read cycle or that data may be removed from the bus during a write cycle. XACK is, a MULTIBUS compatible Signal. PORT CONTROL: This pin is sampled on the falling edge of RESET. It configures the 82C08 to accept command inputs or processor status inputs. If PCTL is low after RESET the 82C08 is programmed to accept bust multibus command inputs or iAPX 286 status inputs. If PCTL is high after RESET the 82C08 is programmed to accept status inputs from iAPX 86 or iAPX 186 type processors. The S2 status line should be connected to this input if programmed to accept iAPX 86 or iAPX 186 inputs. When programmed to accept bus commands or iAPX 286 status inputs, it should be tied low or it may be connected to INHIBIT when operating with MULTIBUS. PORT ENABLE: This pin serves to enable a RAM cycle request. It is generally decoded from the address bus. WRITE: This pin is the write memory request command input. This input also directly accepts the SO status line from Intel processors. READ: This pin is th~read memory request command pin. This input also directly accepts the S1 status line from Intel processors. CLOCK: This input provides the basic timing for sequencing the internal logic. REFRESH REQUEST: This input is sampled on the falling edge of RESET. If RFRO is high at RESET then the 82C08 is programmed for internal-refresh request or external-refresh request with failsafe protection. If RFRO is low at RESET then the 82C08 is programmed for external-refresh without failsafe protection or burst refresh. Once programmed the RFRO pin accepts signals to start an external-refresh with failsafe protection or externalrefresh without failsafe protection or a burst refresh. RFRO is also sampled when POD is activated. When RFRO = 1 it will cause 3 burst refresh cycles. PROGRAM DATA INPUT: This input is sampled by RESET going low. It programs the various user selectable options in the 82C08. The PCLK pin shifts programming data into the POI input from an external shift register. This pin may be strapped low to a default iAPX 186 mode configuration or high to a default iAPX 286 mode configuration. POWER DOWN DETECT: This input is sampled before every memory cycle to inform the 82C08 of system detection of power failure. When active, the 82C08 remains in power down mode and performs memory refresh only (RAS-only refresh). In power down mode the 82C08 uses PDCLK for timing and VPD for power. POWER DOWN CLOCK: This pin is used as a clock for internal refresh circuits during power down. The input can be asynchronous to pin 31. Extended refresh is achieved by slowing down this clock. This pin should be grounded if not used. POWER: Power supply for internal logic. This should be held active during power down. POWER: Supply for drivers. Need not be held active during power down. GROUND GROUND ·Different function than the HMOS 8208, 6-123 inter 82C08 GENERAL DESCRIPTION FUNCTIONAL DESCRIPTION The Intel 82C08 Dynamic RAM Controller is a microcomputer peripheral device which provides the necessary signals to address, refresh, and directly drive 64K and 256K dynamic RAMs. Processor Interface The 82C08 supports several microprocessor interface options including synchronous' and, asynchronous operations for iAPX 86, iAPX 186, iAPX 286, and MULTIBUS. The 82C08 will also interface to non-Intel microprocessors. The 82C08 is a CHMOS version of the 8208 and is pin compatible with it. Three pins:-17, 22, and 48of the 82C08 are different from the 8208. They provide a power down mode that allows the systE!m to run at a much lower ICC. In this mode, thE! 82C08 rE!freshes the DRAM using battE!ry backup. ThE! power down current (lpD) that is drawn by the 82C08 is VE!ry small compared to thE! Icc which allows mE!mory to be kept alive with a battE!ry. A sE!paratE! refresh clock, pin 22, allows thE! designer to take advantage of RAMs that permit extended memory refresh. The 82C08 also has some timing changes versus the 8208. In order to eliminate the E!xternal bus latches, both WE and CAS timings are .shortened. These timing changes are backwards-compatible for 8208 designs. The 82C08 has control circuitry capable of supporting one of several possible bus structures. The 82C08 may be programmed to run synchronous or asynchronous. to the processor clock. The 82C08 has been optimized to run synchronously with Intel's iAPX 86, iAPX 88, iAPX 186/188 and iAPX 286. When the 82C08 is programmed to run in asynchronous mode, the 82C08 inserts the necessary synchronization circuitry for the RD, WR inputs. The 82C08 achieves high performance (i.e. no wait states) by decoding the status lines directly from the processor. The 82C08 can also be programmed to receive read or write MULTIBUS commands or commands from a bus controller. The 82C08 may be programmed to operate synchronously to the processor. It can also be programmed to run at various frequencies. (See Microprocessor Clock Frequency Option.) Figure 2 shows the different processor interfaces to the 82C08 using the synchronous or asynchronous mode and status or command interface. Figure 3 shows detailed interfaces to the iAPX 186 andiAPX 286 processors. 6-124 82C08 Siil------t~ 808&1 S'il------t 80186 S21------t~ 231357-3 231357-5 Slow-Cycle Synchronous-Status Interface Slow-Cycle Asynchronous-Status Interface 231357-4 231357-6 Slow-Cycle Synchronous-Command Interface Slow-Cycle Asynchronous-Command Interface Figure 2A. Slow-cycle (CFS = 0) Port Interfaces Supported by the 82C08 6-125 intJ 82C08 231357-9 231357-7 Fast-Cycle Asynchronous-Status Interface Fast-Cycle Synchronous-Status Interface 231357-10 231357-8 'MULTIBUS OPTION Fast-Cycle Synchronous-Command Interface Fast-Cycle Asynchronous-Command Interface Figure 2B. Fast-cycle (CFS = 1) Port Interfaces Supported by the 82C08 6-126 82C08 LATCHED ADDRESS BUS SYSTEM ADDRESS BUS 231357-11 Figure 3A. 82C081nterface to an 80186 OTHEAS~ AACI(. SIQNALS J I l .. I. c •• ~ ~ IIU00 "'1.. 1 ClowUtl I Wi t-- ~. m i'" iiit ~ ::::::o---w..---r-\. ~ LATCH 12&2 ~" ,. - LS24S } ... LATCHE o ADORES 5 BUS to. SYSTEM DATA BUS ) 231357-12 Figure 38. 82C08 Interface to an 80286 6-127 82C08 Dynamic RAM Interface The 82C08 is capable of addressing 64K and 256K dynamic RAMs. Figure 3 shows the connection of the processor address bus to the 82C08 using the different RAMs. Table 2 shows the bank selection decoding and corresponding RAS and CAS assignments. For ample, if only one RAM bank is occupied, then two RAS and CAS strobes are activated with same timing. the exthe the Table 2. Bank Selection Decoding and Word Expansion (NOTE 1) All-A19 AHG-AH8 82C08 256K RAM INTERFACE 82C08 Program Bit RB Bank Input BS 0 0 RASo, 1, CASo, 1 to Bank 0 0 1 Illegal 1 0 RASo, CASo to Bank 0 1 1 RAS1, CAS1 to Bank 1 82C08 RAS/CAS,Pair Allocation Program bit RB is not used to check the bank select input BS. The system design must protect from accesses to "illegal", non-existent banks of memory by deactivating the PE input when addressing an "illegal", non-existent bank of memory. 64K RAM INTERFACE 231357-13 NOTES: 1. Unassigned address input pins should be strapped high. 2. AO along with SHE are used to select a byte within a processor word. 3. Low order address bit is used as a bank select input so that consecutive memory access requests are to alternate banks allowing bank interleaving of memory cycles. The 82C08 adjusts and optimizes internal timings for either the fast or slow RAMs as programmed. (See RAM Speed Option.) Memory Initialization After programming, the 82C08 performs eight RAM "wake-up" cycles to prepare the dynamic RAM for proper device operation. Figure 3. Processor Address Interface to the 82C08 Using 64K, and 256K RAMS The 82C08 divides memory into two banks, each bank having its own Row (RAS) and Column (CAS) Address Strobe pair. This organization permits RAM cycle interleaving. RAM cycle interleaving overlaps the start of the next RAM cycle with the RAM precharge period of the previous cycle. Hiding the precharge period of one RAM cycle behind the data access period of the next RAM cycle optimizes memory bandwidth and is effective as long as successive RAM cycles occur in the alternate banks. Successive data access to the same bank cause the 82C08 to wait for the precharge time of the previous RAM cycle. But when the 82C08 is programmed in an iAPX 186 synchronous configuration, consecutive cycles to the same bank do not result in additional wait states (Le. 0 wait state). If not all RAM banks are occupied, the 82C08 can be programmed to reassign the RAS and CAS strobes to allow using wider data words without increasing the loading on the RAS and CAS drivers. Refresh The 82C08 provides an internal refresh interval counter and a refresh address counter to allow the 82C08 to refresh memory. The 82C08 has a 9-bit internal refresh address counter which will refresh 128 rows every 2 milliseconds, 256 rows every 4 milliseconds or 512 rows every 8 milliseconds, which allows all RAM refresh options to be supported. In addition, there exists the ability to refresh 256 row address locations every 2 milliseconds via the Refresh Period programming option. The 82C08 may be programmed for any of five different refresh options: Internal refresh only, External refresh with failsafe protection, External refresh without failsafe protection, Burst refresh modes, or no refresh. (See Refresh Options.) It is possible to decrease the refresh time interval by 10%,20% or 30%. This option allows the 82C08 to compensate for reduced clock frequencies. Note 6-128 inter 82C08 that an additional 5% interval shortening is built-in in all refresh interval options to compensate for clock variations and non-immediate response to the internally generated refresh request. (See Refresh Period Options.) SYSTEM I 82C08 i---11~ RE~ L-- RES~_________________ t 1~~=PROGRAMMING TIME OF~~ 82C08 ______ External Refresh Requests after RESET B2COB DIFFERENTIATED RESET NOTES: = TPROG + TPREP where: TPROG = (40) (TCLCL) programming time TPREP 231357-14 1. Required only when the synchronization option is altered from its initial default value. 2. Vee must be stable before system reset is activated when using this circuit. ego 82C08 System Response: TRESP RESET SYSTEM RESET External refresh requests are not recognized by the 82C08 until after it is finished programming and preparing memory for access. Memory preparation includes 8 RAM cycles to prepare and ensure proper dynamic RAM operation. The time it takes for the 82C08 to recognize a request is shown below. Figure 4. 82C08 Differentiated Reset Circuit = (8) (32) (TCLCL) RAM warm-up time Within four clocks after RESET goes active, all the 82C08 outputs will go high, except for AOO-2, which will go low. if TCLCL = 125 ns then TRESP = 37 ILs Reset OPERATIONAL DESCRIPTION RESET is an asynchronous input, its falling edge is used by the 82C08 to directly sample the logic levels of the PCTL, RFRO, and PDI inputs. The internally synchronized falling edge of reset is used to begin programming operations (shifting in the contents of the external shift register, if needed, into the PDI input). Differentiated reset is unnecessary when the default synchronization programming is used. Until programming is complete the 82C08 latches but does not respond to command or status inputs. A problem may occur if the S bit is programmed inconsistently from the Command which was latched before programming was completed. A simple means of preventing commands or status from occurring during this period is to differentiate the system reset pulse to obtain a smaller reset pulse for the 82C08. The differentiated reset pulse would be shorter than the system reset pulse by at least the programming period required by the 82C08. The differentiated reset pulse first resets the 82C08, and system reset would reset the rest of the system. While the rest of the system is still in reset, the 82C08 completes its programming. Figure 4 illustrates a circuit to accomplish this task. Programming the 82C08 The 82C08 is programmed after reset. On the falling edge of RESET, the logic states of several input pins are latched internally. The falling edge of RESET actually performs the latching, which means th~t the logic levels on these inputs must be stable prior to that time. The inputs whose logic levels are latched at the end of reset are the PCTL, RFRO, and PDI pins. Status/Command Mode The processor port of the 82C08 is configured by the states of the PCTL pin. Which interface is selected depends on the state of the PCTL pin at the end of reset. If PCTL is high at the end of reset, the 8086/80186 Status interface is selected; if it is low, then the MULTIBUS or Command interface is selected. The status lines of the 80286 are similar in code and timing to the Multibus command lines, while the status code and timing of the 8086 and 8088 are identical to those of the 80186 and 80188 (ignoring the differences in clock duty cycle). Thus there exists two interface configurations, one for the 80286 status or Multibus memory commands, which is called the Command interface, and one for 8086, 6-129 82C08 8088, 80186 or 80188 status, called the 8086 Status interface. The Command interface can also directly interface to the command lines of the bus controllers for the 8086, 8088, 80186 and the 80286. The 80186 Status interface allows direct decoding of the status lines for the iAPX 86, iAPX 88, iAPX 186 and the iAPX 188. Table 3 shows how the status lines are decoded. Table 3A. Status Coding of 8086, 80186 and 80286 Status Code S2 Sl SO 0 0 0 1 0 0 1 0 0 0 1 1 1 0 0 1 0 1 1 1 0 1 1 1 8086/80186 MEMORY READ MEMORY WRITE IDLE External Refresh without Failsafe To generate single external refresh requests without failsafe protection, it is necessary to hold RFRQ low until after reset. Thereafter, bringing RFRQ high for one clock period will cause a refresh request to be generated. A refresh .request is not recognized until a previous request has been serviced. Table 3B. 82C08 Response Function 8086/80186 80286 Status or PCTl RD WR 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 Status Interface IGNORE 1 0 1 IGNORE IGNORE IGNORE READ READ WRITE IGNORE For the 82C08 to generate internal refresh requests, it is necessary only to strap the RFRQ input pin high. To allow user-generated refresh requests with failsafe protection, it is necessary to hold the RFRQ input high until after reset. Thereafter, a low-to·high transition on this input causes a refresh request to be generated and the internal refresh interval counter to be reset. A high-to-Iow transition has no effect on the 82C08. A refresh request is not recognized until.a previous request has been serviced. 80286' INTERRUPT 1/0 READ 110 WRITE IDLE HALT • Refer to 80286 pin deSCription table 82C08 Command Internal Refresh Only External Refresh with Failsafe Function INTERRUPT 1/0 READ 1/0 WRITE HALT INSTRUCTION FETCH MEMORY READ MEMORY WRITE IDLE generated. If the RFRQ pin is low immediately after a reset, then the user has the choice of a single external refresh cycle without failsafe, burst refresh or no refresh. Burst Refresh Command Interface IGNORE' READ Burst refresh is implemented through the same pro· cedure as a single external refresh without failsafe (Le., RFRQ is kept low until after reset). Thereafter, bringing RFRQ high for at least two clock periods will cause· a burst of up to 128 row address locations to be refreshed. A refresh request is not recognized until a previous request has been serviced (i.e. burst is completed). WRITE IGNORE IGNORE INHIBIT INHIBIT IGNORE No Refresh '1lIegal with CFS = 0 It is necessary to hold RFRQ low until after reset. This is· the same as programming External Refresh without Failsafe. No refresh is accomplished by keeping RFRQ low. Refresh Options Immediately .after system reset, the state of the RFRQ input pin is examined. If RFRQ is high, the 82C08 provides the user with the choice between self-refresh and user-generated refresh with failsafe protection. Failsafe protection guarantees that if the user does not come back with another refresh request before the internal refresh interval counter times out, a refresh request will be automatically Option Program Data Word PROGRAMMING FOR SLOW CYCLE The program data word consists of 9 program data bits, PDO-PD8. If the first program data bit, PD~ is 6-130 inter 82C08 set to logic 0, the 82C08 is configured to support iAPX 186, 188, 86, or 88 systems. The remaining bits, P01-P08, may then be programmed to optimize a selected system configuration. A default of all zeros in the remaining program bits optimizes the 82C08 timing for 8 MHz Intel CPUs using 150 ns (or faster) dynamic RAMs with no performance penalty. PROGRAMMING FOR FAST CYCLE If the first program data bit is set to logic 1, the 82C08 is configured to support iAPX 286 systems (Command mode). A default of all ones in the program bits optimizes the 82C08 timing for an 8 MHz 286 using 120 ns DRAMs at zero wait states. Note that the programming bits P01-8 change polarity according to POO. This ensures the same choice of options for both default modes. Table 4A shows the various options that can be pro. grammed into the 82C08. Name PD~ = 0 = 1 CFS = 0 SLOW CYCLE CFS = 1 FAST CYCLE PD~ CFS CFS PD1 5 S S=O SYNCHRONOUS' 5=1 ASYNCHRONOUS PD2 RFS RFS RFS = 0 FAST RAM' RFS = 1 SLOW RAM PD3 RB RB RAM BANK OCCUPANCY SEE TABLE 2 PD4 CI1 CI1 WE/PCLK is a dual function pin. During programming, it serves to clock the external shift register, and after programming is completed, it reverts to the write enable RAM control output pin. As the pin changes state to provide the write enable signal to the dynamic RAM array, it continues to clock the shift register. This does not present a problem because data at the POI pin is ignored after programming. Figure 7 illustrates the timing requirements of the shift register. After reset, the 82C08 serially shifts in a program data word via the POI pin. This pin may be strapped low or high, or connected to an external shift register. Strapping POI low causes the 82C08 to default to the iAPX 186 system configuration, while high causes a default to the iAPX 286 configuration. Table 4B shows the characteristics of the default configuration for Fast Cycle (POI = 1) and Slow Cycle (POI = 0). If further system flexibility is needed, one external shift register, like a 74HC165, can be used to tailor the 82C08 to its operating environment. Polarity/Function PD~ Serial data is shifted into the 82C08 via the POI pin (33), and clock is provided by the WE/PCLK pin (25), which generates a total of 9 clock pulses. Default Programming Options Table 4A. Program Data Word Program Data Bit such as a 7 4HC165. The reset pulse serves to parallel load the shift register and the 82C08 supplies the clocking signal (PCLK) to shift the data into the POI programming pin. Figure 6 shows a sample circuit diagram of an external shift register circuit. Table 4B. Default Programming Synchronous interface Fast RAM (Note 1) COUNT INTERVAL BIT 1; SEE TABLE 6 COUNT INTERVAL BIT 0; SEE TABLE 6 PD5 CIO CIO PD6 PLS PLS PLS = 0 LONG REFRESH PERIOD' PLS = 1 SHORT REFRESH PERIOD PD7 FFS FFS FFS = 0 FAST CPU FREQUENCY' FFS = 1 SLOW CPU FREQUENCY PD8 X X X = OAACK' X = 1 XACK 2 RAM banks occupied 128 row refresh in 2 ms; 256 in 4 ms, 512 in 8 ms Fast processor clock frequency Advanced ACK strobe NOTE: 1. For iAPX 86/186 systems either slow or fast (150 or 100 ns) RAMS will run at 8 MHz with zero wait states. Synchronous! Asynchronous Mode (S program bit) The 82C08 may be configured to accept synchronous or asynchronous commands (RO, WR, PCTL) and Port Enable (PE) via the S program bit. The state of the S programming bit determines whether the interface is synchronous or asynchronous. • Default In both modes Using an External Shift Register The 82C08 may be programmed by using an external shift register with asynchronous load capability 6-131 inter 82C08 +5V o o)----1~ . , 0-0-0 , • I I I I 82C08 82C08 RESET t-----I WE/PCLK t - -....~ POI ClK L------r---------------------------------~RESET 231357-15 Figure 6. External Shift Register Interface ClK --'0..- ..... 4 RESET . ~~~~ =:) POI . ~,......8,,"-----, X POO X PD1 . NOTES: TRTVCL TPGVCL TCLPC TLOAO - P02 x::::: 231357-16 , Reset is an asychronous input, if reset occurs before TRTVCL, then it is guaranteed to be recognized. Minimum POI valid time prior to reset going low. MUX/PCLK delay. Asychronous load data propagation delay. Figure 7. Timing Illustrating External Shift Register Requirements for Programming the 82C08 While the 82C08 may be configured with either the Status or Command (MULTIBUS) interface in the Synchronous mode, certain restrictions exist in the Asynchronous mode. An Asynchronous-Command interface is directly supported. An Asynchronous80186/80286 Status interface using the status lines of the 80186/80286 is supported with the use of TIL gates as illustrated in Figure 2. In the 80186 case, the TIL gates are needed to guarantee that status does not appear at the 82C08's inputs too much before address, so that a cycle would start before address was valid. In the case of the 80286, the TIL gates are used for lengthening the Status pulse, as required by the TRWL timing. Microprocessor CloCk Cycle Option (CFS and FFS program bits) The 82C08 is programmed to interface with microprocessors with "slow cycle" timing like the 8086, 8088, 80186, and 80188, and with "fast cycle" microprocessors like the 80286. The CFS bit is used to select the appropriate timing. The FFS option is used to select the speed of the microprocessor clock. Table 5 shows the various microprocessor clock frequency options that can be programmed. The external clock frequency must be 6-132 inter 82C08 programmed so that the failsafe refresh repetition circuitry can adjust its internal timing accordingly to produce a refresh request as programmed. Table 6. Refresh Count Interval Table Ref. Period CFS PLS FFS (p.S) Table 5; Microprocessor Clock Frequency Options Program Bits FFS CFS 0 0 0 1 1 1 0 1 Processor iAPX86, 88,186,188 iAPX86, 88,186,188 iAPX286 iAPX286 Clock Frequency s 5 MHz ~ 6MHz s ~ 10 MHz 12 MHz RAM Speed Option (RFS program bit) The RAM Speed programming option determines whether RAM timing will be optimized for a fast or slow RAM. Whether a RAM is fast or slow is measured relative to 100 ns DRAMs (fast) or 150 ns DRAMs (slow). This option is only a factor in Fast cycle Mode (CFS = 1). Count Interval Cll,CIO (82C08 Clock Periods) 00 01 10 11 (0%) (10%) (20%) (30%) 15.6 1 1 1 236 212 188 164 7.8 1 '0 1 118 106 94 82 15.6 1 1 0 148 132 116 100 7.8 1 0 0 74 66 58 50 15.6 0 1 1 118 106 94 82 7.8 0 0 1 59 53 47 41 15.6 0 1 0 74 66 58 50 7.8 0 0 0 37 33 29 25 The refresh count interval is set up for the following basic frequencies: 5 MHz slow cycle 8 MHz slow cycle 10 MHz fast cycle 16 MHz fast cycle Refresh Period Options (CIO, CI1 and PLS program bits) The 82C08 refreshes with either 128 rows every 2 milliseconds, with 256 rows every 4 milliseconds or 512 rows every 8 milliseconds. This translates to one refresh cycle being executed approximately once every 15.6 microseconds. This rate can be changed to 256 rows every 2 milliseconds or a refresh approximately once every 7.8 microseconds via the Period Long/Short, program bit PLS, programming option. The Count Interval 0 (CIO) and Count Interval 1 (Cll) programming options allow the rate at which refresh requests are generated to be increased in order to permit refresh requests to be generated close to the 15.6 or 7.8 microsecond period when the 82C08 is operating at reduced frequencies. The interval between refreshes is decreased by 0%,10%,20%, or 30% as a function of how the count interval bits are programmed. A 5% guard band is built-in to allow for any clock frequency variations. Table 6 shows the refresh period options available. The numbers tabulated under Count Interval represent the num!Jer of clock periods between internal refresh requests. The percentages in parentheses represent the decrease in the interval between refresh requests. Example: Best 12 MHz fast cycle performance can be achieved using the basic frequency of 16 MHz (CFS = 1, FFS = 1) and the appropriate count interval bits (Cll = 1, CIO = 1) to reduce the frequency. clock pariod x rafrash count intarval = rafresh pariod i.a. 83.3 ns X 164 = 13.6!,-s Example: 10 MHz slow cycle CFS = 0, FFS = 1, CI1 = 0, CIO = 0 i.e. 100 ns X 118 = 11.8!,-s Processor Timing In order to run without wait states, AACK must be used and connected to the SRDY input of the appropriate bus controller. AACK is issued relative to a point within the RAM cycle and has no fixed relationship to the processors's request. The timing is such, however, that the processor will run without wait states, barring refresh cycles. In slow cycle, fast RAM configurations (8086, 80186), AACK is issued on the same clock cycle that issues RAS. Port Enable (PE) set-up time requirements depend on whether the 82C08 is configured for synchronous 6-133 inter 82C08 or asynchronous, fast or slow cycle o~ration. In a synchronous fast cycle configuration, PE is required to be set-!!E. to the same clock edge as the commands. If PE is true (low), a RAM cycle is started; if not, the cycle is not started until the RD ot WR line goes inactive and active again. If the X programming bit is high, the strobe is configured as XACK, while if the bit is low, the strobe is configured as AACK. Data will always be valid a fixed time after the -occurrence of the advanced acknowledge. Thus, the advanced acknowledge may also serve as a RAM cycle timing indicator. In asychronous operation, PE is required to be setup to the same clock edge as the internally synchronized status or commands. Externally, this allows the internal synchronization delay to be added to the status (or command) -to-PE delay time, thus allowing for more external decode time than is available in synchronous operation. General System Considerations 1. The RASO, 1, CASO, 1, and AOO-8 output buffers are designed to directly drive the heavy capacitive loads of the dynamic RAM arrays. To keep the RAM driver outputs from ringing excessively in the system environment it is necessary to match the output impedance with the RAM array by using series resistors. Each application may have different impedance characteristics and may require different series resistance values. The series resistance values should be determined for each application. - The minimum synchronization delay is the additional amount that fiE must be held valid. If PE is not held valid- for the maximum synchronization delay time, it is possible that fiE will go invalid prior to the status or command being synchronized. In such a case the 82C08 may not start a memory cycle. If a memory cycle intended for the 82C08 is not started, then no acknowledge (AACK or XACK) is issued and the processor locks up in endless wait states. 2. Although the 82C08 has programmable options, in practice there are only a few choices the designer must make. ForiAPX 86/186 systems (CFS = 0) the C2 default mode (pin 33 tied low) is the best choice. This permits zero wait states at 8 and 10 MHz with 150 ns DRAMs. The only consideration is the refresh rate, which must be programmed if the CPU is run at less than 8 MHz; Memory Acknowledge (AACK, XACK) Two types of memory acknowledge signals are supplied by the 82C08. They are the Advanced Acknowledge strobe (AACK) and the Transfer Acknowledge strobe (XACK). The S programming bit optimizes AACK for synchronous operation ("early" AACK) or asynchronous operation ('!late" AACK). Both the early and late AACK strobes are two clocks long for CFS = 0 and three clocks long for CFS = For iAPX 286 systems (CFS = 1) the designer must choose between configuration CO (RFS = 0) and C1 (RFS = 1, FFS = 0). CO permits zero wait state, 8 MHz'iAPX 286 operation with 120 ns DRAMs. However, for consecutive reads, this performance depends on interleaving between two banks. _The C1 configuration trades off 1 wait state performance for the ability to use 150 ns DRAMs. 150 ns DRAMs can be supported by the CO configuration using 7 MHz iAPX 286. 1. The XACK strobe is asserted when data is valid (for reads) or when data may be removed (for writes) and meets the MULTIBUS requirements. XACK is removed asynchronously by the command going inactive. Since in an asynchronous operation the 82C08 removes read data before late AACK or XACK is recognized by the CPU, the user must provide for data latching in the system until the CPU reads the data. In synchronous operation data latching is unnecessary, since the 82C08 will not remove data until the CPU has read it. 3. For non-Intel microprocessors, the asynchronous command mode would be the best choice, since Intel status lines are not available. To minimize the synchronization delay, the 8~C08 should use a 16 MHz clock. The preferred timing configuration is CO. Table 7. Memory Acknowledge Summary Asynchronous _ Synchronous XACK Fast Cycle AACK Optimized for Local 80286 (early) AACK Optimized for Remote 80286 (late) Multibus Compatible Slow Cycle AACK Optimized for Local 8086/186 (early) AACK Optimized for Remote 8086/186 (late) Multibus Compatible 6-134 inter 82C08 and the system clock during the time interval of the 3 burst cycles, e.g. 2310 clock cycles after activating POD. Low level at RFRO input enables the 82C08 to enter power down immediately without executing any bursts. POWER DOWN During Power Down (PO) mode, the 82C08 will perform refresh cycles to preserve the memory content. Two pins are dedicated to this feature, POD (Power Down Detect) and PDCLK (Power Down Clock). POD is used to inform the 82C08 of a system power failure, and will remain active as long as the power is down. It is the system's responsibility to detect power failure and to supply this signal. PDCLK is used to supply the clock during power down for the 82C08 refresh circuits. It is the system's responsibility to supply this clock. Power Down Procedure Power Supplies Power down is achieved by eliminating the clock from all the 82C08 circuits that are not participating in the refresh generation. The 82C08 has two power pins (Vee's), one supplies power to the output buffers and the other, to 82C08 logic. All the active circuits during power down are connected to the logic Vee, including the active output buffers. Therefore, it is the user's choice to connect only the logic Vee pin to the back-up power supply, or to connect both pins to it. It is recommended, however, to connect both pins to the same power supply in order to simplify and to shorten the power up time. Extended Refresh at Power Down (PO) The 82C08 will preserve the memory content during the entire period of the system operation. Upon detection of power down, the 82C08 will save internally its configuration status and the refresh address counter content, execute 3 burst refresh cycles. (If it is programmed to failsafe mode and the RFRO input level is high), it will switch the internal clock from the system clock (CLK) to the power down clock (PDCLK) and will continue the refresh to the next address location. (See Figure 11.) When power is up again (POD input deactivated), the 82C08 will issue internal reset which will not reprogram the device and will not clear the refresh address counter, and therefore, refresh will continue to the next address location. After the internal reset, 82C08 performs 3 burst refresh cycles which refresh the whole memory, as at entering extended PD. This is done to give the 82C08 enough time to wake up. Notice, at the time interval of 2310 clocks after power recovering no memory access will be performed. 82C08 Outputs on Power Down To reduce power dissipation during PO, 82C08 will support the extended refresh cycle of the Intel 51CXXL (e.g. 51C64L). In this mode, the refresh period can be extended up to 64 milliseconds versus 4 milliseconds in non-extended cycles. This is achieved by slowing down the PDCLK frequency. The user should take into consideration that when supporting extended refresh during PO, the dynamic RAM must be refreshed completely within 4 milliseconds, without active cycles, both before going into and after coming out of extended refresh. The 82C08 has the option of performing burst refresh of all the memory whenever the user cannot guarantee the 4 milliseconds idle interval. This is achieved by performing 3 consecutive burst refresh cycles activated internally by the 82C08. The option of refreshing all the memory is enabled in failsafe mode configuration (RFRO input high at reset). When 82C08 detects power down, (high level at POD) it examines the RFRO input. High level at the RFRO input will cause 3 burst refresh cycles to be performed. The user should supply the power Four of the 82C08 outputs are not activated during power down, AACK, CASO-1 and WE. All these outputs will be forced to a non-active state, AACK and CASO-1 will be forced high and WE will be forced low (External NAND buffer is used to drive the WE DRAM inputs, hence a high level on the DRAM inputs). The other 82C08 outputs, AOO-9 and RASO1, will switch to perform the memory refresh in a "RAS-ONLY REFRESH CYCLE." The RAS outputs internal pull-ups assure high levels on these outputs, as close as possible to Vee, for low DRAM power. The size of the output buffers, in power down, is smaller than the normal size, and therefore, the speed of these buffers is slower. It is done in order to reduce the speed of charging and discharging the outputs and hence reduce spikes on the power lines. It is required especially in power down, since there is only one power supply pin active which drives the output buffers as well as the internal logic. All the device inputs, beside POD and PDCLK, will be ignored during power down. 6-135 'S2COS esc. J RAS# PDCLK J AO _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~X~ _____________ 231357-18 Figure 8 Power Down Detect As previously mentioned, the PDD input will be supplied by the system to inform the 82C08 of a power failure. It can be asynchronous since the 82C08 synchronizes it internally. The PDD input will be sampled by the 82C08 before the beginning of every memory cycle but only after the termination of programming and initialization period. The user should guarantee Vee and ClK stable during the programming and initialization period (300 clocks after RESET). If the whole memory refresh is required (for extended refresh) then Vee and system clock should be available 2310 clocks after activating PDD. If it isn't required then 82C08 should wait for present memory cycle completion and synchronization time which will take about 25 system clock cycles. , During power down, 'RAS-ONlY REFRESH' will be performed by the 82C08, The time interval between refreshes is 5 PDClKs and this is fixed for all applications. However, the 82C08 can support the extended refresh (up to 64 ms) by slowing down the PDClK frequency. During the power down refresh cycle, RAS will be activated for one PDClK cycle only. In extended refresh, the PDClK frequency will be below 50 kHz and this will cause a long duration of the RAS signal which will increase the DRAM's current rapidly. To minimize the RAS low pulse, the two RC networks shown in Figure 9 are designed to insert one very fast (1 its) cycle whenever RAS is low (see Figure 8). The time' constant of RC1 and RC2 should be centered around 300 ns and 100 ns respectively. With PDD going inactive, the 82C08 synchronizes the clock back to the ClK clock, issuing internal reset and will perform 3 burst refresh cycles. NOTE: 82C08 LOW FREOUENCY OSCILLATOR The power supplies and the ClK should go up before the PDD is deactivated. All CPU requests will be ignored when PDD is active. HC132 Refresh during Power Down The 82C08 has two clock pins, ClK is the system clock and PDClK is the power down clock. PDClK should be an independent clock which has its own crystal oscillator. When entering power down, the 82C08 will disable the system clock internally and will run with the PDClK. The system clock will be enabled and the PDClK will be disabled when power is up. The ClK and PDClK will be switched internally for the refresh circuits. PDCLK (GND) RASo I Vcc· 231357-19 Figure 9. Low Frequency OSCillator 6-136 intJ 82C08 Power Down Synchronization The 82C08 main clock (MClK) is generated internally, from the system clock (ClK) and the power down clock (PDClK) (see Figure 10), and is driving the circuits that are active at all times, i.e.: circuits that are active both in power down mode and in normal operation. The system clock (ClK) is driving the circuits that are active in normal operation only, and the PDClK is driving the circuits that are active in power down only. The operation of the three clocks is as follows: When it isn't required, PDClK should be active, and ClK should remain active for at least 22 clock cycles + synchronization time, for completion of SSE write. The synchronization time is the ratio of PDClK and ClK + 1. Therefore, the ClK minimum active time after PD is activated: 22 + [CLK(MHz) I PDCLK(MHz) + 11 clock cycles When the power is up again, PDClK should remain active at least 4 clock cycles after PD is going inactive, to assure completion of refresh cycle and internal synchronization time. When entering power down mode, and the whole memory refresh is required, the ClK minimum active time after PDD is activated is 2310 clocks. PO ClK ,- \ ________________J' n J U .~----------------- n LJn LJn LJr----------, n n n r __________ LJ LJ LJ LJ POClK MClK 231357-20 Figure 10 POWER DOWN FLOW SET PDFLAQ, DISABLE WE, AACKIf, CASN DISABLE elK, ENS PDCLK OUT 231357-21 Figure 11 6-137 intJ 82C08 Differences Between 8208 and 82C08 The differences between the HMOS 8208 and the CHMOS 82C08 represent forward compatible enhancements. The 82C08 can be plugged into an 8208 socket without changes. LOGICAL DIFFERENCES 1. 82C08 has one new feature: Power Down (PO) 231357-22 2. 82C08 supports CMOS DRAMs with TRAC 100, 150 3. Address Mapping: 2. DC parameters: The difference is in the current consumption. ICC IPD 9 Most 9 Least Outputs Significant Bits Significant Bits 8208 82C08 column address row address row address column address 8208 82C08 300mA 30 mA (typical) 1 mA· (estimated) Configuration Charts 4. Slow cycle shortening: 1). the write cycle is two clocks shorter so consecutive writes will be executed without wait states. 2) The WE output is two clocks shorter. Therefore, an external latch on the WE output is not necessary. 3) CAS output is shorter by one clock on the read cycle. This reduces one level of buffers for address/data bus needed in 8208 deSigns. Read access margins are improved to support nonIntel spec. RAMs. 5. Fast cycle shortening: 1) The write cycle in CO configuration is shortened by one clock. 2) For both CO and C1 synchronous configuration, the CAS signal is shorter by one clock and the activation of RAS is tied to the 02 cycle of the 80286. This prevents contention on the data bus. The 82C08 operates in three basic configurationsCO, C1, C2-depending upon the programming of CFS (PDO), RFS (PD2), and FFS (PD7). Table 8 shows these configurations. These modes determine the clock edges for the 82C08's programmable signals, as shown in Table 9. Finally, Table 10 gives the programmable AC parameters of the 82C08 as a function of configuration. The non-programmable parameters are listed under AC Characteristics. Using the Timing Charts The notation used to indicate which clock edge triggers an output transition is "n t" or "n.J,", where "n" is the number of clock periods that have passed since clock 0, the reference clock, and " t" refers to rising edge and " .J, " to falling edge. A clock period is defined as the interval from a clock falling edge to the following falling edge. Clock edges are defined as shown below. ELECTRICAL DIFFERENCES 1. AC parameters: 1) CAS delay: In C2 synchronous read cycle, the CAS is deactivated by some delay from clock falling edge (TCLCSH timing) as in the follow. ing diagram: In C2 write cycles the CAS activation is triggered by the clock falling edge with a delay of 35 ns from the clock. For 8208 the delay is TP/1.8 + 53. (n-1)1 ril nl (n+l)1 (n+l)1 231357-23 The clock edges which trigger transitions on each 82C08 output are tabulated in Table 9. "H" refers to the high-going transition, and "L" to low-going transition. 2) 82C08 has an additional timing parameter TKNVCH (RD, WR) inactive setup time to clock. 6-138 inter 82C08 Clock 0 is defined as the clock in which the 82C08 begins a memory cycle, either as a result of a port request which has just arrived, or of a port request which was stored previously but could not be serv- iced at the time of its arrival because the 82C08 was performing another memory cycle. Clock a is identified externally by the leading edge of RAS, which is always triggered on oJ,. Table 8. 82C08 Configurations Timing Conf. CFS(PDO) RFS(PD2) FFS(PD7) Wait States' Co iAPX286(1) FAST RAM(1) 20 MHz(1) 0 Co . iAPX286(1) FASTRAM(1) 16 MHz(1) a C1 iAPX286(1) SLOW RAM (0) 16 MHz(1) 1 Co iAPX286(1) FASTRAM(1) 10 MHz (0) Co iAPX286(1) SLOWRAM(O) 10-MHz (0) C2 iAPX186(0) DON'T CARE DON'T CARE a a a • USing EAACK (synchronous mode) Table 9a. Timing Chart - Synchronous Mode RAS ADDRESS WE CAS Cn Cycle L H Col Row' L H a RD,RF oJ, sJ, oJ, 2J, 1J, sJ, WR oJ, 4J, oJ, sJ, 2J, 4J, RD,RF oJ, 4J, oJ, sJ, 1 J, 5J, WR oJ, 5J, oJ, sJ, 2J, 5J, RD,RF oJ, 2J, oJ, 2J, oJ, 2J, WR oJ, 2J, oJ, sJ, 1J, sJ, 1 2 H 1J, 1J, oJ, EAACK L H 1J, 4J, 1J, 4J, 2J, 5J, L 4J, 5J, 2J, 2J, 5J, oJ, 2J, oJ, 2J, Table 9b. Timing Chart - Asynchronous Mode RAS Cn a Cycle RD,RF oJ, Col Row' H oJ, 2J, 1J, 4J, 4J, oJ, sJ, 2J, 4J, RD,RF oJ, 4J, oJ, sJ, 1J, 6J, oJ, 5J, oJ, sJ, 2J, 5J, RD,RF oJ, 2J, oJ, 2J, oJ, sJ, 2J, oJ, sJ, 1J, sJ, WR oJ, WE CAS L sJ, WR 2 ADDRESS H oJ, WR 1 L .. LAACK XAACK H L 2J, 5J, sJ, RD 1J, 4J, sJ, WR L H H L 1J, 4J, 2J, 5J, 4J, RD 1 J, 5J, 1J, 4J, sJ, WR 1 J, sJ, 2J, RD oJ, 2J, 1t st 2J, WR The only dIfference between the two tables IS the traIling edge of CAS for all read cycle confIguratIons. In asynchro· nous mode, CAS trailing edge is one clock later than in synchronous mode. NOTES FOR INTERPRETING THE TIMING CHART: 1. COLUMN ADDRESS is the time column address becomes valid. 2. The CAS, EAACK, lAACK and XACK outputs are not issued during refresh. 3. XACK-high is reset asynchronously by command gOing inactive and not by a clock edge. 4. EAACK is used in synchronous mode, lAACK and XACK in asynchronous mode. 5. ADDRESS· Row is the clock edge where the 82C08 AO switches from current column address to the next row address. 6. If a cycle is inhibited by PCTl = t (Multibus IIF mode) then CAS is not activated during write cycle and XACK is not activated in either read or write cycles. 'Column addresses switch to row addresses for next memory cycle. The row address buffer is transparent following this clock edge. 'TRAH' specification is guaranteed as per data sheet. 6-139 intJ 82C08 82C08-DRAM Interface Parameter Equations Several DRAM parameters, but not all, are a direct function of 82C08 timings, and the equations for these parameters are given in the following tables. The following is a list of those DRAM parameters which have NOT been included in the following tables, with an explanation for their exclusion. WRITE tDS: tDH: tDHR: CYCLE system-dependent parameter. system-dependent parameter. system-dependent parameter. READ, WRITE REFRESH CYCLES tRAC: response parameter. tCAC: response parameter. tREF: See "Refresh Period Options". tCRP: must be met only if CAS-only cycles, which do not occur with 82C08, exist. tRAH: See "A.C. Characteristics" tRCD: See "A.C. Characteristics" tASC: See "A.C. Characteristics" tASR: See "A.C. Characteristics" tOFF: response parameter. Table 10. Programmable Timings Read and Refresh Cycles C2-Slow Cycle Parameter 2TCLCL-T25 tAP 1.5TCLCL-TS4 tCPN tCPN 2.5TCLCL-TS4 2TCLCL-TS2 tASH tCSH STCLCL-T25 2TCLCL + TS4(min)-T25 tCSH tCAH 2TCLCL-TS2 tAA 2TCLCL-T25 tT S/SO 4TCLCL tAC tAAS 2TCLCL-T25 STCLCL-TS2 tCAS tCAS 2TCLCL + TS!(min)-TS2 1.5TCLCL-TCL-TS6-TBUF tACS tACH TCLCL-TS2+ TS6 (min.) CO-Fast Cycle STCLCL-T25 STCLCL-TS4 4TCLCL-TS4 2TCLCL-TSS 4TCLCL-T25 STCLCL-T25 TCLCL-TSS 2TCLCL-T25 S/SO 6TCLCL STCLCL-T25 STCLCL-TSS 2TCLCL-T25 2TCLCL-TCL-TS6-TBUF TCLCL-TS2 C1-Fast Cycle STCLCL-T25 2TCLCL-TS4 STCLCL-TS4 STCLCL-TSS 6TCLCL-T25 5TCLCL-T25 2TCLCL-TSS STCLCL-T25 S/SO 7TCLCL 4TCLCL-T25 5TCLCL-TSS 4TCLCL-TSS 2TCLCL-TCL-TS6-TBUF TCLCL-TS2 Notes 1 1,5 1,4 1 1,5 1,4 1 1 2 1 1 1,5 1,4 1 1 C1·Fast Cycle STCLCL-T25 4TCLCL-TS4 STCLCL-TSS 5TCLCL-T25 TCLCL-TSS STCLCL-T25 S/SO 8TCLCL 5TCLCL-T25 STCLCL-TSS STCLCL-TSS 5TCLCL-T25 4TCLCL-TS6-TBUF 4TCLCL-TS6-TBUF 4TCLCL-TS6-TBUF TCLCL+ TS6-TS1-TBUF Notes 1 1 1 1 1 1 2 1 1 1 1,S 1,S 1 1 1 1 Write Cycles Parameter C2·Slow Cycle CO·Fast Cycle 2TCLCL-T25 STCLCL-T25 tAP tCPN 1.5TCLCL-TS4 5TCLCL-TS4 tASH STCLCL-TS2 2TCLCL-TSS tCSH STCLCL-T25 4TCLCL-T25 2TCLCL-TS2 tCAH TCLCL-TSS STCLCL-T25 STCLCL-T25 tAA tT S/SO S/SO tAC 4TCLCL 7TCLCL tAAS 2TCLCL-T25 4TCLCL-T25 tCAS 2TCLCL-TS2 2TCLCL-TSS tWCH TCLCL-TS2 2TCLCL-TSS tWCA 2TCLCL-T25 4TCLCL-T25 tWP 2TCLCL:TS6-TBUF STCLCL-TS6,TBUF tAWL 2TCLCL-TS6-TBUF STCLCL-TS6-TBUF tCWL STCLCL-TS6-TBUF STCLCL-TS6-TBUF TCLCL + TS6-TS1-TBUF TCLCL + TS6-TS1-TBUF tWCS NOTES: 1. Minimum. 2. Value on right is maximum; value on left is minimum. S. Applies to the eight warm-up cycles during initialization. 4. For synchronous mode only. 5. For asynchronous mode only. 6-140 inter 82C08 ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias - O°C to + 70°C Storage Temperature - 65°C to + 150°C Voltage On Any Pin With Respect to Ground -0.5Vto +7V Power Dissipation 0.5 Watts • Notice: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operaUon of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied Exposure to absolute maximum rating conditions for extended periods may affect device reliability. NOTICE: Specifications contained within the following tables are subject to change. D.C. CHARACTERISTICS Symbol TA = O°Cto 70°C; Vcc = 5.0V +10%;Vss = GND - Min Max Units Input Low Voltage -0.5 +0.8 V VIH Input High Voltage 2.0 Vcc + 0.5 V VOL Output Low Voltage VOH Output High Voltage VROL RAM Output Low Voltage VIL Parameter Comments V Note 1 V Note 1 0.45 V Note 1 V Note 1 30 60 mA mA Note 3 TA = 0° ±10 /J- A V OV ~ VIN ~ Vcc 0.45 2.4 VROH RAM Output High Voltage Icc Supply Current III Input Leakage Current VCL Clock Input Low Voltage -0.5 +0.6 VCH Clock Input High Voltage 3.8 Vcc + 0.5 V CIN Input Capacitance 20 pF VOHPD RAS Output High Power Down IpD Supply Current at Power Down 2.6 Vcc - 0.5 1.0 fc = 1 MHz V Note 2 mA Estimated Value NOTE: 1.!oL= 5 rnA and IOH = -0.32 rnA WE: IOL = 8 rnA 2. RAS Output voltage during power down. 3. Typical value. A.C. Testing Load Circuit A.C. Testing Input, Output Waveform RAS O.' ~--'-;';~\I\.I\,._-O 82C08 CASo., 1-=-.....::.;~fV\\r--''''O A00-8 _RA;.;.;O,"""",,,_-..n 2.4 Other Outputs 0.45 x::: :::x 231357-25 231357-24 RRAS = 390 RCAS = 390 RAO = 220 A.C. Testing inputs (except clock) are driven at 2.4V for a logic "1" and 0.45V for a logic "0" (clock is driven at 4.0V and 0.45V for logic "1"" and "0" respectively). Timing measurements are made at 2.0V, 2.4V for logic "1" and O.BV for logic "0". CRAS = 150 pF CCAS = 150 pF CAO = 200 pF CL=50pF 6-141 82C08 A.C. CHARACTERISTICS (TA = O°Cto 70°C; Vee = +5V ±10%, VSS = OV) Measurements made with respect to RASo_1, CASO_1, AOO-B, are at +2.4Vand 0.8V ClK at 3V, 1V. All other pins are measured at 2.0V and 0.8V. All times are ns unless otherwise indicated. Testing done with specified test load. Ref Symbol Parameter S2COS·20, S2COS·16 S2COS-10, S2COS-S Min Max S2COS-12 Min Units Notes Max CLOCK AND PROGRAMMING tF 1 2 3 Clock Fall Time 12 12 ns 3 tR Clock Rise Time 12 12 ns 3 TClCl Clock Period 82C08-20 82C08-16 82C08-12 82C08-10 82C08-8 250 ns ns ns ns ns 1 1 1 2 2 225 ns ns ns ns ns 1 .1 1 2 2 230 ns ns ns ns ns 1 1 1 2 2 4 TCl TCH Clock low Time 82C08-20 82C08-16 82C08-12 82C08-10 82C08-8 Clock High Time 82C08-20 82C08-16 82C08-12 82C08-10 82C08-8 4 TRTVCl Reset to ClK J, Setup 5 TRTH 6 TPGVRTl 7 50 62.5 250 250 100 125 500 500 10 15 230 230 83.3 20 44 TClCLl2-12 17 20 230 230 25 44 TClCl/3+2 40 65 ns Reset Pulse Width 4TClCl 4TClCl ns PCTl, POI, RFRO to RESET J, Setup 125 167 ns TRTlPGX PCTl, RFRO to RESET J, Hold 10 10 ns 8 TClPC PClK from ClK J, Delay 9 TPDVCl POI to ClK J, Setup 60 85 ns 10 TClPDX POI to ClK J, Hold 40 55 ns 45 55 5 ns 6 SYNCHRONOUS /LP PORT INTERFACE 11 TPEVCl PE to ClK J, Setup 30 40 12 TKVCl RD, WR, PE, PCTl to ClK J, Setup 20 25 ns 13 TClKX RD, WR, PE, PCTl to ClKJ,Hold 0 0 ns 14 TKVCH RD, WR, PCTl to ClK t Setup 20 30 ns 6-142 2 1 2 intJ 82C08 A.C. CHARACTERISTICS (Continued) Ref Symbol Parameter 82C08·20, 82C08-16 82C08-10, 82C08·8 Min Max 82C08-12 Min Units Notes 8.9 Max ASYNCHRONOUS~PPORTINTERFACE 15 TRWVCl RD, WRto ClKJ,Setup 20 30 ns 16 TRWl RD, WR Pulse Width 2TClCl+30 2TClCl+40 ns 17 TRWlPEV PEfromRD, WRJ, Delay CFS=1 CFS=O 18 TRWlPEX PEto RD, WRJ, Hold TClCl-20 TClCl-30 2TClCl+30 19 TRWlPTV PCTl from RD, WRJ, Delay 20 TRWlPTX PCTl to RD, WRJ, Hold 2TClCl+40 TClCl-30 2TClCl+30 21 TRWlPTV PCTl from RD, WRJ, Delay 22 TRWlPTX PCTl toRD, WRJ, Hold TClCl-30 1 2 ns TClCl-40 2TClCl+40 2TClCl-20 ns ns 2TClCl-30 ns 2 ns 2 ns 1 3TClCl+30 3TClCl+40 ns 1 45 + tASR 55 + tASR ns 2 RAM INTERFACE 23 TAVCl Al,AH, BSto ClK J, Set-up 82C08-20 82C08-16 24 TCLAX Al,AH, BSto ClKJ, Hold 25 TClRSl RASJ, from ClKJ, Delay 26 TRCD 27 TClRSH 51 +tASR 45 + tASR ns ns 0 25 35 60 RAS to CAS Delay CFS=1 TClCl-25 CFS=O 30 CFS=O TClCl/2-30 CFS=O 60 RASt from ClKJ, Delay ns 0 35 60 TClCl-30 50 60 6-143 60 60 ns ns ns 1 2 24 ns ns ns ns 1,14 23 2,11,14 2,12,14 ns ns 24 82C08 A.C. CHARACTERISTICS (Continued) Ret Symbol Parameter 82C08-20, 82C08-16 8208-10, 82C08-8 Min Max 82C08-12 Min Units Notes ns ns ns 13,15 13,15 2, 11, 15 23 Max RAM INTERFACE (Continued) 28 TRAH 82C08-20 82C08-16 CFS=O CFS=O 29 TASR RowAO RAS,j, Setup 30 TASC ColumnAOto CAS,j, Setup CFS=1 CFS=O CFS=O 18 TCLCL/2-13 TCLCLl4-10 20 10,16 2 5 5 31 TCAH Column AOto CAS Hold 32 TCLCSL CAS,j, from CLK,j, Delay CFS=O CFS=O CFS=O CFS=1 TCLCLl4+30 50 CASt from CLK,j, Delay TCLCLl4 34 TCLCSH 35 TCLWL WE,j, from CLK,j, Delay 36 TCLWH WEt from CLK,j,Delay CFS=O CFS=1 CFS=O TCLCLl2-15 5 ns ns ns 1,13,17,18 2,13,17,18 23 ns ns ns ns 2,26 23 2,27 1 '22 (See DRAM Interface Tables) TCLCLl1.8 + 53 100 35 35 40 40 50 60 ns ns 35 45 ns TCLCLl1.8 + 53 35 100 45 ns ns TCLCL +50 3.2 TCLCL/4+30 50 37 TCLTKL XACK,j, from CLK,j, Delay 35 45 ns 38 TRWLTKH XACK t from RD t , WRt Delay 50 55 ns 39 TCLAKL MCK,j, from CLK,j, Delay 35 35 ns 40 TCLAKH AACKt from CLK,j, Delay 50 60 ns 6-144 2 1 23 intJ 82C08 A.C. CHARACTERISTICS (Continued) Ref Parameter Symbol 82COB·20, 82COB·16 82C08-10, B2C08-B Min Max B2C08·12 Units Min Notes Max REFRESH REQUEST 41 TRFVCl RFRO to ClK.l,. Setup 20 30 ns 42 TClRFX RFRO to ClK.l,. Hold 10 10 ns 43 TFRFH Failsafe RFRO Pulse Width TClCl + 30 TClCl + 50 ns 19 44 TRFXCl Single RFRO Inactive to ClK.l,. Setup 20 30 ns 20 45 TBRFH Burst RFRO Pulse Width 2TClCl + 30 2TClCl + 50 ns 19 ns 24,25 46 TPDVCl POD Setup Time 20 30 47 TPDHRFX RFRO Valid after POD Active 4TClCl + 20 4TClCl + 30 4B RFVPDH RFRO Setup Time to POD Active 0 0 24 The following RC loading is assumed: AOO-B R = 220 C = 200 pF RASo_lo CASO_l R = 390 C = 150 pF AACK, WE/PClK R = 330 C = 50 pF NOTES: 1. Specification when programmed in the Fast Cycle processor mode (iAPX 2B6 mode). B2COB-20, -16, -12 only. 2. Specification when programmed in the Slow Cycle processor mode (iAPX 1B6 mode). B2COB-B, -6 only. 3. tR and tF are referenced from the 3.5V and 1.0V levels. 4. RESET is internally synchronized to ClK. Hence a set-up time is required only to guarantee its recognition at a particular clock edge. 5. The first programming bit (PDO) is also sampl.ed by RESET gOing low. 6. TClPDX is guaranteed if programming data is shifted using PClK. B. TRWVCl is not required for an asynchronous command except to guarantee its recognition at a particular clock edge. 9. Valid when programmed in either Fast or Slow Cycle mode. 10. tASR is a user specified parameter and its value should be added accordingly to TAVCL. 11. When programmed in Slow Cycle mode and 125 ns ,;;; TClCl < 200 ns. 12. Wh.en programmed in Slow Cycle mode and 200 ns ,;;; TClCL. 13. Specification for Test load conditions. 14. tRCD (actual) = tRCD (specification) +0.06 (~CRAS) - 0.06{~CCAS) where ~C = C (test load) - C (actual) inpF. (These are first order approximations.) 15. tRAH (actual) = tRAH (specification) + 0.06 (~CRAS) - 0.022 (~CAO) where ~C = C (test load) - C (actual) in pF. (These are first order approximations.) 16. tASR (actual) = tASR (specification) +0.06 (~CAO) - 0.025 (~CRAS) where ~C = C (test load) - C (actual) in pF. (These are first order approximations.) 1.7. tASC (actual) = tASC (speCification) +0.06 (~CAO) - 0.025 (~CCAS) where ~C (test load) - C (actual) in pF. (These are first order approximations.) . 1B. tASC is a function of clock frequency and thus varies with changes in frequency. A minimum value is specified. 19. TFRFH and TBRFH pertain to asynchronous operation only. 20. Single RFRO should be supplied synchronously to avoid burst refresh. 22. CFS = 0, synchronous mode, Read cycle. 23. For 10 MHz Slow Cycle only. 24. Power down mode. 25. POD is internally synchronized. A setup time is required only to guarantee its recognition at a particular clock edge. 26, Slow Cycle Read only. 27. Slow Cycle Write only. 6-145 intJ 82C08 WAVEFORMS CLOCK AND PROGRAMMING TIMINGS ClK ,RESET _n*--"'"'\ --~Fiiil_r=;;--- PCTl ® REFRQ PDI PD~ WE/PClK @ PDl -==.J----,~/?--------..:.....~1®-8---®;;..8~ 231357-26' RAM WARM-UP CYCLES '~~"~~f-'-":""-----~~'-_~ .Jr RASC/ WE .-J i ____ I' h'-. 51 PROGRAMMING lAST RAM WARM-UP FIRST RAM WARM·UP CYCLE RESET ~--~--~-----------------~-----------~ 231357-27 NOTE: The present example assumes a RAS four clocks long. REFRESH REQUEST TIMING Cl.K ==---"""'\1 REQUEST == _______ SINGLE BURST ==~ ..J ------L....l 1 I I I POD AFRO t-+----- f. , I -+------>c 1 ==><--+-1 4• 1 I 231357-28 6-146 infef 82C08 WAVEFORMS (Continued) SYNCHRONOUS PORT INTERFACE COMMAND MODEl FAST CYCLE 1m, WI" PE" COMMAND MODEl FAST CYCLE PCTL (INHIBIT) COMMAND MODEl FAST CYCLE INTERNAL INHIBIT --+--+-_ --+--1----""+---------------- SLOW CYCLE RD,WR ~OWCYCLE SLOW CYCLE PCTL RAS--_ _, 231357-29 NOTE: Actual transitions are programmable. Refer to Tables 8 and 9. 6-147 inter 82C08 WAVEFORMS (Continued) ASYNCHRONOUS PORT INTERFACE ClK FAST/SLOW CYCLE RD,WR ~--------~--r-------~~ ~----------~+--------r~ FAST/SLOW CYCLE _--1"""-"';;;':;"'" PE ~-------------+~I------+SLOW CYCLE PCTl ~------------~---QDI---r--------~ ~~---~I----~~ FAST CYCLE PCTl (INHIBIT) --------------~~----~----~----------- r------------------------ FAST CYCLE INTERNAL INHIBIT I m ---------""\. 231357-30 6-148 82C08 WAVEFORMS (Continued) RAM INTERFACE TIMING CLOCK 0 ClK COMMAND --~----~------------'-~----------~----~-------f AlO - Ala AHa - AHa BS o- BS, RAS --------~--~I ADO - AO a _________p ________~......+_+--~'\.------------\_------\_-----------@)~ ~-I------ CAS --------~------......;;;....,--_i_I WE XACK AACK -, @~ -@r 231357-31 NOTE: Actual transitions are programmable. See Tables 8 and 9. 6-149 8207 8207 User's Manual AUGUST 1983 NOVEMBER 1983 6-150 ORDER NUMBER: 230822-002 8207 CHAPTER 1 INTRODUCTION This guide is a supplement to the 8207 Data Sheet 1 and is intended as a design aid and not a standalone description of the 8207. The reader should already have read and have a copy of the 8207 Data Sheet, 8206 Error Detection and Correction Unit Data Sheet (EDCU), a microprocessor Data Sheet, or a Multibus bus specification for interfacing to the 8207, and a dynamic RAM Data Sheet2 . The Intel 8207 Advanced Dynamic RAM Controller is a high performance, highly integrated device designed to interface 16k, 64k, and 256k dynamic RAMS to Intel microprocessors. The 8207, with the 8206, provides complete control for memory initialization, error correction, and automatic error scrubbing. The 8207 has several speed selected versions. The -16 and -12 parts are for clock speeds up to 16MHz and 12 MHz in "fast cycle" configurations, and up to 8 MHz and 6 MHz in "slow cycle" configurations. The -8 and -6 parts can only be used in slow cycle configurations and as a result have some relaxed A.C. timings. NOTE: (I) The most current Data Sheet is dated July, 1984 (2) All RAM cycle timings and references are based on Intel's 2164A Dynamic RAMs, APR '82 6-151 230822-002 8207 CHAPTER 2 PROGRAMMING THE 8207 The many configurations of bus structures, RAM speeds, and system requirements that the 8207 supports require the 8207 to be programmable. The 8207 will modify its outputs to provide the best performance possible. The 8207 must be told what type of interface the memory commands will arrive on, what type of RAM (speed, refresh rate) is being used, the clock rate, and others. The 8207 uses two means to be informed of the user's requirements. It reads in a 16 bit serial program word and examines the logic states on several input pins. The pins that are sampled for a logic level give the user options on the types of refresh and memory command input timing. Input Pin Options The three input pins that configure part of the 8207 are: PCTLA, PCTLB, and REFRQ. Let's examine the options in refresh types the REFRQ pin provides. Refresh types: The 8207 gives the user a choice of the following refresh types. 1) Internal Refresh: All refresh cycles are generated internally programmable time. based on an internal 2) External Refresh with Failsafe: If the external logic does not generate a refresh cycle within the programmed period, the 8207 will. 3) External Refresh - No Failsafe or No Refresh; All refresh cycles are generated at times by the user. This is for systems that cannot tolerate the random delay imposed by refresh (i.e. graphics memory). 4) Burst Refresh: The 8207 generates up to 128 consecutive refresh cycles and must be requested by external logic. Memory requests will be performed when the burst is completed. The 8207 examines the state of the REFRQ pin when RESET goes inactive. This timing is shown in the "Clock and Programming Timings" waveforms in the Data Sheet. If REFRQ is sampled active by the falling edge of RESET, the 8207's internal timer is enabled. The timer's period is determined by the CIO, Cll, and PLS bits in the program word. External refresh cycles are generated by a low to high transition on the REFRQ input. This transition, besides generating a refresh cycle, also resets the internal timer to zero. Simply tie REFRQ to Vcc if internal refresh is required. If REFRQ is seen low at the falling edge of RESET, the internal timer is deactivated. All refresh cycles must either be done by external logic or by accessing all RAM (internal) rows within a 2 ms period. Once the no failsafe option is programmed, the 8207 will generate a burst of up to 128 refresh cycles when the REFRQ input goes from low to high and sampled high for two consecutive clock edges. These cycles are internally counted and the 8207 stops when the refresh address counter reaches the value XXI1111112 (X = don't care; see Refresh Counter section). If prior to the burst request the counter is at XX 11111102 then only 2 refresh cycles would be generated. 6-152 230822-002 inter 8207 For a single refresh cycle to be generated via external logic, the REFRQ input will have to go from low to high and then sample high by a falling 8207 clock edge. Since external refresh requests typically arrive asynchronously with respect to the 8207's clock, this requires the REFRQ to be synchronized to the 8207 clock when programmed in the failsafe mode. This is to ensure that the request is seen for one clock - no more, no less. If no external synchronization is performed, then the 8207 could do random burst cycles. Processor Interface Options: The PCTLA, PCTLB input pins will program the 8207 to accept either the standard demultiplexed RD and WR inputs, or to directly decode the status outputs of Intel's iAPX86, 88 family of microprocessors. The state definitions of the status lines and their timings, relative to the processor clock, differ for the 8086 family and the iAPX286 processor. Table 1 illustrates how the 8207 interprets these inputs after the PCTL pins are programmed. If PCTL is seen high, as RESET goes inactive, and 8086 status interface is enabled. The commands arriving at the 8207 are sampled by a rising clock edge. When PCTL is low, the 80286 status and Multibus command interface is selected. These commands are sampled by the 8207 by a falling clock edge. More information on interfacing to processors is contained in the Microprocessor Interface section. 8207 Response Table 1. Status Coding of 8086, 80186 and 80286 8207 Command Status Code S2 S1 SO 0 0 0 Interrupt Interrupt 0 0 1 I/O Read I/O Read 0 0 1 1 1 0 0 1 0 Function Function 8086/80186 I/O Write Halt 80286 PCTL I/O Write Idle RD WR 8086 Status Interface Command Interface 0 0 0 Ignore Ignore 0 0 1 Ignore Read 0 1 0 Ignore Write 0 1 1 Ignore Ignore 1 0 0 Read Ignore Inhibit Instruction Fetch Halt Memory Read Memory Read 1 0 1 Read 0 1 1 1 0 Memory Write Memory Write 1 1 0 Write Inhibit 1 1 1 Idle Idle 1 1 1 Ignore Ignore 1 Programming Word The 8207 requires more information to operate in a wide variety of systems. The 8207 alters its timings and pin functions to operate with the 8206 ECC chip. The programming options allow the designer to use asynchronous or synchronous buses, various clock rates, various speeds and types of RAM, and others. This is detailed in Table 2. This data is supplied to the 8207 over the PDI input pin. There are two methods of supplying this data. One is to strap the PDI pin high or low with the subsequent restrictions on your system. Table 6-153 230822-002 8207 3 shows the required system configuration. Note that your only option when strapping this pin high or low is error correction or not. If any other configurations are required, then the programming data will have to be supplied by one or two 74LS165 type shift registers. Note that the sense of the bits in the program word change between ECC and non-ECC configurations. Table 2a. Non-ECC Mode Program Data Word I 0 PD~ PD8 PD7 PD15 I o ITM1 IPPR I FFS I EXT I PLS I CIO I CI1 IRB1 I RBO IRFS ICFS I SB Program Data Bit Name SA I o Polarity/Function PD~ ECC ECC = 0 For non-ECC mode PD1 SA SA = 0 SA = 1 Port A is synchronous Port A is asynchronous PD2 SB SB = 0 SB = 1 Port B is asynchronous Port B is synchronous PD3 CFS CFS = 0 CFS = 1 Fast-cycle iAPX 286 mode Slow-cycle iAPX 86 mode PD4 RFS RFS = 0 RFS = 1 Fast RAM Slow RAM PD5 PD6 RBO RB1 RAM bank occupancy See Table 4 PD7 PD8 Count interval bit 1: see Table 6 in 8207 data sheet Co.unt interval bit 0: see Table 6 in 8207 data sheet PD9 CI1 CIO j5[S PLS = 0 PLS = 1 Long refresh period Short refresh period PD10 EXT EXT = 0 EXT = 1 Not extended Extended PD11 FFS FFS = 0 FFS = 1 Fast CPU frequency Slow CPU frequency PD12 PPR PPFi = 0 PPR = 1 Most recently used port priority Port A preferred priority PD13 TM1 TM1 = 0 TM1 = 1 Test mode 1 off Test mode 1 enabled PD14 0 Reserved must be zero PD15 0 Reserved must be zero 6-154 , 230622-002 8207 Table 2b ECC Mode Program Data Word PD15 PD8 PD7 ITM21 RB1 IRBO IPPR IFFS IEXT IPLS I CIO I CI1 I XB XA IRFS ICFS I SB Program Data Bit Name PDO ECC ECC = 1 ECC mode PD1 SA SA = 0 SA = 1 Port A is asynchronous (late AACK) Port A is synchronous (early AACK) PD2 SB SB = 0 SB = 1 Port B is synchronous (early AACK) Port B is asynchronous (late AACK) PD3 CFS CFS = 0 CFS = 1 Slow-cycle iAPX 86 mode Fast-cycle iAPX 286 mode PD4 RFS RFS = 0 RFS = 1 Slow RAM Fast RAM PD5 XA XA = 0 XA = 1 Multibus-compatible XACKA AACKA not multibus-compatible PD6 XB XB = 0 XB = 1 AACKB not multibus-compatible Multibus-compatible XACKB PD7 PD8 CI1 CIO Count interval bit 1: see Table 6 in 8207 data sheet Count interval bit 0: see Table 6 in 8207 data sheet PD9 PLS PLS = 0 PLS = 1 Short refresh period Long refresh period PD10 EXT EXT EXT = 0 EXT = 1 Master and slave EDCU Master EDCU only PD11 FFS FFS = 0 FFS = 1 -Slow CPU frequency Fast CPU frequency PD12 PPR PPR = 0 PPR = 1 Port A preferred priority Most recently used port priority PD13 PD14 RBO RB1 RAM bank occupancy See Table 4 PD15 TM2 TM2 = 0 TM2 = 1 SA I PDO 1 I Polarity/Function Test mode 2 enabled Test mode 2 off Table 3. 8207 Default Programming Port A is Synchronous-has early AACK Port B is Asychronous-has late AACK Fast RAM Refresh Interval uses 236 clocks 128 Row refresh in 2 ms; 256 Row refresh in 4 ms Fast Processor Clock Frequency (16 MHz) "Most Recently Used" Priority Scheme 4 RAM banks occupied 6-155 230822-002 8207 Reset If Port A is changed to an asynchronous interface (via the SA bit), then one of two precautions must be taken. Either a differentiated reset must be provided, or else software must not access the 8207 controller RAM for a short period. The 8207 is either adding or deleting internal synchronizing circuits. If a command is received during this changing, the 8207 may not perform properly. This is required only if Port A is changed to asynchronous, or if Port B is changed to synchronous. Several of the bits in the program word determine a particular configuration of the 8207 (reference Tables 10, 11 and the 8207 Data Sheet). The bits are: CFS, CLOCK fast or slow; RFS, RAM access time fast or slow (fast refers to 100 ns - slow is everything greater); and EXT, for memory data word widths greater than 16 (22) bits. Generally speaking, CO is the fastest configuration at clock frequencies up to 16 MHz, both in the ECC or non-ECC charts. 'C3' is the fastest for 8 MHz clocks in non-ECC mode, and 'C4' is the fastest configuration when using ECC. Take, for example, a 16 MHz 8207 clock with no error correction, a 16 bit word, and 150 ns (slow) dynamic RAMs. Table 10, in the 8207 data sheet, is used to arrive at the configuration "CI."The Timing chart Table 12 in the 8207 Data Sheet is then used to determine which clock edge to reference all timings from. The Waveforms diagrams then are used to determine the delay from the clock edge. 6-156 230822-002 8207 CHAPTER 3 'RAM INTERFACE The 8207 takes the memory addresses from the microprocessor bus and multiplexes them into row and column addresses as required by dynamic RAMs. The only hardware requirement when interfacing the 8207 to dynamic RAM are series resistors on all the RAM outputs of the 8207, and proper layout of the traces (see Intel's RAM Data Sheets or the Memory Design Handbook). This section mainly details the effects and requirements of input signals to the 8207 on the RAM array. The 8207 contains an internal address counter used for refresh and error scrubbing (when using the 8206 EDCU) cycles. The 8207 has 18 address inputs (AILO-AIL8 and AIHO-AIH8) which are multiplexed to form 9 address outputs (AOO-A08). There are also 2 bank select (BSO, BSl) inputs for up to 4 banks of RAM. The Bank Select inputs are decoded internally to generate RAS and CAS outputs. Refresh Interval The 8207 supports four different refresh techniques as described in the Refresh Options section. In addition, the rate at which refresh cycles are performed is programmable. This is necessary because the refresh period is generated from the CLK input, which may vary over a wide range of frequencies. Programming the Cycle Fast/Slow (CFS) and Frequency Fast/Slow (FFS) bits automatically reprograms the refresh timer to generate the correct refresh interval for a clock frequency of 16, 10, 8, or 5 MHz (CFS, FFS = 11, 10,01, and 00, respectively). For clock frequencies between those, Count Interval (Cll, CIO) programming bits allow "fine tuning" of the refresh interval. Refresh will always be done often enough to satisfy the RAM's requirements without doing refresh more often than needed and wasting memory bandwidth for all clock frequencies. Refresh Counter The internal refresh address counter of the 8207 contains 20 bits as organized in Figure 1. 17 16 15 14 13 12 11 Col addr 10 9 8 7 6 5 4 3 2 o Rowaddr Figure 1. 8207 Refresh Address Counter' In non-ECC mode, the refresh address counter does not count beyond bit 8. For standard RAMs, this will refresh 128 rows every 2 ms or 256 rows every 4 ms. In ECC mode, the 8207 automatically checks the RAM for errors during refresh. This requires it to access each of the possible 220 words of memory. The 8207 does not delete any of these bits when used with 16k and 64k dynamic RAMs. Each column would be scrubbed 4 times with 16k RAMs, and twice with 64 RAMs. This will have no detrimental effect on reliability. Banks of RAM that are not occupied, as indicated to the 8207 by the RBO, RBI programming bits, will not be scrubbed. Bank Selects BSO, BS1; RBO, RB1 The 8207 is designed to drive up to 88 RAMs in various configurations. The 8207 takes 2 inputs, BSO, BSl, and decodes them based on 2 programming bits, RBO, RBI, to generate the required RAS/CAS strobes. Additionally, the 8207 will always recognize (not programmable) whether an access is made to the same RAM bank or to a different bank. The 8207 will interleave the accesses resulting in improved performance. 6-157 230822-002 8207 RAS and CAS Reallocation The 8207's address lines are designed to drive up to 88 RAMs directly (through impedance matching resistors). The 4 RAS and CAS outputs drive up to 22 RAMs per bank (16 data plus 6 check bits with the 8206). Under these conditions, the 8207 will meet all RAM timing requirements. See Figure 2 for an example. - 8207 RASO CASO 8 BITS 8 BITS RAS1 CAS1 8 BITS 8 BITS 8 BITS 8 BITS 8 BITS 8 BITS AOO·8 RAS2 CAS2 BSO BS1 RAS3 CiiS:i 'ECC OPTIONAL Figure 2. 8207 4 RAM Bank Configuration The 8207 can accommodate other configurations like a 32 bit error corrected memory system. Each bank would have 39 RAMs (32 + 7 check bits) with the total number of RAMs equal to 78. This is within the address drivers capability, but the 39 RAMs per bank exceeds the RAS and CAS drivers limits. The loading of the RAS/CAS drivers should not exceed 22 RAMs per bank, otherwise critical row, column address setup, and hold times would be violated. In order to prevent these critical timings being violated, the 8207 will re-allocate the RAS and CAS drivers based on the RBO, RBI programming bits (see Table 4). If the RBO, RBI bits are programmed for 2 banks, the 8207 will operate RASO and RASI as a pair along with RAS2 and ~, CASU and CASI, and CAS2 and CAS3. Now the address drivers would be loaded by 78 RAMs and the RAS/CAS drivers by 20 RAMs. This relative loading is almost identical to the first case of four banks of 22 RAMs each. Drive reallocation allows a wide range of memory configurations to be used and still maintain optimal memory timings. Figure 3 shows a 32 bit non-error corrected configuration. These programming bits do not help to qualify RAM cycles. Their purpose is to'reallocate RAS/CAS drivers. For example, if there is one bank of RAM and the bank select inputs (BSO, BSI) select any other bank and no provision is made to deselect the 8207 (via PEl, the 8207 will do a RAM cycle and issue an acknowledge. This happens irregardless of the RBO, RBI programmed value. See the Optional RAM Bank's section to provide for this. 6-158 230822-002 8207 Table 4. RAM Bank Selection Decoding and Word Expansion Program . Bits RB1 RBO Bank Input B1 BO RASICAS Pair Allocation 0 0 0 0 RASO-3, CASO_3 to Bank 0 0 0 0 1 Illegal Bank Input 0 0 1 0 Illegal Bank Input 0 0 1 1 Illegal Bank Input 0 1 0 0 ~0,1' CASO,1 to Bank 0 0 1 0 1 RAS2,3, CAS2,3 to Bank 1 0 1 1 0 Illegal Bank Input 0 1 1 1 Illegal Bank Input 1 0 0 0 RASO, CASO to Bank 0 1 0 0 1 RAS1, CAS1 to Bank 1 1 0 1 0 RAS2, CAS2 to Bank 2 1 0 1 1 Illegal Bank Input . 1 1 0 0 RASO, CASO to Bank 0 1 1 0 1 RAS1, CAS1 to Bank 1 1 1 1 0 RAS2, CAS2 to Bank 2 1 1 1 1 RAS3, CAS3 to Bank 3 RAS1 CAS1 RASO CASO ~ ~ ~ ~ 16 BITS I L-=:f 16 BITS I 16 BITS I 16 BITS I AOO-8 RAS2 CAS2 C>- ~ r- ;- S BSO BS1 RAS3 CAS3 8207 Figure 3. 8207 2 RAM Bank Configuration 6-159 230822-002 inter 8207 Scrubbing An additional function of the RBO, RBI bits, besides RAS/CAS allocation, is to inform the 8207 of how many banks are physically present. The 8207 will, during the refresh cycle, read data from a location and check to see that data and check bits are correct. If there is an error, the 8207 lengthens the refresh cycle and writes the corrected data back into RAM. Scrubbing the entire memory greatly reduces the chance of an uncorrectable error occurring. See the Refresh section for more dj!tail on scrubbbing. c. Refresh Cycles The 8207 performs RAS only refresh cycles in non-ECC systems. It outputs all 8207 control signals except for CAS and acknowledges. The real delay in a system due to refresh would be a fraction of that value l . The length of the refresh cycle is always 2tRP + tRAS, and varies based upon the programmed 8207 configuration. In error-corrected systems, the refresh cycle is actually a read cycle. The 8207 outputs a row address, then all RAS outputs go active. Next, a column address is output and then CAS. The CAS output is based upon the RBO, RBI allocation bits. Figure 4a shows the general timing for a four bank system, and Figure 4b shows a two bank system. ROW ROW ~~---------------------CASO \L-____ CAS1-3 ~~--------------------\\-.-.,...---- CASO,1 CAS2,3 4 BANKS 2 BANKS Figure 4. Refresh Cycles for Error Corrected Systems (1) Measurements have shown a delay of 2-40/0 on program execution time compared to programs running without refresh. 6-160 230822-002 8207 The 8207 sends the read out word through the 8206 EDCU to check for any errors. If no errors, the refresh cycle ends. If an error is discovered, the 8207 lengthens the cycle. An error is determined if the ERROR output of the 8206 is seen active at the same edge that the 8207 issues the R/W output. Th~ cycle is then lengthened to a RMW cycle. If the error was correctable, the corrected data is written back to the location it was read from. But, if the data is uncorrectable, the cycle is still lengthened to a RMW, but no write pulse is issued. To aid in stabilizing the RAM output data and the Error flag, pullup resistors of 10k ohms on the data out lines are recommended. Scrubbing removes soft errors that may accumulate until a double-bit error occurs, which would halt the system. Hard single-bit failures will not stop the system, but could slow it down. This is because read and refresh cycles lengthen to correct the data. For large RAM arrays some form of error logging or diagnostics should be considered. Interleavi n9 The term "interleaving" is often used to refer to overlapping the cycle times of multiple banks (or boards or systems) of RAMs. This has the advantage of using relatively slow cycle time banks to achieve a faster perceived cycle time at the processing unit. The drawbacks of interleaving are more logic to handle the necessary control and, for maximum performance, the program should execute sequentially through the addresses. Dynamic RAM cycles consist of 2 parts - the RAS active time (tRAS in Dynamic RAM Data Sheets) and precharge time (tRP). The sum of these two times are roughly equal to the cycle time of the RAM. The 8207 determines how long these two periods are, based on the configuration the user picked (via the programming bits). Bank interleaving, as used by the 8207, is slightly different than the previous definition. The 8207 will overlap the precharge time of one bank with the access time of another bank. In either case, the advantage is the effective cycle time is reduced without having to use faster RAMs. For interleaving to take place. there must be more than 1 bank of RAM connected to the 8207. Interleaving is not practical with 3 banks of RAM because 3 is not a power of 2 (the 2 bank inputs BSO, BS1). So, interleaving works only for 2 or 4 banks of RAM. Note that it is easy enough to use three banks of RAM where the bank select inputs are connected to the highest-order address line. For instance, if three banks of 2164s are used in an 8086 system, and located at address OH, bank selects BSO and BS1 would be connected to microprocessor addresses A17 and A18, respectively. Banks 0-2 would be accessed in the address ranges OH - FFFFH, 10000H - 1FFFFH, and 20000H - 2FFFFH, respectively. In this case, consecutive addresses are almost always in the same bank and very little interleaving can take place. Figure 5 shows the effects on the performance of the processor with and without interleaving. In both examples, consecutive accesses to the same bank will add 1 wait state to the second access, but no wait states to consecutive accesses to different banks.lrregardless of the 8207 configuration, there always be a minimum 1 wait state added without interleaving. Therefore, interleaving is very highly recommended! will Interleaving is accomplished by connecting the 8207's BSO, BSI inputs to the microprocessor's low order word address lines. Each consecutive address is then located in a different bank of RAM. About 90"10 of memory accesses are sequential, so interleaving will occur about 90% of the time in a single port system. In a dual port system, the advantages of interleaving are a function of the number of banks of memory. Since the memory accesses of the two ports are presumably independent, and both ports are continuously accessing memory, the 8207 arbiter will tend to interleave accesses from each port (Le., Port A, Port 6-161 230822-002 inter 8207 TS 80286 TS' TC TC TS TC I" 16 MHz CLOCK 8207 I 0 2 I 3 I \ RASO 4 0 I 5 0 2 1 l_tRP DELAY 1 3 r ..\ \ I \ RAS1 3 2 CONFIGURATION CO-NO ECC (READ) T1 80186 8 MHz CLOCK 8207 I T2 I 0 RASO \ T3 I T4 I T1 2 I 3 I 4 0 T2 1 I 0 1 /--D~~Y=4 \ RAS1 T3 1 2 TW T4 T4 T1 2 3 3 4 T1 T2 I 4 / I CONFIGURATION C3-NO ECC (READ) Figure 5. Processor Performance With and Without Interleaving B, Port A, Port B, ... ). If there are two banks of RAM interleaving will occur 50% of the time and, if there are four banks of RAM, interleaving will take place 75% of the timel. To the extent that a single port generates a majority of memory cycles, interleaving efficiency will approach 900,70 as described in the previous paragraph. (1) Don't get confused here. The paragraph is talking about interleaving memory requests from both ports, and their probability of accessing one of the other banks of RAM where tRP has been satisfied. The 8207 will leave the RAM precharge time out if consecutive accesses go to different banks. The 8207 RAM timing logic does not care which port requests a RAM cycle. requests a RAM cycle. Optional RAM Banks' Many users allow various RAM array sizes for customer options and future growth. Some care must be taken during the design to allow for this. Three items should be considered to permit optional RAM banks. The first item is tI!Uotal RAM size. The 8207 starts a memory cycle based only upon a valid status or command and PE active. So some logic will be required to deselect the 8207 (via PEl when the addressed location does not exist within the current memory size. A 7485 type magnitude comparator . works well. The second item to consider is the BSO, BSl inputs. With one bank of RAM these inputs are tied to ground. Four banks of RAM require two address inputs. So, if the design ever needs four banks 6-162 230822-002 inter 8207 of RAM, then the BSO, BSI inputs must be connected to address lines. Selecting a non-existant RAM bank is illegal. Figure 6 shows a non-interleaved method. A19 A18 "7----_---------------1 BSl .->---~-4------------_4 BSO A +5 f ~B~------~ ~ 8207 7485 Figure 6. Non-Interleaved 8207 Selection Circuit With designs using interleaving, the least significant word address lines are connected to the BSO, BSI inputs. With two banks of RAM, Al from the Intel processor is connected to BSO. A2 is connected to BSl, but not allowed to function until four banks are present. However, A2 must still be used since addresses increase sequentially. Two possible ways of implementing this are shown in Figure 7 below. 240 A19 AH7 A18 AL7 A2 BSl Al BSO A19 AH7 8207 8207 A2 BSl t Al PE. A18 F 7485 BSjiJ PE A A>B B 7485 Figure 7. Interleaved 8207 Selection Circuits 6-163 230822-002 inter 8207 The final consideration is for the RAS/CAS outputs. Remember that when the RBO, RBI bits are programmed for two banks, then RASQ, 1 operates in tandem (non-ECC mode/ECC mode - the CAS outputs also work in tandem). Figure 8 shows the proper layout. , 2 RAM BANK RASO/CASO 2 RAS2ICAS2 OPTIONAL BANK RAS1/CASl OPTIONAL BANK 8207 RAS3/CAS3 OPTIONAL BANK Figure 8. RAM Bank Layout Write Enables - Byte Marks The write enable supplied by the 8207 cannot drive the RAM array directly. It is intended to be NAND with the processor supplied byte marks in a non-ECC system. In error-corrected systems, the write enable output should be inverted before being used by RAMs. Only full word read/writes are allowed in ECC systems. The changing of byte data occurs in the 8206 EDCU. For single and dual port systems, the byte mark data (AO, BHE) must be latched. The 8207 can (and will) change the input addresses midway through a RAM cycle.· Memory Warm-up and Initialization After programming, the 8207 performs 8 RAM warm-up cycles. The warm-up cycles are to prepare the RAMs for proper operation. If the 8207 is configured for ECC, it will then prewrite zeros into the entire array. All RAS outPut~ are driven active for these cycles, once every 32 clock periods. The prewrite cycles are equivalent to write cycles, except all RAS and CAS will go active, data is generated by the 8206, and the address is generated by the 8207. RAM Cycles/Timings Tables 12 and 13 of the 8207 Data Sheet show on what clock edge each of the 8207 outputs are generated. This, together with the timing waveforms and A.C. parameters, allows the user to calculate the timings of the 8207 for each of its configurations. To make the job easier, Tables 14-18 of the 8207 Data Sheet precalculate dynamic RAM timings for each 8207 configuration and type of cycle. All that is required is to plug in numerical values for the 8207 parameters. 6-164 230822-002 inter 8207 Write Cycles The 8207 always issues WE after CAS has gone valid. These types of cycles are known as "late writes." The 8207 does this primarily to interface to the iAPX286 processor bus timings. Late writes require separate data in and data out traces to the RAM array, plus the additional drivers. Data Latches The 8207 is designed to meet data setup and hold times for the iAPX86 family processors when using a synchronous status interface (see Microprocessor Interface section). Other types of interfaces will require external data latches. This is because the CAS pulse is a fixed length - the user has no control (besides programming options) over lengthening CAS. When CAS goes inactive, data out of the RAMs will disappear. Asynchronous interfaces should use XACK or LAACK to latch the data. 6-165 230822-002 I 8207 CHAPTER 4 MICROPROCESSOR INTERFACES The 8207 is designed to be directly compatible with all Intel iAPX86, 186, 188, and 286 processors. For maximum per'formance, the 8207 will directly decode the status lines and operate off of the processor's clock. Additionally, the 8207 interfaces easily to other bus types that support demultiplexed address and data with separate read and write strobes. Bus Interfaces The 8207 easily supports either an asynchronous. or synchronous command timing. The command timing can also be adjusted for various processors via the PCTL pin.' MEMORY COMMANDS There are four inputs for each port of the 8207 that initiate a memory cycle. The input pins are Wb RD, PCTL, and PE. The first three inputs connect directly to the iAPX 86, 88, 186, 188 SO-S2 outputs, respectively. For the 80286, the same connections are used except that PCTL is tied to ground. In all configurations PE is decoded from the address bus. Multibus type commands use the same. input setup as the 80286. COMMAND/STATUS INTERFACE The status interface for the 80186 and the 80286 differ both in timing and meaning. The 8207 can be optimized for either processor by programming the PCTL input pin at RESET time. S2 in 80186 systems, connects directly to PCTL. When the processor is reset it drives S2 high for one clock, then tristates it. A pullup resistor to +5 will program the PCTL input for the 80186 status interface when RESET goes inactive. A pullup is required only if no component has this pullup internally. To optimize the 8207 for the 80286 interface, PCTL is tied to ground and not used in 80286 systems. Multibus commands are similar in meaning to the 80286 status interface, and are programmed the same way. In Multibus type systems, PCTL can be used as an inhibit to allow shadow memory. PCTL would be driven high, when required, to prevent the 8207 from performing a memory cycle. It would be connected to the Multibus INH pin through an inverter. SYNCHRONOUS/ASYNCHRONOUS COMMANDS Each port of the 8207 can be configured to accept either a synchronous or asynchronous (via programming bits) memory request. Minimum m.emory request decode time (and maximum performance) is achieved using a synchronous status interface. This type of interface to the processor requires no 'logic for the user to implement. . . An asynchronous interface is used with Multibus bus interfaces when the setup and hold times of the memory commands cannot be guaranteed. Synchronizers are added to the inputs and will require up to two clocks for the 8207 to recognize the command. It should be obvious that better performance will result if the 8207's clock is run as fast as possible. , Figure 2 of the 8207 Data Sheet shows various combinations of interfaces. The additional logic for the asynchronous interfaces is used to either lengthen the command width, to meet the minimum 8207 spec, or to make sure the command does not arrive too soon before the address has stabilized. PORT ENABLE The PE inputs serve t2Jlualify a memory request. A RAM cycle, once started, cannot be stopped. A RAM cycle starts if PE is seen active at the proper clock edge and a valid command is recognized. If PE is activated after a command has gone active and inactive, no cycle will start. 6-166 230822-002 8207 Types of logic that work well are 74138 and 7485. PE should be valid as much as possible before the command arrives because, as the address bus switches and settles, glitches on PE could either: disqualify a memory cycle; delay a memory cycle; or start a memory cycle when none should have. Refer to the Port Interface Waveforms in the Data Sheet. If Port Enable is not seen active by the next or same clock edge, no memory cycle will occur unless the command is removed and brought active again. Back to Back Commands Holding the RD, 'WR inputs active will not generate continuous memory cycles. Memory commands must go inactive for at least one clock period before another memory request at that port will be considered valid. Holding the inputs active will not keep the other port from gaining access to the RAM. The only signal that can prevent the other port's gaining access to the RAM is LOCK. Address Inputs (And LOCK) Two pins control the address inputs on the 8207, MUX and LEN. Neither are used for single port 8086 based systems. MUX is used for dual port configurations, and LEN is used for single and dual port 80286 based systems. MUX is used to gate the proper ports addresses to the 8207. If the output is high, Port A is selected. If it is low, Port B is selected. The cross coupled NAND gates, shown in the 8207 Data Sheet (Figure 3), are used to minimize contention when switching address buses. Use of a single inverter would have both outputs enabled simultaneously for a short period. The cross coupled hand gates allow only one output enabled. MUX also allows the single LOCK input to be multiplexed between ports. Figure 9 shows how to multiplex the LOCK input for dual port systems. See the LOCK section for more information. TO ADDR LATCH A EN MUX I------.---i 8207 LOCKA LOCK TO ADDR LATCH B EN Figure 9. Dual Port LOCK Input Circuit MUX TIMING The MUX output is optimized by the Port Arbitration scheme, which is selected in the program word. Figure 10 shows the effects on memory selected in the program word. Figure 10 shows the effect~ on memory bandwidth with the different schemes. Port A Preferred optimizes consecutive cycles for Port A. Consecutive Port B cycles have at least 1 clock added to their cycle time. There would be no MUX delays for any Port A request. 6-167 230822-002 inter 8207 The Most Recently Used scheme allows either port to generate consecutive cycles without any MUX delays. The first memory cycle for each port would have the 1 clock delay. But all others would not. With either scheme, if both ports request the memory at their top speed, the 8207 will interleave the requests; Port A,' Port B, Port A, Refresh, Port B. 8 MHz CMDA CMDB MUX A RiiSX MUX A A A B MOST RECENTLY USED RiiSX, A B B t, ~ __...Jr Figure 10. Port Arbitration Effects LEN LEN is used to hold the 80286 addresses when the 8207 cannot respond immediately. The 8207 will require a separate address latch, with the ALE input replaced with LEN. LEN optimizes the address setup and hold times for the 8207. ' LEN goes from high to low when a valid 8207 command is recognized, which latches the 80286 address. This transition of LEN is independent of a memory cycle starting. The low to high transition will occur in the middle of a memory cycle so that the next address will be admitted and subsequently latched. ' If Port B is to interface t6 an 80286 with the synchronous status interface, then LEN must be created using external logic. Figure 11 shows the equivalent 8207 circuit for Port B. LOCK The LOCK input allows each port uninterrupted access to memory. It does this by not permitting MUX to ,switch. It is not intended as a means to improve throughput of one of the ports. To do so is at the designer's riskl. Obviously, LOCK is only used in dual port systems. The'8207 interprets LOCK as originating from the port that MUX is indicating. (1) The 8207 will not malfunction if this is done. This is a system level concern. For example, . a time dependent process may fail if the other port holds LOCK active, preventing its access of memory and relinquishing the bus. 6-168 230822-002 8207 RESET PR AACK J Q FROM 80286 lEN CLOCK SO 51 +5 g )~ PE Figure 11. Port B LEN Circuit LOCK from the 8086 may be connected directly to the 8207 or to the multiplexing logic. The 8207 requires additional logic when interfaced to an 80286. Figure 12 shows both the synchronous and asynchronous circuitry. For 16 MHz operation, the 8207 ignores the LOCK input during the clock period that MUX switched. During 8 MHz operation, the 8207 will see LOCK as being active during the clock period when MUX switches. The LOCK issued in Multibus bus systems may not be compatible with the 8207. The 8207 references LOCK from the beginning of a cycle, while Multibus references LOCK from the end of a cycle. The 82284 RESET READY' ClK V J PR Q V-i-JPRQ 82288 r-K 80286 lOCK '- ALE a I-- r=[>rK Q ~ 'COCK Figure 12a. Synchronous interface 6-169 230822-002 8207 -80286 LOCK - r-I> 1 D PR 1 D Q PR Q 82288 CLR Q ALE LT rl> CLR Q J 82284 RESET READY Figure 12b. Asynchronous interface Multibus LOCK can be used if it meets the 8207 requirements. If the LOCK timing cannot be guaranteed, then additional logic is necessary. The logic would issue LOCK whenever a Multibus command is recognized. The drawback to this is that MUX cannot switch during the RAM cycle. This would delay the other port's memory access by one or two clocks. DEADLOCK The designer should ensure that a deadlock hazard has not been created in the design. The simple interfaces shown previously will not create a deadlock condition when the 8207 controls all system memory. If LOCK is issued by both ports,_ then the above logic would need to be modified to remove LOCK. Figure 13 shows an illustration of the problem with a single LOCK input. LOCK r---; 8207 Figure 13. Single LOCK Input Circuit 6-170 230822-002 8207 Suppose the 8207 starts a locked string transfer for the processor. The Multibus bus port requests a memory cycle but must wait for the processor to remove LOCK. But the processor must access Multibus as part of the locked string transfer. We now have a deadlock. The solution is to force LOCK inactive whenever an access is made to non-8207 memory by the processor. By doing this we have now violated the purpose of LOCK, since the Multibus port could change data. Another solution is to ensure that locked data does not exist in physically separate memory. 8207 Acknowledge's The 8207 in non-ECC mode has two active acknowledge'S per port, AACK and XACK. The AACK output is configured into either an "early" or "late" AACK based on the SA, SB bits in the program data word. In ECC systems there is on~ Acknowledge per port, and it is configured to anyone of the three (EAACK, LAACK or XACK) by the programming bits. The AACK pin is optimized for either the 80286 or the 8086, based upon the CFS programming bit (fast = 80286; slow = 8086). XACK conforms to the Multibus bus specification. XACK requires a tri-state buffer and must not drive the bus directly. In synchronous systems, XACK will not go active if the memory' command is removed prior to the clock period that issues XACK. In asynchronous systems, the AACK pin can also serve as an advanced RAM cycle timing indicator. Data out, in synchronous systems, should not have to be latched. The 8207 was designed to meet the data setup and hold times of Intel processors, the 8086 family, and the 80286. In asynchronous systems, the 8207 will remove data before the processor recognizes the Acknowledge (LAACK or XACK). In these systems, the data should be latched with transparent type latches (Intel 8282/8283). Output Data Control Non-EGG In single port systems, Intel processors supply the necessary timing signals to control the input or output of data to the RAMs. These control signals are i5EN and DT lit Refer to the microprocessor handbook for their explanation. If these signals are not available, then PSEN and DBM provide the same function. They can be used directly to control the 8286/8287 bus drivers of the 8207. Because of the single set of data in/out pins of the RAMs, data must be multiplexed between the two ports in dual port systems. The 8207 provides two outputs for contention-free switching. PSEL operates the same as the MUX output, in that a high selects Port A and a low selects Port B. PSEN acts to enable the selected port. The timing is shown in the 8207 Data Sheet, Port Switching Timing section. The easiest means of using PSEL and PSEN is shown in Figure 14. At no time will both POltS be enabled simultaneously. PSEL PSEN t====Oa I ~;O>----D D OE OE PORT A PORT B Figure 14. PSEL and PSEN Interface Circuit 6-171 230822-002 inter 8207 Data Bus - Single Port Recall that the 8207 always performs a late write cycle and that this requires separate data in and out buses. One option for the data bus is shown in Figure 3 of the 8207 Data Sheet. It requires separate data in and out traces on the processor board. The second option is to keep the processor's combined data, bus but separate the data at the 8207 RAM. This is shown in Figure 15. RAM ARRAY 'S240(2) PE DBM TO I'P DATA BUS Figure 15. Data Bus Circuit Data Bus - Dual Port Non-EGG The multiplexed data of the 8207 RAM must be kept isolated so that an access by one port does not affect another port. Figure 16 illustrates the control logic. 6-172 230822-002 8207 RAM ARRAY PORT B PORT A S S Y Y S S T E M T E M B U B U S S DBM PE PSEL PSEN c:>-----~t_t A C>---~-O--L--" Figure 16. Dual Port Data Bus Control Circuitry 6-173 230822-002 8207 CHAPTER 5 8207 WITH ECC (8206) This section points out the proper control of the 8206 EDCU by the 8207. The 8207 performs error correction during read and refresh cycles (scrubbing), and initializes memory after power up to prevent false errors from causing interrupts to the processor. Since the 8207 must refresh RAM, performing scrubbing during refresh allows it to be accomplished without any additional performance penalty. Upon detection of a correctable error during scrubbing, the RAM refresh cycle is lengthened slightly to permit the 8206 to correct the error and for the corrected word to be rewritten into memory. Uncorrectable errors detected during scrubbing are ignored, since the processor may never access that memory location. Correctable errors detected during a memory read cycle are corrected immediately and written back into memory. Synchronous/Asynchronous Buses The many types of configurations that are supported by the 8207/8206 combination can be broken down into two classes: ECC for synchronous or for asynchronous buses. In synchronous bus systems, performance is optimized for processor throughput. In asynchronous buses, performance is optimized to get valid data onto the bus as quickly as possible (Multibus). While possible to optimize the 8207/8206 for processor throughput in Multibus systems, it is not Multibus compatible. The performance optimization is selected via the XA/XB and SA/SB programming bits. When optimized for processor throughput, an advanced acknowledge (AACK - early or late) is issued at some point (based on the type of processor) so that data will be valid when the processor needs it. When optimized for quick data access, an XACK is issued as soon as valid data is known to exist. If the data was invalid (based on the ERROR flag), then the XACK is delayed until the 8206 corrects the data and the data is on the bus. The first example is known as "correct always" mode. The 8206 CRCT pin is tied to ground and the 8206 requires time to do the correction. Figure 17 shows this implementation. The quick data access method is known as "correct on error." The CRCT pin is tied to the RIW output of the 8207. When CRCT is high, the 8206 does not do correction, but still checks the data. This delay is typically half of the first. If an error happens, the cycle becomes a RMW and XACK is delayed slightly so that data can be corrected. The correct on error mode is of no real benefit to non-Multibus users. The earliest acknowlege (EAACK) is delayed by one clock to allow for the delays through the 8206. This imposes a 1 wait state delay. Byte Marks The only real difference to the 8207 system when adding the 8206 is the treatment of byte writes. Because the encoded check bits apply only to a whole word (including check bits), byte ~rites must not be permitted at the RAM. Instead, the altering of byte data is done at the 8206. The byte marks previously sent to RAM are now sent to the 8206. These byte marks must also qualify the output enables of the data drivers. The DBM output of the 8207 is meant to be nanded with the processors byte marks. This output is activated only on reads or refreshes. On write cycles, this output stays high which would force the 8206 byte mark input low. When low, the internal 8206 data out buffers are tristated so that new data may be gated into the device. 6-174 230822-002 inter 8207 RAS,CAS AOOR WE RAM ARRAY ~ +5 01 8207 CBI DO OBM WZ ERROR CE Rm PSEN 16 FWR AO BHE Figure 17. 8206 Interface to the 8207 Read Modify Writes - ECC A RMW cycle occurs whenever a processor wants to do byte writes or when the 8207 has detected an error during read or refresh (scrubbing) cycles. A byte write is detected by the FWR input to the 8207 and is based on the processor supplied byte marks. At the start of it RMW cycle, DBM stays high, which, when qualified with the byte marks, will enable the.J!ata out buffer of the 8206 for the unmodified byte, and tristates the buffer for the new byte; R/W is high, which tells the 8206 to do error detection and correcting (if CRCT is low). The 8206 can latch data and check bits from the RAM via the STB'input, but the 8207 does not use this feature. Instead, the 8207 keeps CAS active the entire length of the RMW cycle to hold data at the 8206. The new byte data from the processor goes to the 8206 and to the RAM. The 8207 would have corrected any errors just read, so the old and new bytes of data, plus their check bits, are available at the RAM, and the 8207 generates a write pulse. The data driver for the unmodified byte must not have been enabled, otherwise erroneous data would be wri,tten to RAM and possibly made valid (if it was stable) by the 8206. Data Buffer Control - ECC The control of the data buffers is essentially the same as in non-ECC systems, with a few exceptions. 6-175 230822-002 8207 The processor's byte marks must now qualify the output enable logic. The reason was described earlier . in the RMW section. This applies to both single and dual port configurations. A refresh cycle outputs all the control signals that a read cycle will, except for an acknowledge. If complete buffer control is left to the 8207, then it would occasionally (during refreshes) put data on the processor bus. The DEN and DT IR signals must be qualified by the PE input. PE would have to be latched for the entire cycle by PSEN. Test Modes Neither of the two test modes of the 8207 are to be used in a design. Both test modes reset the refresh address counter to a specific value, which interrupts the refresh sequence and causes loss of data. In error corrected systems, a reset pulse causes the 8207/8206 to write over the entire RAM array. Test Mode 2 appears to bypass the prewrite sequence. But, the refresh counter is reset to a value of IF7 (H). So, besides interrupting the refresh sequence, the 8207 still prewrites the 8 locations specified by the counter. To not overwrite the RAM data, the 8207 RESET will have to be isolated from the system reset logic in ECC systems. 6-176 230822-002 8207 APPENDIX I 8207/8208 Performance The following performance charts were based upon Figure 3 in the 8207 Data Sheet, and apply to the 8208 as well. All RAM access delays are based upon Intel dynamic RAMs. The charts show the performance of a single cycle with no precharge, refresh, port switching, or arbitration delays. The read access calculations are: the margin between the 8207 starting a memory cycle to data valid at the processor - 8207 RAS or CAS from clock delay - DRAM RAS or CAS access - 8286 propagation delay - processor setup. Assume the RAS/CAS drivers are loaded with 150 pf, and the 8286 is driving a 300 pf data bus. 80286 (example) RAS Access: 3TCLCL - 8207 TCLRSL - 2118 tRAC 8286 TIVOV - 80286 t8 = (3)62.5 - 35 max - 100 max - 22 - 10 = 20 ns CAS Access: 2 TCLCL - 8207 TCLCSL - 2164A tCAC 8286 TIVOV - 80186 TDVCL = (2)125 - 115 max - 85 max - 22 - 20 = 8 ns 80186 (example) 6-177 230822-002 8207 8207 Performance (EDC synchronous status interface) Table 5a. Wait States for Different !,P and RAM Combinations Wait states at full CPU speed CPU 80286 RAM speed Freq 8 MHz 80186, 8086/88-2 8 MHz 8086/88 5 MHz 120 ns 100 ns 150 ns 1-RD, WR 3-Byte WR CO (3) 1-RD, WR 3-Byte WR CO 2-Read 1-Write 3-Byte WR C2 1-RD, WR 3-Byte WR C4 1-RD,WR 3-Byte WR C4 1-RD,WR 3-Byte WR C4 1 1 1 C6 C6 200 ns Not (1) compatible with RAM· parameters C6 1-RD, WR 3-Byte WR C4 8207 Performance (EDC synchronous status interface) Table 5b. !,P Clock Frequency for Differenc !,P and RAM Combinations Maxlmum.frequency for one wait-state (4) CPU Freq 80286 8 MHz 80186, 8086/88-2 8 MHz 8086/88 5 MHz RAM speed 100 ns I 120 ns 150 ns 7.3 MHz CO FULL SPEED 6-178 200 ns 6 MHz: CO 7 MHz C4 230822-002 8207 8207 Performance (Non-EDC synchronous status interface) Table 6a. Wait States for Different lAP and RAM Combinations r"vait states at full CPU speed CPU 80286 8 MHz 80186, 8086/88-2 8086/88 RAM speed Freq 100 ns 120 ns 150 ns 200 ns CO(3) 1·Read O-Write C1 1-Read O-Write C1 Not(1) compatible with 0 0(2) RAM parameters 0 8 MHz 0 5 MHz 0 C3 C3 C3 0 0 C3 0 C3 C3 C3 Table 6b. lAP Clock Frequency for Different lAP and RAM Combinations Maximum frequency for no wait-state (4) CPU 80286 80186, 8086/88-2 8086/88 Freq 8 MHz RAM speed 100 ns 1 I 120 ns 7 MHz I I 150 ns 6 MHz 200 ns 5.3 MHz 7 MHz 8 MHz FULL SPEED 5 MHz (1) The 2164A tRAH parameter is not satisfied. (2) 150 ns 64K DRAMs with tCAC = 100 ns won't run with 0 wait-states, because they have a longer CAS access time than the 2164A-15 (tCAC = 85 ns). (3) Numbers in lower right corners are the programmed configurations of the 8207. (4) To meet read access time. 6-179 230822-002 8207 8207 Performance (multibus interface) This is an asynchronous, command Interface. Worst case data and transfer acknowledge (XACK#) delays. Including synchronization and data buffer delays, are: Table 7a. Non-EDC system RAM speed Data access time 100 ns 120 ns 150 ns 200 ns 289ns 299ns 322ns 380ns XACK# access time 333ns 450ns Table 7b. EDC system RAM speed 100 ns Data access time (read) XACK# access time 359ns (324 ns)[1] 120 ns 150 ns 200 ns 369ns 392ns (334 ns) (357 ns) 450ns (415 ns) 400 ns-RD, WR 588 ns-Byte Write 520 ns-RD, WR 806. nS-Byte WR (1) Numbers in parentheses are for when 8206 is in check-only mode (8206 doesn't do error correction until after an error is detected. 6-180 230822-002 APPLICATION NOTE AP·97A April 1982 AP·97A INTRODUCTION Table 1. Comparison of Intel Static and Dynamic RAMs Introduced during 1981 The designer of a microprocessor-based system has two basic types of devices available to implement a random access read/write memory - static or dynamic RAM. Dynamic RAMs offer many advantages. First, dynamic RAMs have four times the density (number of bits per device) of static RAMs, and are packaged in a 16-pin DIP package, as opposed to the 20-pin or larger DIPs used by static RAMs; this allows four times as many bytes of memory to be put on a board, or alternatively, a given amount of memory takes much less board space. Second, the cost per bit of dynamic RAMs is roughly one-fourth that of statics. Third, static RAMs use about· one-sixth the power of static RAMs, so power supplies may be smaller and less expensive. These advantages are summarized in Table 1. On the other hand, dynamic RAMS require complex support functions which static RAMs don't, including • • • • address multiplexing timing of addresses and control strobes refreshing, to prevent loss of data arbitration, to decide when refresh cycles will be performed. 2164·15 2167·70 (Dynamic) (Static) Density (No. of bits) No. of pins Access time (ns) Cycle time (ns) Active power (rna) Standby power (rna) Approx. cost per bit (millicents/bit) 64K 16 150 300 60 5 45 16K 20 70 70 125 40 250 In addition, dynamic RAMs may not always be able to transfer data as fast as high-performance microprocessors require; wait states must be generated in this case. The circuitry required to perform these functions takes up board space, costs money, and consumes power, and so detracts from the advantages that make dynamic RAMs so appealing. Obviously, the amount of support circuitry should be minimized. The Intel 8202A and 8203 are LSI dynamic RAM controller components. Either of these 40-pin devices alone does all of the support functions required by dynamic RAMs. This results in a minimum of board space, cost, and power consumption, allowing maximum advantage from the use of dynamic RAMs. LOG2 [COST! CONTROLLER CS LOGIC 4K 8K 16K 32K 64K 128K LOG2 [RAM SIZE! (K BYTES) Figure 1. Implemented Cost of Static vs. Dynamic RAM 6-182 210398-001 Ap·97A Figure 1 shows the relative cost of static and dynamic RAM, including support circuitry, as a function of memory size, using the Intel 8202A or 8203. For any memory larger than 16KBytes, the dynamic RAM is less expensive. Since the cost of the dynamic RAM controller is relatively independent of memory size, the cost advantge for dynamic RAM increases with increasing . memory size. This Application Note will describe the techniques of interfacing a dynamic RAM memory to an iAPX-86 or iAPX-88 system using either the 8202A or 8203 dynamic RAM controller. Various configurations of the 8086 and 8088 microprocessors, and those timings which they satisfy, are described. The Note concludes with examples of particular system implementations. DYNAMIC RAMS This section gives a brief introduction to the interfacing requirements for Dynamic RAMs. Later sections will describe the operation of the Intel 8202A an,d 8203 Dynamic RAM Controllers. Device Description The pinout of two popular families of dynamic RAMs, the Intel 2118 and 2164A, are shown in Figure 2. The 2118 is a 16,384 word by I-bit dynamic MOS RAM. The 2164 is a 65,536 word by I-bit dynamic MOS RAM. Both parts operate from a single + 5v supply with a ± 101110 tolerance, and both use the industry standard 16-lead pinout. Addressing Each bit of a dynamic RAM is individually addressable. Thus, a 2164A, which contains 216 (or 65,536) bits of information, requires 16-bit addresses; similarly, the 2118, which contains 214(or 16,384) bits, requires 14-bit addresses . In order to reduce the number of address pins required (and thus reduce device cost), dynamic RAMs timemultiplex addresses in two halves over the same pins. Thus a 2164A needs only 8 address pins to receive 16-bit addresses, and the 2118 needs only 7 for its 14-bit addresses. The first address is called the row address, and the second is called the column address. The row address is latched internal to the RAM by the faIling edge of the RAS (Row Address Strobe) control input; the column address is latched by the falling edge of the CAS (Column Address Strobe) control input. This operation is illustrated in Figure 3. Dynamic RAMS may be visuallized as a twodimensional array of single-bit storage cells arranged across the surface of the RAM's die. In the case of the 2164A, this array would consist of 28 (or 256) rows and 28 (or 256) columns, for a total of 2 16 (or 65,526) total bit cells (Figure 4). This is the source of the "row address" and "column address" terminology. Bear in mind that any given RAM may not be physically implemented as described here; for instance, the 2164A actually contains four arrays, each one 27 rows by 27 columns. The two parts are pinout-compatible with the exception of the 2164 having one extra address input (A 7, pin 9); this pin is a no-connect in the 2118. Both parts are also compatible with the next generation of 256K dynamic RAMs (262,144 word by I-bit), which will use pin 1 (presently a no-connect on both the 2118 and 2164A) for the required one extra address input (As). This makes it possible to use a single printed circuit board layout with any of these three types of RAM. Vss DIN WE RAS Ao A2 A, Voo CAS Dour V. S CAS DIN WE Dour A6 RAS A3 A4 As Ao Ac A3 A2 A, A4 As Ar. Voo "As DIN WE RAS Ao A2 A, Voo V•• CAS Dour As A3 A4 As A7 Figure 2. Dynamic RAM Pinout Compatibility 6-183 210398-001 AP·97A ADDRESS COLUMN Figure 3. Dynamic RAM Addressing COLUMNS ROWS °H lH °H 100H .1H 2H 3H 101H 102H 103 H "l V 2H 200H 201H 202H 2031l1t 3H 300H 301H 302H 303( 4H 400H 401H 402H 403H\ 5H 500H 501H 502H 50y I \1 FEH FFH IFEH IFFH \ '\pH 19 2FEit 2FFH \3FEH 3FF H BIT CELL ADDRESS "" . ~ ~ FDOOH fi F FEOO H H FE01H FE02H \ FFOOH FF01H FF02H ~H II FEFEH / I FFFEH 1\ FCFF H FDFEH FDFFH FEFFH FFFFH Figure 4. Bit Cell "Array" CAS or WE, whichever occurs last. If WE goes active before CAS (the usual case, called an "early write"), write .data is latched by the falling edge of CAS. If WE goes active after CAS (called a "late write"), data is latched by the falling edge of WE (see Figure 5). Memory Cycles In·this Application Note, we will discuss three types of memory cycles - read, write, and RAS-only refresh. Dymanic RAMs may perform other types of cycles as well; these are described in the dynamic RAM's data sheet. Late writes are useful in some systems where it is desired tp start the memory cycle as quickly as possible, to maximize performance, but the CPU cannot get the write data to the dynamic RAMs quickly enough to be latched by CAS. By delaying WE, more time is allowed for write data to arrive at the dynamic RAMs. Whether data is read or written during a memory cycle is determined by the RAM's WE control input. Data is written only when WE is active. Note that when "'late write" is performed, CAS goes active while WE is still inactive; this indicates a read cycle, so the RAM enables its data output. So, if "late write" cycles are performed by a system, the RAM data inputs and data outputs must be electically isolated from each other to prevent contention. If no "late writes" are performed. the RAM data inputs and data outputs may be tied together at the RAM to reduce the number of board traces. During a read cycle, the CAS input has a second function, other than latching the column address. CAS also enables the RAM data output .(pin 14) when active, assuming RAS is also active. Otherwise, the data output is 3-stated. This allows multiple dynamic RAMs to have their data outputs tied in common. During write cycles, data on the RAM data input pin is latched internally to the RAM by the falling edge of 6-184 210398-001 AP·97A --- 1\ - lOS VALID >DOUT IOH .~ ~------------------------<. . ____ --I/------------- I_N_D_ET_E_R_M_IN_A_T_ E_ _ _ _ B. "LATE WRITE" 1\ - ~ }. IOH VALID ~ DOUT ---------------------------------------------------------------------------A. "EARLY WRITE" Figure 5. Dynamic RAM Write Cycles Access Times Each dynamic RAM has two different access times quoted for it -- access time from RAS active (tRAcl and access time from CAS active (tcAcl; these are illustrated in Figure 6. How do you know which to use? This depends on the timings of your RAM controller. First, the worst case delay from the memory read command active to RAS active (tcw and CAS active (tccl must be determined. Then the read data access time is the larger of the tCR(Controller) + tRAdRAM) or tcC is met, the smaller number of clock periods will apply. 808SA All 8202A output timings are specified for the capacitive loading in the data sheet. Typical output characteristics are'shown in the data sheet for capacitive loads ranging from 0 to 660 pF, these can be used, to calculate the effect of different loads than those specified in the data sheet on output timings. All address, RAg, CAS, and WE drivers are identical, so these characteristic curves apply to all outputs. Figure 15. Improper Transparent Refresh Generation To prevent this from happening, thf:) transparent refresh circuit should be modified as shown in Figure 16. In this circuit, REFRQ cannot be activated until the opcode fetch is already in progress, as indicated by SACK being active (remember, SACK is never active during a refresh). If the microprocessor tries to do an opcode fetch while the 8202A is doing a refresh, REFRQ will not be active; the 8202A will finish the refresh and see only RD active, and will start the opcode fetch; only then will REFRQ be activated. 8202A 51 So 808SA REFRQ SACK RD RD Figure 16. Generating Transparent Refresh For 808SA Systems SACK AND XACK Because refresh cycles are performed asynchronously to the microprocessor's operation (except during transparent refresh), the microprocessor cannot know when it activates RD or WR if a 'refresh cycle is in progress, and therefore, it can't know how long it will take to complete the memory cycle. This added consideration requires an acknowledge or "handshake" signal from ,the 8202A to tell the microprocessor when it may complete the memory cycle. This acknowledge would be, used to generate the microprocessor's READY input - the microprocessor will sit in wait'states until the 8202A acknowledges the memory cycle. Two signals are generated for this purpose by the 8202A; they are called system acknowledge (SACK) and transfer acknowledge (XACK). They serve the same purpose but differ in timing. XACK is a Multibus-compatible signal, and is not activated until the read or write cycle has been completed by the RAMs. In a microprocessor system, however, there is a considerable delay from when the 8202A acknowledges the memory cycle until the microprocessor actually terminates the cycle. This delay is due to the time required to combine this acknowledge with other sources of READY in the system, synchronize READY to the microprocessor's clock, sample the state of READY, and respond to an active READY signal. As a result, more wait states than necessary may actual- Cycle Timing Generator The Cycle Timing Generator consists of a travellingones shift register and combinational logic required to generate all the RAM control signals and SACK and XACK. All timings are generated from the 8202A's internal clock; no external delay lines are ever needed. The timing of these signals relative to CLK is illustrated in Figure 17. 6-194 210398-001 ·1 CLK T"\. IT"\. 0 2 5 8 I. 9 iii) WR ALE PCS ADDRESS en ROW COLUMN ROW ~ RAS "U ~ cD ~ CD 01 ~ CAS READ CYCLE WE SACK WRITE CYCLE ----------------E.~~!!'.P..~!lE~----------------------r'" NORMAL SACK XACK IEOC) ~ 0 U> '"'1" 0 ~ Figure 17. 8202A Timing Relative To elK AP·97A "8202A memory 'cycle will have SACK delayed, even if that cycle was not actually delayed due to a refresh cycle in progress. The delayed SACK flip-flop will be reset at the end of that cycle, and the 8202A will return to normal SACK operation. The same thing happens in Advanced Read mode if SI is high at the falling edge of ALE during a refresh cycle, once again regardless of the state of PCS. ly be generated by using XACK. SACK is activati:d earlier in the cycle to improve performance of microproces!;ors by compensating for the delays in the microprocessor responding to XACK, and thus eliminating unneeded wait states which might be generated as a result of XACK timing. The system designer may use one or the other acknowledge signal, or use both in different parts of the system, at, his option. 8203 SACK and XACK are activated by the Cycle Timing Generator, but they can be de-activated only by the microprocessor removing its RD or WR request, or by activating ALE when in the advanced read mode. As the SACK and XACK signals are used to generate READY for the microprocessor, this is necessary to give the microprocessor as much time as it needs to respond to its READY input. The 8203 is an extension of the 8202A architecture which allows the use of 64K dynamic RAMs. It is pinout compatible with the 8202A and shares identical A.C. and D.C. parameters with that part. The description of the 8202A applies to this part also, with the modifications below. ENHANCEMENTS Delayed SACK Mode SACK may be activated at one of two different times in the memorY cycle; the earlier case is called "normal SACK" and th~1ater is called "delayed SACK" (Figu~e 18). Delayed SACK occurs if the memorY request was received by the 8202A while it was doing a refresh cycle. In this case, the memorY cycle will be dehiyed, some length of time while the refresh cycle completes; SACK is delayed to ensure the microprocessor will generate enough wait states. This is a concern mostly for read cycles. Because of the way the delayed SACK mode is'implemented in the 8202A, if the RD or WR input is activated while a refresh cycle is in progress, regardless of whether or not the 8202A is chip-selected, the internal delayed SACK mode flip-flop will be set. The next 1. Supports 16K or 64K dynamic RAMs. 4K RAM mode, selected by pulling AL6I'OP3 (pin 18) to + 12v, is not supported. 2. Allows a single board design to use either 16K or 64K RAMs, without changing the controller, and only making between two and four jumper changes to reconfigure the board. 3. May operate from external TTL clock without the + 12v pull-up which the 8202A requires (a + Sv or + 12v pull-up may be used). The pinout of the 8203 is shown in Figure 19. This pinout is identical to the 8202A, with the exception of the five highlighted pins. The function of these is described below. The simplified block diagram is similar to the 8202A's, in Figure 11. DELAYED SACK -------:-------~-------=-------------\ \ NORMAL SACK Figure 18. Delayed SACK Mode 6-196 210398-001 AP·97A 8202A's pins are already used, this is clearly a challenge - some functionality must be sacrificed to gain 64K RAM support. The 8203 reduces the maximum number of banks supported from four to two for 64K RAMs. AH4 AH3 . AH. AHl AHo ALo OUTo ALl OUTl AL. OUT. Pin 35 (16K/64K) is used to tell the 8203 whether it is being used to control 16K RAMs or 64K RAMs. When tied to Vee or left unconnected, the 8203 operates in the 16K RAM mode; in this mode all the remaining pins function identically to the 8202A. When tied to ground. it operates in the 64K RAM mode, and pins 23 through 26 change function to enable the 8203 to support 64K RAMs. Pin 35 (16K/64K) contains an internal Pull-up -when unconnected, this input is high, and the 8203 operates identically to the 8202A. This maintains pinout compatibility with the 8202A, in which pin 35 is a noconnect, so the 8203 may be used in 8202A sockets with no board modifications. AL3 OUT3 AL4 OUT4 ALs OUTs AL6 OUT6 Vo• When the 8203 is in the 64K RAM mode, four pins change function, as shown in Table 2. .The pins change function in this particular way to allow laying out a board to use either 16K or 64K RAMs with a minimum of jumpers, as shown in Figure 20. This figure shows the 8203 with two banks of RAM. Banks 0 and 1 may be either 16K RAMs or 64K RAMs; banks 2 and 3 may only be 16K RAMs, as the 8203 supports two banks of 64K RAM. For clarity, only those connections which are important in illustrating the 8203 jumper options are shown. Fig. 198203 Pinout 16K Mode and 64K Mode The goal of the 8203 is to provide a pin- and timingcompatible upgrade of the 8202A for use With 64K RAMs. The difficulty in doing this is that 64K RAMs require an additional address input ·compared to 16K RAMs, and thus the 8203 needs three more pins (one more RAM address output, and two more inputs to its internal address multiplexer). Since all but one of the ALo·6 ALO·6 Ao-A13 RASo 21 24 Bo(AL7) A14 25 Bl (AH7) A1S J1 - --0() ~ (32K WORDS) J2 CS (64K WORDS) -0 ~ J5 ~ .1-=A16 J7 --<> 2118 (2164) RAS. 23 (OUT7) 9 N.C. (A7) RAS3(Bo) PCS 1!!: (128K WORDS) ~ 4 RAS 22 RASl BANK 0 ~ 8203 ~ RAS 16K164K 2118 (2164) BANK 1 JB ~ 16K RAM JUMPER OPTION J1·J4 (32K WORDS) J1·J2 (64K WORDS) ...... TO RAS OF BANK 2 (2118 ONLY) N.C. (A7) '----- TO RAS OF BANK 3 (2118 ONLY) 84K RAM JUMPER OPTION J2·J4 (64K WORDS) J3·J4 (12BK WORDS) J5·J6 J7·J8 Figure 20. 8203 Jumper Options 6-197 210398-001 AP·97A Table 2. 16KJ64K Mode Selection Pin # 16K Function 64K Function 23 24 2S 26 RAS2 Bank Select (BO> ~ Select (Bt) RAS3 Address Output '(OUT;) Address Input (AL7) Address Input (AH7) Bank Select (BO> Jumpers 11-J4 may be used to chip select the 8203 over various a'ddress ranges. For example, if two banks of 16K RAMs are replaced with two banks of 64K RAMs, the address space controlled by the 8203 increases from 32K words to 128K words. If four banks of 16K RAMs are replaced with one bank of 64K RAMs, no chip select jumpers are needed. In the 64K RAM mode, pins 24 and 25 (Bo(AL7) and BI(AH7» change function from bank select inputs to address inputs for the 64K RAM. Since the bank select inputs normally come from the address bus anyway, no jumper changes are required here. The bank select function moves to pin 26 (RAS 3 with no series resistor. This is because pin 36 must be within one Schottky diode voltage drop (roughly 0.5v) . of pin 40 to select the external TTL clock option; a series resistor may cause too great a voltage drop for the external clock option to be selected.· For the same reason, the trace from pin 36 to 40 should be kept as short as practical. Test Cycle An 8203 test cycle is requested by activating the RD. WR, and PCS inputs simultaneously. By comparison, an 8202Atest cycle requires activating only the RD and WR inputs simultaneously, independent of PCS. Like the 8202A, and 8203 test cycle resets the address counter to zero and performs a write cycle. --------,/1 REFRQ/ALE RDIS1 WR pes TIMING 81.0P1_....._ _ _ _ _ _-IGENERATOR 80---------1 16K/,64K------J Figure 21. 8203 Simplified Block Diagram 6-198 210398-001 AP·97A it to support RAMs which use either the 128-row or 256-row refresh schemes. Regardless of which type of RAM is used, the refresh counter cycles through 256 rows every 4 ms. RAMs which use 128-row re-fresh treat the eighth address bit as a "don't care" during refresh, so they see the equivalent of 128-row refresh every 2 ms. In either case the rate of internally-generated refresh cycles is the same-at least one every 15.6 microseconds. BLOCK DIAGRAM A simplified block diagram of the 8203 is shown in Figure 21. It is identical to the 8202A except for the following differences: I. The 3: 1 address multiplexer is 8 bits wide, instead of 7 bits wide, to support the addressing requirements of the 64K RAM. 2. The refresh address counter is 8 bits. This allows INTEL iAPX·86 AND iAPX·88 Device Descriptions The iAPX-86 and iAPX-88 are advanced 16-bit microprocessor families, based on the 8086 and 8088 microprocessors, respectively. While both have a similar architecture and are software compatible, the 8086 transfers data over a 16-bit bus, while the 8088 uses an 8-bit data bus (but has a 16-bit internal bus). Min and Max Modes In order to support the widest possible range of applications, the 8086 and 8088 can operate in one of two modes, called minimum and maximum modes. This allows the user to define certain processor pins to "tailor" the 8086 or 8088 to the intended system. These modes are selected by strapping the MN/MX (minimum/maximum) input pin to Vee or ground. In the minimum mode, the microprocessor supports small, single-processor systems using a minimum of components. In this mode, the 8086 or 8088 itself generates all the required bus control signals (Figure 22). In the maximum mode, the microprocessor supports larger, higher performance, or multiprocessing systems. In this mode, the 8086 or 8088 generates status outputs which are decoded by the Intel 8288 Bus Controller to provide an extensive set of bus control signals, and Multibus compatibility (Figure 23). This allows higher performance RAM operation because the memory read and write commands are generated more quickly than is possible in the minimum mode. The maximum mode is the one most often used in iAPX-86 and iAPX-88 systems. M/iO READY 8086 CPU A16·19 8282 .11-----', lATCH ADo·15 BHE 8284A ClK GEN'R ALE ClK TO TOCPU READY lOGIC Figure 22. 8086 Minimum Mode 6-199 210398-001 Ap·97A READY 8284A ClK GEN'R ClK TOCPU READY lOGIC Figure 23. 8086 Maximum Mode control signal using the min or max mode in the normal configuration. Alternate Configuration The Alternate Configuration is not an operating mode of the SOS6 or SOSS per se, but uses TTL logic along with the status outputs of the microprocesor to generate the RAM read and/or write control signals (Figure 24). The alternate configuration may be used with the microprocessor in either minimum or maximum mode. This configuration is advantageous because it activates the memory read and write signals even earlier than the maximum mode, leading to higher performance. It is possible to generate either the RAM read or write signal using this configuration, and generate the other RAM Each of the three system configurations may· be· used with buffers on the address, data, or control bus for increased electrical drive capability. Performance vs. Wait States Before starting a discussion of timing analyses, it's worthwhile to look at the effect of wait states on the iAPX-S6 and iAPX-SS. Vee 8284A { ClK -----------~ CLOCKED AMWC 8086 8088 {STATUS (So.2> I TO 8202AI 8203 ALE 8288 ~~~~ Figure 24. Alternate Configuration Logic 6-200 210398-001 Ap·97A Fm most microprocessors, the effect of, say, one wait state on execution times is straightforward. If a bus cycle normally is three clocks long, adding a wait state to every bus cycle will make all bus cycles four clocks, decreasing performance by 33070. This is multiplied by the percentage of time that the microprocesor is doing bus cycles (some instructions take a long time to execute, so the microprocessor skips a few bus cycles). which don't use an instruction queue. The effect of wait states on 8086 execution time compared to the Motorola 68000 and Zilog Z8000 for a typical mix of software is summarized in Table 3.[IJ Table 3. Effects of Wait States on Execution Time Execution Time Increase Over 0 Wait State Execution Time The effect of wait states on the iAPX-86 and iAPX-88 is not so straightforward, however. Processor The 8086 and 8088 microprocessors consist of two processing units: the execution unit (EU) executes instructions, and the bus interface unit (BIU) fetches instructions, reads operands, and writes results. During periods when the EU is busy executing instructions, the BIU "looks ahead" and fetches more instructions from the next consecutive addresses in memory; these are stored in an internal queue. This queue is four bytes long for the 8088 and six bytes long for the 8086; under most conditions, the BIU can supply the next instructions without having to perform a memory cycle. Only when the program doesn't proceed serially (e. g. a Jump or Call instruction) does the EU have to wait for the next instruction to be fetched from memory. Otherwise, the instruction fetch time "disappears" as it is proceeding in parallel with execution of previously fetched instructions. The EU then has to wait for the BIU only when it needs to read operands from memory or write results to memory. As a result, the 8086 and 8088 are less sensitive to wait states than other microprocessors iAPX 86/10 (measured) Z8000 (computed) 68000 (computed) 1 Wait Stale 2 Wait 3 Wait States States 8.3070 19.1% 15.9% 16.3% 38.2% 31.9% 26.3% 57.3% 47.8% The BIU can fetch instructions faster than the EU can execute them, so wait states only affect performance to the extent that they make the EU wait for the transfer of operands and results. How much this affects program execution time is a function of the software; programs that contain many complex instructions like mUltiplies and divides and register operations are slowed down less than programs that contain primarily simple instructions. The effect of wait states on the 8086 and 8088 is always less than on other microprocessors which don't use an instruction queue. [1] From J6-Bit Microprocessor Benchmark Report: iAPX-86, Z8000, and 68000, pub!. by Intel Corp. 1980 74532 Ao 8086 A'6.'9 WE (LOW BYTE) 8282 Ip.---"..I OUT WE 0'71==tc:::~ ADO·15 ~:~t----J~ rl___~--,::r~~~A,.K~ RAM DIlDO 52. 51,s" READY Figure 25. 8086 Max Mode System 6-201 210398-001 AP·97A t AL:~~~~t AHO-AH6 12::=-....;.-------------....,--' ~------------.J ~~~- ~~x- 1\ tRSH teAs _tRe I / f4- t ASR- ). ,..tRAH+ !-tAse...... f4-- te A _ COLUMN ROW K Figure 26. Memory Compatibility Timing Table 4. Memory Compatibility Timings (all parameters are minimums) Timing Analysis This section will look at two specific system configurations to show how the 8203 timing requirements are satisfied by the 8086. Methods of determining the worst case number of wait states for the various configurations are also given. - Syinbol tASC tASR teAH teAS 4wI The timings of the 8202A and 8203 are identical; only the 8203 is -referred to for the remainder of this note, but all comments apply equally to the 8202A. All timings are worst case over the range of T A = 0 - 70·C and Vee = + 5v ± 10"10 for the test conditions given in the devices' data sheets. Example 1. 8086 Max Mode System (5 MHz) This example (Figure 25) is representative of a typical medium-size microprocesor system. Example 1 requires one wait state (worst case) for memory cycles. Example 2 also uses an 8086 in Max mode at 5 MHz, but uses externallogic to reduce the number of wait states to zero for both read and write cycles. iRcD[1l iRSH Value Parameter Column Address Set-Up Time tp-30 Row Address Set-Up Time 1p-30 Column Address Hold Time SIp-30 CAS Pulse Width SIp-1O Row Address Hold Time 1p-1O RAS to CAS -Delay Time 21p-40 RAS Hold Time from CAS SIp-30 [IJtRcomin = tRAHmin + tAScmin = 2p - 40 This parameter is the minimum RAS active to active delay. cAs These timings are all a function of the 8203's clock period (tp); they may be adjusted to be compatible with slower dynamic RAMs by siowing the 8203's clock (increasing tp). The frequency of the 8203's clock may be varied from 18.432 MHz to 25 MHz; for best performance, the 8203 should be operated at the highestpossible frequency compatible with the chosen dynamic RAM. In most cases, tRAH or teAS will be the frequency limiting parameter, but the 821B can operate at its maximumfn:quency with most dynamic RAMs available. DYNAMIC RAM INTERFACE tASR applies only to refresh cycles. When the 8203 is in the Idle state (not performing any memory or refresh cycles) the address multiplexer allows the ALo_7 inputs (the RAM row address) to propagate through to the 8203 OUTO_7 pins, which are connected to the RAM address pins. So in read or write cycles, the row address will propagate directly from the address bus to the First, look at the timing requirements of the dynamic RAM to ensure they are satisfied by the 8203. Memory compatibility timings are shown in the 8203 data sheet (Figure 26). Seven 8203 timings are given, not counting tAD, which will be discussed in the next section. These timings are summarized in Table 4. 6-202 210398-001 Ap·97A ADDRESS SET·UP AND HOLD TIME MARGINS RAM; the row address set-up time in this case is determined by the microprocessor's timing (see the next section). At the beginning of a refresh cycle, the 8203 has to switch its internal multiplexer to direct the refresh row address to the RAMs before activating RAS; the tASR parameter in Table 4 refers to this case only. Assume the Intel 2164A-20 RAM (200 ns access time) is used. Equations l(a)-(h) show that this RAM is compatible at the S203's maximum operating frequency of 25 MHz (lp = 1/(25 MHz) = 40 ns). This frequency will be used for now; once the rest of the system timings are calculated, the minimum 8203 frequency which will provide the same system performance can also be determined. (a) (b) (c) (d) (e) tASC tASR tCAH tCAS tRAH (f) tRCD[1J (g) tRP (h) tRSH tp - 30 tp - 30 5tp - 30 5t p - 10 tp - 10 2tp - 40 4tp - 30 5tp - 30 [IJ May be calculated as tRComin = tRAHmin 10 (Equation 1.) 10 170 190 30 40 130 170 + tAscmin = 2tp - 40 The microprocessor must put the memory address on the address bus early enough in the memory cycle for it to pass through the 8203 and meet the row address setup time to RAS (tASR> requirement of the dynamic RAM (Figure 27). Since the address propagates directly through the 8203, this set-up time is a function of how long the microprocessor holds the address on the bus before activating the RD or WR command, the address delay through the 8203 (tAomax), and how long the 8203 waits before activating RAS (tcRmin). This is shown in Figure 28, and calculated in Equation 2. This and all following equations show timing margins; a positive result indicates extra margin, a zero result says the parameter is just met, and a negative result indicates it is not met for worst-case conditions. (Equation 2.) Row Address Set-Up Time Margin CPU Address to RD Delay + RAS Active Delay - Address Delays TCLCL(5MHz) + TCLML min (8288) + tCRmin(8203) - [Greater of TCLA Vmax(8086) + TIVOVmax (8282) or TCLLHmax(8288) + TSHOVmax(8282)] tAomax(8203) - tASR(2164A-20) 200 + 10 + [40 + 30] [Greater of (110 + 30) or (15 + 45)] - 40 - 0 100 74532 AD 6086 A,6.19 WE H-+--t---tPC56203 WE 6262 lfi--...I\.I (LOW BYTE) OUTO'; ADo·15 WE RA,~_~~~ r4_ _ _~--'T".:.....!~~ RAM 01100 52.51,50 READY Figure 27. Address Set·Up and Hold Time Margins 6-203 210398-001 T1 CLK(8284A) T2 ~ \ \ 1\ 1\ I\-- I----TCLAV- \V /1\ BHEl(8086) AO-19 BHE. A019VALID I--TCLLH- ALE(8288) / I TIVOV TSHOV '1' I\) ~ ADDRESS BUS l> "tI \/ cO VALID 11\ ~ I+--IAO--- = OUT 0_7(8203) Ae-n2184·20) VALID >!------IASR- \ MRDC 1(8288) AMWC 1\ RAS(8203) [\ i-TCLML ~ fl ; Figure 28. Address Set·up Time Margin ICR- T2 CLK(8284A) T3 \ \ \ " 1\ TW· T4 T1 \ '\. \. \ '\. '-- I\. ~ 1/ ALE(8288) / ~ q> ADDRESS BUS g MRDs 1(8288) AMWC \V VALID ~I\ ~ \ 1\ I. i ICC CAS(8203) IRSH - - -- - - --- - - - -- J / ~ ~ ~ l> RAS(8203) ~ l> "tI ---- Figure 29. Address Hold Time Margin AP·97A READ DATA ACCESS TIME MARGIN Similarly, the microprocessor must maintain the memory address long enough to satisfy the column address hold time (tcAH> of the RAM; the 8203 TAomin parameter should be used for this calculation. Read data access times determine how many wait states are required for read cycles. Remember that dynamic RAMs have two access time parameters, liAS· access time (tRAd and CAS access time (tcAd. Either one may be the limiting factor in determining RAM access time, as explained in the section Dynamic RAM - Access Times, above. Here tcAC is the limiting factor, as More importantly, the 8203 bank select (BO-I) inputs are also not latched; these are used directly to decode which RAS output is activated during read or write cycles, so these inputs must be held valid until RAS goes inacti.ve. Since BO.I are usually taken directly from the address bus, this determines the address hold time required of the system (Figure 29). These are easily satisfied by the 8086 as shown by Equation 3. N represents the number of wait states. This equation can be tried with various values for N (starting with 0 and increasing) until the equation is satisfied, or it can beset equal to zero (meaning no excess margin remains) and solved for N directly; the fractional value for N that results must be rounded up to get the worst-case number of wait states to satisfy this particular parameter. No wait states are required to meet address hold times. tccmax + tcACmax 2: tcRmax + tRACmax. This timing is shown in Figures 30 and 31, and is calculated in Equation 4. In this system, one wait state is required to satisfy the read data access time requirements of the system; the margin is -50 ns, which is too large a difference to be made up by using a faster RAM. (Equation 3.) Address Hold Time Margin (N = 0) CPU Address Hold Time,. from RD Active - RAS Inactive Delays (3 + N)TCLCL(5MHz) + TCLLHmin(8288)[I] + TSHOYmin(8282)TCLMLmax(8288) - tccmas(8203) tRSHmax(8203) [2] 3(200) + 2 + 10 - 35 - [4(40) + 85([5(40) + 301 102 [I] Not specified - use 2 ns [2] Not specified in 8203 data sheet; tRsHmax(8203) =5tp + 30 Figure 30. Read Data Access Time Margin 6-206 210398-001 T2 T3 TW T4 CLK(8284A) MRDC(8288) 1...10'--______ _ ICC cp ------1"1 l> CAS(8203) "'D cD ..... N ~ l> DouT(2164-20) VALID DATA BUS VALID ADIJ.15(8086) 8'" ; Figure 31. Read Data Access Time Margin AP·97A Read Data Access (Equation 4.) Time Margin (N = 0) CPU RD Active to Data Valid Delay CAS Active Delay - Data Delays (2 + N)TCLCL(5MHz) -. TCLMLmax(8288) tccmax(8203) - tCAcmax(2164A-20) tpmax(74S373)[1) - TIVOVmax(8286) TDVCLmin(8086) 2(200) - 35 - [4(40) + 85] - 11030[1) - 30 - 30 - 80=>1 wait state needed (N = I) Write Data Set-Up Time Margin (Equation 5.) CPU WR Active to Data Valid Delay + CAS Delay - Data Delay TCLMLmin(8288) + tccmin(8203) TCLDVmax(8086) - TIVOVmax(8286) tosmin(2164A-20) 10 + [3(40) + 25] - 110 - 30 - 0 IS Write Data Hold Time (Equation 6.) Margin (N = 0) CPU Data Hold Time, from AMWC Active + Data Delays - CAS Active Delay (2 + N)TCLCL(SMHz) + TCLCHmin(8284A) + TCHDXmin(8086) + TIVOVmin(8286) - TCLMLmax(8288) - tccmax(8203) tOHmin(2164A-20) 2(200) + [¥J(2OO) - IS] + 10 + 5 - 35 - [4(40) + 85] - 45 308 [I) tp(74S373) is the greater of tpHL (from data) or tpLH (from data) and is compensated for Vee and temperature variations, and is derated for a 300pF load (T.I. spec is at 15pF). tp(74S373) = 13ns + 0.OSns/pF(300 - IS)pF + 2.7Sns = 30ns. Where 13ns is T.1. spec value 0.05ns/ pF is derating factor for excess capacitive load (300 - IS) is excess capacitive load 2.75 is compensation for TA and Vee variation WRITE DATA SET·UP AND HOLD TIME MARGINS In write cycles, the write data must I. reach the dynamic RAMs long enough before CAS to meet the RAM's data set-up time parameter, tos (Figures 32 and 33), and 2. be held long enough after CAS to meet the RAM's data hold time parameter (tow (Figures 32 and 34.) Data set-up time margin is calculated in Equatio1l5, and data hold time margin is given in Equation 6. Again, these are margins, so a positive number indicates that system timing requirements are met for worst-case timings. Data hold time is a function of the number of 8086 wait states, represented as N, as is the read data access time margin. No wait states are required to meet this parameter. Figure 32. Write Data Set·Up and Hold Time Margins 6-208 210398-001 Ap·97A T1 CLK(8284A) T2 \ \ /\ 1\ TCLML \ AMWC(8288) f\ ICC \ CAS(8203) !-TCLDV- ADO·I.(8086) \/ ADDRESS DATA /1\ tDS~ !-TIVOV DATA BUS= DIN(2164A·20) I------------------------------ \V //\ VALID Figure 33. Write Data Set·Up Time Margin SACK SET-UP TIME MARGIN As explained earlier, SACK (and XACK) are "handshaking" signals used to tell the microprocessor when it may terminate the bus cycle in progress. Thus, SACK timing determines how many wait states will be generated, as opposed to how many wait states are actually required for proper operation, which is determined by the read data access time for read cycles and by the write data hold time for write cycles. If SACK causes more wait states than are required, there is a performance penalty, but the system operates; if too few wait states are generated, the system will not function. SACK and XACK serve the same function; they differ only in timing. XACK is Multibus compatible, and is activated only when the read data is actually on the bus (in a read cycle) or when the write data has been latched into the RAM (in a write cycle). SACK is activated earlier in the memory cycle than XACK to compensate for delays in the microprocessor responding to this signal to terminate the cycle. Use of SACK is normally preferable, as it results in the fewest possible wait states being generated. But in some systems, SACK will not generate a sufficient number of wait states, so XACK or a delayed form of SACK must be used. Note that the number of wait states generated by SACK and XACK will vary, depending on whether a refresh cycle is in progress when the memory cycle was requested, and if refresh cycle is in progress, how near it is to completion. SACK is sampled by the 8284A Clock Generator Chip's RDYI or RDY2 input. The 8284A can be programmed to treat these inputs as either synchronous or asynchronous inputs by tying its ASYNC input (pin 15) either high or low, respectively. SACK must be treated as asynchronous unless it has been synchronized to the microprocessor's clock with an external flip-flop. SACK set-up time is shown in Figures 35 and 36, and is calculated in Equation 7. This equation indicates that, . at worst case, one wait state will be generated (n = 1). This satisfies the requirements of the system, namely one wait state for reads and zero (or more) wait states for writes. = SACK Set-Up Time Margin (N 0) (Equation 7.) RD or WR Active to SACK Active Delay (N)TCLCL(5MHz) + t pL Hmin(7404)[I] TCLMLmax(8288) - tCAmax(8203) - tsumin(74S74) o + 1 - 35 - [2(40) + 47] - 3 -164 => 1 wait state wi! be generated (N = 1) We have only looked at "worst case" SACK set-up time so far, to determine the maximum number of wait states that will be generated (assuming no delays due to a refresh cycle in progress). We should look at "best [I] Not specified - use 1 ns. 6-209 210398-001 T2 CLK(8284A) T3 ~ T4 V \ 1\ f\ '\ \ / \ 1\ ~ AMWC(8288) \ 1\ Icc CAS(8203) \ 'l' » "tJ TCHDX ~ o ADo·1s(8086) cO ...... » \ DATA VALID / ~TCVNX \ DEN(8288) ~ !-TELOZ--=-TIVOV- DATA BUS ~ VALID IOH ~ ~ ~ Figure 34. Write Data Hold Time Margin Ap·97A 74532 AO 8086 CPU WE (lOW 8282 BYTE) A'6.'. l,.;t-----",I ADO·'S OUT 0·'1--_ _.,/ m XACR WE a¥s RAM DIlDO s"S:;,SQ READY Figure 35. SACK Set·Up Time Margin T3 T2 TW ClK(8284A) MRDC 1(8288) AMWC SACK(8203) ClK(74574) a(74S74)~ RDY1(8284A) READY(8284A,8086) Figure 36. SACK Set·Up Time Margin 6-211 210398-001 AP·97A case" SACK timing also, to make sure enough wait states are always generated. Note that in Figure 35, SACK goes through an external 74S74 flip-flop; this samples SACK on-half clock cycle earlier than the 8284A does (on the same clock edge that activates MRDC or AMWC), effectively reducing SACK set-up time by one-half clock period. This guarantees the proper number of wait state will be generated for "best case" SACK timing. Adding this flip-flop does not increase the worst case number of wait states generated by SACK. RAM DATA OUT HOLD TIME MARGIN The 8203 CAS output is only held valid for a fixed length of time during a read cycle, after that the RAM data outputs are 3-stated. This time is not long enough to allow the 8086 to read the data from the bus, so the data must be latched externally. This latch should bea transparent type and should be strobed by XACK from the 8203. Because the minimum time from XACK active to CAS inactive is only 10 ns, a latch with a data hold time requirement of 10 ns or less (such as a 74S373) should be used (see Equation 9). In the case where a memory cycle is requested while a refresh cycle is in progress, the memory cycle will be delayed by a variable amount of time, depending on how near the refresh cycle is to completion. This delay may be as long as one full memory cycle if the refresh was just starting; this time is about 650 ns~ depending on the 8203's clock frequency. SACK set-up, read data setup, and write data hold times to the microprocessor's clock are not the same as in the usual case where there is no refresh interference. In this case, SACK is delayed until the read or write cycle has been completed by the RAM, so that there is no possibility of terminating the cycle too soon. RAM Data Out Hold Time Margin, (Equation 9.) from XACK Active tAcKmin(8203) + tOFFmin(2164A - 20) - tHmin(74S373)[11 10+0-10 o OTHER CALCULATIONS pes SET·UP TIME MARGIN The 8203's RD, WR, and ALE inputs must be qualified by PCS in order to perform a memory cycle. If the PCS active set-up time parameter (tpes) is violated, the memory cycle will be delayed. In this case all maximum delays normally measured from command (tCR' tcc, tcA> will be measured instead from PCS active and will be increased by tpcs (20 ns). Minimum tCR, tcc, tCA delays remain the same, but are measured from command or PCS whichever goes active later. If tpcs is violated, care must be taken that PCS does not glitch low while RD, WR, or ALE is active, erroneously triggering a memory cycle. tpcs is not violated in this system, however (Equation 8). PCS Set-Up Time Margin (Equation 8.) CPU Address Valid to Command Active Delay - PCS Decode Time TCLCL(5MHz) + TCLMLmin(8288) [Greater of TCLA Vmax(8086) + TIVOVmax(8282) or TCLLHmax(8288) + TSHOVmax(8282») - tpffiax(8205) -t pcsmin(8203) 200 + 10 - [Greater of (110 + 30) or (15 + 45») - 18 - 20 32 6-212 Equations 3, 4, 6 and 7 may be solved directly for N, where N is the number of wait states, to find how many wait states are required at a given frequency. Alternatively, a number may be substituted for N and these equations solved for the 8086's clock period, TCLCL, to find the maximum microprocessor frequency possible with N wait states. Note that the clock high and low times (TCHCL and TCLCH) are also a function of TCLCL. Be sure to use the proper speed selection of the 8086 in this calculation, as various A.C. parameters are different and the result may be different for different speed selections of the 8086, even at the same frequency. Be sure to check the other equations at this frequency to make sure they are OK, too. Finally, for given values of TCLCL and N, Equations 3, 4, 6, .and 7 may be checked to find the lowest 8203 clock frequency which will allow the same system performance, if it is desired to operate at some frequency other than the 25 MHz we assumed. CONCLUSION This design will operate with, at worst case, one wait state (except for refresh) at microprocessor frequencies up to 6 MHz, using slow (200 ns access time) dynamic RAMs. At 6 MHz, it is limited by a lack of SACK set-up [I) A 74S373 must be used to meet this timing requirement. Even though worst case margin is 0 ns, this is not a critical timing, as valid data will hold on the latch inputs for a considerable time after the RAM outputs 3-state. 210398-001 Ap·97A time. At 5 MHz, the 8203 can be operated at any clock frequency from 18.432 MHz to 25 MHz, still with only one wait state. Example 2. 8086 Alternate Configuration System (5 MHz) Figure 37 shows another 8086 Max mode system at 5 MHz, but this time using the Alternate Configuration, which allows it to operate with no wait states (except for refresh). The system in the previous example was limited by SACK set-up time. SACK set-up time can be improved by sampling SACK later; this has been done by changing the clock edge used to sample SACK, allowing roughly 213 clock period longer. SACK set-up time (and read data access time and write data hold time) margin can also be improved by activating the RD or WR inputs of the 8203 earlier in the 8086's bus cycle; this is the purpose of the extra logic in Figure 37 (l.C.s A8 - All). These generate advanced RD and WR signals timed from the falling edge of ALE, which occurs roughly 1;3 clock· period sooner than the MRDC and AMWC are generated by the 8288 Bus Controller. Altogether, these changes allow about one 8086 clock period more set -up time for SACK. Let's look at this logic in more detail. An Intel 8205 (A8) is used to decode the 8086's status outputs SO.2. An opcode fetch, memory read, or memory write decode to 8205 outputs 4,5, and 6, respectively. These outputs go to the D inputs of two 74S74 flip-flops. The Q output of flip-flop AlO.2 is an advanced memory read signal and the Q output of AIl.2 is an advanced memory write signal. As shown in Figure 37, the 8203 is not activated for opcode fetches, but it can be if 8205 outputs 4 and 5 are ORed with the unused 74SOO gate (A9.4) and the Q output of AlO.2 used instead of Q. Both flip-flops are clocked by the falling edge of ALE to generate the advanced commands. Flip-flop AlO.I is clocked by the trailing edge of either AMWC (Advanced Memory Write Command) or MRDC (Memory Read Command) from the 8288 bus controller (A6), indicating that the 8086 has completed the.memory cycle. AlO.I, in turn, presets both the AlO.2 and All.2 flip-flops to terminate the advanced memory read and write signals to the 8202A. AIO.I is then preset to its initial state by ALE going active at the start of the next bus cycle. Because RAM write cycles are started very early in the 8086's bus cycle using this logic, the 8203 will activate CAS to the RAMs (latching write data) before the data is valid from the 8086. This requires delaying WE to the RAMs and performing a "late write" (explained earlier under Dynamic RAMs) in order to allow more time for the write data to arrive. But the WE signal must not be delayed so long that there is no longer enough data hold time, measured from when WE goes active; or that the WE active to CAS inactive delay spec or the RAM (tRwLl is violated. None of the control signals from the 8086 or 8288 bus controller satisfy both of these timing constraints, so such a signal is generated by flip-flop AI1.I, which serves to delay AMWC from the bus controller by an amount of time equal to TCLCH (the low time of the 8086's clock). AIl.l is also preset by AIO.I at the end of the memory cycle. The Q output of AII.I is ANDed with WE from the 8203 by A14.1 to form a delayed RAM WE. As in the previous example, this signal is then ANDed with BHE and AO to form the WE for the high and low bytes of RAM, respectively. A total" of four packages (three 14-pin and one 16-pin) of TTL logic are required. The dynamic RAM interface timings are identical to the last example (Equations I (a)-(h»; 2164A-20 RAMs will be used again. ADDRESS SET·UP AND HOLD TIME MARGINS Address set-up and hold time margins are given in Equations 10 and II, respectively. An 8086-2 microprocessor has been used instead of the standard 8086, as this speed-selected part gives better address setup to RD or WR times, which this design needs since it uses advanced RD and WR commands. Row Address Set-Up Time Margin l1] (Equation lO.) CPU Address to Adv. RD Delay + RAS Delay - Address Delays TCLCHmin(8284A) + TCHLLmin(8288)[2] + tpLHmin(74Soo)[3] + tpHLmin(74S74)[2] + tCRmin(8203) - [Greater of TCLAVmax(8086 - 2) + TIVOVmax(8282) or TCLLHmax(8288) + TSHOVmax(8282)] - tAIJ11lax(8203) - tAsRmin(2164A-20) ['13(200) -15] + 2 + I + 2 + [(40) + 30] - [Greater of (60 + 30) or (15 + 45)] - 40 - 0 63 Read or write cycles only. Eq. Ib gives this timing for refresh cycles. [2] Not specified - use 2 ns. [3] Not specified - use Ins. [1] 6-213 210398-001 Ap·97A Address Hold Time Margin (N = 0) (Equation 11.) CPU Address Hold Time from Adv. RD Active - RAS Inactive Delays (3 + N)TCLCL(5MHz) + TCHCLmin(8284A) + TCLLHmin (8288) + TSHOVmin(8282) - TCLMLmax(8288) - tccmax(8203) - tRsHmax(8203) (3)200 + ['h(200) + 2] + 2 + 5 - 35 - [4(40) + 85] - [5(40) + 20] 175 READ DATA ACCESS TIME MARGIN Read data access time margin is shown in Equation 12; no wait states are required for read cycles, even with 200 ns access time RAMs. Read Data Access Time (Equation 12.) Margin (N = 0) Adv. RD to Data Valid Delay - CAS Delay - Read Data Delays (2 + N)TCLCL(5MHz) + TCHCLmin(8284A) - TCHLLmax(8288) - tpLHmax(74S00) - tpHLmax(74S74) - tccmax(8203) - tCAcmax(2164A-20) - tplIlax(74S373) - TlVOVmax(8286) - TDVCLmin(8086-2) . (2)200 + ['h(200) + 2] - 15 - 5 - 10 - [4(40) + 85] - 110 - 30 - 30 - 20 3 WRITE DATA SET·UP AND HOLD TIME MARGINS Write data set-up and hold times are shown in Equations 13 and 14, respectively. No wait states are required during write cycles. Note that write data set-up has been guaranteed by delaying WE from the 8203 with clocked AMWC from the bus controller and performing "late write" cycles; write data set-up time would not be satisfied otherwise. Equation 15 verifies that WE has not been delayed too long to meet the RAM's WE active to RAS inactive set-up time (tRWU' The RAM's WE active to CAS inactive set-up time (tcwu is also satisfied, since CAS does riot go inactive until at least 20 ns after RAS. Write Data Set-Up Time Margin (Equation 13.) CPU Data to Clocked AMWC Set-Up + WE Delays - Data Delays TCLCHmin(8284A) + tpHLmin(74S74)[1] + (2)tpHLmin(74S32)[I] - TCLDVmax(8086-2) - TlVOVmax(8286) - tDsmin(2164A-20) [Y3(200) - 15] + 2 + (2)2 - 60 - 30 - 0 34 6-214 Write Data Hold Time (Equation 14.) Margin (N = 0) CPU Data Hold Time from Clocked AMWC , + Data Delays - WE Delays (2 + N)TCLCL(5MHz) TCHDXmin(8086-2) + TlVOVmin(8286) - tpHLmax(74S74) - (2)tpHLmax(74S32) - tDHmin(2164A-20) (2)200 + 10 + 5 - 10 - (2)7 - 45 346 WE Active Set-Up Time Margin (Equation 15.) to RAS Inactive TCHLLmin(8284A) [I] + tpLHmin(74S00)[2] + tccmin(8203) + tRsHmin(8203) - tSKEw(74S74)[3] -(2)tpHLmax(74S32) - tRwLmin(2164A-20) - TCLCL(5MHz) 2 + 1 + [3(40) + 25] + [5(40) - 30] - 2 - (2)7 - 50 - 200 52 SACK SET·UP TIME MARGIN Equation 16 shows that SACK set-up time is satisfied; no wait states will be generated for read or write cycles (except for refresh). SACK Set-Up Time Margin (N = 0) (Equation 16.) (l + N)TCLCL(5MHz) - TCHLLmax(8288) - tPLHmax(74S00) - tpHLmax(74S74) - tCAmax(8203) - tsumin(74S74) 200 - 35 - 5 - 10 [2(40) + 47]- 3 20 [I] Not specified - use 2 ns. [2]· Not specified - use 1 ns. [3] tSKEw(74S74) is max. skew between tpHL(Q output, from CLK) of two Q outputs in same package - use = 2 ns. 210398-001 I~ ~ A16·19 ADo·15 A1 8284A A5YNC "'I'" >-z Ow a:..: >o r ~~_R:::~~:________ ___ 115 A18,'9:>iAo:12 00 745138 A2 8086·2 WE Li\ a: READY ".... ClK 50-2 I vI AO.' (HIGH AO A8 BYTE) 0619::------ I I ' l.'~"_O_ _ _ ___, U 8205 Osr 04 WE 9' ~ RAM 2164A ·20 74500 01 !1.._, DIN I II L _______ _ Dour DIN DATA BUS NOles· Symbol t- indicates connection to Voe through 1~pull·up - - - indicates additional circuitry to zero wait slales. I\) I 6 ~ Figure 37. 8086 Alternate Configuration System :J> "tI cD ..... :J> intJ AP·97A PCS Set-Up Time Margin (Equation 17.) CPU Address Valid to Adv. RD or Adv. WR Delay - PCS Decode Time TCLCHmin(8284A) + TCHLLniin(8288)[IJ + tpLHmin(74S00) + tpHLmin(74S74)[IJ - TCLAVmax(8086-2) - TIVOVmax(8282) - tpffiax(74S138[3J - tpcsmin(8203) [¥3(200) - 15] + 2 + 1 + 2 - 60 - 30 - 12 - 20 1 PCS SET·UP TIME MARGIN PCS set-up time for the 8203 (tpcS> is satisfied, but not with as much margin in the last example (Figure 17). [lJ Not specified - use 2 ns. [2J Not specified - use 1 ns. [3J Must use 74S138 to maintain PCS Set-Up Time Margin. This is because the RD and WR commands are activated earlier in the microprocessor's bus cycle, leaving less time to decode PCS from the address bus. CONCLUSION This design will operate with a guaranteed zero wait states up to 5 MHz using slow (200 ns access time) RAMs. At this frequency, it is limited by both read and write data set-up times, and to a lesser extent, by SACK set-up time. Using faster RAMs will not raise the maximum frequency, as write data and SACK set-up times are not affected by the RAM speed. The 8203 operating frequency must be 25 MHz. This design can be used (with some modifications) to allow one wait state performance up to 8086 clock frequency of 8 MHz. 6-216 210398-001 APPLICATION NOTE Ap·141 October 1981 6-217 order number:210315.001 8203/8206/2164A Memory Design Contents ABSTRACT DESIGN CONCLUSION 6-218 210315-001 AP·141 ABSTRACT DESIGN This Application Note shows an error corrected dynamic RAM memory design using the 8203 64K Dynamic RAM Controller, 8206 Error Detection and Correction Unit and 150 ns 64K Dynamic RAMs with a minimum of additional logic. Figure 1 shows a memory design using the 8206 with Intel's 8203 64K Dynamic RAM Controller and 150 ns 64K Dynamic RAMs. As few as three additional ICs complete the memory control function (Figure 2). The goals of this design are to: 1. Control 128K words x 16 bits (256 KB) of 64K 2. 3. . 4. dynamic RAM. Support 150 ns dynamic RAMs. Write corrected data back into dynamic RAM when errors are detected during read operations. To use a minimum of additional logic. It is not the goal of this design to: 1. Provide the maximum possible performance. 2. Provide features like error logging, automatic error scrubbing and dynamic RAM initialization on power-up, or diagnostics, although these features can be added. For simplicity, all memory cycles are implemented as single-cycle read-modify-writes, shown in Figure 3. This cycle differs from a normal read or write primarily when the dynamic RAM write enable (WE) is activated. In a normal write cycle, WE is activated early in the cycle; 1n a read cycle, WE is inactive. A read-modify-write cycle consists of two phases. In the first phase, WE is inactive, and data is read from the dynamic RAM; for the second phase, WE is activated and the (modified) data is written into the same word in the dynamic RAM. Dynamic RAMs have separate data input and output pins so that modified data may be written, even as the original data is being read. Therefore data may be read and written in only one memory cycle. A17·A, _ _ _ _--,/1 RD-----1'-+aI RD 8203 RASOp----OI WR Cs WR CS RAS11O----0I cAsp-.,---C4 XACK XACK~~~----~---~r- R/1Nt---BMot>---~ BM,t>---~ Tt--t-----' Ao-----+-I Ao BHE BHE '-:I-:-:NT=E::R~F-:-AC:-:E:--' LOGIC Figure 1. 8203/8206 Memory System 6-219 210315-001 inter Ap·141 In order to do read-modify-writes in one cycle, the dynamic RAM's CAS strobe must be active long enough for the 8206 to access data from the dynamic RAM, correct it, and write the corrected data back· into the dynamic RAM. CAS active time is an 8203 spec (tcASl, and is dependent on the 8203's clock frequency. The clock frequency and dynamic RAM must be chosen to satisfy Equation 1. R/W is generated by delaying CAS from the 8203 with a TTL-buffered delay line. This allows the 8206 sufficient time to generate the syndrome; this delay, tDELAY J, must satisfy Equation 2. . (Eq.2) Dynamic RAM tDELAYJ ~ (Eq.I) Dynamic RAM 8203 tCASmin ~ tCAC 5(54)-10 ~ 85 260 ~ 251 8206 8206 ISO Dynamic Dynamic RAM RAM + TDVQV + TQVQV +IDS + + 67 + 59 + 0 + ISO tCWL 40 IN 119 + 34 '" In the event that an uncorrectable error is detected, the 8206 will force the Correctable Error (CE) flag low; this may be used .as an interrupt to the CPU to halt execution and/or perform an error service routine. In this case the 8206 outputs data and check bits just as they were read, so that the data in the dynamic RAM is left unaltered, and may be inspected later. The interface logic generates the R/W input to the 8206. This signal is high. for read cycles and lo~ for write cycles. During a read-modify-write cycle, R/W is first high, then low. The faIling edge of RlW tells rhe 8206 to latch its syndrome bits internally and generatf corrected check bits to be written to dynamic RAM.· Corrected data is already available from the DO pins. ~o control si~nals at all are required to generate corrected data. CAS- ~ 8206 + TDVRL The 8206 uses multiplexed pins to output first the syndrome word anq then check bits. This same R/W signal may be used to latch the syndrome word externally for error logging. The 8206 also supplies two useful error signals. ERROR signals the presence of an error in the data or check bits. CE tells if the error is correctable (single bit in error) or uncorrectable (multiple bits in error). The 8203 itself performs normal reads and writes.· In order to perform read-modify-writes, all that is needed is to change the timing of the WE signal. In this design, WE is generated by the interface logic in Figure 2-the 8203 WE output is not used. All other dynamic RAM control signals come from the 8203. A 20-ohm damping resistor is used to reduce ringing of the WE signal. These resistors are included on-chip for all 8203 outputs. 8203 '" tCAc 85 After R/W goes low, sufficient time is allowed for the 8206 ·togenerate corrected check bits, then the interface logic activates WE to write both corrected data and check bits into dynamic RAM. WE is generated by delaying CAS from the 8203 with the same delay line TIL DELAY LINE 50 100 150 200 250 2011 '-----Wl,-:,~ ] :~:AY SYSTEM ADDRESS BUS DEL~~~~ {Ao--'-------"T"-or"""" BMa r----~~>-_+_+ BHE _+------......,.+-~...J cs-..--" .....,..., ~~~TROL BM1 -] SYSTEM { WR AD -..L......... __ CONT:~~ ___ _ _ _ _ _- , -_ _ _ :T::: ~~~TROL Figure 2. Interface Logic 6-220 210315-001 AP·141 A7. A O:=J<: X ROW COLUMN X \ ~----------------~/ RAS \ ~-------------'/ CAS DO- - - - - - - - - - - - <. ______ .....,,>- vA_L_I_D_ _ _ _ _ DI _______,_____________________________ __J:><:~______V_A_Ll_D______J:><:. ._______ Figure 3. Single·Cycle Read·Modify·Write whole word plus check bits into dynamic RAM, A byte write is implemented as a Read-Modify-Write. used to generate R/W. This delay, tDELAY 2, must be long enough to allow the 8206 to generate valid check bits, but not so long that the tCWL spec of the RAM is violated. This is expressed by Equation 3, Why bother with error correction on the old word? Suppose a bit error had occurred in the half of the old word not to be changed. This old byte would be combined with the new byte, and new check bits would be generated for the whole word, including the biUn error. So the bit error now becomes "legitimate"; no error will be detected when this word is read, and the system will crash. You can see why it is important to eliminate this bit error before new check bits are generated. Byte writes are difficult with most EDC chips, but easy with the 8206. (Eq. 3) Dynamic 8206 tDELAY I 150 8203 + TRVSV S tDELAY 2 :5 tcAsmin - + :5 200 :5 260 :5 200 :5 220 192 42 RAM tCWL 40 Unlike other EDC chips, errors in both data and check bits are automatically corrected, without programming the chip to a special mode, Since the 8203 terminates CAS to the dynamic RAMs a fixed length of time after the start of a memory cycle, a latch is usually needed to maintain data on the bus until the 8086 completes the read cycle. This is conveniently done by connecting XACK from the 8203 to the STB input of the 8206, This latches the read data and check bits using the 8206's internal latches. Referring again to Figure 2, the 8206 byte mark inputs (BMo, BM I ), are generated.from AO and BHE, respectively, of the 8086's address bus, to tell the 8206 which byte is being written. The 8206 performs error correction on the entire word to be modified, but tri-states its DO/WDI pins for the byte to be written; this byte is provided from the data bus by enabling the corresponding 8286 transceiver. The 8206 then generates check bits for the new word. The 8086, like all l6-bit microprocessors, is capable of reading and writing single byte data to memory. Since the Hamming code works only on entire words, if you want to write one byte of the word, you have to read the entire word to be modified, do error correction on it, merge the new byte into the old word inside the 8206, generate check bits for the new word, and write the During a read cycle, BMo and BM[ are forced inactive, i.e., the 8206 outputs both bytes even if 8086 is only reading one. This is done since all cycles are implemented as read-modify-writes, so both bytes of data (plus check bits) must be present at the dynamic RAM data input pins to be rewritten during the second phase of the read-modify-write. Only those bytes actually be6-221 210315-001 inter Ap·141 ing read by the 8086 are driven on the data bus by enabling the corresponding 8286 transceiver. The output enables of the 8286 transceivers (OEBO, OEB1) are qualified by the 8086 RD, WR commands and the 8203 CS. This serves two purposes: 1. It prevents data bus contention during read cycles. 2. It prevents contention between the transceivers and the 8206 DO pins at the beginning of a write cycle. CONCLUSION Thanks to the use of a 68-pin package, the 8206 Error Detection and Correction Unit is able to implement an architecture with separate 16 pin input and output busses. The resulting simplification of control requirements allows error correction to be easily added to an 8203 .memory subsystem with a minimal amount of interface logic. 6-222 210315-001 in1er APPLICATION NOTE AP-167 August 1983 ORDER NUMBER: 230809-001 ©Iniel Corporation, 1983. NOVEMBER 1983 6-223 AP-167 This Application Note will illustrate an iAPX design with the 8207 controlling the dynamic RAM array. The reader should be familiar with the 8207 data sheet, the 80186 data sheet, and a RAM data sheet". INTRODUCTION Most microprocessor based workstation designs today use large amounts of DRAM for program storage. A drawback to DRAMs is the many critical timings that must be met. This control function could easily equal the area of the DRAM array if implemented with discrete logic. DESIGN GOALS The main objective of this design is for the 80186 to run with no wait states with a Dynamic RAM array. The design uses one port of the 8207. The dual port and error correcting interfaces of the 8207 are covered in separate Application Notes. The VLSI 8207 Advanced Dynamic RAM Controller (ADRC) performs complete DRAM timing and control. This includes the normal RAM 8 warm-up cycles, various refresh cycles and frequencies, address multiplexing, and address strobe timings. The 8207's system interface and RAM timing and control are programmable to. permit it to be used in most applications. The size of the RAM array is 4 banks of 64k RAMs or 512k bytes. The memory is to be interfaced locally to the 80186. Integrating all of the above functions (plus a dual port and error correcting interfaces) allows the user to realize significant cost savings over discrete logic. For example, comparing the 8207 to the iSBC012B 512K byte RAM board (where the DRAM control is done entirely with TTL), an 8207 design saved board space (3 in2 vs 10 in2); required less power (420 rna vs 1220 rna); and generated less heat. Moreover, design time was reduced, and increased margins were achieved due to less skewing of critical timings. This comparison is based on a single port design and did not include the 8207's RAM warm-up, dual-port and error correcting features. If these features were fully implemented, there would be no change to the 8207 figures, listed above, while the TTL figures would easily double. USING THE 8207 The three areas to be considered when designing in the 8207 are: • • • 8207 programming logic Microprocessor interface RAM array 8207 Programming The 8207 requires up to two 74LS165 shift registers for programming. This design needs one 8 bit shift register, as shown in Figure 1. The 16 bits in the Program Data Word are set as shown in Figure 2. Refresh is done internally, so the REFRQ input must be tied high. The memory commands are iAPX 86 status, so r - - - - - - - - - - -, SYSTEM \ RESET I .------i----------. I :I V RESET I PClKlMUX I ...---........_--'---""1 I I lOAD ClK I : II PUSO SHIFT REG. QH tLw· .. t I! tt !! L T + r T A IN H -=~. I ~: G PD15 PD8 I L__ ~T2£.N~ 8207 ~ ~ : : : lOAD SERIAL A ClK PUSO SHIFT B DATA IN REG. G QH." PD I H t t t..~ t t t 1 1 __ 1 1 JUMPER OPTIONS PD7 PD¢ I ____ J Figure 1. 8207 programming shift registers 'Ali RAM references in this Application Note are based on Intel's 2164A 64k DynamiC RAM. 6-224 230809-001 Ap·167 +5 +5 SRDyelK S2t----++-'....--+_........ S1t----4-----+_~ 80186 So r""""i;=~!::::::;--__j-1 S240 ADDRESS BUS DATA BUS NOTE: THE 8207 REQUIRES SERIES RESISTORS ON All OUTPUTS TO RAM. Figure 3. 80186 to 8207, non-ECC, synchronous system single port. the timing of EAACK will always guarantee 2 clocks of address hold time from RAS. based upon the CAS access period minus buffer, clock, setup requirements. Acknowledge Setup Time 2 TCLCL - 8207 TCLCSL @ 150 pf (t34) DRAM tCAC - 74S240 propagation delay @ 50 pf - additional bus loading delay (250 pf)(!) - 74S240 delay @ 50 pf - 80186 TDVCL ~ 0 The margin between the 8207 issuing EAACK and the 80186 ready input for no wait states minus delays from clock edges, logic delays, and setup time is calculated as follows. 1 clock - 8207 TCLAKL max - 74S30 tPLH @ 15 pf - 80186 TSRYCL ~ 0 250 ns - 122 - 85 - 7 - 7 - 7 - 20 = 2 ns Write Data Setup and Hold Margin Data from the processor must be valid when WE is issued by the 8207 to meet the RAM specification tDS (2164A = 0 ns), and then held for a minimum of 30 ns. (1) 74STTL logic derated by .05 ns/pf. 74STTL buffers (240, 37) derated by .025 ns/pf. 125 ns - 35 - 22 - 35 = 33 ns Read Access Margin The 8207 starts a memory cycle on the falling clock edge between the 80186's T1 and T2. Data must be valid within 2 clocks. Valid data from the RAMs is 6-225 230809-001 AP-167 o ~11_5 0 0 000 0 0 0 0 0 o 0 0 ____________________8~11~7_____________________0~1 Figure 2. Program data word the PCTLA input must be high when RESET goes inactive. The command timing is determined by the period between the status being issued and the first rising clock edge of the 8207, minus setup and delays. The differential reset circuit shown in the Data Sheet is necessary only to ensure that memory commands are not received by the 8207 when Port A is changed from synchronous to asynchronous (vice versa for Port B). This design keeps Port A synchronous so no differential reset circuit is needed. Microprocessor Interface To achieve no wait states, the 8207 must connect directly to the microprocessor's CLKOUT and status lines. The 8207 Acknowledge (EAACK) must connect to the SRDY input of the 80186. 80186 status valid to 8207 rising clock - status from clock delay - 8207 setup to clock ~ 0 1 TCLCL - 80186 TCHSV max - 8207 TKVCH min ~ 0 125 ns - 55 - 20 = 50 ns PE is a chip select for a valid address range. It can be generated from the address bus or from the 80186' s programmable memory selects. This. design uses an inverted A19. The timing is determined by the interval between the address becoming valid and the falling clock edge, minus setup and delays. When the 80186 is reset, it tristates the status lines. The 8207 PCTLA input requires a high to decode the proper memory commands. This is accomplished by using a pull-up resistor or some component that incorporates a pull-up on S2. The 8207 address inputs are connected directly to the latched/demultiplexed address bus. RAM Array The 8207 provides complete control of all RAM timings, warm up cycles, and refresh cycles. All write cycles are "late writes." During write cycles, the data out lines go active. This requires separate data in/out lines in the RAM array. To operate the 80186 with no wait states, it is necessary to chose sufficiently fast DRAMs. The 150 ns version of the 2164A allows operating the 80186 at 8 MHz, and the 200 ns version up to 7 MHz. 80186 address valid to 8207 falling clock edge - 80186 address from clock delay - 8283 latch delays - 8207 PE setup ~ 0 1 TCLCL - 80186 TCLAV max - 8283 IVOV @ 300 pf - 8207 TPEVCL ~ 0 125 ns - 44 - 22 - 30 = 29 ns The hold times are 0 ns and are met. Address Setup For an 80186 design, the 8207 requires the address to be stable before RAS goes active, and to remain stable for 2 clocks. Unused 8207 address inputs should be tied to Vcc. tASR is a RAM specification. If it is greater than zero, this must be added to the address setup time of the 8207. Address setup is the interval between addresses being issued and RAS going active, minus appropriate . delays. HARDWARE DESIGN 80186 address valid to 8207 RASactive 80186 address from clock delay - bus delays (8207 setup + RAM tASR) ~ 0 Figure 3 shows a block diagram of the design, and Figure 4 is a timing diagram showing the relationship between the 8207 and the 80186. TCLCL + 8207 TCLRSL min @ 150 pf(l) 80186 TCLA V max - 8283 IVOV max @ 300 pf - (8207 TA VCL min + DRAM tASR) ~ 0 8207 Command Setup Two events must occur for a command to be recognized by the 8207. The 80186 status outputs are sampled by a rising clock edge and Port Enable (PE) is sampled by the next falling clock. edge (refer to the Data Sheet wave forms). 125 ns + 0 - 44 - 22 - (35 + 0) = 24 ns The address hold time of 2 docks + 0 ns is always met, since the addresses are latched by the 828213. Even when the processor is in wait states (for refresh), (1) Not specified-use 0 ns. 6-226 230809-001 AP-167 TCLCL + TCLCH + 8207 TCLW min(l) + 74S 37 delay tPHL min @ 50 pf + additional loading (142 pf) - 80186 TCVCTV 74S240tPZL - bus delays (250 pf) - 74S240 delay - 2164A tOS ;;. 0 62.5 ns + 10 + 2 + 3 + 7 + 3.5 - 35 3.5 - 30 = 19.5 ns All margins are actually better by about 10-20 ns. No improvement in timing was allowed for lower capacitive loads when additional buffers are used (i.e. the 80186 address out delay is at 200 pf, but the 8283 latch only loads these lines with about 20 pf). 125 + 62.5 + 0 + 6.5 + 3.5 - 70 - 15 - 7 - 7 98.5 ns o= The hold time, tDH, is from WE going low to the 80186 DEN going high plus buffer delays minus WE from clock delays. SUMMARY TCLCL - 80186 TCVCTX min + 74S32 tPD(2) min + 74S240 tPHZ (min)(2) + 250 pf bus delays + 74S240 propagation delay min 8207 TCL W max - 74S37 tPHL @ 50 pf 142 pf loading delays - DRAM tOH ;;. 0 The 8207 supports the 80186 microprocessor running with no wait states. The 8207 interfaces easily between the microprocessor and dynamic RAM. There are no difficult timings to be resolved by the designer using external logic. 8 MHz 8207 RASO 8207 RAS1 8207 CASO 8207 CAS1 8207 WE _ _ _~_--, 8207 EAACK 80186 (SRDY) WRITE CYCLE NOTES: . 1. COMMAND SETUP MARGIN 2. PE SETUP MARGIN 3. EAACK SETUP MARGIN 4. DATA SETUP MARGIN 5. READ ACCESS MARGIN READ CYCLE REFRESH CYCLE READ CYCLE -I Figure 4. 8207/80186 timing relationship (1) Not specified, use 0 ns. (2) Not specified, use one half of typical value. 6-227 230809-001 intJ APPLICATION NOTE A,P-168 August 1983 ORDER NUMBER: 230862·001 ©Intel Corporation, 1983. 6-228 NOVEMBER 1983 inter AP-168 INTRODUCTION 8207 INTERFACE The 80286 high speed microprocessor pushes microprocessor based systems to new performance levels. However, its high speed bus requires special design considerations to utilize that performance. Interfacing the 80286 to a dynamic RAM array require many timings to be analyzed, refresh cycle effects on bus timing examined, minimum and maximum signal widths noted, and the list continues. The 8207 Memory design can be subdivided into three sections: The 8207 Advanced Dynamic RAM Controller was specifically designed to solve all interfacing issues for the 80286, provide complete control and timing for the DRAM array, plus achieve optimum system performance. This includes the normal RAM 8 warmup cycles, various' refresh cycles and frequencies, address multiplexing, and address strobe timings. The 8207 Dynamic RAM Controller's system interface and RAM timing and control are programmable to permit it to be used in most applications. The RAM timing is configured via the 16 bit program word that the 8207 shifts-in when reset. This can require two 74LSI65 shift registers to provide complete DRAM configurability. The 8207 defaults to the configuration shown in Table 1 when PDI is connected to ground. This design does not need the flexibility the shift registers would allow since standard 8207/80286 clock frequencies, DRAM speeds and refresh rates are used. Table 1 details the 8207/80286 configuration and Table 10 in the Data Sheet identifies "CO" as the configuration of the 8207 all timings will be referenced to (80286 mode at 16 MHz using fast RAMs = CO). • Programming the 8207. • The 80286/8207 interface. • The Dynamic RAM array. Programming the 8207 Integrating these functions (plus dual port and error correcting interfaces) allows the user to realize significant savings in both engineering design time, PC board space and product cost. For example, in comparing the 8207 to the ISBC012B 512k byte RAM board (where the DRAM timing and control is done entirely with TTL), the 8207 design saved board space (3 in2 vs 10 in2); used less power (420 ma vs 1220 ma); reduced the design time; and increased margins due to less skewing of timings. The comparison is based upon a single port 8207 design and does not include its RAM warm-up, dual port, error correcting, and error scrubbing or RAM interleaving features. Table 1. Default Non-ECC programming, PD1 pin (57) tied to ground. Port A is Synchronous (EAACKA and XACKA) Port B is Asynchronous (LAACKB and XACKB) Fast-cycle Processor Interface (10 or 16 MHz) Fast RAM 100/120 ns RAM Refresh Interval uses 236 clocks 128 Row refresh in 2 ms; 256 Row refresh in 4 ms This Application Note will detail an 80286 and 8207 design. The reader should have read the 8207 and the 80286 data sheets, a DRAM data sheet*, and have them available for reference. Fast Processor Clock Frequency (16 MHz) "Most Recently Used" Priority Scheme 4 RAM banks occupied DESIGN GOALS The main objective of this design is to run the RAM array without wait states, to maximize the 80286's performance, and to use as little board space as possible. The 80286 will interface synchronously to Port A of the 8207 and the 8207 will control 512k bytes of RAM (4 banks using 64k DRAMs). The dual port and error correcting features of the 8207 are covered in separate Appltcation Notes. The '8207 will accept 80286, status inputs when the PCTLA pin is sampled low at reset. This pin is not necessary for an 80286 design (besides programming) and is tied to ground. Refresh is the final option to be programmed. If the Refresh pin is sampled high at reset, an internal timer "All RAM references in this Application Note are based upon Intel's CMOS 51C64-12 64k Dynamic RAM. Any DRAM with similar tim· ings will function, Refer to section 4.4. . 6-229 230862-001 inter AP-168 is enabled, and if low at reset, this timer is disabled. The first method is the easiest to implement, so the RFRQ pin is tied to Vcc. The differential reset circuit shown in the Data Sheet is necessary only to ensure that memory commands are not received by the 8207 when Port A is changed from synchronous to asynchronous (vice versa for Port B). This design keeps Port A synchronous so no differential reset circuit is needed. RAM Array The 8207 completely controls all RAM timings, warmup cycles, and refresh cycles. To determine if a particular RAM will work with the 8207, calculate the margins provided by the 8207 (Table 15, 16-8207 Data Sheet) and ensure they are greater than the RAM requirement. An additional consideration is the access times of the RAMs. The access time of the system is dependent upon the number of data buffers between the 80286 and the DRAMs. To operate the 80286 at zero wait states requires access times of 100-120 ns. Slower RAMs can be used (150 ns) by either adding a wait state (programming the 8207 for "Cl ") or reducing the clock frequency (to 14.9 MHz approximately and maintaining the CO configuration.) start. LEN will then go high two clocks after RAS starts, since addresses are no longer needed for the current RAM cycle. Thus the low. period of LEN could be much longer than listed in the Data ·Sheet. DESIGNING THE HARDWARE Figure 1 shows a detailed block diagram of the design and Figure 2 shows the timing relationship between the 8207 and the 80286. The following analysis of six parameters will confirm that the design will work. These six system parameters are generally considered .the most important in any microprocessor-,Dynamic RAM design. . 8207 Command Setup Margin Two events must occur for the 8207 to start a memory cycle. Either RD or WR active (low) and PE must be low when the 8207 samples these pins on a falling clock edge. If PE is not valid at the same clock edge that samples RD or WR active, the memory cycle will be aborted and no acknowledge will be issed. The command setup time is based upon the status being valid at the first falling clock edge. 80286 status valid to 8207 falling clock 80286. status from clock delay - 8207 command setup to clock ~ 0 TCLCL - 80286 tl2 (max) - 8207 TKVCL (min) ~ 0 62.5 - 40hs - 20ns = 2.5ns All write cycles are "late writes" and the data out lines of the RAM will go active. This will require separate data in and out lines in the RAM array. Another consideration for the RAM array is the proper layout of the RAM, and impedance matching resistors on the 8207 outputs. Proper layout is covered in Intel's RAM . Data Sheets and Application Notes. PE is decoded from the address bus and must be set up to the same falling clock edge that recognizes the RD, WR inputs. This margin is determined from the clock edge that issues the address and the clock edge t.hat will recognize RD or WR, minus decoding logic delays. Microprocessor Array To achieve no wait state operation, the 8207's clock input must be connected to the 80286's clock input. The EAACK (early acknowledge) output of the 8207 must connect to the SRDY input of the 82284 .. The 8207's address inputs connect directly to the 80286 address outputs and the addresses are latched internally. This latch is strobed by an internal signal with the same timing as LEN (which is for dual port 80286 designs). Figure 2 shows the timing relationship between LEN and the 80286. There are 2 clocks between addresses being issued by the 80286 and PE being sampled by the 8207. Then the 80286 address delay from the clock edge and decoding logic delays are subtracted from this interval. This margin must be greater than O. 2TCLCL - 80286 tl3 (max) - 8207 TPEVCL (min) ~ 0 125 - 60 - 30 = 35ns The address decode logic must use no more than 35 ns (and less is better). Figure 3 shows an easy implementation which uses a maximum of 12 ns. LEN will fall from high to low, which latches the bus a4dress internally, when a valid command is received. LEN can go high in two clock cycles if the RAM cycle started (RAS going low) at the same time LEN went low. If the 8207 is doing a refresh cycle, the 80286 will be put into wait states until the memory cycle can The 8207 requires a zero ns hold time and is always met. 6-230 230862-001 AP-168 82284 ~------~~ SRDYr--------------, ClK t ClK ALE ...-------, 82288 OE~___ OTIR MilO S1 SO "REi'i1iY Cl~ Y ~ MilO I S1 t +5 ClK AACK A00R,...-------'........ RFRQ STROBES y " " PCTl POI ~ V - RO 8207 WE t- V SO WR PSEN AOOR IN lEN 80286 MEMORY (UPPER) WE 01 ~=;-;::::~~::::J'I ~ 7 =;oJ U ~-~l~~~---~-------~ AOOR DATA r-----~ '-1::fJo- r--~~J ~O ST8 80 Y-------IO a _ 7474 .--__'-_--..-+-8;;.;H-E--<.... 0 a ~ VI r---- AAcK L1 y MEMORY (lOWER) WE DO 01 DO I r- AO OE ~ 74S240 ~ ~ T --t""t>- OE 8287 STB ACCK ""'-..J>- OBM 8283 OE {t {} DATA AOOR 74S240 NOTE: THE 8207 REQUIRES SERIES RESISTORS ON All OUTPUTS. Figure 1_ 80286 to 8207, non-ECC, Synchronous System Single Port 6-231 230862-001 inter AP-168 Ts Te I I Ts I T1 I Te I Te Te I I 16 MHz CLOCK S0-81 80266 ADDR. LEN RASO RAS1 DRAM WE Figure 2. 80286/8207 Timing-"CO". +5 74S04 A23 A22 8207 PE A21 74S30 A20 A19 Figure 3. Address Decode Logic 6-232 230862-001 \ AP-168 Address Setup Margin Acknowledge Setup Margin The 8207 must have stable addresses up to two clocks after RAS goes active. This is of no concern to the user, since LEN latches the address internally and will not admit a new address until two clocks after RAS goes active. The 8207 acknowledge (EAACK) can be issued at any point in the 80286 bus cycle (end of ~I or ~2 of Ts or Tc). If EAACK is issued at the end of ~2 (Ts or Tc), the 80286 will complete the current bus cycle. If EAACK is issued at the end of ~I of Tc, the 82284 will not generate READY to the 80286 in time to end the current bus cycle. A new Tc would then be generated and EAACK would now be sampled in time to terminate the bus cycle. EAACK is 3 clocks long in order to meet setup and hold times for either condition. Addresses must be stable at least 35 ns (tAVCL) before RAS goes active to allow for propagation delays through the 8207, if a RAM cycle is not delayed by the 8207. tASR is a RAM specification. If it is greater than zero, tASR must be added to the address setup time of the 8207. Address setup is the interval between addresses being issued, by the 80286, and RAS going active, minus appropriate delays. The margin is determined from the number of clocks between addresses being issued from the 80286 to RAS going active. Exactly when RAS goes active is unimportant, since here we are interested only in the clock edge. 2TCLCL - 80286 t13 (max) - 8207 TA VCL (min) ~ 0 125 - 60ns - 35ns = 35ns ~ We need the margin between the 8207 issuing EAACK and the 82284 needing it. Figure 4, shows a worst case example. TCLCL - 8207 TCLAKL max - 82284 t II 62.5 - 35 - 15 = 12.5ns ~ 0 Read Access Margin The 8207 will typically start a memory cycle (i.e. RAS goes low) at the end of ~I of Ts. But if the start of a memory cycle is delayed (by a refresh cycle for instance), then RAS will be delayed. In the first case, ~mn Th Figure 4. Acknowledge to the 82284 6-233 230862-001 AP-168 this represents 3 clocks and the second case could re. quire 4 clocks to meet the data setup requirements of the 80286. In either case, data must be valid at the end of Tc. The 8207 holds CAS active long enough to ensure valid data is received by the 80286 in dther case. So any DRAM that has a RAS access period less than .135 ns, a CAS access period less than 73 ns, and meets all requirements in the DRAM Interface Timing (Table IS, 16-8207 Data Sheet), will work. DRAMs specify two access times, RAS access (tRAC) and CAS access (tCAC) Both access periods must be calculated and the one with the least inarginused. Also the number of data buffers should be kept to a minimum. Too many buffers would require either faster (more expensive) DRAMs, or a reduction in the performance of the CPU (by adding wait states). Write data from the processor must be valid when the 8207 issues WE to meet the DRAM specification tDS and then held to meet the tDH requirement. Some write cycles will be byte writes and the information to determine which byte is decoded from AO and BHE/. Since the 80286's address bus is pipelined, these two signals can change before the RAM cycle starts, hence they must be latched by LEN. PSEN is used in .the WE term to shorten the WE pulse. Its use is not essential. Write Data Setup and Hold Margin RAS Access Margin Data must be set up to the faIling edge of WE, since WE occurs after CAS. The 2 clocks between valid write data and WE going active (at the RAM's) minus propagation delays determines the margin. 3TCLCL - 8207 TCLRSL max @ 150 pf DRAM tRAC - 74S240 propagation delay max @ 50 pf - 80286 t8 ~ 0 187.5 - 35 - 120 - 7 - 10 = 15.5ns 2 TCLCL - 80286 t14 (max) @ 100 pf 74S240 tplh + 8207 TCLW (min)1 + 74S1O tphl @ 192 pf2 - DRAM tpS = 0 CAS Access Margin 125 - 50 - 7 2TCLCL - 8207 TCLCSL max @ 150 pf - DRAM tCAA (or tCAC - 74S240 tplh max @ 50 pf 80286 t8 ~ 0 125 - 35 - 60- 7 - 10 + 0 + 14 - 0 = 82ns The timing of the 8207's acknowledge is such that data will be kept valid by the 80286, for more than two clocks after WE goes active. This easily meets all RAM tDH specifications. = 13ns By solving each equation for iRAC and tCAC, the speed requirement of the RAM can be determined. SUMMARY The 8207 complements the 80286's performance and high integration with its own performance, integration and ease of use. No critical timings or logic design has been left to the designer. The 80286/8207 combination allows users to realize maximum performance from their simpler design. DRAM tRAC = 3 rCLCL- 8207 TCLRSL 74S240 tplh - 80286 t8 = 135.50s DRAM tCAC = 2 TCLCL - 8207 TCLCSL 74S240 tplh - 80286 t8 = 73ns 1. Not specified. Assun1e no delay for worst case analysis. 2. STTL derated by .05nsipf. 6-234 230862-001 AR-364 7231B APPLICATION BRIEF INTERFACING THE DYNAMIC RAM CONTROLLER TO THE iAPX 186 Jim Sleezer 1.0 INTRODUCTION The 80186 microprocessor has integrated about 20 typically used system components into the same package as the microprocessor. This integration saves board space and design-in time. The 8208 Dynamic RAM Controller continues this system level integration. It is designed to control up to 256 Kbytes of Dynamic RAM (DRAM) using 64 K x 1 DRAMs. and up to 1 Mbyte using 256 K x 1 DRAMs. Besides generating all DRAM control and timings. the 8208 allows various refresh types. frequencies. and microprocessor interfaces. Additionally. the 8208 does the 8 DRAM warm-up cycles back-to-back to prepare for operation. By integrating the entire RAM timing and programmable refresh types. refresh rates. and interfaces into a single package. the user realizes significant savings in development time and board space. For example. a quick comparison of the 8208 versus a TTL implementation (using just the DRAM timing logic from Intel's iSBC012B memory board) yielded the following results: 1) a reduction in board space (10 in 2 to 3 in 2 ). 2) a reduction in power (1.2 A to 300 ml\). and 3) much less design time (1 day). The difference would be greater still if RAM warm-up. refresh. and interface programmability were added to the TTL implementation. This Application Note will examine an 8208 to 80186 design. The reader should already have read the 8208 Data Sheet. the 80186 Data Sheet. and a DRAM Data Sheet*. * While all DRAM references in this Application Note are based upon Intel's 2164A-15 64 K x 1 Dynamic RAM. any DRAM that meets the timing requirements in the Data Sheet. Table 8. and A.C. Characteristics. plus satisfies the Read Data Access Margin. will work. 6-235 inter 2.0 AR-364 HARDWARE DESIGN An 8208 design can be divided into three areas: programming the 8208, DRAM compatibility, and system interface. While each topic will be covered in this Application Note, the 82081 s programming logic defaults to an 8 MHz 80186 synchronous status interface with 150 ns access RAMs. All programming, RAM timings, and interface issues are satisfied for that configuration. 2.1.0 8208 PROGRAMMING On the trailing edge of Reset, the 8208 samples the levels on two input pins and clocks in a 9 bit serial programming word. One input pin controls the type of refresh to be performed, while the other input pin alters the edge on which the 8208 samples memory commands. The program word further configures the 8208 for a refresh rate as a function of 8208 clock frequency, synchronous or asynchronous operation, and either an advanced acknowledge or Multibus compatible acknowledge. 2.1.1 REFRESH TYPES If the REFRQ pin is sampled high at reset, an internal refresh timer is enabled; a low disables it. Both modes allow an external refresh cycle request by pulsing theREFRQ pin. An external request is generated by a low-to-high transition, and sampled by an 8208 (clock edge). Burst refresh occurs only when the timer is disabled and the REFRQ pin is sampled by ,two falling clock edges. The easiest method is to tie the REFRQ pin to Vcc (through a pull-up resistor); refresh cycles are transparent to the user. 2.1.2 8208 COMMANDS The 8208 alters the point at which it samples a command and its response to the command inputs, based on the level sampled on PCTl when reset goes inactive. A high enables the status interface and a rising clock edge is used (this would be the middle of the Tl state; refer to the Timing Diagram). If low, the Multibus compatible interface is selected and a falling edge is used to allow for more propagation delay. '6-236 AR-364 When the status interface is used, the status lines must be externally pulled up. The 80186 will tristate them when reset and the proper level (high) may not be seen by the 8208. 2.1.3 PROGRAM WORD The program word defaults to a synchronous interface, fast acknowledge (for no wait states), and a refresh rate compatible with an 8 MHz clock (128 row/2 ms; 256 row/4 ms). When operating the 8208 at 8 MHz, most designs will not need to alter any programming bits and the POI input pin can be tied to ground. If the 8208 is not run at 8 MHz a 74LS165-type shift register is needed to adjust for a proper refresh rate; otherwise, refresh cycles would not be performed often enough and data would be corrupted. 2.1.3.1 REFRESH RATE OPTIONS (CIO, CI1, PLS, FFS) These four programming bits permit almost any DRAM to be used without wasting memory bandwidth. The combination of these four bits selects one of sixteEn clock intervals as shown in Table 1. ICoum In,erval CI1, CIO (8208 Clock P.II0d.) I I CFS I I I PLS I FFS 0 I ! 0 I 0 I , ! 0 I I I 0 I , 0 I I 0 I 0 Table 1. 00 II (0%) I 118 I ., II I I 01 (10%) ! , i I ! 10 i 11 (30%) I (20%) 106 i 94 I 82 i 53 i 47 ; 41 74 ! 66 58 50 37 , 33 29 25 59 Refresh Count Intervals 6-237 AR-364 The 8208 does not alter any other of its functions with these four bits. To determine which combination of bits to use, examine the following equation: Equation 1. Refresh Rate = count interval x 8208 clock period 14.6 usec = count interval x 190 ns 14.6 usec/.190 = 76.8 count interval The next fastest Count Interval of 74 is chosen from Table 1. The bit configuration is: PLS = 1; FFS = 0; CIl = 0; CIO = 0, and generates seventy-four 8208 clocks between refresh cycles. A refresh cycle can be delayed up to one 8208 RAM cycle from the time it was requested to the time it is serviced. Thus, the 14.6 usec refresh rate is chosen to allow for these delays. The 190 ns clock period was picked at random. The refresh timer. is restarted when the cycle is requested and not when the cycle begins ____ executing. Note the difference in the sense of the programming bits. PLS = 0 is the same as PLS = 1. This notation is used throughout the Data Sheet. 2.1.3.3 INTERFACE OPTIONS (S", X) The S programming bit adds synchronizers to the 8208's inputs when input signals cannot meet setup and hold times. The RD, WR inputs are still decoded as determined by PCTL, but these inputs will ·be sampled on a falling edge (status or command interface). The X bit allows either an 80186 (8086) no wait state acknowledge or an XACK (Multibus) type acknowledge. A synchronous interface should use the advanced acknowledge and an asynchronous interface the XACK acknowledge. XACK is removed by the inactive edge of RD or WR. If RD or WR goes inactive before the 8208 issues XACK, then no XACK is issued. 2.1.3.3 OTHER OPTIONS (~, mr, RFS) The CFS bit must be set to zero. This bit is reserved for future speed enhancements of the 8208. RFS has no effect on 8208 timings and may be set to . either state. It is to be used with faster 8208's. RB is to allow for 32 bit wide memory arrays. If an 8 or 16 bit wide system is used, set this bit to its active state (RB = 0). The Bank Select pin must not select a RAM bank that is not physically present. 6-238 _I® I"n+'e' 2.2 AR-364 MICROPROCESSOR INTERFACE The 8208's timings are optimized for an 8086 and 80186 system. The synchronous status interface offers the best performance (i.e., no wait states) and is the easiest to implement. 2.3 DRAM COMPATIBILITY Table 2 lists the equations to determine whether a particular DRAM will work with the 8208. Four other questions are listed in the A.C. Characteristics Section in the 8208 Data Sheet. Par.mel.. IRP ICPN IRSH ICSH ICAH tAR IT IRC IRAS ICAS IRCS tRCH Rd. RI' Cye:... 2TC1.C1.-T26 2.5TC1.C1.-T3! 3TC1.CL-T~ 3TCLCL-T26 2TCLCL-T306 2TCLCL-T26 3130 HCLCL 2TCLCL-T26 3TCLCL-T306 , .5TCLCL-TCL-T36-TBUF O.5TCLCL-T~ P.r_lef IRP tCPN tRSH !CSH !CAH tAR IT IRC tRAS !CAS tWCH tWCR IWP tAWL !CWL lWCS , I HOI" , ,I , , 2 , , , , , Table 2. WA CyclH 2TCLCL-T26 2.STC1.CL-T35 3TCLCL- T306 4TCLCL-T26 2TCLCL-T'34 3TCLCL-T26 3130 6TC1.CL 4TCLCL-T26 TCLCL-T34 3TCLCL-T34 HCLCL-T26 HCLCL-T36-TBUF 4TCLCL-T36-TBUF 4TCLCL-T36-T8UF TCLCL-T36-T8UF HOIH , i I , , , , , i 2 ! , , , '.3 '.3 i , , , , I DRAM Equations These equations merely determine if the 8208 will provide proper margins for a DRAM. Whether a RAM works properly in a system is another issue. The Hardware Design Example section examines most of the important system timings. 6-239 inter 3.0 AR-364 HARDWARE DESIGN EXAMPLE The objective is to have the 80186 run without wait states when accessing a DRAM array. The total amount of DRAM is 128K bytes and will be organized as 1 bank of 64K words. Figure 1 is a block diagram of our design showing all relevant logic. The programming shift register is not needed since the 8208 will be operating at 8 MHz, and the other defult values are required. A data buffer is required in a no wait state design, since during reads the 8208 CAS line drives data onto the bus up to 50 ns past the end of T4. If another bus cycle were starting, then the multiplexed address/data lines would conflict with the driven data bus. This would reduce the systems' address to ALE setup margins. Figure 2 is a timing diagram of the design. The timing parameters that are examined ensure that this portion of the system will operate,properly. The parameters are: 1. Command setup and hold margin. 2. Address setup and hold margin. 3. Acknowledge setup and hold margin. 4. Write data setup .and hold margin. 5. Read access margin. ACKNOWLEDGE SETUP AND HOLD MARGIN 3.1 The 8208 early acknowledge (AACK) is intended to be connected to the SRDY input on the 80186 after being inverted. The AACK is issued at the beginning of T2 and must be valid at the beginning of T3. lTCLCL - 8208 TCLAKL max - 7410 tPLH @ 15 pf. - 80186 TSRYCL min _ 0 125ns - 35 - 22 - 35 33 ns = 6-240 inter AR-364 The 80186 hold requirements. TCLSRY. of 15 ns is always met. The 15 ns hold time applies only when READY is being looked at by the 80186. Transitions that occur anywhere else in the bus cycle have no effect. AACK is two clocks long and is issued from a falling clock edge. AACK would always be sampled one clock into its duration. There would be a hold time of about 1 clock. 3.2 COMMAND SETUP AND HOLD MARGIN Two events must occur for the 8208 to recognize a valid memory command. The 80186 status outputs are sampled by a rising clock edge (middle 'of Tl typically) and PE is sampled on the very next falling clock edge. If PE is not sampled at this point. no memory cycle will start. The status lines would have to go inactive before requesting another memory cycle. The status setup margin is referenced to the middle of T4 or TI. and is required to be valid by the middle of Tl. lTCHCH - 80186 TCHSV max - 8208 TKVCH min 0 125 ns - 55 ns - 20 ns 50 ns = PE setup margin is referenced to the beginning of Tl and must be valid by the end of Tl. PE selects the 8208 for a valid address range. It can be generated from either the address bus or using the 80186's programmable chip selects. 1 TCLCL - 80186 TCLCSV max - 8208 TPEVCL min 0 125 - 66 - 30 29 ns = Both PEand the RD. WR. and PCTL inputs require a 0 ns hold time to their respective clock edges. 6-241 AR-364 The 8208 latches this information internally for cases when a refresh cycle. delays a memory cycle from starting. Thus, a cycle will start when the refresh cycle finishes, even if the status signals have gone inactive •. The hold margin is always met. 3.3 ADDRESS SETUP AND HOLD MARGINS The 8208 requires the addresses to be stable before RAS goes active, and to remain stable for two clock periods thereafter. Unused address inputs should be pulled up to Vcc with a resistor. The 8208 generates a margin of 0 ns minimum for the DRAM specification tASR when the 8208 specification TAVCl is met. If some DRAM is found that needs a more positive margin for tASR, then this requirement must be added to TAVCl. The setup margin is between the clock edge that addresses are issued from to the 8208 issuing RAS, minus delays. 1 TClCl + 8208 TClRSl min[l] (@ 150 pf) - 80186 TClAV max 8282 IVOV max (@ 300 pf) - [8208 TAVCl min + DRAM tASR] _ 0 125 ns + 0 -44 - 30 - (35 + 0) 16 ns = The 8208's address bus is divided into two halves. AlO-8 becomes the DRAM row address outputs and AHO-8 becomes the column addresses (64K DRAMs would need AlO-7 and AHO-7 connected to the address bus, Al8, AH8 would be tied to Vcc). Internally, the 8208 latches AHO-8 with CAS to provide for tCAH - column address hold time. This latching occurs near the end of T2 for read cycles and near the end of T3 for write cycles. When the RAM cycle is delayed due to refresh, the timing of AACK will ensure the two clock hold requirement. No equation is provided since this happens internally. . [1] Since this is not specified, 0.wi11 be used for analysis only. upon design information this value would be about 20 ns. 6-242 Based inl:el® 3.4 AR-364 WRITE DATA SETUP AND HOLD MARGIN During write cycles, data from the 80186 must be valid at the DRAM when CAS goes low, and satify the DRAM tDS specification. Data must then be held valid and referenced to CAS long enough to meet the DRAM specification tDH. In this design example DEN is the limiting factor in the data setup margin. DEN is active before data is issued by the microprocessor, but there is a significant delay before the buffer is active. The result is that write data will be valid at the buffer before it is fully capable of transmitting data. The margin is referenced to the clock edge that issues DEN and the clock edge that issues CAS, minus delays. TCHCL + 1 TCLCL = 8208 TCLCSL min (@ 150 pf) 80186 TCVCTV max - 74LS245 TPZH max - DRAM TDS 0 55 + 125 + 62.5 - 70 - 40 - 0 = 132 ns The hold margin is referenced to the edge that issues CAS and when valid data disappears. DEN is the controlling signal because it can go inactive before the data bus is floated by the microprocessor. 1 TCLCL + 1 TCLCH + 80186 TCVCTX min + 74LS245 TPLZ min[l] 8208 TCLCSL max (@ 150 pf) - DRAM. TDH _ 0 125 ns + 55 + 10 + 7.5 ~ 121 - 30 = 46.5 ns The WE pulse length may cause problems with back-to-back bus cycles. Shortening the pulse width will not cause any other problems. The easiest solution is to factor in a shorter width signal, such as AACK, as is done in the design example. [1] This parameter is not specified. For analysis, either assume 0 ns or use a more realistic value, such as one-half of typical. 6-243 3.5 READ DATA ACCESS MARGIN The design example requires a buffer in the data path because the 8208 will not stop driving data onto the bus until after the end of T4. With back-to-back bus cycles this would cause bus contention and reduce address to ALE setup margins. The DRAM access parameter used is called "TCAC", and is referenced from the CAS active edge - not RAS. This parameter varies widely between manufacturers. When analyzing read access margins, some trade-off between buffer speed and TCAC delays must be considered. The 8208 starts a memory cycle, typically, at the end of T1, and data must be valid at the end of T3. With [refresh cycle] delayed bus cycles, data would still have to be valid in two clocks. The timing of the AACK signal guarantees this. From this two clock margin, buffer delays, TCAC delays, and others must be subtracted. 2 TCLCL - 8208 TCLCSL max (@ 150 pf) - DRAM TCAC max (@100 pf) - buffer delays max - 80186 TDVCL min 0 250 ns - 121 - 85 - 12 - 20 12 ns = 4.0 SUMMARY The 8208 solves most of the many design issues faced when adding a dynamic RAM array by giving the designer options. Options for various types of DRAMs, clock speeds, and system configurations. The margins that were just examined showed that the 8208 has plenty of margin in a system. Several margins were even higher. The READ DATA ACCESS MARGIN, for example, is considerably greater. The access time for DRAMS is specified with 100 pf loads, yet this was not added into the equation. Each designer should verify this analysis as specifications from manufacturer's change, without notice. 6-244 AR-364 n T2 T3 T4 Tl T2 T3 ALE ADO·IS \'--------! ~iCK-----------_1-------------------I-.....!...-_ _ _I \I......_ _ -- 2.2V TEST POINTS 0.45 0.8 A.C. TESTING LOAD CIRCUIT < 2.2V DEVICE UNDER TEST 0.8 A.C. TESTING: INPUTS ARE DRIVEN AT 2.4V FOR A lOGIC "1" AND O.45V FOR A LOGIC "0." TIMING MEASUREMENTS ARE MADE AT 2.2V FOR A LOGIC "1" AND O.BV FOR A LOGIC O. i}CL=15DPF CL INCLUDES JIG CAPACITANCE 6-272 231308-001 8253/8253·5 WAVEFORMS READ TIMING WRITE TIMING 110-1' CS DATA BUS ----------Jl~----r-~~~-- DATA CLOCK AND GATE TIMING 6-273 231306-001 8254 PROGRAMMABLE INTERVAL TIMER with all Intel and most • Compatible other microprocessors • Three Independent 16-bit Counters Inputs from DC to 10 MHz • Handles 5 MHz 8254-5 • Binary or BCD Counting 8 MHz 8254 10 MHz 8254-2 • Single +5V Supply Available in EXPRESS • -Standard Temperature Range • Status Read-Back Command • Six Programmable Counter Modes The Intel® 8254 is a counter/timer device designed to solve the common timing control problems in microcomputer system design. It provides three independent 16-bit counters, each capable of handling clock inputs up to 10 MHz. All modes are software programmable. The 8254 is a superset of the 8253. The 8254 uses HMOS technology and comes in a 24-pin plastic or CERDIP package. eLK 0 Dr-Do OUTO 0, iili WIl O. Vee WR Os RO cs eLK 1 . GATE 1 OUT 1 " ~ At Ao 0, 0, eLK 2 DO OUT2 ClK' GATE' GATE 2 GNO OUT' OUT2 Figure 2. Pin Configuration Figure 1. 8254 Block Diagram Intel Corporation Assumes No Responsibility for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied. Information Contained herein Supersedes Previously Published SpeCifications On The Devices From Intel. @INTELCORPORATION, 1984 6-274 January 1985 ORDER NUMBER: 231164-002 inter 8254 Table 1. Pin Description Symbol PinNa. Type Name and Function 1·8 1/0 Data: Bi·directional three state data bus DTDO Symbol lines, connected to system data bus. ClK 0 9 I Clock 0: Clock input of Counter O. OUTO 10 0 Output 0: Output of Counter O. GATE 0 11 I Gate 0: Gate input of Counter O. GND 12 -- Ground: Power supply connection. Type Name and Function Power: + 5V 24 WR 23 I Write Control: This input is low during CPU write operations. RD 22 I Read Control: This input is low during CPU read operations. CS 21 I Chip Select: A low on this Input enables the 8254 to respond to AD and WR signals. Ff5 and WR are ignored otherwise. 20·19 I Addre •• : Used to select one of the three Counters or the Control Word Register (or read or write operations. Normally connected to the system address bus. A" Ao FUNCTIONAL DESCRIPTION Pin No. Vee A, Ao 0 0 power supply connection. Selects Counter 0 0 1 Counter 1 1 0 Counter 2 1 1 Control Word Register Clock 2: Clock input of Counter 2. ClK 2 18 I OUT2 17 0 Out 2: Output of Counter 2. GATE 2 16 I Gate 2: Gate input of Counter 2. ClK 1 15 I Ctock 1: Clock input of Counter 1. GATE 1 14 I Gate 1: Gate input of Counter 1. OUT 1 13 0 Out 1: Output of Counter 1. Block Diagram DATA BUS BUFFER General This 3-state, bi·directional, 8·bit buffer is used to inter· face the 8254 to the system bus (see Figure 3). The 8254 is a programmable interval timerlcounter designed for use with Intel microcomputer systems. It is a general purpose, multi-timing element that can be treated as an array of 1/0 ports in the system software. The 8254 solves one of the most common problems in any microcomputer system, the generation of accurate time delays under software control. Instead of setting up timing loops in software, the programmer configures the 8254 to match his requirements and programs one of the counters for the desired delay. After the desired delay, the 8254 will interrupt the CPU. Software over· head is minimal and variable length delays can easily be accommodated. Some of the other counter/timer functions common to microcomputers which can be implemented with the 8254 are: • • • • • • • • elK 0 GATE 0 OUT 0 ClK 1 GATE 1 OUT 1 elK 2 GATE 2 OUT 2 Real time clock Event counter Digital one·shot Programmable rate generator Square wave generator Binary rate multiplier Complex waveform generator Complex motor controller Figure 3. Block Diagram Showing Data Bus Buffer and Read/Write Logic Functions 6-275 231164-002 8254 READ/WRITE lOGIC The ReadlWrite Logic accepts inputs from the system bus and generates control signals for the other functional blocks of the 8254. A1 and Ao select one of the three counters or the Control Word Register to be read from/written into. A "low" on the RD input tells the 8254 that the CPU is reading one of the counters. A "low" on the WR input tells the 8254 that the CPU is writing either a Control Word or an initial count. Both RD and WR are qualified by CS; RD and WR are ignored unless the 8254 has been selected by holding CS low. CONTROL WORD REGISTER The Control Word Register (see Figure 4) is selected by the ReadlWrite Logic when A1,Ao= 11. If the CPU then does a write operation to the 8254, the data is stored in the Control Word Register and is interpreted as a Control Word used to define the operation of the Counters. The Control Word Register can only be written to; status information is available with the Read-Back Command. elK 0 GATE 0 Figure 5. Internal Block Diagram of a Counter The status register, shown in the Figure, when latched, contains the current contents of the Control Word Register and status of the output and null count flag. (See detailed explanation of the Read-Back command.) OUTO The actual counter is labelled CE (for "Counting Ele: ment"). It is a 16·bit presettable synchronous down counter. eLK 1 GATE 1 OUT 1 <" "<'",-~- eLK 2 ~, )lg~U.!\~~~/..I--_ GATE 2 OlM and OLL are two 8-bit latches. OL stands for "Output Latch"; the subscripts M and L stand for "Most significant byte" and "Least significant byte" respectively. Both are normally referred to as one unit and called just OL. These latches normally "follow" the CE, but if a suitable Counter Latch Command is sent to the 8254, the latches "latch" the present count unti I read by the CPU and then return to "following" the CEo One latch at a time is enabled by the counter's Control Logic to drive the internal bus. This is how the 16-bit Counter communicates over the 8·bit internal bus. Note that the CE itself cannot be read; whenever you read the count, it is the OL that is being read. The Counters are fully independent. Each Counter may operate in a different Mode. Similarly, there are two 8-bit registers called CRM and CR L (for "Count Register"). Both are normally referred to as one unit and called just CR. When a new count is written to the Counter, the count is stored in the CR and later transferred to the CEo The Control Logic allows one register at a time to be loaded from the internal bus. Both bytes are transferred to the CE simultaneously. CRM and CRL are cleared when the Counter is pro· grammed. In this way, if the Counter has been programmed for one byte counts (either most significant byte only or least significant byte only) the other byte will be zero. Note that the CE cannot be written into; whenever a count is written, it is written into the CR. The Control Word Register is shown in the figure; it is not part of the Counter itself, but its contents determine how the Counter operates. The Control logic is also shown in the diagram. ClK n, GATE n, and OUT n are all connected to the outside world through, the Control logic. Figure 4. Block Diagram Showing Control Word Register and Counter Functions COUNTER 0, COUNTER 1, COUNTER 2 These three functional blocks are identical in operation, so only a single Counter will be described. The internal block diagram of a single counter is shown in Figure 5. 6-276 231164-002 8254 8254 SYSTEM INTERFACE OPERATIONAL DESCRIPTION The 8254 is a component of the Intel Microcomputer Systems and interfaces in the same manner as all other peripherals of the family. It is treated by the systems software as an array of peripheral 1/0 ports; three are cou nters and the fourth is a control register for MODE programming. General After power·up, the state of the 8254 is undefined. The Mode, count value, and output of all Counters are undefined. Basically, the select inputs Ao, A1 connect to the Ao, A1 address bus signals of the CPU. The CS can be derived directly from the address bus using a linear select method. Or it can be connected to the output of a decoder, such as an Intel 8205 for larger systems. How each Counter operates is determined when it is programmed. Each Counter must be programmed before it can be used. Unused counters need not be programmed. Programming the 8254 Counters are programmed by writing a Control Word and then an initial count. All Control Words are written into the Control Word Register, which is selected when A1,Ao= 11. The Can· trol Word itself specifies which Counter is being pro· grammed. By contrast, initial counts are written into the Counters, not the Control Word Register. The A1,Ao inputs are used to select the Counter to be written into. The format of the initial count is determined by the Control Word used. tt Control Word Format Figure 6. 8254 System Interface SC1 SC - A1oAO= 11 CS=O I sco I RW1 I RWO M2 Select Counter. SC1 SCO 0 0 Select Counter 0 0 1 1 0 1 1 Select Counter 1 Select Counter 2 Read·Back Command (See Read Operations) RW - RWO 0 0 0 1 1 1 0 1 MO M - MODE: M2 0 0 M1 X 1 1 0 0 X 1 1 ReadlWrlte: RW1 M1 Counter Latch Command (see Read Operations) ReadlWrite least significant byte only. ReadlWrite most significant byte only. ReadlWrite least signilicant byte first, then most significant byte. 0 0 RD= 1 WR=O I BCD I MO 0 1 0 1 0 1 Mode 0 Mode 1 Mode 2 Mode 3 Mode 4 Mode 5 BCD: Binary Counter 16·bits Binary Coded Decimal (BCD) Counter (4 Decades) NOTE: DON'T CARE BITS (X) SHOULD BE 0 TO INSURE COMPATIBILITY WITH fUTURE INTEL PRODUCTS. Figure 7. Control Word Format 6-277 231164-002 inter 8254 Write Operations quired. Any programming sequence that follows the conventions above Is acceptable. The programming procedure for the 8254 is very flexible. Only two conventions need to be remembered: A new initial count may be written to a Counter at any time without affecting the Counter's programmed Mode in any way. Counting will be affected as described in the Mode definitions. The new count must follow the pro· grammed count format. 1} For each Counter, the Control Word must be written before the initial count is written. 2} The initial count must follow the count format specified in the Control Word (least significant byte only, most significant byte only, or least significant byte and then most significant byte). If a Counter is programmed to read/write two-byte counts, the following precaution applies: A program must not transfer control between writing the first and second byte to another routine which also writes into that same Counter. Otherwise, the Counter will be loaded with an incorrect count. Since the Control Word Register and the three Counters have separate addresses (selected by the A"Ao inputs), and each Control Word specifies the Counter it applies to (SCO,SC1 bits), no special instruction sequence is reo A, Ao Control LSB of MSB of Control LSB of MSB of Control LSB of MSB of Word count count Word count count Word count count - Counter 0 Counter 0 Counter 0 Counter 1 Counter 1 Counter 1 Counter 2 Counter 2 Counter 2 1 0 0 1 0 0 1 1 1 A, Ao 1 0 0 1 1 1 1 0 0 Control Word Control Word Control Word LSB of count MSB of count LSB of count MSB of count LSB of count MSB of count - Counter 2 Counter 1 Counter 0 Counter 2 Counter 2 Counter 1 Counter 1 Counter 0 Counter 0 A, Ao Control Word Control Word Control Word LSB of count LSB of count LSB of count MSB of count MSB of count MSB of count - Counter 0 Counter 1 Counter 2 Counter 2 Counter 1 Counter 0 Counter 0 Counter 1 Counter 2 1 1 1 1 0 0 0 0 1 1 1 1 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0 A, Ao 1 1 1 0 1 0 0 1 0 Control Control LSB of Control LSB of MSB of LSB of MSB of MSB of Word Word count Word count count count count count - Counter 1 Counter 0 Counter 1 Counter 2 Counter 0 Counter 1 Counter 2 Counter 0 Counter 2 1 1 0 1 0 0 1 0 1 1 1 1 0 1 0 0 0 NOTE: IN ALL FOUR EXAMPLES, ALL COUNTERS ARE PROGRAMMED TO READlWRITE TWO·BYTE COUNTS. THESE ARE ONLY FOUR OF MANY POSSIBLE PROGRAMMING SEQUENCES. Figure 8_ A Few Possible Read Operations It is often desirable to read the value of a Counter without disturbing the count in progress. This is easily done in the 8254. There are three possible methods for reading the counters: a simple read operation, the Counter Latch Command, and Programming Sequences the Read-Back Command. Each is explained below. The first method is to perform a simple read operation. To read the Counter, which is selected with the A1, AO inputs, the ClK input of the selected Counter must be inhibited by using either the GATE input or external logic. Otherwise, the count may be in the process of changing when it is read, giving an undefined result. 6-278 231164-002 8254 COUNTER LATCH COMMAND The second method uses the "Counter Latch Command". Like a Control Word, this command is written to the Control Word Register, which is selected when A Ao= 11. Also Iikea " Control Word, the SCD, SC1 bits select one of the three Counters, but two other bits, 05 and 04, distinguish this command from a Control Word. A1 ,Ao =11; CS=O; RO=1; WR=O 07 06 I I SCO SC1 SC1,SCO - I 0 0 1 1 05,04 - 0 I 0 03 I X O2 I I X 01 X Do I xl specify counter to be latched SC1 X- 04 05 SCO 0 1 0 1 Counter 0 1 2 Read·Back Command 00 designates Counter Latch Command Another feature of the 8254 is that reads and writes of the same Counter may be interleaved; for example, if the Counter is programmed for two byte counts, the follow· ing sequence is valid. 1. 2. 3. 4. Read least significant byte. Write new least significant byte. Read most significant byte. Write new most significant byte. If a Counter is programmed to read/write two·byte counts, the following precaution applies: A program must not transfer control between reading the first and second byte to another routine which also reads from that same Counter. Otherwise, an incorrect count will be read. READ-BACK COMMAND The third method uses the Read-Sack Command. This command allows the user to check the count value, programmed Mode, and current states of the OUT pin and Null Count flag of the selected counter(s). The command is written into the Control Word Register and has the format shown in Figure 10. The command applies to the counters selected by setting their corre· sponding bits 03,02,01 =1. don't care AO,A1=11 cs=o RO=1 W'R=o NOTE: DON'T CARE BITS (X) SHOULD BE 0 TO INSURE COMPATIBILITY WITH FUTURE INTEL PRODUCTS. ICOuiifISTATUSI CNT21 CNT, I CNTO I Figure 9. Counter Latching Command Format The selected Counter's output latch (OL) latches the count at the time the Counter Latch Command is reo ceived. This count is held in the latch until it is read by the CPU (or until the Counter is reprogrammed). The count is then unlatched automatically and the OL returns to "following" the counting element (CE). This allows reading the contents of the Counters "on the fly" without affecting counting in progress. Multiple Counter Latch Commands may be used to latch more than one Counter. Each latched Counter's OL holds its count until it is read. Counter Latch Commands do not affect the programmed Mode of the Counter in any way. If a Counter is latched and then, some time later, latch· ed again before the count is read, the second Counter Latch Command is ignored. The count read will be the count at the time the first Counter Latch Command was issued. With either method, the count must be read according to the programmed format; specifically, if the Counter is programmed for two byte counts, two bytes must be read. The two bytes do not have to be read one right after the other; read or write or programming operations of other Counters may be inserted between them. OS' D.: 03' 02' D1: Do: 0 I 0 = LATCH COUNT OF SELECTED COUNTER(S) 0 = LATCH STATUS OF SELECTED COUNTER(S) , = SELECT COUNTER 2 , = SELECT COUNTER' 1 = SELECT COUNTER 0 RESERVED FOR FUTURE EXPANSION; MUST BE 0 Figure 10. Read·Back Command Format The read·back command may be used to latch multiple' counter output latches (OL) by setting the COUNT bit 05=0 and selecting the desired counter(s). This single command is functionally equivalent to several counter latch commands, one for each counter latched. Each counter's latched count is held until it is read (or the counter is reprogrammed). That counter is automatically unlatched when read, but other counters remain latched until they are read. If multiple count read-back commands are issued to the same counter without reading the count, all but the first are ignored; i.e., the count which will be read is the count at the time the first read-back command was issued. The read·back command may also be used to latch status information of selected counter(s) by setting STATUS bit 04 O. Status must be latched to be read; status of a counter is accessed by a read from that counter. = 231164·002 inter 8254 The counter status format is shown in Figure 11. Bits D5 through DO contain the counter's programmed Mode ex· actly as written in the last Mode Control Word. OUTPUT bit D7 contains the current state of the OUT pin. This allows the user to monitor the counter's output via soft· ware, possibly eliminating some hardware from a system. A. B. WRITE TO THE COUNT REGISTER (CR);[2) NULL COUNT~1 C. NULL COUNT~O NEW COUNT IS LOADED INTO CE (CR_CE); 111 ONLY THE COUNTER SPECIFIED BY THE CONTROL WORD WILL HAVE ITS NULL COUNT SET TO 1. NULL COUNT BITS OF OTHER COUNTERS ARE UNAFFECTED. 121 IF THE COUNTER IS PROGRAMMED FOR TWO-BYTE COUNTS (LEAST SIGNIFICANT BYTE THEN MOST SIGNIFICANT BYTE) NULL COUNT GOES TO 1 WHEN THE SECOND BYTE IS WRITIEN. 0, M1 THIS ACTION: CAUSES: WRITE TO THE CONTROL WORD REGISTER:[1) NULL COUNT~1 MO BCD Figure 12. Null Count Operation 0,1 ~ OUT PIN 151 o ~ OUT PIN ISO ~ ~ ~gh'iJ~~~rLABLE FOR READING 06 Os-Do COUNTER PROGRAMMED MODE (SEE FIGURE 7) If multiple status latch operations of the counter(s) are performed without reading the status, all but the first are ignored; i.e., the status that will be read is the status of the counter at the time the first status read·back command was issued. Figure 11. Status Byte NULL COUNT bit D6 indicates when the last count written to the counter register (CR) has been loaded into the counting element (CE). The exact time this happens dependson the Mode of the counter and is described in the Mode Definitions, but until the count is loaded into the counting element (CE), it can't be read from the counter. If the count is latched or read before this time, the count value will not reflect the new count just writ· ten. The operation of Null Count is shown in Figure 12. Command D4 D3 D2 D7 D6 D5 D1 Do 1 1 0 0 0 0 1 0 1 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 1 0 0 0 1 1 1 1 0 0 0 1 Both count and status of the selected counter(s) may be latched simultaneously by setting both COUNT and STATUS bits D5,D4=0. This is functionally the same as issuing two separate read-back commands at once, and the above discussions apply here also. Specifically, if multiple count and/or status read-back commands are issued to the same counter(s) without any intervening reads, all but the first are ignored. This is illustrated in Figure 13. Description Result Read back count and status of Counter 0 Count and status latched for Counter 0 0 Read back status of Counter 1 Status latched for Counter 1 0 Read back status of Counters 2, 1 Status latched for Counter 2, but not Counter 1 0 0 Read back count of Counter 2 Count latched for Counter 2 0 0 Read back count and status of Counter 1 Count latched for Counter 1, but not status 0 Read back status of Counter 1 Command ignored, status alreacjy latched for Counter 1 0 Figure 13. Read-Back Command Example 6-280 231164-002 inter 8254 If both count and status of a counter are latched, the first read operation of that counter will return latched status, regardless of which was latched first. The next one or two reads (depending on whether the counter is programmed for one or two type counts) return latched count. Subsequent reads return unlatched count. CS RD WR A1 Ao 0 1 0 0 0 Write into Counter 0 0 1 0 0 1 Write into Counter 1 0 1 0 1 0 Write into Counter 2 0 1 0 1 1 Write Control Word 0 0 1 0 0 Read from Counter 0 1) Writing the first byte disables counting. OUT is set low immediately (no clock pulse required) 2) Writing the second byte allows the new count to be loaded on the next ClK pulse. This allows the counting sequence to be synchronized by software. Again, OUT does not go high until N + 1 ClK pulses after the new count of N is written. If an initial count is written while GATE = 0, it will still be loaded on the next ClK pulse. When GATE goes high, OUT will go high N ClK pulses later; no ClK pulse is needed to load the Counter as this has already been done. CW=10 0 0 1 0 1 Read from Counter 1 WR 0 0 1 1 0 Read from Counter 2 elK 0 0 1 1 1 No·Operation (3·State) 1 X X X X No-Operation (3-State) 0 1 1 X X No·Operation (3-State) LSB=4_ _ _ _ _ _ _ _ _ _ __ 'l.JL..J GATE - - - - - - - - - - - - - - - - OUT =-=--''-_______--' Figure 14. ReadlWrite Operations Summary CW=10 LSB=3 m~---------------- elK Mode Definitions The following are defined for use in describing the operation of the 8254. GATE ClK pulse: a rising edge, then a falling edge, in that order, of a Counter's ClK input. trigger: a rising edge of a Counter's GATE input. Counter loading: the transfer of a count from the CR to the CE (refer to the "Functional Description") OUT .=-=:J'-_______---'rI ~ I ~~ I elK MODE 0: INTERRUPT ON TERMINAL COUNT GATE - - - - - - - - - - - - - - - - - Mode 0 is typically used for event counting. After the Control Word is written, OUT is initially low, and will remain low until the Counter reaches zero. OUT then goes high and remains high until a new count or a new Mode o Control Word is written into the Counter. OUT GATE=1 enables counting; GATE=O disables counting. GATE has no effect on OUT. -J,-- =::JL..________ ININININI I~I~~I NOTE: THE FOLLOWING CONVENTIONS APPLY TO ALL MODE TIMING DIAGRAMS: 1. COUNTERS ARE PROGRAMMED FOR BINARY (NOT BCD) COUNTING AND FOR READING/WRITING LEAST SIGNIFICANT BYTe (LSS) ONLY. After the Control Word and initial count are written to a Counter, the initial count will be loaded on the next ClK pulse. This ClK pulse does not decrement the count, so for an initial count of N, OUT does not go high until N + 1 ClK pulses after the initial count is written. 2. THE COUNTER IS ALWAYS SELECTED (CS ALWAYS LOW). 3. CW STANDS FOR "CONTROL WORD"; CW "" 10 MEANS A CONTROL WORD OF 10, HEX IS WRITTEN TO THE COUNTER. 4. LSS STANDS FOR "LEAST SIGNIFICANT BYTE" OF COUNT. 5. NUMBERS BELOW DIAGRAMS ARE COUNT VALUES. THE LOWER NUMBER IS THE LEAST SIGNIFICANT BYTE. THE UPPER NUMBER IS THE MOST SIGNIFICANT BYTE. SINCE THE COUNTER IS PROGRAMMED TO ReAD/WRITE LSB ONLY, THE MOST SIGNIFICANT BYTE CANNOT BE READ. N STANDS FOR AN UNDEFINED COUNT. VERTICAL LINES SHOW TRANSITIONS BETWEEN COUNT VALUES. If a new count is written to the Counter, it will be loaded on the next ClK pulse and counting will continue from the new count. If a two-byte count is written, the follow· ing happens: Figure 15. Mode 0 6-281 231164-002 8254 MODE 1: HARDWARE RETRIGGERABlE ONE·SHOT MODE 2: RATE GENERATOR OUT will be initially high. OUT will go low on the ClK pulse following a trigger to begin the one·shot pulse, and will remain low until the Counter reaches zero. OUT will then go high and remain high until the ClK pulse after the next trigger. This Mode functions like a divide-by-N counter. It Is typiclaly used to generate a Real Time Clock interrupt. OUT will initially be high. When the initial count has decremented to 1, OUT goes low for one ClK pulse. OUT then goes high again, the Counter reloads the initial count and the process is repeated. Mode 2 is periodic; the same sequence is repeated indefinitely. For an initial count of N, the sequence repeats every N ClK cycles. After writing the Control Word and initial count, the Counter is armed. A trigger results in loading the Counter and setting OUT low on the next ClK pulse, thus starting the one-shot pulse. An initial count of N will result in a one-shot pulse N ClK cycles in duration. The one-shot is retriggerable, hence OUT will remain low for N ClK pulses after any trigger. The one-shot pulse can be repeated without rewriting the same count into the counter. GATE has no effect on OUT. If a new count is written to the Counter during a oneshot pulse, the current one-shot is not affected unless the Counter is retriggered. In that case, the Counter is loaded with the new count and the one-shot pulse continues until the new count expires. CW='2 GATE = 1 enables counting; GATE =0 disables counting. If GATE goes low during an output pulse, OUT is set high immediately_ A trigger reloads the Counter with the initial count on the next ClK pulse; OUT goes low N eLK pulses after the trigger. Thus the GATE input can be used to synchronize the Counter. After writing a Control Word and initial count, the Counter will be loaded on the next CLK pulse. OUT goes low N CLK Pulses after the initial count is written_ This allows the Counter to be synchronized by software also. lS8=3_'--_ _ _ _ _ _ _ _ __ CW:::14 LSB=3 WRLJU WRLJU,--------~ elK elK GATE ------;n~--------1n----- GATE - - - - - - - - - - - - - - - - OUT OUT CW=14 CW=12 WI! lSB=:J WR LJU----------- lSB=3 _ _ _ _ _ _ _ _ _ _ __ LJL.J elK elK GATE OUT GATE -------;n----ln---------=.J IL_____---JI INININININI~I~I OUT~ LJ I~ I~ I I~I~I elK elK GATE GATE -------',n--------:" n------ OUT ---------------- =-=.J U I I I I I ~ I ~ I ~ I ~I ~ I ~ I ~ I N N N N OUT NorE: A GATE transition should not occur one clock prior to terminal I I I I I I ~ I ~ I ~ I ~~ I ~~ I N N N N count. N Figure 16. Mode 1 Figure 17. Mode 2 6-282 231164-002 8254 Writing a new count while counting does not affect the current counting sequence. If a trigger is received after writing a new count but before the end of the current period, the Counter will be loaded with the new count on the next ClK pulse and counting will continue from the new count. Otherwise, the new count will be loaded at the end of the current counting cycle. In mode 2, a COUNT of 1 is illegal. CW .. UI WIt LSO.4r-_ _ _ _ _ _ _ _ _ _ _ __ L.J"--J GATE - - - - - - - - - - - - - - - - - OUT CW_1e LSO .. S r -_ _ _ _ _ _ _ _ _ _ _ __ WltLrLJ GATE - - - - - - - - - - - - - - - - - OUT MODE 3; SQUARE WAVE MODE Mode 3 is typically used for Baud rate generation. Mode 3 is similar to Mode 2 except for the duty cycle of OUT. OUT will initially be high. When half the initial count has expired, OUT goes low for the remainder of the count. Mode 3 is periodic; the sequence above is repeated in· definitely. An initial count of N results in a square wave with a period of N ClK cycles. CW=1B Lsa .. 4r-_ _ _ _ _ _ _ _ _ _ _ __ WliL.JL.J GATE = 1 enables counting; GATE=O disables coun· ting. If GATE goes low while OUT is low, OUT is set high immediately; no ClK pulse is required. A trigger reloads the Counter with the initial count on the next ClK pulse. Thus the GATE input can be used to synchronize the Counter. NOTE: A GATE transition should not occur one clock prior to terminal count. After writing a Control Word and initial count, the Counter will be loaded on the next ClK pulse. This allows the Counter to be synchronized by software also. Figure 18. Mode 3 Writing a new count while counting does not affect the current counting sequence. If a trigger is received after writing a new count but before the end of the current half·cycle of the square wave, the Counter will be loaded with the new count on the next ClK pulse and counting will continue from the new count. Otherwise, the new count will be loaded at the end of the current half-cycle. MODE 4: SOFTWARE TRIGGERED STROBE OUT will be initially high. When the initial count expires, OUT will go low for one ClK pulse and then go high again. The counting sequence is "triggered" by writing the initial count. Mode 3 is implemented as follows: GATE = 1 enables counting; GATE= 0 disables count· ing. GATE has no effect on OUT. Even counts: OUT is initially high. The initial count is loaded on one ClK pulse and then is decremented by two on succeeding ClK pulses. When the count expires OUT changes value and the Counter is reloaded with the initial count. The above process is repeated' indefinitely. After writing a Control Word and initial count, the Counter will be loaded on the next ClK pulse. This ClK pulse does not decrement the count, so for an initial count of N, OUT does not strobe low until N + 1 ClK pulses after the initial count is written. Odd counts: OUT is initially high. The initial count minus one (an even number) is loaded on one ClK pulse and then is decremented by two on succeeding ClK pulses. One ClK pulse after the count expires, OUT goes low and the Counter is reloaded with the initial count minus one. Succeeding ClK pulses decrement the count by two. When the count expires, OUT goes high again and the Counter is reloaded with the initial count minus one. The above process is repeated in· definitely. So for odd counts, OUT will be high for (N + 1)12 counts and low for (N - 1)12 counts. If a new count is written during counting, It will be load· ed on the next ClK pulse and counting will continuefrom the new count. If a two· byte count is written, the following happens: 1) Writing the first byte has no effect on counting. 2) Writing the second byte allows the new count to be loaded on the next ClK pu Ise. This allows the sequence to be "retriggered" by soft· ware. OUT strobes low N + 1 ClK pulses after the new count of N is written. 6-283 231164-002 8254 CW=18 CW=1A LSB:3i-_ _ _ _ _ _ _ _ _ __ WlIL..Jl....J LSB=3;...-_ _ _ _ _ _ _ _ __ WI! LJLJ WlI LJLJ elK GATE------------------OUT u =-.J o1 CW=1B I 00 I FFFF I FFFE I FF I FO lSB=3i--_ _ _ _ _ _ _ _ _ __ CW=1A WlIL..Jl....J elK elK GATE GATE LSB=3_------------ - - - - - - - --l~ - -- ----- - - -- --------------~ u--- OUT~ o1 OUT~ I 0 I FF I 0 1 N 1 N 1 N 1 N 1 N 1 NI FF ~ 1 elK GATE - - - ' - - - - - - - - - - - - - - - OUT~ OUT u =:J Figure 20. Mode 5 Figure 19. Mode 4 MODE 5: HARDWARE TRIGGERED STROBE (RETRIGGERABlE) OUT will initially be high. Counting is trigg.ered by a ris· ing edge of GATE. When the initial count has expired, OUT will go low for one ClK pulse and then go high again. Signal Status Modes Low OrGolng Low 0 Disables counting 1 -- Rising -1) Initiates High Enables counting -- counting 2) Resets output after next clock After writing the Control Word and initial count, the counter will not be loaded until the ClK pulse after a trigger. This ClK pulse does not decrement the count, so for an initial count of N, OUT does not strobe low until N + 1 ClK pulses after a trigger. 2 A trigger results in the Counter being loaded with the in· itial count on the next ClK pulse. The counting sequence is retriggerable. OUT· will not strobe low for N + 1 ClK pulses after any trigger. GATE has no effect on OUT. 3 II a new count is written during counting, the curent counting sequence will not be affected. II a trigger oc· curs after the new count is written but before the current count expires, the Counter will be loaded with the new count on the next ClK pulse and counting will continue from there. 4 5 t) Disables counting 2) Sets output immediately high 1) Disables counting 2) Sets output immediately high Disables counting -- Initiates counting Enables counting Initiates counting Enables counting -- Enables counting Initiates counting -- Figure 21. Gate Pin Operations Summary 6-284 231t64-002 inter 8254 GATE Mode Min Count Max Count 0 1 0 1 1 0 2 2 0 3 2 0 4 1 0 5 1 0 NOTE: 0 IS EQUIVALENT TO 2 18 FOR BINARY COUNTING AND 104 FOR BCD COUNTING. The GATE input is always sampled on the rising edge of CLK. In Modes 0, 2, 3, and 4 the GATE input is level sensitive, and the logic level is sampled on the rising edge of CLK. In Modes 1, 2, 3, and 5 the GATE input is rising-edge sensitive. In these Modes, a rising edge.of GATE (trigger) sets an edge-sensitive flip-flop in the Counter. This flip-flop is then sampled on the next rising edge of CLK; the flip-flop is reset immediately after it is sampled. In this way, a trigger will be detected no matter when it occurs-a high logic level does not have to be maintained until the next rising edge of CLK. Note that in Modes 2 and 3, the GATE input is both edge- and levelsensitive. In Modes 2 and 3, if a CLK source other than the system clock is used, GATE should be pulsed immediately following WR of a new count value. COUNTER Figure 22. Minimum and Maximum Initial Counts New counts are loaded and Counters are decremented on the falling edge of CLK. The largest possible initial count is 0; this is equivalent to 216 for binary counting and 104 for BCD counting. Operation Common to All Modes The Counter does not stop when it reaches zero. In Modes 0, 1,4, and 5 the Counter "wraps around" to the highest count, either FFFF hex for binary counting or 9999 for BCD counting, and continues counting. Modes 2 and 3 are periodic; the Counter reloads itself with the initial count and continues counting from there. PROGRAMMING When a Control Word is written to a Counter, all Control Logic is immediately reset and OUT goes to a known initial state; no CLK pulses are required for this. 6-285 231164-002 8254 ABSOLUTE MAXIMUM RATINGS· Ambient Temperature Under Bias ......... O·C to 70·C Storage Temperature .............. -65·C to + 150·C Voltage on Any Pin with Respect to Ground ................. -0.5V to + 7V Power Dissipation .......................... 1 Watt D.C. CHARACTERISTICS (TA= o·C to 70·C; Vee = 5V± 10%) Test Conditions Min. Max. Units Input Low Voltage -0.5 0.8 V VIH Input High Voltage 2.0 Vee+ 0.5V V VOL Output Low Voltage 0.45 V VOH Output High Voltage IlL Input Load Current ±10 IlA VIN = Vee to OV 10FL Output Float Leakage ±10 IlA VOUT= Vee toO.45V lee Vee Supply Current 170 mA Symbol VIL Parameter 'NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to Absolute Maximum Rating conditions for extended periods may affect device reliability. IOL=2.0 mA V 2.4 10H= -4001lA CAPACITANCE (TA=25°C, Vee=GND=OV) Parameter Symbol Min. Test Conditions Max. Units pF fc=1MHz pF Unmeasured pins returned to Vss CIN Input Capacitance 10 CliO 1/0 Capacitance 20 A.C. CHARACTERISTICS (TA=O°C to 70°C, Vee=5V± 10%, GND=OV) Bus Parameters (Note 1) READ CYCLE 8254-5 Symbol Parameter tAR Address Stable Before RD I tSR CS Stable Before RD I tRA Address Hold Time After RDI tAR RD Pulse Width tAD Data Delay from RD tAD Data Delay from Address tDF RD I to Data Floating tRV Com·mand Recovery Ti me Note 1: AC timings measured at VOH Min. 8254·2 8254 Max. Min. Max. Min. Max. Unit 45 45 30 ns 0 0 0 n. ns 0 0 0 150 150 95 j ns 120 120 85 ns 220 220 185 ns 65 ns 90 5 200 5 200 90 5 165 ns =2.0V, VOL" a.BV. 6-286 231164-002 8254 A.C. CHARACTERISTICS (Continued) WRITE CYCLE 8254-5 Symbol Parameter Min. 8254-2 8254 Max. Max. Min. Min. Max. Unit a a a a a a a a a ns WR Pulse Width 150 150 95 ns tow Data Setup Time Before WR! 120 120 95 ns two Data Hold time After WR! a a a ns tRV Command Recovery Time 200 200 165 ns tAW Address Stable Before WR I tsw CS Stable Before WR I tWA Address Hold Time After WRI tww ns ns CLOCK AND GATE 8254-5 Symbol Parameter 8254-2 8254 Min. Max. Min. Max. Min. Max. Unit DC 125 DC 100 DC ns telK Clock Period 200 tpWH High Pulse Width 60 13} 60[3} 30[3} tpWL Low Pulse Width 60[3} 60[3} 50[31 tR Clock Rise Time 25 25 25 ns tF Clock Fall Time 25 25 25 ns tGW Gate Width High 50 50 50 ns tGl Gate Width Low 50 50 50 ns tGS Gate Setup Time to CLK! 50 50 40 ns tGH Gate Setup Time After CLKI 50[21 50[21 50[2[ too Output Delay from CLKI 150 150 100 ns t ODG Output Delay from Gatel 120 120 100 ns twe CLK Delay for Loadingl tWG Gate Delay for Sampling two OUT Delay from Mode Write tel CLK Set Up for Count Latch ns ns ns a 55 a 55 a 55 ns -5 50 -5 50 -5 40 ns 240 ns 40 ns 260 260 -40 45 -40 45 -40 Note 2: In Modes 1 and 5 triggers are sampled on each rising clock edge. A second trigger within 120 ns (70 ns for the 8254-2) of the rising clock edge may not be detected. Note 3: Low-going glitches that violate tpWH ' IpWL may cause errors requiring counter reprogramming 6-287 -- 231164-002 8254 WAVEFORMS WRITE A O• 1 CS DATA BUS READ AO·1 CS DATA B U S - - - I RECOVERY CLOCK AND. GATE elK ----...:...--"'f"\ GATE OUTPUT 0 two • lAST BYTE OF COUNT BEING WRITTEN 6-288 231164-002 8254 A.C. TESTING INPUT, OUTPUT WAVEFORM A.C. TESTING LOAD CIRCUIT INPUT/OUTPUT 2.4 =<2.0 0 8 > TEST POINTS 0.45 - <2.o)C DEVICE UNDER TEST 08 '1Cl~150PF - -=- A.C. TESTING: INPUTS ARE DRIVEN AT 2AV FOR A LOGIC "1" AND O.45V FOR A LOGIC "0," TIMING MEASUREMENTS ARE MADE AT 2.0V FOR A LOGIC "1' AND O.8V FOR A LOGIC "0 .. CL = 150 pF Cl INCLUDES JIG CAPACITANCE 6-289 231164-002 .82C54 CHMOS PROGRAMMABLE INTERVAL TIMER with all Intel and most • Compatible other microprocessors High Speed, "Zero Wait State" • Operation with 8 MHz 8086188 and 801861188 independent 16-bit counters • Three Handles Inputs from DC to 8 MHz • -10 MHz for 82C54-2 Low Power CHMOS • -Icc = 10 rnA 8 MHz Count frequency Completely TTL Compatible • Six Programmable Counter Modes • Binary or BCD counting • Status Read Back Command • Available in 24-Pin DIP and 28-Pin PLCC • @ The Intel 82C54 is a high-performance, CHMOS version of the industry standard 8254 counter/timer which is designed to solve the timing control problems common in microcomputer system design. It provides three independent 16-bit counters, each capable of handling clock inputs up to 10 MHz. All modes are software programmable. The 82C54 is pin compatible with the HMOS 8254, and is a superset of the 8253. Six programmable timer modes allow the 82C54 to be used as an event counter, elapsed time indicator, programmable one-shot, and in many other applications. The 82C54 is fabricated on Intel's advanced CHMOS III technology which provides low power consumption with performance equal to or. greater than the equivalent HMOS product. The 82C54 is available in 24-pin DIP and 28-pin plastic leaded chip carrier (PLCC) packages. 05 Os 01 NC Vee WR RD 28 27 26 16 17 18 07"00 O~T 0 82C54 eLK 1 GATE 1 OUT 1 A, 12 13 -14 15 aUTO GATEO GND NC OUTt GATE1 eLK1 231244-3 PLASTIC LEADED CHIP CARRIER ~ Vee 0, 0, w- 0, liO d. es 0, A, 0, olo 0, eLK 2 OUT 2 231244-1 eLK 1 Figure 1. 82C54 Block Diagram GATE 1 ."----' OUT 1 231244-2 Diagrams are for pin reference only. Package sizes are not to scale. Figure 2. 82C54 Pinout Intel Corporation assumes no responsibility for the use of any Circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. November 1985 © Intel Corporation. 1985 6-290 Order Number: 231244-002 inter 82C54 Table 1. Pin Description Pin Number Symbol Function Type DIP PLCC 1-8 2-9 ClKO 9 10 I Clock 0: Clock input of Counter O. OUTO 10 12 0 Output 0: Output of Counter O. GATE 0 11 I Gate 0: Gate input of Counter o. GND 12 13 14 OUT1 13 16 0 Out 1: Output of Counter 1. Gate 1: Gate input of Counter 1. DrDo 110 Data: Bidirectional tri-state data bus lines, connected to system data bus. Ground: Power supply connection. GATE 1 14 17 I ClK 1 15 18 I Clock 1: Clock input of Counter 1. GATE 2 16 19 I Gate 2: Gate input of Counter 2. Out 2: Output of Counter 2. OUT2 17 20 0 ClK2 18 21 I Clock 2: Clock input of Counter 2. A1,Ao 20-19 23-22 I Address: Used to select one of the three Counters or the Control Word Register for read or write operations. Normally connected to the system address bus. CS 21 24 I RD 22 26 I WR 23 27 I Vee NC 24 Selects Ao A1 0 0 Counter 0 Counter 1 0 1 1 0 Counter 2 Control Word Register 1 1 Chip Select: A low on this input enables the 82C54 to respond to RD and WR signals. RD and WR are ignored otherwise. Read Control: This input is low during CPU read operations. Write Control: This input is low during CPU write operations. Power: + 5V power supply connection. No Connect 28 1, 11,15,25 sired delay. After the desired delay, the 82C54 will interrupt the CPU. Software overhead is minimal and variable length delays can easily be accommodated. FUNCTIONAL DESCRIPTION General The 82C54 is a programmable interval timer/counter designed for use with Intel microcomputer systems. It is a general purpose, multi-timing element that can be treated as an array of I/O ports in the system software. The 82C54 solves one of the most common problems in any microcomputer system, the generation of accurate time delays under software control. Instead of setting up timing loops in software, the programmer configures the 82C54 to match his requirements and programs one of the counters for the de- Some of the other counter/timer functions common to microcomputers which can be implemented with the 82C54 are: • • • • • • • • 6-291 Real time clock Even counter Digital one-shot Programmable rate generator Square wave generator Binary rate multiplier Complex waveform generator Complex motor controller inter 82C54 Block Diagram CONTROL WORD REGISTER The Control Word Register (see Figure 4) is selected by the Read/Write Logic when A1, Ao = 11. If the CPU then does a write operation to the 82C54, the data is stored in the Control Word Register and is interpreted as a Control Word used to define the operation of the Counters. DATA BUS BUFFER This 3-state, bi-directional, 8-bit buffer is used to interface the 82C54 to the system bus (see Figure 3). The Control Word Register can only be written to; status information is available with the Read-Back Command. 231244-4 Figure 3. Block Diagram Showing Data Bus Buffer and Read/Write Logic Functions 231244-5 READ/WRITE LOGIC The Read/Write Logic accepts inputs from the system bus and generates control signals for the other functional blocks of the 82C54. A1 and Ao select one of the three counters or the Control Word Re~ ter to be read from/written into. A "low" on the RD input tells the 82C54 that the CPU is reading one of the counters. A "low" on the WR input tells the 82C54 that the CPU is writing either a Control Word or an initial count. Both RD and WR are qualified by CS; RD and WR are ignored unless the 82C54 has been selected by holding CS low. Figure 4. Block Diagram Showing Control Word Register and Counter Functions COUNTER 0, COUNTER 1, COUNTER 2 These three functional blocks are identical in operation, so only a single Counter will be described. The internal block diagram of a single counter is shown in Figure 5. The Counters are fully independent. Each Counter may operate in a different Mode. The Control Word Register is shown in the figure; it is not part of the Counter itself, but its contents determine how the Counter operates. 6-292 intJ 82C54 stored in the CR and later transferred to the CE. The Control logic allows one register at a time to be loaded from the internal bus. Both bytes are transferred to the CE simultaneously. CRM and CRl are cleared when the Counter is programmed. In this way, if the Counter has been programmed for one byte counts (either most significant byte only or least significant byte only) the other byte will be zero. Note that the CE cannot be written into; whenever a count is written, it is written into the CR. The Control logic is also shown in the diagram. ClK n, GATE n, and OUT n are all connected to the outside world through the Control logic. 82C54 SYSTEM INTERFACE 231244-6 The 82C54 is treated by the systems software as an array of peripheral 1/0 ports; three are counters and the fourth is a control register for MODE programming. Figure 5. Internal Block Diagram of a Counter The status register, shown in the Figure, when latched, contains the current contents of the Control Word Register and status of the output and null count flag. (See detailed explanation of the ReadBack command.) Basically, the select inputs Ao, A1 connect to the Ao, A1 address bus signals of the CPU. The CS can be derived directly from the address bus using a linear select method. Or it can be connected to the output of a decoder, such as an Intel 8205 for larger systems. The actual counter is labelled CE (for "Counting Element"). It is a 16-bit presettable synchronous down counter. OlM and Oll are two 8-bit latches. Ol stands for "Output latch"; the subscripts M and l stand for "Most significant byte" and "least significant byte" respectively. Both are normally referred to as one unit and called just Ol. These latches normally "follow" the CE, but if a suitable Counter latch Command is sent to the 82C54, the latches "latch" the present count until read by the CPU and then return to "following" the CEo One latch at a time is enabled by the counter's Control logic to drive the internal bus. This is how the 16-bit Counter communicates over the 8-bit internal bus. Note that the CE itself cannot be read; whenever you read the count, it is the Ol that is being read. Similarly, there are two 8-bit registers called CRM and CRl (for "Count Register"). Both are normally referred to as one unit and called just CR. When a new count is written to the Counter, the count is 6-293 rr 231244-7 Figure 6. 82C54 System Interface 82C54 OPERATIONAL DESCRIPTION Programming the 82C54 General Counters are programmed by writing a Control Word and then an initial count. The control word format is shown in Figure 7. After power-up, the state of the 82C54 is undefined. The Mode, count value, and output of 11-11. Counters are undefined. All Control Words are written into the Control Word Register, which is selected when A1, Ao = 11. The Control Word itself specifies which Counter is being programmed. How each Counter operates is determined when it is programmed. Each Counter must be programmed before it can be used. Unused counters need not be programmed. By contrast, initial counts are written into the Counters, not the Control Word Register. The A1, Ao inputs are used to select the Counter to be written into. The format of the initial count is determined by the Control Word used. Control Word Format A1, Ao = 11 CS = 0 RD = D7 1 WR = 0 D6 I Isco I SC1 D5 RW1 I D4 RWO D2 M21 M1 MO BCD I I I M1 MO 0 0 0 Select Counter 1 0 0 1 Mode 1 Select Counter 2 X 1 0 Mode 2 Read-Back Command (See Read Operations) X 1 1 Mode 3 1 0 0 Mode 4 1 0 1 Mode 5 Select Counter 0 0 1 1 0 1 1 0 Do M2 0 RW - Read/Write: RW1 RWO 0 D1 M-MODE: SC - Select Counter: SC1 SCO 0 I D3 Counter Latch Command (see Read Operations) 0 1 Read/Write least significant byte only. 1 0 Read/Write most significant byte only. 1 1 Read/Write least significant byte first, then most significant byte. Mode 0 BCD: 0 Binary Counter 16-bits 1 Binary Coded Decimal (BCD) Counter . (4 Decades) NOTE: Don't care bits (X) should be 0 to insure compatibility with future Intel products. Figure 7. Control Word Format 6-294 82C54 Write Operations The programming procedure for the 82C54 is very flexible. Only two conventions need to be remembered: . 1) For each Counter, the Control Word must be written before the initial count is written. 2) The initial count must follow the count format specified in the Control Word (least significant byte only, most significant byte only, or least significant byte and then most significant byte). Since the Control Word Register and the three Counters have separate addresses (selected by the A1, Ao inputs), and each Control Word specifies the Counter it applies to (SCa, SC1 bits), no special in- Control Word LSB of count MSB of countControl Word LSB of count MSB of countControl Word LSB of count MSB of count- Counter a Counter a Counter a Counter 1 Counter 1 Counter 1 Counter 2 Counter 2 Counter 2 Control Word Counter Word Control Word LSB of countLSB of count LSB of count MSB of countMSB of count MSB of count - Counter a Counter 1 Counter 2 Counter 2 Counter 1 Counter a Counter a Counter 1 Counter 2 A1 Ao 1 a a 1 a a 1 1 1 1 a a 1 1 1 1 a a A1 Ao 1 1 1 1 a a a a 1 1 1 1 a 1 a a 1 a struction sequence is required. Any programming sequence that follows the conventions above is acceptable. A new initial count may be written to a Counter at any time without affecting the Counter's programmed Mode in any way. Counting will be affected as described in the Mode definitions. The new count must follow the programmed count format. If a Counter is programmed to read/write two-byte counts, the following precaution applies: A program must not transfer control between writing the first and second byte to another routine which also writes into that same Counter. Otherwise, the Counter will be loaded with an incorrect count. Control WordControl WordControl Word LSB of count MSB of count LSB of countMSB of count LSB of count MSB of count - Counter 2 Counter 1 Counter a Counter 2 Counter 2 Counter 1 Counter 1 Counter a Counter a Control Word Control Word LSB of count Control Word LSB of count MSB of count LSB of count MSB of count MSB of count- Counter 1 Counter a Counter 1 Counter 2 Countei"a Counter 1 Counter 2 Counter 0 Counter 2 A1 Ao 1 1 1 1 1 a a a a 1 1 1 a a 1 1 a a A1 Ao 1 1 a 1 a a 1 a 1 1 1 1 1 a 1 a a a NOTE: In all four examples, all counters are programmed to read/write two-byte counts. These are only four of many possible programming sequences. Figure 8. A Few Possible Programming Sequences Read Operations It is often desirable to read the value of a Counter without disturbing the count in progress. This is easily done in the 82C54. There are three possible methods for reading the counters: a simple read operation, the Counter Latch Command, and the Read-Back Command. Each is explained below. The first method is to perform a simple read operation. To read the Counter, which is selected with the A1, Aa inputs, the CLK input of the selected Counter must be inhibited by using either the GATE input or external logic. Otherwise, the count may be in the process of changing when it is read, giving an undefined result. 6-295 inter 82C54 gramming operations of other Counters may be inserted between them. COUNTER LATCH COMMAND The second method uses the "Counter Latch Command". Like a Control Word, this command is written to the Control Word Register, which is selected when A1, Ao = 11. Also like a Control Word, the SCO, SC1 bits select one of the three Counters, but two other bits, 05 and 04, distinguish this command from a Control Word. Another feature of the 82C54 is that reads and writes of the same Counter may be interleaved; for example, if the Counter is programmed for two byte counts, the following sequence is valid. 1. Read least significant byte. 2. Write new least significant byte. 3. ,Read most significant byte. 4. Write' new most significant byte. A1' Ao=11; CS=D; RD=1; WR=D D7 D6 D5 D4 D3 D2 D1 I SC1 I SCO I 0 I 0 I X I X I X Do X If a Counter is programmed to read/write two·byte counts, the following precaution applies; A program must not transfer control between reading the first and second byte to another routine which also reads from that same Counter. Otherwise; an incorrect count will be read. I SC1, SCO - specify counter to be latched SC1 seD Counter 0 0 1 1 0 1 0 1 0 1 2 Read-Back Command READ-BACK COMMAND The third method uses the Read-Back command. This command allows the user to check the count value, programmed Mode, and current state of the OUT pin and Null Count flag of the selected counter(s). 05,04 - 00 designates Counter Latch Command X - don't care The command is written' into the Control Word Register and has the format shown in Figure 10. The command applies to the counters selected by setting their corresponding bits 03,02,01 = 1. NOTE: Don't care bits (X) should be 0 to insure compatibility with future Intel products. Figure 9. Counter latching Command Format AO, A1 = 11 The selected Counter's output latch (OL) latches the count at the time the Counter Latch Command is received. This count is held in the latch until it is read by the CPU (or until the Counter is reprogrammed). The count is then unlatched automatically and the OL returns to "following" the counting element (CE). This allows reading the contents of the Counters "on the fly" without affecting counting in progress. Multiple Counter Latch Commands may be' used to latch more than one Counter. Each latched Counter's OL holds its count until it is read. Counter Latch Commands do not affect the programmed Mode of the Counter in any way. If a Counter is latched and then, some time later, latched again before the count is read, the second Counter Latch Command is ignored. The count read will be the count at the time the first Counter Latch Command was issued. With either method, the count must be read according to the programmed format; specifically, if the Counter is programmed for two byte counts, two bytes must be read. The two bytes do not have to be read one right after the other; read or write or pro- 07 06 "05 CS = 0 04 RO = 1 03 WR = 0 02 01 DO 1111 ICOUNTlsTATUsICNT.2ICNT1IcNTOI 0 05: 04: 03: 02: 01: 09: I 0 = Latch count of selected counter(s) 0 = Latch status of selected counter(s) 1 = Select counter 2 1 = Select counter 1 1 = Select counter 0 Reserved for future expansion; must be 0 Figure 10. Read-Back Command Format The read-back command may be used to latch mUltiple counter output latches (OL) by setting the COUNT bit 05 = 0 and selecting the desired counter(s). This single command is functionally equivalent to several counter latch .commands, one for each counter latched. Each counter's latched count is held until it is read (or the counter is reprogrammed). That counter is automatically unlatched when read, but other counters remain latched until they are read. If multiple count read-back commands are issued to the same counter without reading the 6-296 82C54 count, all but the first are ignored; i.e., the count which will be read is the count at the time the first read-back command was issued. THIS ACTION: A. Write to the control word register: [1] B. Write to the count register (CR);[2] C. New count is loaded into CE (CR - CE); The read-back command may also be used to latch status information of selected counter(s) by setting STATUS bit 04 = o. Status must be latched to be read; status of a counter is accessed by a read from that counter. CAUSES: Null count = 1 Null count= 1 Null count=O [1] Only the counter specified by the control word will have its null count set to 1. Null count bits of other counters are unaffected. [2] If the counter is programmed for two-byte counts (least significant byte then most significant byte) null count goes to 1 when the second byte is written. The counter status format is shown in Figure 11. Bits 05 through DO contain the counter's programmed Mode exactly as written in the last Mode Control Word. OUTPUT bit 07 contains the current state of the OUT pin. This allows the user to monitor the counter's output via software, possibly eliminating some hardware from a system. Figure 12_ Null Count Operation If multiple status latch operations of the counter(s) are performed without reading the status, all but the first are ignored; i.e., the status that will be read is the status of the counter at the time the first status read-back command was issued. 07 1 = o= 06 1 = o= 05-00 Out Pin is 1 Out Pin is 0 Null count Count available for reading Counter Programmed Mode (See Figure 7) Figure 11. Status Byte NULL COUNT bit 06 indicates when the last count written to the counter register (CR) has been loaded into the counting element (CE). The exact time this happens depends on the Mode of the counter and is described in the Mode Definitions, but until the count is loaded into the counting element (CE), it can't be read from the counter. If the count is latched or read before this time, the count value will not reflect the new count just written. The operation of Null Count is shown in Figure 12. Both count and status of the selected counter(s) may be latched simultaneously by setting both COUNT and STATUS bits 05,04=0. This is functionally the same as issuing two separate read-back commands at once, and the above discussions apply here also. Specifically, if multiple count and/or status read-back commands are issued to the same counter(s) without any intervening reads, all but the . first are ignored. This is illustrated in Figure 13. If both count and status of a counter are latched, the first read operation of that counter will return latched status, regardless of which was latched first. The next one or two reads (depending on whether the counter is programmed for one or two type counts) return latched count. Subsequent reads return unlatched count. Command Description D7 D6 D5 D4 D3 D2 Dl Do· 1 1 0 1 0 0 0 0 Read back count and status of Counter 0 Results Count and status latched for Counter 0 1 1 1 O. 0 1 0 0 Read back status of Counter 1 1 1 1 0 1 1 0 0 Read back status of Counters 2, 1 Status latched for Counter 2, but not Counter 1 Status latched for Counter 1 1 1 0 1 1 0 0 0 Read back count of Counter 2 Count latched for Counter 2 1 1 0 0 0 1 0 0 Read back count and status of Counter 1 Count latched for Counter 1, but not status 1 1 1 0 0 0 1 0 Read back status of Counter 1 Command ignored, status already latched for Counter 1 Figure 13_ Read-Back Command Example 6-297 inter 82C54 CS RD WR A1 Ao 0 1 0 0 0 Write into Counter 0 0 0 0 1 Write into Counter 1 0 1 1 0 1 0 Write into Counter 2 0 1 0 1 1 Write Control Word 0 0 1 0 0 Read from Counter 0 0 0 1 0 1 Read from Counter 1 0 0 1 1 Read from Counter 2 0 1 1 0 0 1 No-Operation (3-State) 1 X X 1 1 X X X X No-Operation (3-State) 0 This allows the counting sequence to be synchronized by software. Again, OUT does not go high until N + 1 ClK pulses after the new count of N is written. If an, initial count is written while GATE = 0, it will still be loaded on the next ClK pulse. When GATE goes high, OUT will go high N CLK pulses later; no ClK pulse is needed to load the Counter as this has already been done. No-Operation (3-State) Figure 14. Read/Write Operations Summary CW.'. lS . . ._ _ _ _ _ _ _ __ WlI""L.fLJ CLK GATE - - - - - - - - - - - - - - Mode Definitions The fOllowing are defined for use in describing the operation of the 82C54. cwo,. ClK PULSE: a rising edge, then a falling edge"in that order, of a Counter's ClK input. ClK TRIGGER: a rising edge of a,Counter's GATE input. QATE COUNTER lOADING: the transfer of a count from the CR to the CE (refer to the "Functional Description") MODE 0: INTERRUPT ON LSa-3r-_ _ _ _ _ _ _ __ WlI""L.fLJ OUT ..J,--- :.-:J...._______ , N , N , N , N , ~ , :,' : , : ~ , , ~ ,~~, TERMINAL COUNT Mode 0 is typically used for event counting. After the Control Word is written, OUT is initially low, and Will remain low until the Couriter reaches zero. OUT then goes high and remains high until a new count or a new Mode 0 Control Word is written into the Counter. GATE = 1 enables couriting; GATE = 0 disables counting. GATE has no effect on OUT. After the Control Word and initial count are written to a Counter, the initial count will be loaded on the next CLK pulse. This ClK pulse does not decrement the count, so for an initial count of N, OUT does not go high until N + 1 ClK pulses after the initial count is written. If a new count is written to the Counter, it will be loaded on the next ClK pulse and counting will continue from the new count. If a two-byte count is written, the following happens: 1) Writing the first byte disables counting. OUT is set low immediately (no clock pulse required). 2) Writing the second byte allows the new count to be loaded on the next CLK pulse. 6-298 elK --1,--- GATE - - - - - - - - - - - - - OUT :::1..._______ , N , N , N , N , ~ , : , ~ , : , ~ , ~ ,~~, 231244-8 NOTE: The FollOwing Conventions Apply To All Mode Timing , Diagrams: 1. Counters are programmed for binarY (not BCD) counting and for Reading/Writing least significant byte (LSB) only. 2. The counter is always selected (~ always low). S. CW stands for "Control Word";CW = 10 means a control word of 10, hex is written to the counter. 4. LSB stands for "Least Significant Byte" of count. 5. Numbers below diagrams are count values. The lower number is the least significant byte. The upper number is the most significant byte. Since the counter is programmed to Read/Write LSB only, the most sigriificant byte cannot be read. N stands for an undefined count. Vertical lines show transitions between count values. Figure 15. Mode 0 82C54 MODE 2: RATE GENERATOR MODE 1: HARDWARE RETRIGGERABLE ONE-SHOT OUT will be initially high. OUT will go Iowan the ClK pulse following a trigger to begin the one-shot pulse, and will remain low until the Counter reaches zero. OUT will then go high and remain high until the ClK pulse after the next trigger. After writing the Control Word and initial count, the Counter is armed. A trigger results in loading the Counter and setting OUT Iowan the next ClK pulse, thus starting the one-shot pulse. An initial count of N will result in a one-shot pulse N ClK cycles in duration. The one-shot is retriggerable, hence OUT will remain low for N ClK pulses after any trigger. The one-shot pulse can be repeated without rewriting the same count into the counter. GATE has no effect on OUT. If a new count is written to the Counter during a oneshot pulse, the current one-shot is not affected unless the Counter is retriggered. In that case, the Counter is loaded with the new count and the oneshot pulse continues until the new count expires. CW;:12 This Mode functions like a divide-by-N counter. It is typicially used to generate a Real Time Clock interrupt. OUT will initially be high. When the initial count has decremented to 1, OUT goes low for one ClK pulse. OUT then goes high again, the Counter reloads the initial count and the process is repeated. Mode 2 is periodic; the same sequence is repeated indefinitely. For an initial count of N, the sequence repeats every N ClK cycles. GATE = 1 enables counting; GATE = 0 disables counting. If GATE goes low during an output pulse, OUT is set high immediately. A trigger reloads the Counter with the initial count on the next ClK pulse; OUT goes low N ClK pulses after the trigger. Thus the GATE input can be used to synchronize the Counter. After writing a Control Word and initial count, the Counter will be loaded on the next ClK pulse. OUT goes low N ClK Pulses after the initial count is written. This allows the Counter to be synchronized by software also. CW=14 LSB=J eLK eLK GATE LSB=] WI\~~---------------- ~~~------------------ GATE ------In---------~n== OUT OUT I NI NI NI NI NI ~ I : I : I : I ~~ I ~ I : I CW::12 CW= 14 LSB=3~---------- WI\~ OUT J~_ _ _ _ _ _ _ _ _ _ _ _ _ _- eLK eLK GATE LS8= WA~ GATE -------~n----ln---------- =..J aUT~ ,. ININiNINI~I:I:I~I:I:I~1 INININININI~I:I:I~I:I:I:1 eLK GATE - - - - - - - - - - - - - - eLK GATE aUT~ -------;n---------;n=== u ININININI:I~I:I:I:I:I~1 231244-10 OUT I NI NI NI NI NI : I : I : I ~~ I ~~ I : I ~ I NOTE: A GATE transition should not occur one clock prior to terminal count. 231244-9 Figure 17. Mode 2 Figure 16. Mode 1 6-299 intJ 82C54 Writing a new count while counting does not affect the current counting sequence. If a trigger is received after writing a new count but before the end of the current period, the Counter will be loaded with the new count on the next ClK pulse and counting will continue from the new count. Otherwise, the new count will be loaded at the end of the current counting cycle. In mode 2, a COUNT of 1 is illegal. OUT will be high for (N (N -1)/2 counts. CW=HI + 1)/2 counts and low for Lsa=4r___----------- ... L-JL.J MODE 3: SQUARE WAVE MODE INI"I"I-I:I:I:I:I:I:I:I:I:I:I Mode 3 is typically used for Baud rate generation. Mode 3 is similar to Mode 2 except for the duty cycle of OUT. OUT will initially be high. When half the initial count has expired, OUT goes low for the remainder of the count. Mode 3 is periodic; the sequence above is repeated indefinitely. An initial count of N results in a square wave with a period of N ClK cycles. wwl:ii:Jr-----'--------- I " I " I " I _I : I : I : I.: I : I : I : I : I : I : I GATE = 1 enables counting; GATE = 0 disables counting. If GATE goes low while OUT is low, OUT is set high immediately; no ClK pulse is required. A trigger reloads the Counter with the initial count on the next ClK pulse. Thus the GATE input can be used to synchronize the Counter. n_~r-------------- OUT After writing a Control Word and initial count, the Counter will be loaded on the next ClK pulse. This allows the Counter to be synchronized by software also. I _I " I I ". I : I·: I : I : I : I : I : I : I : I : I N 231244-11 NOTE: A GATE transition should not occur one clock prior to terminal count. Writing a new count while counting does not affect the current counting sequence. If a trigger is received after writing a new count but before the end of the current half-cycle of the square wave, the Counter will be loaded with the new count on the next ClK pulse and counting will continue from the new count. Otherwise, the new count will be loaded at the end of the current half-cycle. Figure 18. Mode 3 MODE 4: SOFTWARE TRIGGERED STROBE OUT will be initially high. When the initial count expires, OUT will go low for one ClK pulse and then go high again. The counting sequence is "triggered" by writing the initial count. Mode 3 is implemented as follows: Even counts: OUT is initially high. The initial count is loaded on one ClK pulse and then is decremented by two on succeeding ClK pulses. When the count expires OUT changes value and the Counter is reloaded with the initial count. The above process is repeated indefinitely. Odd counts: OUT is initially high. The initial count minus one (an even number) is loaded on one ClK pulse and then is decremented by two on succeeding ClK pulses. One ClK pulse after the count expires, OUT goes low and the Counter is reloaded with the initial count minus one. Succeeding ClK pulses decrement the count by two. When the count expires, OUT goes high again and the Counter is reloaded with the initial count minus one. The above process is repeated indefinitely. So for odd counts, GATE = 1 enables counting; GATE = 0 disables counting. GATE has no effect on OUT. After writing a Control Word and initial count, the Counter will be loaded on the next ClK pulse. This ClK pulse does not decrement the count, so for an initial count of N, OUT does not strobe low until N + 1 ClK pulses after the initial count is written. If a new count is written during counting, it will be loaded on the next ClK pulse and counting will continue from the new count. If a two-byte count is written, the following happens: 6-300 inter 82C54 1) Writing the first byte has no effect on counting. 2) Writing the second byte allows the new count to be loaded on the next ClK pulse. This allows the sequence to be "retriggered" by software. OUT strobes low N + 1 ClK pulses after the new count of N is written. CW",18 lSB=3r.-_ _ _ _ _ _ _ __ WR '--1L.J elK GATE - - - - - - - - - - - - - - u aUT~ CW:18 After writing the Control Word and initial count, the counter will not be loaded until the ClK pulse after a trigger. This ClK pulse does not decrement the count, so for an initial count of N, OUT does not strobe low until N + 1 ClK pulses after a trigger. A trigger results in the Counter being loaded with the initial count on the next ClK pulse. The counting sequence is retriggerable. OUT will not strobe low for N + 1 ClK pulses after any trigger. GATE has no effect on OUT. If a new count is written during counting, the current counting sequence will not be affected. If a trigger occurs after the new count is written but before the current count expires, the Counter will be loaded with the new count on the next ClK pulse and counting will continue from there. lSB=3_--------- WR'--1L.J CW=lA LSB=J ~.~~----------- elK eLK GATE ---------! GATE OUT~ -n----l n--u-----lrc.= OUT I I I I I I ~ I ~ I : I : I ;; I ~ N N N CW",lA WR N LSB=J ~r-------------------- CLK elK GATE - - - - - - - - - - - - - - OUT N GATE Lr =.:J OUT I I I I I I: I ~ I : I I ~ I ;; I N N N N - - - - - - - - -" ~ - - - - - - - - - - -- =-.J I I I I I I I ~ I ~ I ~ I ~ I : I : I ;; I N 231244-12 N N N N N Figure 19. Mode 4 MODE 5: HARDWARE TRIGGERED STROBE (RETRIGGERABLE) GATE OUT will initially be high. Counting is triggered by a rising edge of GATE. When the initial count has expired, OUT will go low for one ClK pulse and then go high again. OUT --------vr-n-n---l,n=.:== =.J U I I I I I I ~ I ~ I : I : I ;; I ;: I : I : I N N N N N 231244-13 Figure 20. Mode 5 6-301 82C54 Signal Status Modes Low Or Going Low 0 Disables counting 1 - 2 3 Operation Common to All Modes Rising High Programming - Enables counting 1) Initiates counting 2) Resets output after next clock - Initiates counting Enables counting Initiates counting Enables counting 1) Disables counting 2) Sets output immediately high 1) Disables counting 2) Sets output immediately high GATE 4 Disables counting - Enables counting 5 - Initiates counting - Figure 21. Gate Pin Operations Summary MODE 0 MAX MIN COUNT COUNT 1 0 1 1 0 2 2 0 3 2 0 4 1 0 When a Control Word is written to a Counter, all Control logic is immediately reset and OUT goes to a known initial state; no ClK pulses are required for this. NOTE: is equivalent to 216 for binary counting and 104 for BCD counting o Figure 22. Minimum and Maximun initial Counts The GATE input is always sampled on the rising edge of ClK. In Modes 0, 2, 3, and 4 the GATE input is level sensitive, and the logic level is sampled on the rising edge of ClK. In Modes 1, 2, 3, and 5 the GATE input is rising-edge sensitive. In these Modes, a rising edge of GATE (trigger) sets an edge-sensitive flip-flop in the Counter. This flip-flop is then sampled on the next rising edge of ClK; the flip-flop is reset immediately after it is sampled. In this way, a trigger will be detected no matter when it occurs-a high logic level does not have to be maintained until the next rising edge of ClK. Note that in Modes· 2 and 3, the GATE input is both edge- and level-sensitive. In Modes 2 and 3, if a ClK source other than the system clock is used, GATE should be pulsed immediately following WR of a new count value. COUNTER New counts are loaded and Counters are decremented on the falling edge of ClK. The largest possible initial count is 0; this is equivalent to 216 for binary counting and 104 for BCD counting. The Counter does not stop when it reaches zero. In Modes 0, 1, 4, and 5 the Counter "wraps around" to the highest count, either FFFF hex for binary counting or 9999 for BCD counting, and continues counting. Modes 2 and 3 are periodic; the Counter reloads itself with the initial count and continues counting from there. 6-302 inter 82C54 ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias ....... O°C to 70°C Storage Temperature ............ - 65° to + 150°C Supply Voltage ................... - 0.5 to + B.OV Operating Voltage .................. + 4V to + 7V Voltage on any Input. ......... GND - 2V to + 6.5V Voltage on any Output .. GND - 0.5V to Vee + 0.5V Power Dissipation ........................ 1 Watt • Notice: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied Exposure to absolute maximum rating conditions for extended periods may affect device reliability. NOTICE: Specifications contained within the following tables are subject to change. D.C. CHARACTERISTICS (TA=O°Cto WC, Vee=5V± 10%, GND=OV) Min Max Units Input low Voltage -0.5 O.B V VIH Input High Voltage 2.0 VOL Output low Voltage VOH Output High Voltage Symbol VIL Parameter Vee + 0.5 0.4 3.0 Vee - 0.4 Test Conditions V V IOL = 2.5 mA V V IOH = -2.5 mA IOH = -100/LA IlL Input load Current ±10 V VIN=Vee toOV IOFL Output Float leakage Current ±10 /LA VOUT=Vee to 0.45V lee Vee Supply Current 10 mA leeSB Vee Supply Current-Standby 10 /LA CAPACITANCE (TA Symbol CIN Clk Freq= BMHzB2C54 1OMHz 82C54-2 ClK Freq = DC CS = HIGH All Inputs/Data Bus HIGH All Outputs Floating = 25°C, Vee = GND = OV) Parameter Min Input Capacitance Units 10 pF fc = 1 MHz Unmeasured pins returned to GND CliO I/O Capacitance 20 pF COUT Output Capacitance 20 pF A.C. CHARACTERISTICS (TA Test Conditions Max = O°C to 70°C, Vee = 5V ± 10%, GND = OV) BUS PARAMETERS (Note 1) READ CYCLE Symbol 82C54-2 82C54 Parameter Min Max Min Units Max tAR Address Stable Before RD .! 45 30 ns tSR CS Stable Before RD .! 0 0 ns tRA Address Hold Time After RD .! 0 0 ns tRR RD Pulse Width 150 95 tRO Data Delay from RD .! tAD Data Delay from Address tOF RD t to Data Floating tRY Command Recovery Time 120 220 5 200 NOTE: 1. Ae timings measured at VOH = 2.0V, VOL = O.BV. 6-303 90 5 165 ns 85 ns 185 ns 65 ns ns 82C54 A.C. CHARACTERISTICS (Continued) WRITE CYCLE Symbol 82C54 Parameter Min J, tAW Address Stable Before WR tsw CS Stable Before iNA J, tWA Address Hold Time After WR tww WR Pulse Width tow Data Setup Time Before WR t two Data Hold Time After WR tRY Command Recovery Time t t Max 82C54-2 Min Units Max 0 0 ns 0 0 ns 0 150 120 0 200 0 95 95 0 165 ns ns ns ns ns CLOCK AND GATE Symbol tClK Clock Period tPWH High Pulse Width tPWl low Pulse Width TR Clock Rise Time tF 82C54 ,Parameter Gate Width High tGl Gate Width low tGS Gate Setup Time to ClK t tGH Gate Hold Time After ClK t Too Output Delay from ClK J, tOOG Output Delay from Gate J, twc ClK Delay for loading twG Gate Delay for Sampling two OUT Delay from Mode Write tCl ClK Set Up for Count latch_ Units Min Max Min Max 125 60[3] , 60(3) DC 100 30[3] 50 131 DC 25 25 ' Clock Fall Time lGw 82C54-2 50 50 50 50(2) 0 -5 -4 ns ns 25 25 50 50 40 50(2) 150 120 55 50 260 45 0 -5 -40 ns ns ns ns ns ns ns 100 100 55 40 240 40 ns ns nli ns ns ns NOTES: 2, In Modes 1 and 5 triggers are sampled on each rising clock edge. A second trigger within 120 ns (70 ns for the 8254-2) of the rising clock edge may not be detected. ' 3. low-going glitches that violate tPWH. tPWL may cause errors requiring counter reprogramming. 6-304 inter 82C54 ~OO~Ufi'{(]OOO~OOW WAVEFORMS WRITE A O. 1 ~IAW~ CS DATA BUS WR 231244-14 READ Ao·, IA. CS QATABUS--- 231244-15 ~}+-I.V=1\ RD. Wii~.,-. _ _J 6-305 231244-16 inter 82C54 CLOCK AND GATE eLK -----'--.Jr! GATE - -_ _-"-_ _ _ _~_II OUTPUT 0 231244-17 • Last byte of count being written A.C. TESTING INPUT, OUTPUT WAVEFORM A.C. TESTING LOAD CIRCUIT INPUT/OUTPUT 24=X . > 2.0 ' TEST POINTS 0.45 0.8 < )C 2.0 0.8 231244-18 A.C. Testing: Inputs are driven at 2.4V for a logic "1" and 0.45V for a logic "0." Timing measurements are made at 2.0V for a logic "1" and 0.8V for a logic "0." 231244-19 CL = 150 pF CL includes jig capacitance 6-306 intel@ 8255A/8255A·5 PROGRAMMABLE P.ERIPHERAL INTERFACE • MCS·85™ Compatible 8255A·5 • 24 Programmable 1/0 Pins • Completely TTL Compatible • Fully Compatible with Intel® Micro· processor Families • Improved Timing Characteristics • Direct Bit SetlReset Capability Easing Control Application Interface • Reduces System Package Count • Improved DC Driving Capability • Available in EXPRESS -Standard Temperature Range -Extended Temperature Range The Intel@ 8255A is a general purpose programmable 1/0 device designed for use with Intel@ microprocessors. It has 241/0 pins which may be individually programmed in 2 groups of 12 and used in 3 major modes of operation. In the first mode (MODE 0), each group of 121/0 pins may be programmed in sets of 4 to be input or output. In MODE 1, the second mode, each group may be programmed to have 8 lines of input or output. Of the remaining 4 pins, 3 are used for handshaking and interrupt control signals. The third mode of operation (MODE 2) is a bidirectional bus mode which uses 8 lines for a bidirectional bus, and 5 lines, borrowing one from the other group, for handshaking. Figure 2. Pin Configuration Figure 1. 8255A Block Diagram ~INTEL CORPORATION, 1982. 6-307 Order Number: 231308-001 .f •"In+._ I"e' 8255A!8255A·G 82S5A FUNCTIONAL DESCRJPTION (RD) Rea~ A "low" on this input pin enables the 8255A to :;eM the data or status information to the CPU on the data bus. In essence, it allows the CPU to "read from" .the 8255A. General The 8255A is a programmabje peripheral interface (PPI) device designed for use in Intel® microcomputer systems. Its function is that of a general purpose 1/0 component to interface peripheral equipment to the microcomputer system bus. The functional configuration of the 8255A is programmed by the system software so that normally no external logic is necessary to interface peripheral devices or structures. (WR) Write. A "low" on this input pin enables the CPU to write data or control words into the 8255A. Data Bus Buffer This 3-state bidirectional 8-bit buffer is used to interface the 8255A to the system data bus. Data is transmitted or received by the buffer upon execution of input or output instructions by ttie CPU. Control words and st<;itus infor mation are also transferred through the data bus buffer. (Ao and Al) Pori Select 0 and Pori Select 1f These input Signals, in conJuncfion with the RD and WR inputs, control the selection of one of the three ports or the control word registers. They are normally connected to the least significant bits of the address bus (An and A l ). 8255A BASIC OPERAIION. INPUT OPERATION (READ) Al AO RD WR CS 0 0 1 0 1 0 0 0 0 1 1 0 0 0 PORT A = DATA BUS PORT B = DATA BUS PORT C = DATA BUS OUTPUT OPERATION (WRITE) 0 0 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 DATA DATA DATA DATA X 1 X 1 X 0 X 1 1 0 DATA BUS = 3-STATE ILLEGAL CONDITION X X 1 1 0 DATA BUS= 3-STATE ReadlWrite and Control Logic The function of this block is to manage all of the internal and external transfers of both Data and Control or Status words. It accepts inputs from the CPU Address and Con'tTOI busses and in turn, issues commands to both of the Control Groups. 1 1 BUS= BUS = BUS = BUS = PORT A PORT B PORT C CONTROL DISABLE FUNCTION (es) ChiD Select_ A "low" on this input pin enables tna com' muniction belween the 8255A and the CPU. POWER -OW [ SUPPLIES _ _ ''" iW--_ W1\--_ ', ___ WRITE C~~6~~L '0--- ,,------' Figure 3_" 8255A Block Diagram Showing Data Bus Buffer and Read/Write Control Logic Functions 6-308 231308-001 8255A18255A·5 (RESET) Ports A, S_ and C Reset. A "'high" on this input clears the control register and all ports (A, B, C) are set to the input mode. The 8255A contains three 8-bit ports lA, B, and C)- ArT can be configured in a wide variety of functional characteristics by the system software but each has its own special features or "personality" to further enhance the power and flexibility of the 8255A_ Group A and Group B Controls The functional configuration of each port is program· med by the systems software. In essence, the CPU "out· puts" a control word to the 8255A. The control word contains information such as "mode", "bit set", "bit reset", etc., that initializes the functional configuration of the 8255A. Each of the Control blocks (Group A and Group B) accepts "commands" from the Read/Write Contr~1 Logic, receives "control words" from the internal data bus and issues the proper commands to its associated ports. Control Group A - Port A and Port C upper (C7-C4) Control Group B - Port B and Port Clower (C3·CO) Port A. One 8·bit data output latch/buffer and one 8·bit data input latch. Port B. One 8-bit data input/output latch/buffer and one 8·bit data input buffer. Port C. One 8·bit data output latch/buffer and one 8·bit data input buffer (no latch for input). This port can be divided into two 4·bit ports under the mode control. Each 4·bit port contains a 4·bit latch and it can be used for the control signal outputs and status signal inputs in conjunction with ports A and B. The Control Word Register can Only be written into. No Read operation of the Control Word Register is allowed. PIN CONFIGURATION '0'"{-.,. $UPPl-IES _ _ ,"0 PIN NAMES ,,0 Pill-PliO IJ, Do RESET cs DATA BUS (BI DIRECTIONAL) RESET INPUT CHIP SELECT AD READ INPUT W'R WRITE INPUT AO, Al ~AT PA7·PAQ PORT A {BIT) PB7 PBO pe7·peo PORT B (BIT) ADDRESS PORT C (BIT) ~c£. +5VOllS GND II VOLTS Figure 4. 8225A Block Diagram Showing Group A and Group B Control Functions 231308·001 6-309 8255A/8255A-5 8255A OPERATIONAL DESCRIPTION Mode Selection CONTROL WORD I0 1 There are three basic modes of operation that can be selected by the system software: 7 o. 05 1O. 1031 0, 10, 1do I LJ Mode 0 - Basic Input/Output Mode 1 - Strobed Input/Output Mode 2 - Bi-Directional Bus / When the reset input goes "high" all ports will be set to the input mode (Le_, all 24 lines will be in the high impedance state)_ After the reset is removed the 8255A can remain in the input mode with no additional initialization required_ During the execution of the system program any of the other modes may be selected using a'single output instruction. This allows a single 8255A to service a variety of peripheral devices with a simple software maintenance routine. GROUPS \ PORT C (LOWER) L-.. 1'" INPUT 0"" OUTPUT - PORTB 1 = INPUT 0'" OUTPUT MODE SELECTION O=MODEO 1 "'MODE 1 The modes for Port A and Port B can be separately defined, while Port C is divided into two portions as required by the Port A and Port B definitions. All of the output registers, including the status flip-flops, will be reset whenever the mode is changed. Modes may be combined so that their functional definition can be "tailored" to almost' any I/O structure. For instance; Group B can be programmed in Mode 0 to monitor simple switch closings or display computational results, Group A could be programmed in Mode 1 to monitor a keyboard or tape reader on an interrupt-driven basis. / GROUP A \ PORT C (UPPER) 1'" INPUT 0'" OUTPUT PORT A 1 '" INPUT 0= OUTPUT MODE SELECTION 00 .. MODE 0 01", MODE 1 1X=MQDE2 ADDRESS BUS MODE SET FlAG , '" ACTIVE CONTROL BUS Figure 6. Mode Definition Format MODE: 0 The mode definitions and possible mode combinations may seem confusing at first but after a cursory review of the complete device operation a simple, logical I/O approach will surface. Ti1e design of the 8255A has taken into account things such as efficient PC board layout, control signal definition vs PC layout and complete functional flexibility to support almost any peripheral device with no external logic. Such design represents the maximum use of the available pins. Single Bit Set/Reset Feature Figure 5. Basic Mode Definitions and Bus Interface Anyofthe eight bits of PortC can beSet or Reset using a single OUTput instruction, This feature reduces software requirements iri Control-based applications. 6-310 231308-001 intJ 8255A/8255A-5 When Port C is being used as status/control for Port A or B, these bits can be set or reset by using the Bit Set/Reset operation just as if they were data output ports. CONTROL WORD I~I~I~I~I~I~I~I~I I I I I X X X I I Interrupt Control Functions BIT SET/RESET 1'" SET 0'" RESET DON'T CARE When the B255A is programmed to operate in mode 1 or mode 2, control signals are provided that can be used as interrupt request inputs to the CPU_ The interrupt request signals, generated from port C, can be inhibited or enabled by setting or resetting the associated INTE flipflop, using the bit set/reset function of port C_ I BIT SELECT 01234567 01010101 80 0011001181 This function allows the Programmer to disallow or allow a specific I/O device to interrupt the CPU without affecting any other device in the interrupt structure. 0000'1118,1 I NTE flip-flop definition: BIT SET/RESET FLAG 0'" ACTIVE I (BIT-SET) -INTE is SET -Interrupt enable (BIT-RESET) -INTE is RESET -Interrupt disable Note: All Mask flip-flops are automatically reset during mode selection and device Reset. Figure 7. Bit Set/Reset Format Operating Modes Mode 0 Basic Functional Definitions: MODE 0 (Basic Input/Output). This functional configuration provides simple input and output operations for each of the three ports. No "handshaking" is required, data is simply written to or read from a specified port • - Two B-bit ports and two 4-bit ports_ • Any port can be input or output_ • Outputs are latched_ • Inputs are not latched. • 16 different Input/Output configurations are possible in this Mode_ tRR RD -, f- --'[-- !.---t HR _ ~IRINPUT -tRA----:1 j - - tAR - CS, Al, AO ---------tRO tOF . --- MODE 0 (Basic Input) two i------tAW-----+i i-------'wA----~ CS, Al.AO L .d - OUTPUT MODE 0 (Basic Output) 6-311 231308-001 intJ 8255A/8255A-5 MODE 0 Port Definition A B GROUPB GROUPA PORTC 03 01 DO 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 OUTPUT OUTPUT 0 OUTPUT OUTPUT OUTPUT INPUT OUTPUT 1 2 '3 OUTPUT OUTPUT INPUT OUTPUT INPUT INPUT OUTPUT OUTPUT OUTPUT INPUT INPUT OUTPUT 0 1 0 1 (UPPERI # PORT B PORTC 04 PORTA OUTPUT OUTPUT OUTPUT INPUT OUTPUT INPUT 4 5 OUTPUT INPUT 6 OUTPUT INPUT INPUT OUTPUT INPUT OUTPUT INPUT OUTPUT INPUT OUTPUT INPUT INPUT 7 8 9 10 11 12 13 14 15 INPUT INPUT INPUT INPUT INPUT INPUT (LOWERI OUTPUT INPUT INPUT OUTPUT OUTPUT OUTPUT INPUT INPUT OUTPUT INPUT INPUT OUTPUT OUTPUT OUTPUT INPUT INPUT OUTPUT INPUT INPUT MODE 0 Configurations CONTROL WORD #2 CONTROL WORD #0 0, D, D, D, D, D, D, D, Do I, 10101010101 I 0 I 8 A , c{ , 8 B D, D, D, Do 8 A , c{ PC 7·PC 4 ° 7-00 , PC 3-PCa 8 B PB 7·PBo PA 7·pAo PC 7·PC 4 PCa-PCa PB 7·PBo CONTROL WORD #3 D, D, D, D, Do , 8 A , c{ 0, D, D, D, D, 0 0 0 0 0 " 8 00 , 1,1 8 A PA7·P!\o 8255A PC 7 -PC 4 °7-00 I B D, IIIIIII o 8255A °7,00 D, 8255A I, I0 I I0 I0 I0 I I, I o D, PA 7·PAo CONTROL WORD #1 D, D, I, I I I I I I '1:.1 8255A q D, 0 0 0 0 0 o °7-0 0 D, D, I . , c{ PC"PCo 0 PB 7·PB a B 6-312 I (' 8 PA"PAo PC 7·PC4 pea-Peo PB 7 ·PBo 231308-001 intel' 8255A/8255A-5 CONTROL WORD #4 D, D, I, CONTROL WORD =8 DJ D, D5 I Io I I,1 0 0 D, D, 0 1 D, Do o I 1 0 I 8 A , D6 D5 0 0 1 1 D, , 1 DJ D, D, 0 0 0 1 1 0 4 4 8 B I , D, D5 D, 0 0 0 1 1 1 , 1 D, D, 0 0 1 °7-0 0 pe3 -pc O P~·PBo D, D, I, 8 , c{ 4 8 DJ D, D5 , 1 o 1 1 0 1 o D, D, D, 1 o ,1 1 1 1 0 1 8 B 0 • D, D, D5 D, , DJ D, 0 0 , 0 0 1 1 1 1 1 0 D, PSJ-PBO PArPAo 4 , ,4 8 PC 7 -PC 4 pe 3 -pc O PBrPBo 1 DO ,1 0 I 8 A PAl-PAC 4 8 4 c{ PC 1 -PC 4 °7.0 0 .. PA1 -PAo pe 3 -pc O , ,8 B PBJ-PBO PC 7-PC4 pe 3 ,pcO I PBJ,PSO ,,8 PAJ-PAc CONTROL WORD #11 DJ , 1 1 D, D, 0 , 1 D, Do I I' c{ . B D, I, 8 A 7 pel-pcO 8255A ," 8255A ° -° ,8 PSl·PBo CONTROL WORD #7 0 , pe 3 -pc O I B 0 I, I c{ . 0 I c{ °7-0 0 • , o PC, ·PC 4 8255A D, 1 DO A Do A D5 8 PC 7 ·PC 4 CONTROL WORD #10 DJ D, 1 0 1 0 1 0 I, 1 0 1 D, PAl-PAC 8255A CONTROL WORD #S D, 4 D, PA7·pAo °7-0 B I, 4 B 1 ' I 1 . O,·DiI .. D5 ,8 c{ PC 7"PC 4 Do A D, , A CONTROL WORD #9 DJ 8255A D, I PAJ-PAO CONTROL WORD #5 D, 1 8255A c{ • 0 1 8255A °7"0 DO , 1 0 1 0 8 ,1 1 DJ D, D, 0 1 0 1 DO 1 I, I A 8255A PC-,.PC4 7 ,00 " D, PA,·pAo ° I D5 pel·pc O • c{ B PBJ-PSO 6-313 , , , 8 PC 7 -PC 4 pel-pcO PSJ-PBO 231308-001 8255A/8255A-5 CONTROL WORD #12 07 I De 1 05 1 04 1 D3 1 02 1 01 1 Do I 10 0 ,8 A 8255A . c{ I . PA 7·PAa A 8255A ,4 I °7-0 0 4 8 B pe 3 ,pc C I 06 1 05 1 04 1 . " i I PArPA o 4 PC 7 ·PC 4 pe 3 "pc O B PB 7,PBo ,8 7 PBrPBo CONTROL WORD #15 CONTROL WORD #13 07 c{ PC,-PC 4 I D3 1 02 1 01 1 Do I, I 0 8 A A 8 8255A 8255A c{ 8 ,4 . I 4 8 c{ B 4 4 8 Mode 1 Basic Functional Definitions: Operating Modes • Two Groups (Group A and Group B) • Each group contains one 8·bit data port and one 4·bit control/data port. • The 8·bit data port can be either input or output. Both inputs and outputs are latched. • The 4·bit port is used for control and status of the 8·bit data port. MODE 1 (Strobed Input/Output). This functional con- figu ration provides a means for transferring I/O data to or from a specified port in conjunction with strObes or "handshaking" signals. In mode 1, port A and port B use the lines on port C to generate or accept these "hand-shaking" signals. 6-314 231308-001 8255A/8255A-5 Input Control Signal Definition MODE 1 (PORT A) STB (Strobe Input). A "low" on this input loads data into the input latch. CONTROL WORD r - - --, IBF (Input Buffer Full F/F) , INTE I PC 4 - r n A ~3_J A "high" on this output indicates that the data has been loaded into the input latch; in essence, an aCknowledgement IBF is set by STB input being low and is reset by the rising edge of the RD input. pes IBF A CL INTR (Interrupt Request) A "high" on this output can be used to interrupt the CPU when an input device is requesting service. INTR is set by the STB is a "one", IBF is a "one" and INTE is a "one". It is reset by the falling edge of RD. This procedure allows an input device to request service from the CPU by simply strobing its data into the port. MODE 1 (PORT BJ CONTROL WORD INTE A Controlled by bit set/reset of PC 4 . INTE B Controlled by bit set/reset of PC 2 . Figure 8. MODE 1 Input - - - - - t 5T - - - - If ,-'SIBIl IBF tSIT ---I i 1 INTR 1~-tR'B~) --- tRIT I I // / / ___ tpH~1 INPUT FROM PERIPHERAL --- tps --------------------- Figure 9. MODE 1 (Strobed Input) 6-315 231308-001 8255AJ8255A·5 Output Control Signal Definition 'MODE 1 (PORT AJ OBF (Output Buffer Full F/F). The OBF output will go "low" to indicate that the CPU has written data out to the specified port. The OBF F/F will be set by the rising edge of the WR input and reset by ACK input being low. CONTROL WORD ACK (Acknowledge Input). A "Iow" on this input informs the 8255A that the data from port A or port B has been accepted. In essence, a response from the peripheral device indicating that it has recieved the data output by the CPU. INTR (Interrupt Request). A "high" on this output can be used to interrupt the CPU when an output device has accepted data transmitted by the CPU. INTR is set when ACK is a "one", OBF is a "one", and INTE is a "one". It is reset by the falling edge of WR. MODE 1 (PORT B) CONTROL WORD 07 06 05 04 0 3 02 0, Do 1, fXk> TEST POINTS < UNDER TEST 2.0 i CL~15DpF -0 VEXT• V -= 0.8 A,C. TESTING. INPUTS ARE DRIVEN AT 2.4V FOR A LOGIC" 1" AND OASV FOR A LOGIC "0_'- TIMING MEASUREMENTS ARE MADE AT 20V FOR A lOGIC l' AND a.BV FOR A LOGIC' 0 'VEXT IS SET AT VARIOUS VOLTAGES DURING TESTING TO GUARANTEE THE SPECIFICATION. CllNCLUDES JIG CAPACITANCE. 6-324 8255A18255A·5 WAVEFORMS MODE 0 (BASIC INPUT) 'RR ] r- ~r e I-tHA-i lR - INPUT t'==..:AR-- -tRA~1 CS, A1, AO --------- < 'RD 1 I. MODE 0 (BASIC OUTPUT) -----·--t,.. w~-WR CS, A1, AO OUTPUT 6-325 'D' r-- . intel' 8255A/8255A-5 WAVEFORMS (Continued) MODE 1 (STROBED INPUT) , - - t ST ----------- V -t"81 1 IBF tSIT -! i.-tRIT 1 _tpH~1 INPUT FROM PERIPHERAL --- :1 !L INTA l _ tRI8 - \ 1 1 .J --------------------- . tps MODE 1 (STROBED OUTPUT) INTR _twiT - tAK OUTPUT 6-326 82SSA/82SSA-S WAVEFORMS (Continued) MODE 2 (BIDIRECTIONAL) / DATA FROM 8080 TO 8255 INTR IBF II ------t--- PERIPHERAL _ _ _ _ _ _ _ _ _ _ BUS I _ I-IRIB / DATA FROM ·PERIPHERAL TO 8255 DATA FROM 8255 TO 8080 NOTE: Any sequence where WR occurs before ACK and STB occurs before RD is permissible. (lNTR = IBF • MASK· STB • RD + OBF.· MASK· ACK • WR ) READ TIMING WRITE TIMING AD_,· cs==x:'--_______-"I~\...----l - i--tRA ----------- RD------------------,~~: . ..-,IRO t- 6-327 -ttDF~ 82C55A CHMOS PROGRAMMABLE PERIPHERAL INTERFACE with all Intel and most • Compatible other microprocessors High Speed, "Zero Wait State" • Operation with 8 MHz 8086/88 and 80186/188 Programmable I/O Pins • 24Bus-hold on all I/O Ports • Eliminatescircuitry Pull-up Resistors Low Power CHMOS • Completely Compatible • Control WordTTLRead-Back Capability • Direct Bit Set/Reset Capability • 2.5 rnA DC Drive Capability on all I/O • Port Outputs • Available in 40-Pin DIP and 44-Pin PLCC The Intel 82C55A is a high·performance, CHMOS version of the industry standard 8255A general purpose programmable 1/0 device which is designed for use with all Intel and most other microprocessors. It provides 24 I/O pins which may be individually programmed in 2 groups of 12 and used in 3 major modes of operation. The 82C55A is pin compatible with the NMOS 8255A and 8255A-5. In MODE 0, each group of 12 1/0 pins may be programmed in sets of 4 and 8 to be inputs or outputs. In MODE 1, each group may be programmed to have 8 lines of input or output. 3 of the remaining 4 pins are used for handshaking and interrupt control signals. MODE 2 is a strobed bi-directional bus configuration. The 82C55A is fabricated on Intel's advanced CHMOS III technology which provides low power consumption with performance equal to or greater than the equivalent NMOS product. The 82C55A is available in 40-pin DIP and 44-pin plastic leaded chip carrier (PLCC) packages. 6 5 .. w I'e,-PC. PC7 11 pe6 13 PCS 14 PC4 15 PCD 16 PCI 17 3 2 1 .... 43 42 41 40 82eSSA Y"WnnnUBUD~ 231256-31 " ts-----' 231256-1 Figure 1. 82C55A Block Diagram 231256-2 Figure 2. 82C55A Pinout Diagrams are for pin reference only. Package sizes are not to scale. Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. November 1985 © Intel Corporation, 1985 6-328 Order Number: 231256-002 82C55A Table 1. Pin Description Symbol PA3-0 Pin Number Dip PLCC 1-4 Type 2-5 1/0 Name and Function PORT A, PINS 0-3: Lower nibble of an 8·bit data output latchl buffer and an 8·bit data input latch. RD 5 6 I READ CONTROL.: This input is low during CPU read operations. CS 6 7 I CHIP SELECT: A low on this input enables the 82C55A to respond to RD and WR signals. RD and WR are ignored otherwise. I ADDRESS: These input signals, in conjunction RD and WR, control the selection of one of the three ports or the control word registers. GND 7 8 A1-0 8-9 9-10 System Ground A1 Ao RD WR CS Input Operation (Read) 0 0 0 1 0 Port A • Data Bus 0 1 0 1 0 Port B • Data Bus 1 0 0 1 0 Port C • Data Bus 1 1 0 1 0 Control Word· Data Bus Output Operation (Write) 0 0 1 0 0 Data Bus· Port A 0 1 1 0 0 Data Bus· Port B 1 0 1 0 0 Data Bus· Port C 1 1 1 0 0 Data Bus· Control X X X X 1 Data Bus· 3 • State X X 1 1 0 Data Bus· 3 • State Disable Function PC7-4 10-13 PCO-3 14-17 PBO.7 18-25 110 PORT C, PINS 4-7: Upper nibble of an 8·bit·data output latchl buffer and an 8·bit data input buffer (no latch for input). This port can be divided into two 4·bit ports under the mode control. Each 4·bit port contains a 4·bit latch and it can be used for the control signal outputs and status signal inputs in conjunction with ports Aand B. 16-19 1/0 PORT C, PINS 0.;.3: Lower nibble of Port C. 20-22, 24-28 1/0 PORT B, PINS 0-7: An 8·bit data output latchlbuffer and an 8· bit data input buffer. 11,13:-15 + 5V Power Supply. Vee 26 29 07-0 27-34 30-33, 35-38 1/0 RESET 35 39 I RESET: A high on this input clears the control register and all ports are set to the input mode.. WR 36 40 I WRITE CONTROL: This input is low during CPU write operations. 37-40 41-44 ·1/0 PA7-4 NC 1,12, 23,34 SYSTEM POWER: DATA BUS: Bi·directional, tri·state data bus lines, connected to system data bus. PORT A, PINS 4-7: Upper nibble of an 8·bit data output latchl buffer and an 8·bit data input latch. No Connect 6·329 inter 82C55A 82C55A FUNCTIONAL DESCRIPTION Generai The 82C55A is a p~ogrammable peripheral interface device designed for use in Intel microco'!'puter systems. Its function is that of a general purpose 110 component to interface peripheral equ!pment to .the microcomputer system bus. The functIonal confIguration of the 82C55A is programmed by the system software so that normally 'no external logic is necessary to interface peripheral devices or structures. Data Bus Buffer This 3-state bidirectional 8-bit buffer is used to interface the 82C55A to the system data bus. Data is transmitted or received by the buffer upon execution of input or output instructions by the CPU. Control words and status information are also transferred through the data bus ·buffer. Read/Write and Control Logic The function of this block is to manage all of the internal and external transfers of both Data and Control or Status words. It accepts inputs from the CPU Address and Control busses and in turn, issues commands to both of the Control Groups. Each of the Control blocks (Group A and Group B) , accepts "commands" from the Read/Write Control Logic, receives "control words" from, the in.ternal data bus and issues the proper commands to Its associated ports. Control Group A - Port A and Port C upper (C7 -C4) Control Group B - Port 13 and Port Clower (C3-CO) The control word register can be both written and read as shown in the address decode bible in the pin descriptions. Figure 6 shows the control word format for both Read and Write operations. When the control word is read, bit 07 will always be a logic "1 ", as this implies control word mode information. Ports A. B. and C The 82C55A contains three 8-bit ports (A, B, and C). All can be configured in a wide variety of functional characteristics by the system software but each has its own special features or "personality" to further enhance the power and flexibility of the 82C55A. Port A. One 8-bit data output latch/buffer and one 8-bit input latch buffer. Both "pull-up" and "pulldown" bus hold devices are present on Port A. Port B. One 8-bit data, input/output latch/buffer. Only "pull-up" bus hold devices are present on Port B. Group A and Group B Controls The functional configuration of each port is programmed by the systems software. In essence, the CPU "outputs" a control word to the 82C55A. The control word contains information such as "mode", "bit -set", "bit reset", etc.; that initializes the functional configuration of the 82C55A. Port C. One 8-bit data outputlatch/buffer and one 8-bit data input buffer (no latch for input). This port can be divided into two 4-bit ports under the mode control. Each 4-bit port contains a 4-bit latch and it can be used for the control signal outputs and status signai inputs in conjunction with ports A and B. Only "pull-up" bus hold devices are present on Port C. . See Figure 4 for the bus-hold circuit configuration for Port A, B, and C. ' 6-330 82C55A I- - ' v GROUP A PORT A ---aND '" JC==::> p~~ PAo 81 OIR(CTIQNAL DATA BUS 0, Do /'----"1 I BIT INTERNAL OATA8US ,0 1'r........- - . / P Cl PCO ;;0---I/'-~-~, 0'0 IV........- - . / pa,·PBD ..,----1 RfSET----/ 13------' 231256-3 Figure 3. 82C55A Block Diagram Showing Data Bus Buffer and Read/Write Control. Logic Functions RESET INTERNAL DATA IN --j"~)o-l>o---., EXTERNAL -_~---o (I-""-- ~~RT A Vee RESET --::r')o......--i EXTERNAL L-_o---O UH 1 Al OBF (Output Buffer Full F/F). The OBF output will go "low" to indicate that the CPU has written data out to the specified port. The OBF FIF will be set by the rising edge of the WR input and reset by ACK Input being low. ACK (Acknowledge Input). A "low" on this input informs the 82C55A that the data from Port A or Port B has been accepted. In essence, a response from the peripheral device indicating that it has received the data output by the CPU. MODE 1 (PORT B) INTR (Interrupt Request). A "high" on this output can be used to interrupt the CPU when an output device has accepted data transmitted by the CPU. INTR is set when ACK is a "one", OBF is a "one" and INTE is a "one". It is reset by the falling edge of WR. P~-PBo 8 CONTROL WOAD INTEA Controlled by bit set/reset of PC6. INTE B Controlled by bit set/reset of PC2. WR_ 231256-15 Figure 10. MODE 1 Output INTR -+---twiT _ t AK OUTPUT 231256-16 Figure 11. MODE 1 (Strobed Output) 6-339 82C55A Combinations of MODE 1 Port A and Port B can be individually defined as input or output in Mode 1 to support a wide variety of strobed I/O applications. PC, PC, 2 PC6,7 2 --I-- I/O PC4.5 WR- --I- I/O PC, PC o 1NTRS INTRa PORT A - (STROBED INPUT) PORT A - (STROBED OUTPUT) PORT B - (STROBED INPUn PORT B - (STROBED OUTPUT) 231256-17 Figure 12. Combinations of MODE 1 Operating Modes Output Operations MODE 2 (Strobed Bidirectional Bus I/O).This functional configuration provides a means for communicating with a peripheral device or structure on a single 8-bit bus for both transmitting and receiving data (bidirectional bus I/O). "Handshaking" signals are provided to maintain proper bus flow discipline in a similar manner to MODE 1. Interrupt generation and enable/disable functions are also available. OBF (Output Buffer Full). The OBF output will go "low" to indicate that the CPU has written data out to port A. MODE 2 Basic Functional Definitions: INTE 1 (The INTE Flip-Flop Associated with' OBF). Controlled by bit set/reset OfPC6. • Used in Group A only. • One 8-bit, bi-directional bus port (Port A) and a 5bit control port (Port C). • Both inputs and outputs are latched. • The 5-bit control port (Port C) is used for control and status for the 8-bit, bi-directional bus port (Port A). Bidirectional Bus I/O Control Signal Definition INTR (Interrupt Request). A high on this output can be used to interrupt the CPU for input or output operations. ACK (Acknowledge). A "low" on this input enables the tri-state output buffer of Port A to send out the data. Otherwise, the output buffer will be in the high impedance state. Input Operations STB (Strobe Input). A "Iow"on this input loads data into the input latch. IBF (Input Buffer Full F/F). A "high" on this output indicates that data has been loaded into the input latch. INTE 2 (The INTE Flip-Flop Associated with IBF). Controlled by bit set/reset of PC 4 . 6-340 inter 82C55A CONTROL WORD C ~2~J~P~T PORT B 1 = INPUT 0" OUTPUT GROUP B MODE WR--- O=MODEO 1 ",MODE 1 231256-18 3 00--- PC 2.() -+-- I/O Figure 13. MODE Control Word 231256-19 Figure 14. MODE 2 DATA FROM CPU TO 8255A WR INTR tAl< . - - - ~r----~--------- IBF RIPHERAL _ _ _ _ _ _ _ _ _ _ BUS DATA fROM / PERIPHERAL TO 8255A DATA FROM 8255A TO 8080 231256-20 Figure 15. MODE 2 (Bidirectional) NOTE: Any sequence where WR occurs before ACK, and STB occurs before RD is permissible. (INTR = IBF. MASK. STB • RD + OBF. MASK. ACK • WR) 6-341 82C55A MODE 2 AND MODE 0 (OUTPUT) MODE 2 AND MODE 0 !INPUT) CONTROL WORD CONTROL WORD D, 0, D, 06 Os D. D3 02 0, Do Os 0. 0 3 02 0, Do ,. 1'@¢ / --------------------231256-24 MODE 1 (STROBED OUTPUT) INTR _twiT OUTPUT 231256-25 6-349 82C55A WAVEFORMS (Continued) MODE 2 (BIDIRECTIONAL) DATA FROM 8080 TO 8255 INTR - t AK _ ----------------~~------------+-, /1,----+---------- _ I ST _ m ----------------~ r-~--~----~------------- IBF PERIPHERAL BUS ---------- DATA FROM PERIPHERAL TO 8255 DATA FROM 8255 TO 8080 231256-26 Note: Any sequence where WR occurs before ACK AND STS occurs before RD is permissible. (INTR = ISF. MASK. STS • RD + OSF • MASK • ACK • WR) WRITE TIMING READ TIMING AO.,.CS----x.___~-~~ '-_____ An·,· cs_ _,-,.._ _ _ _ _ _ _-+-'f.'-_ _ __ -~ DATA BUS tAR RD -----------J·1"--~--_+----f~--- HIGH IMPEDANCE 231256-28 231256-27 A.C. TESTING INPUT, OUTPUT WAVEFORM 2.' 0.45 2.0 0.8 :> TEST POINTS < A.C. TESTING LOAD CIRCUIT 2.0 YEn * 0.8 231256-29 231256-30 A.C. Testing Inputs Are Driven At 2.4V For A Logie 1 And 0.45V For A Logic 0 Timing Measurements Are Made At 2.0V For A Logie 1 And 0.8 For A Logie O. 'VEXT Is Set At Various Voltages During Testing To Guarantee The Specification. CL Includes Jig Capacitance. 6-350 8256AH MULTIFUNCTION MICROPROCESSOR SUPPORT CONTROLLER • Programmable Serial Asynchronous Communications Interface for 5·, 6·, 7·, or 8·Bit Characters, 1, 1 Y2, or 2 Stop Bits, and Parity Generation • Two 8·Bit Programmable Parallel I/O Ports; Port 1 Can Be Programmed for Port 2 Handshake Controls and Event Counter Inputs • On·Board Baud Rate Generator Programmable for 13 Common Baud Rates up to 19.2K Bits/second, or an External Baud Clock Maximum of 1M Bit/second • Eight-Level Priority Interrupt Controller Programmable for 8085 or iAPX 86, iAPX 88 Systems and for Fully Nested Interrupt Capability • Five 8·Bit Programmable Timer/ Counters; Four Can Be Cascaded to Two 16·Bit Timer/Counters • Programmable System Clock to 1 x , 2 x , 3 x , or 5 x 1.024 MHz The Intel® 8256AH Multifunction Universal Asynchronous Receiver-Transmitter (MUART) combines five commonly used functions into a single 40-pin device. It is designed to interface to the 8086/88, iAPX 1861188, and 8051 to perform serial communications, parallel 1/0, timing, event counting, and priority interrupt functions. All of these functions are fully programmable through nine internal registers. In addition, the five timerlcounters and two parallel 1/0 ports can be accessed directly by the microprocessor. ADO-AD4 OBS-OB7 ADO Vee ADt pta AD2 Pl1 AD3 Pt2 AD4 Pt3 DB5 Pt' DBS Pt5 DB7 PtS ALE Pt7 iiii ViR P20 iiii RESET P22 WR ALE RESET cs P23 INTA P24 INT P25 cs-......J---' INT RxD TxD EXTINT P2S RxC ClK P27 TiC RxC TxD CTS Figure 1. MUART Block Diagram P2t RxD TxC GND CTS Figure 2. MUART Pin Configuration Intel Corporation Assumes No Responsibility for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Palent Licenses are Implied ., INTEL CORPORATION t984 6-351 September 1984 ORDER NUMBER: 230759-002 8256AH Table 1. Pin Description Symbol ADO-AD4 DBS-DB? ALE Pin Type Name and Function l-S 6-8 I/O ADDRESS/DATA: Three-state address/data lines which interface to the lower 8 bits of the microprocessor's multiplexed address/data bus. The S-bit address is latched on the falling edge of ALE. In the 8-bit mode, ADO-AD3 are used to select the proper register, while AD1-AD4 are used in the 16-bit mode. AD4 in the 8-bit mode is ignored as an address, while ADO in the 16-bit mode is used as a second chip select, active low. ADDRESS LATCH ENABLE: latches the S address lines on ADO-AD4 and CS on the 9 falling edge. RD 10 READ CONTROL: When this signal is low, the selected register is gated onto the data bus. WR 11 RESET 12 RESET: An active high pulse on this pin forces the chip into its initial state. The chip remains in this state until control information is written. CS 13 CHIP SELECT: A low on this signal enables the MUART. It is latched with the address on the falling edge of ALE, and ro5 and WR have no effect unless CS was latched low during the ALE cycle. INTA 14 INTERRUPT ACKNOWLEDGE: If the MUART has been enabled to respond to interrupts, this signal informs the MUART that its interrupt request is being acknowledged by the microprocessor. During this acknowledgement the MUART puts an RSTn instruction on the data bus for the 8-bit mode or a vector for the 16-bit mode. INT lS EXTINT 16 WRITE CONTROL: When this signal is low, the value on the data bus is written into the selected register. o INTERRUPT REQUEST: A high signals the microprocessor that the MUART needs service. EXTERNAL INTERRUPT: An external device can request interrupt service through this input. The inpui is level sensitive (high), therefore it must be held high until an iiiifA occurs or the interrupt address register is read. ClK 17 RxC 18 RxD 19 GND 20 SYSTEM CLOCK: The reference clock for the baud rate generator and the timers. I/O RECEIVE CLOCK: If the baud rate bits in the Command Register 2 are all 0, this pin is an input which clocks serial data into the RxD pin on the rising edge of RxC. If baud rate bits in Command Register 2 are programmed from 1-0FH, this pin outputs a square wave whose rising edge indicates when the data on RxD is being sampled. This output remains high during start, stop, and parity bits. RECEIVE DATA: Serial data input PS GROUND: Power supply and logic ground reference. 6-352 230759-002 8256AH Table 1. Pin Description (continued) Pin Type Name and Function CTS 21 I CLEAR TO SEND: This.J!!put enables the serial transmitter:...!!.. 1, 1.5, or 2 stop bits are selected CTS is level sensitive. As long as CTS is low, any character loaded into the transmitter buffer register will be transmitter serially. A single negative going pulse causes the transmission of a single character previously loaded into the transmitter buffer register. If a baud rate from 1-0FH is selected, CTS must be low for at least 1132 of a bit, or it will be ignored. If the transmitter buffer is empty, this pulse will be ignored. If this pulse occurs during the transmission of a character up to the time where Y2 the first (or only) stop bit is sent out, it will be ignored. If it occurs afterwards, but before the end of the stop bits, the next character will be transmitted immediately following the current one. If CTS is still high when the transmitter register is sending the last stop bit, the transmitter will enter its idle state until the next high-to-Iow transition on CTS occurs. If 0.75 stop bits is chosen, the eTS input is edge sensitive. A negative edge on eTS results in the immediate transmission of the next character. The length of the stop bits is determined by the time interval between the beginning of the first stop bit and the next negative edge on CTS. A high-to-Iow transition has no effect if the transmitter bulfer is empty or if the time interval between the beginning of the stop bit and next negative edge is less than 0.75 bits. A high or a low level or a low-to-high transition has no effect on the transmitter for the 0.75 stop bit mode. TxC 22 1/0 TRANSMIT CLOCK: If the baud rate bits in command register 2 are all set to 0, this input clocks data out of the transmitter on the falling edge. If baud rate bits are programmed for 1 or 2, this input permits the user to provide a 32x or 64x clock which is used for the receiver' and transmitter. If the baud rate bits are programmed for 3-0FH, the internal transmitter clock is output. As an output it delivers the transmitter clock at the selected bit rate. If 1Y2 or 0.75 stop bits are selected, the transmitter divider will be asynchronously reset at the beginning of each start bit, immediately causing a high-to-Iow transition on TxC. TxC makes a high-to-Iow transition at the beginning of each serial bit, and a low-to-high transition at the center of each bit. Symbol 23 0 TRANSMIT DATA: Serial data output. P27-P20 24-31 110 PARALLEL 1/0 PORT 2: Eight bit general purpose 1/0 port. Each nibble (4 bits) of tliis port can be either an input or an output. The outputs are latched whereas the input signals are not. Also, this port can be used as an 8-bit input or output port when using the two-wire handshake. In the handshake mode both inputs and outputs are latched. P17-P10 32-39 1/0 PARALLEL I/O PORT 1: Each pin can be programmed as an input or an output to perform general purpose 110. All outputs are latched whereas inputs are not. Alternatively these pins can serve as control pins which extend the functional spectrum of the chip. 40 PS POWER: +5V power supply. TxD 6-353 230759-002 inter 8256AH FUNCTIONAL DESCRIPTION The 8256AH Multi-Function Universal Asynchronous Receiver-Transmitter (MUART) combines five commonly used functions into a single 40-pin device. The MUART performs asynchronous serial communications, parallel I/O, timing, event counting, and interrupt control. For detailed application information, see Intel Ap Note #153, Designing with the 8256. Serial Communications The serial communications portion of the MUART contains a full-duplex asynchronous receivertransmitter (UART). A programmable baud rate generator is included on the MUART to permit a variety of operating speeds without external components. The UART can be programmed by the CPU for a variety of character sizes, parity generation and detection, error detection, and start/stop bit handling. The receiver checks the start and stop bits in the center of the bit, and a break halts the reception of data. The transmitter can send breaks and can be controlled by an external enable pin .. Parallel 110 The MUART includes 16 bits of general purpose parallel I/O. Eight bits (Port 1) can be individually changed from input to output or used for special I/O functions. The other eight bits (port 2) can be used as nibbles (4 bits) or as bytes. These eight bits also include a handshaking capability using two pins on Port 1. Counter/Timers There are five 8-bit counter/timers on the MUART: The timers can be programmed to use either a 1 kHz or 16 kHz clock generated from the system clock. Four of the 8-bit counter/timers can be cascaded to two 16-bit counter/timers, and one of the 8-bit counter/timers can be reset to its initial value by an external signal. Interrupts An eight-level priority interrupt controller can be configured for fully nested or normal interrupt priority. Seven of the eight interrupts service functions on the MUART (counter/timers, UART), and one external interrupt is provided which can be used for a particular function or for chaining interrupt controllers or more MUARTs. The MUARTwili support 8085 and 8086/88 systems with direct interrupt vectoring, or the MUART can be polled to determine the cause of the interrupt. If additional interrupt control capability is needed, the MUART's interrupt controller can be cascaded into another MUART, into an Intel 8259A Programmable Interrupt Controller, or into the interrupt controller of the iAPX 186/188 High-Integration Microprocessor. INITIALIZATION In general the MUART's functions are independent of each other and only the registers and bits associated with a particular function need to be initialized, not the entire chip. The command sequence is arbitrary since every register is directly addressable; however, Command Byte 1 must be. loaded first. To put the device into a fully operational condition, it is necessary to write the following commands: Command byte 1 Command byte 2 Command byte 3 Mode byte Port 1 control Set Interrupts The modification register may be loaded if required for special applications; normally this operation is noi necessary. The MUART should be reset before initialization. (Either a hardware or a software reset will do.) INTERFACING This section describes the hardware interface between the 8256 MUART and the 80186 microprocessor. Figure 3 displays the block diagram for this interface. The MUART can be interfaced to many other microprocessors using these basic principles. In all cases the 8256 will be connected directly to the CPU's multiplexed address/data bus. If latches or data bus buffers are used in a system, the MUART should be on the microprocessor side of the address/data bus. The MUART latches the address internally on the falling edge of ALE. The address consists of Chip Select (CS) and four address lines. For 8-bit microprooessors, ADO-AD3 are the address lines. For 16-bit microprocessors, AD1-AD4 are the address lines; ADO is used as a second chip select which is active low. Sinoe chip select is internally latched along with the address, it does not have to remain active during the entire instruction cycle. As long as the chip select setup and hold times are met, it can be derived from multiplexed address/data lines or multiplexed address/status lines. When the 8256 is in the 16-bit mode, AO serves as a second chip select. As a result the MUART's internal registers will all have even addresses since AO must be zero to select the device. Normally the MUART will be placed on the lower data byte. If the MUART is placed on the upper data byte. 6-354 230759-002 inter 8256AH Vee 16 MHz rDl n X 1 x 2 RESET AD WR RES INTO INTAO ALE J DT/R DEN + 5 V - SRDV .r NMI ADo-15 + HOLD 1 -~ v ADDR/DATA pcso STB 8282 ,) ADDRESS lATCH (2) OE y ~ 80186 !2J!6 (16) DATA TRCVR ~0E(2) v f 0- ALE INTA INT WR ADO_4 (8) 8256 y °5-7 CS ri RD RESET ClK PORT 1 PORT 2 CTS TxD RxD TxC RxC EXTINT .- d CLOCK GENERATOR (8) (8) ! SERIAL 1/0 Figure 3_ 80186/8256 Interface 8086 - the internal registers will be 512 address locations apart and the chip would occupy an 8 K word address space. This bit selects between 8085 mode and 8086/8088 mode. In 8085 mode (8086 = 0), AO to A3 are used to address the internal registers, and an RSTn instruction is generated in response to the first INTA. In In 8086 mode (8086 = 1), A1 to A4 are used to address the internal registers, and AO is used as an extra chip select (AO must equal zero to be enabled). The response to INTA is for 8086 interrupts where the first INTA is ignored, and an interrupt vector (40H to 47H is placed on the bus in response to the second INTA. DESCRIPTION OF THE REGISTERS The following section will provide a description of the registers and define the bits within the registers where appropriate. Table 2 lists the registers and their addresses. Command Register 1 I L1 I LO S1 (OR) FRO - so IBRKII BIT I I 8086 I FRO (OW) I Timer Frequency Select This bit selects between two frequencies for the five timers. If FRO = 0, the timer input frequency is 16 kHz (62.5/As). If FRO = 1, the timer input frequency is 1 KHz (1 ms). The selected clock frequency is shared by all the counter/timers enabled for timing; thus, all timers must run with the same time base. 8086 Mode Enable BITI - Interrupt on Bit Change This bit selects between one of two interrupt sources on Priority Level 1, either CounterlTimer 2 or Port 1 P17 interrupt. When this bit equals 0, CounterlTimer 2 will be mapped into Priority Level 1. If BITI equals and Level 1 interrupt is enabled, a transition from 1 to 0 in Counter/Timer 2 will generate an interrupt request on Level 1. When BITI equals 1, Port 1 P17 external edge triggered interrupt source is mapped into Priority Level 1. In this case if Level 1 is enabled, a low-te-high transition on P17 generates an interrupt request on Level 1. o 6-355 230759-002 8256AH Table 2. MUART Registers Read Registers Write Registers . 8085 Mode: AD3 AD2 8086 Mode: AD4 AD3 AD1 ADO AD2 AD1 L11 LOI S1 I so I BRKII BITI 180861 FRO I 0 Command 1 o 0 0 I L1 I LO I S1 I SO I BRKII BITlla0861 FRO I Command 1 I PENI EP I C1 I CO I B31 B2 I B1 I BO I 0 Command 2 o 0 1 I PEN I EP I C1 I CO I B3 I B2 I B1 I BO I Command 2 I 0 I RxE I IAE I NIE I 0 ISBRKITBRKI 0 I 0 Command 3 0 I T351 T241 T5C I CT31 CT21 P2C21 P2C11 P2coI Mode 0 0 o I SET I RxE I IAE I NIE I END ISBR~TBR~ RST I Command 3 I T351 T241 T5C I CT31 CT21 P2C21 P2C11 P2coI Mode I P171 P161 P151 P141 P131 P121 P11 I P10 I 0 Port 1 Control 0 0 I P171 P161 P151 P141 P131 P121 P11 I P10 I Port 1 Control I L7 I L6 I L5 I L4 I L31 L2 I L1 I LO I 0 Interrupt Enable o 1 I L7 I L6 I L5 I L4·1 L3 I L2 I L1 1 LO 1 Set Interrupts I 04 I 03 I 02 I 07 1 06 1 05Interrupt Address I .01 I DO I 0 o Reset Interrupts I 04 I 03 I 02 I 01 I DO I I 07 I 06 1 05 Receiver Buffer 1071001~1~loolml~lool 0 I 07 I 06 I 05 I 04 I 03 I 02 I 01 I DO I 1 Port 1 [07I00I~I~loolmIMlool Transmitter Buffer o 0 0 I 07 I 06 I 05 I 04 I 03 I 02 I 01 I 00 I Port 1 o 0 1 I 07 I 06 I 05 1 04 I 03 I 02 I 01 1 DO 1 Port 2 Port 2 I 07 I 06 I 05 I 04 1. 03 I 02 I 01 I DO I 1 Timer 1 I 07 I 06 I 05 I 04, I 03 I 02 I 01 Timer 2 I DO I 1 I 07 I 06 I 05 04 I 03 1 02 1 01 Timer 3 I DO I I 07 I 00 I 05 I 04 I 03 I 02 1 01 I DO 1 1 Timer 4 I 07 I 06 I 05 I I 04 I 03 Timer 5 I 02 lul~I~lul~I~IL1ILOI I 0 o 107lool~I~loolml~lool Timer 1 0 1 07 I 06 I 05 I 04 I 03 1 02 I 01 I DO 1 Timer 2 o o 0 I 07 I 06 I 07 I 1 05 1 04 03 1 02 1 01 I DO 1 Timer 3 I 06 I 05 I 04 I 03 I 02 1 01 I DO 1 Timer 4 01 1 DO 1 1 0 1 07 1 06 1 05 1 04 1 03 Timer 5 liNT I RBF I TBE I TRE I BO I PE I OE I FE I 1 Status 1 ,I 0 I RS4 IRS3 I RS2 I RS1 I 02 I 01 I DO 1 I RSO ITME 10SC 1 Modification 6-;356 230759-002 8256AH BRKI - Break-In Detect Enable If this bit equals 0, Port 1 P16 is a general purpose 1/0 port. When BRKI equals 1, the Break-In Detect feature is enabled on Port 1 P16. A Break-In condition is present on the transmission line when it is forced to the start bit voltage level by the receiving station. Port 1 P16 must be connected externally to the transmission line in order to detect a Break-In. A Break-In is polled by the MUART during the transmission of the last or only stop bit of a character. vide a frequency of either 32x or 64x the baud rate. The data transmission rates range from o... 32 Kbaud. If bits o... 3 are set to 0, separate clocks must be input to pin RxC for the receiver and pin TxC for the transmitter. Thus, different baud rates can be used for transmission and reception. In this case, prescalers are disabled and the input serial clock frequency must match the baud rate. The input serial clock frequency can range from 0 to 1.024 MHz. BO, B1, B2, B3 - A Break-In Detect is OR-ed with Break Detect in Bit 3 of the Status Register. The distinction can be made through the interrupt controller. If the transmit and receive interrupts are enabled, a Break-In will generate an interrupt on Level 5, the transmit interrupt, while Break will generate an interrupt on Level 4, the receive interrupt. SO, S1 - These four bits select the bit clock's source, sampling rate, and serial rate for the internal baud rate generator. SO 0 0 1 0 1 1.5 1 0 2 1 1 0.75 Stop Bit Length The relationship of the number of stop bits and the function of input CTS is discussed in the Pin Description section under "CTS". LO , L 1 - Character Length L1 LO Character Length 0 0 8 0 1 7 1 0 6 1 1 5 (1 R) B3 82 B1 BO Baud Rate Q Q 0 0 TxC, Rxe: 0 0 0 1 IxC/64 64 Sampling Rate 1 0 0 1 0 TxC/32 32 0 0 1 1 19200 32 0 1 0 0 9600 64 0 1 0 1 4800 64 0 1 1 0 2400 64 0 1 .1 1 1200 64 1 0 0 0 600 64 1 0 0 1 300 64 1 0 1 0 200 64 1 0 1 1 150 64 1 1 0 0 110 64 1 1 0 1 100 64 1 1 1 0 75 64 1 1 1 1 50 64 The following table gives an overview of the function of pins TxC and RxC: Command Register 2 IPEN! EP ! C1 ! CO B2 B3 Stop Bit Length S1 Baud Rate Select B1 Bits 3 to o (Hex_) TxC RxC Input: 1 x baud 0 I Input: 1 x baud rate clock for the rate clock for the transmitter receiver Input: 32 x or 64 x Output: receiver bit 1, 2 baud rate for trans- clock with a low-tomitter and receiver high transition at data bit sampling time. Otherwise: h~h level 3 to F Output: baud rate Output: as above clock of the transmitter BO (1W) Programming bits o... 3with values from 3H to FH enables the internal baud rate generator as a common clock source for the transmitter and receiver and determines its divider ratio. I 1 I J Programming bits 0 ... 3 with values of 1H or 2H enables input TxC as a common clock source for the transmitter and receiver. The external clock must pro6-357 230759-002 8256AH As an output, AxC outputs a low-to-high transition at sampling time of every data bit of a character. Thus, data can be loaded, e.g., into a shift register externally. The transition occurs only if data bits of a character are present. It does not occur for start, parity, and stop bits (RxC = high). curs to that bit. When Command Register 3 is read, bits 0, 3, and 7 will always be zero. RST - If RST is set, the following events occur: As an output, TxC outputs the internal baud rate clock of the transmitter. There will be a high-to-Iow transition at every beginning of a bit. 1. All bits in the Status Register except bits 4 and 5 are cleared, and bits 4 and 5 are set. 2. The Interrupt Enable, Interrupt Request, and Interrupt Service Registers are cleared. Pending requests and indications for interrupts in service will be cancelled. Interrupt signal INT will go low. CO, C1 - System Clock Prescaler . (Bits 4, 5) Bits 4 and 5 define the system clock prescaler divider ratio. The internal operating frequency of 1.024 MHz is derived from the system clock. . C1 CO Divider Ratio Clock at Pin ClK 0 0 0 1 5 3 3.072 MHz 1 0 2 2.048 MHz 1 1 1 1.024 MHz EP - 3. The receiver and transmitter are reset. The transmitter goes idle (TxD is high), and the receiver enters start bit search mode. 4. If Port 2 is programmed for handshake mode, IBF and OBF are reset high. 5.12 MHz RST does not alter ports, data registers or command registers, but it halts any operation in progress. RST is automatically cleared. RST = 0 has not effect. The reset operation triggered by Command Register 3 is a subset of the hardware reset. Even Parity (Bit 6) EP = 0: Odd parity EP = 1: Even parity PEN - TBRK - Bit 7 enables parity generation and checking. PEN = 0: No parity bit PEN = 1: Enable parity bit The parity bit according to Command Register 2 bit 6 (see above) is inserted between the last data bit of a character and the first or only stop bit. The parity bit is checked during reception. A false parity bit generates an error indication in the Status Register and an Interrupt Request on Level 4. SBRK - Command Register 3 ISET I RxE IIAE I NIW I END I SBRK I TBRK I RST I (2W) Command Register 3 is different from the first two registers because it has a bit set/reset capability. Writing a byte with Bit 7 high sets any bits which were also high. Writing a byte with Bit 710w resets any bits which were high. If any bit 0-6 is low, no change oc- Transmit Break The transmission data output TxD will be set low as soon as the transmission of the previous character has been finished. It stays low until TBRK is cleared. The state of CTS is of no significance for this operation. As long as break is active, data transfer from the Transmitter Buffer to the Transmitter Register will be inhibited. As soon as TBRK is reset, the break condition will be deactivated and the transmitter will be re-enabled. Parity Enable (Bit 7) (2R) Reset Single Character Break This causes the transmitter data to be set low for one character including start bit, data bits, parity bit, and stop bits. SBRK is automatically cleared when time for the last data bit has passed. It will start after the character in progress completes, and will delay the next data transfer from the Transmitter Buffer to the Transmitter Register until TxD returns to an idle (marking) state. If both TBRK and SBRK are set, break will be set as long as TBRK is set, but SBRK will be cleared after one character time of break. If SBRK is set again, it remains set for another character. The user can send a definite number of break characters in this manner by clearing TBRK after setting SBRK for the last character time. 6-358 230759-002 inter END - 8256AH P2C2, P2C1, P2CO - End of Interrupt If fully nested interrupt mode is selected, this bit reset the currently served interrupt level in the Interrupt Service Register. This command must occur at the end of each interrupt service routine during fully nested interrupt mode. END is automatically cleared when the Interrupt Service Register (internal) is cleared. END is ignored if nested interrupts are not enabled. NIE - P2C2 P2C1 P2CO Nested Interrupt Enable When NIE equals 1, the interrupt controller will opera~e in the nested interrupt mode. When NIE equals 0, the interrupt controller will operate in the normal interrupt mode. Refer to the "Interrupt controller" section of AP-153 under "Normal Mode" and "Nested Mode" for a detailed description of these operations. IAE - Interrupt Acknowledge Enable Mode Register IT351 T241 T5C ICT31 CT21 P2C21 P2C1 IP2CO I = 1 1 1 1 0 1 Gtl~lIltp.f!Timp.r Mode Timer 5 Control If T5C is set, then Timer 5 can be preset and started by an external signal. Writing to the Timer 5 register loads the Timer 5 save register and stops the timer. A high-to-Iow transition on bit 5 of Port 1 (pin 34) loads the timer with the saved value and starts the timer. The next high-to-Iow transition on pin 34 retriggers the timer by reloading it with the initial value and continues timing. If this bit is high during a write to Command Register 3, then any bit marked by a high will set. If this bit is low, then any bit marked by a high will be cleared. To achieve this, it is necessary to program bit 4 of Port 1 as an output (Port 1 Control Register Bit P14 1), and to program Command Register 2 bits B3 - BO with a value;;' 3H. 1 T5C - Bit Set/Reset If test mode is selected, the output from the internal baud rate generator is placed on bit 4 of Port 1 (pin 35). 0 If CT2 or CT3 are high, then counter/timer 2 or 3 respectively is configured as an event counter on bit 2 or 3 respectively of Port 1 (pins 37 or 36). The event counter decrements the count by one on each lowto-high transition of the external input. If CT2 or CT3 is low, then the respective counter/timer is configured as a timer and the Port 1 pins are used for parallel 110. Note that the detection of break characters remains enabled while the receiver is disabled; i.e., Status Register Bit 3 (BD) will be set while the receiver is disabled whenever a break character has been recognized at the receive data input RxD. (3W) 1 Bit 3 and 4 defines the mode of operation of event counter/timers 2 and 3 regardless of its use as a single unit or as a cascaded one. Receive Enable (3R) 0 1 0 1 0 CT2, CT3 - This bit enables the serial receiver and its associated status bits in the status register. If this bit is reset, the serial receiver will be disabled and the receive status bits will not be updated. SET - 0 0 1 1 0 Direction Upper Lower Mode Input Input Nibble Nibble Input Output Nibble Output Input Nibble Output Output Byte Input Handshake Byte Output Handshake DO NOT USE Test NOTE: If Port 2 is operating in handshake mode, Interrupt Level 7 is not available for Timer 5. Instead it is assigned to Port 2 handshaking. . This bit enables an automatic response to INTA. The particular response is determined by the 8086 bit in Command Register 1. RxE - 0 0 0 0 1 Port 2 Control Following a hardware reset, the save register is reset to OOH and both clock and trigger inputs are disabled. Transferring an instruction with T5C = 1 enables the trigger input; the save register can now be loaded with an initial value. The first trigger pulse causes the initial value to be loaded from the save register and enables the counter to count down to zero. When the timer reaches zero it issues an interrupt request, disables its interrupt level and continues counting. A subsequent high-to-Iow transition on pin 5 resets Timer 5 to its initial value. For another timer interrupt, the Timer 5 interrupt enable bit must be set . again. 6-359 230759-002 inter 8256AH T35, T24 - Cascade Timers These two bits cascade Timers 3 and 5 or 2 and 4; Timers 2 and 3 are the lower bytes, while Timers 4 and 5 are the upper bytes. If T5C is set, then both Timers 3 and 5 can be preset and started by an ex· ternal pulse. When a high·to·low transition occurs, Timer 5 is preset to its saved value, But Timer 3 is always preset to all ones. If either CT2 or CT3 is set, then the correspon· ding timer pair is a 16·bit event counter. A summary of the counter/timer controi bits is given in Table 3. Port 1 Control Register I Ip171p161 P151p141 P131 P12 P11 (4W) (4W) P10 Each bit in the Port 1 Control Register configures the direction of the corresponding pin. If the bit is high, the pin is an output, and if it low the pin is an input. Every Port 1 pin has another function which is can· trolled by other registers. If that special function is disabled, the pin functions as a general I/O pin as specified by this register. The special functions for each pin are described below. Port 10, 11 - Handshake Control NOTE: Interrupt levels assigned to single counters are partly not oc· cupied if event countersltimers are cascaded. Level 2 will be vacated if event countersltimers 2 and 4 are cascaded. Likewise, Level 7 will. be vacated if event countersltimers 3 and 5 are cascaded. '. If byte handshake control is enabled for Port 2 by t.!:!£...Mode Register, then Port 10 is programmed as STB/ACK handshake-2.Qntrol input, and Port 11 is programmed as IBF/OBF handshake control output. Single event countersltimers generate an interrupt request on the transition from 01 H to OOH, while cascaded ones generate it on the transition from 0001 H to OOOOH. If byte handshake mode is enabled foroutput on Port 2 OBF indicates that a character has been loaded Table 3. Event CounterslTimers Mode of Operation Event Counter/ Timer Programming (Mode Word) Function - Clock Source 1 a·bit timer 2 a·bit timer a·bit event counter T24=0, CT2= 1 P12 pin 37 2 8-bit timer T35=0, CT3=0 Internal clock T24",,0, CT2=0 Internal clock Internal clock a·bit event counter T35=0, CT3= 1 P13 pin 36 4 8-bit timer T24=0 Internal clock a·bit timer, normal'mode T35=0, T5C=0 Internal clock 5 a·bit timer, retriggerable mode T35=0, T5C=1 Internal clock 16·bit timer T24= 1, CT2=0 Internal clock 16·bit event counter T24=1, CT2=1 P12 pin 37 16·bit timer, normal mode T35=1, T5C=O, CT3=0 Internal clock 16·bit event counter, normal mode T35=1, T5C=O, CT3=1 P13 pin 36 16·bit timer, retriggerable mode T35=1, T5C=1, CT3=O Internal clock 16·bit event counter, retriggerable mode T35=1, T5C=1, CT3=1 P13 pin 36 2 and 4 cascaded 3 and 5 cascaded 6-360 230759·002 8256AH Interrupt Enable Register into the Port 2 output buffer. When an external device reads the data, it acknowledges this operation by driving ACK low. OBF is set low by writing to Port 2 and is reset by ACK. L7 LS I L4 L3 (SR) If b~handshake mode is enabled for input on Port 2, STB is an input. IBF is driven low after STB goes low. On the rising edge of STB the data from Port 2 is latched. I L1 L2 LO (SW=enable, (6W=disable) Interrupts are enabled by writing to the Set Interrupts Register (SW). Interrupts are disabled by writing to the Reset Interrupts Register (6W). Each bit set by the Set Interrupts Register (SW) will enable that level interrupt, and each bit set in the Reset Interrupts Register (6W) will disable that level interrupt. The user can determine which interrupts are enabled by reading the Interrupt enable Register (SR). IBF is reset high when Port 2 is read. Port 12, 13 - Counter 2, 3 Input If Timer 2 or Timer 3 is programmed as an event counter by the Mode Register, then Port 12 or Port 13 is the counter input for Event Counter 2 or 3, respectively. - Priority Highest LO L1 L2 L3 L4 LS L6 L7 Lowest Port 14 - Baud Rate Generator Output ~. I L6 I _ _ 1- "IU~I\ If test mode is enabled by the Mode Register and Command Register 2 baud rate select is greater than 2, then Port 14 is an output from the internal baud rate generator. P14 in Port 1 control register must be set to 1 for the baud rate generator clock to be output. The baud rate generator clock is 64 x the serial bit rate except at 19.2Kbps when it is 32 x the bit rate. Source Timer 1 Timer 2 or Port Interrupt External Interrupt (EXTINT) Timer 3 or Timers 3 & 5 Receiver Interrupt Transmitter Interrupt Timer 4 or Timers 2 & 4 Timer S or Port 2 Handshaking Interrupt Address Register o I 0 I 0 I 0 I D4 I Dpm I ~ 0 Interrupt Level Indication Port 15 - Timer 5 Trigger (6R) If TSC is set in the Mode Register enabling a retriggerable timer, then Port 1S is the input which starts and reloads Timer S. Reading the interrupt address register transfers an identifier for the currently requested interrupt level on the system data bus. This identifier is the number of the interrupt level multiplied by 4. It can be used by the CPU as an offset address for interrupt handling. Reading the interrupt address register has the same effect as a hardware interrupt acknowledge INTA; it clears the interrupt request pin (I NT) and indicates an interrupt acknowledgement to the interrupt controller. A high-to-Iow transition on P1S (Pin 34) loads the timer with the save register and starts the timer. Port 16 - Break-In Detect If Break"ln Detect is enabled by BRKI in Command Register 1, then this input is used to sense a BreakIn. If Port 16 is low while the serial transmitter is sending the last stop bit, then a Break-In condition is signaled. Receiver and Transmitter Buffer Iwlool~I~lool ~ (7Ft) Port 17 - Port Interrupt Source D1 00 (7W) Both the receiver and transmitter in the MUART are double buffered. This means that the transmitter and receiver have a shift register and a buffer register. The buffer registers are directly addressable by reading or writing to register seven. After the receiver buffer is full, the RBF bit in the status register is set. If BITI in Command Register 1 is set, then a low-tohigh transition on Port 17 generates an interrupt request on Priority Level 1. Port 17 is edge triggered. 6-361 230759-002 inter 8256AH Reading the receive buffer dears the RBF status bit. The transmit buffer should be written to only if the TBE bit in the status register is set. Bytes wri.tten to the transmit buffer are held there until the transmit shift register is empty, assuming eTS is low. If the transmit buffer and shift register are empty, writing to the transmit buffer immediately transfers the byte to the transmit shift register. If a serial character length is less than 8 bits, the unused most significant bits are set to zero when reading the receive buffer, and are ignored when writing to the transmit buffer. leads to a count of X *256 + 255. Timers count down continuously. If the interrupt is enabled, it occurs when the.counter changes from 1 to O. The timer/counter interrupts are automatically disabled when the interrupt request is generated. Status Register OE FE Port 1 I 07 I 06 I 05 04 03 02 01 DO (8W) (8R) Writing to Port 1 sets the data in the Port 1 output latch. Writing to an input pin does not affect the pin, but the data is stored and will be output if. the direction of the pin is changed later. If the pin is used as a control signal, the pin will not be affected, but the data is stored. Reading Port 1 transfers the data in Port 1 onto the data bus. Port 2 I 07 I 06 I 05 I 04 03 02 01 00 (9W) (9R) Writing to Port 2 sets the data in the Port 2 output latch. Writing to an input pin does not affect tlie pin, but it does store the data in the latch. Reading Port 2 puts the input pins onto the bus or the contents of the output latch for output pins. Timer 1-5 I 07 I 06 I 05 I 04 03 02 01 00 Reading Timer N puts the contents of the timer onto the data bus. If the counter changes while RO is low, the value on the data bus will'not change. If two timers are cascaded, reading the high-order byte will cause the low-order byte to be latched. Reading the loworder byte will unlatch ·them both. Writing to either timer or decascading them also clears the latch condition. Writing to a timer sets the starting value of that timer. If two timers are cascaded, writing to the highorder byte presets the low-order. byte to all ones. Loading only the high-order byte with a value of X Reading the status register gates its contents onto the data bus. It holds the operational status of the serial interface as well as the stat\ls of the interrupt pin INT. The status register can be read at any time. The flags are stable and well defined at a" instants. FE - Framing Error, Transmission Mode. Bit 0 can be used in two modes. Norma"y, FE indicates framing error which can be changed to transmission mode indication by setting the TME bit in the modification register. If transmission mode is disabled (in Modification Register), then FE indicates a framing error. A framing error is detected during the first stop bit. The error is reset by reading the Status Register or by a chip reset. A framing error does not inhibit the loading of the Receiver Buffer. If RxO remains low, the receiver will assemble the next character. The false stop bit is treated as the next start bit, and no high-to-Iow transition on RxO is required to synchronize the receiver. When the TME bit in the Modification Register is set; FE is used to indicate that the transmitter was active during the' reception of a character, thus indicating that the character received was·transmitted by its own transmitter. FE is reset when the transmitter is not active during the reception of character. Reading the status register will not reset the FE bit in the transmission mode. OE - Overrun Error If the user does not read the character in the Receiver Buffer before the next character is received and transferred to this register, then the OE Qit is set. The OE flag is set during the reception of the first stop bit and is cleared when the Status Register is read or when a hardware or software reset occurs. The first character received in this case will be lost. 6-362 230759-002 8256AH PE - Parity Error TBE - This bit indicates that a parity error has occurred during the reception of a character. A parity error is present if value of the parity bit in the received character is different from the one expected according to command word 2 bits 6 EP. The parity bit is expected and checked only if it is enabled by command word 2 bit 7 PEN. TBE indicates the Transmitter Buffer is empty and is ready to accept a character. TBE is set by a chip reset or the transfer of data to the Transmitter Register, and is cleared when a character is written to the transmitter buffer. When TBE is set, an interrupt request is generated on Level 5 if enabled. RBF A parity error is set during the first stop bit and is reset by reading the Status Register or by a chip reset. BD - Break/Break-In The BD bit flags whether a break character has been received, or a Break-In condition exists on the transmission line. Command Register 1 Bit 3 (BRKI) enables the Break-In Detect function. Whenever a break character has been received, Status Register Bit 3 will be set and in addition an interrupt request on Levei 4 is generaied. Tile ,tlceiv6i· will be idled. It will be started again with the next highto-low transition at pin RxD. The break character received will not be loaded into the receiver buffer register. If Break-In Detection is enabled and a Break-In condition occurs, Status Register Bit 3 will be set and in addition an interrupt request on Level 5 is generated. The BD status bit will be reset on reading the status register or on a hardware or software reset. For more information on BreaklBreak-ln, refer to the "Serial Asynchronous Communication" section of AP-153 under "Receive Break Detect" and "BreakIn Detect." TRE - Receiver Buffer Full RBF is set when the Receiver Buffer has been loaded with a new character during the sampling of the first stop bit. RBF is cleared by reading the receiver buffer or by a chip reset. INT - Interrupt Pending The INT bit reflects the state of the INT Pin (Pin 15) and indicates an interrupt is pending. It is reset by INTA or by reading the Interrupt Address Register if only one interrupt is pending and by a chip reset. FE, DE, PE, RBF, and Break Detect all generate a Level 4 interrupt when the receiver samples the first stop bit. TRE, TBE, and Break-In Detect generate a Level 5 interrupt. TRE generates an interrupt when TBE is set and the Transmitter Register finished transmitting. The Break-In Detect interrupt is issued at the same time as TBE or TRE. Modification Register o I IRS41 RS31 RS21 RS1 RSO (OF 1sW) DSC - Transmit Register Empty When TRE is set the transmit register is empty and an interrupt request is generated on Level 5 if enabled. When TRE equals 0 the transmit register is in the process of sending data. TRE is set by a chip reset and when the last stop bit has left the transmitter. It is reset when a character is loaded into the Transmitter Register. If CTS is low, the Transmitter Register wilLQe loaded during the transmission of the start bit. If CTS is high at the end of a character, TRE will remain high and no character will be loaded into the Transmitter Register until CTS goes low. If the transmitter was inactive before a character is loaded into the Transmitter Buffer, the Transmitter Register will be empty temporarily while the buffer is full. However, the data in the buffer will be transferred to the transmitter register immediately and TRE will be cleared while TBE is set. Transmitter Buffer Empty I TME I DSC I Disable Start Bit Check DSC disables the receiver's start bit check. In this state the receiver will not be reset if RxD is not low at the center of the start bit. TME - Transmission Mode Enable TME enables transmission mode and disables framing error detection. For information on transmission mode see the description of the framing error bit in the Status Register. RSO, RS1, RS2, RS3, RS4 Sample Time Receiver The number in RSn alters when the receiver samples RxD. The receiver sample time can be modified only if the receiver is not clocked by RxC. 6-363 230759-002 inter 8256AH NOTE: , The modification register cannot be read. Reading from address OFH, 8086: 1EH gates the contents of th!! status register' onto the data bus. Reset has no effect on the contents of receiver buffer register, transmitter buffer register, the intermediate latches of parallel ports, and event counters/timers, respectively. A hardware reset (reset, Pin 12) resets all modification register bits to 0, Le.: • The start bit check is enabled. • Status Register Bit 0 (FE) indicates framing error. • The sampling time of the serial receiver is the bit center. RS4 RS3 RS2 RS1 A software reset (Command Word 3, RST) does not affect the modification register. 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Hardware Reset A reset signal on pin RESET (HIGH level) forces the device 8256 into a well-defined initial state. This state is characterized as follows: 1. Command registers 1, 2 and 3, mode register, Port 1 control register, and modification register are reset. Thus, all bits of the parallel interface are set to be inputs and event countersltimers are con' figured as independent 8-bit timers. 2. Status register bits are reset with the exception of bits 4 and '5. Bits 4 and 5 are set indicating that both transmitter register and transmitter buffer register are empty. 3. The interrupt mask, interrupt request, and inter;upt service register bits are reset and disable all requests. As a consequence, interrupt signallNT IS INACTIVE (LOW). 4. The transmit data output is set to the marking state (HIGH) and the receiver section is disabled until it is enabled by Command Register 3 Bit 6. 5. The start bit will be checked at sampling time. The receiver will return to start bit search mode if input RxD. is not LOW at this time. 6. Status Register Bit 0 implies framing error. 7. The receiver samples input RxD at bit center. 6-364 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1. 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 ,0 0 1 1 0 0 1 1 0 0 1 1 0 0 RSO 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 Point of time between start of bit and end of bit measured in steps of 1/32 bit length 1 (Start of Bit) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (Bit center) 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 (End of Bit) 230759-002 8256AH ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias 0° C to 70° C Storage Temperature -65°C to +150°C Voltage On Any Pin With Respect to ground -0.5V to +7V Power Dissication 1 Watt "NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. D.C. CHARACTERISTICS Symbol Parameter Min. Max. Units VIL Input Low Voltage -0.5 0.8 V Vcc+ 0.5 0.45 V Volt~ge VIH Input High VOL Output Low Voltage VOH Output High Voltage 2.0 2.4 V IOH= -400 p.A IlA IlA VIN= Vcc VIN= OV VOUT= Vce VOUT= 0.45V IlL Input Leakage ILO Output Leakage 10 -10 Icc Vee Supply Current ~ 160 mA Symbol IOL= 2.5 mA V 10 -10 CAPACITANCE Test Conditions (TA= 25°C, Vex;= GND = OV) Parameter Min. Max. Units GIN Input Capacitance 10 pF fc= 1 MHz CliO I/O Capacitance 20 pF Unmeasured pins returned to Vss 6-365 Test Conditions 230759-002 8256AH A.C. CHARACTERISTICS (TA = ooe to 70oe, Vee = +5.0V ± 10%, GND = OV) BUS PARAMETERS 8256AH Symbol Parameter tLL ALE Pulse Width tCSL tAL tLA tLC tCC tRD CS to ALE Setup Time Address to ALE Setup Time Address Hold Time After ALE ALE to RDIWR tOF tOW tWO tCL tLDR Data Float After RD (2) Data Valid to WR tRST tRV Min. RD, WR, INTA Pulse Width Data Valid from RD (1) 50 25 ALE to Data Valid Reset Pulse Width Recovery Time Between RD/WR 300 120 50 ns ns ns ns ns 150 ns ns ns 500 tCPWL tTPI Counter Input Pulse Width Low Counter Inputt to INTt at Terminal Count tTlH tTlL tPP tCR LOAD Pulse High Time Counter 5 LOAD Pulse Low Time Counter 5 Counter 5 Load Before Next Clock Pulse on P13 External Count Clockt to ROt to Ensure Clock is Reflected in Count tRC ROt to External Count Clockt to Ensure Clock is not Reflected in Count tCW External Count Clockt ro WRt to Ensure Count Written is Not Decremented WRt to External Count Clock to Ensure Count Written is Decremented 2.2 1.1 1.1 tOPI Interrupt request on P17t to INTt tPI Pulse Width of Interrupt Request on P17 tHEA INTAt or ROt to EXTINn INTAt or ROt to INn /is /is /is 2.75 1.1 1.1 1.1 2.2 /is /is /is /is ns 2.2 /is 0 ns 200 ns 2tCY +500 ns tCY+ 100 ns 30 300 6-366 /is 0 INTERRUPT PARAMETERS tOEX EXTINTt to INTt tHIA ns ns ns ns ns 150 Data Valid After WR RDIWR Control to Latch Enable Units ns 50 0 20 25 20 200 TIMER/COUNTER PARAMETERS tCPI Counter Input Cycle Time (P12, P13) tCPWH Counter Input Pulse Width High tWC Max. ns ns 230759-002 8256AH A.C. CHARACTERISTICS (continued) SERIAL INTERFACE AND CLOCK PARAMETERS 8256AH Symbol Parameter Min. tCY tCLKH .Clock Period Clock High Pulse Width 195 tCLKL Clock Low Pulse Width Clock Aise Time 65 tA tF tSCY tSPD tSPW tSTD tDTX tlABF tlTBE tWOB tAOB tSIB tAl tSIT 20 975 Serial Clock Low (4) Internal Status Update Delay From Center of Stop Bit (5) TxC to TxD Data Valid INT Delay From Center of First Stop Bit 350 350 300 tAED OBF~ to ACK ~ ns ns ns ns ns 0 50 150 tSIB ns ns ns ns ns 50 50 ns ns ns (6) 300 250 250 250 250 2tCY +500 2tCY +500 Delay NOTES: 1. CL = pF all outputs. 2. Measured from logic "one" or "zero" to 1.5V at CL = 150 pF. 3. P12, P13 are external clock inputs. 4. Note that RxC may be used as an input only in 1X mode, otherwise it will be an output. ns ns ns ns ACKI to OBFI STB ~ to IBF ~ AD t to IBF t STB t to INT t ACK t to INT t ns 300 2tCY +500 2tCY +500 INT Delay From Falling Edge of Transmit Clock at end of Start Bit Data Setup to STB t Data Hold After STB t WA t to OBF t Units ns 20 Clock Fall Time Serial Clock Period (4) Serial Clock High (4) tAIT 1000 65 tCTS Pulse Width for Single Character Transmission PARALLEL 1/0 PORT PARAMETERS tWP WA t to P1/P2 Data Valid tPA P1/P2 Data Stable Before AD ~ (7) tAP PlIP2 Data Hold Time tAK ACK Pulse Width tST Strobe Pulse Width tPS tPH Max . 0 ns ns ns ns ns ns ns 5. The center of the Stop Bit will be the receiver sample time, as programmed by the modification register. 6. 1I16th bit length for 32X, 64X; 100 ns for 1X. 7. To ensure t RO spec is met. 6-367 230759-002 8256AH WAVEFORMS A.C. TESTING INPUT, OUTPUT WAVEFORM 2.4=X INPUT/OUTPUT ~% 2.0 2.0 TEST POINT~ U A.C. TESTING LOAD CIRCUIT )C DEVICE UNDER TEST U NOTES: A.C. testing: inputs are driven at 2.4V for a logic "1" and 0.45V for a logic "0". timing measurements are made at 2.0V for a logic "1" and O.BV for a logic "0". nIL C = IS0pF NOTES: C l = 150 pF C l includes jig capacitance SYSTEM CLOCK 1 4 - - - - - -I C y - -...... ClK WRITE CYCLE DB A ()'7 0·3 ALE READ CYCLE DB 0·7 A DATA 0·3 ALE RD (INTA) - ..._-tcc--~ 6-368 230759·002 8256AH WAVEFORMS (Continued) PARALLEL PORT HANDSHAKING - INPUT MODE 1---------_1-..,1---_ P 10 (S-TB) " P 11 (IBF) INT -----------------~r..,\-------~ RD DB 0-7 DATA. VALID A >-- 0-3 PARALLEL PORT HANDSHAKING - OUTPUT MODE DB 0-7 A 0-3 =x X DATA VJUlD '\:X >- :\\ II WR P tAOB 11 (OBF) P 10 =1 (ACK) INT tHIA AD INTAOR OUTPUT >t : P 20-27 ~ATAVALID 6-369 ;; Ai ~ ~! r;l) 231256-001 intJ 8256AH COUNT PULSE TIMINGS P12 - P13 (COUNTER INPUT) INT LOADING TIMER (OR CASCADED COUNTERITIMER 3 AND 5) P13 (COUNTER INPUT) ZERO COUNT PIS (COUNTER INPUT) ....----tTIL-----~ INT TRIGGER PULSE FOR TIMER 5 (CASCADED EVENT COUNTER/TIMER 3 AND 5) PIS (TRIGGER INPUT) COUNTER TIMER TIMING "''----n--- EXTERNAL CLOCK (P12, P13) OUTPUT FROM PORT 1 AND PORT 2 DB A ______________J:><:,____DA_T_A_V_A_Ll_D__-':>C'-________________ 0-7 0-3 OUTPUT Pl0~17, P2G-27 ":-----~ :xr~:::::::::::::::::= ~~ .... . " 1-<" 6-370. 230759-002 inter 8256AH INPUT FROM PORT 1 AND PORT 2 INPUT Pl0-17, P20-27 DB 0-7 A x _ _ _ _ _ _ _ _ _ _ _.J 0-3 DATA VALID )>-------- INTERRUPT TIMING EXTINT INT ""iNTA OR AD DB 0-7 A 0-3 ____________x DATA. )>---- CTS FOR SINGLE CHARACTER TRANSMISSION RESET TIMING RESET EXTERNAL BAUD RATE CLOCK FOR SERIAL INTERFACE TxC (64 X AND 32 BAUD RATE INPUT 6-371 230759-002 inter 8256AH TRANSMITTER AND RECEIVER CLOCK FROM INTERNAL CLOCK SOURCE TXC, RiC (OUTPUT) TRANSMISSION OF CHARACTERS ON SERIAL INTERFACE - STATUS REGISTER BIT 5 (TBE) STATUS REGISTER BIT 4 (TRE) INT (LEVEL 5) TxD NOTES: 1. Load transmitter buffer register. 2. Transmitter buffer register is empty. 3. Transmitter register is empty. 4. Character format for this example: 7 Data Bits with Parity Bit and 2 Stop Bits. 5. Loading of transmitter buffer register must be complete before CfS goes low. 6. Interrupt due to transmitter buffer register empty. 7. Interrupt due to transmitter register empty. No Status bits are altered when AD is active. DATA BIT OUTPUT ON SERIAL INTERFACE TxC (1 x BAUD RATE' INPUT) TxC (64 x BAUD RATE INPUT) TxC (32 x BAUD RATE INPUT) TxD ~-----DATA 6-372 BIT------t 230759·002 8256AH CONTINUOUS RECEPTION OF CHARACTERS ON SERIAL INTERFACE WITHOUT ERROR CONDITION CHARACTER RxD CHARACTER CHARACTER CHARACTER CHARACTER 1) 2) COMMAND REGISTER BIT 6 (RxE) STATUS REGISTER BIT 6 (RBF) INT (LEVEL 4) RD 4) RECEIVER ENABLE RECEIVER DISABLE CHARACTER CHARACTER CHARACTER NOTES: 1. 2. 3. 4. Character format for this example: 6 data bits with parity bit and one stop bit. Set or reset bit 6 of command register 3 (enable receiver). Receiver buffer located. Read receiver buffer register. ERROR CONDITIONS DURING RECEPTION OF CHARACTERS ON THE SERIAL INTERFACE CHARACTER RxD CHARACTER CHARACTER CHARACTER CHARACTER 1) STATUS REGISTER 2) BIT 6 (RBF) CHARACTER INT (LEVEL 4) STATUS REGISTER 3) ++____J ______ BIT 1 (OE) STATUS REGISTER BIT 0 (FE) FRAMING ERROR NOTES: 1. 2. 3. 4. 5. 6. 7. Character format for this example: 6 data bits without parity and one stop bit. Receiver buffer register loaded. Overrun error. Framing error. Interrupt from receiver buffer register loading. Interrupt from overrun error. Interrupt from framing error and loading receiver buffer register. No status bits are altered when AD is active. 6-373 230759-002 inter 8279/8279·5 PROGRAMMABLE KEYBOARD/DISPLAY INTERFACE • Single 16·Character Display • Simultaneous Keyboard Display Operations • Scanned Keyboard Mode • Right or Left Entry 16·Byte Display RAM • Scanned Sensor Mode • Mode Programmable from CPU • Strobed Input Entry Mode • Programmable Scan Timing • a·Character Keyboard FIFO • Interrupt Output on Key Entry • 2·Key Lockout or N·Key Rollover with Contact Debounce • Dual a· or 16·Numerical Display The • Available in EXPRESS -Standard Temperature Range -Extended Temperature Range Intel~ 8279 is a general purpose programmable keyboard and display I/O interface device designed for use with microprocessors. The keyboard portion can provide a scanned interface to a 64·contact key matrix. The' keyboard portion will also Interface to an array of sensors or a strobed interface keyboard; such as the hall effect and ferrite variety. Key depressions can be 2·key lockout or N-key rollover. Keyboard entries are debounced and strobed,in an 8-character FIFO. If more than 8 characters are entered, overrun status is set. Key entries set the interrupt output line to the CPU. . Intel~ The display portion provides a scanned display interface for LED, incandescent, and other popular display technologies. Both numeric and alphanumeric segment displays may be used as well as simple indicators, The 8279 has 16X8 display RAM which can be organized Into dual 16X4. The RAM can be loaded or interrogated by the CPU. Both right entry, calculator and left entry typewriter display formats are possible. Bath read and write of the display RAM can be done with auto-increment of the display RAM address. Vee IRQ RLo.7 DATA BUS SHIFT . 1_ _ _ - KEY DATA AD wR CNTlISTB CPU INTERFACE cs . SLOoJ SCAN Ao OUT AO.3 RESET DISPLAY ClK OUT 80-3 DATA V" Figure 1. Logic Symbol io-_ _..... Figure 2. Pin Configuration 6-374 8279/8279·5 HARDWARE DESCRIPTION The 8279 is packaged in a 40 pin DIP. The following is a functional description of each pin. Table 1. Pin Descriptions Symbol DBo-DB7 Pin No. Name and Function 19-12 BI-dlrectlonal data bus: All data and commands between the CPU and the 8279 are transmitted on these lines. ClK 3 Clock: Clock from system used to generate internal timing. RESET 9 Reset: A high signal on this pin resets the 8279. After being reset the 8279 is placed in the following mode: 1) 16 8-bit character display -left entry. 2) Encoded scan keyboard-2 key lockout. Along with this the program clock prescaler is set to 31. CS 22 Chip Select: A Iowan this pin enables the interface functions to receive or transmit. Ao 21 Buffer Address: A high on. this Symbol Pin No, SHIFT 36 Shift: The shift input status is stored along with the key position on key closure in the Scanned Keyboard modes. It has an active internal pullup to keep it high until a switch closure pulls it low. CNTUSTB 37 Control/Strobed Input Mode: For keyboard modes this line is used as a control input and stored like status on a key closure. The line is also the strobe line that enters the data into the FIFO in the Strobed Input mode. (Rising Edge), It has an active internal pullup to keep it high until a switch closure pulls it low. OUT Ao-OUT A3 OUT Bo-OUT B3 line indicates the signals in or out are interpreted as a command or status. A low indicates that they are data. RD,WR IRQ 10-11 Input/Output Read and Write: These signals enable the data buffers to either send data to the external bus or receive it from the external bus. 4 BD Interrupt Request: In a keyboard mode, the interrupt line is· high when there is data in the FIFO/Sensor RAM. The interrupt line' goes low with each FIFO/ Sensor RAM read and returns high if there is still information in the RAM. In a sensor mode, the interrupt line goes high whenever a change in a sensor is detected. Vss , Vcc 20,40 Ground and power supply pins, SLo-Sl3 32.,'35 Scan Lines: Scan lines which are 38, 39, 1,2, 5-8 27-24 Outputs: These two ports are the 31-28 outputs for the 16 x 4 display refresh registers. The data from these outputs is synchronized to the scan lines (SL o-Sl3) for multiplexed digit displays. The two 4 bit ports may be blanked independently. These two ports may also be considered as one 8-bit port, 23 Blank Display: This output is used to blank the display during digit switching or by a display blanking command. FUNCTIONAL DESCRIPTION Since data input and display are an integral part of many microprocessor designs, the system designer needs an interface that can contrbl these functions without plaCing a large load on the CPU. The 8279 provides this function for 8-bit microprocessqrs. used to scan the key switch or sensor matrix and the display digits. These lines can be either encoded (1 of 16) or decoded (1 of 4), RLo-Rl7 Name and Function The 8279 has two seciions: keyboard and display, The keyboard section can interface to regular typewriter style keyboards or random toggle 0' thumb switches. The display section drives alphanumeric displays or a bank of indicator lights. Thus the CPU is relieved from scanning the keyboard or refreshing the display. Return Line: Return line inputs which are connected to the scan lines through the keys or sensor switches. They have active internal pullups'lo keep them high until a switch closure pulls one low. They also serve as an 8-bit input in the Strobed Input mode, The 8279 is designed to directly connect to the microprocessor bus, The CPU can program all operating modes for the 8279. These modes inClude: 6-375 inter 8279/8279-5 Input Modes PRINCIPLES O'F OPERATION • Scanned Keyboard - with encoded (8 x 8 key keyboard) or decoded (4 x 8 key keyboard) scan lines. A key depression generates a 6·bit encoding of key position. Position and shift and control status are stored in the FIFO. Keys are automatically debounced with 2·key lockout or N·key rollover. The following is a description olthe major elements olthe 8279 Programmable Keyboard/Display interface device. Refer to the block diagram in Figure 3. 1/0 Control and Data Buffets • Scanned Sensor Matrix - with encoded (8 x 8 matrix switches) or decoded (4 x 8 matrix switches) scan lines. Key status (open or closed) stored in RAM addressable by CPU. . The I/O control section uses the CS, Ao, RD and WR lines to control data flow to and from the various internal registers and buffers. Ail data flow to and from the 8279 is enabled by CS. The character of the information, given or desired by the CPU, is Identified by Ao. A logic one means the Information is a command or status. A logic zero means the information is data. RD and WR determine the direction of data flow through the Data Buffers. The Data Buffers are bi-directional buffers that connect the internal bus to the external bus. When the chip is not. selected (CS = 1), the devices are in a high impedance state. The drivers input during WRe CS and output during • Strobed Input - .oata on return lines during control line strobe is transferred to' FIFO. Output Modes • 8 or 16 character multiplexed displays that can be or· ganlzed as dual 4·bit or single 8·blt (80 Do, Aa 07)' = = • Right entry or left entry display formats. Ai5 .es. Other features of the 8279 include: . • Mode programming from the CPU. Control and Timing Registers and Timing Control • Clock Prescaler • Interrupt output to signal CPU when there is keyboard or sensor data available. These registers store the keyboard and display modes and other operating conditions programmed by the CPU. ,The modes are programmed by presenting the proper command on the data lines with Ao = 1 and then sending a WR. The command is latched on the rising edge of WR.. • An 8 byte FIFO to store keyboard information. • 16 byte internal Display RAM for display refresh. This RAM can also be read by the CPU. eLK RESET DBO·7 IRO KEYBOARD OEBOUNCEAND CONTROL TIMING AND CONTROL OUT Ao.3 OUT 80.3 Figure 3. Internal Block Diagram 6-376 inter 8279/8279·5 The command is then decoded and the appropriate function is set. The timing control contains the basic timing counter chain. The first counter is a .,. N prescaler that can be programmed to yield an internal frequency of 100 kHz which gives a 5.1 ms keyboard scan time and a 10.3 ms debounce time. The other counters divide down the basic internal frequency to provide the proper key scan, row scan, keyboard matrix scan, and display scan times. SOFTWARE OPERATION 8279 commands The following commands program the B279 operating modes. Tl]e commands are sent on the Data Bus with CS low and Ao high and are loaded to the B279 on the rising edge of WR. Keyboard/Display Mode Set MSB Scan Counter The scan counter has two modes. In the encoded mode, the counter provides a binary count that must be externally decoded to provide the scan lines for the keyboard and display. In the decoded mode, the scan counter decodes the least significant 2 bits and provides a decoded 1 of 4 scan. Note than when the keyboard is in decoded scan, so is the display. This means that only the first 4 characters in the Display RAM are displayed. In the encoded mode, the scan lines are active high outputs. In the decoded mode, the scan lines are active low outputs. Code: LSB 101010iDIDIK IKIKI Where DD is the Display Mode and KKK is the Keyboard Mode. DO o 0 B B-bit character display - o 1 16 8-bit character display - o B B-bit character display 16 B-bit character display - Return Buffers and Keyboard Debounce and Control The 8 return lines are buffered and latched by the Return Buffers. In the keyboard mode, these lines are scanned, looking for key closures in that row. If the debounce circuit detects a closed switch. it waits about 10 msec to check if the switch remains closed. If it does, the address of the switch in the matrix plus the status of SHIFT and CONTROL are transferred to the FIFO. In the scanned Sensor Matrix modes, the contents of the return lines is directly transferred to the corresponding row of the Sensor RAM (FIFO) each key scan time. In Strobed Input mode, the contents of the return lines are transferred to the FIFO on the rising edge of the CNTLlSTB line pulse. Display Address Registers and Display RAM The Display Address Registers hold the address of the word currently being written or read by the CPU and the two 4-bit nibbles being displayed. The read/write addresses are programmed by CPU command. They also can be set to auto increment after each read or write. The Display RAM Cdn be directly read by the CPU after the correct mode and a·:tdress is set. The addresses for the A and B nibbles are> .'utomatically updated by the 8279 to match data entry by the CPU. The A and B nibbles can be entered independently or as one word, according to the mode that is set by the CPU. Data entry to the display can be set to either left or right entry. See Interface Considerations for details. Left entry' Right entry Right entry For description of right and left entry, see Interface Considerations. Note that when decoded scan is set in keyboard mode, the display is reduced to 4 characters independent of display mode set. KKK 0 0 0 0 0 Encoded Scan Keyboard - 2 Ke/y Lockout· Decoded Scan Keyboard - 2-Key Lockout 0 0 Encoded Scan Keyboard - N-Key Rollover 0 1 Decoded Scan Keyboard - N-Key Rollover 0 Encoded Scan Sensor Matrix 0 Strobed Input, Encoded Display Scan 0 Decoded Scan Sensor Matrix 0 FIFO/Sensor RAM and Status This block is a dual function 8 x 8 RAM. In Keyboard or Strobed Input modes, it is a FIFO. Each new entry is written into successive RAM positions and each is then read in order of entry. FIFO status keeps track of the number of characters in the FIFO and whether it is full or empty. Too many reads or writes will be recognized as an error. The status can be read by an RD with CS low and Ao high. The status logic also provides an IRQ signal when the FIFO is not empty. In Scanned Sensor Matrix mode, the memory is a Sensor RAM. Each row of the Sensor RAM is loaded with the status of the corresponding row of sensor in the sensor matrix. In this mode, IRQ is high if a change in a sensor is detected. Left entry Strobed Input, Decoded Display Scan Program Clock Code: 1 0 1 0 11 1 pip 1 pip 1 P I All timing and multiplexing signals for the 8279 are generated by an internal prescaler. This prescaler divides the external clock (pin 3) by a programmable integer. Bits PPPPP determine the value of this integer which ranges from 2 to 31. Choosing a divisor that yields 100 kHz will give the specified scan and debounce times. For instance, if Pin 3 of the 8279 is being clocked by a 2 MHz Signal, PPPPP should be set to 10100 to divide the clock by 20 to yield the proper 100 kHz operatIng frequency. Read FIFO/Sensor RAM Code: 1 0 11 1 0 1 AI I X IA I A 1 A 1 X = Don't Care The CPU sets up the B279 for a read of the FIFO/Sensor RAM by first writing this command. In the Scan Key'Default after reset. 6-377 827918279·5 board Mode, the Auto-Increment flag (AI) and the RAM address bits (AAA) are irrelevant. The 8279 will automatically drive the data bus for each subsequent read (Ao= 0) in the same sequence in which the data first entered the FIFO. All subsequent reads will be from the FIFO until another command is issued. Clear Code: In the Sensor Matrix Mode, the RAM address bits AAA select one of the 8 rows of the Sensor RAM. If the AI flag is set (AI = 1), each successive read will be from the subsequent row of the sensor RAM. The CD bits are available in this command to clear all rows of the Display RAM to a selectable blanking code as follows: 1"'C: ': ' AU z,," IX - Read Display RAM Code: 1 0 11 11 1AliA 1A 1A 1AI The CPU sets up the 8279 for a read of the Display RAM by first writing this command. The address bits AAAA select one of the 16 rows of the Display RAM. If the AI flag is set (AI = 1), this row address will be incremented after each following read or write to the Display RAM. Since the same counter is used for both reading and writing, this command sets the next read or write address and the sense of the Auto-Increment mode for both operations. 11 11 10 1Co 1 CD 1CD 1 CF 1 CA 1 000" "',,' 1 0 AB = Hex 20 (0010 0000) 1 1 All Ones Enable clear display when = 1 (or by CA = 1) During the time the Display RAM is being cleared ("'160 ,",s), it may not be written to. The most significant bit of the FIFO status word is set during this time. When the Display RAM becomes available again, it automatically resets. If the C F bit is asserted (C F = 1), the FIFO status is cleared and the interrupt output line is reset. Also, the Sensor RAM pointer is set to row O. C A , the Clear All bit, has the combined effect of CD and CF; it uses the CD clearing code on the Display RAM and also clears FIFO status. Furthermore, it resynchronizes ' the internal timing chain. Write Display RAM The CPU sets up the 8279 for a write to the Display RAM by first writing this command. After writing the com· mand with Ao= 1, all subsequent writes with Ao= 0 will be to the Display RAM. The addressing and AutoIncrement functions are identical to those for the Read Display RAM. However, this command does not affect the source of subsequent Data Reads; the CPU will read from whichever RAM (Display or FIFO/Sensor) which was last specified. If, indeed, the Display RAM was last specified, the Write Display RAM will, nevertheless, change the next Read location. End Interrupt/Error Mode Set Code: For the sensor matrix modes this command lowers the IRQ line and enables further writing into RAM. (The IRQ line would have been raised upon the detection of a change in a sensor value. This would have also inhibited further writing into the RAM until reset). For the N-key rollover mode - if the E bit is programmed to "1"' the chip will operate in the special Error mode. (For further details, see Interface Considerations Section.) Display Write Inhibit/Blanking A B A B Status Word Code: The IW Bits can be used to mask nibble A and nibble B in applications requiring separate 4-bit display ports. By setting the IW flag (IW = 1) for one of the ports, the port becomes marked so that entries to the Display RAM from the CPU do not affect that port. Thus, if each nibble is input to a BCD decoder, the CPU may write a digit to the Display RAM without affecting the other digit being displayed. It is important to note that bit Bo corresponds to bit Do on the CPU bus, and that bit A3 corresponds to bit D7• The status word contains the FIFO status, error, and display unavailable signals. This word is read by the CPU when Ao is high and Cs and RD are low. See Interface Considerations for more detail on status word. If the user wishes to blank the display, the BL flags are available for each nibble. The last Clear command issued determines the code to be used as a "blank." This code defaults to all zeros after a reset. Note that both BL flags must be set to blank a display formatted with a single 8-bit port. 6-378 Data Read Data is read when Ao, CS and RD are all low. The source of the data is specified by the Read FIFO or Read Display commands. The trailing edge of RD will cause the address of the RAM being read to be incremented if the AutoIncrement flag is set. FIFO reads always increment (if no error occurs) independent of Ak Data Write Data that is written with Ao, CS and WR low is always written to the Display RAM. The address is specified by the latest Read Display or Write Display command. AutoIncrementing on the rising edge of WR occurs if AI set by the latest display command. intel' 827918279·5 INTERFACE CONSIDERATIONS Scanned Keyboard Mode, 2·Key Lockout There are three possible combinations of conditions that can occur during debounce scanning. When a key is depressed, the debounce logic is set. Other depressed keys are looked for during the next two scans. If none are encountered, it is a single key depression and the key position is entered into the FIFO along with the status of CNTL and SHIFT lines. If the FIFO was empty, IRQ will be set to signal the CPU that there is an entry in the FIFO. If the FIFO was full, the key will not be entered and the error flag will be set. If another closed switch is encountered, no entry to the FIFO can occur. If all other keys are released before this one, then it will be entered to the FIFO. If this key is released before any other, it will be entirely ignored. A key is entered to the FIFO only once per depression, no matter how many keys were pressed along with it or in what order they were released. If two keys are depressed within the debounce cycle, it is a simultaneous depression. Neither key will be recognized until one key remains depressed alone. The last key will be treated as a single key depression. I ncrement flag is set to zero, or by the End. Interrupt command if the Auto-Increment flag is set to one. Note: Multiple changes in the matrix Addressed by (SLo-3 = OJ may cause multiple interrupts. (SLe =0 in the Decoded Model. Reset may cause the 8279 to see multiple changes. Data Format In. the Scanned Keyboard mode, the character entered into the FIFO corresponds to the position of the switch in the keyboard plus the status of the CNTL and SHIFT lines (non·inverted). CNTL is the MSB of the character and SHIFT is the next most significant bit. The next three bits are from the scan counter and indicate the row the key was found in. The last three bits are from the column counter and indicate to which return line the key was connected. LSB MSB I CNTL ISH I FTI ~ETUR~ SCANNED KEYBOARD DATA FORMAT In Sensor Matrix mode, the data on the return lines is entered directly in the row of the Sensor RAM that corresponds to the row in the matrix being scanned. Therefore, each switch postion maps directly to a Sensor RAM pOSition. The SHIFT and CNTL inputs are ignored in this mode. Note that switches are not necessarily the only thing that can be connected to the return lines in this mode. Any logic that can be triggered by the scan lines can enter data to the return line inputs. Eight multiplexed input ports could be tied to the return lines and scanned by the 8279. Scanned Keyboard Mode, N·Key Rollover With N-key Rollover each key depression is treated independently from all others. When a key is depressed. the debounce circuit waits 2 keyboard scans and then checks to see if the key is still down. If it is, the key is entered into the FIFO. Any number of keys can be depressed and another can be recognized and entered into the FIFO. If a simultaneous depression occurs, the keys are recognized and entered according to the order the keyboard scan found them. Scanned Keyboard - Special Error Modes For N-key rollover mode the user can program a special error mode. This is done by the "End Interrupt/Error Mode Set" command. The debounce cycle and key-validity check are as in normal N-key mode. If during a single debounce cycle, two keys are found depressed, this is considered a simultaneous multiple depression, and sets an error flag. This flag will prevent any further writing into the FIFO and will set interrupt (if not yet set). The error flag could be read in this mode by reading the FIFO STATUS word. (See "FIFO STATUS" for further details.) The error flag is reset by sending the normal CLEAR command with CF = 1. MSB' LSB RL71 RLGI RLSI RL41 RL31 RL21 RLl I RLo In Strobed Input mode, the data is also entered to the FIFO from the return lines. The data is entered by the rising edge of a CNTLlSTB line pulse. Data can come from another encoded keyboard or simple switch matrix. The return lines can also be used as a general purpose strobed input. MSB LSB Sensor Matrix Mode In Sensor Matrix mode, the debounce logic is inhibited. The status of the sensor switch is inputted directly to the Sensor RAM. In this way the Sensor RAM keeps an image of the state of the switches in the sensor matrix. Although debouncing is not provided, this mode has the advantage that the CPU knows how long the sensor was closed and when it was released. A keyboard mode can only indicate a validated closure. To make the software easier. the designer should functionally group the sensors by row since this is the format in which the CPU will read them. The IRQ line goes high if any sensor value change is detected at the end of a sensor matrix scan. The IRQ line is cleared by the first data read operation if the Auto- Display Left Entry Left Entry mode is the simplest display format in that each display position directly corresponds to a byte (or nibble) in the Display RAM. Address 0 in the RAM is the left-most display character and address 15 (or address 7 in 8 character display) is the right most display character. Entering characters from position zero causes the display to fill from the left. The 17th (9th) character is entered back in the left most position and filling again proceeds from there. 6-379 inter 8279/8279·5 o 1st entry o 2nd entry 16th entry 1 1st entry ITI 2 3 4 I I I 6 '7'-Displav 5 I I 1 I :~d~ess 2nd entry 14 15 ~====~ 1 Command 10010101· 14 15 EEI= = = Enter next at Location 5 Auto Increment =~ 1 o 14 15 @EI= = = 3rd entry =~ 1 4then tr v 234 11 I 2 I o LEFT ENTRY MODE (AUTO INCREMENT) 1 I 2 3 6 7 5 13 I I 4 5 I 6 I 7. 111211113141 LEFT ENTRY MODE (AUTO INCREMENT) Right Entry Right entry is the method used by most electronic calculators. The first entry is placed in the right most display character. The next eniry is also placed .in the right most character after the display is shifted left one character. The left most character is shifted off the end and is lost. 1 1st entry 1 111 14 15 ~ o 1 o 18th entry o 14 15_Display RAM Address r::iT?1- - - - o 17th entry 1 r,rr_- _- _- _- CD L...:.L...1 2 14 15 [II: === I I In the Right Entry mode, Auto Incrementing and non Incrementing have the same effect as in the Left Entry except if the address sequence is interrupted: .1 1st entry O'-Display· 11 I I 2 I 4 3 I I 5 I 6 ·7 I O:4-Di,play 11 I :~d~ess 23456701 :~~ess 2nd entry I [ I I 11 I 21 23456701 Command 10010101 I I 1'1 121 Enter next at Location 5 Auto Increment 34567012 3rd entry I I I3 I 1 11 12 I 45670123 1 2 14 15 0 17th entry [!0====1151161171 3 15 ISthentry l2EI= == =11611711sl 2 0 1 4th entry 13141 11 121 I 1 RIGHT ENTRY MODE (AUTO INCREMENT) Starting at an arbitrary location operates as shown below: o RIGHT ENTRY MODE (AUTO INCREMENT) Command 10010101 Note that now the display position and register address do not correspond. Consequently, entering a character to an arbitrary position in the Auto Increment mode may have unexpected results. Entry starting at Display RAM address o with sequential entry is recommended. 1 2 I II 1 3 4 I 5 I 6 I 7.- Display I 1 :~~ess Enter next at Location 5 Auto Increment 12345670 1st entry Auto Increment In the Lett Entry mode, Auto Incrementing causes the address where the CPU will next write to be incremented by one and the character appears in the next location. With non-Auto Incrementing the entry is both to the same RAM address and display position. Entry to an arbitrary address in the Auto Increment mode has no undesirable side effects and the result is predictable: IIII 11 III 23456701 2nd entry I Sthentry 141516171s1112131 9th entry 1516 I 7 Is 19 12 13 14 I I I '1 1 12 I I RIGHT ENTRY MODE (AUTO INCREMENTI 6-380 I I inter 8279/8279·5 Entry appears to be from the initial entry pOint. In a Sensor Matrix mode, a bit Is set In the FIFO status word to indicate that at least one sensor closure indica· tion is contained in the Sensor RAM. 8/16 Character Display Formats In Special Error Mode the S/E bit Is showing the error flag and serves as an indication to whether a simultane· ous multiple closure error has occurred. If the display mode is set to an 8 character display, the on duty-cycle is double what it would be for a 16 character display (e.g., 5.1 ms scan time for 8 characters vs. 10.3 ms for 16 characters with 100 kHz internal frequency). FIFO STATUS WORD G. FIFO StatuB FIFO status is used in the Keyboard and Strobed Input modes to indicate the number of characters in the FIFO and to indicate whether an error has occurred. There are two types of errors possible: overrun and underrun. Overrun occurs when the entry of another character into a full FIFO is attempted. Underrun occurs when the CPU tries to read an empty FIFO. Error-Overrun ' - - - - - Sensor Closure/Error Flag for Multiple Closures ' - - - - - - Display unavailable The FIFO status word also has a bit to indicate that the Display RAM was unavailable because a Clear Display or Clear All command had not completed its clearing operation. KEYBOARD SHIFT ~ MATRIX CONTROL iT 8 COLUMNS RETURN LINES 8 ROWS • INT 8-SIT MICRO· DATA PROCESSOR BUS SVSTEM CONTROLS { ADDRESS { BUS CLOCK SHIFT CNTL INT RO_7 voo DATA BUS 8/ 0 0 _1 AD lOR WR RESET CS Ao CLK lOW RESET IIss So.3 8279 }- v· 3 lv 3- B DECODER ~ 3 LSI' 4/ SCAN LINES t4 4-1SDECODER C! Ao CLK BO _3 AQ _ 3 BD BLANK l~'SPLAV US ADDRESSES (DECODED! DISPLAY 4 / CHARACTERS DATA DISPLAY • Do not drive the keyboard decoder with the MSB of the scan lines. Figure 4. System Block Diagram 6-381 inter 8279/8279·5 ABSOLUTE MAXIMUM RATINGS· Ambient Temperature . . . . . . . . . . . . . . O°C to 70°C Storage Temperature .......•..... -65°C to 125°C Voltage on any Pin with Respect to Ground .. , . . . . . . . . . . . -0.5V to +7V Power Dissipation . . . . . . • . . . . . . . . . . . . . . . 1 Watt D.C. CHARACTERISTICS ·NOTlCE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and· functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. [TA = O"C to 70°C. Vss = 011, (NOTE 3))* Symbol Parameter Max. Unit VILl Input Low Voltage for Return Lines -0.5 1.4 V VIL2 Input Low Voltage for All Others -0.5 0.8 V VIHl Input High Voltage for Return Lines 2.2 VIH2 Input High Voltage for All Others 2.0 VOL Output Low Voltage VOHl Output High Voltage on Interrupt Line 3.5 VOH2 Other Outputs 2.4 IILl Input Current on Shift. Control and Return Lines +10 -100 IIL2 Input Leakage Current on All Others IOFL Output Float Leakage Icc Power Supply Current f--_. Min. Test Conditions V V 0.45 V Note 1 V Note 2 IOH = -400p.A 8279-5 -100p.A 8279 IJ.A IJ.A VIN = Vcc VIN = OV ±10 IJ.A VIN = Vcc to OV ±10 IJ.A VOUT = Vee to 0.45V .. 120 mA CAPACITANCE Symbol Parameter Max. Unit CIN Input Capacitance 5 10 pF fe = 1 MHz Unmeasured COUT Output Capacitance 10 20 pF pins returned to VSS A.C. CHARACTERISTICS Typ . . Test Conditions [TA = O"C to 70°C. VSS = OV. (Note 3)] • Bus Parameters READ CYCLE 8279-5 8279 Symbol Parameter Min. Max. Min. Max. Unit tAR Address Stable Before READ 50 0 ns tRA Address Hold Time for READ 5 0 ns tRR READ Pulse Width tRO[4] Data Delay from READ tAO [4] Address to Data Valid tOF READ to Data Floating tRCY Read Cycle Time 420 250 I 10 1 6-382 ns 300 150 ns 450 250 ns 100 10 1 100 ns IJ.S 8279/8279·5 A.C. CHARACTERISTICS (Continued) WRITE CYCLE 8279 Symbol Parameter Min_ 8279-5 Min_ Max_ Max_ Unit tAW Address Stable Before WR IT E 50 0 ns tWA Address Hold Time for WR ITE 20 0 ns tww WR ITE Pulse Width 400 250 ns tDW Data Set Up Time for WR ITE 300 150 ns tWD Data Hold Time for WR IT E 40 0 ns twey Write Cycle Time 1 1 I'S OTHER TIMINGS 8279 8279-5 I Parameter Min_ t¢w Clock Pu Ise Width 230 120 J nsec tCY Clock Period 500 320 i nsec Symbol Keyboard Scan Time ........................ 5.1 msec Keyboard Debounce Time .................. 10.3 msec Key Scan Time .............................. 80 p,sec Display Scan Time ......................... 10.3 msec Max_ Min_ Max_ I Unit ._- Digit-on Time .............................. 480 p,sec Blanking Time ............................. 160 p,sec Internal Clock Cycle[5] ....................... 10 p,sec NOTES: 1. 8279, IOl = 1.6mA; 8279-5, IOl = 2.2mA. 2. IOH = -1OOfLA 3. 8279, Vee = +5V ±5%; 8279-5, Vee = +5V ±10%. 4. 8279, Cl = 100pF; 8279-5, Cl = 150pF. 5. The Prescaler should be programmed to provide a 10 fLs internal clock cycle . • For Extended Temperature EXPRESS, use M8279A electrical parameters. A.C. TESTING INPUT, OUTPUT WAVEFORM A_C. TESTING LOAD CIRCUIT INPUT/OUTPUT u==x > 2.0 TEST POINTS 0.45 O.B -- < )C 2.0 DEVICE UNDER TeST 0.8 A.C. TESTING: INPUTS ARE DRIVEN AT 2AV FOR A LOGIC "1" AND0.45V FOR A lOGIC "0." TIMING MEASUREMENTS ARE MADE AT 2.0V FOR A LOGIC "1" AND a.8V FOR A LOGIC "0 .. I c, ~ 120pF CL =120pF C L INCLUDES JIG CAPACITANCE 6-383 8279/8279·5 WAVEFORMS READ OPERATION 1---------------------r "'-___________--4--tAR-I~·~---------tRcv (SYSTEM'S ADDRESS BUS) ----1-------1 J---~-'AA-----I (READ CONTROL) --tOF t RD - I----·Ao----I DATA BUS (OUTPUT) ....~..,.;~~~~........~..,.;~~_ _ _ _ _ _ _ _ _ _~~~~loll~~~~~~~~ WRITE OPERATION ~------------------- (SYSTEM'S ADDRESS BUS) ~---~w---~ (WRITE CONTROL) -.oW~ -~o 'V ---X DATA BUS DATA -+---DATAVALlO-- IINPUT)_ _ _ _ _ M_A_Y_C_HA_N_G_E__F--..J~ ,- DATA ' -_ _ _ _,.;M:.;,A;,;Y,.;C;;,;H;,;A;;,;NG:;,;E;,.._ _ _ __ CLOCK INPUT ~--------------------------------------------------------------- 6-384 8279/8279-5 WAVEFORMS (Continued) SCAN L 5, ENCODED SCAN L L 5, 5, SCAN 5, 5, u u u u u u u DECODED u u u u DISPLAY !--------6.II0 I ' S = 6 4 t C y - - - - - - - u PRESCALER PROGRAMMED FOR INTERNAL FREQUENCY = 100 kHz SO teY"'" 10J,ts 50 5, AO-A3 ACTIVE HIGH AIO) BLANK CODE" All) "BLANK CODE IS EITHER ALL O's OR ALL 1'$ OR 20 HEX 80- 8 3 8(1) ACTIVE HIGH 4901'$ Rl o- RL7 NOTE: SHOWN IS ENCODED SCAN LEFT ENTRY 52-53 ARE NOT SHOWN BUT THEY ARE SIMPLY 51 DIVIDED BY 2 AND 4 6-385 LJ APPLICATION NOTE Ap·153 June 1983 210907-002 6-386 Designing with the 8256 Contents INTRODUCTION DESCRIPTION OF THE MUART Microprocessor Bus Interface Command and Status Registers Clock Circuitry System Clock Prescaler Timer Prescaler Asynchronous Serial Interface Receiver Section of the UART Receive Break Detect Transmitter Section of the UART Transmit Break Features Modification Register Parallel I/O Two Wire Byte Handshake Event CounteriTimers Interrupt Controller MCS-85/8256 Interrupt Operation MCS-86/88/8256 Interrupt Operation Using the Interrupt Controller Without INTA Interrupt Registers Interrupt Modes Edge Triggering Level Triggering Cascading the MUART's Interrupt Controller Polling the MUART PIN DESCRIPTIONS DESCRIPTION OF REGISTERS Hardware Reset INTERFACING PROGRAMMING Initialization . Operating the Serial Interface Transmitting Receiving Operating the Parallel Interface Loading Port 1 and 2 Reading Port 1 and 2 Operating the Event Counter/Timers Loading Event CounterlTimers Reading Event CounterlTimers 6-387 210907-002 Contents (cont.) APPLICATION EXAMPLE Description of the Line Printer Multiplexer Description of the Hardware Description of the Software Buffer Management Using the LPM with the MDS SERIES II ORSERIESIII APPENDIX Listing of the Line Printer Multiplexer Software Listing of the WRITE Program MUART Registers 6-388 210907-002 AP-153 INTRODUCTION The INTEL 8256 MUART is a Multifunction Universal Asynchronous Receiver Transmitter designed to be used for serial asynchronous communication while also providing hardware support for parallel 110, timing, counting and interrupt control. Its versatile design allows it to be directly connected to the MCS@-85, iAPX-86, iAPX-88, iAPX-186, and iAPX-188 microcomputer systems plus the MCS-48 and MCS-51 family of single-chip microcomputers. The four commonly used peripheral functions contained in the MUAR Tare: 1) Full-duplex, double-buffered serial asynchronous Receiver/Transmitter with an on-chip Baud Rate Generator 2) Two - 8-bit parallel 110 ports 3) Five - 8-bit countersltimers 4) 8-level priority interrupt controller Address/Data Bus The MUART contains 16 internal directly addressable read/write registers. Four of the eight address/data lines are used to generate the address. When using 8-bit microprocessors such as MCS-85, MCS-48 and MCS-51, ADO - AD3 are used to address the 16 internal registers while Address/Data line 4 (AD4) is not used for addressing. For 16-bit systems, AD! - AD4 are used to generate the address for the internal data registers and ADO is used as a second active low chip select. RD, WR, CS The 8256 bus interface uses the standard bus control signals which are compatible with all Intel peripherals and microprocessors. The chip select signal (CS), typically derived from an address decoder, is latched along with the address on the falling edge of ALE. As a result, chip select does not have to remain low for the entire bus cycle. However, the data bus buffers will remain tristated unless an RD or a WR signal becomes active while chip select has been latched in low. This manual can be divided into two parts. The first part describes the MUART in detail, including its functions, registers and pins. This section also describes the interface between the MUART and Intel CPUs plus a discussion on programming considerations. The second section provides an application example: a MUART-based line printer multiplexer. The Appendix contains software listings for the line printer multiplexer and some useful reference information. The INT and INTA signals are used to interrupt the CPU and receive the CPU's acknowledgment to the interrupt request. The MUART can vector the CPU to the appropriate service routine depending on the source of the interrupt. DESCRIPTION OF THE MUART RESET The MUART can be logically partitioned into seven sections: the microprocessor bus interface, the command and status registers, clocking circuitry, asynchronous serial communication, parallel 110, timer/event counters, and the interrupt controller. This can be seen from the block diagram of the 8256 MUART as shown in Figure 1. The MUART's pin configuration can be seen in Figure 2. When a high level occurs on the RESET pin, the MUART is placed in a known initial state. This initial state is described under "Hardware Reset." Microprocessor Bus Interface The microprocessor bus interface is the hardware section of the MUART which allows a IlP to communicate with the MUART. It consists of tristate bi-directional data-bus buffers, an address latch, a chip select (CS) latch and bus control logic. In order to provide all of the MUART's functions in a 40-pin DIP while retaining direct register addressing, a multiplexed address/data bus is used. 6-389 INT,INTA Command and Status Register There are three command registers and one status register as shown in Figure I. The three command registers are read/write registers while the status register is a read only. The command registers configure the MUART for its operating environment (Le., 8 or 16 bits CPU, system clock frequency). In addition, they direct its higher level functions such as controlling the UART, selecting modes of operation for the interrupt controller, and choosing the fundamental frequency for the timers. Command Register 3 is the only register in the MUART which is a bit set/reset register, allowing the programmer to simply perform one write to set or reset any of the bits. 210907-002 AP·153 P10'tp ADo·AD. DBs·DBr P2o.a7 Os AxD AD WT,D ALE RESET iNti INT RiC I _____ -"" ~========== elK EXTINT Figure 1. Block Diagram of the 8256 MUART ADO Vee AD1 P10 AD2 P11 AD3 P12 AD4 P13 DBS P14 DBB P1S DB7 P16 ALE PH RD P20 WR P21 RESET P22 CS P23 iNTA P24 INT P2S EXTINT P2B ClK P27 RiC TxD RxD rxc OND CTS Figure 2. MUART Pin Configuration The status register provides all of the information about the status of the UART's transmitter and receiver as weIl as the status of the interrupt pin. The status register is the only read only register' in the MUART. CLOCK CIRCUITRY The clock for the five timers and baud rate generator is derived from the system clock. The system clock, pin 17 (eLK), is fed into a system clock prescaler which in turn feeds the five timers and the baud rate generator. The MUART's system clock can be asynchronous to the microprocessor's clock. System Clock Prescaler The system clock prescaler is a programmable divider which normalizes the internal clocking frequency for the timers and baud rate generator to 1.024MHz. It divides the system clock (eLK) by I, 2, 3, or 5, aIlowing clock frequencies of 1.024MHz, 2.04SMHz, 3.072MHz or 5.12MHz. (The, commonly used 6.144MHz crystal frequency for the SOS5 results in a 3.072MHz frequency from the SOS5's eLK pin;) If the system clock is not one of the four frequencies mentioned above,' then the frequency of the baud rate generator and the timers will be nonstandard; 6-390 210907-002 Ap·153 or at the rising edge of the internal- baud clock. When the receiver is enabled but inactive, the receive logic is sampling RxD at either 32 or 64 times the bit rate, looking for a change from the Mark (high) to the Space (low) state. This is commonly referred to as the start bit search mode. When this state change occurs, the receive logic waits one half of a bit time and then samples RxD again. If RxD is still in the Space state, the receive logic begins to clock in the receive data beginning one bit period later. If RxD has returned to the Mark state (i.e., false start bit), the receive logic will return to the start bit search mode. however, the MUART will still run as long as the system clock meets the data sheet tcy spec. Timer Prescaler The timer prescaler permits the user to select one of two fundamental timing frequencies for all of the MUART's timers, either 1KHz or 16KHz. The frequency selection is made via Command Register O. Asynchronous Serial Interface The asynchronous serial interface of the MUART is a full-duplex double-buffered transmitter and receiver with separate control registers. The standard asynchronous format is used as shown in Figure 3. The operation of the UART section of the MUART is very similar to the operation of the 8251A USART. Receiver Section of the UART The serial asynchronous receiver section contains a serial shift register, a receiver buffer register and receiver control logic. The serial input data is clocked into the receive shift register from the RxD pin at the specified baud rate. The sampling actually takes place at the rising edge of RxC, assuming an external clock, GENERATED BYB256 OoO'----D~ STJ;-i errs L DOES NOT APPEAR 000, ----0 .. ON THE DATA BUS RECEIVER INPUT RxO IL._S,,;,T:_.~_T tt t t ..JG,--_D_AT-;A Bf-'T_S.....L---'_...I' '~~fL PROGRAMMED CHARACTER LENGTH TRANSMISSION fORMAT CPU BYTE 15·8 BITS/CHAR) DATA C:!,RACTER ASSEMBLED SERIAL DATA OUTPUT START ~T.DI DATA CHARACTER STOt;-'] ,--B~'T~_ _~~_ _~~~_B~'T~ RECEIVE FORMAT SERIAL DATA INPUT IR.DI L.-ST_~~_T~___DA_T_A_CH-iAR~AC_T_'R__~__--,__S-;~~I=J CPU BYTE (58 BITS/CHARI' D.ATA '.' CH~R""A_CT_'_R__-, 'NOTE IF CHARACTER LENGTH IS DEFINED AS 5, 6 OR 7 BITS THE UNUSED BITS ARE SET TO "ZERO" Figure 3. Asynchronous Format Normally the received data is sampled in the center of each bit, however it is possible to adjust the location where the bit is sampled. This feature is controlled by the modification register. The bit rate of the serial receive data is derived from either the internal baud rate generator or an external clock. When using an external clock, the programmer has a choice of three sampling rates: lx, 32x, or 64x, Using the internal baud rate generator, the sampling rates are all 64x except for 19.2 Kbps which is 32x. When the serial shift register clocks in the stop bit, an internal load pulse is generated which transfers the contents of the shift register into the receive buffer. This transfer takes place during the first half of the first stop bit. The load pulse also triggers several other signals relevant to the receive section including Receive Buffer Full (RBF), Parity Error (PE), Overrun Error (OE), and Framing Error (FE). These four status bits are updated after the middle of the first stop bit when the receive buffer has already been latched. Each one of these four status bits are latched. They are reset on the rising edge of the first read pulse (RD) addressed to the status register. A complete description of the status register is given in the section "Description of the Registers." When the serial receiver is disabled (via bit 6 of Command Register 3) the load pulse is suppressed. The result is that the receive buffer is not loaded with the contents of the shift register, and the RBF, PE, OE, and FE bits in the status register are not updated. Even though the receiver is disabled, the serial shift register will still be clocking in the data from RxD, if any. This means that the receiver will still be synchronized with the start and stop bits. For example, if the receiver is enabled via Command Register 3 in the middle of receiving a serial character, the character will. still be ass~mbled correctly. When the receiver is disabled the last character received will remain in the receive buffer. On power-up the value in the receive buffer is undefined. 6-391 210907-002 inter Ap·153 Whenever a character length of fewer than 8 bits is programmed, the most significant bits of a received character will read as zero. Also, the receiver will only check the first stop bit of any character, regardless of how many stop bits are programmed into the device. Receive Break Detect A Receive Break occurs when RxD remains in the space state for one character time, including the parity bit (if any) and the first stop bit. The MUART will set the Break Detect status bit (BD) when it receives a break. The Break Detect status bit is set after the middle of the first stop bit. If the MUART detects a break it will inhibit the receive buffer load pulse, thus the receive buffer will not be loaded with the null character, and none of the four status bits (PE, OE, FE, and RBF) will be updated. The last character received will remain in the receive buffer. A break detect state has the same effect as disabling the receiver-they both inhibit the load pulse-'therefore one can think of the break status as disabling the receiver. The Break Detect status bit is latched. It is cleared by the rising edge of the read pulse addressed to the status register. If a break occurs, and then the RxD data line returns to the Mark state before the status register is read, the BD status bit will remain set until it is read. If RxD returns to the Mark state after the BD status bit has been read true, the BD status bit will be reset automatically without reading the status register. The receive break detect logic of the MUART is independent of whether the receiver is enabled or disabled; therefore even if the receiver is disabled the MUART will recognize a break. When the RxD line returns to the Mark state after a break, the 8256 will be in the start bit search mode. If the receiver interrupt level is enabled, break will generate an interrupt request regardless of whether the receiver is enabled. Another receive interrupt will not be generated until the RxD pin returns to the Mark state. Transmitter Section of the UART The serial asynchronous transmitter section of the MUART consists of it transmit buffer, a transmit (shift) register, and the associated control logic. There are two bits in the status register which indicate the status of the transmit buffer and transmit register: TBE (transmit butfer empty) and TRE (transmit register empty). To transmit a character, a byte is written to the transmit buffer. The transmit buffer should only be written to when TBE = 1. When the transmit register is empty and CTS = 0, the character will be automatically transferred from the transmit buffer into the transmit register. The data transfer from the transmit buffer to the transmit register takes place during the transmission of the start bit. After this transfer takes place, sometime at the beginning of the transmission of the first data bit, TBE is set to 1. When the transmitter is idle, both TBE. and TRE will be set to 1. After a character is written to the transmit buffer, TBE = 0 and TRE = 1. This state will remain for a short period of time, then the character will be transferred into the transmit register and the status bits will read TBE = 1 and TRE = O. At this point a second character may be written to the transmit buffer after which TBE =0 and TRE =O. TBE will not be set to 1 again until the transmit register becomes empty and is reloaded with the byte in the transmit buffer. The transmitter can be disabled only one way-using the CTS pin. When CTS = 0 the transmitter is enabled, and when CTS = 1 the transmitter is disabled. If the transmitter is idle and ffi" goes from 0 to I, disabling the transmitter, TBE and TRE will remain set to 1. Since TBE = 1 a character can be written into the tr~nsmit buffer. The character will be stored in the transmit buffer but it will not be transferred to the transmit register until CTSgoes low. If CTS goes from low to high during transmission of a character, the character in transmission will be completed and TxD will return to the Mark state. If the transmitter is full (i.e., TBE and TRE = 0), the transmit shift register will be emptied but the transmit buffer will not; therefore TBE = 0 and TRE = I. Transmitter Break Features The MUART ,has three transmit break features: Break-In Detect, Transmit Break (TBRK), and Single Character Break (SBRK). Break-In Detect - A Break-In condition occurs when the MUART is sending a serial message and the transmission line is forced to the space state by the receiving station. Break-In is usually used with halfduplex transmission so that the receiver can signal a break to the transmitter. Port 16 must be connected externally to the transmission line in order to detect a Break-In. If transmission voltage levels other than TTL are used, then proper buffering must be provided so that Port 16 on the MUART will receive the correct polarity and voltage levels. 6-392 210907-002 inter AP·153 When Break-In Detect is enabled, Port 16 is polled internally during the transmission of the last or only stop bit of a character. If this pin is low during transmission of the stop bit, the Break Detect status bit (BD) will be set. Break-In Detect and receive Break Detect are OR-ed to set the BD status bit. (Either one can set this bit.) The distinction can be made through the interrupt controller. If the transmit and receive interrupts are enabled, a Break-In will generate an interrupt on level 5, the transmit interrupt, while Break will generate an interrupt on level 4, the receive interrupt. If RxC and TxC are used for the serial bit rates, Break -In cannot be detected. Transmit Break - This causes the TxD pin to be forced low for as long as the TBRK bit in Command Register 3 is set. While Transmit Break is active, data transfers from the Transmit Buffer to the Transmit register will be inhibited. If both the Transmit Buffer and the Transmit Register are full, and a Transmit Break command is issued (command register 3, TBRK = I), the entire character in the Transmit register is sent including the stop bits. TxD is then driven low and the character in the Transmit Buffer remains there until Transmit Break is disabled (command register 3, TBRK = 0). At this time TxD will go high for one bit time and then send the character in the Transmit Buffer. Single Character Break - This causes low for one character including start parity bit, and stop bits. The user can number of Break characters using this TxD to be set bit, data bits, send a specific feature. If both the Transmit Buffer and the Transmit Register are full and a Send Break command is issued (command register 3, SBRK = I) the entire character in the Transmit Register is sent including the stop bits. TxD is driven low for one complete character time followed by a high for two bit times after which the characterin the Transmit Buffer is sent. Modification Register The modification register is used to alter two standard functions of the receiver (start bit check, and sampling time) and to enable a special indicator flag for halfduplex operation (transmitter status). Disabling start bit check means that the receiver will not return to the start bit search mode if RxD has returned to the Mark state in the center of the start bit. It will simply proceed to assemble a character from the RxD pin regardless of whether it received a false start bit or not. The modification register also allows the user to define where within the receive data bits the MUART will sample. Parallel 1/0 The MUART contains 16 parallel 110 pins which are divided into two 8-bit ports. These two parallel 1/0 ports (Port I and Port 2) can be used for basic digital 110 such as setting a bit high or low, or for byte transfers using a two-wire handshake. Port 1 is bit programmable for input or output, so any combination of the eight bits in Port 1 can be selected as either an input or an output. Port 2 is nibble programmable, which means that· all four bits in the upper or lower nibble have to be selected as either inputs or outputs. For byte transfers using the two- wire handshake, Port 2 can either input or output the byte while two bits in Port I are used for the handshaking signals. All of the bits in Port 1 have alternate functions other than 110 ports. As mentioned above, when using the byte handshake mode, two bits on Port I are used for the handshaking signals. As a result, these two bits cannot be used for general purpose 1/0. The other six bits in Port I also have alternate functions if they are not used as 110 ports. Table 1 lists each bit from Port 1 and its corresponding alternate function. The bits in the Port 1 Control Register select whether the pins on Port I are inputs or outputs. The pins on Port I are selected as control pins through the other programming registers which are relevant to the control signal. Configuring a bit in Port I as a control function overrides its definition in the Port I Control Register. If the pins on Port I are redefined as control signals, the definition of whether the pin is an input or an output in the Port I Control Register remains unchanged. If the pins on Port 1 are converted back to 110 pins, they assume the state which was defined in the Port I Control Register. Each parallel 110 port has a latch and drivers. When the port is in the output mode, the data written to the port is latched and driven on the pins. The data which is latched in the 110 ports remains unchanged unless the port is written to again. Reading the ports, whether the port is an input or output, gates the state at the pins onto the data bus. Writing to an input port has no effect on the pin, but the data is stored in the latch and will be output if the direction on the pin is changed later. Writing to a control pin on Port I has the same effect as writing to an input pin. If pins 2, 3, 5, and 6 in Port I are used for control signals, the contents of the respective output latches will be read, not the state of the control signals. If pins 0, I, and 7 on 6-393 210907-002 AP·153 Table 1. Port 1 Control Signals Pin Symbol Pin Number Control Function Condition PI0 Pll 39 38 ACK OBF Control signals for Port 2 8-bit handshake output Mode register P2C2 - P2CO=101 PIO Pll 39 38 STB IBF Control signals for Port 2 8-bit handshake input Mode register P2C2 - P2CO= 100 P12 37 Event counter 2 clock input Mode register CT2=1 P13 36 Event counter 3 clock input Mode register CT3=1 P14 35 Internal baud rate generator clock output Mode word P2CO - P2C2 = 111 Port 1 control word P14= 1 Command Register 2 B3 - BO~ 3H P15 34 Timer 5 trigger input Mode register T5C=1 P16 33 Break-In detection input Command Register 1 BRKI=1 P17 32 External edge sensitive interrupt input Command Register 1 BITI= 1 Port 1 are used for control signals, the state of the control signals will be read. If pin 4 on Port 1 is used as a test output for the internal baud rate, this clock signal will be output through the output latch, thus the information in the output latch will be lost. The Two·Wire Byte Handshake first data byte must be written to Port 2 and completely transferred before an interrupt will occur, or the two-wire handshake interrupt is enabled while ACK is low, and then ACK goes high. Event Countersrtimers The 8256 can be programmed, via the Mode Register, to implement an input or output two-wire byte handshake. When the Mode Register is programmed for the byte handshake, Port 2 is used to transmit or receive the byte, and pins PIO and Pll are used for the two handshake control signals. Figures 4 and 5 on pages 7 through 10 show a block diagram and timing signals for the two-wire handshake input and output. The MUART's five 8-bit programmable counters/ timers are binary presettable down counters. The distinction between timer and counter is determined by the clock source. A timer measures an absolute time interval, and its input clock frequency is derived from the MUART's system clock. A counter's input clock frequency is derived from a pulse applied to an external pin. The counter is decremented on the rising, edge of this pulse. ' To set up the two-wire handshake output using interrupts one must first program the Mode Register, and then enable tbe interrupt via the interrupt mask register. An interrupt will 110t occur immediately after the two-wire handshake interrupt is enabled. The interrupt is triggered by the rising edge of ACK. There are two ways to generate the first interrtipt. Either the When the counters/timers are configured as timers their clock source passes through two dividers: the system clock prescaler, and the timer prescaler. As mentioned before, the system clock prescaler normalizes the internal system clock to 1.024 MHz. The timer prescaler receives this normalized system clock and devides it down to either 1 kHz or 16 kHz, depending 6-394 210907-002 Ap·153 INT OBF iNTA AcK Ro PrDcessDr 8256 Equipment WR P20·P27 Databus Figure 4. Block Diagram on how Command Register I is programmed. If more timing resolution is needed the clock frequency can be input externally through the I/O ports. of Handshake Output By programming the Mode Register, four of the 8-bit counters/timers can be cascaded to form two 16-bit counters. Counters/timers 3 and 5 can be cascaded together, and counters/timers 2 and 4 can be cascaded together. Counters/timers 2 and 3 are the lower bytes, while counters/timers 4 and 5 are the upper bytes in the cascaded mqde. The event counters/timers can be used in the following modes of operation: Each counter can be loaded with an arbitrary initial value. Timer 5 is the only timer which has a special save register which holds its initial value. Whenever Timer 5 is loaded with an initial value the special save register is also loaded with this value. Timer 5 can be reloaded to its initial value from the detection of a high-to-low transition on Port P15. bit in the interrupt mask register is automatically reset, preventing further interrupt requests from occuring. Timer I - Serves as an 8-bit timer. Event Counter/Timer 2 - Serves as an 8-bit timer or event counter, or cascaded with Timer 4 as a 16-bit timer or event counter. The counters are decremented on the first rising edge of the clock after the initial value has been loaded. The setup time for loading the counter when using an external clock is specified in the data sheet. When using internal clocks, the user has no way of knowing the phase relationship of the clock to the write pulse; therefore the timing accuracy is one clock period. The timers are counting continuously, and an interrupt request is issued any time a single counter or pair of cascaded counters reaches zero. If the timers are going to be used with interrupts, then the programmer should first load the timer with the initial value, then enable the interrupt. If the programmer enables the interrupt first, it is possible that the interrupt will occur before the initial value is loaded. When an interrupt from anyone of the timers occurs, the corresponding 6-395 Event Counter/Timer 3 - Serves as an 8-bit timer or event counter, or cascaded with Timer 5 as a 16-bit timer or event counter, with the additional modes of operation selectable for Timer 5. Timer 4 - Serves as an 8-bit timer, or cascaded with Event Counter/Timer 2 as a 16-bit timer or event counter. Timer 5 I) Non-retriggerable 8-bit timer 2) Retriggerable a-bit timer whose initial value is loaded from a save register which starts following the negative transition of an external signal. Subsequent transitions of this signal after the counting has started, reloads the initial value and restarts the counting. 3) Cascaded with Event Counter/Timer 3, nonretriggerable 16-bit timer, which can be loaded with an initial value by two write operations. 210907-002 Ap·153 INT iN'i'A or RfI ............ ............ ...... ...... ® 2 " i \ , AD.·AD4 DBS·DB7 _ _ _J Data P20·P27 Figure 4a. Timing' of Handshake Output CD The 8256 signals with INT that the equipment has accepted the last ci)aracter and that the output latches are empty again. o Thereupon, the microprocessor transfers the next data to the 8256. CDThe rising edge of WR latches the data into port 2 (P20 ... P27) and "Output Buffer Full" (OBF) is set which indicates that a new byte is available. @The equipment acknowledges with the falling edge ofACK that it recognized OBF. 0Thereupon, the 8256 releases OBF. ® The equipment acknowledges the data transfer with a rising edge of ACK which causes the 8256 to set INT. 6-396 210907-002 Ap·153 INT STB INTA IBF AD Processor 8256 Equipment P20·P27 Oatabus Figure 5. Block Diagram of Handshake Input 4) Cascaded with event counter/timer 3, non· retriggerable 16·bit event counter, which can be loaded with an initial value by two write operations. 5) Cascaded with Event Counter/Timer 3, retrig· gerable 16·bit timer. The most significant byte (Timer 5) will be loaded with its initial value from the save register, while the least significant byte' (Event Counter/Timer 3) will be set to OFFH automatically, Loading, starting, and retriggering operations follow the same pattern as in 2). 6) Cascaded with Event Counter/Timer 3, retriggerable 16-bit event counter. The most significant byte (Timer 5) will be loaded with its initial value from the save register, while the least significant byte (Event Counter/Timer 3) will be set to OFFH automatically. Loading, starting, and retriggering operations follow the same pattern as in 2). Interrupt Controller In a microcomputer system there are several ways for the CPU to recognize that a peripheral device needs service. Two of the most common ways are the polling method and the interrupt service method. In the polling method the CPU reads the status of each peripheral to determine whether it needs service. . If the peripheral does not need service, the time the CPU spends polling is wasted; therefore this overhead results in increasing the execution time. Some systems must meet a specific request to response time such as a real time signal. In this case the programmer must guarantee that the peripheral is polled at a certain frequency. This polling frequency cannot always easily be met when the CPU must execute a main program as well as subroutines. Usually each peripheral has its own request to response time requirements; therefore the user must establish a priority scheme. The interrupt method provides certain advantages over the polling method. When a peripheral device needs service it signals the CPU through hardware asynchronously, thus reducing the overhead of polling a device which does not need service. The CPU would typically finish the.instruction it is executing, save the important registers, and acknowledge the peripheral's interrupt request. During the acknowledgment, the CPU reads a vector which directs the CPU to the starting location of the appropriate interrupt service routine. If several interrupt requests occur at the same time, special logic can prioritize the requests so that when the CPU acknowledges the interrupt, the highest priority request is vectored to the CPU. An interrupt driven system requires additional hardware to control the interrupt request signal, priority, and vectoring. The 8256 integr~tes this additional hardware onto the chip. The interrupt controller on the MUART is directly compatible with the MCS-85, iAPX-86, iAPX-88, iAPX-186, iAPX-188 family of microcomputer systems, and it can also be used with other microprocessors as well. It contains eight priority levels, however, there are a total of 12 interruptable sources: 10 internal and 2 external. Since there are eight priority levels, only eight interrupts can be used at one time. The assignment of the interrupts used is selected by Command Register 1 and by the mode register. The MUART's interrupt sources have a fixed priority. Table 2 displays how the 12 interrupt sources are mapped into the 8 priority levels. 6-397 210907-002 Ap,·153 : P2G-P27 =x: Data x: II II :)< Data ~ STB ~----~~~i--------~!~---J INT AD.AD4 ~~i DBS.DB7_'_ _ _ _ _ _ _ _~~~~'lI------ Figure 5a. Timing for Handshake Input CD The equipment indicates with the falling edge of STB (Strobe) that a new character is available at port 2. The 8256 acknowledges the indication by activating IBF (Input Buffer Full). @Thereupon, the equip~ent releases ffi and the 8256 latches the character. ®The 8256 informs the microprocessor through INT that a new character is ready for transfer. @The microprocessor reads the character. The rising edge of Signal Ri5" resets signal iBF. ® ® This action signals to the equipment that the input latches of the 8256 are empty and the next character can be transferred. 6-398 210907-002 inter Ap·153 Table 2. Mapping of Interrupt Sources to Priority Levels Priority Highest Source LO L1 L2 L3 L4 Lowest MEMORY ADDRESS RST0r-_ _ _ _.., OOH L5 L6 L7 Timer 1 Timer 2 or Port Interrupt External Interrupt (EX TINT) Timer 3 or Timers 3 & 5 Receiver Interrupt Transmitter Interrupt Timer 4 or Timers 2 & 4 Timer 5 or Port 2 Handshaking OBH TRAP 10H RST 7.5 RST 6.5 RST 5.5 1BH 20H 24H 2BH 2CH MCS®·85/8256 Interrupt Operation 30H The 8256 is compatible with the 8085 interrupt vector· ing method when the 8086 bit in Command Register 1 of the MUART is set to O. This is the default condition after a hardware reset. The 8085 has five hardware interrupt pins: INTR, RST 7.5, RST 6.5, RST 5.5, and TRAP. When the MUART's interrupt acknowledge feature is enabled (lAE bit 5 Command Register 3 = 1) the MUART's INT Pin 15 should be tied to the 8085's INTR, and both the 8085 and the MUART's INTA pins should be tied together. All of the interrupt pins on the 8085 except INTR automatically vector the program counter to a specified location in memory. When the INTR pin becomes active (HIGH), assuming the 8085 has interrupts enabled, the 8085 fetches the next instruction from the data bus where it has been placed by the 8256 or some other interrupt controller. This instruction is usually a Call or an RSTO through RST7. Figure 6 shows the memory locations where the 8085 will vector to based on which type of interrupt occurred. The 8085 can receive an interrupt request any time, since its INTR input is asynchronous. The 8085, however, doesn't always acknowledge an interrupt request immediately. It can accept or disregard requests under software control using the EI (Enable Interrupt) or DI (Disable Interrupt) instructions. At the end of each instruction cycle, the 8085 examines the state of its INTR pin. If an interrupt request is present and interrupts are enabled, the 8085 enters an interrupt machine cycle. During the interrupt machine cycle the 8085 automatically disables further interrupts until the EI instruction is executed. Unlike normal machine cycles, the interrupt machine 34H 3BH BOBSA EXECUTING SOFTWARE RST INSTRUCTIONS IN RESPONSE TO INTR 3CH BOBSA SYSTEM MEMORY Figure 6. 8085A Hardware and Software RST Branch Locations cycle doesn't increment the program counter. This ensures that the 8085 can return to the pre-interrupt program location after the interrupt service is completed. The 8085 issues an INTA pulse indicating that it is honoring the request and is ready to process the interrupt. The 8256 can now vector program execution to the corresponding service routine. This is done during the first and only INTA pulse. Upon receiving the INTA pulse, the 8256 places the opcode RSTn on the data bus; where n equals 0 through 7 based on the level of the interrupt requested. The RSTn instruction causes the contents of the program counter to be pushed onto the stack, then transfers control to the instruction whose address is eight times n, as shown in Figure 6. Note that because interrupts are disabled during the interrupt acknowledge sequence, the EI instruction must be executed in either the service routine or the main program before further interrupts can be processed. For additional information on the 8085 interrupt operation and the RSTn in~truction, refer to the MCS-85 User's Manual. 6-399 210907-002 Ap·153 two INTA pulses which signals the 8256 that the iAPX·86/88 - 8256 Interrupt Operation 8086/8088 has honored its interrupt request. The MUART is compatible with the 8086/8088 method of interrupt vectoring when the 8086 bit in Command Register 1 is set to 1. The MUART's INT pin is tied to the 8086/8088 INTR pin, and its INTA pin connected to the 8086/88's INTA pin. Like the 8085, the 8086/8088's INTR pin is also asynchronous so that an interrupt request can occur at any time. The 8086/8088 can accept or disregard requests on the INTR pin under software control instructions. These instructions set or clear the interrupt· enabled flag IF. When the 8086/8088 is powered· on or reset, the IF flag is cleared, disabling external interrupts on INTR. Although there are some basic similarities, the actual processing of interrupts with an 8086/8088 is different from the 8085. When an interrupt request is present and interrupts are enabled, the 8086/8088 enters its in· 'terrupt acknowledge machine cycle. The interrupt acknowledge machine cycle pushes the flag registers onto the stack (as in PUSHF instruction). It then clears the IF flag, which disables interrupts. Finally, the contents of both the code segment register and the instruction pointer are pushed onto the stack. Thus, the stack retains the pre-interrupt flag status and program location which are used to return from the service routine. The 8086/8088 then issues the first ·of The 8256 is now ready to vector program execution to the appropriate service routine. Unlike the 8085 where the first INTA pulse is used to place an instruction on the data bus, the first INTA pulse from the 8086/8088 is used only to signal the 8256 of the honored request. The second INTA pulse causes the 8256 to place a single interrupt vector byte onto the data bus. The 8256 places the interrupt vector bytes 40H through 47H corresponding to the level of the interrupt to be serviced. Not used as a direct address, this interrupt vector byte pertains to one of 256 interrupt "types" supported by the 8086/8088 memory. Program execution is vectored to the corresponding service routine by the contents of a specified interrupt type. All 256 interrupt types are located in absolute memory locations 0 through3FFH which make up the 8086/8088's interrupt vector table. Each type in the interrupt vector table requires 4 bytes of memory and stores a code segment address and an instruction pointer address. Figure 7 shows a block diagram of the interrupt vector table. When the 8086/8088 receives an interrupt vector byte, it multiplies its value by four to acquire the address of the interrupt type. ,~ --'f' INTERRUPT TYPE 255 (FFH) 3FCH INTERRUPT TYPE 254 (FE H) 3F8H tR MUART'S INTERRUPT LEVELS ~~ INTERRUPT TYPE 71 (47H) llCH INTERRUPT TYPE 70 (46H) 118H INTERRUPT TYPE 69 (45H) 114H INTERRUPT TYPE 68 ~441iL 110H INTERRUPT TYPE 67 (43H) lOCH INTERRUPT TYPE 66 (42H) 108H INTERRUPT TYPE 65 (41H) 104H TYPE 64 ~Ol:!l. 100H . . INTERRUPT t~ ·· · ~~ INTERRUPT TYPE 2 (2H) INTERRUPT TYPE 1 (lH) 4H INTERRUPT TYPE 0 (OH) OH 8H Figure 7. 8086/8088 Interrupt Vector Table 6-400 210907-002 Ap·153 Once the service routine is completed the main program may be reentered by using an IRET (Interrupt Return) instruction. The I RET instruction will pop the pre-interrupt instruction pointer, code segment and flags off the stack. Thus the main program will resume where it was interrupted with the same flag status regardless of changes in the service routine. Note especially that this includes the state of the IF flag; thus interrupts are re-enabled automatically when returning from the service routine. For further information refer to the iAPX 86,88 User's Manual. Interrupt Registers Using the 8256's Interrupt Controller Without INTA There are several configurations where the 8256 will not have an INTA signal connected to it. Some examples are when using the 8256 with an 8051 or 8048, or when connecting the INT pin on the 8256 to the 8085's RST 7.5, RST 6.5, or RST 5.5 inputs. In these configurations the IAE bit in Command Register 3 is set to 0, and the INTA pin on the 8256 is tied high. When the interrupt occurs the CPU should branch to a service routine which reads the interrupt address register to determine which interrupt request level occured. The interrupt address register contains the level of the interrupt multiplied by four. Reading the interrupt address register is equivalent in effect to the iNTA signal; it clears the INT pin and indicates to the MUART that the interrupt request has been acknowledged. After the CPU reads the value in the interrupt address register, it can add an offset to this value and branch to an interrupt vector table which contains jump instructions to the appropriate interrupt service routines. An 8085 program which demonstrates this routine is given is Figure 8. Table 3 summarizes the priority levels and the interrupt vectors which the 8256 sends back to the CPU. Note that when using Timer 1 there is a conflict pre- INTA: sent between RSTO in the 8085 mode and a hardware reset, because both expect instructions starting at address OH. However, there is a way to distinguish between the two. After a hardware reset, all control registers are reset to a value of OH; therefore when using Timer 1, Reset and RSTO can be distinguished by reading one of the control registers of the 8256 which has not been programmed with a value of OH. The control registers will contain the previously programmed values if RSTO occurs. The 8256's interrupt controller has several registers associated with it: an Interrupt Mask Register, an Interrupt Address Register, an Interrupt Request Register, an Interrupt Service Register, and a Priority Controller. Only the Interrupt Mask Registers and the Interrupt Address Register can be accessed by the user. Interrupt Mask Registers The Interrupt Mask Registers consist of two write registers - the Set Interrupts Register and Reset Interrupts Register, and one read register - the Interrupt Enable Register. Each one of the eight levels of interrupts may be individually enabled or disabled through these registers. Writing a one to any of the bits in the Set Interrupts Register enables the corresponding interrupt level, while writing a one to a bit in the Reset Interrupts Register disables the corresponding interrupt level. Reading the Interrupt Enable Register allows the user to determine which interrupt levels are enabled. The bits which are set to one in the Interrupt Enable Register correspond to the levels which are enabled. All of the interrupt levels will remain enabled until disabled by the Reset Interrupts Register except the counter Itimer interrupts which automatically disable themselves when they reach zero. IN MOV XRA MOV INTADD L, A A H,A ;Read the Interrupt Address Register ;Put the interrupt address in HL LXI DAD PCHL B, TABLE B ;Load BE with the interrupt table offset ;Add the offset to the interrupt address ;Jump to the interrupt vecor table Figure 8. Software Interrupt Acknowledge Routine 6-401 210907-002 Ap·153 Table 3. Assignment of Interrupt Levels to Interrupt Sources Restart Com· mand Inter· rupt Vector Interrupt Level 8085 8086 mode mode Inter· rupt Trigger Address Mode Highest Priority 0 RSTO 40H OH 1 RSTI 41H 2 RST2 3 4 Sources (Only one source can be assigned at any time) Selection by edge Timer 1 - 4H edge Event Counter/Timer 2 or external interrupt request on Port 1 PI7 Command word 1 BITI (bit 2) 42H SH level Input EXTINT - RST3 43H CH edge Event Counter/Timer 3 or cascaded event counters/ timers 3 and 5 Mode word T35 (bit 7) RST4 44H 10H edge Serial receiver 5 RST5 45H 14H edge Serial transmitter - 6 RST6 46H 2SH edge Timer 4 or cascaded event counters/timers 2 and 4 Mode word T24 (bit 6) 7 Lowest Priority RST7 47H ICH edge Timer 5 or Port 2 with handshaking interrupt request Mode word P2C2 - P2CO (bits 2 ... 0) Note: If no interrupt requests are pending and INTA cycle occurs, interrupt level 2 will be the default value vectored to the CPU. Interrupt requests occurring when the corresponding interrupt level is disabled are lost. An interrupt will only occur if the interrupt is enabled before the interrupt request occurs. Interrupt Request Register The Interrupt Request Register latches all pending interrupt requests unless they are masked off. The request is set whenever the associated event occurs. Interrupt Address Register The Interrupt Address Register contains an identifier for the currently requested interrupt level. The numerical value in this register is equal to the interrupt level mutliplied by four. It can be used in lieu of an INTA signal to vector the CPU to the appropriate interrupt service routine. Reading this register has the same effect as the INTA pulse: it clears the INT pin aud indicates an interrupt acknowledgement to the MUART. If the Interrupt Address Register is read while no interrupts are pending, the external interrupt EXTINT will be the default value, OSH. Interrupt Service Register In the fully nested mode of operation, every interrupt request which is granted service is entered into this register. The appropriate bit will be set whenever the interrupt is acknowledged by 'iNTA or by reading the Interrupt Address Register. At the same time, the corresponding bit in the Interrupt Request Register is reset. The Interrupt Service Register bit remains set until the microcomputer transfers the End Of Interrupt command (EOI) to the device by writing it into Command Register 3. In the normal mode the bits in the Interrupt Service Register are never set. 6-402 210907-002 inter Ap·153 The implied way to design a program using the normal mode is to have the CPU's interrupt flag enabled during portions of the main program, but to leave the interrupt flag disabled while the CPU is executing code in an interrupt service routine. This way, the CPU can never be interrupted in an interrupt service routine. Upon completion of an interrupt service routine the program can enable the CPU's interrupt flag, then return to the main program. Priority Controller The priority controller selects the highest priority request in the Interrupt Request Register from up to eight requests pending. If the INTA signal is enabled and becomes active, the priority controller will cause the highest priority level in the Interrupt Request Register to be vectored back to the CPU, regardless of whether the 8256 is in the normal mode or the nested mode. In the normal mode, if any bits are set in the Interrupt Request Register, the INT pin is activated. The highest priority level in the Interrupt Request register will be transferred to the Interrupt Address Register at the same time the interrupt request occurs. In the Fully Nested mode, the priorities of all pending requests are compared to the priorities in the Interrupt Service Register. If there is a higher priority in the Interrupt Request Register than in the Interrupt Ser· vice Register, the INT signal will be activated and the new interrupt level will be loaded into the Interrupt Address Register. Figure 9 shows an example of how the normal mode of interrupts may operate. As the CPU begins executing code in the main program, certain liD ports, variables, and arrays need to be initialized. During this time the CPU's interrupt flag is disabled. Once the program has completed the initialization routine and can accept an interrupt, the interrupt flag is enabled. In the 8085 this is done with the assembly language instruction EI, and on the 8086 with STI. A short time later, an interrupt request comes in on Level 4. Since the CPU's interrupt flag is enabled, the interrupt acknowledge signal is activated and the CPU branches off to Interrupt Service Routine 4. While the CPU is executing code in Interrupt Service Routine 4, an interrupt request comes in on Level 6 and then a short time later on Level 2. The 8256 activates the INT signal; however, the CPU ignores this because its interrupt flag is disabled. Upon returning to the main program the interrupt flag is enabled. When the interrupt acknowledge signal is activated, the MUART places the highest priority interrupt request on the data bus regardless of the order in which the requests came in. Therefore, during the interrupt acknowledge the MUART vectors the indirect address for Interrupt Level 2. The INT signal is not cleared after the acknowledge because there is still a pending interrupt. Interrupt Modes There are two modes of operation for the interrupt controller: a normal mode and a fully nested mode. In the normal mode the CPU should only be a maximum of one interrupt level deep; therefore, the CPU can be interrupted only while in the main program and not while in an interrupt service routine. In the fully nested mode it is possible for the CPU to be nested up to eight interrupt levels deep. Using the fully nested mode, the MUART will activate the INT pin only when a higher priority than the one in service is requested. The fully nested mode is used to protect high priority interrupt service routines from being interrupted by equal or lower priority requests. Normal Mode In the normal mode of operation the 8256 will activate the INT pin whenever any of the bits in the Interrupt Request Register are set. The bits in the Interrupt Request Register can be set only if the corresponding interrupts are enabled. If more than one interrupt request bit is set, the MUART will always place the highest priority level in the Interrupt Address Register and vector this level to the CPU during an iN'i'A cycle. When the CPU acknowledges the interrupt request, using either the INTA signal or by reading the Interrupt Address Register, the corresponding Interrupt Request Register bit is reset. Since the Interrupt Service Register bits are never set, there is no indication in the MUART that an interrupt service routine is in progress. Therefore, the priority controller will interrupt the CPU again if any of the interrupt request bits are set, regardless of whether the next request is a higher, lower, or equal priority. The normal mode of operation is advantageous in that it simplifies programming and lowers code requirements within interrupt routines; however, there are also several disadvantages. One disadvantage is that the interrupt response time for higher priority interrupts may be excessive. For example, if the CPU is executing code in an interrupt service routine during a higher priority request, the CPU will not branch off to the higher priority service routine until the current interrupt service routine is completed. This delay time may not be acceptable for interrupts such as the serial receiver or a real time signal. For these cases the MUART provides the nested mode. Nested Mode In the nested mode of operation, whenever a bit in the Interrupt Request Register is set, the Priority Con- 6-403 210907-002 Ap·153 MAIN PROGRAM t _t EI OR STI t rINTERRUPT-l t INTERRUPT REQUEST 4 • • i I I I SERVICE ROUTINE 4 l 4 ·'--- I I : t INTERRUPT REQUEST 6 INTERRUPT REQUEST 2 I t I RET OR IRET ________ .JI 1 '-iNTERRupT -, I I I I I I I I I SERVICE ROUTINE 2 , , , I I I I I I I I I ... _______ .JI RET OR IRET r-iN'TER'RUPi"- , I i SERVICE ROUTINE 6 I I I I I I I I I I RET OR IRET I... _______ I 1 Figure 9. Normal Interrupt Mode Example troller compares the Interrupt Request Register to the Interrupt Service Register. If the bit set in the Request Register is of a higher priority than the highest priority bit set in the Service Register, the MUAR T will activate the INT signal and update the Interrupt Address Register. If the bit in the Request Register is of equal or lower priority than the highest priority bit set in the Service Register, the INT signal will not be activated. When an 'iN'TA signal is' activated or the Interrupt Address Register is read, the corresponding bit in the Request Register which caused the INT signal to be asserted is reset and set in the Service Register. When an EOI (End Of Interrupt) command is issued, the highest priority bit in the Service Register is reset. Figure 10 shows an example of the program flow using the nested mode of interrupts. During the main program an interrupt request is generated from Level 4. Since the interrupt flag is enabled, the interrupt acknowledge signal is activated, and the microprocessor is vectored to Service Routine 4. During Service Routine 4, Level 2 requests an inter-, rupt. Since Level 2 is a higher priority than Level 4, the 8256 activates its INT signal. An interrupt 6-404 210907-002 Ap·153 MAIN PROGRAM EI OR STI ....t.. r INTERRUPT REQUEST 4 INTERRUPT -, R~mW~CEE4 I • c::::::;- iI ....t.. : ~ :• • I I I I L L EI OR STI I I I I I I I I I I I I I EOI I I I RET OR IRET I ... _____ ..J INTERRUPT REQUEST 2 rI I I I I I I I INiER"RUPT- , SERVICE I ROUTINE 2 1 EI OR STI I I I _I EOI REl OR I/tEl I INTERRUPT REQUEST 6 I I ___ J r.~Pr'"I I II I I I I... ICE E6 R EI OR STI EOI RET OR IRET I I I I I I I _ _ _ _ :..l Figure 10. Fully Nested Interrupt Mode Example acknowledge is not generated because the interrupt flag is disabled. This section of code in Service Routine 4 is protected and cannot be' interrupted. A protected section of code may reinitialize a timer, take a sample, or update a global variable. When the interrupt flag is enabled the microprocessor acknowledges the interrupt and vectors into Service Routine 2. Service Routine 2 immediately enables the interrupt flag because it does not have a protected section of code. During Service Routine 2, Interrupt Request 6 is generated. However, the MUART will not interrupt the microprocessor until service routines 2 and 4 have issued the EOI command. Edge Triggering The MUART has a maximum of two external interrupts-EXTINT and P17. EXTINT is a dedicated interrupt pin which is level triggered, where PI7 is either an 110 port or an edge triggered interrupt. If PI7 is selected as an interrupt through Command Register I and its interrupt level is enabled, it will generate an interrupt when the level on this pin changes from low to high. The edge triggered mode incorporates an edge lockout feature. This means that after the rising edge of an interrupt request and the acknowledgment of the request, the positive level on 6-405 . 210907-002 Ap·153 PI7 won't generate further interrupts. Before another interrupt can be generated PI7 must return low. External devices which generate a pulse for an inter· rupt request can use the edge triggered mode as long as the minimum high time specified in the data sheet is met. Level Triggering The external interrupt (EXTINT pin 16) is the only level triggered interrupt on the MUART. The 8256 will recognize any active (high) level on the EXTINT as an interrupt request. The EXTINT pin must stay high un· til a short time after the rising edge of the first INTA pulse. If the voltage level on the EXTlNT pin is high then goes low, the bit in the interrupt .request register corresponding to EXTINT will be reset. In the normal mode of operation if EXTINT is still high after the iNTA pulse has been activated, the INT signal will remain active. If the microprocessor's interrupt flag is immediately reenabled, another interrupt will occur. Unless repeated interrupt generation is desired, the programmer should not reenable the CPU's interrupt flag until EXTINT has gone low. In the nested mode of operation, if EXTINT is still high after the INTA pulse has been activated, the INT signal will not be reactivated. This is because in the nested mode only a higher priority interrupt than the one being serviced can activate the INT signal. The 8085 8088 INTR EXTINT pin should go inactive (low) before the EOI command is issued if an immediate interrupt is not desired. Depending upon the particular design and application, the EXTINT pin has a number of uses. For example, it can provide repeated interrupt generation in the normal mode. This is useful in cases when a service routine needs to be continually executed until the interrupt request goes inactive. Another use of the EXTINT pin is that a number of external interrupt requests can be wire-ORed. This can't be done using PI7, for if a device makes an interrupt request while PI7 is high (from another request), its transition will be shadowed. Note that when a wire-OR'ed scheme is used, the actual requesting device has to be determined by the software in the service routine. Cascading the MUART's Interrupt Controller Cascading the MUART's interrupt controller is necessary in interrupt driven system which contains more than one interrupt controller, such as a system using more than one MUART, or using a MUART with another interrupt controller like the 8259A. For a system which uses several MUART's, one of them is tied directly to the microprocessor's INT and INTA pins, while the remaining MUARTs are daisy-chained using the EXTINT and INT pins. This is shown in Figure 11. -an 8256 8258 8256 INT EXTINT INTA INT INTA Vee INTA Vee Figure 11. Cascading the MUART's Interrupt Controller 6-406 210907-002 inter AP·153 Using the configuration in Figure 11, when the microprocessor receives an interrupt, it generates an interrupt acknowledge and branches into an interrupt service routine. For the interrupt service routine of the external interrupt, EXTINT Level 2, the microprocessor will read the next MUART's interrupt address register and branch to the appropriate service routine. In effect, this would be a software interrupt FIRST MUART LEVEL 0 INTERRUPT SERVICE ROUTINE acknowledge. An example of this type of interrupt acknowledge is given in Figure 8. If the last MUART in the chain indicated an external interrupt, the microprocessor would simply return to the main program; however, this would be an error condition caused by a spurious interrupt. A flow chart of the software to handle cascaded interrupts is given in Figure 12. LEVEL 1 INTERRUPT SERVICE ROUTINE • • • • • • SECOND MUART • • • Figure 12. Flow Chart to Resolve Interrupt Request When Cascading MUART Interrupt Controllers . 6-407 210907·002 . AP-.153 Polling the MUART Some consideration should be given to the priority of the interrupts when cascading MUARTs. If all of the MUART's Level 0 and Levell interrupts are disabled, the highest priority interrupt is the EXTINT. In this case the last MUART in the chain would have the highest priority; however, it would take the longest time to propagate back to the CPU. If, however, Level 0 or Level 1 interrupts were enabled, the closer to the microprocessor the MUART is, the higher the priority these two levels would have. If interrupts are not used, the only other way to control the MUART is to poll it. It is still possible to use the priority structure of the MuART with polling. In this mode of operation the MUART's INT signal (Pin 15) is not used, and the iiifTA pin is tied high. Since the INT pin's level is duplicated In the MSB of the Status Register, a program can poll this bit. When it becomes set, the program could read the Interrupt Address Register to determine the cause. Either the normal or nested mode of operation can be used. Note that the functions used with this polled method must hi:\Ve their interrupts enabled . When using the 8256 interrupt controller along with .some other interrupt controller, such as the 8259A, the MUART's INT signal would simply be tied to one of the interrupt controller's request inputs. The service routine for the MUART's interrupt request would initially perform the software interrupt acknowledge before servicing the MUART's interrupt request. A block diagram of this configuration is given in Figure 13. 8085A 8088 It is also possible to poll the counters/timers, parallel I/O, and UART separately. To control the UART, one could poll the Status Register. Byte handshakes with the parallel I/O can be controlled by polling Port 1. Finally; each counter/timer has its own register which can be polled. 8259A INTR I - - INT INTA t--- iNTA IRm 8256 I - - INT vc't"' INTA Figure 13. Connecting the 8256 to the 8259A Interrupt Controller 6-408 210907-002 Ap·153 PIN DESCRIPTIONS Symbol Pin No. Type ADO-AD4 1-5 DB5-DB7 6-8 ~--~--'-'-----~~I Name and Function Symbol Pin No. Type 110 Address/Data: Threestate address/data lines which interface to the lower 8 bits of the microprocessor's multiplexed address/data bus. The 5-bit address is latched on the falling edge of ALE. In the 8-bit mode, ADOAD3 are used to select the proper register, while ADI-AD4 are used in the 16-bit mode. AD4 in the 8-bit mode is ignored as an address, while ADO in the 16-bit mode is used as a second chip select, active low. ALE 9 Address Latch Enable: Latches the 5 address lines on ADO-AD4 and CS on the falling edge. RD 10 Read Control: When this signal is low, the selected register is gated onto the data bus. WR 11 Write Control: When this signal is low, the value on the data bus is written into the selected register. RESET 12 CS 13 Reset: An active high pulse on this pin forces the chip into its initial state. The chip remains in this state until control information is written. Chip Select: A low on this signal enables the MUART. It is latched with the address on the falling edge of ALE, and RD and WR have no effect unless CS was latched low during'the ALE cycle. 6-409 Name and Function INTA 14 INT IS o Interrupt Request: A high signals the microprocessor that the MUART needs service. EXTINT 16 I External Interrupt: An external device can request interrupt service through this input. The input is level sensitive (high), therefore it ~be held high until an INTA occurs or the interrupt address register is read. CLK 17 I System Clock: The reference clock for the baud rate generator and the timers. RxC 18 Interrupt Acknowledge: If the MUART has been enabled to respond to interrupts, this signal informs the MUART that its interrupt request is being' acknowledged by the microprocessor. During this acknowledgement the MUART puts an RSTn instruction on the data bus for the 8-bit mode or a vector for the 16-bit mode. lIO Receive Clock: If the baud rate bits in Command Register 2 are all 0, this pin is an input which clocks serial data into the RxD pin on the rising edge of RxC. If baud rate bits in Command Register 2 are programmed from I-OFR, this pin outputs a square wave whose rising 210907-002 Ap·153 PIN DESCRIPTIONS (CONTINUED) Symbol Pin No. Type Name and Function Symbol Pin No. Type edge indicates when the data on RxD is being sampled. This output remains high during start, stop, and parity bits. RxD 19 I Receive Data: Serial data input. CTS 21 I Clear To Send: This input enables the serial transmitter. If I, 1.5, or 2 stop bits are selected, CTS is level sensitive. As long as CTS is low, any character loaded into the transmitter buffer register will be transmitted serially. A single negative going pulse causes the transmission of a single character previously loaded into the transmitter buffer register. If a baud rate from I-OFH is selected, CTS must be low for at least 1132 of a bit, or it will be ignored. If the transmitter buffer is empty, this pulse will be ignored. If this pulse occurs during the transmission of a character up to the time where 112 of the first (or only) stop bit is sent out, it will be ignored. If it occurs afterwards, but before the end of the stop bits, the next character will be transmitted immediately following the current one. If CTS is still high when the transmitter register is sending the last stop bit, the transmitter will enter its idle state until the next high-to-low occurs. transition on rn 6-410 TxC 22 Name and Function If 0.75 stop bits is chosen, the CTS input is edge sensitive. A negative edge on CTS results in the immediate transmission of the next character. The length of the stop bits is determined by the time interval between the beginning of the first stop bit and the next negative edge on CTS. A high-to-low transition has no effect if the transmitter buffer is empty or if the time interval between the beginning of the stop bit and next negative edge is less than 0.75 bits. A high or a low level or a low-to-high transition has no effect on the transmitter for the 0.75 stop bit mode. I/O Transmit Clock: If the baud rate bits in command register 2 are all set to 0, this input clocks data out of the transmitter on the falling edge. If baud rate bits are programmed for 1 or 2, this input permits the user to provide a 32x or 64x clock which is used for the receiver and transmitter. If the baud rate bits are programmed for 3-0FH, the internal transmitter clock is output. As an output it delivers the transmitter clock at the selected bit rate. If 1 Y, or 0.75 stop bits are selected, the transmitter divider will be asynchronously reset at the beginning of each 210907-002 inter AP-153 PIN DESCRIPTIONS (CONTINUED) Symbol Pin No. Type DESCRIPTION OF THE REGISTERS Name and Function start bit, immediately causing a high-to-Iow transition on TxC. TxC makes a high-to-Iow transition at the beginning of each serial bit, and a lowto -high transition at the center of each bit. TxD 23 P27-P20 24-31 PI7-PIO 32-39 o Transmit Data: data output. Serial I/O Parallel 110 Port 2: Eight bit general purpose I/O port. Each nibble (4 bits) of this port can be either an input or an output. The outputs are latched whereas the input signals are not. Also, this port can be used as an 8-bit input or output port when using the two-wire handshake. In the handshake mode both inputs and outputs are latched. I/O Parallel I/O Port 1: Each pin can be programmed as an input or an output to perform general purpose I/O. All outputs are latched whereas inputs are not. Alternatively these pins can serve as control pins which extend the functional spectrum of the chip. GND 20 PS Ground: Power sup"ly and logic ground reference. Vcc 40 PS Power: + 5V power supply. The following section will provide a description of the registers and define the bits within the registers where appropriate. Table 4 lists the registers and their addresses. Command Register 1 I I I I I BRKI I BITI L1 LO 81 (OR) SO 8086 I FRO I (OW) FRQ - Timer Frequency Select This bit selects between two frequencies for the five timers. If FRQ = 0, the timer input frequency is 16KHz (62.5us). If FRQ = I, the timer input frequency is 1 KHz (lms). The selected clock frequency is shared by all the counter/timers enabled for timing; thus, all timers must run with the same time base. 8086 - 8086 Mode Enable This bit selects between 8085 mode and 8086/8088 mode. In 8085 mode (8086 = 0), AO to A3 are used to address the internal registers, and an RSTn instruction is generated in response to the first INTA. In 8086 mode (8086= I), Al to A4 are used to address the internal registers, and AO is used as an extra chip select (AO must equal zero to be enabled). The response to INTA is for 8086 interrupts where the first INTA is ignored, and an interrupt vector (40H to 47H) is placed on the bus in response to the second iNTA, . BITI - Interrupt on Bit Change This bit selects between one of two interrupt sources on Priority Levell, either Counter/Timer 2 or Port 1 P17 interrupt. When this bit equals 0, Counter/Timer 2 will be mapped into Priority Levell. If BITI equals o and Level 1 interrupt is enabled, a transition from 1 to 0 in Counter/Timer 2 will generate an interrupt request on Levell. When BIT! equals I, Port 1 P17 external edge triggered interrupt source is mapped into Priority Levell. In this case if Level 1 is enabled, a . low-to-high transition on P17 generates an interrupt request on Levell. BRKI - Break-In Detect Enable lfthis bit equals 0, Port 1 P16is a general purpose I/O port. When BRKI equals I, the Break-In Detect feature is enabled on Port 1 P16. A Break-In condition is present on the transmission line when it is forced to the start bit voltage level by the receiving station. Port I P16 must be connected externally to the transmission line in order to detect a Break-In. A 6-411 210907-002 AP·153 Table 4. MUART Registers Read Regl.ters Write Registers 8085 8088 Mode: Mode: AD3 AD2 AD1 ADO AD4 AD3 AD2 AD1 L1 I LO I S1 I SO 18AKII 81T11soss1 FAOI Command 1 0 0 0 0 I L1 I LO I S1 I .SO 18AKII 81T1 I sossl FAOI Command 1 . I PEN I EP I C1 I CO I 83 I 82 I 81 I 80 I 0 Command 2 0 0 1 I PEN I EP I C1 I CO I 83 I 82 I 81 I 80 I Command 2 I 0 I AxE I IAE I NIE I 0 IS8AKIT8AKI 0 I 0 Command 3 0 o I SET I AxE I IAE I NIE I END IS8A~T8A3 AST I Command 3 1 T3sl T241 TSC 1 CT31 CT21 P2C21 P2C11 P2coI Mode 0 1 1 T3S1 T241 T5C I CT31 CT21 P2C21 P2C11 P2COj Mode 0 I P171 P1s1 P1s1 P141 P131 P121 P11 I P10 I 0 Port 1 Control 0 o I PHI P1s1 P1s1 P14 1 P131 P121 P11 I P10 I Port 1 Control L7 I LS I LS I L4 I L3 I L2 I L1 I LO 1 0 Interrupt Enable o 1 I L7 I LS I L5 I L4 1 L3 I L2 I L1 Sel"lnterrupts LO I 0 I L7 I LS I L5 I L4 I L3 I L2 I L1 Reset Interrupts LO I I 07 I OS I 05 I 04 I 03 I 02 I 01 I DO I 0 Interrupt Addre•• 1 07 1 OS 1 05 I 04 1 03 1 02 1 01 1 DO "I Receiver Buller ' 1. 0 1 IwlD8ID8I~lool~I~lool Transmitter Buller I 07 I D8 I OS I 04 I 03 I 02 I 01 I 00 I 1 Port 1 o I 07 I OS I 05 I 04 I 03 I 02 I 01 I DO I 1 Port 2 00110710SI051041031021011 00 1 .Port 2 1 07 1 .OS 1 05 1 04 1 03 1 02 I 01 1 DO 1 1 Timer 1 o IWID8ID8I~IOOI~I~lool 1 0 o IWID8ID8I~IOOI~I~lool Timer 1 IWID8ID8I~IOOI~I~lool o Timer 2 Timer 2 I 1 o IwlD8ID8I~IOOI~I~lool 1 o 1 07 1 OS 1 05 I 04 1 03 1 02 1 01 1 DO Timer 3 0 I 07 I OS I 05 I 04 I 03 I 02 I 01 I 00 I Port 1 Timer 4 0 I 07 I OS 1 OS I 04 I 03 1 02 I 01 I 00 1 Timer 3 IWID8ID8I~IOOI~I~lool Timer 4 IWID8ID8I~IOOI~I~ 1001 1 o I 07 1 OS 1 05 I 04 I 03 I 02 I 01 I DO 1 TimerS TimerS liNT I A8F I T8E I TAE I 80 I PE I OE I FE I 1 , StatuI 1 I 0 I RS4 I AS3 I AS2 I AS1 I ASO ITME losc Modification 6-412 I 210907-002 Ap·153 Break·In is polled by the MUART during the transmission of the last or only stop bit of a character. A Break-In Detect is OR-ed with Break Detect in Bit 3 of the Status Register. The distinction can be made through the interrupt controller. If the transmit and receive interrupts are enabled, a Break-In will generate an interrupt on Level 5, the transmit interrupt, while Break will generate an interrupt on Level 4, the receive interrupt. SO, 51 - transmission and reception. In this case, pre scalers are disabled and the input serial clock frequency must match the baud rate. The input serial clock frequency can range from 0 to 1.024 MHz. BO, B1, B2, B3 - These four bits select the bit clock's source, sampling rate, and serial bit rate for the internal baud rate generator. Stop Bit Length 51 o o SO Stop Bit Length 0 I 0 I 1.5 2 I I 0.75 I The relationship of the number of stop bits and the function of input CTS is discussed in the Pin Description section under "CTS". LO, L1 - B3 B2 B1 BO 0 0 0 0 0 0 0 0 0 0 0 0 I I I I 0 0 0 0 I I 1 I 0 0 I I 0 0 I I 0 0 I I 0 0 I I 0 1 0 I 0 I 0 I 0 I 0 I 0 I 0 I Character Length L1 LO o o o Character Length 8 7 1 I I o 6 I 5 Baud Rate Select Baud Rate TxC, RxC TxC/64 TxC/32 19200 9600 4800 2400 1200 600 300 200 150 110 100 75 50 Sampling Rate I 64 32 32 64 64 64 64 64 64 64 64 64 64 64 64 The following table gives an overview of the function of pins TxC and RxC: Command Register 2 IPEN IEP I CI I CO (IR) B3 B2 BI Bits 3 to o (Hex.) BO (lW) o Programming bits O... 3 with values from 3H to FH enables the internal baud rate generator as a common clock source for the transmitter and receiver and determines its divider ratio. 1,2 Programming bits 0 ... 3 with values of IH or 2H enables input TxC as a common clock source for the transmitter and receiver. The external clock must provide a frequency of either 32x or 64x the baud rate. The data transmission rates range from 0 ... 32 Kbaud. 3 to F If bits O... 3 are set to 0, separate clocks must be input to pin RxC for the receiver and pin TxC for the transmitter. Thus, different baud rates can be used for 6-413 TxC Input: I x baud rate clock for the transmitter Input 32 x or 64 x baud rate for transmitter and receiver RxC Input: I x baud rate clock for the receiver Output: receiver bit clock with a low -tohigh transition at data bit sampling time. Otherwise: high level Output: baud rate Output: as above clock of the transmitter As an output, RxC outputs a low-to-high transition at sampling time of evary data bit of a character. Thus, data can be loaded, e.g., into a shift register external- 210907-002 inter AP-153 ly. The transition occurs only if data bits of a character are present. It does not occur for start, parity, and stop bits (RxC = high). As an output, TxC outputs the internal baud rate clock of the transmitter. There will be a highcto-low transition at every beginning of a bit. Bits 4 and 5 define the system clock prescaler divider ratio. The internal operating frequency of 1.024 MHz is derived from the system clock. C1 CO Divider Ratio Clock at Pin ClK 0 0 1 1 0 1 0 1 5 3 2 1 5.12 MHz 3.072 MHz 2.048 MHz 1.024 MHz 1) All bits in the Status Register except bits 4 and 5 are cleared, and bits 4 and 5 are set. 2) The Interrupt Enable, Interrupt Request, and Interrupt Service Registers are cleared. Pending requests and indications for interrupts in service will be cancelled. Interrupt signal INT will go low. 4) If Port 2 is programmed for handshake mode, IBF and OBF are reset high. Even Parity (Bit 6) RST does not alter ports, data registers or command registers, but it halts any operation in progress. RST is automatically cleared. ~ST = 0 has no effect. The reset operation triggered by Command Register 3· is a subset of the hardware reset. Parity Enable (Bit 7) Bit 7 enables parity generation and checking. PEN = 0: No parity bit PEN = 1: Enable parity bit TBRK - The parity bit according to Command Register 2 bit 6 (see above) is inserted between the last data bit of a character and the first or only stop bit. The parity bit is checked during reception. A false parity bit generates an error indication in the Status Register and an Interrupt Request·on Level 4. Command Register 3 Transmit Break The transmission data output TxD will be set low as soon as the transmission of the previous character has been finished. It stays low until TBRK is cleared. The state of CTS is of no significance for this operation. As long as break is active, data transfer from the Transmitter Buffer to the Transmitter Register will be inhibited. As soon as TBRK is reset, the break condition will be deactivated and the transmitter will be reenabled. SBRK - ISET IRxE I IAE INIE IEND ISBRK~BRK IRST I (2R) Reset 3) The receiver and transmitter are reset. The transmitter goes idle (TxD is high), and the receiver enters start bit search mode. EP = 0: Odd parity EP = 1: Even parity PEN - RST - If RST is set, the following events occur: CO, C1 - System Clock Prescaler (Bits 4, 5) EP - Writing a byte with Bit 7 high sets any bits which were also high. Writing a byte with Bit 7 low resets any bits which were high. If any bit 0-6 is low, no change occurs to that bit. When Command Register 3 is read, bits 0, 3, and 7 will always be zero. (2W) Command Register 3 is different from the first two registers because it has a bit set/reset capability. 6-414 Single Character Break This causes the transmitter data to be.set low for one character including start bit, data bits, parity bit, and stop bits. SBRK is automatically cleared when. time for the last data bit has passed. It will start after the character in progress completes, and will delay the next data transfer from the Transmitter Buffer to the Transmitter Register until TxD returns to an idle 210907-002 inter Ap·153 (marking) state. If both TBRK and SBRK are set, break will be set as long as TBRK is set, but SBRK will be cleared after one character time of break. If SBRK is set again, it remains set for another character. The user can send a definite number of break characters in this manner by clearing TBRK after setting SBRK for the last character time. END - P2C2, P2C1', P2CO - Direction Upper Lower P2C2 P2C1 P2CO Mode o 0 0 nibble input input o 0 1 nibble input output o 1 0 nibble output input o 1 1 nibble output output 1 0 0 byte handshake input 0 1 byte handshake output 1 1 1 0 DO NOT USE 1 1 1 test End of Interrupt If fully nested interrupt mode is selected, this bit resets the currently served interrupt level in the Interrupt Service Register. This command must occur at the end of each interrupt service routine during fully nested interrupt mode. END is automatically cleared when the Interrupt Service Register (internal) is cleared. END is ignored if nested interrupts are not enabled. NIE - If test mode is selected, the output from the internal baud rate generator is placed on bit 4 of Port 1 (pin 35). To achieve this, it is necessary to program bit 4 of Port 1 as an output (Port 1 Control Register Bit P14 = I), and to program Command Register 2 bits B3 - BO with a value ~.3H. Nested Interrupt Enable When NIE equals I, the interrupt controller will operate in the nested interrupt mode. When NIE equals 0, the interrupt controller will operate in the normal interrupt mode. Refer to the "Interrupt controller" section under "Normal Mode" and "Nested Mode" for a detailed description of these operations. IAE - RxE - CT2, CT3 - Receive Enable This bit enables the serial receiver and its associated status bits in the status register. If this bit is reset, the serial receiver will be disabled and the receive status bits 'will not be updated. Note that the detection of break characters remains enabled while the receiver is disabled; i.e., Status Register Bit 3 (BD) will be set while the receiver is disabled whenever a break character has been recognized at the receive data input RxD. SET - Note: If Port 2 is operating in handshake mode. Interrupt Level 7 is not available for Timer 5. Instead it is assigned to Port 2 handshaking. Interrupt Acknowledge Enable This bit enables an automatic response to INTA. The particular response is determined by the 8086 bit in Command Register 1. CounterlTimer Mode Bit 3 and 4 defines the mode of operation of event counter/timers 2 and 3 regardless of its use as a single unit or as a cascaded one. If CT2 or CT3 are high, then counter/timer 2 or 3 respectively is configured as an event counter on bit 2 or 3 respectively of Port 1 (pins 37 or 36). The event counter decrements the count by one on each low-tohigh transition of the external input. If CT2 or CT3 is low, then the respective counter/timer is configured as a timer and the Port 1 pins are used for parallel I/O. Bit Set/Reset If this bit is high during a write to Command Register 3, then any bit marked by a high will set. If this bit is low, then any bit marked by a high will be cleared. Mode Register I T35 I T241 T5C I CT31 CT21 P2C21 P2Cli P2COI (3R) Port 2 Control (3W) 6-415 T5C - Timer 5 Control If T5C is set, then Timer 5 can be preset and started by an external signal. Writing to the Timer 5 register loads the Timer 5 save register and stops the timer. A high-to-low transition on bit 5 of Port 1 (pin 34) loads the timer with the saved value and starts the timer. The next high-to-low transition on pin 34 retriggers the timer by reloading it with the initial value and continues timing. Following a hardware reset, the save register is reset to OOH and both clock and trigger inputs are disabled. Transferring an instruction with T5C = 1 enables the trigger input; the save register can now be loaded with 210907-002 AP·153 an initial value. The first trigger pulse causes the initial value to be loaded from the save register and enables the counter to count down to zero. When the timer reaches zero it issues an interrupt request, disables its interrupt level and continues counting. A subsequent high-to-low transition on pin 5 resets Timer 5 to its initial value. For another timer interrupt, the Timer 5 interrupt enable bit must be set again. T35, T24 - Cascade Timers These two bits cascade Timers 3 and 5 or 2 and 4. Timers 2 and 3 are the lower bytes, while Timers 4 and 5 are the upper bytes. If T5C is set, then both Timers 3 and 5 can be preset and started by an external pulse. When a high-to-low transition occurs, Timer 5 is preset to its saved value, But Timer 3 is always preset to all ones. If either CT20r CT3 is set, then the corresponding timer pair is a 16-bit event counter. A summary of the counter/timer control bits is given in Table 5. Note: Interrupt levels assigned to single counters are partly not occupied if event counters/timers are cascaded. Level 2 will be vacated if event counters/timers 2 and 4 are cascaded. Likewise. Level 7 will be vacated if event counters/timers 3 and 5 are cascaded. Single event counters/timers generate an interrupt request on the transition from 01H to OOH, while cascaded ones generate it on the transition from 0001H to ooooH. Table 5. Event CounterslTlmers Mode of Operation Function Programming (Mode Word) Clock Source I 8-bit timer - internal clock 2 8-bit timer 8-bit event counter T24=0, CT2=0 T24=0, CT2= I internal clock P12 pin 37 3 8-bit timer T35=0, CT3=0 8-bit event counter T35 =0, CT3 = I internal clock P13 pin 36 4 8-bit timer T24=0 internal clock T35=0, T5C=0 internal clock 5 8-bit timer, normal mode 8-bit timer, retriggerable mode T35=0, T5C=I internal clock 2 4 cascaded 16-bit timer 16-bit event counter T24=1, CT2=0 T24=1, CT2=I internal clock P12 pin 37 T35=I, T5C=0, CT3=0 T35=I, T5C=0, CT3=I internal clock 3 and 5 cascaded 16-bit timer, normal mode 16-bit event counter, normal mode 16-bit timer, Retriggerable mode T35 = I, T5C = I, CT3=0 internal clock 16-bit event counter, Retriggerable mode T35=I, T5C=I, CT3=l P13 pin 36 Event Counterl Timer and 6-416 P13 pin 36 210907-002 inter Ap·153 Port 1 Control Register I I P17 P161 PIS I P141 P13 I P121 Pll (4R) I I PI0 (4W) Each bit in the Port 1 Control Register configures the direction of the corresponding pin. If the bit is high, the pin is an output, and if it is low the pin is an input. Every Port 1 pin has another function which is controlled by other registers. If that special function is disabled, the pin functions as a general 110 pin as specified by this register. The special functions for each pin are described below. Port 15 - Timer 5 Trigger If T5C is set in the Mode Register enabling a retriggerable timer, then Port 15 is the input which starts and reloads Timer 5. A high-to-Iow transition on PIS (Pin 34) loads the timer with the save register and starts the timer. Port 16 - Break·ln Detect If Break-In Detect is enabled by BRKI in Command Register 1, then this input is used to sense a Break-In. If Port 16 is low while the serial transmitter is sending the last stop bit, then a Break-In condition is signaled. Port 17 Port 10, 11 - Handshake Control Port Interrupt Source If BITI in Command Register 1 is set, then a low-to- If byte handshake control is enabled for Port 2 by the Mode~ister, then Port 10 is programmed as STBI ACK handshake control input, and Port 11 is programmed as IBFIOBF handshake control output. high transition on Port 17 generates an interrupt request on Priority Level 1. If byte handshake mode is enabled for output on Port Interrupt Enable Register Port 17 is edge triggered. 2, OBF indicates that a character has been loaded into the Port 2 output buffer. When an external device reads the data, it acknowledges this operation by driving ACK low. OBF is set low by writing to Port 2 and is reset high by ACK. If byte handshake mode is enabled for input on Port 2, STB is an input. IBF is driven low after ffi goes - low. On the rising edge of STB the data from Port 2 is latched. IBF is reset high when Port 2 is read. Port 12, 13 - Counter 2, 3 Input If Timer 2 or Timer 3 is programmed as an event counter by the Mode Register, then Port 12 or Port 13 is the counter input for Event Counter 2 or 3, respectively. Port 14 - Baud Rate Generator Output Clock If test mode is enabled by the Mode Register and Command Register 2 baud rate select is greater than 2, then Port 14 is an output from the internal baud rate generator. P14 in Port 1 control register must be set to 1 for the baud rate generator clock to be output. The baud rate generator clock is 64 x the serial bit rate except at 19.2Kbps when it is 32 x the bit rate. L7 I L6 1 L5 1 L4 1 L3 1 L2 1 Ll (5R) (5W = enable, 6W = disable) LO Interrupts are enabled by writing to the Set Interrupts Register (5W). Interrupts are disabled by writing to the Reset Interrupts Register (6W). Each bit set by the Set Interrupts Register (5W) will enable that level interrupt, and each bit set in the Reset Interrupts Register (6W) will disable that level interrupt. The user can determine which interrupts are enabled by reading the Interrupt Enable Register (5R). Priority Highest LO Ll L2 L3 L4 L5 L6 Lowest L7 Source Timer 1 Timer 2 or Port Interrupt External Interrupt (EXTINT) Timer 3 or Timers 3 & 5 Receiver Interrupt . Transmitter Interrupt Timer 4 or Timers 2 & 4 Timer 5 or Port 2 Handshaking Interrupt Address Register o (6R) 6-417 o o D4 0310210101 Interrupt Level Indication 2 210907·002 int~:f Ap·153 Reading the interrupt address register transfers an identifier for the currently requested interrupt level on the system data bus. This identifier is the number of the interrupt level multiplied by 4. It can be used by the CPU as an offset address for interrupt handling. Reading the interrupt address register has the same ef· fect as a hardware interrupt acknowledge INTA; it clears the interrupt request pili (INT) and indicates an interrupt acknowledgement to the interrupt controller. 1 05 \04 (7R) 07 06 05 04 03 (9R) 02 01 00 (9W) Writing to Port 2 sets the data in the Port 2 oiltput latch. Writing to an input pin does not affect the pin, but it does store the data in the latch. Reading Port 2 puts the input pins onto the bus or the contents of the output latch for output pins. Timer 1·5 Receiver and Transmitter Buffer 07 1 06 Port 2 I I 00 07 D3 \ 02 01 (7W) Both the receiver and ,transmitter in the MUART are double buffered. This means that the transmitter and receiver have a shift register and a buffer register. The buffer registers are directly addressable by reading or writing to register seven. After the receiver buffer is full, the RBF bit in the status register is set. Reading the receive buffer clears the RBP status bit. The transmit buffer should be written to only if the TBE bit in the status register is set. Bytes written to the transmit buffer are held there until the transmit shift register is empty, assuming CTS is low. If the transmit buffer and shift register are empty, writing to the transmit buffer immediately transfers the byte to the transmit shift register. If a serial character length is less than 8 bits, the unused most significant bits are set to zero when reading the receive buffer, and are ignored when writing to the transmit buffer. I 06 I 05 04 03 02 D1 00 Reading Timer N puts the contents of the timer onto the data bus. If the counter changes while RO is low, the value on the data bus will not change. If two timers are cascaded, reading the high-order byte will cause the low-order byte to be latched. Reading the low-order byte will unlatch them both. Writing to either timer or decascading them also clears the latch condition. Writing to a timer sets the starting value of that timer. If two timers are cascaded. writing to the high-order byte presets the low-order byte to all ones. Loading only the high-order byte with a value of X leads to a count of X 256+255. Timers count down continuously. If the interrupt is enabled, it occurs when the counter changes from 1 to o.. The timer/counter interrupts are automatically disabled when the interrupt request is generated. Status Register I lINT RBF 1TBE 1TRE 1 BO 1 PE (OF I6 R) Port 1 07 1 061 05 \ 04 \ 03 (8R) 02 01 00 (8W) Writing to Port I sets the data in the Port 1 output latch. Writing to an input pin does not affect the pin, but the data is stored and will be output if the direction of the pin is changed later. If the pin is used as a control signal, the pin will not be affected, but the data is stored. Reading Port 1 transfers the data in Port 1 onto the data bus. 6-418 OE FE Reading the status register gates its contents onto the data bus. It holds the operational status of the serial interface as well as the status of the interrupt pin INT. The status register can be read at any tiIne. The flags are stable and well defined at all instants. FE - Framing Error, Transmission Mode Bit 0 can be used in two modes. Normally, FE indicates framing error which can be changed to transmission mode indication by setting the TME bit in the modification register. 210907-002 inter AP·153 If transmission mode is disabled (in Modification Register), then FE indicates a framing error. A fram. ing error is detected during the first stop bit. The error is reset by reading the Status Register or by a chip reset. A framing error does not inhibit the loading of the Receiver Buffer. If RxD remains low, the receiver will assemble the next character. The false stop bit is treated as the next start bit, and no high-to-low transition on RxD is requied to synchronize the receiver. When the TME bit in the Modification Register is set, FE is used to indicate that the transmitter was active during the reception of a character, thus indicating that the character received was transmitted by its own transmitter. FE is reset when the transmitter is not active during the reception of character. Reading the status register will not reset the FE bit in the transmission mode. OE - Overrun Error If the user does not read the character in the Receiver Buffer before the next character is received and transferred to this register, then the OE bit is set. The OE flag is set during the reception of the first stop bit and is cleared when the Status Register is read or when a hardware or software reset occurs. The first character received in this case will be lost. PE - Parity Error This bit indicates that a parity error has occurred during the reception of a character. A parity error is present if value of the parity bit in the received character is different from the one expeCted according to command word 2 bits 6 EP. The parity bit is expected and checked only if it is enabled by command word 2 bit 7 PEN. A parity error is set during the first stop bit and is reset by reading the Status Register or by a chip reset. BO - Break/Break·ln The BD bit flags whether a break character has been received, or a Break-In condition exists on the transmission line. Command Register 1 Bit 3 (BRKI) enables the Break-In Detect function. Whenever a break character has been received, Status Register Bit 3 will be set and in addition an interrupt request on Level 4 is generated. The receiver will be idled. It will be started again with the next high-to-low transition at pin RxD. The break character received will not be loaded into the receiver buffer register. If Break-In Detection is enabled and a Break-In condition occurs, Status Register Bit 3 will be set and in addition an interrupt request on Level 5 is generated. The BD status bit will be reset on reading the status register or on a hardware or software reset. For more information on Break/Break-In, refer to the "Serial Asynchronous Communication" section under "Receive Break Detect"and "Break-In Detect." TRE - Transmit Register Empty When TRE is set the transmit register is empty and an interrupt request is generated on Level 5 if enabled. When TRE equals 0 the transmit register is in the process of sending data. TRE is set by a chip reset and when the last stop bit has left the transmitter. It is reset when a character is loaded into the Transmitter Register. If CTS is low, the Transmitter Register will be loaded during the transmission of the start bit. If CTS is high at the end of a character, TRE will remain high and no character will be loaded into the Transmitter Register until CTS goes low. If the transmitter was inactive before a character is loaded into the Transmitter Buffer, the Transmitter Register will be empty temporarily while the buffer is full. However, the data in the buffer will be transferred to the transmitter register immediately and TRE will be cleared while TBE is set. TBE - Transmitter Buffer Empty TBE indicates the Transmitter Buffer is empty and is ready to accept a character. TBE is set by a chip reset or the transfer of data to the Transmitter Register, and is cleared when a character is written to the transmitter buffer. When TBE is set, an interrupt request is generated on Level 5 if enabled. RBF - Receiver Buffer Full RBF is set when the Receiver Buffer has been loaded with a new character during the sampling of the first stop bit. RBF is cleared by reading the receiver buffer or by a chip reset. INT - Interrupt Pending The INT bit reflects the state of the INT Pin (Pin 15) and indicates an interrupt is pending. It is reset by INTA or by reading the Interrupt Address Register if only one interrupt is pending and by a chip reset. 6-419 210907-002 Ap·153 FE, DE, PE, RBF, and Break Detect all generate a Level 4 interrupt when the receiver samples the first stop bit. TRE, TBE, and Break-In Detect generate a Level 5 interrupt. TRE generates an interrupt when TBE is set and the Transmitter Register finished transmitting. The Break-In Detect interrupt is issued at the same time as TBE or TRE. RS4 RS:l RS2 RS1 RS(] Point of time between start of bit and end of bit measured in steps of 1/32 bit length 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Modification Register I 0 I RS4 I RS3 I RS21 RSI I RSO ITME IDSC I (OF16W) esc - Disable Start Bit Check DSC disables the receiver's start bit check. In this state the receiver will not be reset if RxD is not low at the center of the start bit. TME - Transmission Mode Enable TME enables transmission mode and disables framing error detection. For information on transmission mode see the description of the framing error bit in the Status Register. RSO, RS1, RS2, RS3, RS4 - Receiver Sample Time The number in RSn alters when the receiver samples RxD. The receiver sample time can be modified only if the receiver is not clocked by RxC. Note: The modification register cannot be read. Reading from address OFH, 8086: lEH gates the contents of the status register onto the data bus. - A hardware reset (reset, Pin 12) resets all modification register bits to 0, i.e.: * The start bit check is enabled. * Status Register Bit 0 (FE) indicates framing error. * The sampling time of the serial receiver is the bit center. A reset signal on pin RESET (HIGH level) forces the device 8256 into a well-defined initial state. This state is characterized as follows: 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 (Start of Bit) 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 (Bit center) 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 (End of Bit) 1) Command registers 1, 2 and 3, mode register, Port 1 control register, and modification register are reset. Thus, all bits of the parallel interface are set to be inputs and event counters/timers are configured as independent 8-bit timers. A software reset (Command Word 3, RST) does not affect the modification register. Hardware Reset 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 2) Status register bits are reset with the exception of bits 4 and 5. Bits 4 and 5 are set indicating that both transmitter register and transmitter buffer register are empty. 6-420 210907-002 Ap·153 3) The interrupt mask, interrupt request, and inter· rupt service register bits are reset and disable all reo quests. As a consequence, interrupt signal INT is inactive (LOW). 4) The transmit data output is set to the marking state (HIGH) and the receiver section is disabled until it is enabletl by Command Register 3 Bit 6. 5) The start bit will be checked at sampling time. The receiver will return to start bit search mode if input RxD is not LOW at this time. Figure 16 shows the 8256 interfaced with an 8086 in the min mode. When the 8256 is in the 16-bit mode, AO serves as a second chip select. As a result the MUART's internal registers will all have even ad· dresses since AO must be zero to select the device. Normally the MUART will be placed on the lower data byte. If the MUART is placed on the upper data byte the internal registers will be 512 address locations apart and the chip would occupy an 8 K word address space. Figure 16A shows a table and a diagram of how the 8256 may be selected in an 8086 system where the MUART is I/O mapped and used on the lower byte of the address/data bus. 6) Status Register Bit 0 implies framing error. PROGRAMMING 7) The receiver samples input RxD at bit center. Initialization Reset has no effect on the contents of receiver buffer register, transmitter buffer register, the intermediate latches of parallel ports, and event counters/timers, respectively. INTERFACING This section describes the hardware interface between the 8256 MUART and the 8085, 8086,8088, and 80186 microprocesors. Figures 14 through 19 display the block diagrams for these interfaces. The MUART can be interfaced to many other microprocessors using these basic principles. In all cases the 8256 will be connected directly to the CPU's multiplexed address/data bus. If latches or data bus buffers are used in a system, the MUART should be on the microprocessor side of the ad· dress/data bus. The MUARTlatches the address in· ternally on the falling edge of ALE. The address con· sists of Chip Select (CS) and four address lines. For 8·bit microprocessors, ADO·AD3 are the address lines. For 16-bit microprocessors, ADI-AD4 are the address lines; ADO is used as a second chip select which is active low. Since chip select is internally latched along with the address, it does not have to remain active during the entire instruction cycle. As long as the chip select setup and hold times are met, it can be derived from multiplexed address/data lines or multiplexed address/status lines. In Figure 15, the 8088 min mode, the 8205 chip select decoder is connected to the 8088's address bus lines A8-AI5. These address lines are stable throughout the entire instruction cycle. However, the MUART's chip select signal could have been derived from A1'6/S3AI9/S6. In general the MUART's functions are independent of each other and only the registers and bits associated with a particular function need to be initialized, not the entire chip. The command sequence is arbitrary since every register is directly addressable; however, Command Word 1 must be loaded first. To put the device into a fully operational condition, it is necessary to write the following commands: Command byte 1 Command byte 2 Command byte 3 Mode byte Port 1 control Set Interrupts The modification register may be loaded if required for special applications; normally this operation is not necessary. It is a good idea to reset the part before initialization. (Either a hardware or a software reset will do.) Operating the Serial Interface The microprocessor transfers data to the serial interface by writing bytes to the Transmit Buffer Register. Receive characters are transferred by reading the Receiver Buffer Register. The Status Register provides all of the necessary information to operate the serial I/O, including when to write to the Transmit Buffer, and when to read the Receive Buffer and error information. Transmitting The transmitter and the receiver may be operated by using either polling or interrupts. If polling is used. then the software may poll the Status Register and write a byte to the Transmit Buffer whenever TBE = 1. Writing a byte to the Transmit Buffer clears the TBE 6-421 210907-002 AP·153 vfs v~c pD~ ::: =: X, TRAP RST 7.5 RST8.5 RST 5.5 ~ RESET IN X, HOLD HlDA SOD Sf. 8085A So 'cr Q ~ 10 M cr ~~~~ Q Q r~ € Q Q Iii WJi ALE C K :;::: ::: ~~~E~T mn IL~ i CC ::; 8205 DECODER RxD RESET Til:! CC ClK 1m € WR IfIj ALE I RiC I TxD ~}Serl t=, Port 1 (8) ) Part 2 (8) .....~ ADO·AD4 DB5·DB7 .................... L-- CS EXTINT r-r.J 8282 lATCH ~ VCC cc .t ~ Q al,IIO - ClND t € € TO NON·MUlTIPlEXED PERIPHERALS Figure 14. 8085/8256 Interface status bit. If the CTS pin is low, then the Transmit Buffer will transfer the data to the Transmit Register when it becomes empty. When this transfer takes place the TRE bit is reset, and the TBE bit is set indicating th~xt byte may be written to the Transmit Buffer. If CTS is high, disabling the transmitter, the data byte will remain in the Transmit Buffer and TBE . will remain low until CTS goes low. The transmitter can only buffer one byte if it is disabled. byte must be written to the Transmit Buffer. After the first byte has been written to the Transmit Buffer, a transmit interrupt· request will occur, providing the transmitter is enabled. There is no· way of knowing that the transmitter is disabled unless the CTS signal is fed into one of the 1/0 ports. Using the transmitter interrupt will free up the CPU to perform other functions while the transmitter is disabled or while the Transmit Buffer is full. To enable the transmit interrupt feature Bit LS in the Set Interrupt Register must be set. An interrupt request will not occur immediately after this bit has been set. Before any transmit interrupt request will occur a 6-422 There are three sources of transmitter interrupt requests: TBE=l, TRE=l, and Break-In Detect. Assuming the Break-In Detect feature is disabled, after the transmit interrupt is enabled and the first byte is written, a transmit interrupt request will be generated by TBE going active. The microprocessor can immediately write a byte to the Transmit Buffer without reading any status. However if Break-In Detect is enabled, the Status Register must be read to determine whether the transmit interrupt request was generated by Break-In Detect or TBE. The TRE interrupt request can be used to indicate when the transmitter has completely sent all of the data. For example, using half-duplex communica- 210907-002 inter Ap·153 1 A,oA15 r-- ADg-AD r ClK ADDR 01111111 R II1111 ADDR/DATA MN/MX r-VCC ,..- READY 8088 ~ ClK READY RES RESET X, .s-r- PORT1~ ADO·AD4 D5·D7 ALE RD WR 101M INTR INTA A"/S3·A"/S6 - L-~ PORT 2 <::=:::> TxC RxC 8256 TxD RxD INTA CTS INTR RESET WR ~ SERI AlliO RD ALE ClK RESET EXTINT ~ X, 0 v 'v Figure 15. 8088 Min Mode/8256 Interface Multiplexed Bus tions, all of the data written to the MUART must be transmitted before the line can be turned around. After the last byte is written, an interrupt request will be generated by TBE. If this interrupt is acknowl· edged without writing another byte, then the next transmitter interrupt request, TRE = 1, will indicate that the transmitter is empty and the line may be turned around. RECEIVING Valid data may be read from the Receive Buffer whenever the RBF bit in the Status Register is set. Reading the Receive Buffer resets the RBF status bit. The RBF bit in the Status Register can be used for polling. When the RBF bit is set, the three receive status bits, PE, OE, and FE are updated. These three status bits are reset when they are read. Therefore when the status register is read with RBF set, the three error status bit should be tested too. If interrupts are used for serial receive data, the receiver must be enabled by setting the RxE bit in Command Register 3, and Bit L4 must be set in the Set Interrupt Register. When the receive interrupt request occurs the Receive Buffer may be read, but the status register should also be read since the receive interrupt could have been generated by the Break Detect. Also, reading the status register will indicate whether there were any errors in the received character. Operating the Parallel Interface Data can be transferred to or read from Port 1 and Port 2 by using the appropriate write and read opera· tions. LOADING PORT 1 and PORT 2 Writing to the ports transfers the data present on the data bus into the output latches. This operation is in· dependent of the programmed I/O characteristics of the individual port pins. Writing to control or input ports has no effect on the state of the pins. Pins de· fined as outputs immediately assume the state which is associated with the transferred data. If inputs or con· trol pins are reprogrammed into outputs, they assume the states stored in their output latches which were transferred by the most recent port write operation. 210907-002 Ap·153 rD~ 8284 CLOCK GENERATOR RES ~ MN/MX !-Vcc M/Rl AD RESET ..... ClK ...... READY WR INT f---L. f---I-I ---, I I INTA ALE DT/R DEN L I---'n-'I 8086 STS I: :I AD o-AD I5 8282 ,," Au-AI' ~DRlDATA - I-- BHE II' I',I II II II I III : :II " ) ADDR lATCH 2 OR 3 OE ~ [-=----' ----'1 8286 'I" :I (16)~ ~ : I I TRANS I CEIVER I I (2)11 OE ') II j-II-iJOi>iiONAl I CS ALE INTA INT WR I . DATA IT L'C-:.::.:: I ______ ' (8) ADDR/DATA RD RESET ClK S T PORT 1 8256 AD o·AD4 D5,D7 PORT 2 CTS TxD RxD. TxC RxC EXTINT ~ SERIAL 110 Figure 16. 8086 Min Mode/8256 Interface MUART.... BHE A. CHARACTERISTICS 0 0 1 0 1 1 WHOLE WORD UPPER BYTE FROMITO ODD ADDRESS LOWER BYTE FROMITO EVEN ADDRESS NONE ADDRESS M/iO BHE 1 0 • A.-A, 8205 ~ E, E, E, tpr 0, VEN ADDRESS BYTE PERIPHERALS 1/0 MAPPED 0, Figure 16a. Technique for Generating the MUART's Chip Select 6-424 210907-002 AP-153 ~ I--;:;;;5i~~---lL g?KNTROllER 8288 BUS I ~ ~~M'k!t="====:~? ~ READY S, RES 8284A ~RESET C~ GENERATOR S, ~~~!~~CO~M~M~A~N~D~BU~S~~~~~~~~~~~E~ ,~ ~ il5RC ~, r - - DEl'J. rr'lTl' ~ 8088 CPU L STB rnr :£~! k1~==~~...... 8~~3 ...... 8282 ..;~+ RIIE,s 1BL I~ IMEMORY PERIPHERA lL-L~r-,7,--..,.1 DATA DATA ~ T 8286 OR 8287 n n I 8205 I DECODER DATA B S OE RESET ClK PORT1 1 INT ALE AD,·AD, 0,·0, 8256 CSWRRDINTA PORT2 TxC RxC TxD RxD CTS EXTINT Q D l~ Figure 17. 8088 Max Mode/8256 Interface READING PORT 1 AND PORT 2 Reading the ports gates the state at the pins onto the data bus if they are defined as 110 pins. A read operation transfers the contents of the associated output latches of pins PI2,.PI3, PIS, and P16, which are defined as control function pins. Reading control pins PIO, Pll, and PI7 delivers the state of these pins. Operating the Event CounterslTimers The event counters/timers can be loaded with an initial value at any time. Reading event counters/timers is possible without interfering with the counting process. LOADING EVENT COUNTERSITIMERS Loading event counters/timers 1-5 under their respective addresses transfers the data present on the data bus as an initial value into the addressed event counter/timer. The event counter/timer counts from the new initial value immediately following the data transfer (exception: retriggerable mode of Timer 5, or 3 and 5) Cascaded counters/timers can be loaded with an initial value using one of two procedures: . 1) Only the event counter/timer representing the most significant byte will be loaded. The event counter/timer representing the least significant byte is set to OFFH automatically. Counting is started immediately after the data transfer. 2) The event counter/timer representing the most significant byte will be loaded, causing the least significant byte to be set to OFFH automatically. Counting is started immediately following the. data transfer. Next, the counter representing the least significant byte will be loaded and counting is started 6-425 210907-002 Ap·153 rml ~CLK .... MN/Ml' I--GND S, S, S, 8284 RESET CLOCK GENERATOR f-- READY ... rINTR IL 8086 CLK MRDC S, ~ ADo·AD H Au·Au S, S, DEli DT/R ALE MWTC AMWC iOIiC f-i .JQWk [i AI~ JmA r--§I.B OE 8282 LATCH (2 OR 3) , I I I AD W BHE ~ 8286 TRANS· CEIVERS (2) T LA BE Ilr - J ADDRIDATA ALE INT INTA WR AD o·AD 4 CTS RD CS CLK 8256 D~·D1 TxD RxD RESET PORT1 TxC RxC EXTINT PORT2 ~'I ~ SERIAL 110 Figure 18. 8086 Max Mode/8256 Interface again, but this time with a complete 16-bit initial value. The least significant byte of the initial value must be transferred before the counter representing the least significant byte exhibits its zero transition to prevent the most significant byte of the initial value from being decremented improperly. In the case of an 8-bit initial value for Timer 5 or for cascaded Event Counter/Timer 3 and 5, the initial value for Timer 5 is loaded from a save register, if it is operated in retriggerable counting mode. Counting is started after an initial value has been transferred whenever a high-to-low transition occurs on Port P15. Cascaded Event Counter/Timer 3 and 5 operating in retriggerable counting mode can be loaded directly with an initial value for Timer 5 representing the most significant byte; Event Counter/Timer 3 will be set to OFFH automatically. ' READING EVENT COUNTERSITIMERS Reading event counters/timers 1-5 from their respective addresses gates ,the counter contents onto the data bus. The counter contents gated onto the data bus remain stable during the read operation while the counter just being read continues to count. The minimum time between the two read operations from the same counter is I usec. The procedure to be followed when reading cascaded event counters/timers is: I) The event counter/timer representing the most significant byte will be read first. At this time, the least significant byte is latched into read latches. 2) When the event counter/timer representing the least significant byte is addressed, the byte stored in the read latches will be gated onto the data bus. The value stored in the read latches remains valid until it is read, the cascading condition is removed, or a write 6-426 210907-002 inter AP·153 16 MHz VCC !.[i . rm., x, X, RESET iiii RES WR INTO +5V _ SRDY INTAO ALE NMI f"" HOLD f"" 80186 DTlii L-.~ DEN 8282 lATCH (2) OE ADo·AD" ~.ADDRIDATA PCSO > ADDRESS ~ 8286 TRCVR - .1:ro- ) DATA (161 (2) OE I II ~GENERATOR CLOCK ALE INTA INT ADo·AD. 0,-0. (8) RD RESET WR 8256 CS CTS TxD t ! RxD TxC t , ClK PORT1 PORT2 RxC EXTINT J ~ f '(ij) ~ (8) ) "" SERIAL 110 Figure 19. 80186/8256 Interface operation affecting one of the two counters/timers is executed. event The time between reading the most significant byte and the least significant byte must be at least 1 usec. Note: For cascaded event counters/timers the least significant counter/timer is latched after reading the most significant counter/timer. If the lower byte changes from OOH to OFFH between the reading of the MSB and the latching of the LSB, the carry from the most significant event counter/timer to the least significant event counter/timer is lost. Therefore, it is necessary to repeat the whole reading once if the value of the least significant event counter/timer is OFFH. Doing this will avoid working with a wrong value (correct value + 255). APPLICATION EXAMPLE This section describes how the 8256 was designed into a Line Printer MUltiplexer (LPM). This application example was chosen because it employs a majority of the MUART's features. The information in this section will be applicable to many other designs since it describes some common software and hardware aspects of using the MUART. Description of the Line Printer Multiplexer (LPM) The Line Printer Multiplexer allows up to eight workstations to share one printer. The workstations transmit serial asynchronous data to the LPM. The LPM receives the serial data, buffers it, then transmits 6-427 210907-002 Ap·153 Workstations Une Printer Figure 20. Using the Line Printer Multiplexer to Share a Line Printer it to the line printer using a two-wire byte handshake Dataproducts interface. A conceptual diagram of this system is shown in Figure 20. Note that only one workstation can transmit at a time. This workstation will transmit its entire file before another workstation· will be allowed to transmit. The LPM sequentially polls each of the eight RS-232 ports for a Request To Send (RTS). When it finds a serial port which has asserted RTS, it configures itself for the appropriate data format and bit rate, establishes the connection and sends back to the serial port a Clear To Send (CTS) which enables transmission. The LPM receives the serial asynchronous data, buffers it ina software FIFO, and transmits the data to the line printer. If the LPM detects an error in any ofthe serial characters it receives, it transmits an error message to the serial port and ignores the bad character. If the LPM does not receive a serial character after 18 seconds, it assumes that the transmission is complete. It transmits the final status to the serial port, and returns to scanning. This LPM was designed to be used with single-user workstations and a 300 lines per minute line printer. These workstations are not multitasking; therefore in the middle of a file transfer when the CPU needs to reload its buffer from the disk, no serial data is transmitted. During this time the LPM is emptying its FIFO; thus, the line' printer never stops printing. The buffer size on the LPM was chosen to complement the disk access time on the workstations. Figure 21 illustrates the buffer size calculation. The line printer can print up to 300 lines per minute, or approximately 660 characters per second. This corresponds to a serial transmission rate of 6,600bps (assuming ASCII character codes and a parity bit) as shown in equation 1. (1) Serial bit rate = (300 Iines/min)·(l32 char/line)·(lObits/char) for the line printer (60 sec/min) The bottleneck in this data transfer is the line printer . since the MUART and the workstations can both transmit and receive at 19.2Kbps. To realize the maximum data transfer rate of this system the LPM must guarantee that the average transfer rate to the line printer is 660 characters per second. The maximum amount of dead time that the serial port on the workstation is not transmitting, multiplied by 660 is the number of bytes which the LPM should buffer. It was determined through experimentation that it takes about 3 seconds to load 40K bytes of data from the , disk into the workstation's RAM. During these 3 seconds no serial data is being sent; therefore the buffer size on the LPM should be 2K bytes; (Note: even though only a 2K byte FIFO is required, this design used an 8 Kbyte FIFO.) To keep the LPM's buffer full the serial data rate must be greater than 6.6Kbps. The two bit rates which the 6-428 210907-002 inter Ap·153 LINE PRINTER Q ~ 9,600 BPS OR LPM iii 19,200 BPS . ;).:_ ... i ~ 660CHAR/SEC= ~~ 6,600 BPS 300 LINES/MIN Figure 21. LPM Buffer Size Calculation UPPER NIBBLE FIRST BYTE L 1 LO 0 0 1 0 0 1 0 0 8·BIT 7 6 5 LOWER NIBBLE SECOND BYTE I X x I x X B3 I I B2 B1 I BO ~ BAUD RATE SELECT B3 B2 B1 BO o 0 0 0 o o o o 0 0 0 0 1 1 1 0 1 o o 1 1 0 0 0 1 1 1 0 1 1 1 1 1 1 0 0 0 0 0 1 0 1 0 o 1 0 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 0 1 1 BIT RATE DO NOT USE DO NOT USE DO NOT USE 19200 9600 4800 2400 1200 600 300 200 150 110 100 75 50 Figure 22. Programming Words Format for LPM workstations use are 9.6Kbps and 19.2Kbps. The CTS signal is used to control the flow of the serial data so that the LPM buffer will not overflow. Each serial port on the LPM can have a different bit rate, character length, and parity format. These parameters are programmable through the serial port. When the LPM powers up, or is reset, it expects a bit rate of 9600 bps, 7 bit characters, and odd parity. 6-429 When a serial port receives an ASCII ESC character (lBH), it puts that port in the program mode. The next two bytes will program these three parameters. Only the lower nibbles of these two bytes are used, and the upper nibbles are discarded. The format of these programming words is given in Figure 22. If the word following the ESC is an ASCII NUL (0), the LPM will exit from the programming mode and not change any of its parameters. 210907-002 inter Ap·153 Description of the Hardware Figure 23 shows a block diagram of the LPM. In addition to the standard components of most microprocessor systems such as CPU, RAM, and ROM this particular design requires a UART, timers, parallel I/O and an interrupt controller. The MUART is the ideal choice for this design since it integrates these four functions onto one device. The eight serial I/O ports use four signals: Transmit Data (TxD), Receive Data .@1f.D), Request To Send (RTS); and Clear To Send (CTS). These four signals, controlled by the MUART, are connected toone port at a time using TTL mUltiplexers. The TTL multiplexers are interfaced to RS-232 transceivers to be electrically compatible with the RS-232 spec. The serial port select address is derived from three bits of the MUART's parallel I/O port (Port 1). Two more bits from Port i control CTS and RTS, and another bit lights up an LED to indicate when the LPM's buffer is full. Parallel Port 2 and two bits from Port 1 are connected to the line printer implementing a two-wire byte handshake transfer. These signals are passed through a line driver so that they can reliably drive a long cable. There are three timing functions needed for the LPM: a scan timer, a debounce timer, and a recieve timeout. The Scan timer determines the amount of time spent sampling RTS on each port before the next port is addressed. By using one of the MUART's timers to do this function, the CPU is free to perform other functions instead of implementing the timer in software. If RTS is recognized as true, the CPU branches into a debounce procedure. This procedure uses another one of the MUART's timers to wait 10 msec then sample RTS again, thus preventing any glitches from registering as a false RTS. The receive timeout timer uses two 8-bit timers in the cascaded mode to measure an 18-second interval. After a valid RTS is recognized, r---------- ----------l I I I I I I I L c=J e---.; c......J ~. e---.; c=J c=; C........J Serial 1;===:::-t~==~1-;===:::-t~==::;-ll/o porls Figure 23. Functional Block Diagram of the Line Printer Multiplexer 6-430 210907-002 AP-153 the LPM sends back a CTS and initializes the receive timeout timer for 18 seconds. Each time a character is received by the LPM, this timer is reinitialized. If this timer times out, the LPM considers the transmission complete and returns to scanning. registers occupy even addresses from 0 to IEH. Using an 8088 CPU the MUART must be placed in the 8086 mode since the INTA signal is used; hence the register addresses are all even numbers. The line printer used provides a choice of two standard parallel interfaces: Centronics or Dataproducts. The schematic diagram of the LPM is shown in Figure 24. The CPU is an 8088 used in the min mode. It is inThe Centronics interface uses a two-wire handshake pulsed strobe where the transmitter asserts a complete terfaced directly to the 8256. An 8282 latch is employed in the system so that nonmultiplexed bus strobe pulse before an acknowledge is received. The Dataproducts interface is an interlocking two-wire memory can be used. A 2716 holds the entire prohandshake. The Dataproducts interface was chosen gram, and six 2016s (2K x 8 static RAMs) are used to store the buffer, temporary data, stack area, and insince it is directly compatible with the MUART's terrupt vector table. The 2716 is located in the upper two-wire byte handshake. The MUART could also be 2K of the 8088 address space (FF800- FFFFFH) so that connected to the Centronics interface; however, addithe reset vectors can be stored starting at location tional hardware would be necessary to generate the pulsed strobe for correct interrupt operation. Figure FFFFOH. The RAM address space spans 0-2FFFH so that the interrupt vector table can be stored starting at 25 shows the timing of the Dataproducts interface and location O. The MUART is I/O mapped and its Table 6 lists the connector pin configuration. Table 6_ Dataproducts Interface Line Functions Connector Pin Signal Description Data Request Sent by printer to synchronize data transmission. When true, requests a character. Remains true until Data strobe is received, then goes false within 100 nsec. E(return C) Data Strobe Sent by user system to cause printer to accept information on data lines. Should remain true until printer drops Data Request line. Data lines must stabilize for at least 50 nsec before Data Strobe is sent. j(return m) Data Bit I Data Bit 2 Data Bit 3 Data Bit 4 Data Bit 5 Data Bit 6 Data Bit 7 Data Bit 8 Bit 8 controls optional character set Refer to Commands and Formats. B(return D) F(return J) L(return N) R(return T) V(return X) Z(return b) n(return k) h(return e) Optional control from user system. Used for VFU control. Data Request/Strobe timing is same as for data lines. p(return s) Sent to user system by printer. True when !Io Check condition exists. CC(return EE) On Line Sent to user system by printer. True when. Ready line is true and operator has activated ON LINE Pushbutton. Enables interface activity. y(return AA) Interface Verify Jumper in printer connector. Continuity informs user system that connector is properly seated. x to v Supply voltage for Exerciser only. HH VFU Control (PI) Ready +5V 6-431 210907-002 Ap·153 e.10&4MHr SYSTEM RESET .r .,. IN .-l. 0-,,"',""-..,......, ' -_ _ _ _ _ _ _ _ _ _ _ _ _ _..!''j'RST 8256 ~~~~":'NT 14i1lTi ALE llWii lORD 13 Ci P11 32 Pili P15 P,4 P13 33 34 35 38 P12 31 P1, 31 Pl0 39 .., TO 2121(F) TO 2128(E) TO 2121(D) I I I TYPICAL OF6 2Kd STATIC I I RAMS, 2011(A) THAU I 201~f) TO 2121(C) TO 2121(8) Figure 24. Schematic of LPM 6-432 210907-002 inter Ap·153 "11, . ~713';" 5 8205 t4' " 11\ ~l 11( HIlI( ~L -:- :~ 1314 lK 11\ 11\ 11\ • L~ l~ LE.O Figure 24. Schematic of LPM (Continued) 6-433 210907-002 AP-153 ~~I------------------------------~U READ~' ON·lINE ,......_ _~,I-' i+.......,--------2~ SEC MIN -----------1•• _ -_100NSEC L _______________ ,DATA REQUEST ~ :1 1 ~1,----, , DATA LINES 1 THROUGH 8 & Pl I ~ ~ 50 N~EC MIN _______. . . . ________I~IIYL / ' \~---'---- DATA STROBE Figure 25. Timing of Dataproducts Interface Only ten signals are used to interface the LPM to the line"printer: Data Request, Data Strobe, and the eight data lines. The most. significant data line is' not used since the character code is 7-bit ASCII. Data Strobe connects to OBF on' the MUART; however, for the Dataproducts interface this signal must be inverted. Data Request is connected to ACK on the MUART. When the line printer is ready to accept data, the Data Request signal goes high. The 8256 will not interrupt 'the CPU to transmit parallel data unless this signal is high. connected above are interrupt procedures. They are entered when the MUART interrupts the CPU and vectors an indirect address to it. The LPM program uses nested interrupts; the priority of the interrupt procedures is given in Table 7. Table 7. Line Printer Multiplexers' Interrupt Priority Priority Highest 0 1 The Dataproducts interface is slightly different from the MUART's two-wire handshake in that it latches the data on the leading edge of the strobe signal. When the MUART receives bytes it latches the data on the trailing edge. As a result the Dataproducts interface has a 50 nsec setup time for data stable to the leading edge of Data Strobe. In the LPM hardware a delay line was used to realize this setup time. Description of the Software The software is written in PL/M and is broken up into four separate modules, each containing several procedures. A block diagram of the software structure is given in Figure 26. The modules are identified by the dotted boxes, and the procedures are identified by the solid boxes. Two or more procedures connected by a solid line means the procedure above calls the procedure below. The procedures without any solid lines 6-434 2 3 4 5 6 7 Source Debounce timer Not Used Not Used Receive timer RxD Interrupt TxD Interrupt Scan timer LP Interrupt The priority of the interrupts is not programmable but they are logically oriented so that for this application the priority is correct. In the steady state of the LPM's operation the UART will be receiving data, and the parallel port will be transmitting data. The serial receiver should be the highest priority since it can have overrun errors. This is the case because the debounce timer will be disabled, and the receive timeout interrupt will only occur when serial reception has ended. Therefore the RxD request can interrupt any other service routine, thus preventing any possibility of an overrun error. 210907-002 AP-153 ~------------, MAIN_MOD SCAN I I r.;--IPON_MOD I I I I I --.., I I I .....-P-O-W...lE-R-SO-N-.,: L _______ J I I L ____________ JI r;:----liNT_MOD I I SCANSTIME --------------I IDEBOUNCESTIME I I RECEIVESTIME I ---, LOADSINTSTABLE I I c:!!IJ ____________ .JI I I L __ Figure 26. Block Diagram of LPM Software Structure On power-up the CPU branches from OFFFFOH to the INITCODE routine which is included in the machine code by the MDS locater utility. INITCODE initializes the 8088's segment registers, stack pointer, and instruction pointer, then it disabled interrupts and jumps into MAIN_MOD. The first executable instruction in MAIN~OD calls POWER$ON, which initializes the MUART, flags, variables, and arrays. The MAIN-.MOD calls LOAD$INT$TABLE, which initializes the interrupt vector table. The CPU's interrupt is then enabled and the program enters into a DO FOREVER loop which scans the eight serial ports for an R'i'S. There are three software functions which employ the MUART's timers and interrupt controller to measure time intervals: SCAN, debounce, and IN IT$RECElVER. DEBOUNCE and INIT$RECElVER procedures, employ the MUART's timers and interrupt controller to measure time intervals. The CPU remains in a loop for a specific amount of time before it proceeds with the next section of code. In this loop the CPU is waiting for a global status flag to change while servicing any interrupts which may occur. When the appropriate timer interrupt occurs, the interrupt service routine will set the global flag which causes the CPU to exit the loop and proceed to the next section of code. An example can be seen from the scan flow chart in Figure 27. The first thing the program does before entering the loop is set the flag (in this case SCAN$DELAY) TRUE. The timer is initialized and the loop is entered. As long as SCAN$DELAY is TRUE the CPU will continue to sample RTS. If RTS remains false for more than 100 msec, the timer interrupts the CPU and the interrupt service routine sets SCAN$DELAY FALSE. This causes the CPU to exit the loop and address the next port. The process is then repeated. If RTS becomes true while it is being sampled, the DE· BOUNCE procedure is called. DEBOUNCE does nothing more than wait 10 msec and sample RTS again using the same technique discussed above. If RTS is still valid IN· IT$RECEIVER is called, otherwise the CPU returns to scan. 6-435 210907-002 AP-153 CALL ERROR PROCEDURE ADDRESS NEXT PORT Figure 27. Scan Flow Chart. Figure 28. RxD Interrupt Procedure Flow Chart INIT$RECEIVER calls CONFIGURE which programs the MUART for the bit rate, number of bits in a character, and parity format. This information is stored in an array called SERIAUFORMAT, which contains a byte for each port. The bytes in the SERIAL$FORMAT array have the same bit definition as the two nibbles in the programming words in Figure 22. Upon returning to INIT$RECEIVER the receiver is enabled, the receive timeout timer is initialized. and the timer and receiver interrupts are enabled. CTS on the serial port is then set true, and the CPU enters a loop which does nothing except wait for 18 seconds. If no characters are received within; 18 seconds, the receive timeout interrupt occurs and the loop flag is set false, which causes the CPU to exit the loop. If a character is received, a receive interrupt occurs, and the CPU vectors into the RxD interrupt service routine. Figure 28 shows a flow chart of the RxD interrupt service routine. This routine begins by reading the receive buffer and reinitializing the receive timeout timer. There are two conditions to check for before the character can be inserted into the FIFO. First, if there are any errors in the received character, an ERROR procedure is called which reports back to the serial port what the error condition was. The character in error is discarded and the routine returns. The other condition is that if the received character is an ASCII ESC, the PROGRAM procedure is called. If neither one of these conditions occurs, the character is placed in the FIFO by the BUFF$IN procedure. The LP interrupt routine is entered when the byte handshake interrupt request is acknowledged; This routine simply calls the BUFF$OUT procedure, which extracts a byte out of the FIFO. BUFF$OUT returns the byte to the LP interrupt procedure, which then writes it to Port 2. One small problem with getting the handshake interrupt going is that the first byte has to . be written to Port 2 before the first handshake interrupt will occur. The problem is that the line printer may not be.ready for the first byte. This would be indicated by DATA REQUEST being low. If the byte was written to the LP while DATA REQUEST is low, it would be lost. Note that if the handshake interrupt is enabled while DATA REQUEST is low, then DATA REQUEST goes high, the interrupt will occur without 6-436 210907-002 Ap·153 writing the first byte. There are several ways to solve this problem. Port 1 can be read to find out what 'the state of the DATA REQUEST line is. If DATA RE· QUEST is low, the CPU can simply wait for the interrupt without writing the first byte. If DATA REQUEST is high, then the first data byte may be written. Another solution would be to write a NUL character as the first byte to Port 2. If DATA REQUEST is low, then a worthless character is lost. If DATA REQUEST is high, the NUL character would be sent to the line printer; however, it is not printed since NUL is a nonprintable character. The LPM program uses the NUL character solution. BUFFER MANAGEMENT The FIFO implementation uses an 8K byte array to store the characters. There are two pointers used as indexes in the array to address the characters: IN$POINTER and OUT$POINTER. IN$POINTER points to the location in the array which will store the next byte of data inserted. OUT$POINTER points to the next byte of data which will be removed from the array. Both IN$POINTER and OUT$POINTER are declared as words. Figure 29 illustrates the FIFO in a block diagram. The BUFF$IN procedure receives a byte from the RxD interrupt routine and stores it in the array location pointed to by IN$POINTER, then IN$POINTER is incremented. Similarly, when BUFF$OUT is called by the LP interrupt routine, the byte in the array pointed to by OUT$POINTER is read. OUT$POINTER is incremented, and the byte which was read is passed back to the LP interrupt routine. Since IN$POINTER and OUT$POINTER are always incremented, they must be able to roll over when they hit the top of the 8K byte address space. This is done by clearing the upper three bits of each pointer after it is incremented. IN$POINTER and OUT$PONTER not only point to the locations in the FIFO, they also indicate how many bytes are in the FIFO and whether the FIFO is full or empty. When a character is placed into the FIFO and IN$POINTER is incremented, the FIFO is full if IN$POINTER equals OUT$POINTER. When a character is read from the FIFO and OUT$POINTER is incremented, the FIFO is empty if OUT$POINTER equals IN$POINTER. If the buffer is neither full nor empty, then it is in use. A byte called BUFFER$STATUS is used to indicate one of these three conditions. The software uses the buffer status information to control the flow into and out of the FIFO. When the FIFO is empty the handshake interrupt must be turned off. When the FIFO is full, ffi must be sent false so that no more data will be received. If the buffer status is in use, ffi' is tru~ and the handshake interrupt is enabled. Figure 30 shows the now chart of the BUFF$IN procedure. The BUFF$IN procedure begins by checking the BUFFER$STATUS. If it is empty and the character· to be inserted into the FIFO is a CR or LF, the handshake interrupt is enabled, a NUL character is output, and the BUFFER$STATUS is set to INUSE. The character passed to BUFF$IN from RxD is put into the FIFO. If the FIFO is now full, the BUFFER$STATUS is set to FULL, CTS is set false, and the buffer full LED is turned on. (0) I-- FIFO (OUT$POINTER) Figure 31 shows the flow chart of the BUFF$OUT procedure. After the character is read from the FIFO, the FIFO is tested to determine if it is empty. If it is not empty, the BUFFER$STATUS is FULL and there are 200 bytes available in the FIFO, serial data reception is reemibled, and the FIFO fills again. While data is being received from the workstation, CTS toggles high and low, filling up and emptying the last 200 bytes in the FIFO. Referring to the top of the flow chart (FIFO empty test) if it's empty, the BUFFER$STATUS is set to EMPTY, and the handshake interrupt is disabled. During this time all interrupts I-- FIFO (IN$POINTER) (8 K) BUFFER$STATUS EMPTY INUSE FULL Figure 29. FI FO Structure and Status 6-437 210907-002 AP-153 This is known as a critical section of code. Suspicion should arise for a critical section of code when two or more nested interrupt routines can affect the same status. One solution is to disable the interrupt flag at the CPU while the status and conditional .operations are being modified. The flow chart for the TxD interrupt procedure is given in Figure 32. For this program five different messages can be transmitted, and they are stored in ROM. It is possible to download the messages into a dedicated RAM buffer; however, the RAM buffer would have to be as large as the largest message. A more efficient way to transmit the messages is to read them from ROM. In this case the address of the first byte of the. message would have to be accessible by the transmit interrupt procedure. Since parameters cannot be passed to interrupt procedures, this message pointer is declared PUBLIC in one module and EXTERNAL in the other modules. To get the transmit interrupt started, the first byte of the message must be written to the transmit buffer. When a section of code decides to transmit a message serially, it loads the global message pointer with the address of the first byte of the message, enables the transmit interrupt, and calls the TxD interrupt procedure. Calling the TxD interrupt procedure writes the first byte to the transmit buffer to initiate transmit interrupts. This can be done by calling PL/M's built-in . procedure CAUSE$INTERRUPT. Figure 30. Flow Chart of the BUFF$IN Procedure are disabled at the CPU. (Remember that the RxD interrupt routine can interrupt the LP and BUFF$OUT procedures since it has a higher priority, and the MUART is in the nested mode.) If the CPU interrupt was not disabled during this time, the following events could occur which would cause the LPM to crash. Assume that the RxD inter.rupt occured where the asterisk is in the flow chart, after BUFFER$STATUS is set to EMPTY .. The BUFF$IN procedure would set BUFFER$STATUS to INUSE and enable the handshake interrupt. When the RxD interrupt routine returned to BUFF$OUT; the handshake interrupt is disabled, but the BUFFER$STATUS is INUSE. The handshake interrupt could never be reenabled, and the FIFO would fill up. The transmit interrupt routine checks each byte before it writes it to the transmit buffer. The last character in each message is a 0, so if the character. fetched is 0, the transmit interrupt is disabled and the character is ignored. USING THE LPM WITH THE INTELLE~ MICROCOMPUTER DEVELOPMENT SYSTEM, SERIES" OR SERIES '" A special driver program was written for the MDS to communicate to the LPM. This program, called WRITE, reads a specified file from the disk, expands any TAB characters, and transmits the data through . Serial Channel 2 to the LPM. Serial Channel 2 was chosen because CTS and RTS are brought out to the RS-232 connector. The WRITE program is listed in appendix B. It was also necessary to modify the boot ROM of the development system so that Serial Channel2 initializes with RTS false and a bit rate of 9600 bps. . 6-438 210907-002 inter AP·153 Figure 31. Flow Chart of the BUFF$OUT Procedure Figure 32. Flow Chart for TxD Interrupt Procedure 6-439 210907-002 AP·153 APPENDIX A LISTING OF THE LINE PRINTER MULTIPLEXER SOFTWARE 6-440 210907-002 Ap·153 PLlM-t,lb CD~lPIL£k r·lI·\} i-.lj'IUlJ SERIES-I II PL/M-86 VI 0 COMPILAfWN OF MODULE MAINMOD 09.JECT MODULE PLACED IN : J."I: MAIN. OBJ COMPILER INVO~ED 5Y PLM86. 86 : F I: 11AIN. SRC I**************~*********.**********.***************** ******~*~********~***** ~ MAIN MODUL.E FOR THE LINE PRINTER MULTIPLEXER ~ ~ * * • ************~***************************************** **********************1 $DEBUG MAIN$MOD: DO, 1***************************************************** *********************** * *~ * * * PORT 1 BIT CONFIGURATION ADDRESS RTS TWO WIRE HANDSHA~E CTS * 95 54 53 81 BO 52 B6 B7 * ****************************************************** ***********************1 2 BUFFER FULL DECLARE LIT TRUE FALSE FOREVER LITERALLY LIT LIT LIT 'LITERALLY', 'OFFH', '0', 'WHILE l' , CMD$I CMD$2 CMD$3 MODE PORT$I$CTRL SET$lNT INT$EN RST$INT INT$ADDR TX$BUFF RX$5UFF PORT$1 PORT$2 DEBOUNCESTIMER SCAN$TIMER RECEIVESTIMER STATUSSREG LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT '0', '8', 'OAH', 'OAH', 'OCH', 'OCH' , 'OEH', 'OEH', '10H', '12H', '14H', 'IAH', ' lCH', 'lEH', SCAN$INT DE90UNCE$INT RECEIVER$INT TIME$OUT$lNT TRANSMITSINT LIT LIT LIT LIT LIT '40H', 'OIH', 'IOH' . '08H' , '20H' , EMPTY INUSE FULL LIT LIT LIT '0', RTS Lli '( INPUT(PORTSll AND 04Hl', 1*8256 REGISTERS*I '2', '4', '6', '1', '2', 6-441 210907-002 AP·153 PL/M-86 COMPILER MAINMOD LABEL PUBLIC, TEMP BYTE. SCAN$DELAY BYTE DEBOUNCE$DELAY BYTE RECEIVE$DELAY BYTE PORT$PTR BYTE SERIAL$FORMAT(8)BYTE PlJBLIC. PUBLIC. PUBLIC. PUBLIC. PUBLIC. BEGIN MESSAGE$PTR J OKl1> llUFFER$STATUS POINTER BYTE BYTE BYTE I> PEN EP Ll LO B:3 82 Bl BO *1 EXTERNAL. EXTERNAL.• EXTERNAL. EXTERNAL; 1***************************************************** **************** * EXTERNAL PROCEDURE DECLARATIONS * ****************************************************** •• *.**.*.****.*/ :3 4 1 2 POWER$ON:PROCEDURE EXTERNAL; END POWER$ON; 5 6 1 2 LOAD$INT$TABLE:PROCEDURE EXTERNAL; END LOAD$INT$TABLE; 1***************************************************** **************** * SET THE BIT RATE AND ,DATA FORMAT FOR THE SERtAL PORT * ****************************************************** ***************1 7 8 9 10 11 1 2 2 2 2 CONFIGURE:PROCEDURE ; I*Initiali,e bit rate and data format*1 TEMP=SER IAL$FORr1AT( SHR (PORT$PTR. 3) ); OUTPUTlCMD$I)=(lSHLCTEMP.2) AND OCOH) OR 03H); OUTPUTCCMD$2)=CTEMP OR :30H); END CONFIGURE; , , ' /**************************~************************** **************** * INITIALIZE SERIAL RECEIVER * ****************************************************** ***************1 12 1:3 14 15 16 17 18 1 2 2 2 2 2 2 19 2 20 21 2 3 22 23 24 25 2 2 2 2 INIT$RECEIVER' PROCEDURE; CALL CONFIGURE; I*Initialize 8256 se~ial po~t*1 RECEIVE$DELAY=TRUE; OUTPUTCCMD$3)=OCOH; I*Enable 5e~ial receiver*1 OUTPUTlRECEIVESTIMER)=70; 1*18 second TIMESOUT*/ OUTPUTlSET$INT)=18H; I*Enable RECEIVER and TIME$OUT interrupts*1 IF (8UFFER$STATUS<>FULL) THEN OUTPUTlPORT$l)=CINPUTCPORT$l) AND OBFH); I*Send CTS TRUE*I DO WHILE RECEIVE$DELAY=TRUE. END; 1* Wait here while receiving 1* After 18 seconds of not receiving a character. OUTPUTlSET$INT)=TRANSMIT$INT; 1* Send the terminating se~ial data *1 proceed *1 m~ssage *1 J=O; MESSAGESPTR= QOKlO); CAUSE$INTERRUPT (45H); 6-442 210907-002 AP-153 PL/M-86 COMPILER 26 27 28 29 MAlI'moD 2 2 oUTPUT(PoRT$I)~(INPUT(PoRT$I) 2 oUTPUT(CMD$3)~40H; 2 END INIT$RECEIVER; oUTPUT(RST$INT)~18H; DR 40H) i I*Send CTS FALSE*I I*Clear RECEIVER and TIMER Interrupts*1 I*Disable serial receiver*/ 1********************************************************************* * DEB OUNCE RTS * ***********~****************************************** ***************1 30 31 32 33 34 35 36 38 1 2 2 2 2 3 2 2 DEBoUNCE:PRoCEDURE; DEBoUNCE$DELAY~TRUEi OUTPUTCDEBOUNCE$TIMER);10; 1* 10 msec debounce time delay *1 oUTPUT(SET$INT)~DEBoUNCE$INTi DO \'HIL.E DEBoUNCE$DELAY~TRUEi END; IF RTS~O THEN CALL INIT$RECEIVERi END DEB OUNCE i I**************************************~************** **************** * BEGIN MAIN PROGRAM * ****************************************************** ***************1 39 BEGIN: CALL POWER$ONi 40 CALL LoAD$INT$TABLEi 41 ENABLE; 42 DO FOREVER; 43 44 45 2 2 2 46 47 2 3 48 49 3 50 51 52 53 2 2 2 2 54 55 56 2 2 SCAN$DELAY~TRUE; OUTPUT(SCAN$TIt1ER)=100; I*Spend 100 msec on each serial port sampling RTS*I oUTPUT(SET$INT)~SCAN$INT; DO WHILE SCAN$DELAY~TRUEi IF RTS~O THEN CALL DEBOUNCE; END; 3 I*Increment PoRT$PTR*1 TEMP~INPUT(PORT$I); AND 38H; AND (NOT 38H), PORT$PTR~(PORT$PTR+8) AND 38H; PORT$PTR~TEMP TEMP~TEMP OUTPUT(PoRT$I)~TEMP DR PoRT$PTRi I*Look at next serial port*1 END; 1*00 FOREVER*I END MAIN$MODi MODULE INFORMATION: CODE AREA SIZE PL/M-86 COMPILER 011CH 284D MAINMoD CONSTANT AREA SIZE VARIABLE AREA SIZE MAXIMUM STACK SIZE 159 LINES READ o PROGRAM WARNINGS o PROGRAM ERRORS OOOOH OOODH OOOCH 00 130 120 END OF PL/M-86 COMPILATION 6-443 210907-002 Ap·153 PL/M-86 COMPILER INTMll0 SERIES-Ill PL/M-86 Yl. 0 COMPILATICIN OF MODULE INl'MOD OBJECT MODUl.E PLACED IN . F\; INT OBJ COMPILER INYOKED BY: Pl.M86.86 FI INT. SR,' '**********~~**********.********.~**.****************~ *~***.***~.*.*** * * * * INTE'lRUF'T MODULE': CONTAINS ALL INTERRUPT ROUHNES PLUS LOAD INTERPUPT fP,DL.E PROCEDURE • •. * * **********************************~*.***************** ***************1 $DEBUG INT$MOD: DO, 'liNOLIST DECLARE 3 ESC SCAN$DELAY DEBOUNCE$DELAY RECEIVE'liDELAY MESSAGE'liPTR J 'ISH' , EXTERNAL, EXTERNAL, EXTERNAL, EXTERNAL, EXTERNAL, LIT BYTE BYTE BYTE POINTER BYTE 1******************************************·********** ***************** * MESSAGES SENT TO SERIAL PORTS * ****************************************************** ***************1 OK (*) BYTE PUBLIC DATA ('TRANSMISSION COMPLETE',OAH,ODH.OO), BREAK (*) BYTE PUBLIC DATA ('BREAK DETECT ERROR',OAH.ODH.OO), PARITY (*)BYTE PUBLIC DATA ('PARITY ERROR DETECTED',OAH.ODH,OO), FRAME (*) BYTE PUBLIC DATA ('FRAMING ERROR DETECTED'. OAH.ODH, 00), OVER'liRUN(*)BYTE PUBLIC DATA('OVER RUN ERROR DETECTED',OAH.ODH,OO), 4 5 6 I :2 :2 1*************************_·******************************************* * EXTERNAL PROCEDURES CALLED BY THE INTERRUPT ROUTINES * *********************************************************************1 ERROR:PROCEDURE (STATUS) EXTERNAL; DECLARE STATUS BYTE, END ERROR, 7 I 8 2 PROQRAM:PROCEDURE EXTERNAL, END PROGRAM, 9 11 1 2 2 BUFF$IN:PROCEDURE (CHAR) EXTERNAL, DECLARE CHAR BYTE, END BUFF'liIN, 12 13 1 2 BUFF'liOUT. PROCEDURE BYTE E·XTERNAL, END BUFF'liOUT; 10 1***************************************************** ****~*********** .. LOAD THE INTERRUPT TABLE •. ********************~********************************* ***************1 14 LOAD'liINT$TABLE:PROCEDURE PUBLIC, 6-444 210907-002 Ap·153 PL/M-B6 COMPILER INTMOD 15 16 17 IB 2 2 19 20 2 2 CALL CALL CALL CALL CALL CALL 21 2 END LOADSINTSTABLE; 2 2 SETS INTERRUPT SET$lNTERRUPT' SETSINTERRUPT SETSINTERRUPT SETSINTERRUPT SETS INTERRUPT 12/09/82 C40H.DEBOUNCESTIME); C43H. RECEI YESTI ME); C44H.RXD); C45H.TXD); (46H.SCANSTIME); (47H.LP); 1********************************************************************* * INTERRUPT ROUTINES * ****************************************************** ***************1 1********************************************************************* * SET SCAN DELAY FLAG FALSE * ****************************************************** ***************1 SCANSTIME:PROCEDURE INTERRUPT 46H, 22 23 2 24 25 26 2 2 2 ENABLE, SCANSDELAY=FALSEi OUTPUTCCMDS3)=BBH, END SCANSTIME, I*Output end fD~ nested mode*/ 1***************************************************** **************** * SET DEBOUNCE DELAY FLAG FALSE * *********************************************************************1 27 2B 29 30 1 2 2 2 DEBOUNCESTIME:PROCEDURE INTERRUPT 40H; DEBOUNCESDELAY=FALSE, OUTPUTCCMDS3)=BBH, END DEBOUNCESTIt1E, 1********************************************************************* * SET RECEIYE DELAY FLAG FALSE * *********************************************************************1 31 32 33 34 35 1 2 2 2 2 RECEIYESTIME:PROCEDURE INTERRUPT 43H, ENABLE, RECEIYESDELAY=FALSEi OUTPUTCCMDS3)=BBH, END RECEIYESTIME, 1********************************************************************* * READ SERIAL RECEIYE BUFFER * *********************************************************************1 36 RXD:PROCEDURE INTERRUPT 44H, 37 DECLARE 38 39 40 2 2 2 STATUS BYTE. CHAR BYTE, CHAR=INPUTCRXSBUFF), OUTPUT'RECEIYE$TIMER)=70. STATUS~ INPUT( STATUS.REG) AND OF'H, 1* REINITIALIZE RECEIYE TIME OUT ./ 6-445 210907-002 Fl_/M-86 COMP lLE'.R 41 :2 42 2 43 2 44 2 45 46 47 2 2 2 r;HMOD H' STATUS<,:'O THEN CALL ERROR (STATUS) I ELSF. IF CHAR=ESC THEN CAl.L PRDGRAI1; ELSE CALL BUFF51N ICHAR ), OUTPUTICMD$3)=88H; END RXD, 1********************************************************************* * SEND A BYTE TO THE LINE PRINTER * *********************************************************************1 48 49 50 51 52 2 2 2 2 I_P: PROCEDURE INTERRUPT 47H; ENABLE. OUTPUT I PORT$2) =BUFFSOUT; OUTPUTICMD$3)=88H. END LP; 1********************************************************************* * SEND A BYTE TO THE SERIAL PORTS * ****************************************************** ***************1 53 54 2 55 56 57 2 2 2 59 60 61 62 2 2 2 2 63 1 TXD:PROCEDURE INTERRUPT 45H. DECLARE MESSAGE BASED MESSAGESPTR (1) BYTE, I BYTE. ENABLE; I =MESSAGE I J), IF 1<>0 THEN OUTPUT(TXSBUFF)=I. ELSE OUTPUTIRSTSINTI=TRANSMIT$INT. J=J+l. OUTPUTICMD$31=88H; END TXD. END INT$MOD. MODULE INFORMATION: CODE AREA SIZE CONSTANT AREA SIZE VARIABLE AREA SIZE MAXIMUM STACK SIZE 181 LINES READ o PROGRAM WARNINGS o PROGRAM ERRORS 01BDH 0078H 0003H 0022H 4450 1200 3D 340 END OF PL/M-86 COMPILATION 6-446 .210907-002 Ap·153 PL/M-86 COMPILER BUFFMOD SERIES-III PL/M-86 VI. 0 COMPILATION OF MODULE BUFFMOD OB-JECT MODULE PLACED IN . Fl: BUFF. OB-J COMPILER INVOKED BY: PLM86.86 :Fl.BUFF. SRC .* . 1********************************************************************* * BUFFER MODULE: INSERTS At,D REMOVES CHARACTERS FROM FIFO REPORTS SERIAL RECEIVE ERRORS AND RE-PROGRAMS SER IAL PORTS . .. .. .. •. . **************~****************************~********** ***************1 $DEBUG BUFF$MOD: DO; $NOLIST DECLARE 3 MESSAGE$PTR POINTER -J BYTE OK(I) BYTE BREAK(I) BYTE PARITY(I) BYTE FRAME(I) BYTE OVER$RUN(I) BYTE SERIAL$FORMAT(I)BYTE PORT$PTR BYTE PUBLIC, PUBLIC. EXTERNAL. EXTERNAL. EXTERNAL. EXTERNAL. EXTERNAL. EXTERNAL. EXTERNAL. FIFO(8192) IN$POINTER OUT$POINTER BUFFER$STATUS PUBLIC. PUBLIC, PUBLIC; BYTE. WORD WORD BYTE 1***************************************************** ****************. .. INSERT CHARACTER INTO FIFO .. *********************************************************************1 4 5 1 2 BUFF$IN:PROCEDURE (CHAR) PUBLIC; DECLARE CHAR BYTE; IF «BUFFER$STATUS=EMPTY) AND «CHAR=LF) DR (CHAR=CR»l THEN DO; OUTPUT(SETSINT)=HANDSHAKE$INTi 1* Enable two-wire handshake interrupt *1 BUFFER$STATUS=INUSE; I .. Output NULL character to get OUTPUT(PORT$2)=O; 6 2 7 8 9 10 2 3 3 3 11 3 12 13 2 2 FIFOCIN$POINTER)=CHARi 1* Put CHAR lnto FIFO and IncrPffiPnt IN$POINTER=( (INPOINTERH) AND lFFFH); 14 2 IF 15 2 the interrupt started *1 END; «(It..I'liPOlt"TER-t4) AND lFFFH)o:.OlJT$PCllhl1l-R) 1* If' tht:> bllfft'r' pOlnt~r I~, ~! filII .... top l't!'It-.'pt\\ln THEN DO; lit Send CT~i FALSE. dlld light up 6-447 but'reT' ·fu! I I ~ D u/ 210907-002 ft Ap·153 FL/M-86 COMPILER 16 17 18 19 3 3 3 2 BUFFMOD OUTPUTiPORT$1 )~( (INPUT(PORT$I) DR 40H) AND 7FH), [~UFFER$STATIJS~Fl.ILL.; END; END IlUFF$ I N; I**********************************~****************** **************** .• REMOVE CHARACTER FROM F JFO * ****************************************************** ***************1 20 21 22 23 24 25 26 27 2B 29 30 I 2 2 "2 BUFF$OUTPROCEDURE BYTE PUBLIC, BYTE, DECLARE CHAR CHAR=FIFO(OIJT$POINTER), OUT'POlNTER=((OUT'POINTER+I) AND IFFFH), IF OUT$POINTER=IN'POINTER 1* If the buffer i. EMPTY disable the output to LP *1 THEN DO, :? 3 3 3 3 3 DISABLE; BUFFER$STATUS=EMPTY, OUTPIJT(RSU!NT)~HANDSHAKE$INT. ENAIlLE, END, 1* 31 2 32 33 34 35 2 3 3 3 37 2 ELSE If tho buf'e. is IF « ~eady to .ill up again then send CTS TRUE *1 BUFFErl$STATUS~FULLl THEN DO; AND « (OUT$PUINTER·-:200) AND IFFFH) '=IN$POINTER) ) 1* Turn off buffer-full LED and turn on CTS */ OUTPUT(PORT$!)=«INPUT(PORT$I) AND OBFH) DR BOH); BUFFER$STATUS=INUSE; END; RETURN CHAR; END BUFF$OUT; 1*************************************.****-********** **************** * SEND ERROR MESSAGE TO SERIAL PORT * ****************************************************** ***************1 38 39 2 40 2 41 42 2 2 ELSE 43 44 2 2 ELSE 45 46 2 :2 ELSE 47 2 49 50 3 3 ERROR· PROCEDURE (STATL'S) PUBLIC, BYTE. DECLARE STATUS MESSAGE BASED MESSAGE$PTR(li BYTE; IF (STATUS ANO THEN STATUS=2; IF (STATUS AND THEN STATUS=3; IF (STATUS AND THEN STATUS=4; IF (STATUS AND THEN STATUS=I, DO CASE STATUS; 02H»O 04H»0 OBH»O OIH»)·O MESSAGE$PTR~@FRAME(O), 6-448 210907-002 inter AP-153 PL/M-86 COMPILER 52 53 54 3 3 3 3 55 56 57 58 2 2 2 2 51 GUFFMOD MESSAGE$PTR=@OVER$RUN(O); MESSAGE$PTR=@PARITY(O), MESSAGE$PTR=@GREAKCO); END; 1* Point to second character ln string *1 OUTPUT(SET$INT)=TRANSMIT$INT; OUTPUT(TX$GUFF)=MESSAGE(O); END ERROR; J=I; 1***************************************************** **************** * RELOAD SERIAL PORT CONFIGURE IlYTE ****************************************************** ***************J 59 60 61 2 PROGRAM: PROCEDURE PUGLIC; DECLARE TEMP GYTE, CHAR GYTE; 62 2 3 DO WHILE (INPUT(STATUS$REG) AND 40H)=O, END, 63 2 CHAR=INPUT(RX$IlUFF), 64 2 65 66 67 68 69 2 3 3 3 3 IF CHAR=O THEN DO, 1* If second byte is 0, END, 70 2 71 72 2 3 DO WHILE (INPUT(STATUS$REG) AND 40H)=0, END, 73 2 74 75 2 76 exit program mode *1 OUTPUT(RECEIVE$TIMER)=70, CALL IlUFF$IN (CHAR), RETURN, TEMP=(CHAR AND OFH), 2 1* Wait for next byte *1 TEMP=(INPUT(RXIlUFF) AND OFH) DR SHL(TEMP,4), SERIAL$FORMAT (SHR(PORT$PTR.3»=TEMP; END PROGRAM, END GUFF$MOD, MODULE INFORMATION: CODE AREA SIZE CONSTANT AREA SIZE VARIABLE AREA SIZE r~AXIMUM STACK SIZE 18'1 LINES READ o PROGRAM WARNINGS o PROGRAM ERRORS OlE4H OOOOH 200BH OOOAH 484D OD 82030 100 END OF PL/M-86 COMPILATION 6-449 210907-002 Ap·153 PL/M-86 COMPILER SER IES- I II PL/M-86 VI 0 CoMP ILAT JON OF MOOULE PON __ MOfJ OBJECT MODULE PLACED IN f'l PON DB,) COMPILER INVOKED BY: PLM86.86 FI PON SRC $DEBUG /*****~*.********************************************* *********************** * i~ • POWER ON INITIALIZATION OF THE LINE P·RINTER MULTIPLEXER * * * ****************************~*~******~*****~********** *********************J $NOLIST 3 DECLARE BUFFER$STATUS BYTE I N$Po !tHER WORD OUT$POINTER WORD PORT$PTR BYTE SERIAL$FDRMAT(8)BYTE 4 POWER$ON: EXTERNAL, EXTERNAL, EXTERNAl., EXTERNAL, EXTERNAL, PROCEDURE PUBLIC, 5 2 DECLARE I BYTE, 6 2 DISABLE, 7 2 OUTPUT(CMD$I)=OIOOOOIIB, 8 2 OUTPUT(CMD$2i=IOlI0100D, 9 10 2 2 OUTPUT(CMD$3)=0111111IB, OUTPUT(CMD$3)=1011000IB, II 2 OUTPUT(MODE)=10000101B, 12 2 oUTPUT(PoRT$ISCTRL)=11111000B: I*PoRT I 13 2 oUTPUT(PoRTSI)=11000000B, I.POINT TO THE FIRST PORT, CTS IS AND BUFFER IS NOT FULL. I 1* I. 14 15 17 2 2 2 18 2 INITIALIZE THE MUART *1 INITIALIZE FLAGS, 1*8086 MODE, FRECl=IKHz, 1 STOP BIT, ~, 7 BITS/CHARACTER., 1*000 PARITY, SYSTEM CLoCK=I. 024 MHz, & 9600 bps.' I*CLEAR CMD$3 REGISTER*I I-RESET, INTERRUPT ACKNOWLEDGE ENABLE, ~, NESTED INTERRUPT MODE.' I_CASCADE TIMERS 35 FOR THE RECEIVE$TIME$OUT TIMER, BYTE OUTPUT MODE., VARIABLES, RTS=INPUT, THE REST ARE oUTPUTS., F~' AND ARRAYS . , BUFFER$STATUS=EMPTY, IN$POINTER=O, OUT$PoiNTER=O, PoRT$PTR=O, DO 1=0 TO 7, 6-450 210907-002 Ap·153 PL/M-86 COMPILER 19 3 SERIAL$FORMAT THEN GO TO DONE, 29 CALL OPEN(. AFT$IN, . FILENAME, 1,0, . STATUS), 1* Open up the file *1 30 IF STATUS C· THEN GO TO DONE, ° 31 32 1* Read in file and path name *1 ° REPEAT: CALL READ(AFT$IN, . BUFFER,32000,. ACTUAL, . STATUS), 33 ° 34 IF STATUS () THEN GO TO DONE, 3S CHAR.COUNT~Oi 3~ OUTPUT(USART$STATUS)= RTS OR TXEN, 1* CHAR$COUNT keeps track of the tab columns in each line *1 6-454 210907-002 Ap·153 Cu,'H·-' 1 LER PL/t-l-SU IF RUFFER(O)aFORM$FEED 37 38 39 40 41 the first chaTacter is a form feed remove it ro'rm feeds are inserted at the end of a file *i THEN DO, BUFFER (0) =OOH, CHAR$COUNT=-! , END, " 2 2 DO I O T a lAC TUAL - 42 43 1* If IF 2 44 45 46 47 2 3 3 3 48 49 50 51 52 53 3 !), (BUFFER(I)=TAB) 1* Replace "rAB characters wIth the approprlate number of spaces *1 THEN DO, CALL TXRDY, OUTPUT(USART$DATA1=SP, CHAR$COUNT=CHAR$COUNT+l, DO WHILE «CHAR$COUNT AND 0007H)CO), CALL TXRDY, OUTPUT (USART$DATA)=SP, CHAR$COUNT=CHAR$COUNT+l, END, 4 4 4 4 3 END, ELSE 54 IF BUFFER(I)-ESC I . If outputting ESC, 2 o 55 56 57 58 3 3 3 59 60 61 62 2 3 3 3 63 3 64 3 65 66 67 3 3 then output a next so the LPM does not get re-programmed *1 THEN DO J-O TO 1; CALL TXRDY, OUTPUT(USART$DATA)=O, END, 2 ELSE 1* If the character is not an ESC or TAD then output it *1 DO, CALL TXRDY, OUTPUT(USART$DATA)=BUFFER(I), IF I BUFFER I J) >!FH AND BUFFER I I ) <>7FH) THEN 1* Only ,ncrement CHAR.COUNT for printable characters *1 CHAR$COUNT=CHAR$CoUNT+!, IF IBUFFER(I)=CR) DR IBUFFERII)=LF) 1* Reset CHAR<.f;COUNT for CR or LF *1 THEN 68 69 70 71 72 2 CHAR$CoUNT=O, ENDi END; IF ACTUAL = 32000 1*lf the file is more than 32K, get same more data *1 THEN GO TO REPEAT, CALL TXRDY; 1* Terminate file with CR. LF, and FF *1 OUTPUTIUSART$DATA)=CR, CALL TXRDY; 6-455 210907-002 AP·153 PL/M-80 COMPILER 73 74 75 OUTPUT (uSARTSDATA) =LF, CALL TXRDY, OUTPUT (USARTSOATA)=FORMSFEEO, 76 OUTPUT(USARTSSTATUS)=RXE OR TXEN, 77 CALL CLOSE (AFTSIN •. STATUS), 78 79 2 80 81 82 2 2 2 83 1* Shut off RTS *1 1* Output sign off message '*1 00 1=0 TO 14; IF FILENAME(I)=CR THEN GO TO SKIP, DYE( 1+5)=FILENAME( I), END, SKIP: 84 CALL WRITE(O •. BYE.42 •. STATUS), GO TO NEXT, 85 DONE: 86 NEXT: 87 END WRITESMOD, CALL ERROR(STATUS), CALL EXIT, MODULE INFORMATION: CODE AREA SIZE VARIABLE AREA SIZE r1AXIMUM STACK SIZE 191 LINES READ o PROGRAM ERRORS 0209H 7D44H 0008H 5210 320680 80 END OF PL/M-80 COMPILATION 6-456 210907-002 inter AP·153 APPENDIX C MUART REGISTERS 6-457 210907-002 Ap·153 8085 Mode: AD3 8086 Mode: AD4 ADZ ADl ADO AD3 ADZ ADl 0000 Timer Frequency Select ' - - - - - 8086 Mode Enable Interrupt on Bit Change Break-in Detect Enable Stop Bit Length Character Bit Length 0001 ' - - - - - - - Baud Rate Select ' - - - - - - - - - - - - - Even System Clock Divider Parity L.._ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ' - - - - - - - - - - - - - - - - - - - Parity Enable 0010 I SET I RxE 1lAE I NlE I END ISBRKtrBRK IRST I Command 3 1 I 001l I Software Reset Transmit Break Single Character Break End of Interrupt Nested Interrupt Enable Interrupt Acknowledge Enable Receiver Enable Bit Set/Reset I T35 I T24 IT5C I CT31 CT21 P2C21p2CII P2col 1'--____ MOdleL....-1 _ _ Port 2 Control Counter/Timer 2 Counter/Timer 3 L.._ _ _ _ _ _ _ _ _ _ _ _ _ Timer 5 Retriggerable ' - - - - - - - - - - - - - - - - - Cascade Counter/Timer 2 & 4 1..-_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ Cascade Counter/Timer 3 & 5 6-458 210907-002 Ap·153 0100 ' - - - - - - - - - - - Output/Input of Port 1 pins (Write only) 0101 L7 L6 I L5 I L4 I L3 I L2 Ll I LO I Enable Ll I LO I Disable Ll I LO I Interrupt Levels Enabled Set Interrupts (Write only) 0110 L7 L6 I L5 I L4 I L3 I L2 Reset Interrupts (Read only) 0101 L7 L6 I L5 I L4 I L3 I L2 Interrupt Enable (Read only) 0110 Interrupt Level in Service (Write only) 1111 Disable Start Bit Check .....- - - - Transmit Mode Enable ' - - - - - - - - - - - Receiver Sampling Point 6-459 210907-002 Ap·153 Status Register 1111 (Read only) I I I lINT RBF TBE TRE l BD J PE I OE I FE I Framing Error/Transmission Mode Indication Overrun Error Parity Error Break Detect or Break·in Detect Transmitter Register Empty Transmitter Buffer Empty Receiver Buffer Full Interrupt Pending I Response to INTA SOSS·Mode (RST·instruction in response to INTA) os D41031· 1-._ _ _ _ _ _ _ _ _ _ Interrupt Level SOS6-Mode (Interrupt Vector in response to second INTA) o o o o D2 DI I DO 1 1-._ _ _ _ 6-460 Interrupt Level 210907-002 APPLICATION NOTE AP-183 August 1984 8256AH Multifunction Peripheral Simplifies Microcomputer I/O Design CHRISTOPHER SCOTT © Intel Corporation, 1984 6-461 Order Number: 231125-001 AP·183 8256AH Multifunction Peripheral Simplifies Microcomputer I/O Design CONTENTS INTRODUCTION Description of the 8256AH HARDWARE DESCRIPTION 8256AH/80186 System Design RS-232C Hardware Ihterface Parallel 110 with Handshaking SOFTWARE DESCRIPTION Serial RS-232C Interface RS·232C Control Signals Interrupt Structure CONCLUSION APPENDIX A. Software Listing FIGURES 1a. System Block Diagram Without 8256AH System Block Diagram With 1b. 8256AH 2. 8256AH Internal Block Diagram 3. 8256AH / 80186 Schematic 4. Block Diagram of the 8256AH Serial RS·232C Interface Software Structure 5. 8256AH Interrupt Source To Priority Level Map 6. Port 1 RS·232C Pin Definition 7. Receive Data Interrupt Service Routine Software Flowchart 8. Transmit Data Interrupt Service Routine Software Flowchart Additional Sources of Information Ap Note 153 Designing with the 8256AH 6-462 231125-001 AP-183 INTRODUCTION A primary goal of microcomputer system design is to provide the required functionality and flexibility with the fewest number of components. The 8256AH Multifunction Peripheral is designed specifically to meet these conflicting requirements. Four of the most common microcomputer system functions, previously requiring up to four separate MSI or LSI devices, are combined into one LSI device. The 8256AH incorporates a serial asynchronous communication channel, two 8-bit parallel I/O ports, five 8-bit timer/counters and an eight level priority interrupt controller in one 40 pin package. Its flexible design allows it to directly interface to most microprocessors, including Intel's MCS-85, iAPX-86, iAPX-88, iAPX-186 and iAPX-188, and the MCS-48 and MCS-5l family of single-chip microcomputers. This application note describes using the 8256AH to implement a Data Terminal Equipment (DTE) RS-232C serial asyncrhonous communication link with the control signals necessary to interface to a Bell 1031212A modem. The interface requires a total of nine interface signals. Three of these signals, TxD, RxD and CTS, are provided by the UART section of the 8256AH. The balance of the RS-232C interface signals are implemented using six of the independently programmable parallel PORT I lines. In addition, the application design provides an eight bit parallel I/O port with handshaking signals. The on-chip priority interrupt controller enables the RS-232C serial interface an. the parallel interface to operate on an interrupt baSI The 8256AH uniquely addresses the complexities of implementing an RS-232C communications interface. By utilizing the built-in hardware and software features of the 8256AH, the design achieves flexibility with simplicity, qualities often exclusive of one another. Previous solutions required four components to implement the same interface. Figure I illustrates the basic system block diagrams for the two solutions. In Figure la the 8251A Programmable Communications Interface provides the UART serial communications interface. The 8254 Programmable Interval Timer provides baud rate generation and other timing functions, such as time-out loops, needed for software support of an RS-232C interface. These .are especially needed if the RS-232C channel is to operate in an interrupt system environment. The 8255A Programmable Peripheral Interface provides parallel I/O with one port dedicated to the RS-232C control signals. The 8259A Priority Interrupt Controller provides an eight level priority interrupt structure. This represents a total of 120 device pins compared to the single 40 pin 8256AH, and 465 mA current requirement verses a 160 mA current requirement. Figure Ib represents the 8256AH solution incorporating the four functions in one package. In some data communication applications only three lines - ground, Transmit Data and Receive Data - are used for serial communication. An example is communication between an ASCII terminal or printer and a personal computer. These devices are usually located close to one another and in general do not require the additional control signals of the EIA RS-232C serial communications standard. In other data communications applications, this same equipment requires that the integrity of the serial communications link be constantly monitored. This enables the host system to control the data trransmission at all times, whether it be a host computer or intelligence local to a communications device, such as an ASCII terminal. The need for control and monitoring of the serial line is particularly important when the communications link is over telephone lines using a modem. In a Switched Network, where a number of serial devices share the same communications line, the control signals are crucial to the system's multiplexing the single line. 2 WIRE RxD 11<0 HANDSHAKE 231125-1 Figure 1a. System Block Diagram Without the 8256AH 6-463 231125-001 AP.183 TO All INTERNAL FUNCTIONS ADO-AD4 ADDRESSI DATA BUS BUFFERS SYSTEM CLOCK PRESCAlER DB5·DB7 PORT 1 COUNTER INPUTS ClK BAUD RATE GENERATOR RxD '/XD CS - - -.. RD - - -.. RxC '/XC CTS WR - - -.. BUS ALE - - _.. CONTROL LOGIC RESET - -......... INTA - - _.. INT_-~ INTERRUPT CONTROllER 1+--- EXTINT 231125-3 Figure 2. 8256AH Internal Block Diagram parallel port with ACK/OBF and STB/IBF two wire handshake signals. In the latter configuration, the six remaining I/O lines may be used as either independent· ly programmable I/O lines, or as predefined special function inputs and/or outputs, such as a second external interrupt input or timer/counter inputs. The five 8-bit programmable timer/counters are binary presettable downcounters. In addition, an independent on-chip Baud Rate Generator is provided for the UART. The clock sources for the timers/counters may be either internal or external - via programmed parallel port pins - depending upon whether they are configured as timers or counters. Four of the timer/counters may be cascaded to form two 16-bit timer/counters. Each of the five timer/counters has its own read/write register. The eight level priority interrupt controller has twelve possible interrupt sources. Ten of the sources are internal and two are external. One of the external interrupt sources is a fixed pin; EXTINT. The second is one of the parallel Port 1 pins which can be programmed as an external interrupt source. The twelve interrupt sources are internally mapped to the eight interrupt priority levels. 6-464 The interrupt controller may be programmed to operate in either a Normal or Nested Interrupt Mode. In Normal Mode any interrupt may interrupt any other interrupt based upon the enable/disable bits in the Interrupt Enable, or Mask, Register. In the Nested Mode only an interrupt of higher piority may interrupt one of lower priority, again based upon the bits in the Enable Register. The 8256AH interrupt structure supports both 8085 and 8086 interrupt vectoring methods via the INTR and INTA signals. In vectored interrupt operation the 8256AH places the interrupt vector address on the data bus during the INTA sequence. In addition the 8256AH supports non-vectored interrupt interfaces, such as MCS-5l and MCS-48 systems. In non-vectored interrupt applications the host system simply reads the interrupt vector address from the .Interrupt Address Register of the 8256AH. Reading the interrupt address register clears the INT pin and acknowledges that the interrupt has been serviced. This is the functional equivalent to an INTA sequence generated by the host processor. 231125·001 AP-183 PARALLEL 1/0 WITH 2 WIRE HANDSHAKE RxD TxD SERIAL 1/0 231125-2 Figure 1b. System Block Diagram With the 8256AH This Application Note assumes that the reader is familiar with the 8256AH Data Sheet and with the RS-232C communication protocol and terminology. A complete software listing is provided in Appendix A. A complete description and definition of the RS-232C interface standard may be found in the book "Data Communications: A Users Guide" by Kenneth Sherman, Reston Publishing 1981. DESCRIPTION OF THE 8256AH The 8256AH combines four commonly used piiripheral functions into one device (see Figure 2); 1. A full-duplex, double-buffered serial asynchronous Receiver/Transmitter (UART) with an on-chip Baud Rate Generator. 2. Two 8-bit parallel I/O ports; One bit programmable, One nibble programmable. 3. Five 8-bit timer/counters; 4 can be cascaded to form 2 16-bit timer/counters 4. An 8-level priority interrupt controller. The 8256AH uses the standard bus control signals compatible with Intel's family of peripherals and microprocessors. The microprocessor interface utilizes a multiplexed address/data bus. Four of the eight address/data lines are used to generate the register address. This enables all of the 8256AH's functionality to be contained in a 40 pin package while retaining direct register addressing. The sixteen directly addressable internal read/write registers provide control for all of the 8256AH's various functions. Fourteen of the registers are read/write, one, the Status Register, is read only and one, the Modification Register, is write only. Three Command Registers configure the operating environment including the type of CPU, 8 or 16 bit, and system clock frequency. Command Register Three provides bit set-reset capability for control of such functions as End of Interrupt, Nested Interrupts, Interrupt Acknowledge and UART Receive Enable. The Status Register provides all information about the UART's transmitter and receiver, and the state of the interrupt (INT) output pin to the microprocessor. The Mode Register defines the configuration of the two parallel ports and the five timer/ counters. The write only Modification Register is used to alter two standard functions of the receiver, start bit sampling and to enable a special indicator flag for half-duplex operation. In addition, six registers control the two parallel ports. Two registers provide for UART Transmit and Receive Buffers. Ten registers are used for timer!counter interface, and four registers provide for Priority Interrupt Controller support. The UART section of the 8256AH features a full-duplex double-buffered transmitter and receiver with separate control registers. The internal baud rate generator provides the thirteen common sampling rates from 50 bps to 19.2 kbps. An external baud rate clock can also be used, with programmable choice of IX, 32X or 64X sampling rates. The two parallel I/O ports can be configured as two independent 8-bit parallel I/O ports, or as one 8-bit 6-465 231125-001 AP-183 DESIGN DESCRIPTION SOFTWARE DESCRIPTION Hardware Description Serial R5-232C Interface Figure 3 shows a block diagram of this application's system design. The microprocessor used is an iAPX-186 with two 8256AH's for parallel and serial I/O, as well as for providing a variety of system support functions. One 8256AH is used to implement both the RS-232C modem interface and provide multiplexed parallel I/O. The system uses the Intel 957B System Monitor for control of the system hardware and software development support. The second 8256AH is used for basic serial communication between an ASCII terminal and the Intel 957B System Monitor residing in 16K bytes of EPROM. The two 8256AHs provide a total of six I/O channels - two UARTs and four parallel I/O ports. The software is written in PL/M and is broken up into four separate modules, each containing several procedures. A block diagram of the software structure is given in Figure 4. The modules are identified by the dotted boxes, and the procedures are identified by the solid boxes.. Two or more procedures connected by a solid line means the procedure above calls the procedure below. The procedures without any solid lines connecting them are interrupt procedures. They are entered when the 8256AH interrupts the 80186 and vectors an indirect address to the 80186. When one of the 8256AHs is configured for the serial RS-232C interface, one of its parallel ports, Port I pins 2-7, provides control signals for the serial interface. Four of the RS-232C control signals (CTS, DSRS, DSR and CD) are OR'd to the EXTINT pin of the 8256AH. If any of these signals change from their defined state, an interrupt is generated to the 8256AH. The modem driver software then responds to the interrupt by reading the Port I register, determines the signal generating the interrupt and responds accordingly (see the software listing; INT-,.MOD). In addition to the RS-232C control signals, the communications software can support all of the standard UART error conditions such as framing errors, underrun, overrun and parity, if parity is enabled. Parallel 110 With Handshaking The remaining two Port 1 lines, not used for the RS-232C control signals, provide ACK/OBF and STB/IBF handshaking signals for parallel Port 2. In an environment which utilized the second parallel port, while implementing the above described RS-232C channel, both would operate on an interrupt basis. The interrupt software algorithm depends upon whether the parallel port is configured as input or output, and whether Nested or Normal interrupt mode is programmed. If Nested Interrupt Mode is used, the software flow would default to parallel input or output (as programmed) with Port 2 handshaking the lowest priority interrupt. The serial channel would then interrupt parallel Port 2 transmission whenever the serial channel transmitted or received a character. The RS-232C control signals, OR'd to the External Interrupt (EXTINT) pin, would have the highest interrupt controller priority. The Software Description below describes this in greater. detail. The Serial RS-232C Interface software uses nested interrupts. The priority of the interrupt procedures is given in Figure 5. The priority of the interrupts is not programmable but they are logically oriented so that for this application the priority is correct. The serial receiver should have the highest priority since it could have overrun errors. Therefore the RxD request can interrupt any other interrupt service routine thus preventing any possibility of an overrun error. The Serial RS-232C Interface software is entered via a GO instruction from the 957B System Monitor console. The software first calls POWR-ON-INIT which initializes the 8256AH. This sets the 8256AH to 8086 Mode with parallel Port 2 in two wire handshake mode using Port I pin 0-1 for Port 2 handshaking. The initialization configures six of the Port I lines, pins 2-7, for RS-232C handshaking-input or output depending upon the specific signal tied to the pin. Figure 6 illustrates the definition of each Port I RS-232C handshaking line and its direction. Both the Serial RS-232C Interface and the parallel interface with handshaking operate on an interrupt basis. Following initialization the software enters an endless loop and awaits an interrupt from one of three sources; Receive Data (RxD), Transmit Data (TxD) or the parallel interface. In the serial interface idle state, neither transmitting nor receiving data, the software is constantly responding to TxD interrupts; a result of the Transmit Buffer (TBE) and/or Transmit Register (TRE) being continuely empty. When data is received by the RS-232C channel the RxD interrupt, being of higher priority, asserts its interrupt. 6-466 231125-001 t ~ X, RESET 1.2 RES RESET CLK crs AD 1kD INto WR INTA PLIO ALE SRDY AllOY c... CD ~ '7 INT WA INTA ::LD 00.8& ~ c» N en G) :.::z: T. ....c» C1> -...I 0 .... c» l DEN - DI1R .....----.... STa LOW ~ ->.. G) (I) n :::T CD 3 AI ~ ~ --.I ~ ~ HIGH LOW .... TRCYR ~) L'::===::J ~E 1 17 D,"", ADD~RESS8-'5) • pORr 2 62.. r" ~~R~ SERIAL UO • ... ----- .. -82: ~ ~l H,~-~," ~~'E=~': TaC RaD RIC' CS ALE - "II Iii · RESET ~ EXTINT ::s 1:~~ ~ KINa ~ :.:c uo ING HANDSH IJQ PARAW ~crs DSR .... ' - - RESET EPR~ IK • • (2) RAM 2K • • I~ ~ :'::c ~ ~ L.....-- WR INT DS" co 9578 MON'ITDR 1XC SERIAL RaC EXTINT cs L _ 1kD RaD iNti (3) CTS ALE DATA[?E(o-l5) 8256AH ~ AD,-ADs L - - - - - - - - { J D,.o. 2lI4L ~: ~~~c (2) RAM ZK x, AD~ PORT 1 11'-----'\ :~: 231125-4 '"~ '" ~ uo :.- ... " CCI Co) AP-183 r-------------, r------ I PON·MOD I I MAIN·MOD I I I I ' Tx·Rx·LOOP , ,:L _____________HI----------+,-, ,L______ ______ I, ~ ~ r----------------------------------- ------, ,'NT-MOD 1GB L___________________ . HANDSHAKE·INT , ,,, , , rH~~MOD------ I ~ _~ . I LOAD·INT·TABLE I _________________ JI - -----------,, ,, ,, , , ____________________________ J 231125-5 Figure 4. Block Diagram of the 8256AH Serial RS·232C Interface Software Structure Priority Highest Source Not Used Not Used External Interrupt (EXTINT) 3 Not Used 4 RxD Interrupt 5 TxD Interrupt 6 Timer 2 or 2 & 4 (16 bit) 7 Port 2 Handshaking Figure 5. 8256AH Interrupt Source To Priority Level Map Port 1 Pin No. 0 1 2 Circuit 3 4 5 6 CG CE CD CI CF 7 CC 0 1 2 I/O I I 0 I I I Abrev. Signal Name STB/ACK IBF/OBF CTS RI DTR DSRS RLSD (or CD) DSR Parallel Port 2 Handshaking Signals Clear To Send Ring Indicator Data Terminal Ready Data Signal Rate Selector Receive Line Signal Detector (Carrier Detect) Data Set Ready Figure 6. Port 1 RS·232C Pin Definition 231125·001 AP·183 Although the parallel interface software is not implemented in the software listing of Appendix A, the algo· rithm for implementing multiplexed parallel and serial I/O is to input or output data on the parallel port duro ing the relatively lengthy time required for serial com· munication overhead. The algorithm differs slightly during the serial channel idle state when the software responds to repetitive TxD interrupts. In this case the endless loop would detect the idle state repetitive TxD interrupts and disable the TxD interrupt for a short time while the parallel inputs or outputs data. This would require using one of the 8256AH timers to time out repetitive TxD interrupts. The timer used has to be lower in priority than the RxD interrupt to guarantee protection against overrun errors. Timer 2, or 2 and 4 cascaded if longer time delays are desired, provides the proper interrupt level as shown in Figure 5. Figure 7 shows the Receive Data (RxD) interrupt servo ice routine software flowchart. Since two conditions can generate an RxD Interrupt the Software first reads the Status Register and checks for the Break Detect (DB) bit being set. If the BD bit is clear, no Break condition being present, the data byte is read, stripped to seven bits, for an ASCII character, and sent to the system console via a call to the 957B System Monitor Console Output (CO) routine. Upon return from the 957B monitor call an End Of Interrupt (EOI) is sent to the 8256AH to reset the currently served interrupt level bit in the Interrupt Service Register. Figure 8 shows the Transmit Data (TxD) interrupt service routine software flowchart. There are three con· ditions which may cause a TxD Interrupt; TBE, TRE and Break·In Detect. The TxD service routine first reads the Status Register to determine if the interrupt source is the TBE (Transmit Buffer Empty), if not then the interrupt service routine returns to the MAINMOD loop. If TBE = 1 (true) then a data byte is read from the 957B System Monitor Console Input (CI) rou· tine. If the data byte is an ASCII character it is written to the 8256AH Transmit Buffer. The software exists via an EOI (End Of Interrupt) command to the 8256AH then returns to the MAIN-MOD Rx-Tx-Loop. 231125-6 Figure 7. Receive Data Interrupt Service Routine Software Flowchart 6-469 231125-001 AP·183 N 231125-7 Figure 8.Transmit Data Interrupt Service Routine Software Flowchart ' RS·232C Control Signals Interrupt Structure The overall interrupt scheme is such that a change in a RS-232C handshake line causes an interrupt via the EXTINT pin on the 8256AH (see Figure 3 8256AH/ 80186 Schematic). The EXTINT interrupt is of higher priority than either the RxD or TxD interrupt. This enables the RS-232C handshake signals to manage the receipt or transmission of data via the nested interrupt mode of the 8256AH. The EXTINT interrupt service routine first reads the Port 1 pins 2-7 data and compares it to default state for the signal requiring service. The EXTINT interrupt service routine then calls the appropriate handshake signal service procedure as shown in the bottom module of Figure 4 Software Structure Block Diagram. Each of the individual RS-232C control signal service procedures displays a message on the 957B monitor console device indicating the signal requiring a response. The service procedure then either initiates spe- cltlc predefin,ed actions or prompts the user with options. In a system which utilized file storage, such as a personal computer, the RS-232C software driver could pass a flag to the communications software, rather than a message. The communications software would in tum perform the same types of action but could also protect disk buffering files which might be open at the time of the interrupt. Two examples of the RS-232C Control Signal interrupt service routines, CTS and DSRS, are described below; If Clear To Send (CTS) changes state, the UART automatically disables the transmitter. The CTS interrupt service procedure initializes the 8256AH's internal Timer. If the timer times out before CTS goes active again an interrupt is generated, a second message is displayed at the 957B monitor console prompting the user that the CTS line remains inactive. The options available at this point are to wait again, re-initializing Timer 1, or to disconnect the RS-232C channel. 6-470 231125-001 AP-183 If Data Signal Rate Selector (DSRS) changes state, the software prompts the user with a message that the Data Rates of the two RS-232C channels are not the same and the user is given the option of altering the data rate. This application example was interfaced to a 103A/212 Bell modem and as such prompts the user to select between 300 or 1200 bps data rates. In the case of a non-modem interface the routine could prompt the user for one of the thirteen standard data rates. The software then returns to the TxD/RxD software loop. The balance of the interrupt service procedures for the RS-232C handshaking signals function in a similar manner. Depending upon the specific system design and software requirements, a variety of enhancements could be added to the system design. These could include interrupt traps that initiate specific corrective options or cascading multiple 8256AHs each with an RS-232C interfaces as described above. An example of an interrupt trap might be auto redial upon time out for lack of Carrier Detect (CD) upon initiating a communications link, or automatic disk file update when a receive buffer approaches overflow. The ability of the 8256AH to be reprogrammed to meet the changing requirements of a system simplifies the overall system design and multiplies its capabilities. A simple reinitialization sequence could reconfigure the 8256AH as a UART with two parallel ports or utilize any of the various special functions of the parallel Port I; e.g., an external timer input or an additional external interrupt input; etc. The reinitialization could also configure the 8256AH Multifunction Peripheral for a variety of custom applications. CONCLUSION The functional integration of the 8256AH makes it ideal for designs which require maximum flexibility and simplicity of implementation. The implementation of the RS-232C serial channel modem interface and multiplexed parallel I/O described in this application note represent a level of efficiency in peripheral performance and design previously unavailable. The 8256AH Multifunction Peripheral represents a savings of two-thirds the board space and power required by the previous four chip solution, with the added benefit of increased system reliability. The application note demonstrates the ease of implementing the variety of I/O capabilities and system support functions of the 8256AH. The integration of four common microprocessor system functions into one VLSI device enables the designer to devote valuable resources to adding features to enhance the system design, adding performance and flexibility, and reducing the system's overhead. 6-471 231125-001 APPENDIX A. SOFTWARE LISTING PL/M-86 COMPILER MAINMOD SERIES-III PL/M-86 V2.3 COMPILATION OF MODULE MAINMOD OB~ECT MODULE PLACED IN :F2:56. OBJ COMPILER INVOKED BY: PLM86.86 :F2:56 1* * * * * * * * * * * * ~ * * * * * * * * * * * * * * * * * *. * * * * * * * * * * * * * * 9256AH MULTIFUNCTION PERIPHERAL SIMPLIFIES MICROCOMPUTER 1/0 DESIGN Intel Co"po"ation 3065 Bow.". Avenue Santa Cla"a, Ca. 95051 W"itten Ch"istophe" Scott B~ *** ** ***** ********************** * * * * *• * * * * **1 .MODI86 DEBUG LARGE MAINMOD: DO; 1* 1* 1* 2 - - - - - - - - - 8256AH Registe" I Value I Constant Dech"e Lit DCL - - - - - - - - - - - - - - - *1 *1 - *1 Definitions - - - - - - " Li h"all~ 'lite"all~ lit 'Dec la1".', Pc 51 Cmd1"eg Cmd2"eg Cmd"3"eg Mode"eg lit lit lit lit lit lit lit lit 'Offh " 'Oh " 'lIIh i 1 It l' , 'SOh " 'pcs1 + 0', 'pcsl + 2', 'p c 5 1 + 4', 'pcs1 + 6', Po"tlCt"llReg SetlntReg EnIntReg RstIntReg IntAdd"Reg TxBuffReg RxBuffReg lit lit lit lit lit lit lit 'p c s 1 'pc s 1 'pcsl 'pcsl 'p cs1 'pcsl 'pc 51 + + + + + + + Po"t1R"g Po"t2Reg Time"lReg Time"2R,,g Tim",,3Reg StatReg lit lit lit lit lit lit 'pcsl 'pc 51 'pc 5 1 'pc s 1 'p C5 1 'pc 5 1 + + + + + + T"ue False For.veT' Int,,1 Int,,2 Int,,3 8', Oah', Oah I, Och I , Och', Oeh', Och I, 10h " 12h " 14h' , lah' , 1 ch I, leh' , 'pcsl + 40h " 'cil + 01h', 'p c 51 + 10h " t t t 231125-8 6-472 231125-001 PL/M-Bb COMPILER MAINMOD Intr4 lit 'pest + OSh', Int_Reset SioTxEn Break Dislntr StripTo7fh Port I_Strip lit lit lit lit lit lit lit lit 'BSh " 'lOh " '20h' , '40h' , '04h' , 'OOh " '7fh' , 'OfcH' , Cmdl Cmd2A Cmd2B Cmd3elr Cmd3 Mode EnRcvl' lit lit lit lit lit lit lit '43h' , '07h' , A lit lit lit lit lit lit lit lit lit lit lit lit SioT.Rd~ SioR.Rd~ B DSR DSRJlag CO CO_Flag DSRS DSRS_Flag DTR RI CTS CTS_Flag '09h " '7fh' , 'Oa Ih I, 'OOh' , 'OcOh' , '41h' , '42h' , 'BOh' , 'BOh' , '40h " '40h' , '20h " '20h' , '10h " 'OBh' , '04h " '04h' , (Status, Hndsh k Pins, J) - B~ Char te, Extel'naL B~te Pointeri 3 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 Message Declarations *1 1* DeL CTS_MSG (*) B~te Public Data ('CTS Disabled Receive Data stopped. OAH, ODH, 0) , (*) B~te Public Data ('DSR Disabled. ',OAH, ODH, 00), DSR _t1SG (it) B~te Public Data ( 'CO Disab led. ',OAH, ODH, 00), CD _MSG DSRS_r1SG (it) B~te Public Data ('Enter Baud Rate; ~ 300 B. 1200 (AlB) ',00), eTS2 _t1SG (*) B~te Public Data ('CTS Di.abled. Receive Data stopped. OAH, ODH. 00). Break _MSG (*) B~te Public Data ('Break in Receive Data. ',OAH, OOH, 00); - - - - - - - - - - - - - - *1 1* -- lit lit --- -- -- --- - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 External Procedures: *1 231125-9 6-473 231125-001 PL/M-B6 COMPILER MAINMOD 1* 1* 1* 1* 1* 1* 4 5 1 2 6 2 7 1 B 2 MCO: MCI: *1 *1 957B Monitor Consol. Output Routin. V 957B Monitor Consol. Input Routine - - - - - - *1 *1 *1 MCO: ProcedureCChar) External. DCL Char Byte. End MCO. MCI: Procedure BUte External. End MCI. 1* - - - - - - - - - - - - - - - - - - - - - - - - -'- - - - - *1 1* - - - -, - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* Initialize B256AH Procedure *1 InitS6: Procedure. 10 2 Di .ab I •• 1* Output B256AH Init Data 11 2 OutputCCmdlR.~)aCmdl. 12 2 OutputCCmdlRe~)=Cmd2A. 13 14 2 2 OutputCCmdlReg)=Cmd3Clr. OutputCCmdlReg)=Cmd3. 15 16 2 2 OutputCCmdlReg)-EnRcvr. OutputCCmdlReg)=Mode. 17 IB 2 2 Call Load_Int_Table. Enab Ie. 19 2 *1 1* BOB6 mod". freg=1 kh z. 1 stop bit. and 7 bit char *1 1* odd paritu. system clk=I, 024mhz. and 1200 bps *1 1* clear cmd reg 3 *1 1* reset. itr ack I!nabled. nl!sted intr mod" *1 1* enable rl!ce1v"r *1 1* cascade timl!rs 3&~ for thl! rl!I!ivI!rStim"rSout tim"r. bUtl! & output modI! *1 End Ini t56. 1* - - - - - - - - - - - - - - - - - - - - - - -'- - - - - - - - *1 1* - - - - - - - - - - - - - - - - - - - - - - - - - 1* Procedure: Load Interrupt Address Vectors Load_Int_Table: Procedure Public. 20 21 22 23 24 2 2 25 2 2 2 Call Call Call Call - *1 *1 SetSInterruptC42H.EXTINT). SetSInterruptC44H.Receive_Char). SetSInterrupt(45H.Transmit_Char). S"tSInterrupt(46H.Timer_2_4). End Load_Int_Tabll!' 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* - - - - 1* 1* - - - - - - - - - - - - - - - - - - - - - - *1 EXTINT Intl!rrpt Procedurl!: *1 *1 231125-10 ,6-474 231125-001 PL/M-86 COMPILER MAINMOD 1* Service routine r ... d. the Port 1 RS232 *1 1* h.ndsh .. k. sign.. ls .. nd •• t. the m..... g. pointer *1 1* core.ponding to the Signal d.t.ct.d. *1 1* *1 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 EXTINT: Procedur. Interrupt 42H, 26 27 28 29 30 31 32 33 34 2 2 2 2 3 3 3 2 35 36 2 2 37 38 2 2 39 40 41 42 2 3 3 43 44 3 3 45 46 47 3 2 2 48 2 :3 En .. b Ie, HndShk-Pins-lnputCPort1Reg) .. nd Port1_Stripl If CTSjFlag • HndShk-Pins and CTS Then 001 Me .... g._Ptr-aCTS_MSQCO) I outputCTimer2R.g)=100, Endl El •• If DSRjFI .. g • HndShk_Pin • • nd DSR Th.n Me .... ge_Ptr-aDSR_MSQCO)I Else If CD_FI .. g a HndShk-Pin • • nd CD Then M••• ilge_Ptr=aCD_MSQCO) • Else If DSRS_Flag • HndShk-Pins .. nd DSRS Th.n DO. Me .... ge_Ptr-eDSRS_MSQCO). If MCI • A Then OutputCCmdlReg)-Cmd2AI 1* odd .nd Else I f MCI = 0 Then OutputCCmdlReg)-Cmd2B. 1* odd .. nd End. Call SendJisg. OutPutCRstlntReg)alnt_Re.et. p.. rity. system clk-1. 024mhz. 1200 bps *1 p.. rity. system clk-l. 024mhz. 300 bps *1 End EXTINT. 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* Procedure Rlceive a ch .. r .. cter *1 Receive_Char: Procedure Interrupt 44H. 49 50 51 52 53 54 55 56 57 2 2 2 2 3 3 3 2 58 59 60 61 3 3 3 2 62 2 1., Enab StatusaClnputCStatReg) and SioRxRdyl, If St.. tU5 AND Oreak Then DO. Mess .. ge_Ptr=@Break_MSGCO). Call Send_Msg. Endl Else Do; Char.lnputCRxBuffReg) and StripTo7fh. Cdl MCOCCh"r). End. OutPutCRstIntReg)=Int_Re •• tl 231125-11 6-475 231125-001 PL/M-86 COMPILER MAINMOD 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* - - - - - - - - - - - - - - - - - - - - - - - 1* Procedure: Write character to 8256AH UART Transmit_Char: Procedure Interrupt 45HI 63 64 65 66 67 68 8tetus-CInputCStatRegl and SioRKRdVl1 If Status and SioRKRdV Then Char-CMCI And StripTo7FHII 1* strip to 7 bits *1 If Char >- 20H And Char <- 7fH Then 1* if char is ASCII Dutput it *1 OutputCTKSuffRegl-Char; OutPutCRltlntRegl=Int_Resetl 2 2 2 69 2 2 2 70 2 - *1 *1 End Transmit_CharI 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* - - - - - - - - - - - - - - - - - - - '1* Procedure: Wrih charachr to 856AH UART Timer_2_4: 'PrDcedure Interrupt 46HI 71 72 74 2 2 2 75 2 73 - *1 *1 Message-ptr-eCTS2_MSGCOII Call Send_Msg; OutPutCRstIntRegl-Int_Reset, End Tim.r~_4' 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 1* Message Output Procedure *1 Send_Msg: Procedure, 76 77 78 DCL 2 2 ~·o; 79 2 80 81 82 3 Do While Message(~1 Char-Message (~II Call MCOCChat"I, 83 3 ~·~+1, 3 84 3 2 85 2 End, Return, End Send_Msgl 1* - - - - 1* 1* 86 87 88 1 1 2 <> 0, - - - - - - - - -'- - - - - - - - - - - - - - - - - - *1 Main Program BodV - - - - - - - - - - - - - - - - - - - - *1 *1 Call Ini t56, Do Forever; End; , 1* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *1 231125-12 6-476 ~31125-001 Ap·183 PL/M-B6 COMPILER B9 MAINMOD End M.inMod, MODULE INFORMATION: CODE AREA SIZE • CONSTANT AREA SIZE. VARIABLE AREA SIZE. MAXIMUM STACK SIZE. 2BO LINES READ o PROGRAM WARNINGS o PROGRAM ERRORS 0235H OOBEH 0007H 0034H 565D 190D 7D 52D DICTIONARY SUMMARY: 31KB MEMORY AVAILABLE 6KS MEMORY USED (19X) OKS DISK SPACE USED END OF PL/M-B6 COMPILATION 6-477 231125-001 inter 8272A SINGLE/DOUBLE DENSITY FLOPPY DISK CONTROLLER IBM Compatible In Both Single and • Double Density Recording Formats Programmable Record Lengths: • 128,256,512, orData 1024 Bytes/Sector Multl·Sector and Multl·Track Transfer • Capability Up to 4 Floppy or Mlnl·Floppy • Drives Disks Data Transfers in DMA or Non·DMA • Mode Seek Operations on Up to • Parallel Four Drives Compatible with all Intel and Most • Other Microprocessors • Single· Phase 8 MHz Clock. • Single +5 Volt Power Supply (::!:10%) The 8272A is an LSI Floppy Disk Controller (FDC) Chip, which contains the circuitry and control functions for Inter· facing a processor to 4 Floppy Disk Drives. It is capable of supporting either IBM 3740 single density format (FM), or IBM System 34 Double Density format (MFM) including double sided recording. The 8272A provides control signals which simplIfy the design of an external phase locked loop and write precompensation circuitry. The FDG simplifies and handles most of the burdens associated with Implementing a Floppy Disk Drive Interface. The 8272A Is a pin· .. compatible upgrade to the ~272. D80-7 REGISTERS PSD TERMINAL COUNT PS, WR DATA READY WRITE PROTECTITWO SIDE INDEX FAULTITRACK 0 DS, DS, HDSEL DRIVE SELECT 0 DRIVE SELECT 1 MFM MODE IIW/SEEK HEAD LOAD HEAD SELECT LOW CURRENT/DIRECTION FAULT RESET/STEP elK --... Vee - . . QND - . . . Figure 1. 8272A Internal Block Diagram Intel Corporation Bssumes no responsibility for the USB of any circuitry other than circuitry embodied © 'nt., Corporation, 1982 6-478 Figure 2. Pin Configuration In an Intel product. No other circuit patent licenses are Implied. ORDER NUMBER 210lI06-001 8272A Table 1. Pin Description Symbol RESET RD Pin No. 1 2 Type I 1111 Connec· tlon To JLP JLP Name and Function Reset: Places FDC in Idle state. Resets out· put lines to FDD to "a" (low). Does not clear the last specify command. Read: Control signal for transfer of data from FDC to Data Bus, when "0" (low). WR 3 1111 JLP Write: Control signal for transfer of data to FDC via Data Bus, when "0" (low). CS 4 I JLP Chip Select: IC selected when "a" (low), allow· ing RD and WR to be enabled. Ao 5 1111 JLP Data/Status Register Select: Selects Data Reg (Ao = 1) or. Status Reg (Ao = a) contents to be sent to Data Bus. DB o·DB7 6-13 1/0111 JLP Data Bus: Bidirectional 8·Bit Data Bus. DRO 14 0 DMA Data DMA Request: DMA Request is being made by FDC when DRO "1.,,13 1 DACK 15 I DMA DMA Acknowledge: DMA cycle is active when "0" (low) and Controller is performing DMA transfer. TC 16 I DMA Terminal Count: Indicates the termination of a DMA transfer when "1" (high}I'I. lOX 17 I FDD Index: Indicates the beginning of a disk track. INT 18 0 JLP Interrupt: Interrupt Request Generated by FDC. ClK 19 I GND 20 Symbol Pin No. Type Connectlon To Read Write / SEEK: When "1" (high) Seek mode selected and when "a" (low) Read/ Write mode selected. Name and Function Vcc 40 RW/SEEK 39 0 FDD lCT/DIR 38 0 FDD low Current/Direction: lowers Write current on inner tracks in Read/Write mode, determines direction head will step in Seek mode. FR/STP 37 0 FDD Fault Reset/Step: Resets fault FF in FDD in Read/Write mode, provides step pulses to move head to another cylinder in Seek mode. HDl 36 0 FDD Head Load: Command which causes read/write head in FDD to contact diskette. RDY 35 I FDD WP/TS 34 I FDD Write Protect / Two· Side: Senses Write Pro· teet status in Read/ Write mode, and Two Side Media in Seek mode. FlT/TRKO 33 I FDD Fault/Track 0: Senses FDD fault condition in Read/Write mode and Track a condition in Seek mode. 31,32 0 FDD Precompensatlon (preshift): Write precompensation status during MFM mode. Determines early, late, and normal times. PS PS O " D.C. Power: +5V Ready: Indicates FDD is ready to send or receive data. Must be tied high (gated by the index pulse) for mini floppies which do not normally have a Ready line. Clock: Single Phase 8 MHz (4 MHz for mini floppies) Squarewave Clock. WR DATA 30 0 FDD Write Data: Serial clock and data bits to FDD. Ground: D.C. Power Return. DS " DSo 28,29 0 FDD Drive Select: Selects FDD unit. 27 0 FDD Head Select: Head 1 selected when "1" (high) Head a selected when "O"J!0w}. HDSEl Note 1: Disabled when CS=1. Nole 2: TC must be activated to terminate the Execution Phase of any command. Note 3: ORO is also an input for certain test modes. It should have a 5kO pull-up resistor to prevent activation. 6-479 210606-001 inter 8272A Table 1. Pin Description (Continued) Symbol Pin No. Type Connectlon To MFM 26 0 PLL MFM Mode: MFM mode when "1," FM mode when "0." WE 25 0 FDD Write Enable: Enables write data into FDD. Name and Function Symbol Pin No. Type Connectlon To OW 22 I PLL WRCLK 21 I Name and Function Data Window: Generated by PLL, and used to sample data from FDD. VCO 24 0 PLL VCO Sync: Inhibits VCO in PLL when "0" (low), enables VCO when "1." Write Clock: Write data rate to FDD FM = 500 kHz, MFM = 1 MHz, with a pulse width of 250 ns for both FM and MFM. RD DATA 23 I FDD Read Data: Read data from FDD, containing clock and data bits. Must be enabled for all operations,both Read and Write. I CPU ~ Scan High or Equal Scan Low or Equal Specify Track 0) Sense Interrupt Status Sense Drive Status For more information see the Intel Applic!ltion Notes AP·116 and AP-121. SYSTEM BUS "'" C- "" ". oL I FEATURES ". ;y: DATA WINDOW ORa Br PLL RD DATA WR DATA 8237 OMA CONTROLLER OACK 8272A FOC ;I '"., ,~ INTERFACE INPUT CONTROL ~ ~ Address mark detection circuitry is internal to the FDC which simplifies the phase locked loop and read elec· tronics. The track stepping rate, head load time, and head unload time may be programmed by the user. The 8272A offers many additional features such as multiple sector transfers in both read and write modes with a single command, and full IBM compatibility in both single (FM) and double density (MFM) modes. OUTPUT CONTROL TC TERMINAL - V 8272A ENHANCEMENTS COUNT Figure 3. 8272A System Block Diagram DESCRIPTION Hand-shaking Signals are provided in the 8272A which make DMA operation easy to incorporate with the aid of an external DMA Controller chip, such as the 8237 A. The FDC will operate iii either DMA or Non·DMA mode. In the Non-DMA mode, the FDC generates interrupts to the processor for every transfer of a data byte between the CPU and the 8272A. In the DMA mode, the processor need only load a command into the FDC and all data transfers occur under control of the 8272A and DMA controller. On the 8272A, after detecting the Index Pulse, the VCO Sync output stays low for a shorter period of time. See Figure 4A. On the 8272 there can be a problem reading data when Gap 4A is 00 and there is no lAM. This occurs on some older floppy formats. The 8272A cures this problem by adjusting the veo Sync timing so that it is not low during the data field. See Figure 4B. ... Gap1 Gap4A IIAM I Track Index Pulse ----.r-----1 8272 VCO Syn;;----' 8272A VCO SyiiC' '580 There are 15 separate commands which the 8272A will execute. Each of these commands require multiple 8·bit bytes to fully specify the operation which the processor wishes the FDC to perform. The following commands are available. Read Data Write Data Read ID Format a Track Read Deleted Data Write Deleted Data Read a Track Seek Scan Equal Recalibrate (Restore to ~s In FM mode; 527 ~s 110 I Gap2 I Data ... I I In MFM mode A. Margin on the Index Pulse Track Index Pulse 8272 VCO Sync 8272A VCO Sync Gap 4A (00) -..r-"l I 10 I Gap2 I I Data r-- L-.J B. Ability to Read Data When Gap 4A Contains 00 Figure 4. 8272A Enhancements over the 8272 6-480 210606-001 8272A 8272A REGISTERS - CPU INTERFACE The 8272A contains two registers which may be accessed by the main system processor; a Status Register and a Data Register. The 8-bit Main Status Register contains the status information of the FDC, and may be accessed at any time. The 8-bit Data Register (actually consists of several registers in a stack with only one register presented to the data bus at a time), stores data, commands, parameters, and FDD status information. Data bytes are read out of, or written into, the Data Register in order to program or obtai n the results after execution of a command. The Status Register may only be read and is used to facilitate the transfer of data between the processor and 8272A. The relationshi p between the Status/Data registers and the signals RD, WR, and Ao is shown in Table 2. Table 2. Ao, RD, WR decoding for the selectIon of Status/Data register functlons_ FUNCTION Ao RD WR 0 0 1 Read Main Status Register 0 1 0 Illegal (see note) 0 0 0 Illegal (see note) 1 0 0 Illegal (see note) 1 0 1 Read from Data Register 1 1 0 Write into Data Register Note: Design must guarantee that the 8272A is not subjected to illegal inputs_. The Main Status Register bits are defined in Table 3. Table 3_ Main Status Register bit descriptlon_ BIT tlUMBER !lAME SYMBOL DESCRIPTIOtl 00 FOD 0 Busy °oB FOD ,number a Is In the Seek mode. 01 FOD 1 Busy °l B FoD number 1 Is In the Seek mode. 02 FOD 2 Busy °2 B FOD number 2 is In the Seek mode. 03 FOD 3 Busy °3 B FOD number 3 is In the Seek mode. 04 FOC Busy CB A read or write command is in 05 Non·DMA mode NOM The FOC is in the non·OMA mode. This bit Is set only durIng the execution phase in non·DMA mode. Transition to process. "0" state Indicates execution phase has ended. 06 Data input/Output 010 Indicates direction of data transfer between FOC and Ot Register. If 010="1" then transfer Is from Data Register to the Processor. If 010="0", then transfer Is from the Proc· ossor to Data Register. 07 Request for Master RQM Indicates Data Register Is ready to send or receive data to or from the Processor. Bot bits 010 and ROM should be used to perform the handshaking functions of "ready" and "direction" to the processor. The 010 and ROM bits in the Status Register indicate when Data is ready and in which direction data will be transferred on the Data Bus. Note: There is a 121lS or 24115 ROM flag delay when using an 8 or 4 MHz clock respectively_ OATAIN·OUT (010) OUT OF PROCESSOR AND INTO FDC REQUEST FOR MASTER (ROM) Wi -----uI 1.1 uI I I iiii I I • I . NOTES: ~ - DATA REOISTER 00 - DATA REGISTER !&l - DATA REGISTER PROCESSOR [2] - DATA REGISTER PROCESSOR I I I• I 1 c I • I READY TO BE WRI"EN INTO IY PROCESSOR NOT REAOY TO 8E WRITTEN INTO BY PROCESSOR READY FOR NEXT DATA 8YTE TO BE READ BY THE NOT READY FOR NEXT OATA BYTE TO BE READ BY Figure 5_ Status Register Timing The 8272A is capable of executing 15 different commands. Each. command is initiated- by a multi-byte transfer from the processor, and the result after execution of the command may also be a multi-byte transfer back to the processor. Because of this multi-byte inter-· change of information between the 8272A and the ·processor, it is convenient to consider each command as consisting of three phases: Command Phase: The FDC receives all information required to perform a particular operation from the processor. Execution Phase: The FDC performs the operation it was instructed to do. Result Phase: After completion of the operation, status and other housekeeping Information are made available to the processor. During Command or Result Phases the Main Status Register (described in Table 3) must be read by the processor before each byte of information is written into or read from the Data Register. Bits 06 and D7 in the Main Status Register must be in a 0 and 1 state, respectively, before each byte of the command word may be written into the 8272A. Many of the commands require multiple bytes, and as a result the Main Status Register.must be read prior to each byte transfer to the 8272A. On the other hand, during the Result Phase, 06 and 07 in the Main Status Register must both be 1's (06 = 1 and 07 = 1) before reading each byte from the Data Register. Note, this reading of the Main Status Register before each byte transfer to the 8272A is required in only the Command and Result Phases, and NOT during the Execution Phase. During the Execution Phase, the Main Status Register need not be read. If the 8272A is in the non-DMA Mode, then the receipt of each data byte (if 8272A is reading data from FDD) is indicated by an Interrupt signal on pin 18 (INT 1). The generation of a Read Signal (RD 0) will reset the Interrupt as well as output the Data onto = = 210606-001 8272A the Data Bus. For example, if the processor cannot handle Interrupts fast enough (every 13 ,..s for MFM mode) then it may poll the Main Status Register and then bit 07 (ROM) functions just like the Interrupt signal. If a Write Command is in process, then the WR signal performs the reset to the Interrupt signal. It is important to note that during the Result Phase all bytes shown in the Command Table must be read. The Read Data Command, for example, has seven bytes of data in the Result Phase. All seven bytes must be read in order to successfully complete the Read Data Com· mand. The 8272A will not accept a new command until all seven bytes have been read. Other commands may require fewer bytes to be read during the Result Phase. The 8272A always operates in a multi·sector transfer mode. It continues to transfer data until the TC input is active. In Non·DMA Mode, the system must supply the TC input. The 8272A contains five Status Registers. The Main Status Register mentioned above may be read by the processor at any time. The other four Status Registers (STO, ST1, ST2, and ST3) are only available during the Result Phase, and may be read only after successfully completing a command. The particular command which has been executed determines how many of the Status Registers will be read. If the 8272A is in the DMA Mode, no Interrupts are gener· ated during the Execution Phase. The 8272A generates ORa's (DMA Requests) when each byte of data is available. The DMA Controller responds to this request with both a DACK = 0 (DMA Acknowledge) and a RD = 0 (Read signal). When the DMA Acknowledge signal goes low (DACK = 0) then the DMA Request is reset (ORO = 0). If a Write Command has been programmed then a WR signal will appear instead of RD. After the Execution Phase has been completed (Terminal Count has occurred) then an Interrupt will occur (INT = 1). This signifies the beginning of the Result Phase. When the first byte of data is read during the Result Phase, the In· terrupt is automatically reset (lNT = 0). The bytes of data which are sent to the 8272A to form the Command Phase, and are read out of the 8272A in the Result Phase, must occur in the order shown in the Table 4. That is, the Command Code must be sent first and the other bytes sent in the prescribed sequence. No foreshortening of the Command or Result Phases are allowed. After the last byte of data in the Command Phase is sent to the 8272A, the Execution Phase Table 4. 8272A Command Set DATA BUS PHASE RIW ~ D6 Ds D4 D3 Dl Do REMARKS PHASE RIW D7 D6 DS READ DATA Command W W W W W W W W W MT MFM SK 0 0 0 0 0 0 0 1 1 0 Command Codes Command HOS OSl OSO Sector 10 information prior to Command C H R N EOT GPl OTl A A A A A A A execution STO ST 1 ST2 C H Data transfer between the FDD and main-system Execution Status information after Command execution Result Sector 10 Information after command execution A N W W W W W W W W W MT MFM 0 0 W W W W W W W W W MT MFM SK 0 0 0 1 0 0 0 0 0 1 HOS 051 050 C H A N EOT GPl DTl _ _ _ _ Execution A A A A A A A Result D3 D2 Dl DO STO ST 1 ST 2 _____ C H A N 0 0 0 0 0 0 0 1 REMARKS 1 Command Codes HOS OS1 !DSO Sector to information prior to Command execution C H A N EOT GPl OTl Data transfer between the mainsystem and FOD Status information after Command execution STO STl ST2 C A A A A A A A Sector ID information after Command execution H A N WRITE DELETED DATA READ DELETED DATA Command D4 WRITE DATA Execution Result I DATA BUS D2 Command Codes Command Sector ID information prior to Command execution Data transfer between the FDO and main·system Execution Status information after Command execution Result Sector ID in'ormation after Command execution W W W W W W W W W MT MFM 0 0 0 0 0 0 1 0 1 0 0 HOS 051 050 C H R ______ Command Codes Sector 10 information prior to Command execution N EOT _ _ _ _ _ GPl DTl Data transfer between the FOD and main-system A A A A A A A STO ST 1 ST 2 C H A N Status information after Command execution Sector ID information after Command execution Note: 1. Symbols used In this table are described at the end of this section. = 2. AO 1 for all operations. 3. X = Don't care, usually made to equal binary O. 6-482 210606-001 8272A Table 4. 8272A Command Set (Continued) I PHASE RIW DATA BUS I 07 06 04 05 03 DATA BUS 02 01 DO REMARKS PHASE RIW I 07 06 W 0 W 0 MFM SK 0 0 0 0 0 W W W W W W W 0 1 0 0 HOS OSl OSO Command Command Codes C H Sector 10 Information prior to Command R execution N EOT GPL OTL R R R R R R R Result Status Information after Command execution STO ST 1 ST 2 C H Sector 10 Information after Command execution R N W W 0 0 MFM 0 0 0 0 0 1 0 0 1 HOS DS1 0 R R R R R R R STO ST 1 ST 2 C H Commands The first correct 10 information on the Cylinder Is stored in Data Register R Execution Status information after Command execution Result FORMAT A TRACK Command W 0 W 0 MFM 0 0 0 W W W W 0 0 1 0 1 1 0 HOS OSl OSO N SC GPL _ _ _ _ _ 0 Result R R R R R R R Bytes/Sector Sectors/Cylinder Gap 3 Filler Byte W W W W W W W W W MT MFM SK 0 0 0 1 0 0 0 C H R Result 1 0 0 HOS OSl OSO STO ST 1 ST 2 C H R N 1 1 0 0 0 0 1 HOS OSl OSO C H Command Codes Sector 10 Information prior Command execution R N EOT GPL STP R R R R R R R W ST 0 ST 1 ST 2 C H Status Information after Command execution Sector 10 Information after Command execution R N MT MFM SK 0 0 0 1 0 1 0 W W W C H W W N EOT GPL STP 1 0 1 HOS OSl OSO Command Codes Sector 10 Information prior Command execution R Data compared between the FDO and main-system R R R R R R R Status information after Command execution ST 0 ST 1 ST 2 C H Sector 10 information after Command execution R N W 0 0 0 W 0 0 0 0 0 1 0 0 0 1 1 OSl DSO Command Codes Head retracted to Track 0 Command Result W Command W 0 0 0 R R 1 ST 0 PCN 0 0 0 0 Command Codes Status information at the end of each seek operation about the FOC SPECIFY 0 _ Command Codes 0 0 0 0 0 1 1 SRT _ _' . _ _ _ HUT HLT • NO Command Codes SENSE DRIVE STATUS Sector 10 information prior to Command execution Command W W Result R Command W 0 0 0 0 0 0 0 0 0 0 ST 3 1 0 0 HOS OSl OSO Command Codes Status Information about FOo SEEK Data compared between the FOD and main-system R R R R R R R 0 Data compared between the FOD and main-system W W N EOT GPL STP Execution REMARKS SENSE INTERRUPT STATUS In this case, the 10 Information has no meaning R N 0 Execution SCAN EQUAL Command DO RECALIBRATE Command Status information after Command execution ST 0 STl ST 2 C H 0 Command Codes FOC formats an entire cylinder Execution MT MFM SK W W Sector 10 information during Executlon Phase N W W W W W W W W W W eso Execution Result 01 SCAN HIGH OR EQUAL Command READ 10 Command 02 03 Execution Data transfer between the FOD and maln·system. FOC reads all of cylinders contents Irom Index hole to EOT Executlon Result 04 SCAN LOW OR EQUAL READ A TRACK Command 05 W W 0 0 0 0 0 0 0 1 0 0 NCN 1 1 1 HOS OSl DSO Execution Status information alte r Command execution Sector 10 Information after Command execution Command Codes Head Is positioned o .... er proper Cylinder on Diskette INVALID Command W _ _ _ _ In ....alld Codes _ _ _ _ Result R ST 0 Invalid Command Codes (NoOp- FDC goes into Standby State) ST 0= 80 (16) 6-483 210606-001 8272A Table 5. Command Mneumonlcs , NAME SYMBOL Address Line 0 AO DESCRIPTION NAME DESCRIPTION NCN New Cylinder Number NCN stands for a new Cylinder number. which Is going to be reached as a result of the Seek operation. Desired position of Head. SYMBOL At) controls selection of Main Status Register (AO=O) or Data Register (AO= 1). C Cylinder Number C stands for the current selected Cylinder ,track number 0 through 76 of the medium. D Data o stands for the data pattern which Is going to be written Into a Sector. NO Non·DMA Mode NO stands for operation in the Non·DMA Mode. 07- 0 0 Oala Bus 8-blt Data Bus where 07 Is the most PCN Present Cylinder Number PCN stands for the Cylinder number at the completion of SENSE INTERRUPT STATUS Command. POSition of Head at present time. R Record significant bit, and DO Is the least slgnlfl· cant bit. OS stands for a selected drive number 0 OSO,OSl Drive Select OTL Data Length R/W Read/Write R/W stands for either Read (R) or Write (W) signal. EOT End of Track EOT stands for the final Sector number of a Cylinder. SC Sector SC indicates the number of Sectors per Cylinder. GPL Gap Length GPL stands for the length of Gap 3 (spacing between Sectors excluding VCO Sync Field). SK Skip SK stands for Skip Deleted Data Address Mark. SAT Step Rate Time SRT stands for the Stepping Rate for the FDD (1 to 16 ms in 1 ms increments). The same Stepping Rate applies to all drives (F=l ms, E=2 ms, etc.). STO STl ST 2 ST 3 Status 0 Status 1 Status 2 Status J ST 0-3 stand for one of four registers which store the status Information after a command has been executed. This information is available during the result phase after command execution. These registers should not be confused with the main status register (selected by = 0). ST 0-3 may be read only after a command has been executed and contain Information relevant to that particular command. or1. read out or write Into the Sector. H Head Address H stands for head number 0 or 1, as specified In 10 field. HOS Head Select HD5 stands for a selected head number 0 or 1 (H = HDS In all command words). HLT Head load Time HlT stands for the head load time in the FDD (2 to 254ms In 2ms increments). HUT Head Unload Time HUT stands for the head unload time after a read or write operation has occurred (16 to 240ms in 16ms increments). MFM FM or MFM Mode If MF Is low, FM mode Is selected and 11 Ao it is high, MFM mode is selected. MT Multi-Track If MT Is high, a multl·track operation Is to be performed (a cylinder under both HOO and HDl will be read or written). N Number N stands for the number of data bytes written in a Sector. R stands for the Sector number. which will be read or written. When N is defined as 00, DTL stands for the data length which users are going to STP During a Scan operation, if STP= 1, the data in contiguous sectors Is compared byte by byte with data sent from the processor (or DMA), and If STP = 2, then alternate sectors are read and compared. automatically starts. In a Similar fashion, when the last byte of data is read out in the Result Phase, the command is automatically ended and the 8272A is ready for a new command, A command may be aborted by simply sending a Terminal Count signal to pin 16 (TC 1), This is a convenient means of ensuring that the processor may always get the 8272A's attention even if the disk system hangs up in an abnormal manner. into the Data Register. The DIO (DB6) and ROM (DB7) bits in the Main Status Register must be in the "0" and "1" states respectively, before each byte of the command may be written into the 8272A. The beginning of the execution phase for any of these commands will cause DIO and ROM to switch to "1" and "0" states respectively. POLLING FEATURE OF THE 8272A A set of nine (9) byte words are required to place the FDC into th~ Read Data Mode, After the Read Data command has been issued the FDC loads the head (if it Is in the unloaded state), waits the specified head settling time (defined in the Specify Command), and begins reading ID Address Marks and ID fields. When the current sector number ("R") stored in the ID Register (IDR) compares with the sector number read off the diskette, then the FDC outputs data (from the data field) byte-bybyte to the main system via the data bus. After completion of the read operation from the current sector, the Sector Number is incremented by one, and the data from the next sector is read and output on the data bus. This continuous read function is called a "Multi-Sector Read Operation," The Read Data Command must be terminated by the receipt of a Terminal Count signal. Upon receipt of this signal, the FDC stops outputting data to the processor, but will continue to read data from the current sector, check CRC (Cyclic Redundancy Count) bytes, and then at the end of the sector terminate the Read Data Command. The amount of data which can be handled with a single command to the FDC depends upon MT (multi-track), MFM (MFM/FM), and N (Number of Bytes/Sector), Table 7 on the next page shows the Transfer Capacity. = After power-up RESET, the Drive Select Lines DSO and DS1 will automatically go into a polling mode. In between commands (and between step pulses in the SEEK command) the 8272A polls all four FDDs looking for a change in the Ready line from any of the drives, I(the Ready line changes state (usually due to a door opening or closing) then the 8272A will generate an interrupt. When Status Register 0 (STO) is read (after Sense Interrupt Status is issued), Not Ready (NR) will be indicated. The polling of the Ready line by the 8272A occurs continuously between instructions, thus notifying the processor which drives are on or off line. Approximate scan timing is shown in Table 6. Table 6. Scan Timing OSl DSO APPROXIMATE SCAN TIMING 0 0 220",5 0 1 220"S 1 1 0 220"S 1 440JolS COMMAND DESCRIPTIONS During the Command Phase, the Main Status Register must be polled by the CPU before each byte is written 6-484 READ DATA 210606-001 8272A Table 7. Transfer Capacity Multl·Track Maximum Transf.r Capacity (Bylaa/Sector) (Number of Sectors) Final Sector R.ad MT MFM/FM MFM Bytes/Sector N 0 0 0 1 00 01 (12B) (26)= 3.32B (256) (26)= 6.656 26 at Side 0 or 26 at Side 1 26 at Side 1 trom Diskette 1 1 0 1 00 01 (12B) (52) = 6.656 (256) (52)= 13.312 0 0 0 1 01 02 (256) (15) = 3.B40 (512)(15)= 7.6BO 15 at Side a or 15 at Side 1 1 1 0 1 01 02 (256)(30) = 7.6BO (512) (30)= 15.360 15 al Side 1 0 0 0 1 02 03 (512) (B) = 4.096 (1024) (B) = B.192 8 at Side 0 or 8 at Side 1 1 1 0 1 02 03 (512) (16)= B.192 (1024) (16)= 16.3B4 8 at Side 1 During disk data transfers between the FDC and the processor, via the data bus, the FDC must be serviced by the processor every 27 I's in the FM Mode, and every 131's in the MFM Mode, or the FDC sets the OR (Over Run) flag in Status Register 1 to a 1 (high), and terminates the Read Data Command. The "multi·track" function (MT) allows the FDC to read data from both sides of the diskette. For a particular cylinder, data will be transferred starting at Sector 1, Side 0 and completing at Sector L, Side 1 (Sector L = last sector on the side). Note, this function pertains to only one cylinder (the same track) on each side of the diskette. If the processor terminates a read (or write) operation in the FDC, then the ID Information in the Result Phase is dependent upon the state of the MT bit and EOT byte. Table 5 shows the values for C, H, R, and N, when the processor terminates the Command. When N = 0, then DTL defines the data length which the FDC must treat as a sector. If DTL is smaller than the actual data length in a Sector, the data beyond DTL in the Sector is not sent to the Data Bus. The FDC reads (internally) the complete Sector performing the CRC check, and depending upon the manner of command termination, may perform a Multi-Sector Read Operation. When N is non-zero, then DTL has no meaning and should be set to OFFH. Table 8. ID Information When Processor Terminates Command MT At the completion of the Read Data Command, the head is not unloaded until after Head Unload Time Interval (specified in .the Specify Command) has elapsed. If the processor issues another command before the head unloads then the head settling time may be saved between subsequent reads. This time out is particularly valuable when a diskette is copied from one drive to another. EOT 1A OF 08 Sector 1 to 25 at Side 0 Sector 1 to 14 at Side 0 Sector 1 to 7 at Side 0 1A OF OB Sector 26 at Side 0 1A OF 08 Sector 1 to 25 at Side 1 0 1A OF If the FDC detects the Index Hole twice without finding the right sector, (indicated in "R"), then the FDC sets the ND (No Data) flag in Status Register 1 to a 1 (high), and terminates the Read Data Command. (Status Register 0 also has bits 7 and 6 set to 0 and 1 respectively.) After reading the ID and Data Fields in each sector, the FDC checks the CRC bytes. If a read error is detected (incorrect CRC in ID field), the FDC sets the DE (Data Error) flag in Status Register 1 to a 1 (high), and if a CRC error occurs in the Data Field the FDC also sets the DD (Data Error in Data Field) flag in Status Register 2 to a 1 (high), and terminates the Read Data Command. (Status Register 0 also has bits 7 and 6 set to 0 and 1 respectively.) If the FDC reads a Deleted Data Address Mark off the diskette, and the SK bit (bit D5 in the first Command Word) is not set (SK = 0), then the FDC sets the CM (Control Mark) flag in Status Register 2 to a 1 (high), and terminates the Read Data Command, after reading all the data in the Sector. If SK= 1, the FDC skips the sector with the Deleted Data Address Mark and reads the next sector. Final SectorTrans.erred to Processor Sector 15 at Side 0 10 Information at Result Ph ••• C H R N NC NC R+1 NC C+1 NC R=01 NC NC NC R+1 NC C+1 NC R=01 NC Sector B at Side 0 Sector 1 to 14 at Side 1 Sector 1 to 7 al Side 1 Sector 26 at Side 1 DB Sector 15 at Side 1 Sector 8 at.Slde 1 1A OF OB Sector 1 to 25 at Side a Sector 1 to 14 at Side a Sector 1 to 7 at Side a NC NC R+1 NC 1A OF OB Sector 26 at Side a Sector 15 at Side a Sector 8 at Side a NC LSB R=01 NC 1A OF 08 Sector 1 to 25 at Side 1 Sector 1 to 14 at Side 1 Sector 1 to 7 at Side 1 NC NC R+1 NC 1A OF OB Sector 26 at Side 1 Sector 15 at Side 1 Sector 8 at Side 1 C+1 LSB R=01 NC 1 Notes: 1. NC (No Change): The same value as the one at the beginning of command execution. 2. LSB (Least Significant Bit): The least significant bit of H Is complemented. WRITE DATA A set of nine (9) bytes are required to set the FDC into the Write Data mode. After the Write Data command has been issued the FDC loads the head (if it is in the unloaded state), walts the specified head settling time (defined in the Specify Command), and begins reading ID Fields. When the current sector number ("RU), stored in the ID Register (lDR) compares with the sector 6-485 210606-001 inter 8272A number read off the diskette, then the FDC takes data from the processor byte·by·byte via the data bus, and outputs It to the FDD. After writing data Into the current sector, the Sector Number stored In "R" Is Incremented by one, and the next data field Is written Into. The FDC continues this "Multl·Sector Write Operation" until the issuance of a Terminal Count signal. If a Terminal Count signal Is sent to the FDC it continues writing into the current sector to complete the data field. If the Terminal Count signal is received while a data field is being written then the reo malnder of the data field is filled with 00 (zeros). The FDC reads the ID field of each sector and checks the CRC bytes. If the FDC detects a read error (incorrect CRC) in one of the 10 Fields, it sets the DE (Data Error) flag of Status Register 1 to a 1 (high), and terminates the Write Data Command. (Status Register 0 also has bits 7 and 6 set to 0 and 1 respectively.) The Write Command operates in much the same manner as the Read Command. The following items are the same; refer to the Read Data Command for details: • Transfer Capacity • EN (End of Cylinder) Flag • NO (No Data) Ffag • Head Unload Time Interval • ID Information when the processor terminates com· mand (see Table 2) • Definition of DTL when N = 0 and when N '" 0 In the Write Data mode, data transfers between the proc· essor and FDC must occur every 31 ,..S in the FM mode, and every 15 ,..S in the MFM mode. If the time interval between data transfers is longer than this then the FDC sets the OR (Over Run) flag in Status Register 1 to a 1 (high), and terminates the Write Data Command. For mini·floppies, multiple track writes are usually not permitted. This is because of the turn·off time of the' erase head coils-the head switches tracks before the erase head turns off. Therefore the system should typically wait 1.3 mS. before attempting to step or change sides. WRITE DELETED DATA This command is the same as the Write Data Command except a Deleted Data Address Mark is written at the beginning of the Data Field instead of the normal Data Address Mark. READ DELETED DATA This command is the same as the Read Data Command except that when the FDC detects a Data Address Mark at the beginning of a Data Field (and SK 0 (low)), it will read all the data in the sector and set the CM flag in Status Register 2 to a 1 (high), and then terminate the command. If SK 1, then the FDC skips the sector with the Data Address Mark and reads the next sector. = = READ A TRACK This command is similar to READ DATA Command except that the entire data field is read continuously from each of the sectors of a track. Immediately after encountering the INDEX HOLE, the FDC starts reading all data fields on the track as continuous blocks of data. If the FDC finds an error In the 10 or DATA CRC check bytes, It continues to read data from the track. The FOe compares the 10 Information read from each sector with the value stored in the lOR, and sets the NO flag of Status Register 1 to a 1 (high) if there is no comparison. Multl·track or skip operations are not allowed with this command. This command terminates when EOT number of sectors have been read. If the FDC does not find an 10 Address Mark on the diskette after it encounters the INDEX HOLE for the second time, then It sets the MA (missing address mark) flag In Status Register 1 to a 1 (high), and terminates the command. (Status Register 0 has bits 7 and 6 set to 0 and 1 respectively.) READID The READ 10 Command is used to give the present posl· tion of the recording head. The FDC stores the values from the first 10 Field it is able to read. If no proper 10 Address Mark is found on the diskette, before the IN· DEX HOLE is encountered for the second time then the MA (Missing Address Mark) flag in Status Register 1 is set to a 1 (high), and if no data is found then the NO (No Data) flag Is also set in Status Register 1 to a 1 (high) and the command is terminated. FORMAT A TRACK The Format Command allows an entire track to be for· matted. After the INDEX HOLE is detected,Data is writ· ten on the Diskette: Gaps, Address Marks, 10 Fields and Data Fields, all per the IBM System 34 (Double Density) or System 3740 (Single Density) Format are recorded. The particular format which will be written is controlled by the values programmed into N (number of bytes/sec· tor), SC (sectors/cylinder), GPL (Gap Length), and 0 (Data Pattern) which are supplied by the processordur· ing the Command Phase. The Data Field is filled with the Byte of data stored in D. The ID Field for each sector is supplied by the processor; that is, four data requests per sector are made by the FDC for C (Cylinder Number), H (Head Number), R (Sector Number) and N (Number of Bytes/Sector). This allows the diskette to be formatted with nonsequential sector numbers, if desired. After formatting each sector, the processor must send new values for e, H, R, and N to the 8272A for each sec· tor on the track. The contents of the R Register is in· cremented by one after each sector is formatted, thus, the R register contains a value of R + 1 when it is read during the Result Phase. This incrementing and format· ting continues for the whole track until the FDC en· . counters the INDEX HOLE for the second time, where· upon it terminates the command. If a FAULT signal is received from the FDD at the end of a write operation, then the FDe sets the Ee flag of Status Register 0 to a 1 (high), and terminates the com· mand after setting bits 7 and 6 of Status Register 0 to 0 and 1 respectively. Also the loss of a READY signal at the beginning of a command execution phase causes command termination. Table 9 shows the relationship between N, SC, and GPL for various sector sizes: 6-486 210606-001 8272A Table 9. Sector Size Relationships. 51(. S" STANDARD FLOPPY W MINI FLOPPY FORMAT SECTOR SIZE N SC GPL1 GPL2 REMARKS SECTOR SIZE N SC GPL 1 GPL2 FM Mode 128 bytes/Sector 256 512 1024 2048 4096 00 01 02 03 04 05 lA OF 08 04 02 01 07 OE 18 47 lB 2A 3A 8A FF FF IBM Diskette 1 IBM Diskette 2 128 bytes/Seclor 128 256 512 1024 2048 00 00 01 02 03 04 12 10 08 04 02 01 07 10 18 46 09 19 30 87 FF FF 01 02 03 04 05 06 lA OF 08 04 02 01 OE lB 35 36 54 74 FF FF FF IBM Diskette 20 01 01 02 03 04 05 12 10 08 04 02 01 MPM Mode 256 512 1024 2048 4096 8192 C8 C8 99 C8 C8 IBM Diskette 20 256 256 512 1024 2048 4096 C8 C8 OA 20 2A 80 C8 C8 OC 32 50 FO FF FF Note: 1. Suggested values of GPL In Read or Write Commands to avoid splice point between data field and 10 field of contiguous sections. 2. Suggested values of GPL In format command. SCAN COMMANDS The SCAN Commands allow data which is being read from the diskette to be compared against data which is being supplied from the main system (Processor in NON·DMA mode, and DMA Controller in DMA mode). The FDC compares the data on a byte· by· byte basis, and looks for a sector of data which meets the conditions of DFDD DP,ocesso,; DFDD ~ DP,ocesso" or DFDD;' DP,ocesso,' Ones complement arithmetic is used for comparison (FF = largest number, 00 = smallest number).' After a whole sector of data is compared, if the cond itions are not met, the sector number is incremented (R + STP R), and the scan operation is continued. The scan opera· tion continues until one of the following conditions oc· cur; the conditions for scan are met (equal, low, or high), the last sector on the track is reached (EaT), or the ter· minal count signal is received. = If the conditions for scan are met then the FDC sets the SH (Scan Hit) flag of Status Register 2 to a 1 (high), and terminates the Scan Command. If the conditions for scan are not met between the starting sector (as specified by R) and the last sector on the cylinder (EaT), then the FDC sets the SN (Scan Not Satisfied) flag of Status Register 2 to a 1 (high), and terminates the Scan Command. The receipt of a TERMINAL COUNT signal from the Processor or DMA Controller during the scan operation will cause the FDC to complete the com· parison of the particular byte which is in process, and then to terminate the command. Table 10 shows the status of bits SH and SN under various conditions of SCAN. Table 10. Scan Status Codes STATUS REGISTER 2 COMMAND Scan Equal Scan Low or Equal BIT2=SN COMMENTS 0 1 o' 1 DFDO = Dprocessor DFDD 4= Dprocessor 0 1 OF DO = Dprocessor 0 0 0 DFDD 1 OF DO = Dprocessor OF DO > Dprocessor OF DO ;t 0processor 1 Scan High or Equal BIT3=SH 0 0 0 1 0 Mark) flag of Status Register 2 to a 1 (high) and ter· minates the command. If SK= 1, the FDC skips the sec· tor, with the Deleted Address Mark, and reads the next sector. In the second case (SK= 1), the FDC sets the CM (Control Mark) flag of Status Register 2 to a 1 (high) in order to show that a Deleted Sector had been en· countered. When either the STP (contiguous sectors STP = 01, or alternate sectors STP = 02 sectors are read) or the MT (Multi·Track) are programmed, it is necessary to remember that the last sector on the track must be read. For example, if STP = 02, MT = 0, the sectors are numbered sequentially 1 through 26, and we start the Scan Command at sector 21; the following will happen. Sectors 21, 23, and 25 wi II be read, then the next sector (26) will be skipped and the Index Hole will be en· countered before the EaT value of 26 can be read. This will result in an abnormal termination of the command. If the EaT had been set at 25 or the scanning started at sector 20, then the Scan Command would be completed in a normal manner. During the Scan Command data is supplied by either the processor or DMA Controller for comparison against the data read from the diskette. In order to avoid having the OR (Over Run) flag set in Status Register 1, it is nec· essary to have the data available in less than 27 I'S (FM Mode) or 13 I's (MFM Mode). If an Overrun occurs the FDC terminates the command. SEEK The read/write head within the FDD is moved from cylinder to cylinder under control of the Seek Command. The FDC compares the PCN (Present Cylinder Number) which is the current head position with the NCN (New Cylinder Number), and performs the following operation if there is a difference: PCN < NCN: Direction signal to FDD set to a 1 (high), and Step Pulses are issued. (Step In.) < 0processor PCN > NCN: Direction signal to FDD set to a 0 (low), and Step Pulses are issued. (Step Out.) DFDD ~ Dprocessor If the FDC encounters a Deleted Data Address Mark on one of the sectors (and SK = 0), then it regards the sec· tor as the last sector on the cylinder, sets GM (Control The rate at which Step Pulses are issued is controlled by SRT (Stepping Rate Time) in the SPECIFY Command. After each Step Pulse is issued NCN is compared against PCN, and when NCN= PCN, then the SE (Seek End) flag is set in Status Register 0 to a 1 (high), and the command is terminated. 6-487 210606-001 8272A Table 11. Seek, Interrupt Codes During the Command Phase of the Seek operation the FDC is in the FDC BUSY state, but during the Execution Phase it is in the NON BUSY state. While the FDC is in the NON BUSY state, another Seek Command may be issued, and in this manner parallel seek operations may be done on up to 4 Drives at once. SEEK END INTERRUPT CODE BIT 5 BIT6 BIT7 I! an FDD is in a NOT READY state at the beginning of the command execution phase or during the seek operation, then the NR (NOT READY) flag is set in Status Register 0 to a 1 (high), and the command Is terminated. Note that the 8272A Read and Write Commands do not have implied Seeks. Any R/W command should be preceded by: 1) Seek Command; 2) Sense Interrupt Status; and 3) Read ID. RECAliBRATE This command causes the read/write head within the FDD to retract to the Track 0 position. The FDC clears the contents Of the PCN counter, and checks the status of the Track 0 signal from the FDD. As long as the Track o signal is low, the Direction signal remains 1 (high) and Step Pulses are issued. When the Track 0 signal goes high, the SE (SEEK END) flag in Status Register 0 is set to a 1 (high) and the command is terminated. I! the Track o signal is still low after 77 Step Pulses have been issued, the FDC sets the SE (SEEK END) and EC (EQUIPMENT CHECK) flags of Status Register 0 to both 1s (highs), and terminates the command. The ability to overlap RECALIBRATE Commands to multiple FDDs, and the loss of the READY Signal, as described in the SEEK Command, also applies to the RECALIBRATE Command. CAUSE 0 1 1 Ready Line changed state, either polarity 1 0 0 Normal Termination of Seek or Recalibrate Command 1 1 0 Abnormal Termination of Seek or Recalibrate Command SPECIFY The Specify Command sets the initial values for each of the three internal timers. The HUT (Head Unload Time) defines the time from the end of the Execution Phase of one of the Read/Write Commands to the head unload state. This timer is programmable from 16 to 240 ms in increments of 16 ms (01 = 16 ms, 02=32 ms .... OF= 240 ms). The SRT (Step Rate Time) defines the time interval between adjacent step pulses. This timer is programmable from 1 to 16 ms in increments of 1 ms (F = 1 ms, E = 2 ms, D = 3 ms, etc.). The H l T (Head load Time) defines the time between when the Head load signal goes high and when the Read/Write operation starts. This timer is programmable from 2 to 254 ms in increments of 2 ms (01 = 2 ms, 02 = 4 ms, 03 = 6 ms .... FE=254 ms). The step rate should be programmed 1 mS longer than the minimum time required by the drive. SENSE INTERRUPT STATUS An Interrupt signal is generated by the FDC for one of the following reasons: The time intervals mentioned above are a direct function of the clock (ClK on pin 19). Times indicated above are for an 8 MHz clock, if the clock was reduced to 4 MHz (mini-floppy application) then all time intervals are increased by a factor of 2. The choice of DMA or NON-DMA operation is made by the ND (NON-DMA) bit. When this bit is high (ND = 1) the NON-DMA' mode is selected, and when ND = 0 the DMA mode is selected. 1. Upon entering the Result Phase of: a. Read Data Command b. Read a Track Command c. Read ID Command d. Read Deleted Data Command e. Write Data Command f. Format a Cylinder Command g. Write Deleted Data Command h. Scan Commands 2. Ready Line of FDD changes state 3. End of Seek.or Recalibrate Command 4. During Execution Phase in the NON-DMA Mode SENSE DRIVE STATUS This command may be used by the processor whenever it wishes to obtain the status of the FDDs. Status Register 3 contains the Drive Status information. INVALID Interrupts caused by reasons 1 and 4 above occur during normal command operations and are easily discernible by the processor. However, interrupts caused by reasons 2 and 3 above may be uniquely identified with the aid of the Sense Interrupt Status Command. This command when issued resets the interrupt signal and via bits 5, 6, and 7 of Status Register 0 identifies the cause of the interrupt. Neither the Seek or Recalibrate Command have a Result Phase. Therefore, it is mandatory to use the Sense Interrupt Status Command after these commands to effectively terminate them and to provide verification of the head position (PCN). 6-488 If an invalid command is sent to the FDC (a command not defined above), then the FDC will terminate the command. No interrupt is generated by the 8272A during this condition. Bit 6 and bit 7 (DIO and RQM) in the Main Status Register are both high ("1 ") indicating to the processor that the 8272A is in the Result Phase and the contents of Status Register 0 (STO) must be read. When the processor reads Status Register 0 it will find an 80H indicating an invalid command was received. A Sense Interrupt Status Command must be sent after a Seek or Recalibrate interrupt, otherwise the FDC will consider the next command to be an Invalid Command. I n some appl ications the user may wish to use this command as a No-Op command, to place the FDC In a standby or no operation state. 210606-001 inter 8272A Table 12. Status Registers BIT NO. NAME BIT DESCRIPTION SYMBOL NO. NAME STATUS REGISTER 0 D7 Interrupt IC Code D, Not Writable NW During execution of WRITE DATA, WRITE DELETED DATA or Format A Cylinder Command, if the FOC detects a write protect signal from the FOO, then this flag is set. Do Missing Address Mark MA If the FOG cannot detect the 10 Address Mark after encountering the index hole twice, then this flag is set. If the FOC cannot detect the Data Address Mark or Deleted Data Address Mark, this flag is set. Also at the same time, the MO (Missing Address Mark in Data Field) of Status Register 2 is set. D7-1 and D6-0 Invalid Command issue, (Ie). Command which was issued was never started. D7= 1 and D6= 1 Abnormal Termination because during command execution the ready signal from FDD changed STATUS REGISTER 2 D6 Control Mark CM During executing the READ DATA or SCAN Command, if the FDC encounters a Sector which contains a Deleted Data Address Mark, this flag is set. D5 Data Error in Data Field DD If the FOG detects a CRC error in the data field then this flag is set. D_ Wrong Cylinder WC This bit is related with the NO bit, and when the contents of C on the medium is different from that stored in the IDR, this flag is set. D3 Scan Equal Hit SH During execution, the SCAN Command, if the condition of "equal" is satisfied, this flag is set. D2 Scan Not Satisfied SN During executing the SCAN Command, if the FOC cannot find a Sector on the cylinder which meets the condition, then this flag is set. D, Bad Cylinder BC This bit is related with the NO bit, and when the content of C on the medium is different from that stored in the IDA and the content of C is FF, then this flag Is set. Do Missing Address Mark in Data Field MD When data is read from the medium, if the FOC cannot find a Data Address Mark or Deleted Data Address Mark, then this flag is set. D7 Fault FT This bit is used to indicate the status of the Fault signal from the FDD. D6 Write Protected WP This bit is used to indicate the status of the Write Protected signal from the FOO. D5 Ready RDY This bit is used to indicate the status of the Ready signal from the FDD. During executing the READ 10 Command, if the FOC cannot read the 10 field without an error, then this flag is set. D_ Track 0 TO This bit is used to indicate the status of the Track 0 signal from the FOD. D3 Two Side TS This bit is used to indicate the status of the Two Side signal from the FDO. During the execution of the READ A Cylinder Command, if the starting sector cannot be found, then this flag is set. D2 Head Address HD This bit is used to indicate the status of Side Select signal to the FDD. D, Unit Select 1 US 1 This bit is used to indicate the status of the Unit Select 1 signal to the FDO. Do Unit Select 0 US a This bit is used to indicate the status of the Unit Select a signal to the FDD. D5 Seek End SE When the FDG completes the SEEK Command, this flag is set to 1 (high). 0_ Equipment Check EC If a fault Signal is received from the FOO, or if the Track 0 Signal fails to occur after 77 Step Pulses (Reealibrate Command) then this flag is set. Not Ready NR When the FDD is in the not-ready state and a read or write command is issued, this flag is set. If a read or write command is issued to Side 1 of a single sided drive, th'en this flag is set. O2 Head Address D, Unit Select 1 US 1 These flags are used to indicate a Do Unit Select a US 0 Drive Unit Number at Interrupt HD This flag is used to indicate the state of the head at Interrupt. STATUS REGISTER 1 End of Cylinder EN When the FOG tries to access a Sector beyond the final Sector of a Cylinder, this flag is set. 05 Data Error DE When the FDC detects a CRC error in either the 10 field or the data field, this flag is set. D4 Over Run OR If the FOC is not serviced by the main-systems during data transfers, within a certain time interval, this flag is set. D7 Not used. This bit is always 0 (low). D6 03 D2 STATUS REGISTER 3 Not used. This bit always 0 (low). No Data ND Not used. This bit is always 0 (low). D7 state. D3 DESCRIPTION STATUS REGISTER 1 (CONT.) D7=0 and D6=0 Normal Termination of Command, (ND, Command was completed and properly executed. D7=0 and D6= 1 Abnormal Termination of Command, (An. Execution of Command was started, but was not successfully completed. D6 SYMBOL During execution of READ DATA, WRITE DELETED DATA or SCAN Command, if the FOC cannot find the Sector specified in the lOR Register, this flag is set. 6-489 210606-001 8272A ABSOLUTE MAXIMUM RATINGS* o·c NOTICE: Stress above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Operating Temperature .................. to + 70·C Storage Temperature ............. - 40·C to + 125·C All Output Voltages ............... -0.5 to + 7 Volts All Input Voltages ................. -0.5 to + 7 Volts Supply Voltage Vcc ............... -0.5 to + 7 Volts Power Dissipation .......................... 1 Watt D.C. CHARACTERISTICS (TA = o·c to + 70·C, Vcc = +5V ± 10%) Limits Symbol Parameter Min. Max. Unit Test Conditions VIL Input Low Voltage -0.5 0.8 V V IH Input High Voltage 2.0 Vcc+ 0.5 V VOL Output Low Voltage 0.45 V 10L= 2.0 mA VOH Output High Voltage Vcc V IOH = - 400 Icc V cc Supply Current 120 mA IlL Input Load Current (All Input Pins) 10 -10 /i A /i A VIN = Vcc VIN=OV ILOH High Level Output Leakage Current 10 /i A VOUT=Vcc IOFL 'Output Float Leakage Currerit ±10 /i A CAPACITANCE (TA 2.4 0.45V ,,;; VOUT ,,;; Vee = 25°C, Ie = 1 MHz, Vcc = OV) Limits Symbol Parameter Min. Max. CIN( "=X 2.0 < 2.0 TEST POINTS 0.8 0.45 0.8 x= DEVICE UNDER TEST A.C. TESTING: INPUTS ARE DRIVEN AT 2.4V FOR A LOGIC "1" ANO O.45V FOR A LOGIC "0." TIMING MEASUREMENTS ARE MADE AT 2.0V FOR A LOGIC "1" AND 0.8V FOR A LOGIC "0:' ~CL=100PF CL = 100pF CL INCLUDES JIG CAPACITANCE WAVEFORMS PROCESSOR READ OPERATION 1_----'RoI----_ DATA - - - - - - - - - - - .....---tOF - 'RI_, INT 6-492 210606-001 8272A WAVEFORMS (Continued) PROCESSOR WRITE OPERATION A.r}. CS. OACK ...--iAw f----tww----., - 4 - - - - - tO W - - - - . . - DATA I • INT DMA OPERATION 1--_ _ _ _ _ _ _ _ _ tRQCY - - - - - - - - - - - ORa !---_ _ _ _ _ _ IRQRW _ _ _ _ _ _-+j W"Ror R5 I__- - - I R Q W - - - - ! 1-----tROR----i 6-493 210606-001 8272A WAVEFORMS (Continued) CLOCK TIMING elK FDD WRITE OPERATION WRITE ENABLE (WE) Ic' PRESHIFT 0 PRESHIFT I NORMAL 0 0 LATE 0 1 EARLY 1 1 0 INVALID 6~494 1 210606-001 8272A WAVEFORMS (Continued) SEEK OPERATION STABLE ~tD5 tSD~ LeT( DIRECTION STEP 1---;---------'sc------------1 FLT RESET INDEX FAULT RESET FAil UNSAFE RESET .....-tIDX ______ 6-495 210606-001 8272A WAVEFORMS (Continued) FDD READ OPERATION READDA4A tROD RE~ N~A_OT; ------------------------- . ~~I-'f------------t-w'-o~~~~~~-------/ tl4----------tWWCy-----------~ __________________ _____ TERMINAL COUNT RESET RESET TC 6-496 210606-001 APPLICATION NOTE AP·116 March 1981 6-497 207875-002 APPLICATIONS An Intelligent Data Base System Using the 8272 Contents INTRODUCTION The Floppy Disk The Floppy Disk Drive SUBSYSTEM OVERVIEW Controller Electronics Drive Electronics Controller/Drive Interface Processor/Memory Interface DISK FORMAT Data Recording Techniques Sectors Tracks Sector Interleaving THE 8272 FLEXIBLE DISKETTE CONTROLLER Floppy Disk Commands Interface Registers Command/Result Phases Execution Phase Multi-sector and Multi-track Transfers Drive Status Polling Command Details THE DATA SEPARATOR Single Density Double Density Phase-Locked Loop Design Initialization Floppy Disk Data Startup PLL Synchronization AN INTELLIGENT DISKETTE DATA BASE SYSTEM Processor and Memory Serial 110 DMA Disk Drive Interface SPECIAL CONSIDERATIONS APPENDiX Schematics Power Distribution 6-498 207875-002 APPLICATIONS 1. INTRODUCTION Most microcomputer systems in use today require lowcost, high-density removable magnetic media for information storage. In the area of removable media, a designer's choice is limited to magnetic tapes and floppy disks (flexible diskettes), both of which offer non-volatile data storage. The choice between these two technologies is relatively straight-forward for a given application. Since disk drives are designed to permit random access to stored information, they are significantly faster than tape units. For example, locating information on a disk requires less than a second, while tape movement (even at the fastest rewind or fast-forward speed) often requires several minutes. This random access ability permits the use of floppy disks in on-line storage applications (where information must be located, read, and modified/updated in real-time under program or operator control). Tapes, on the other hand, are ideally suited to archival or back-up storage due to their large storage capacities (more than 10 million bytes of data can be archived on a cartridge tape). A sophisticated controller is required to capitalize on the abilities of the disk storage unit. In the past, disk controller designs have required upwards of 150 ICs. Today, the single-chip 8272 Floppy Disk Controller (FDC) plus approximately 30 support devices can handle up to four million bytes of on-line data storage on four floppy disk drives. The Floppy Disk A floppy disk is a circular piece of thin plastic material covered with a magnetic coating and enclosed in a protective jacket (Figure 1). The circular piece of plastic revolves at a fixed speed (approximately 360 rpm) within its jacket in much the same manner that a record revolves at a fixed speed on a stereo turntable. Disks are manufactured in a variety of configurations for various storage capacities. Two standard physical disk sizes are commonly used. The 8-inch disk (8 inches square) is the larger of the two sizes; the smaller size (5-114 inches square) is often referred to as a mini-floppy. Singlesided disks can record information on only one side of the disk, while double-sided disks increase the storage capacity by recording on both sides. In addition, disks are classified as single-density or double-density. Doubledensity disks use a modified recording method to store twice as much information in the same disk area as can be stored on a single-density disk. Table 1 lists storage capacities for standard floppy disk media. Figure 1. A Floppy Diskette positioned at one of these fixed positions, the head can read or write information in a circular path as the disk revolves beneath the head assembly. This method divides the surface into a fixed number of cylinders (as shown in Figure 2). There are normally 77 cylinders on a standard disk. Once the head assembly is positioned at a given cylinder, data may be read or written on either side of the disk. The appropriate side of the disk is selected by the read/write head address (zero or one). Of course, a single-sided disk can only use head zero. The combination of cylinder address and head address uniquely specifies a single circular track on the disk. The physical beginning of a track is located by means of a small hole (physical index mark) punched through the plastic near the center of the disk. This hole is optically sensed by the drive on every revolution of the disk. Table 1. Formatted Disk Capacities Single· Density Format Byte/Sector Sectors/Track Tracks/Disk Bytes/Disk 128 26 77 256 15 77 512 8 77 1024 4 77 256,256 295,680 315,392 315,392 128 52 77 256 30 77 512 16 77 1024 8 77 512,512 591,360 630,784 630,784 Double·Density Format A magnetic head assembly (in contact with the disk) writes information onto the disk surface and subsequently reads the data back. This head assembly can move from the outside edge of the disk toward the center in fixed increments. Once the head assembly is Bytes/Sector Sectors/Track Tracks/Disk Bytes/Disk 6-499 207875-002 APPLICATIONS Each track is subdivided into a number of sectors (see detailed discussion in section 3). Sectors are generally 128, 256, 512, or 1024 data bytes in length. This track sectoring may be accomplished b'y one of two techniques: hard sectoring or soft sectoring. Hard sectored disks divide each track into a maximum of 32 sectors. The beginning of each sector is indicated by a sector hole punched in the disk plastic. Soft sectoring, the IBM standard method, allows software selection of sector sizes. With this technique, each data sector is preceded by a unique sector identifier that is read/written by the disk controller. A floppy disk may also contain a write protect notch punched at the edge of the outer jacket of the disk. This notch, is detected by the drive and passed to the controller as a write protect signal. The Floppy Disk Drive The floppy disk drive is an electromechanical device that records data on, or reads data from, the surface of a floppy disk. The disk drive contains head control elec'tronics that move the head assembly one increment (step) forward (toward the center of the disk) or backward (toward the edge of the disk). Since the recording head must be in contact with the disk material in order to read or write information, the disk drive also contains head-load electronics. Normally the read/write head is unloaded until it is necessaiy to read or write information on the floppy disk. Once the head assembly has been positioned over the correCt track on the 'disk, the head is loaded (brought into contact with the disk). This sequence prevents excessive disk wear. A small time penalty is paid wheri the head is loaded. Approximately thirty to fifty milliseconds are needed before data may be reliably read from, or written to, the disk. This time is known as the head load time. If desired, the head, may be moved from cylinder to cylinder while loaded. In tl?-is manner, only a small time interval (head settling time) is required before data may be, read from the new cylinder. The head settling time is often shorter than the head load time. Typically, disk drives also contain drive select 10g1c that allows more than one physical drive to be connected to the same interface cable (from the controller). By means of a jumper on the drive, the drive number may be selected' by the OEM or end user. The drive is enabled only when selected; when not seiected, all control signals on the cable are ignored. Finally, the drive provides additional signals to' the system controller regarding the status of the drive and disk. These signals include: Drive Ready - Signals the system that the drive door is closed and that a floppy disk is inserted into the drive. Track Zero - Indicates that the head assembly is located over the outermost track of the disk. This signal may be used for calibration of the disk drive at system initialization and after an error con,dition. , Write Protect - Indicates that the floppy disk loaded into the drive is, write protected. Dual Sided - Indicates that the floppy disk in the drive is dual-sided. Write Fault - Indicates that an error occurred during a recording operation. Index - Informs the system that the physical index mark of the floppy disk (signifying the start of Ii data track) has been sensed. CURRENT TRACK Figure 2. Concentric Cylinders on a Floppy Diskette 6-500 207875-002 APPLICATIONS 2. SUBSYSTEM OVERVIEW disks.) The serial data must also be assembled into 8·bit bytes for transfer to system memory. A byte must be assembled and transferred every 32 microseconds for single· density disks and every 16 microseconds for double·density. A disk subsystem consists of the following functional electronic units: 1. Disk Controller Electronics 6. Error Checking - Information recorded on a flop· py disk is subject to both hard and soft errors. Hard (permanent) errors are caused by media defects. Soft errors, on the other hand, are temporary errors caused by electromagnetic noise or mechanical inter· ference. Disk controllers use a standard error check· ing technique known as a Cyclic Redundancy Check (CRC). As data is written to a disk, a l6·bit CRC character is computed and also stored on the disk. When the data is subsequently read, the CRC charac· ter allows the controller to detect data errors. Typi· cally, when CRC errors are detected, the controlling software retries the failed operation (attempting to recover from a soft error). If data cannot reliably be read or written after a number of retries, the system software normally reports the error to the operator. Multiple CRC errors normally indicate unrecover· able media error on the current disk track. Subse· quent recovery attempts must be defined by the sys· tem designers and tailored to meet system interfacing requirements. 2. Disk Drive Electronics 3. Controller/Disk Interface (cables, drivers, termina· tors) 4. Controller/Microprocessor System Interface The operation of these functional units is discussed in the following paragraphs. Controller Electronics The disk controller is responsible for converting high· level disk commands (normally issued by software ex· ecuting on the system processor) into disk drive com· mands. This function includes: 1. Disk Drive Selection - Disk controllers typically manage the operations of multiple floppy disk drives. This controller function permits the system processor to specify which drive is to be used in a particular operation. 2. Track Selection - The controller issues a timed se· quence of step pulses to move the head from its cur· rent location to the proper disk cylinder from which data is to be read or to which data is to be written. The controller stores the current cylinder number and computes the stepping distance from the current cylinder to the specified cylinder. The controller also manages the head select signal to select the correct side of the floppy disk. Today, single·chip digital LSI floppy disk controllers such as the 8272 perform all the above functions with the exception of data separation. A data separation cir· cuit (a combination of digital and analog electronics) synchronizes itself to the actual data rate of the disk drive. This data rate varies from drive to drive (due to mechanical factors such as motor tolerances) and varies from disk to disk (due to temperature effects). In order to operate reliably with both single· and double·density storage, the data separation circuit must be based on phase·locked loop (PLL) technology. The phase·locked loop data separation logic is described in section 5. The separation logic, after synchronizing with the data stream, supplies a data window to the LSI disk con· troller. This window differentiates data information from clock information within the serial stream. The controller uses this window to reconstruct the data previously recorded on the floppy disk. 3. Sector Selection - The controller monitors the data on a track until the requested sector is sensed. 4. Head Loading - The disk controller determines the times at which the head assembly is to be brought in contact with the disk surface in order to read or write data. The controller is also responsible for waiting until the head has settled before reading or writing information. Often the controller maintains the head loaded condition for up to 16 disk revolu· tions (approximately 2 seconds) after a read or write operation has been completed. This feature elimi· nates the head load time during periods of heavy disk I/O activity. Drive Electronics Each floppy disk drive contains digital electronic cir· cuits that translate TTL·compatible command signals into electromechanical operations (such as drive selec· tion and head movement/loading) and that sense and report disk or drive status to the controller (e.g., drive ready, write fault, and write protect). In addition, the drive electronics contain analog components to sense, amplify, and shape data pulses read from, or written to, the floppy disk surface by the read/write head. 5. Data Separation - The actual signal recorded on a floppy disk is a combination of timing information (clock) and data. The serial READ DATA input (from the disk drive) must be converted into two sig· nal streams: clock and data. (The READ DATA in· put operates at 250K bits/second for single·density disks and 500K bits/second for double·density 6-501 207875·002 APPLICATIONS Controller/Drive Interface The controller/drive interface consists of high-current line drivers, Schmitt triggered input gates, and flat or twisted pair cable(s) to connect the disk drive electronics to the controller electronics. Each interface signal line is resistively terminated at the end of the cable farthest from the line drivers. Eight-inch drives may be directly interfaced by means of 50-conductor flat cable. Generally, cable lengths should be less than ten feet in order to maintain noise immunity. Normally, provisions are made for up to four disk drives to share the same interface cable. The controller may operate as many cable assemblies as practical. LSI floppy disk controllers typically operate one to four drives on a single cable. Processor/Memory Interface The disk controller must inteiface to the system processor and memory for two distinct purposes. First, the processor must specify disk control and command parameters to the controller. These parameters include the selection of the recording density and specification of disk formatting information (discussed in section 3). In addition to disk parameter specification, the processor must also send commands (e.g., read, write, seek, and scan) to the controller. These commands require the specification of the command code, drive number, cylinder address, sector address, and head address. Most LSI controllers receive commands and parameters by means of processor I/O instructions. In addition to this I/O interface, the controller must also be designed for high-speed data transfer between memory and the disk drive. Two implementation methods may be used to coordinate this data transfer. The lowest-cost method requires direct processor intervention in the transfer. With this method, the controller issues an interrupt to the processor for each data transfer. (An equivalent method allows the processor to poll an interrupt flag in the controller status word.) In the case of a disk write operation, the processor writes a data byte (to be encoded into the serial output stream) to the disk controller following the receipt of each controller interrupt. During a disk read operation, the processor reads a data byte (previously assembled from the input data stream) from the controller after each interrupt. The processor must transfer a data byte from the controller to memory or transfer a data byte. from memory to the disk controller within 16 or 32 microseconds after each interrupt (double-density and single-density response times, respectively). If the system processor must service a variety of other interrupt sources, this interrupt method may not be practical, especially in double-density systems. In this case, the disk controller may be interfaced to a Direct Memory Access (DMA) controller. When the disk controller requires the transfer of a data byte, it simply activates the DMA request line. The DMA controller interfaces to the processor and, in response to the disk controller's request, gains control of the memory interface for a short period of time-long enough to transfer the requested data byte to/from memory. See section 6 for a detailed DMA interface description. 3. DISK FORMAT New floppy disks must be written with a fixed format by the controller before these disks may be used to store data. Formatting is a method of taking raw media and adding the necessary information to permit the controller to read and write data without error. All formatting is performed by the disk controller on a track-bytrack basis under the direction of the system processor. Generally, a track may be formatted at any time. However, since formatting "initializes" a complete disk track, all previously written data is lost (after a format operation). A format operation is normally used only when initializing new floppy disks. Since soft-sectoring in such a predominant formatting technique (due to IBM's influence), the following discussion will limit itself to soft-sectored formats. Data Recording Techniques Two standard data recording techniques are used to combine clock and data information for storage on a floppy disk. The single-density technique is referred to as FM encoding. In FM encoding (see Figure 3), a double frequency encoding technique is used that inserts a data bit between two adjacent clock bits. (The presence of a data bit represents a binary "one'.' while the absence of a data bit represents a binary "zero.") The two adjacent clock bits are referred to as a bit cell, and except for unique field identifiers, all clock bits written on the disk are binary "ones." In FM encoding, each data bit is written at the center of the bit cell and the clock bits are written at the leading edge of the bit cell. The encoding used for double-density recording is termed MFM encoding (for "Modified FM"). In MFM encoding (Figure 3) the data bits are again written at the center of the bit cell. However, a clock bit is written at the leading edge of the bit cell only if no data bit was written in the previous bit cell and no data bit will be written in the present bit cell. Sectors Soft-sectored floppy disks divide each track into a number of data sectors. Typically, sector sizes of 128, 256, 512, or 1024 data bytes are permitted. The sector size is specified when the track is initially formatted by the controller. Table 1 lists the single- and double6-502 207675-002 APPLICATIONS the beginning of the data field. When a sector is to be deleted, (e.g., a hard error on the disk), a deleted data address mark is written in place of the data ad. dress mark. The last two bytes of the data field comprise the eRe character. density data storage capacities for each of the four sector sizes. Each sector within a track is composed of the following four fields (illustrated in Figure 4): I. Sector ID Field - This field, consisting of seven bytes, is written only when the track is formatted. The ID field provides the sector identification that is used by the controller when a sector must be read or written. The first byte of the field is the ID address mark, a unique coding that specifies the beginning of the ID field. The second, third, and fourth bytes are the cylinder, head, and sector addresses, respectiveIy, and the fifth byte is the sector length code. The last two bytes are the 16-bit eRe character for the ID field. During formatting, the controller supplies the address mark. The cylinder, head, and sector addresses and the sector length code are supplied to the controller by the processor software. The eRe character is derived by the controller from the data in the first five bytes. 4. Post Data Field Gap - The post data field gap (gap 3) is written when the track is formatted and separates the preceding data field from the next physical ID field on the track. Note that a post data field gap is not written following the last physical sector on a track. The gap itself contains a programselectable number of bytes. Following a sector update (write) operation, the drive's write logic is disabled during the gap. The actual size of gap 3 is determined by the maximum number of data bits that can be recorded on track, the number of sectors per track and the total sector size (data plus overhead information). The gap size must be adjusted so that it is large enough to contain the discontinuity generated on the floppy disk when the write current is turned on or off (at the start or completion of a disk write operation) and to contain a synchronization field for the upcoming ID field (of the next sector). On the other hand, the gaps must be small enough so that the total number of data bits required on the track (sectors plus gaps) is less than the maximum number of data bits that can be recorded on the track. The gap size must be specified for all read, write, and format operations. The gap size used during disk reads and writes must be smaller than the size used to format the disk to avoid the splice points between contiguous physical sectors. Suggested gap sizes are listed in Table 9. a 2. Post ID Field Gap - The post ID field gap (gap 2) is written initially when the track is formatted. During subsequent write operations, the drive's write circuitry is enabled within the gap and the trailing bytes of the gap are rewritten each time the sector is updated (written). During subsequent read operations, the trailing bytes of the gap are used to synchronize the data separator logic with the upcoming data field. 3. Data Field - The length (number of data bytes) of the data field is determined by software when the track is formatted. The first byte of the data field is the data address mark, a unique coding that specifies I DATA --j 0 I 0 o I o I 1 I - BIT CELL (4 ",) FM MFM NOTE THAT THE FM EiITCELL IS TWICE THE SIZE OFTHE MFM BIT CELL. THUS, THE FM TIME SCALE IN THIS FIGURE IS 4~s/BIT WHJlE THE MFM TIME SCALE IS 2 f.js/BIT Figure 3. FM and MFM Encoding 207875-002 6-503 APPLICATIONS Tracks chronize the data separator logic with the data to be read from the ID field (of the first sector). The post index gap is written only when the disk is formatted. The overall format for a track is illustrated in Figure 4. Each track consists of the following fields: 4. Sectors - The sector information (discussed above) is repeated once for each sector on the track. 1. Pre-Index Gap - The pre-index gap (gap 5) is written only when the track is formatted. 5. Final Gap - The final gap (gap 4) is written when the track is formatted and extends from the last physical data field on the track to the physical index mark. The length of this gap is dependent on the number of bytes per sector specified, the lengths of the program-selectable gaps specified, and the drive speed. 2. Index Address Mark - The index address mark consists of a unique code that indicates the beginning of a data track. One index mark is written on each track when the track is formatted. 3. Post Index Gap - The post index gap (gap 1) is used during disk read and write operations to syn- n PHYSICAL INDEX MARK -------' i~ SECTOR DATA FIELD PRE· FINAL GAP (GAP 4) INDEX ADDRESS MARK INDEX GAP (GAP 5) POST 1 GAP (GAP 1) , POST ID FIELD GAP (GAP 2) SECTOR INDEX ID FIELD SECTOR 1 DATA FIELD I J 1 J HEX FF l SYNC (HEX 00) DATA ADDRESS MARK HEX FF (HEX SYNC 00) 128 x 2" USER DATA BYTES 1 1 CRC CRC eVTE 2 BYTE 1 J I /I POST DATA FIELD GAP (GAP 3) SECTOR 2 10 FIELD POST 10 FIELD GAP (GAP 2) SECTOR 2 DATA FIELD POST DATA FIELD GAP (GAP 3) POST 10 FIELD GAP (GAP 2) SECTOR 3 10 FIELD I 1 Jl I I I 1 1 1 I J HEX FF l 10 TRACK ADDRESS BYTE 1 BYTE 2 SECTOR DATA FIELD I I ADDRESS MARK lu) HEAD ADDRESS BYTE 3 (HEX 00) SYNC HEX FF SECTOR ADDRESS SECTOR LENGTH CRC BYTE 1 BYTE 4 BYTE 5 BYTE 6 Figure 4. Standard Floppy Diskette Track Format (From 6-504 (HEX 00) SYNC CRC BYTE 2 BYTE 7 sec 204 Manual) 207875-002 APPLICATIONS Sector Interleaving The initial formatting of a floppy disk determines where sectors are located within a track. It is not necessary to allocate sectors sequentially around the track (i.e., 1,2,3, ... ,26). In fact, is is often advantageous to place the sectors on the track in a non-sequential order. Sequential sector ordering optimizes sector access times during multi-sector transfers (e.g., when a program is loaded) by permitting the number of sectors specified (up to an entire track) to be transferred within a single revolution of the disk. A technique known as sector interleaving optimizes access times when, although sectors are accessed sequentially, a small amount of processing must be performed between sector reads/writes. For example, an editing program performing a text search reads sectors sequentially, and after each sector is read, performs a software search. If a match is not found, the software issues a read request for the next sector. Since the floppy disk continues to rotate during the time that the software executes, the next physical sector is already passing under the read/write head when the read request is issued, and the processor must wait for another complete revolution of the disk (approximately 166 milliseconds) before the data may actually be input. With interleaving, the sectors are not stored sequentially on a track; rather, each sector is physically removed from the previous sector by some number (known as the interleave factor) of physical sectors as shown in Figure 5. This method of sector allocation provides the processor additional execution time between sectors on the disk. For example, with a 26 sector/track format, an interleave factor of 2 provides 6.4 milliseconds of processing time between sequential 128 byte sector accesses. To calculate the correct interleave factor, the maximum processor time between sector operations must be divided by the time required for a complete sector to pass under the disk read/write head. After determining the interleave factor, the correct sector numbers are passed to the disk controller (in the exact order that they are to physically appear on the track) during the execution of a format operation. 4. THE 8272 FLEXIBLE DISKETTE CONTROLLER The 8272 is a single-chip LSI Floppy Disk Controller (FDC) that contains the circuitry necessary to implement both single-and double-density floppy disk storage subsystems (with up to four dual-sided disk drives per FDC). The 8272 supports the IBM 3740 single-density recording format (FM) and the IBM System 34 doubledensity recording format (MFM). With the 8272, less than 30 ICs are needed to implement a complete disk subsystem. The 8272 accepts and executes high-level disk commands such as format track, seek, read sector, write sector, and read track. All data synchronization and error checking is automatically performed by the FDC to ensure reliable data storage and subsequent retrieval. External logic is required only for the generation of the FDC master clock and write clock (see Section 6) and for data separation (Section 5). The FDC provides signals that control the startup and base frequency selection of the data separator. These signals greatly ease the design of a phase-locked loop data separator. In addition to the data separator interface signals, the 8272 also provides the necessary signals to interface to microprocessor systems with or without Direct Memory Access (DMA) capabilities. In order to interface to a large number of commercially available floppy disk drives, the FDC permits software specification of the track stepping rate, the head load time, and the head unload time. The pin configuration and internal block diagram of the 8272 is shown in Figure 6. Table 2 contains a description for each FDC interface pin. Floppy Disk Commands Figure 5. Interleaved Sector Allocation Within a Track The 8272 executes fifteen high-level disk interface commands: Specify Write Data Write Deleted Data Sense Drive Status Sense Interrupt Status Read Track Read ID Seek Scan Equal Recalibrate Scan High or Equal Format Track Scan Low or Equal Read Data Read Deleted Data 6-505 207875-002 APPLICATIONS Each command is initiated by a multi-byte transfer from the processor to the FDC (the transferred bytes contain command and parameter information). After complete command specification, the FDC automatically executes the command. The command result data (after execution of the command) may require a multi-byte transfer of status information back to the processor. It 'is convenient to consider each FDC command as consisting of the following three phases: COMMAND PHASE: RESET iiii The executing program transfers to the FDC all the information required to perform a particular disk operation. The 8272 automatically enters the command phase after RESET and following the completion of the result phase (if any) of a previous command. Vee EXECUTION PHASE: The FDC performs the operation as instructed. The execution phase is entered immediately after the last command parameter is written to theFDC in the preceding command phase. The execution phase normally ends when the last data byte is transferred to/from the disk (signalled by the TC input to the FDC) or when an error occurs. RESULT PHASE: After completion of the disk operation, status and other housekeeping information are made available to the processor. After the processor reads this information, the FDC reenters the command phase and is ready to accept another command. REGISTERS 080.7 RWISEEK LeTICIR FR/STP Ao HDL DBa DB, RDY DB, FLT/TRKO DB, PSo PS, DB, WPfTS DB. WR DATA DB, DS, DS, DB, DRO DACK TC SERIAL INTERFACE CONTROLLER READY WRITE PROTECTITWO SIDE INDEX FAULTITRACK 0 HDSEl MFM WE IDX Vee INT RD DATA CLK DW GND WRCLK eli DRIVE INTERFACE CONTROLLER -----1-. DRIVE SELECT 0 DRIVE SELECT 1 MFM MODE RWISEEK HEAD LOAD HEAD SELECT elK - - . LOW CURRENT/DIRECTION FAULT RESET/STEP Vee ----.. GND~ Figure 6. 8272 Pin Configuration and Internal Block Diagram 6-506 207875-002 APPLICATIONS Table 2. 8272 FDe Pin Description Number Pin Symbol I/O To/From Description I RST I uP Reset. Active-high signal that places the FDC in the "idle" state and all disk drive output signals are forced inactive (low). This input must be held active during power on reset while the RD and WR inputs are active. 2 RD I- uP Read. Active-low control signal that enables data transfer from the FDC to the data bus. 3 WR I- uP Write. Active-low control signal that enables data transfer from the data bus into the FDC. 4 CS I uP Chip Select. Active-low control signal that selects the FDC. No reading or writing will occur unless the FDC is selected. 5 Ao I- uP Address. Selects the Data Register or Main Status Register for input/output in conjunction with the RD and WR inputs. (See Table 3.) 6-13 DBa-DB, I/O- uP Data Bus. Bidirectional three-state 8-bit data bus. 14 DRQ 0 DMA DMA Request. Active-high output that indicates an FDC request for DMA services. IS DACK I DMA DMA Acknowledge. Active-low control signal indicating that the requested DMA transfer is in progress. 16 TC I DMA Terminal Count. Active-high signal that causes the termination of a command. Normally, the terminal count input is directly connected to the TC/EOP output from the DMA controller, signalling that the DMA transfer has been completed. In a non-DMA environment, the processor must count data transfers and supply a TC signal to the FDC. 17 IDX I Drive Index. Indicates detection of the physical index mark (the beginning of a track) on the selected disk drive. 18 INT 0 uP Interrupt Request. Active-high signal indicating an 8272 interrupt service request. I Clock. Signal phase 8 MHz clock (50"70 duty cycle). 19 CLK 20 GND 21 WRCLK I 22 DW I PLL 23 RD DATA I Drive Read Data. FDe input data from the selected disk drive. 24 VCO 0 PLL VCO Sync. Active-high output that enables the phase-locked loop to synchronize with the input data from the disk drive. Ground. DC power return. Write Clock. 500 kHz (FM) or I MHz (MFM) write clock with a constant pulse width of 250 ns (for both FM and MFM recording). The write clock must be present at all times. Data Window. Data sample signal from the phase-locked loop indicating that the FDC, should sample input data from the disk drive. 25 WE 0 Drive Write Enable. Active-high output that enables the disk drive write gate. 26 MFM 0 PLL MFM Mode. Active-high output used by external logic to enable the MFM double-density recording mode. When the MFM output is low, single-density FM recording is indicated. 27 HDSEL 0 Drive Head Select. Selects head 0 or head I on a dual-sided disk. 28,29 DSl>DS O 0 Drive Drive Select. Selects one of four disk drives. 30 WRDATA 0 Drive Write Data. Serial data stream (combination of clock and data bits) to be written on the disk. 31,32 PSl>PS O 0 Drive Precompensation (pre-shift) Control. Write precompensation output control during MFM mode. Specifies early, late, and normal timing signals. See the discussion in Section 5. 6-507 207875-002 APPLICATIONS Table 2. 8272 FDC Pin Description (continued) Number Pin Symbol I/O To/From 33 FLT/TRKO I Drive Fault/Track O. Senses the disk drive fault condition in the Read/Write mode and the Track 0 condition in the Seek mode. 34 WP/TS I Drive Write Protect/Two-Sided. Senses the disk write protect status in the Read/Write mode and the dual-sided media status in.the Seek mode. Description 35 RDY I Drive Ready. Senses the disk drive ready status. 36 HDL 0 Drive Head Load. Loads the disk drive read/write head. (The head is placed in contact with the disk.) 37 FR/STP 0 Drive Fault Reset/Step. Resets the fault flip-flop in the disk drive when operating in the Read/Write mode. Provides head step pulses (to move the head from one cylinder to another cylinder) in the Seek mode. 38 LCT/DIR 0 Drive Low Current/Direction. Signals that the recording head has been positioned over the inner cylinders (44-77) of the floppy disk in the Read/Write mode. (The write current must be lowered when recording on the physically shorter inner cylinders of the disk. Most drives do not track the actual head position and require that the FDC supply this signal.) Determines the head step direction in the Seek mode. In the Seek mode, a high level on this pin steps the read/write head toward the spindle (step-in); a low level steps the head away from the spindle (step-out). 39 RW/SEEK 0 Drive Read, Write/Seek Mode Selector. A high level selects the Seek mode; a low level selects the Read/Write mode. 40 Vee + 5V DC Power. ·Disabled when CS is high. Interface Registers To support information transfer between the FDC and the system processor, the 8272 contains two 8-bit registers: the Main Status Register and the Data Register. The Main Status Register (read only) contains FDC status information and may be accessed at any time. The Main Status Register (Table 4) provides the system processor with the status of each disk drive, the status of the FDC, and the status of the processor interface. The Data Register (read/write) stores data, commands, parameters, and disk drive status information. The Data Register is used to program the FDC during the command phase and to obtain result information after completion of FDC operations. Data is read from, or written to, the FDC registers by the combination of the AO, RD, WR, and CS signals, as described in' Table 3. In addition to the Main Status Register, the FDC contains four additional status registers (STO, STl, ST2, and ST3). These registers are only available during the result phase of a command. 6-508 Table 3. FDC Read/Write Interface CS Ao RD WR Function 0 0 0 0 0 0 I 0 0 0 I 1 1 X 0 I 0 0 0 I X I 0 0 0 I 0 X Read Main Status Register Illegal Illegal Illegal Read from Data Register Write into Data Register Data Bus is three-stated 207875-002 APPLICATIONS Table 4. Main Status Register Bit Definitions Bit Number Symbol 0 DaB Disk Drive 0 Busy. Disk Drive 0 is in the Seek mode. I D]B Disk Drive I Busy. Disk Drive I is in the Seek mode. 2 D2B Disk Drive 2 Busy. Disk Drive 2 is in the Seek mode. 3 D3B Disk Drive 3 Busy. Disk Drive 3 is in the Seek mode. 4 CB FDC Busy. A read or write command is in process. 5 NDM Non-DMA Mode. The FDC is in the non-DMA mode when this bit is high. This bit is set only during the execution phase of commands in the non-DMA mode. Transition to a low level indicates that the execution phase has ended. 6 DIO Data Input/Output. Indicates the direction of a data transfer between the FDC and the Data Register. When DIO is high, data is read from the Data Register by the processor; when DIO is low, data is written from the processor to the Data Register. 7 RQM Request for Master. Indicates that the Data Register is ready to send data to, or receive data from, the processor. Description Command/Result Phases Table 5 lists the 8272 command set. For each of the fifteen commands, command and result phase data transfers are listed. A list of abbreviations used in the table is given in Table 6, and the contents of the result status registers (STO-ST3) are illustrated in Table 7. The bytes of data which are sent to the 8272 during the command phase, and are read out of the 8272 in the result phase, must occur in the order shown in Table 5. That is, the command code must be sent first and the other bytes sent in the prescribed sequence. All bytes of the command and result phases must be read/written as described. After the last byte of data in the command phase is sent to the 8272 the execution phase automatically starts. In a similar fashion, when the last byte of data is read from the 8272 in the result phase, the command is automatically ended and the 8272 is ready for a new command. A command may be aborted by simply raising the terminal count signal (pin 16). This is a convenient means of ensuring that the processor may always gain control of the 8272 (even if the disk system hangs up in an abnormal manner). It is important to note that during the result phase all bytes shown in Table 5 must be read. The Read Data command, for example, has seven bytes of data in the result phase. All seven bytes must be read in order to successfully complete the Read Data command. The 8272 will not accept a new command until all seven bytes have been read. The number of command and result bytes varies from command-to-command. In order to read data from, or write data to, the Data Register during the command and result phases, the system processor must examine the Main Status Register to determine if the Data Register is available. The DIO (bit 6) and RQM (bit 7) flags in the Main Status Register must be low and high, respectively, before each byte of the command word may be written into the 8272. Many of the commands require multiple bytes, and as a result, the Main Status Register must be read prior to each byte transfer to the 8272. To read status bytes during the result phase, DIO and RQM in the Main Status Register must both be high. Note, checking the Main Status Register in this manner before each byte transfer to/from the 8272 is required only in the command and result phases, and is NOT required during the execution phase. Execution Phase All data transfers to (or from) the floppy drive occur during the execution phase. The 8272 has two primary modes of operation for data transfers (selected by the specify command): 1. DMA mode 2. non-DMA mode In the DMA mode, DRQ (DMA Request) is activated for each transfer request. The DMA controller responds to DRQ with DACK (DMA Acknowledge) and RD (for read commands) or WR (for write commands). DRQ is reset by the FDC during the transfer. INT is activated after the last data transfer, indicating the completion of the execution phase, and the beginning of the result phase. In the DMA mode, the terminal count (TC/EOP) output of the DMA controller should be connected to the 8272 TC input to properly terminate disk data transfer commands. 6-509 207875-002 APPLICATIONS Table 5. 8272 Command Set DATA BUS PHASE RIW D7 D8 DS D4 D3 DATA BUS D2 D, DO I REMARKS PHASE RIW D7 D8 DS AEAO DATA Command W W MT MFM SK W W W W W W W C H A N _ _ _ _ _ _ EOT 0 0 0 0 0 0 0 , , 0 HDS OS, DSO Command Command Codes Sector 10 information prior to Command execution Oala transfer between the FOD and the main-system A A A A A A A W W 0 0 0 0 , 0 0 W W W W W W W 0 0 MFM SK 0 1 0 0 HOS OS, DSO 0 0 0 0 Result Command Codes Sector 10 Information prior to Command execution Data transfer between the FOD and the main-system. FOC reads the complete track A A A A A A A ST 0 ST 1 ST 2 C H _____ A N W 0 MFM 0 0 , W 0 0 0 W MT MFM 0 0 0 0 0 0 0 0 Sector 10 information after Command execution Command Command Codes 0 0 0 1 0 HDS OSl OSO A A A A A A A N W W W W W W W W MT MFM 0 0 0 0 1 0 0 0 A A A N 0 0 , 0 MFM 0 0 1 'w 0 0 0 0 0 N SC GPL 0 1 0 1 Bytes/Sector SectorsfTrack Gap 3 Filter Byte STO ST 1 ST 2 C,_ _ _ _ _ _ FOC formats an entire track A A A A A A W W W W W W W W W Command Codes Sector 10 information prior to Command execution ST 0 ST 1 ST2 _ _ _ _ C H A N Status information after Command execution In this case, the 10 information has no meaning MT MFM SK 0 0 0 1 0 0 0 C H A N EOT GPL STP Execution Data transfer between the FOO and the main-system Command Codes HOS OS1 OSO SCAN EQUAL Command HOS OS1 OSO Execution H A N Sector 10 information during Execution Phase W A Sector 10 information aUer Command execution C H A N _ _ _ _ _ _ EOT GPL OTL A A A A A A A Result Status information after Command execution WAITE DELETED DATA W Command Codes Status information after Command execution STO STl ST 2 C H Execution ST 0 ST 1 ST2 C H A Sector 10 information after Command execution The first correct ID Information on the track is stored in Data Register W W W W Sector 10 information prior to Command execution Data transfer between the mainsystem and the FOO A after Command execution FORMAT A TRACK 1 0 1 HOS OS1 OSO C H A N EOT GPL _ _ ~. _ _ _ OTL A A A A Status information AEAO 10 Command Result Status information after Command execution ST 0 ST 1 ST2 C H A N Command Codes HDS DSl DSO C H A N EOT GPL DTL Execution Execution Result 1 REMARKS physical index mark to EOT Sector 10 information prior to Command execution C H A N ECl GPL OTL A A A A A A A W W W W W W W Command DO Data transfer between the FOO and the main-system W Result 0 ' 0' 0 WAITE DATA Command D, contents from the Sector 10 Information after command execution Execution Result D2 Status Information alter Command execution STO ST 1 ST 2 C H A N MT MFM SK D3 Execution READ DELETED DATA Command W W W W W W W W W GPL DTL Executlon Result D4 AEAO A TAACK Result Status information after Command execution Sector ID information atter Command execution 0 0 1 Command Codes HOS OS1 OSO Sector 10 information prior to Command execution Data compared between the FOO and the maln·system A A A A A A A STO ST 1 ST 2 C H A N Status information after Command execution Sector 10 information after Command execution Note: 1. AO= 1 for all operations. 6-510 207875-002 APPLICATIONS Table 5. Command Set (Continued) DATA BUS PHASE RIW 07 06 05 D. 03 DATA BUS 02 01 DO REMARKS RIW PHASE 07 06 05 SCAN LOW OR EQUAL Command W W W W W W W W W MT MFM SK 0 0 0 1 0 1 0 0 0 1 HOS OS1 OSO Command Command Result ----- ST 0 ST 1 ST 2 C H ----R N ----~ MT MFM SK 0 0 0 1 1 0 0 0 0 0 0 0 1 W 0 0 0 0 0 0 W R R 0 W W W 0 0 0 0 1 Command Codes C H R N EOT GPl STP 0 1 1 1 0 0 0 Command Sector ID information after Command execution Status information at the end of each seek operation about the FOC 0 0 0 0 0 1 _SPT _ _ .. _ H U T HlT 1 Command Codes NO Timer Settings 0 Command Codes SENSE DRIVE STATUS Command W W R 0 0 0 0 0 0 0 0 0 0 1 0 HOS OSl DSO Status information about the FDD ST 3 Command Codes Sector ID information prior Command execution SEEK Command ---- W W W 0 0 0 0 0 0 0 0 ---- 1 0 1 1 1 HDS DS1 DSO Head is positioned over proper Cylinder on Diskette INVALID Command W Result R --_. Invalid Codes ---~ Status information alter Command execution ----~- Command Codes C Execution _ _ _ _~ STO ST 1 ST 2 C H R N Command Codes SPECIFY Status information after Command execution Data compared between the FDD and the main-system R R R R R R R 1 REMARKS OSl DSO STO C HDS DS1 DSO Execution Result DO Head retracted to Track 0 Result W W W W W W W W W 01 Execution SCAN HIGH OR EQUAL Command W Data compared between the FDD and the main-system R R R R R R R 02 SENSE INTERRUPT STATUS Execution Result Command Codes Sector ID information prior Command execution C H R N EOT GPl STP 04 ·03 RECALIBAATE Sector ID information after Command execution STO Invalid Command Codes (NoOp- FDC goes into Standby State) 5TO=80 116) Table 6. Command/Result Parameter Abbreviations Symbol Description Symbol Description C Cylinder Address. The currently selected cylinder address (0 to 76) on the disk. EaT End of Track. The final sector number of the current track. 0 Data Pattern. The pattern to be written in each sector data field during formatting. GPL Gap Length. The gap 3 size. (Gap 3 is the space between sectors excluding the VCO synchronization field as defined in section 3.) DSO,DSI DTL Disk Drive Select. DSI DSO 0 0 Drive I Drive 0 I 0 Drive Drive I 1 H 0 I 2 3 Special Sector Size. During the execution of disk read/write commands, this parameter is used to temporarily alter the effective disk sector size. By setting N to zero, DTL may be used to specify a sector size from I to 256 bytes in length. If the actual sector (on the diskette) is larger than DTL specifies, the remainder of the actual sector is not passed to the system during read commands; during write commands, the remainder of the actual sector is written with all-zeroes bytes. DTL should be set to FF hexadecimal when N.is not zero. 6-511 Head Address. Selected head: 0 or 1 (disk side respectively) as encoded in the sector ID field. o or 1, HLT Head Load Time. Defines the time interval that the FDC waits after loading the head before initiating a read or write operation. Programmable from 2 to 254 milliseconds (in increments of 2 ms). HUT Head Unload Time. Defines the time interval from the end of the execution phase (of a read or write command) until the head is unloaded. Programmable from 16 to 240 milliseconds (in increments of 16 ms). MFM MFM/FM Mode Selector. Selects MFM double,density recording mode when high, FM single-density mode when low. 207875-002 APPLICATIONS Table 6. Command/Result Parameter Abbreviations (continued) Symbol MT Description Multi-Track Selector. When set, this flag selects the multi-track operating mode. In this mode (used only with dual-sided disks), the FDC treats a complete cylinder (under both read/write head 0 and read/write head 1) as a single track. The FDC operates as if this expanded track started at the first sector under head 0 and ended at the last sector under head 1. With this flag set (high), a multi-sector read opeation will automatically continue to the first sector under head 1 when the FDC finishes operating on the last sector under head O. N Sector Size. The number of data bytes within a se<;tor. (See Table 9.) ND Non-DMA Mode Flag. When set (high), this flag indicates that the FDC is to operate in the non-DMA mode. In this mode, the processor is interrupted for each data transfer. When low, the FDC interfaces to a DMA controller by means of the DRQ and DACK signals. R Sector Address. Specifies the sector number to be read or written. In multi-sector transfers, this parameter specifies the sector number of the first sector to be read or written. SC Number of Sectors per Track. Specifies the number of sectors per track to be initialized by the Format Track command. Symbol Description SK Skip Flag. When this flag is set, sectors containing deleted data address marks will automatically be skipped during the execution of multi-sector Read Data or Scan commands. In the same manner, a sector containing a data address mark will automatically be skipped during the execution of a multi-sector Read Deleted Data command. SRT Step Rate Interval. Defines the time interval between step pulses issued by the FDC (trackto-track access time). Programmable from 1 to 16 milliseconds (in increments of 1 ms). STO STl ST2 ST3 Status Register 0-3. Registers within the FDC that store status information after a command has been executed. This status information is available to the processor during the Result Phase after command execution. These registers may only be read after a command has been executed (in the exact order shown in Table 5 for each command). These registers should not be confused with the Main Status Register. STP Scan Sector Increment. During Scan operations, this parameter is added to the current sector number in order to determine the next sector to be scanned. Table 7. Status Register Definitions Bit Number Symbol Description Status Register 0 7,6 IC Interrupt Code. 00 - Normal termination of command. The specified command was properly executed and completed without error. 01 - Abnormal termination of command. Command execution was started but could not be successfully completed. 10 - Invalid command. The requested command could not be executed. II - Abnormal termination. During command execution, the disk drive ready signal changed state. 5 SE Seek End. This flag is set (high) when the FDC has completed the Seek command and the read/write head is positioned over the correct cylinder. 4 EC Equipment Check Error. This flag is set (high) if a fault signal is received from the disk drive or if the track 0 signal fails to become active after 77 step pulses (Recalibrate command). 3 NR Not Ready Error. This flag is set if a read or write command is issued and either the drive is not ready or the command specifies side I (head I) of a single-sided disk. 2 H 1,0 DSI,DSO Head Address. The head address at the time of the interrupt. Drive Select. The number of the drive selected at the time of the interrupt. 6-512 207875-002 APPLICATIONS Table 7. Status Register Definitions (continued) Bit Number Symbol Description Status Register 1 7 EN End of Track Error. This flag is set if the FDC attempts to access a sector beyond the final sector of the track. S DE Data Error. Set when the FDC detects a CRC error in either the ID field or the data field of a sector. 4 OR Overrun Error. Set (during data transfers) if the FDC does not receive DMA or processor service within the specified time interval. 2 ND Sector Not Found Error. This flag is set by any of the following conditions. a) The FDC cannot locate the sector specified in the Read Data, Read Deleted Data, or Scan command. b) The FDC cannot locate the starting sector specified in the Read Track command. c) The FDC cannot read the ID field without error during a Read ID command. 1 NW Write Protect Error. This flag is set if the FDC detects a write protect signal from the disk drive during the execution of a Write Data, Write Deleted Data, or Format Track command. 0 MA Missing Address Mark Error. This flag is set by either of the following conditions: a) The FDC cannot detect the ID address mark on the specified track (after two occurrences of the physical index mark). b) The FDC cannot detect the data address mark or deleted data address mark on the specified track. (See also the MD bit of Status Register 2.) 6 CM Control Mark. This flag is set when the FDC encounters one of the following conditions: a) A deleted data address mark during the execution of a Read Data or Scan command. b) A data address mark during the execution of a Read Deleted Data command. S DD Data Error. Set (high) when the FDC detects a CRC error in a sector data field. This flag is not set when a CRC error is detected in the ID field. 4 WC Cylinder Address Error. Set when the cylinder address from the disk sector ID field is different from the current cylinder address maintained within the FDC. 6 Not used. This bit is always low. 3 Not used. This bit is always low. Status Register 2 7 Not used. This bit is always low. 3 SH Scan Hit. Set during the execution of the Scan command if the scan condition is satisfied. 2 SN Scan Not Satisfied. Set during execution of the Scan command if the FDC cannot locate a sector on the specified cylinder that satisfies the scan condition. 1 BC Bad Track Error. Set when the cylinder address from the disk sector ID field is FF hexadecimal and this cylinder address is different from the .current cylinder address maintained within the FDC. This all "ones~' cylinder number indicates a bad track (one containing hard errors) according to the IBM soft-sectored format specifications. 0 MD Missing Data Address Mark Error. Set if the FDC cannot detect a data address mark or deleted data address mark on the specified track. 6-513 207875-002 APPLICATIONS Table 7. Status Register Definitions (continued) Bit Number Symbol Description Status Register 3 7 FT Fault. This flag indicates the status of the fault signal from the selected disk drive. 6 WP Write Protected. This flag indicates the status of the write protect signal from the selected disk drive. S RDY 4 TO Track O. This flag indicates the status of the track 0 signal from the selected disk drive. Ready. This flag indicates the status of the ready signal from the selected disk drive. 3 TS Two-Sided. This flag indicates the status of the two-sided signal from the selected disk drive. 2 H Head Address. This flag indicates the status of the side select signal for the currently selected disk drive. 1,0 DS1,DSO Drive Select. Indicates the currently selected disk drive number. In the non-DMA mode, transfer requests are indicated by activation of both the INT output signal and the RQM flag (bit 7) in the Main Status Register. INT can be used for interrupt-driven systems and RQM can be used for polled systems. The system processor must respond to the transfer request by reading data from (activating RD), or writing data to (activating WR), the FDC. This response removes the transfer request (INT and RQM are set inactive). After completing the last transfer, the 8272 activates the INT output to indicate the beginning of the result phase. In the non-DMA mode, the processor must activate the TC signal to the FDC (normally by means of an I/O port) after the transfer request for the last data byte has been received (by the processor) and before the appropriate data byte has been read from (or written to) the FDC. In either mode of operation (DMA or non-DMA), the execution phase ends when a terminal count signal is sensed or when the last sector on a track (the EOT parameter-Table 5) has been read or written. In addition, if the disk drive is in a "not ready" state at the beginning of the execution phase, the "not ready" flag (bit 3 in Status Register 0) is set (high) and the command is terminated. If a fault signal is received from the disk drive at the end of a write operation (Write Data, Write Deleted Data, or Format), the FDC sets the "equipment check" flag (bit 4 in Status Register 0), and terminates the command after setting the interrupt code (bits 7 and 6 of Status Register 0) to "01" (bit 7 low, bit 6 high). Multi-sector and Multi-track Transfers During disk read/write transfers (Read Data, Write Data, Read Deleted Data, and Write Deleted Data), the FDC will continue to transfer data from sequential sectors until the TC input is sensed. In the DMA mode, the TC input is normally connected to the TC/EOP (terminal count) output of the DMA controller. In the nonDMA mode, the processor directly controls the FDC TC input as previously described. Once the TC input is received, the FDC stops requesting data transfers (from the system processor or DMA controller). The FDC, however, continues to read data from, or write data to, the floppy disk until the end of the current disk sector. During a disk read operation, the data read from the disk (after reception of the TC input) is discarded, but the data CRC is checked for errors; during a disk write operation, the remainder of the sector is filled with allzero bytes. If the TC signal is not received before the last byte of the current sector has been transferred to/from the system, the FDC increments the sector number by one and initiates a read or write command for this new disk sector. The FDC is also designed to operate in a multi-track mode for dual-sided disks. In themuiti-track mode (specified by means of the MT flag in the command byte-Table 5) the FDC will automatically increment the head address (from 0 to 1) when the last sector (on the track under head 0) has been read or written. Reading or writing is then continued on the first sector (sector 1) of head 1. Drive Status Polling After the power-on reset, the 8272 automatically enters a drive status polling mode. If a change in drive status is detected (all drives are assumed to be }'not ready" at power-on), an interrupt is generated. The 8272 continues this status polling between command executions (and between step pulses in the Seek command). In this manner, the 8272 automatically notifies the system processor when a floppy disk is inserted, removed, or changed by the operator. 6-514 207875-002 APPLICATIONS Command Details Sense Interrupt Status During the command phase, the Main Status Register must be polled by the CPU before each byte is written into the Data Register. The DIO (bit 6) and RQM (bit 7) flags in the Main Status Register must be low and high, respectively, before each byte of the command may be written into the 8272. The beginning of the execution phase for any of these commands will cause DIO to be set high and RQM to be set low. An interrupt signal is generated by the FDC when one or more of the following events occurs: The following paragraphs describe the fifteen FDC commands in detail. Specify The Specify command is used prior to performing any disk operations (including the formatting of a new disk) to define drive/FDC operating characteristics. The Specify command parameters set the values for three internal timers: 1. Head Load Time (HLT) - This seven-bit value defines the time interval that the FDC waits after loading the head before initiating a read or write operation. This timer is programmable from 2 to 254 milliseconds in increments of 2 ms. 2. Head Unload Time (HUT) - This four-bit value defines the time from the end of the execution phase (of a read or write command) until the head is unloaded. This timer is programmable from 16 to 240 milliseconds in increments of 16 ms. If the processor issues another command before the head unloads, the head will remain loaded and the head load wait will be eliminated. 1. The FDC enters the result phase for: a. Read Data command b. Read Track command c. Read ID command d. Read Deleted Data command e. Write Data command f. Format Track command g. Write Deleted Data command h. Scan commands 2. The ready signal from one of the disk drives changes state. 3. A Seek or Recalibrate command completes operation. 4. The FDC requires a data transfer during the execution phase of a command in the non-DMA mode. Interrupts caused by reasons (1) and (4) above occur during normal command operations and are easily discernible by· the processor. However, interrupts caused by reasons (2) and (3) above are uniquely identified with the aid of the Sense Interrupt Status command. This command, when issued, resets the interrupt signal and by means of bits 5, 6, and 7 of Status Register o (returned during the result phase) identifies the cause of the interrupt (see Table 8). Table 8. Interrupt Codes 3. Step Rate Time (SRT) - This four-bit value defines the time interval between step pulses issued by the FDC (track-to-track access time). This timer is programmable from I to 16 milliseconds in increments of 1 ms. Seek End Bit 5 The time intervals mentioned above are a direct function of the FDC clock (CLK on pin 19). Times indicated above are for an 8 MHz clock. The Specify command also indicates the choice of DMA or non-DMA operation (by means of the ND bit). When this bit is high the non-DMA mode is selected; when ND is low, the DMA mode is selected. Sense Drive Status This command may be used by the processor whenever it wishes to obtain the status of the disk drives. Status Register 3 (returned during the result phase) contains the drive status information as described in Table 7. Interrupt Code Cause Bit 6 Bit 7 0 1 1 Ready Line changed state, either polarity 1 0 0 Normal Termination of Seek or Recalibrate Command 1 1 0 Abnormal Termination of Seek or Recalibrate Command Neither the Seek nor the Recalibrate command has a result phase. Therefore, it is mandatory to use the Sense Interrupt Status Command after these commands to effectively terminate them and to provide verification of the disk i).ead position. 6-515 207875-002 APPLICATIONS When an interrupt is received by the processor, the FDC busy flag (bit 4) and the non-DMA flag (bit 5) may be used to distinguish the above interrupt causes: Recalibrate A single interrupt request to the processor may, in fact, be caused by more than one of the above events. The processor should continue to issue Sense Interrupt Status commands (and service the resulting conditions) until an invalid command code is received. In this manner, all "hidden" interrupts are serviced. This command causes the read/write head of the disk drive to retract to the track 0 position. The FDC clears the contents of its internal cylinder counter, and checks the status of the track 0 signal from the disk drive. As long as the track 0 signal is low, the direction signal remains high and step pulses are issued. When the track 0 signal goes high, the seek end flag (in Status Register 0) is set (high) and the command is terminated. If the track osignal is still low after 77 step pulses have been issued, the seek end and equipment check flags (in Status Register 0) are both set and the Recalibrate command is terminated. Seek Recalibrate commands for multiple drives can be overlapped in the same manner that Seek commands are overlapped. bit 5 bit 4 o o o 1 1 1 Asynchronous event-(2) or (3) above Result phase-(1) above Data transfer required-(4) above The Seek command causes the drive's read/write head to be positioned over the specified cylinder. The FDC determines the difference between the current cylinder address and the desired (specified) address, and issues the appropriate number of step pulses. If the desired cylinder address is larger than the current address, the direction signal (LCT/DIR, pin 38) is set high (step-in); the direction signal is set low (step-out) if the desired cylinder address is less than the current address. No head movement occurs (no step pulses are issued) if the desired cylinder is the same as the current cylinder. The rate at which step pulses are issued is controlled by the step rate time (SRT) in the Specify command. After each step pulse is issued, the desired cylinder address is compared against the current cylinder address. When the cylinder addresses are equal, the "seek end" flag (bit 5 in Status Register 0) is set (high) and the command is terminated. If the disk drive becomes "not ready" during the seek operation, the "not ready" flag (in Status Register 0) is set (high) and the command is terminated. During the command phase of the Seek operation the FDC is in the FDC busy state, but during the execution phase it is in the non-busy state. While the FDC is in the non-busy state, another Seek command may be issued. In this manner parallel seek operations may be in operation on up to four floppy disk drives at once. The Main Status Register contains a flag for each drive (Table 4) that indicates whether the associated drive is currently operating in the seek mode. When a drive has completed a seek operation, the FDC generates an interrupt. In response to this interrupt, the system software must issue a Sense Interrupt Status command. During the result phase of this command, Status Register 0 (containing the drive number in bits 0 and I) is read by the processor. Format Track The Format Track command formats or "initializes" a track on a floppy disk by writing the ID field, gaps, and address marks for each sector. Before issuing the Format command, the Seek command must be used to position the read/write head over the correct cylinder. In addition, a table oflD field values (cylinder, head, and sector addresses and sector length code) must be prepared before the command is executed. During command execution, the FDC accesses the table and, using the values supplied, writes each sector on the track. The ID field address mark originates from the FDC and is written automatically as the first byte of each sector's ID field. The cylinder, head, and sector addresses are taken, in order, from the table. The ID field CRC character (derived from the data written in the first five bytes) is written as the last two bytes of the ID field. Gaps are written automatically by the FDC, with the length of the variable gap determined by one of the Format command parameters. The data field address mark is generated by the FDC and is written automatically as the first byte of the data field. The data pattern specified in the command phase is written into each data byte of each sector. A CRC character is derived from the data address mark and the data written in the sector's data field. The two CRC bytes are appended to the last data byte. The formatting of a track begins at the physical index mark. As previously mentioned, the order of sector assignment is taken directly from the formatting table. Four entries are required for each sector: a cylinder address, a head address, a sector address, and a sector length code. The cylinder address in the ID field should be equal to the cylinder address of the track currently being formatted. 6-516 207875-002 APPLICATIONS The sector addresses must be unique (no two equal). The order of the sector entries in the table is the sequence in which sector numbers appear on the track when it is formatted. The number of entry sets (cylinder, head, and sector address and sector length code) must equal the number of sectors allocated to the track (specified in the command phase). passed to the system; the remainder of the actual disk sector is not transferred (although the data is checked for CRC errors). Multi-sector read operations are performed in the same manner as they are when the sector size code is non-zero. (The N and DTL parameters are always present in the command sequence. DTL should be set to FF hexadecimal when N is not zero.) Since the sector address is supplied, in order, for each sector, tracks can be formatted sequentially (the first sector following the index mark is assigned sector address 1, the adjacent sector is assigned sector address 2, and so on) or sector numbers can be interleaved (see section 3) on a track. If the FDC detects the physical index mark twice without finding the requested sector, the FDC sets the "sector not found error" flag (bit 2 in Status Register 1) and terminates the Read Data command. The interrupt code (bits 7 and 6 of Status Register 0) is set to "01." Note that the FDC searches for each sector in a multisector operation. Therefore, a "sector not found" error may occur after successful transfer of one or more preceding sectors. This error could occur if a particular sector number was not included when the track was first formatted or if a hard error on the disk has invalidated a sector ID field. Table 9 lists recommended gap sizes and sectors/track for various sector sizes. Read Data Nine (9) bytes are required to complete the command phase specification for the Read Data command. During the execution phase, the FDC loads the head (if it is in the unloaded state), waits the specified head load time (defined in the Specify command), and begins reading ID address marks and ID fields. When the requested sector address compares with the sector address read from the disk, the FDC outputs data (from the data field) byte-by-byte to the system. The Read Data command automatically operates in the multi-sector mode described earlier. In addition, multi-track operation may be specified by means of the MT command flag (Table 5). The amount of data that can be transferred with a single command to the FDC depends on the multi-track flag, the recording density flag, and the number of bytes per sector. During the execution of read and write commands, the special sector size parameter (DTL) is used to temporarily alter the effective disk sector size. By setting the sector size code (N) to zero, DTL may be used to specify a sector size from 1 to 256 bytes in length. If the actual sector (on the disk) is larger than DTL specifies, only the number of bytes specified by the DTL parameter are After reading the ID field and data field in each sector, the FDC checks the CRC bytes. If a read error is detected (incorrect CRC in the ID field), the FDC sets the "data error" flag in Status Register 1; if a CRC error occurs in the data field, the FDC sets the "data error" flag in Status Register 2. In either error condition, the FDC terminates the Read Data command. The interrupt code (bits 7 and 6 in Status Register 0) is set to "01." If the FDC reads a deleted data address mark from the disk, and the skip flag (specified during the command phase) is not set, the FDC sets the "control mark" flag (bit 6 in Status Register 2) and terminates the Read Data command (after reading all the data in the sector). If the skip flag is set, the FDC skips the sector with the deleted data address mark and reads the next sector. Thus, the skip flag may be used to cause the FDC to ignore deleted data sectors during a multi-sector read operation. During disk data transfers between the FDC and the system, the FDC must be serviced by the system (processor or DMA controller) every 27 I's in the FM mode, and every 13 I's in the MFM mode. If the FDC is not Table 9. Sector Size Relationships Format FM Mode MFM Mode Sector Size N Sector Size Code 128 bytes/Sector 256 512 00 01 02 256 512 01 02 03 1024 GPL1 Gap 3 Length GPL2 Gap 3 Length lA(16) OF(16) 08 07(16) OE(16) IB(16) IB(16) 2A(16) 3A(16) IBM Diskette 1 IBM Diskette 2 IA(l6) OF(16) 08 OE(l6) IB(16) 35(16) 36(16) 54(16) 74(16) IBM D'iskette 2D SC Sectorsl Track Remarks IBM Diskette 2D Notes: 1. Suggested values of GPL in Read or Write commands to avoid splice point between data field and ID field of contiguous sectors. 2. Suggested values of GPL in Format command. 6-517 207875-002 APPLICATIONS serviced within this interval, the "overrun error" flag (bit 4 in Status Register 1) is set and the Read Data command is terminated. skip flag. When the FDC detects a data address mark at the beginning of a data field (and the skip flag is not set), the FDC reads all the data in the sector, sets the "control mark" flag (bit 6 in Status Register 2), and terminates the command. If the skip flag is set, the FDC skips the sector with the data address mark and continues reading at the next sector. Thus, the skip flag may be used to cause the FDC to read only deleted data sectors during a multi-sector read operation. If the processor terminates a read (or write) operation in the FDC, the ID information in the result phase is dependent upon the state of the multi-track flag and end of track byte. Table 11 shows the values for C, H, R, and N, when the processor terminates the command. Write Data Write Deleted Data Nine (9) bytes are required to complete the command phase specification for the Write Data command. During the execution phase the FDC loads the head (if it is in the unloaded state). waits the specified head load time (defined by the Specify command), and begins reading sector ID fields. When the requested sector address compares with the sector address read from the disk, the FDC reads data from the processor one byte at a time via the data bus and outputs the data to the data field of that sector. The CRC is computed on this data and two CRC bytes are written at the end of the data field. This command operates in the same manner as the Write Data command operates except that a deleted data address mark is written at the beginning of the data field instead of the normal data address mark. This command is used to mark a bad sector (containing a hard error) on the floppy disk. Read Track. The FDC reads the ID field of each sector and checks the CRC bytes. If the FDC detects a read error (incorrect CRC) in one of the ID fields, it sets the "data error" flag (bit 5 in Status Register 1) and terminates the Write Data command. The interrupt code (bits 7 and 6 in Status Register 0) is set to "01." The Write Data command operates in much the same manner as the Read Data command. The following items are the same; refer to the Read Data command for . details: • • • • • • • Multi-sector and Multi-track operation Data transfer capacity "End of track error" flag "Sector not found error" flag "Data error" flag Head unload time interval ID information when the processor terminates the command (see Table 11) • Definition of DTL when N = 0 and when N"" 0 During the Write Data execution phase, data transfers between the processor and FDC must occur every 31 /- Dprocessor DFD01- Dprocessor Table 11. ID Information When Processor Terminates Command MT 0 I EOT Final Sector Transferred to Processor ID Information at Result Phase C H R N NC NC R+I NC C+I NC R=OI NC NC NC R+I NC C+I NC R=OI NC IA OF 08 Sector I to 25 at Side 0 Sector I to 14 at Side 0 Sector I to 7 at Side 0 IA OF 08 Sector 26 at Side 0 Sector 15 at Side 0 Sector 8 at Side 0 IA OF 08 Sector I to 25 at Side I Sec\or I to 14 at Side I Sector I to 7 at Side I IA OF 08 Sector 26 at Side I Sector 15 at Side I Sector 8 at Side I IA OF 08 Sector I to 25 at Side 0 Sector I to 14 at Side 0 Sector 1 to 7 at Side 0 NC NC R+I NC IA OF 08 Sector 26 at Side 0 Sector 15 at Side 0 Sector 8 at Side 0 NC LSB R=OI NC IA OF 08 Sector I to 25 at Side 1 Sector 1 to 14 at Side 1 Sector I to 7 at Side I NC NC R+I NC IA OF 08 Sector 26 at Side I Sector 15 at Side I Sector 8 at Side I C+I LSB R=OI NC Notes: 1. NC (No Change): The same value as the one at the beginning of command execution. 2. LSB (Least Significant Bit): The least significant bit of H is complemented. 6-519 207875-002 APPLICATIONS not satisfied" flags under various scan termination conditions. If the FDC encounters a deleted data address mark in one of the sectors and the skip flag is low, it regards the sector as the last sector on the cylinder, sets the "control mark" flag (bit 6 in Status Register 2) and terminates the command. If the skip flag is high, the FDC skips the sector with the deleted address mark, and reads the next sector. In this case, the FDC also sets the "control mark" flag (bit 6 in Status Register 2) in order to show that a deleted sector had been encountered. NOTE: During scan command execution, the last sector on the track must beread for the command to terminate properly. For example, if the scan sector increment is set to 2, the end of track parameter is set to 26, and the scan begins at sector 21, sectors 21, 23, and 25 will be scanned. The next sector, 27 will not be found on the track and an abnormal command termination will occur. The command would be completed in a normal manner if either a) the scan had started at sector 20 or b) the end of track parameter had been set to 25. During the Scan command, data is supplied by the processor or DMA controller for comparison against the data read from the disk. In order to avoid having the "overrun error" flag set (bit 4 in Status Register I), it is necessary to have the data available in less than 27 p's (FM Mode) or 13 p's (MFM Mode). If an overrun error occurs, the FDC terminates the command. Invalid Commands If an invalid (undefined) command is sent to the FDC, the FDC will terminate the command. No interrupt is generated by the 8272 during this condition. Bit 6 and bit 7 (DIO and RQM) in the Main Status Register are both set indicating to the processor that the 8272 is in the result phase and the contents of Status Register 0 must be read. When the processor reads Status Register oit will find an 80H code indicating that an invalid command was received. A Sense Interrupt Status command must be sent after a Seek or Recalibrate interrupt; otherwise the FDC will consider the next.command to be an invalid command. Also, when the last "hidden" interrupt has been serviced, further Sense Interrupt Status commands will result in invalid command codes. In some applications the user may wish to use this command as a No-Op command to place the FDC in a stand-by or no operation state. 5. THE DATA SEPARATOR As briefly discussed in section 2, LSI disk controllers such as the 8272 require external circuitry to generate a data window signal. This signal is used within the FDC to isolate the data bits contained within the READ DATA input signal from the disk drive. (The disk READ DATA signal is a composite signal constructed from both clock and data information.) After isolating the data bits from this input signal, the FDC assembles the data bits into 8-bit bytes for transfer to the system processor or memory. Single Density In single-density (FM) recording (Figure 3 ), the bit cell is 4 microseconds wide. Each bit cell contains a clock bit at the leading edge of the cell. The data bit (if present) is always located at the center of the cell. The job of data separation is relatively straightforward for singledensity; simply generate a data window 2 p.s wide starting 1 p's after each clock bit. Since every cell has a clock bit, a fixed window reference is available for every data bit and because the window is 2 p.s wide, a slightly shifted data bit will still remain within the data window. A single-density data separator with these specifications may be easily generated using a digital or analog oneshot triggered by the clock bit. Double·Density Double-density (MFM) bit cells are reduced to 2 p.s (in order to double the disk data storage capacity). Clock bits are inserted into the data stream only if data bits are not present in both the current and preceding bit cells (Figure 3). The data bit (if present) still occurs at the center of the bit cell and the clock bit (if present) still occurs at the leading edge of the bit cell. MFM data separation has two problems. First, only some bit cells contain a clock bit. In this manner, MFM encoding loses the fixed bit cell reference pulse present in FM encoding. Second, the bit cell for MFM is onehalf the size of the bit cell for FM. This shorter bit cell means that MFM cannot tolerate as large a playback data-shift (as FM can tolerate) without errors. Since most playback data-shift is predictable, the FDC can precompensate the write data stream so that datal clock pulses will be correctly positioned for subsequent playback. This function is completely controlled by the FDC and is only required for MFM recording. During write operations, the FDC specifies an early, normal, or late bit positioning. This timing information is specified with respect to the FDC write clock. Early and late timing is typically 125 ns to 250 ns before or after the write clock transition (depending on disk drive requirements). 207875-002 APPLICATIONS The data separator circuitry for double-density recording must continuously analyze the total READ DATA stream, synchronizing its operation (window generation) with the actual clock/data bits of the data stream. The data separation circuit must track the disk input data frequency very closely-unpredictable bit shifts leave less than 50 ns margin to the window edges. Phase· Locked Loop Only an analog phase-locked loop (PLL) can provide the reliability required for a double-density data separation circuit. (A phase-locked loop is an electronic circuit that constantly analyzes the frequency of an input signal and locks another oscillator to that frequency.) Using analog PLL techniques, a data separator can be designed with ± 1 ns resolution (this would require a 100 MHz clock in a digital phase-locked loop). The analog PLL determines the clock and data bit positions by sampling each bit in the serial data stream. The phase relationship between a data bit and the PLL generated data window is constantly fed back to adjust the position of the data window, enabling the PLL to track input data frequency changes, and thereby reliably read previously recorded data from a floppy disk. PLL Design A block diagram of the phase-locked loop described in this application note is shown in Figure 7. Basically, the phase-locked loop operates by comparing the frequency of the input data (from the disk drive) against the frequency of a local oscillator. The difference of these frequencies is used to increase or decrease the frequency of the local oscillator in order to bring its frequency closer to that of the input. The PLL synchronizes the local oscillator to the frequency of the input during the all "zeroes" synchronization field on the floppy disk (immediately preceding both the ID field and the data field). The PLL consists of nine ICs and is located on page 3 of the schematics in the Appendix. The 8272 YCO output essentially turns the PLL circuitry on and off. When the PLL is off, it "idles" at its center frequency. The YCO output turns the PLL on only when valid data is being received from the disk drive. The YCO turns the PLL on after the read/write head has been loaded and the head load time has elapsed. The PLL is turned off in the gap between the ID field and the data field and in the gap after the data field (before the next sector ID field). The GPL parameter in the FDC read and write commands specifies the elapsed time (number of data bytes) that the PLL is turned off in order to blank out discontinuities that appear in the gaps when the write current is turned on and off. The PLL operates with either MFM or FM input data. The MFM output from the FDC controls the PLL operation frequency. The PLL consists of six functional blocks as follows: 1. Pulse Shaping - A 96LS02 senses a READ DATA 'pulse and provides a clean output signal to the FDC and to the PLL Phase Comparator and Frequency Discriminator circuitry. 2. Phase Comparator - The phase difference between the PLL oscillator and the READ DATA input is compared. Pump up (PU) and pump down (PD) error signals are derived from this phase difference and output to the filter. If there is no phase difference between the PLL oscillator and the READ DATA input, the PU and PD pulse widths are equal. If the READ DATA pulse occurs early, the PU duration is shorter than the PD duration. If the data pulse occurs late, the PU duration is longer than the PD duration. 3. Filter - This analog circuit filters the PU and PD pulses into an error voltage. This error voltage is buffered by an LM358 operational amplifier. r-----------------------------------~~~~D~~TA DATA WINDOW (TO FDC) READ DATA (FROM DISKETTE DRIVE) FREQUENCY DISCRIMINATOR VCO (FROM FDC) MFM (FROM FDC) ---------------------1 ---------------------1 START LOGIC IDLE CLAMP Figure 7. Phase·Locked Loop Data Separator 6-521 207875-002 APPLICATIONS 4. PLL Oscillator - This oscillator is composed of a 74LS393, 74LS74, and 96LS02. The oscillator frequency is controlled by the error voltage output by the filter. This oscillator also generates the data window signal to the FDC. 5. Frequency Discriminator - This logic tracks the READ DATA input from the disk drive and discriminates between the synchronization gap for FM recording (250 KHz) and the gap for MFM recording (500 KHz). Synchronization gaps immediately precede address marks. 6. Start Logic - The function of this logic is to clamp the PLL oscillator to its center frequency (2 MHz) until the FDC VCO signal is enabled and a valid data pattern is sensed by the frequency discriminator. The start logic (consisting of a 74LS393 and 74LS74) ensures that the PLL oscillator is started with zero phase error. PLL Adjustments The PLL must be initially adjusted to operate at its center frequency with the VCO output off and the adjustment jumper removed. The 5K trimpot should be adjusted until the frequency at the test point (Q output of the 96LS02) is 2 MHz. The jumper should then be replaced for normal operation. PLL Design Details The following paragraphs describe the operational and design details of the phase-locked loop data separator il- lustrated in the appendix. Note that the analog section is operated from a separately filtered + 5V supply. Initialization As long as the 8272 maintains a low VCO signal, the data separator logic is "turned off". In this state, the PLL oscillator (96LS02) is not oscillating and therefore the 2XBR signal is constantly low. In addition, the pump up (PU) and pump down (PD) signals are inactive (PU low and PD high), the CNT8 signal is inactive (low), and the filter input voltage is held at 2.5 volts by two IMohm resistors between ground and +5 volts. Floppy Disk Data The data separator frequency discriminator, the input pulse shaping circuitry, and the start logic are always enabled and respond to rising edges of the READ DATA signal. The rising edge of every data bit from the disk drive triggers two pulse shaping one-shots. The first pulse shaper generates a stable and well-defined 200 ns read data pulse for input to the 8272 and other portions of the data separator logic. The second one-shot generates a 2.5 J1,S data pulse that is used for input data frequency discrimination. The frequency discriminator operates as illustrated in Figure 8. The 2F output signal is active (high) during reception of valid MFM (double-density) sync fields on the disk while the IF signal is active (high) during reception of valid FM (single-density) sync fields. A multiplexer (controlled by the 8272 MFM signal) selects the appropriate IF or 2F signal depending on the programmed mode. (0) FM OPERATION: ONE·SHOT TIMES OUT BETWEEN CLOCK PULSES FMREADDATA~------lnl-...Jnl-...Jnl-...JnL.--_rL FREQ DISC -~. __ 2F LOW. 1F HIGH DURING SYNC DATA INPUT (FM) MFM READ DATA ~ FREQ DISC~ 2F HIGH. 1F LOW DURING SYNC DATA INPUT (MFM) ~J( K )( J( )( J( I( I( x= FREQUENCY DISCRIMINATOR SAMPLE POINTS TO GENERATE 1F AND 2F SIGNALS Figure 8. Input Data Frequency Discrimination 6-522 207875-002 APPLICATIONS Startup The data separator is designed to require reception of eight valid sync bits (one sync byte) before enabling the PLL oscillator and attempting to synchronize with the input data stream (see Figure 9). This delay ensures that the PLL will not erroneously synchronize outside a valid sync field in the data stream if the VCO signal is enabled slightly early. The sync bit counter is asynchronously reset by the CNTEN signal when valid sync data is not being received by the drive. Once the VCO signal is active and eight sync bits have been counted, the CNT8 signal is enabled. This signal turns on the PLL oscillator. Note that this oscillator starts synchronously with the rising edge of the disk input data (because CNT8 is synchronous with the data rising edge) and the oscillator also starts at its center frequency of 2 MHz (because the LM348 filter input is held at its center voltage of approximately 2.5 volts). This frequency is divided by two and four to generate the 2XBR signal (1 MHz for MFM and 500 KHz for FM). READ DATA FREQ DISC 2F~L-_ _ _ _ _ _ _ _ _ __ lF~ CNTEN~L-_________________________________________________________ Vco CNT8----------------------________________________________ ~ PLCLK _______________________________________________________ ~ 2XBR ________________~_______________________________________ ~ PDCLR _________________________________________________________ ~ PUCLR ____________________________________________________________-,~ PU _______________________________________~n~~n~_ PD---------------,U LJ ILJLJ DW _ _ _ _ _ _ _ _ _ _ _ Figure 9. Typical Data Separator Startup Timing Diagram 6-523 207875-002 APPLICATIONS PLL Synchronization Processor and Memory At this point, the PLL is enabled and begins to synchronize with the input data stream. This synchronization is accomplished very simply in the following manner. The pump up (PU) signal is enabled on the rising edge of the REAO OATA from the disk drive. (When the PLL is synchronized with the data stream, this point will occur at the same time as the falling edge of the 2XBR signal as shown in Figure 9). The PU signal is turned off and the PO signal is activated on the next rising edge of the 2XBR clock. With this scheme, the difference between PU active time and the PO active time is equal to the difference between the input bit rate and the PLL clock rate. Thus, if PU is turned on longer than PO is on, the input bit rate is faster than the PLL clock. A high-performance 8088 eight-bit microprocessor (operating at 5 MHz with no wait states) controls system operation. The 8088 was selected because of its memory addressing capabilities and its sophisticated string handling instructions. These features improve the speed of data base search operations. In addition, these capabilities allow the system to be easily upgraded with additional memory, disk drives, and if required, a bubble memory or winchester disk unit. As long as PU and PO are both inactive, no charge is transferred to or from the LM358 input holding capacitor, and the PLL output frequency is maintained (the LM358 operational amplifier has a very high input impedance). Whenever PU is turned on, current flows from the +5 volt supply through a 20K resistor into the holding capacitor. When the PO signal is turned on, current flows from the holding capacitor to ground through a 20K resistor. In this manner, both the pump up and pump down charging rates are balanced. The change in capacitor charge (and therefore voltage) after a complete PU/PO cycle is proportional to the difference between the PU and PO pulse widths and is also proportional to the frequency difference between the incoming data stream and the PLL oscillator. As the capacitor voltage is raised (PU active longer than PO), the PLL oscillator time constant (RC of the 96LS02) is modified by the filter output (LM358) to raise the oscillator frequency. As the capacitor voltage is lowered (PO active longer than PO), the oscillator frequency is lowered. If both frequencies are equal, the voltage on the holding capacitor does not change, and the PLL oscillator frequency remains constant. 6. AN INTELLIGENT DISKETTE DATA BASE SYSTEM The system described in this application note is designed to function as an intelligent data base controller. The schematics for this data base unit are presented in Appendix A; a block diagram of the unit is illustrated in Figure 10. As designed, the unit can access over four million bytes of mass storage on four floppy disk drives (using a single 8272 FOC); the system can easily be expanded to four FOC devices (and 16 megabytes of online disk storage). Three serial data links are also included. These data links may be used by CRT terminals or other microprocessor systems to access the data base. The schematics for the basic design provide 8K bytes of 2732A high-speed EPROM program storage and 8K bytes of disk directory and file buffer RAM. This memory can easily be expanded to 1 megabyte for performance upgrades. An 8259A Programmable Interrupt Controller (PIC) is also included in the design to field interrupts from both the serial port and the FOC. This interrupt controller provides a large degree of programming flexibility for the implementation of data base functions in an asynchronous, demand driven environment. The PIC allows the system to accumulate asynchronous data base requests from all serial 110 ports while previously specified data base operations are currently in progress. This feature is made possible by the ability of the 8251A RXROY signal to cause a processor interrupt. After receiving this interrupt, the processor can temporarily halt work on existing requests and enter the incoming information into a data base request buffer. Once the information has been entered into the buffer, the system can resume its previous processing. In addition, the PIC permits some portions of data base requests to be processed in parallel. For example, once a disk record has been loaded into a memory buffer, a memory search can proceed in parallel with the loading of the next record. After the FOC completes the record transfer, the memory search will be interrupted and the processor can begin another disk transfer before resuming the memory search. The bus structure of the system is split into three functional buffered units. A 20-bit address from the processor is latched by three-state transparent 74LS373 devices. When the processor is in control of the address and data busses, these devices are output enabled to the system buffered address bus. All 110 devices are placed directly on the local data bus. Finally, the memory data bus is isolated from the local data bus by an 8286 octal transceiver. The direction of this transceiver is determined by the Memory Read signal, while its output enable is activated by a Memory Read or Memory Write command. 6-524 207875-002 APPLICATIONS I I CLOCK GENERATOR (8284) F===>I ~ RESET READY ADDRESS l.ATCH ·'" '"'"' ". r--- f- ffff- 110 AND MEMORY COMMANDS INTA INT HOLD t HLDA ~ F===>I ADDRESS LATCHI '". c~ c I-- BUFFER t DACK f-,--- I--- ~ -r + DATA I ~INDOWI VCO,MFM (EAD DATA I RECEIVERS rtt CS c~ I (8286) PHASE RD,WR,es l rlJL. -- SERIAL I/O PORTS (B251A USARTs) LOCKED LOOP I DATA BUS TRANSCEIVER RD,WR,CS 8·BIT LOCAL DATA BUS PROGRAMMABLE INTERRUPT CONTROLLER (B259A PIC) FLEXIBLE DISKETTE CONTROLLER (6272 FDC) f---J t,!, '" '" '" r--- ORO ~ 110 AND MEMORY ADDRESS DECODE RAM (211'·3) '""" '" '"r:i a:," ci" " ~ DMA CONTROLLER (8237·2) 2732A f-- 8·BIT LOCAL DATA BUS PROCESSOR (6066) rl'"~ I (PLL) DATA SEPA· I-~ ~ BAUD RATE GENERATOR (6253 pm I-- U:k~:~ L----RxD ~ READY hD R,D INDEX WRITE PROTECT TWO SIDED FAULT TRACK 0 READ DATA DRIVERS 111 DRIVE SELECT DIRECTION STEP WRITE GATE FAULT RESET LOW CURRENT SIDE SELECT HEAD LOAD WRITE DATA Figure 10. Intelligent Data Base Block Diagram 6-525 207875-002 APPLICATIONS Serial 1/0 The three RS-232-C compatible serial 110 ports operate at software-programmable baud rates to 19.2K. Each 110 port is controlled by an 8251A USART (Universal Synchronous/Asynchronous Receiver/Transmitter). Each USART is individually programmable for operation in many synchronous and asynchronous serial data transmission formats (including IBM Bi-sync). In operation, USART error detection circuits can check for parity, data overrun, and framing errors. An 8253 Programmable Interval Timer is employed to generate the baud rates for the serial 110 ports. The Transmitter Ready and Receiver Ready output signals of the 8251As are routed to the interrupt inputs . of the 8259A interrupt controller. These signals interrupt processor execution when a data byte is received by a USART and also when the USART is ready to accept another data byte for transmission. DMA The 8272 FDC interfaces to system memory by means of an 8237-2 high-speed DMA controller. Transfers between the disk controller .and memory also operate with no wait states when 2114-3 (150 ns) or faster static RAM is used. In operation, the 8272 presents a DMA request to the 8237 for every byte of data to be transferred. This request causes the 8273 to present a HOLD request to the 8088. As soon as the 8088 is able to relinquish data/address bus control, the processor signals a HOLD acknowledge to the 8237. The 8237 then assumes control over the data and address busses. After latching the address for the DMA .transfer, the 8237 generates simultaneous 110 Read and Memory Write commands (for a disk read) or simultaneous 110 Write and Memory Read commands (for a disk write). At the same time, the 8272 is selected as the I/O device by means of the DMA acknowledge signal from the 8237. After this single byte has been transferred between the FDC and memory, the DMA controller releases the data/address busses to the 8088 by deactivating the HOLD request. In a short period of time (13 /LS for double-density and 27 /LS for single-density) the FDC requests a subsequent data transfer. This transfer occurs in exactly the same manner as the previous transfer. After all data transfers have been completed (specified by the word count programmed into the 8237 before the FDC operation was initiated), the 8237 signals a terminal count (EOP pin). This terminal count signal informs the 8272 that the data transfer is complete. Upon reception of this terminal count signal, the 8272 halts DMA requests and initiates an "operation complete" interrupt. Since the system is designed for 20-bit addressing, a four-bit DMA-address latch is included as a processor addressable 110 port. The processor writes the upper four DMA address bits before a data transfer. When the DMA controller assumes bus control, the contents of this latch are output enabled on the upper four bits of the address bus. The only restriction in the use of this address latch is that a single disk read or write transfer cannot cross a 64K memory boundary. Disk Drive Interface The 8272 FDC may be interfaced to a maximum of four eight-inch floppy disk drives. Both single- and doubledensity drives are accommodated using the data separation circuit described in section 5. In addition, single- or dual-sided disk drives may be used. The 8272 is driven by an 8 MHz crystal controller clock produced by an 8224 clock generator. Drive select signals are decoded by means of a 74LS139 from the DSO, DSI outputs of the FDC. The fault reset, step, low current, and direction outputs to the disk drives are generated from the FR/STEP, LCT/DIR, and RW/SEEK FDC output signals by means of a 74LS240. The other half of the 74LS240 functions as an input multiplexer for the disk write protect, two-sided, fault, and track zero status signals. These signals are multiplexed into the WP/TS and FLT/TRKO inputs to the 8272. The 8272 write clock (WR CLK) is generated by a ring counter/multiplexer combination. The write clock frequency is 1 MHz for MFM recording and 500 KHz for FM recording (selected by the MFM output of the 8272). The pulse width is a constant 250 ns. The write clock is constantly generated and input to the FDC (during both read and write operations). The FDC write enable output (WE) is transmitted directly to the write gate disk drive input. Write data to the disk drive is preshifted (according to the PSO, PSI FDC outputs) by the combination of a 74LS175 four-bit latch and a 74LS153 multiplexer. The amount of preshift is completely controlled within the 8272 FDC. Three cases are possible: the data may be written one clock cycle early, one clock cycle late, or with no preshift. The data preshift circuit is activated by the FDC only in the double-density mode. The preshift is required to cancel predictable playback data shifts when recorded data is later read from the floppy disk. A single 50-conductor flat cable connects the board to the floppy disk drives. FDC outputs are driven by 7438 open collector high-current line-drivers. These drivers are resistively terminated on the last disk drive by means of a 150 ohm resistor to +5V. The line receivers are 7414 Schmitt triggered inverters with 150 ohm pull-up resistors on board. 6-526 207875-002 APPLICATIONS 7. SPECIAL CONSIDERATIONS This section contains a quick review of key features and issues, most of which have been mentioned in other sections of this application note. Before designing with the 8272 FDC, it is advisable that the information in this section be completely understood. 3. Sector Sizes The 8272 does not support 128 byte sectors in the MFM (double-density) mode. 4. Write Clock The FDC Write Clock input (WR CLK) must be present at all times. 5. Reset 1. Multi·Sector Transfers The 8272 always operates in a multi-sector transfer mode. The 8272 continues to transfer data until the TC input is activated. In a DMA configuration, the TC input of the 8272 must always be connected to the EOP/TC output of the DMA controller. When mUltiple DMA channels are used on a single DMA controller, EOP must be gated with the select signal for the proper FDC. If the TC signal is not gated, a terminal count on another channel will abort FDC operation. In a processor driven configuration with no DMA controller, the system must count the transfers and supply a TC signal to the FDC. In a DMA environment, ORing a programmable TC with the TC from the DMA controller is a convenient means of ensuring that the processor may always gain control of the FDC (even if the diskette system hangs up in an abnormal manner). 2. Processor Command/Result Phase Interface In the command phase, the processor must write the exact number of parameters in the exact order shown in Table 5. During the result phase, the processor must read the complete result status. For example, the Format Track command requires six command bytes and presents seven result bytes. The 8272 will not accept a new command until all result bytes are read. Note that the number of command and result bytes varies from command-to-command. Command and result phases cannot be shortened. During both the command and result phases, the Main Status Register must be read by the processor before each'byte of information is read from, or written to, the FDC Data Register. Before each command byte is written, DIO (bit 6) must be low (indicating a data transfer from the processor) and RQM (bit 7) must be high (indicating that the FDC is ready for data). During the result phase, DIO must be high (indicating a data transfer to the processor) and RQM must also be high (indicating that data is ready for the processor). NOTE: After the 8272 receives a command byte, the RQM flag may remain set for 12 microseconds (with an 8 MHz clock). Software should not attempt to read the Main Status Register before this time interval has elapsed; otherwise, the software will erroneously assume that the FDC is ready to accept the next byte. The FDC Reset input (RST) must be held active during power-on reset while the RD and WR inputs are active. If the reset input becomes inactive while RD and WR are still active, the 8272 enters the test mode. Once activated, the test mode can only be deactivated by a power-down condition. 6. Drive Status The 8272 constantly polls (starting after the power-on reset) all drives for changes in the drive ready status. At power-on, the FDC assumes that all drives are not ready. If a drive application requires that the ready line be strapped active, the FDC will generate an interrupt immediately after power is applied. 7. Gap Length Only the gap 3 size is software programmable. All other gap sizes are fixed. In addition, different gap 3 sizes must be specified in format, read, write, and scan commands. Refer to Section 3 and Table 9 for gap size recommendations. 8. Seek Command The drive busy flag in the Main Status Register remains set after a Seek command is issued until the Sense Interrupt Status command is issued (following reception of the seek complete interrupt). The FDC does not perform implied seeks. Before issuing data read or write commands, the read/write head must be positioned over the correct cylinder. If the head is not positioned correctly, a cylinder address error is generated. After issuing a step pulse, the 8272 resumes drive status polling. For correct stepper operation in this mode, the stepper motor must be constantly enabled. (Most drives provide a jumper to permit the stepper motor to be constantly enabled.) 9. Step Rate The 8272 can emit a step pulse that is one millisecond faster than the rate programmed by the SRT parameter in the Specify command. This action may cause subsequent sector not found errors. The step rate time should be programmed to be 1 ms longer than the step rate time required by the drive. 10. Cable Length A cable length of less than 10 feet is recommended for drive interfacing. 6-527 207875-002 APPLICATIONS 11. Scan Commands The-current 8272 has several problems when using the scan commands. These commands should not be used at this time. is low), the FDC terminates the command after reading all the data in the sector. 12. Interrupts When the processor receives an interrupt from the FDC, the FDC may be reporting one of two distinct events: a) The beginning' of the result phase of a previously requested read, write, or scan command. b) An asynchronous event such as a seek/recalibrate completion, an attention, an abnormal command termination, or an invalid command. These two cases are distinguished by the FDC busy flag (bit 4) in the Main Status Register. If the FDC busy flag is high, the interrupt is of type (a). If the FDC busy flag is low, the interrupt was caused by an asynchronous event (b). ' A single interrupt from the FDC may signal more than one of the above events. After receiving an interrupt, the processor must continue to issue Sense Interrupt Status commands (and service the resulting conditions) , until an invalid command code is received. In this manner, all "hidden" interrupts are ferreted out and serviced. 13. Skip Flag (SK) The skip flag is used during the execution of Read Data, Read Deleted Data, Read Track, and various Scan commands. This flag permits the FDC to skip unwanted sectors on a disk track. 14. Bad Track Maintenance The 8272 does not internally maintain bad track information. The maintenance of this information must be performed by system software. As an example of typical bad track operation, assume that a media test determines that track 31 and track 66 of a given floppy disk are bad. When the disk is formatted for use, the system software formats physical track 0 as logical cylinder 0 (C=O in the command phase parameters), physical track 1 as logical track I (C = I); and so on, until physical track 30 is formatted as logical cylinder 30 (C = 30). Physical track 31 is bad and should be formatted as logical cylinder FF (indicating a bad track). Next, physical track 32 is formatted as logical cylinder 31, and so on, until physical track 67 is formatted as logical cylinder 64. Next, bad physical track 66 is formatted as logical cylinder FF (another bad track marker), and physical track 67 is formatted as logical cylinder 65. This formatting continues until the last physical track (77) is formatted as logical cylinder 75. Normally, after this formatting is complete, the bad track information is stored in a prespecified area on the floppy disk (typically in a sector on track 0) so that the system will be able to recreate the bad track information when the disk is removed from the drive and reinserted at some later time. When performing a Read Data, Read Track, or Scan command, a high SK flag indicates that the FDC is to skip over (not transfer) any sector containing a deleted data address mark. A low SK flag indicates that the FDC is to terminate the command (after reading all the data in the sector) when a deleted data address mark is encountered. To illustrate how the system software performs a transfer operation disk with bad tracks, assume that the disk drive head is positioned at track 0 and the disk described above is loaded into the drive. If a command to read track 36 is issued by an application program, the system software translates this read command into a seek to physical track 37 (since there is one bad track between 0 and 36, namely 31) followed by a read of logical cylinder 36. Thus, the cylinder parameter C is set to 37 for the Seek command and 36 for the Read Sector command. When performing a Read Deleted Data command, a high SK flag indicates that sectors containing normal data address marks are to be skipped. Note that this is just the opposite situation from that described in the last paragraph. When a data address mark is enco\lntered during a Read Deleted Data command (and the SK flag 15. Head Load versus Head Settle Times The 8272 does not permit separate specification of the head load time and the head s,ettle time. When the Specify command is issued for a given disk drive, the proper value for the HLT parameter is the maximum of the head load time and the, head settle time. 6-528 207875-002 APPLICATIONS APPENDIX 6-529 207875-002 APPLICATIONS Power Distribution Part +5 GND 40 9,16 31 26 24 28 40 18 20 1,20 8 20 4 12 14 20 9 10 Fl,F2,01,02,Hl,H2,I1,12 DI,D2 18 24 9 12 E1 B2,E6,E8,F8 E2,E5 Bl A4,05,H6 F3 EI0 14 14 14 14 14 16 16 16 16 14 16 i6 20 16 16 20 14 7 7 7 7 7 8 8 8 8 7 8 8 10 8 8 10 7 Ref Deslg 8088 8224 8237-2 8251A 8253-5 8259A 8272 8284 8286 A2 16 A6 A9,B9,C9 AIO BIO DIO Al B6,F4 2114 2732A 74LSOO 74LS04 74LS27 74LS32 74LS74 74LS138 74LS139 74LS153 74LS157 74LSI64 74LS173 74LS175 74LS240 74LS257 74LS367 74LS373 74LS393 13 F6 F5 G3 04 010 D3 C3,E9 B4,C4,D4,C6 15,F7 +12 -12 14 1 74S08 74S138 E4 D6,E3 14 16 7 8 7414 7438 H7 H8,H9,HIO 14 14 7 7 1488 1489 H3 H4 14 7 7 96LS02 96LS02 07 16 8 G6 16 8 LM358 H5 8 4 6-530 207875-002 APPLICATIONS REFERENCES 6. Shugart, SA800 Series Diskette Storage Drive Double Density Design Guide, Part No. 39000, Shugart Associates, 1977. 7. Shugart, "Application Notes for Shugart Dual VFO," Part No. 39101, Shugart Associates, 1980. 1. Intel, "8272 Single/Double Density Floppy Disk Controller Data Sheet," Intel Corporation, 1980. 2. Intel iSBC 208 Hardware Reference Manual, Man~al Order No. 143078, Intel Corporation, 8. Pertec, "Soft-sector Formatting for PERTEC Flexible Disk Drives," Pertec Application Note, 1977. 1980. 3. Intel, iSBC 204 Flexible Diskette Controller Hardware Reference Manual, Manual Order No. 9800568A, Intel Corporation, 1978. 4. Shugart, SA8001801 Diskette Storage Drive OEM Manual, Part No. 50574, Shugart Associates, 1977. 5. Shugart, SA8001801 Diskette Storage Drive Theory of Operations, Part No. 50664, Shugart Associates, 1977. 9. Austin Lesea and Rodnay Zaks, "Floppy-disc Controller Design Must Begin With the Basics," EDN, May 20, 1978. 10. John Hoeppner and Larry Wall, "Encoding/ Decoding Techniques Double Floppy Disc Capacity," Computer Design, Feb 1980. 11. John Zarrella, System Architecture, Mirocomputer Applications, 1980. 6-531 207875-002 inter 7... ADG-AD7 ~ - ADO 8 ADl 7 AD. 8 AD. a AD. 10 ADS 11 ADO ",. AD7 1 RESET • • • iOR lOW 70CS ,. 5 AXD DREQ72 15 DACK72 18 INT72 10 EOP 0, 051 01 DSO .. : ro -... D. HOSEL Y3 • RD WR lCTfDIR CS AD ORO RWISEEK ~ ~ .. DACK .... "~ 2Vt lA. lY2 W .Y2 ~ L5 11 H8 • • . 18 ~ joo. 7 Xl Voo 12 OSC ,. CLK --RESIN PSl READY INDEX .1!.. ~:~ . ~ (4 PleS) WRITE PROT .... r:;; 8 2A3 lA4 17 2A4 TRACK0 ' " '-- 2Y3 lY' 2Y, '--- 1~ " LS08 (2 PLeS) 5- E9 1 ~ 3. ~ 5 31 •• Gr---~___l~ ___ 221'F ~ 1 I I I 2B LS257 03 3A 3B 4A 13 4B +5V O.1I'F AlA (2_P_lC_S)~__~__~__-,~ 6-536 10K (3 PlC t-'-r- f-12A 29 WR +1 +5V 2 1A 1Y 4 2Y 7 3Y 9 4Y 12 APPLICATIONS RESET LR~ET I/O PORTS OX - 8237·2 1X - DMA UPPER ADDRESS 12 elK ~8 ~. AD7 2X -'8253 9 AEN OREQl DREQ2 8 ADSTB ADa 21 DB7 22 AD5 23 AD. 26 AD3 27 AD2 26 ADl 26 ADO 30 DREa3 il 4X - 8251A'1 18 5X - 6251A12 AX5 2 AX. 1 V7 B V6 A V5 Sl36 06 8251A13 r:l-9 10 C5513 i:5512 11 V' V3 f> 01 S C5511 12 C572 13 C S53 V2 " Yl 2B f0 OOA YOl CS DREaD DBO C 7X - 6259A 8237·2 A6 DACKO 11 19 0 REa72 25 1 40 A7 39 0K 36 37 EOP 35 lOW 3' 33 MW 32 ex - 3 AX8 3X - 8272 17 lOR AD MR AXO 27 AD 11 DO 10 01 . ADO E6 "~ 36 2 • 0ACiffi ,r-9 ";:"SO. CS IRl 02 v-----.!. 03 0::~ IRO 7 D. 8259A 6 05 B1D S 06 AD7 IR2 20 21 IR3 IR4 22 23 IRS IRS 24 IR7 WR • 07 RD 7 HLDA 16 19 I NT72 I NT511R I NT511T I NT512R I NT512T I NT513R INT513T ~ 2 p:- I- 10 HRQ READY 17 INT 26 INTA 6 1 +5V~ 10K EOP AXQ·AX19 I ADO·AD? ,1,1 ADD eo M 1 AD 19 DO '~DD ADl 2 Al B1 18 01 ~Dl AD2 3 A2 B2 17 02 83 18 03 ~ 02 ~ 03 84 15 D. AD3 '. A3 5 A. AD4 8266 F4 ADS 6 A5 B5 ,. 05 AD6 7 A6 86 13 06 AD7 B A7 T "'1' DE B7 12 07 ~N 00 3 AX16 AX17 LS173 03 02 2~ 01 • 5 02 03 6 AX18 AX19 01 '(9 9'1' ~' I DO ,07 Rw M t=LSDB LS367 (' PLCS) 10 ..... 9 13 12 C3 ..... 6 ..... 7 ....... 5 ...... IMi 10i I M Vi W 10 ..... 2 ..... 3 ~ 6-537 207875-002 APPLICATION . NOTE AP-121 June 1981 © Intel Corporation, 1981. 6-538 207885-001 Software Design and Implementation of Floppy Disk Subsystems Contents 1. INTRODUCTION The Physical Interface Level The Logical Interface Level The File System Interface Level Scope of this Note 2. DISK I/O TECHNIQUES FDC Data Transfer Interface Overlapped Operations Buffers 3. THE 8272 FLOPPY DISK CONTROLLER Floppy Disk Commands Interface Registers Command/Result Phases Execution Phase Multi-sector and Multi-track Transfers Drive Status Polling Command Details Invalid Commands 4. 8272 PHYSICAL INTERFACE SOFTWARE INITIALlZE$DRIVERS EXECUTE$DOCB FDCINT OUTPUT$CONTROLS$TO$DMA OUTPUT$COMMAND$TO$FDC INPUT$RESULT$FROM$FDC OUTPUT$BYTE$TO$FDC INPUT$BYTE$FROM$FDC FDC$READY$FOR$COMMAND FDC$READY$FOR$RESULT OPERATlON$CLEAN$UP Modifications for Polling Operation 5. 8272 LOGICAL INTERFACE SOFTWARE SPECIFY RECALIBRATE SEEK FORMAT WRITE READ Coping With Errors 6-539 207885-001 Contents (Continued) 6. FILE SYSTEMS File Allocation The Intel File System Disk File System Functions 7. KEY 8272 SOFTWARE INTERFACING CONSIDERATIONS REFERENCES APPENDIX A-8272 FDC DEVICE DRIVER SOFTWARE APPENDIX B-8272 FDC EXERCISER PROGRAM APPENDIX C-8272 DRIVER FLOWCHARTS 6-540 207885-001 APPLICATIONS 1. Introduction Oisk interface software is a major contributor to the efficient and reliable operation of a floppy disk subsystem. This software must be a well-designed compromise between the needs of the application software modules and the capabilities of the floppy disk controller (FOC). In an effort to meet these requirements, the implementation of disk interface software is often divided into several levels of abstraction. The purpose of this application note is to define these software interface levels and describe the design and implementation of a modular and flexible software driver for the 8272 FOC. This note is a companion to AP-116, "An Intelligent Data Base System Using the 8272. " The Physical Interface Level The software interface level closest to the FOC hardware is referred to as the physical interface level. At this level, interface modules (often called disk drivers or disk handlers) communicate directly with the FOC device. oisk drivers accept floppy disk commands from other software modules, control and monitor the FOC execution of the commands, and finally return operational status information (at command termination) to the requesting modules. In order to perform these functions, the drivers must support the bit/byte level Foe interface for status and data transfers. In addition, the drivers must field, classify, and service a variety of FDC interrupts. The Logical Interface Level System and application software modules often specify disk operation parameters that are not directly compatible with the FOC device. This software incompatibility is typically caused by one of the following: 1. The change from an existing FOC to a functionally equivalent design. Replacing a TTL based controller with an LSI device is an example of a change that may result in software incompatibilities. 2. The upgrade of an existing FDC subsystem to a higher capability design. An expansion from a single-sided, single-density system to a dual-sided, double-density system to increase data storage capacity is an example of such a system change. 3. The abstraction of the disk software interface to avoid redundancy. Many FOC parameters (in particular the density, gap size, number of sectors per track and number of bytes per sector) are fixed for a floppy disk (after formatting). In fact, in many systems these parameters are never changed during the life of the system. 6-541 207885-001 APPLICATIONS 4. The requirement to support a software interface that is independent of the type of disk attached to the system. In this case, a system generated ("logical") disk address (drive, head, cylinder, and sector numbers) must be mapped into a physical floppy disk address. For example, to switch between singleand dual-sided disks, it may be easier and more cost-effective for the software to treat the dual-sided disk as containing twice as many sectors per track (52) rather than as having two sides. with this technique, accesses to sectors 1 through 26 are mapped onto head 0 while accesses to sectors 27 through 52 are mapped onto head 1. 5. The necessity of supporting a bad track map. Since bad tracks depend on the disk media, the bad track mapping varies from disk to disk. In general, the system and application software should not be concerned with calculating bad track parameters. Instead, these software modules should refer to cylinders logically (0 through 76). The logical interface level procedures must map these cylinders into physical cylinder positions in order to avoid the bad tracks. The key to logical interface software design is the mapping of the "logical disk interface" (as seen by the application software) into the "physical disk interface" (as implemented by the floppy disk drivers). This logical to physical mapping is tightly coupled to system software design and the mapping serves to isolate both applications and system software from the peculiarities of the FOC device. Typical logical interface procedures are described in Table 1. The File System Interface Level The file system typically comprises the highest level of disk interface software used by application programs. The file system is designed to treat the disk as a collection of named data areas (known as files). These files are cataloged in the disk directory. File system interface software permits the creation of new files and the deletion of existing files under software control. When a file is created, its name and disk address are entered into the directory; when a file is deleted, its name is removed from the directory. Application software requests the use of a file by executing'an OPEN function. Once opened, a file is normally reserved for use by the requesting program or task and the file cannot be reopened by other tasks. When a tas~ no longer needs to use an open file, the task closes the file, releasing it for use by other tasks. Most file systems also support a set of file attributes that can be specified for each file. File attributes may be used to protect files (e.g., the WRITE PROTECT attribute ensures that an existing file cannot accidentally be overwritten) and to supply system configuration information (e.g., a FORMAT attribute may specify that a file should automatically be created on a new disk' when the disk is formatted). At the file system interface level, application programs need not be explicitly aware of disk storage allocation techniques, block sizes, or file coding strategies. Only a "file name" must be presented in order to open, read or write, and subsequently close a file. Typical file system functions are listed in Table 2. 6-542 207885-001 APPLICATIONS Table 1: Name Examples of Logical Interface Procedures Description FORMAT DISK Controls physical disk formatting for all tracks on a disk. Formatting adds FDC recognized cylinder, head, and sector addresses as well as address marks and data synchronization fields (gaps) to the floppy disk media. RECALIBRATE Moves the disk read/write head to track 0 (at the outside edge of the disk). SEEK Moves the disk read/write head to a specified logical cylinder. The logical and physical cylinder numbers may be different if bad track mapping is used. READ STATUS Indicates the status of the floppy disk drive and media. One important use of this procedure is to determine whether a floppy disk is dual-sided. READ SECTOR Reads one or more complete sectors starting at a specified disk address (drive, head, cylinder, and sector). WRITE SECTOR Writes one or more complete sectors starting at a specified disk address (drive, head, cylinder, and sector). 6-543 207885-001 APPLICATIONS Table 2: Name OPEN CLOSE Disk File System Functions Description Prepare a file for processing. If the file is to be opened for input and the file name is not found in the directory, an error is generated. If the file is opened for output and the file name is not found in the directory, the file is automatically created • ._ Termi':late processing of an open file. READ Transfer data from an open file to memory. The READ function is often designed to buffer one or more sectors of data from the disk drive and supply this data to the requesting program, as required. WRITE Transfer data from memory to an open file. The WRITE function is often designed to buffer data from the application program until enough data is available to fill a disk sector. CREATE Initialize a file and enter its name and attributes into the file directory. DELETE Remove a file from the directory and release its storage space. RENAME Change the name of a file in the directory. ATTRIBUTE Change the attributes of a file. LOAD Read a file of executable code into memory. INITDISK Initialize a disk by formatting the media and establishing the directory file, the bit map file, and other system files. 6-544 207885-001 APPLICATIONS Scope of this Note This application note directly addresses the logical and physical interface levels. A complete 8272 driver (including interrupt service software) is listed in Appendix A. In addition, examples of recalibrate, seek, format, read, and write logical interface level procedures are included as part of the exerciser program found in Appendix B. Wherever possible, specific hardware configuration dependencies are parametized to provide maximum flexibility without requiring major software changes. 6-545 207885-001 APPLICATIONS 2. Disk I/O Techniques One of the most important software aspects of disk interfacing is the fixed sector size. (Sector sizes are fixed when the disk is formatted.) Individual bytes of disk storage cannot be read/written; instead, complete sectors must be transferred between the floppy disk and system memory. Selection of the appropriate s.ector size involves a tradeoff between memory size; disk storage efficiency, and disk transfer efficiency. Basically, the following factors must be weighed: 1. Memory size. The larger the sector size, the larger the memory area that must be reserved for use during disk I/O transfers. For example, a lK byte disk sector size requires that at least one lK memory block be reserved for disk I/O. 2. Disk Storage efficiency. Both very large and very small sectors can waste disk storage space as follows. In disk file systems, space must be allocated somewhere on the disk to link the sectors of each file together. If most files are composed of many small sectors, a large amount of linkage overhead information is required. At the other extreme, when most files are smaller than a single disk sector, a large amount of space is wasted at the end of each sector. 3. Disk transfer efficiency. A file composed of a few large sectors can be transferred to/from memory more efficiently (faster and with less overhead) than a file composed of many small sectors. Balancing these considerations requires knowledge of the intended system applications. Typically, for general purpose systems, sector sizes from 128 bytes to lK bytes are used. For compatibility between single-density and doubledensity recording with the 8272 floppy disk controller, 256 byte sectors or 512 byte sectors are most useful. FDC Data Transfer Interface Three distinct software interface techniques may be used to interface system memory to the FDe device during sector data transfers: 1. DMA - In a DMA implementation, the software to set up the DMA controller memory address and to initiate the data transfer. The DMA handshakes with the processor/system bus in each data transfer. 2. Interrupt Driven - The FDC generates an interrupt when a data byte is ready to be transferred to memory, or when a data byte is needed from memory. It is the software's responsibility to perform appropriate memory reads/writes in order to transfer data from/to the FDC upon receipt of the interrupt. 3. polling - Software responsibilities in the polling mode are identical to the responsibilities in the interrupt driven mode. The polling mode, however, is used when interrupt service overhead (context switching) is too large to support the disk data 6-546 is only required and transfer count, controller hardware order to perform 207885-001 APPLICATIONS rate. In this mode, the software determines when to transfer data by continually polling a data request status flag in the Foe status register. The OMA mode has the advantage of permitting the processor to continue executing instructions while a disk transfer is in progress. (This capability is especially useful in multiprogramming environments when the operating system is designed to permit other tasks to execute while a program is waiting for I/O.) Modes 2 and 3 are often combined and described as non-OMA operating modes. Non-OMA modes have the advantage of significantly lower system cost, but are often performance limited for double-density systems (where data bytes must be transferred to/from the Foe every 16 microseconds) • Overlapped Operations Some Foe devices support simultaneous disk operations on more than one disk drive. Normally seek and recalibrate operations can be overlapped in this manner. Since seek operations on most floppy drives are extremely slow, this mode of operation can often be used by the system software to reduce overall disk access times. Buffers The buffer concept is an extremely important element in advanced disk I/O strategies. A buffer is nothing more than a memory area containing the same amount of data as a disk sector contains. Generally, when an application program requests data from a disk, the system software allocates a buffer (memory area) and transfers the data from the appropriate disk sector into the buffer. The address of the buffer is then returned to the application software. In the same manner, after the application program has filled a buffer for output, the buffer address is passed to the system software, which writes data from the buffer into a disk sector. In multitasking systems, multiple buffers may be allocated from a buffer pool. In these systems, the disk controller is often requested to read ahead and fill additional data buffers while the application software is processing a previous buffer. Using this technique, system software attempts to fill buffers before they are needed by the application programs, thereby eliminating program waits during I/O transfers. Figure 1 illustrates the use of multiple buffers in a ring configuration. 6-547 207885-001 APPLICATIONS #, BUFFER EMPTV BUFFER #3 EMPTV BUFFER #2 EMPTY BUFFER #1 BEING FILLED DATA FLOW FROM DISK INTO BUFFER DISK DRIVE DISK SUBSYSTEM a) The first disk read request by the application software causes the disk subsystem to begin filling the first empty buffer, The application software must wait until the buffer is filled before it may continue execution. AFN-01949A Figure 1. Using Multiple Memory Buffers for Disk I/O 6-548 207885-001 APPLICATIONS APPLICATION SOFTWARE BUFFER #1 BEING EMPTIED ~ BUFFER #4 EMPTY t BUFFER #3 EMPTY BUFFER #2 BEING FILLED / DATA FLOW FROM DISK INTO BUFFER OISK DRIVE OISK SUBSYSTEM b) After the first buffer is filled, the disk system continues to transfer disk data into the next buffer while the application software begins operating on the first full buffer. AFN-01949A Figure 1. Using Multiple Memory Buffers for Disk I/O (Continued) 6-549 207885-001 APPLICATIONS APPLICATION SOFTWARE t BUFFER #1 BEING EMPTIED SUFFER #2 FULL BUFFER #3 FULL BUFFER #4 FULL NO DISK TRANSFER ACTIVE DISK SUBSYSTEM c) When all empty buffers have been filled, disk activity is stopped until the application software releases one or more buffers for reuse. AFN-01949A Figure 1. Using Multiple Memory Buffers for Disk I/O (Continued) 6-550 207885-001 APPLICATIONS APPLICATION SOFTWARE t ~/ BUFFER #2 BEING EMPTIED '--:c-_ _ _- - ' BUFFER #3 , FULL BUFFER #4 FULL BUFFeR #1 BEING FILLED I DISK DRIVE II t DATA FLOW fROM DISK INTO BUFFER DISK SUBSYSTEM d) When the application software releases a buffer (for reuse), the disk subsystem begins a disk sector read to refill the buffer. This strategy attempts to anticipate application software needs by maintaining a sufficient number of full data buffers in order to minimize data transfer delays. If disk data is already in memory when the application software requests it, no disk transfer delays are incurred. AFN.Q1949A Figure 1. Using Multiple Memory Buffers for Disk I/O (Continued) 6-551 207885-001 APPLICATIONS 3. THB 8272 FLOPPY DISK CONTROLLBR The 8272 is a single~chip LSI Floppy Disk Controller ,(FOe) that implements both single- and double-density floppy disk storage subsystems (with up to four dual-sided disk drives per FOe). The 8272 supports the IBM 3740 single-density recording format (FM) and the IBM System 34 double-density 'recording format (MFM). The 8272 accepts and executes high-level disk commands such as format track, seek, read sector, and write sector •. All data synchronization and error checking is automatically performed by the FDC to ensure reliable data storage and subsequent retrieval. The 8272 interfaces to microprocessor systems with or without Direct Memory Access (DMA) capabilities and also interfaces to a large number of commercially available floppy disk drives. Floppy Disk Commands The 8272 executes fifteen high-level' disk interface commands: Specify Sense Drive Status Sense Interrupt Status Seek Recalibrate Format Track Read Data Read Deleted Data Write Data Write Deleted Data Read Track Read ID Scan Equal Scan High or Equal Scan Low or Equal Each command is initiated by a multi-byte transfer from the driver software to the FDC (the transferred bytes contain command and parameter information). After complete command specification, the FOe automatically executes the command. The command result data (after execution of the command) may require a multi-byte transfer of. status information back to the driver. It is convenient to consider each FDC command as consisting of the following three phases: Command Phase: The driver transfers to the FDC all the information required to perform a particular disk operation. The 8272 automatically enters the command phase after RESET and following the completion of the result phase (if any) of a previous command. Execution Phase: The FOe performs the operation as instructed. The execution phase is entered immediately after the last command parameter is written to the FDC in the preceding command phase. The execution phase normally ends when the last data byte is transferred to/from the disk or when an error occurs. Result Phase: After completion of the disk operation, status and other housekeeping information are made available to the driver software. After this information is read, the FDC reenters the command phase and is ready to accept another command. 6-552 207885-001 APPLICATIONS Interface Registers To support information transfer between the FDC and the system software, the 8272 contains two 8-bit registers: the Main status Register and the Data Register. The Main status Register (read only) contains FDC status information and may be accessed at any time. The Main Status Register (Table 3) provides the system processor with the status of each disk drive, the status of the FDC, and the status of the processor interface. The Data Register (read/write) stores data, commands, parameters, and disk drive status information. The Data Register is used to program the Foe during the command phase and to obtain result information after completion of FDC operations. In addition to the Main Status Register, the FDC contains four additional status registers (STD, ST1, ST2, and ST3). These registers are only available during the result phase of a command. Command/Result Phases Table 4 lists the 8272 command set. For each of the fifteen commands, command and result phase data transfers are listed. A list of abbreviations used in the table is given in Table 5, and the contents of the result status registers (STD-ST3) are illustrated in Table 6. The bytes of data which are sent to the 8272 by the drivers during the command phase, and are read out of the 8272 in the result phase, must occur in the order shown in Table 4: That is, the command code must be sent first and the other bytes sent in the prescribed sequence. All bytes of the command and result phases must be read/written as described. After the last byte of data in the command phase is sent to the 8272 the execution phase automatically starts. In a similar fashion, when the last byte of data is read from the 8272 in the result phase, the result phase is automatically ended and the 8272 reenters the command phase. It is important to note that during the result phase all bytes shown in Table 4 must be read. The Read Data command, for example, has seven bytes of data in the result phase. All seven bytes must be read in order to successfully complete the Read Data command. The 8272 will not accept a new command until all seven bytes have been read. The number of command and result bytes varies from command-to-command. In order to read data from, or write data to, the Data Register during the command and result phases, the software driver must examine the Main Status Register to determine if the Data Register is available. The 010 (bit 6) and RQM (bit 7) flags in the Main Status Register must be low and high, respectively, before each byte of the command word may be written into the 8272. Many of the commands require multiple bytes, and as a result, the Main Status Register must be read prior to each byte transfer to the 8272. TO read status bytes during'the result phase, 010 and RQM in the Main Status Register must both be high. Note, checking the Main Status Register in this manner before each byte transfer to/from the 8272 is required only in the command and result phases, and is NOT required during the execution phase. 6-553 207885-001 APPLICATIONS Table 3: Main status Register Bit Definitions BIT DESCRIPTION SYMBOL NUMBER 0 DOB Disk Drive 0 Busy. Disk Drive 0 is seeking. 1 DIB Disk Drive 1 BUSY· Disk Drive 1 is seeking. 2 D2B Disk Drive 2 BUSY· Disk Drive 2 is seeking. 3 D3 B Disk Drive 3 BUSY· Disk Drive 3 is seeking. 4 CB FDC BUSY. 5 NDM Non-DMA Mode. The FDC is in the non-DMA mode when this flag is set (1). This flag is set only during the execution. phase of commands in the non-DMA mode. Transition of this flag to a zero (0) indicates that the execution phase has ended. 6 DIO Data Input/Output. Indicates the direction of a data transfer between the FDC and the Data Register. When DIO is set (1), data is read from the Data Register by the processor; when DIO is reset (0), data is written from the processor to the Data Register. 7 RQM Request for Master. When set (1), this flag indicates that the Data Register is ready to send data to, or receive data from, the processor. I A read Qr write command is in progress. 6-554 207885-001 APPLICATIONS Table 4: 8272 Command Set I OATA BUS PHASE AJW °7 06 °5 03 °4 °2 0, 00 I OATA BUS REMARKS PHASE AJW °7 °6 °5 READ DATA Command W W W W W W W W W MT MFM SK 0 0 0 0 0 0 0 1 1 HOS OS1 0 Command Command Codes eso Sector 10 information prior to Command execution G H R N EOT GPL OTL Execution Result Oala transfer between the FOD and the maln·system R R R R R R R W W W 0 0 0 0 1 0 0 W W W W Result aller command execution 1 0 HOS OS1 0 Command Codes eso Sector 10 information prior to Command execution W W W W W W W W W 0 MFM SK 0 0 0 R R R R R R R Result Status Information after Command execution STO ST 1 ST 2 C H R N W W W W W W W W W MT MFM 0 0 0 0 0 0 0 0 Sector ID information after Command execution 1 0 0 0 1 Command Command Codes HOS DS1 OSO Sector 10 information prior to Command execution Sector 10 information prior to Command execution Dala transfer between the FOD and the main-system. FOC reads the complete track contents from the physical index mark to EOT R R R R R R R ~ ST 0 _ _ _ _ _ ST1 ST 2 C H _ _ ~~_ R N W W 0 MFM 0 0 1 0 0 0 0 0 0 1 0 HOS OS1 OSO W W W W W W W W W Result Status information after Command execution ST 0 ST 1 ST 2 C H R N MT MFM 0 0 0 0 1 0 0 0 R R R R R ST 0 ST 1 ST 2 C H R R N C H R N EOT GPL DTL R R R R R STO ST 1 ST 2 G H R N Command Codes Sector 10 information during Execution Phase W W W W W W 0 MFM 0 0 1 0 0 0 0 0 1 0 1 0 1 Command Codes HOS OS1 DSO Bytes/Sector SectorsfTrack Gap 3 Filter Byte N SC GPL D FOC formats an entire track R R R R Status Information after Command execution ST 0 ST 1 ST 2 C H In this case, the 10 information has no meaning R N SCAN EOUAL Command Command Codes HOS OS1 DSO Sector 10 information prior to Command execution W W W W W W W W W MT MFM SK 0 0 0 0 1 0 0 C H R N EOT GPL STP Execution Data transler between the FDO and the main-system R R Sector 10 information after Command execution Status information after Command execution R R R R Secto-r ID information after Command execution 0 Status information after Command execution The first correct 10 information on the track is_stored In Data Register Execution Data transfer between the main· system and the FOD R R R R R R R Command Codes HDS DS1 DSO FORMAT A TRACK 0 G H R N EOT GPL DTL Execution Result 1 REMARKS READ ID Command WRITE DELETED DATA Command 0 0 Data transfer between the FDO and the main-system Execution Result 0 G H R N EOT GPL DTL WRITE DATA Command °0 Execution Execution Result 0, Sector 10 information C H R N EG 1 GPL DTL W W °2 Status information after Command execution STO ST 1 ST 2 C H R N MT MFM SK °3 Execution REAO DELETED DATA Command °4 READ A TRACK Result Sector 10 information after Command execution 0 1 Command Codes Sector ID Information prior to Command execution Data compared between the FDo and the main-system R R R Status information after Command execution 0 HDS DS1 OSO R R R R STO ST 1 ST 2 C H R N Status information after Command execution Sector 10 information after Command execution Note: 1. AO= 1 for all operations. 6-555 207885-001 APPLICATIONS I PHASE RIW I DATA BUS 07 De Os 0, 03 O2 0, DO REMA,RKS PHASE RIW DATA BUS 07 De Os Command W W MT MFM SK 0 0 0 W , 1 0 0 0 0 1 HoS OS, oSO W W W Command W W W Status information after Command execution STO ST' ST 2 C H R N W W W W W W W MT MFM SK 0 0 0 1 1 0 0 Command W Result R R Command W 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 , , 0 0 1 0 1 STO _ _ _ _ _ 0 '1 ST 0 C W DO 1 OS, oSO 0 0 , 1 0 0 _SPT _ _ + ______ HUT HlT _NO 0 REMARKS Command Codes Command W W Result R 0 0 0 0 0 0 0 0 0 0 _ _ _ _ _ ST3 1 0 0 HOS OS1 OSO SEEK Command W W W 0 0 0 0 0 0 0 0 1 0 , , 1 HOS DS1 DSa Timer Settings Command Codes Command Codes C Execution Head is pOSitioned over proper Cylinder on Diskette INVALID Command W _ _ _ _ Invalid Codes _ _ _ _ Result R ST 0 Status information after Command execution Sector ID information after Command execution Command Codes Status information about the FDD Command Codes Sector 10 information prior Command execution Command Codes Status Information al the end of each seek operation about the FoC SENSE ORIVE STATUS HOS OSI DSO C H R N EDT GPl STP ST 1 ST2 C H R N 0 SPECIFY Data compared between the FDD and the main-system R A R R R A R 0, Head retracted to Track 0 W Sector 10 information alter Command execution Execution Result 02 Execution SCAN HIGH OR EQUAL Command W Data compared between the FDD and the main-system R R R R R R R 03 SENSE INTERRUPT STATUS Execution Result Command Codes Sector 10 Information prior Command execution C H R N EDT GPl STP W W W 0, RECALIBRATE SCAN lOW OR EQUAL 6-556 Invalid Command Codes (NoOp- FDC goes into Standby State) STO=80 (16) 207885-001 APPLICATIONS Table 5: SYMBOL Command/Result Parameter Abbreviations DESCRIPTION C Cylinder Address. the disk. D Data Pattern. formatting. 'DSO,DSl Disk Drive Select. The currently selected cylinder address (0 to 76) on The pattern to be written in each sector data field during DSl DSO 0 0 1 1 0 1 0 1 Drive Drive Drive Drive 0 1 2 3 DTL Special Sector Size. During the execution of disk read/write commands, this parameter is used to temporarily alter the effective disk sector size. By setting N to zero, DTL may be used to specify a sector size from 1 to 256 bytes in length. If the actual sector (on the disk) is larger than DTL specifies, the remainder of the actual sector is not passed to the system during read commands: during write commands, the remainder of the actual sector is written with all-zeroes bytes. DTL should be set to FF hexadecimal when N is not zero. EDT End of Track. GPL Gap Length. H Head Address. Selected head: 0 or 1 (disk side 0 or 1, respectively) as encoded in the sector ID field. HLT Head Load Time. Defines the time interval that the FDC waits after loading the head before initiating a read or write operation. programmable from 2 to 254 milliseconds (in increments of 2 ms). HUT Head Unload Time. Defines the time interval from the end of the execution phase (of a read or write command) until the head is unloaded. programmable from 16 to 240 milliseconds (in increments of 16 ms). MFM MFM/FM Mode Selector. Selects MFM double-density recording mode when high, FM single-density mode when low. MT Multi-Track Selector. When set, this flag selects the multi-track operating mode. In this mode (used only with dual-sided disks), the FDC treats a complete cylinder (under both read/write head 0 and read/write head 1) as a single track. The FDC operates as if this expanded track started at the first sector under head 0 and ended at the last sector under head 1. With this flag set (high), a mUlti-sector read operation will automatically continue to the first sector under head 1 when the FDC finishes operating on the last sector under head O. N Sector Size Code. The final sector number of the current track. The gap 3 size. (Gap 3 is the space between sectors.) The number of data bytes within a sector. 6-557 207885-001 APPLICATI.ONS ND Non-DMA Mode Flag. When set ·(1), this flag indicates that the FDC is to operate in the non-DMA mode. In this mode, the processor participates in each data transfer (by means of an interrupt or by polling the ROM flag in the Main status Register). When reset (0), the FDC interfaces to a DMA controller. R sector Address. Specifies the sector number to be read or written. In multi-sector transfers, this parameter specifies the sector number of the first sector to be read or written. SC Number of Sectors per Track. 'Specifies the number of sectors per track to be initialized by the Format Track command. SK Skip Flag. When this flag is set, sectors containing deleted data address marks will automatically be skipped during the execution of multi-sector Read Data or Scan commands. In the same manner, a sector containing a data address mark will automatically be skipped during the execution of a multi-sector Read Deleted Data command. SRT step Rate Interval. Defines the time interval between step pulses issued by the FDC (track-to-track acc.ess time). programmable from 1 to 16 milliseconds (in increments of 1 ms). STO STI ST2 ST3 status Register 0-3. Registers within the FDC that store status information after a command has been exe.cuted. This status information is available to the processor during the Result phase after command execution. These registers may only be read after a command has been executed (in the exact order shown in Table 4 for each command). These registers should not be confused with the Main Status Register. STP Scan Sector Increment. 'During Scan operations, this parameter is added to the current sector number in order to determine the next sector to be scanned. 6-558 207885-001 APPLICATIONS Table 6: status Register Definitions Status Register 0 BIT NUMBER SYMBOL 7,6 IC DESCRIPTION Interrupt Code. 00 - Normal termination of command. The specified command was properly executed and completed without error. 01 - Abnormal termination of command. Command execution was started but could not be successfully completed. 10 - Invalid command. The requested command could not be executed. 11 - Abnormal termination. During command execution, the disk drive ready signal changed state. 5 SE Seek End. This flag is set (1) when the FDC has completed the Seek co~and and the read/write head is positioned over the correct cylinder. 4 EC Equipment Check Error. This flag is set (1) if a fault signal is received from the disk drive or if the track 0 signal is not received from the disk drive after 77 step pulses (Recalibrate command). 3 NR Not Ready Error. This flag is set if a read or write command is issued and either the drive is not ready or the command specifies side 1 (head 1) of a single-sided disk. 2 H Head Address. 1,0 DSl,DSO Drive Select. The number of the drive selected at the time of the interrupt. The head address at the time of the interrupt. status Register 1 BIT NUMBER SYMBOL 7 EN DESCRIPTION End of Track Error. This flag is set if the FDC attempts to access a sector beyond the final sector of the track. Undefined 6 5 DE Data Error. Set when the FDC detects a CRC error ,in either the the ID field or the data field of a sector. 4 OR Overrun Error. Set (during data transfers) if the FDC does not receive DMA or processor service within the specified time interval. 6-559 207885-001 APPLICATIONS Undefined 3 2 ND Sector Not Found Error. ing conditions. This flag is set by any of the,fo11ow- a) The FDC cannot locate the sector specified in the Read Data, Read Deleted Data, or Scan command. b) The FDC cannot locate the starting sector specified in the Read Track command. c) The FDC cannot read the ID field without error during a Read ID command. 1 NW write Protect Error. This flag is set if the FDC detects a write protect signal from the disk drive during the execution of a Write Data, Write Deleted Data, or Format Track command. o MA Missing Address Mark Error. following conditions: This flag is set by either of the a) The FDC cannot detect the ID address mark on the specified track (after two rotations of the disk). b) The FDC cannot detect the data address mark or deleted data address mark on the specified track. (See also the MD bit of Status Register 2.) Status Register 2 BIT NUMBER Undefined 7 6 DESCRIPTION SYMBOL CM Control Mark. This flag is set when the FDC encounters one of the following conditions: a) A deleted data address mark during the execution of a Read Data or Scan command. b) A data address mark during the execution of a Read Deleted Data command. 5 DD Data Error. Set (1) when the FDC detects a CRC error in a sector data field. This flag is not set when a CRC error is detected in the ID field. 4 WC Cylinder Address Error. Set when the cylinder address from the disk sector ID field is different from the current cylinder address maintained within the FDC. 3 SH Scan Hit. Set during the execution of the Scan command if the scan condition is satisfied. 2 SN Scan Not Satisfied. Set during execution of the Scan command if the FDC cannot locate a sector on the specified cylinder that satisfies the scan condition. 6-560 207885-001 APPLICATIONS 1 BC Bad Track Error. Set when the cylinder address from the disk sector ID field is FF hexadecimal and this cylinder address is different from the current cylinder address maintained within the FDC. This all "ones" cylinder number indicates a bad track (one containing hard errors) according to the IBM soft-sectored format specifications. o MD Missing Data Address Mark Error. Set if the FDC cannot detect a data address mark or deleted data address mark on the specified track. status Register 3 BIT NUMBER SYMBOL 7 FT Fault. This flag indicates the status of the fault signal from the selected disk drive. 6 WP write Protected. This flag indicates the status of the write protect signal from the selected disk drive. 5 RDY Ready. This flag indicates the status of the ready signal from the selected disk drive. 4 TO Track O. This flag indicates the status of the track 0 signal from the selected disk drive. 3 TS TWo-Sided. This flag indicates the status of the two-sided signal from the selected disk drive. 2 H Head Address. This flag indicates the status of the side select signal for the currently selected disk drive. 1,0 DS1,DSO Drive Select. number. DESCRIPTION Indicates the currently selected disk drive 6-561 207885-001 APPLICATIONS Execution phase All data transfers to (or from) the floppy drive occur during the execution phase. The 8272 has two primary modes of operation for data transfers (selected by the specify command): 1) DMA mode 2) non-DMA mode In the DMA mode, execution phase data transfers are handled by the DMA controller hardware (invisible to the driver software). The driver software, however, must set all appropriate DMA controller registers prior to the beginning of the disk operation. An interrupt is generated by the 8272 after the last data transfer, indicating the completion of the execution phase, and the beginning of the result phase. In the non-DMA mode, transfer requests are indicated by generation of an interrupt and by activation of the RQM flag (bit 7 in the Main status Register). The interrupt signal can be used for interrupt-driven systems and RQM can be used for polled systems. The driver software must respond to the transfer request by reading data from, or writing data to, the FDC. After completing the last transfer, the 8272 generates an interrupt to indicate the beginning of the result phase. In the non-DMA mode, the processor must activate the "terminal count" (TC) signal to the FDC (normally by means of an I/O port) after the transfer request for the last data byte has been received (by the driver) and before the appropriate data byte has been read from (or written to) the FDC. In either mode of operation (DMA or non-DMA), the execution phase ends when a "terminal count" signal is sensed by the FDC, when the last sector on a track (the EOT parameter - Table 4) has been read or written, or when an error occurs. Multi-sector and Multi-track Transfers During disk read/write transfers (Read Data, Write Data, Read Deleted Data, and Write Deleted Data), the FDC will continue to transfer data from sequential sectors until the TC input is sensed. In the DMA mode, the TC input is normally set by the DMA controller. In the non-DMA mode, the processor directly controls the FDC TC input as previously described. Once the TC input is'received, the FDC stops requesting data transfers (from the system software or DMA controller) • The FDC, however, continues to read data from, or write data to, the floppy disk until the end of the current disk sector. During a disk'read operation, the data read from the disk (after reception of the TC input) is discarded, but the data CRC is checked for errors: during a disk write operation, the remainder of the sector is filled with all-zero bytes. If the TC signal is not received before the last byte of the current sector has been transferred to/from the system, the FDC increments the sector number by one and initiates a read or write command for this new disk sector. 6-562 207885-001 APPLICATIONS The FDC is also designed to operate in a multi-track mode for dual-sided disks. In the multi-track mode (specified by means of the MT flag in the command byte - Table 4) the FDC will automatically increment the head address (from 0 to 1) when the last sector (on the track under head 0) has been read or written. Reading or writing is then continued on the first sector (sector 1) of head 1. Drive status polling After the power-on reset, the 8272 automatically enters a drive status polling mode. If a change in drive status is detected (all drives are assumed to be "not ready" at power-on), an interrupt is generated. The 8272 continues this status polling between command executions (and between step pulses in the Seek command). In this manner, the 8272 automatically notifies the system software whenever a floppy disk is inserted, removed, or changed by the operator. Command Details During the command phase, the Main Status Register must be polled by the driver software before each byte is written into the Data Register. The 010 (bit 6) and RQM (bit 7) flags in the Main Status Register must be low and high, respectively, before each byte of the command may be written into the 8272. The beginning of the execution phase for any of these commands will cause 010 to beset high and RQM to be set low. Operation of the FDC commands is described in detail in Application Note AP-116, "An Intelligent Data Base System Using the 8272." Invalid Commands If an invalid (undefined) command is sent to the FDC, the FDC will terminate the command. No interrupt is generated by the 8272 during this condition. Bit 6 and bit 7 (010 and RQM) in the Main Status Register are both set indicating to the processor that the 8272 is in the result phase and the contents of Status Register 0 must be read. When the processor reads Status Register o it will find an 80H code indicating that an invalid command was received. The driver software in Appendix B checks each requested command and will not issue an invalid command to the 8272. A Sense Interrupt Status command must be sent after a Seek or Recalibrate interruptl otherwise the FDC will consider the next command to be an invalid command. Also, when the last "hidden" interrupt has been serviced, further Sense Interrupt Status commands will result in invalid command codes. 6-563 207885-001 APPLICATIONS 4. 8272 physical Interface Software PL/M software driver listings for the 8272 FOC are contained in Appendix A. These drivers have been designed to operate in a OMA environment (as described in Application Note AP-1l6, "An Intelligent Oata Base System Using the 8272"). In the following paragraphs, each driver procedure is described. (A description of the driver data base variables is given in Table 7.) In addition, the modifications necessary to reconfigure the drivers for operation in a polled environment are discussed. INITIALIZE$DRIVERS This initialization procedure must be called before any FOC operations are attempted. This module initializes the ORIVE$READY, ORlVE$STATUS$CHANGE, OPERATION$IN$PROGRESS, and OPERATION$COMPLETE arrays as well as the GLOBAL$ORIVE$NO variable. EXECUTE$DOCB This procedure contains the main 8272 driver control software and handles the execution of a complete FDC command. EXECUTE$OOCB is called with two-parameters: a) a pointer to a disk operation control block and b) a pointer to a result status byte. The format of the disk operation control block is illustrated in Figure 2 and the result status codes are described in Table 8. Before starting the command phase for the specified disk operation, the command is checked for validity and to determine whether the FOC is busy. (For an overlapped operation, if the FOC BUSY flag is set - in the Main Status Register the command cannot be started; non-overlapped operations cannot be started if the FOC BUSY flag is set, if any drive is in the process of seeking/recalibrating, or if an operation is currently in progress on the specified drive.) After these checks are made, interrupts are disabled in order to set the OPERATION$IN$PROGRESS flag, reset the OPERATION$COMPLETE flag, load a pointer to the current operation control block into the OPERATION$OOCB$PTR array and set GLOBAL$ORIVE$NO (if a non-overlapped operation is to be started). At this point, parameters from the operation control block are output to the OMA controller and the FOC command phase is initiated. After completion of the command phase, a test is made to determine the type of result phase required for the current operation. If no result phase is needed, control is immediately returned to the calling program. If an immediate result phase is required, the result bytes are input from the FOC. Otherwise, the CPU waits until the OPERATION$COMPLETE flag is set (by the interrupt service procedure) • Finally, if an error is detected in the result status code (from the FOC), an FOC operation error is reported to the calling program. 6-564 207885-001 APPLICATIONS Table 7: Driver Data Base NAME DESCRIPTION DRIVE$READY A public array containing the current "ready" status of each drive. DRIVE$STATUS$CHANGE A public array containing a flag for each drive. The appropriate flag is set whenever the ready status of a drive changes. OPERATION$DOCB$PTR An internal array of pointers to the operation control block currently in progress for each drive. OPERATION$IN$PROGRESS An internal array used by the driver procedures to determine if a disk operation is in progress on a given drive. OPERATION$COMPLETE An internal array used by the driver procedures to determine when the execution phase of a disk operation is complete. GLOBAL$DRlVE$NO A data byte that records the current drive number for non-overlapped disk operations. VALID$COMMAND A constant flag array that indicates whether a specified FOC command code is valid. COMMAND $LENGTH A constant byte array specifying the number of command/parameter bytes to be transferred to the FDC during the command phase. DRlVE$NO$PRESENT A constant flag array that indicates whether a drive number is encoded into an FDC command. OVERLAP$OPERATION A constant flag array that indicates whether an FOC command can be overlapped with other commands. NO$RESULT A constant flag array that is used to determine when an FDC operation does not have a result phase. IMMED$RESULT A constant flag array that indicates that an FDC operation has a result phase beginning immediately after the command phase is complete. POSSIBLE$ERROR A constant flag array that indicates if an FDC operation should be checked for an error status indication during the result phase. 6-565 207885-001 APPLICATIONS Address Offset Disk Operation Control Block (DOCB) o DMA$OP 1 DMA$ADDR 3 DMA$ADDR$EXT 4 DMA$COUNT 6 DISK$COMMAND(O) 7 DISK$COMMAND(l) 8 DISK$COMMAND(2) 9 DISK$COMMAND(3) 10 DISK$COMMAND(4) 11 DISK$COMMAND(~) 12 DISK$COMMAND(6) 13 DISK$COMMAND(7) 14 DISK$COMMAND(8) 15 DISK$RESULT(O) 16 DISK$RESULT(l) 17 DISK$RESULT(2) 18 DISK$RESULT(3) 19 DISK$RESULT(4) 20 DISK$RESULT(5) 21 DISK$RESULT(6) 22 MISC I I AFN-Ql949A Figure 2. Disk Operation Control Block (DOCB) Format 6-566 20788S'()01, APPLICATIONS Table 8: EXECUTE$DOCB Return status Codes Code Description o No errors. 1 FDC busy. The requested operation cannot be started. This error occurs if an attempt is made to start an operation before the previous operation is completed. 2 FDC error. An error was detected by the FDC during the execution phase of a disk operation. Additional error information is contained in the result data portion of the disk operation control block (DOCB.DISK$RESULT) as described in the 8272 data sheet. This error occurs whenever the 8272 reports an execution phase error (e.g., missing address mark). 3 8272 command interface error. An 8272 interfacing error was detected during the command phase. This error occurs when the command phase of a disk operation cannot be successfully completed (e.g., incorrect setting of the DIO flag in the Main status Register). 4 8272 result interface error. An 8272 interfacing error was detected during the result phase. This error occurs when the result phase of a disk operation cannot be successfully completed (e.g., incorrect setting of the DIO flag in the Main Status Register) • 5 Invalid FDC Command. The specified operation was completed without error. 6-567 207885-001 APPLICATIONS FDCINT This procedure performs all interrupt processing for the 8272 interface drivers. Basically, two types of interrupts are generated by the 8272: (a) an interrupt that signals the end of a command execution phase and the beginning of the result phase and (b) an interrupt that signals the completion of· an overlapped operation or the occurrence of an unexpected event (e.g., change in the drive "ready" status). An interrupt of type (a) is indicated when the FDC BUSY flag is set (in the Main Status Register). When a type (a) interrupt is sensed, the result bytes are read from the 8272.and placed in the result portion of the disk operation control block, the appropriate OPERATION$COMPLETE flag is set, and, the OPERATION$IN$PROGRESS flag is reset. When an interrupt of type (b) .is indicated (FDC not busy), a sense interrupt status command is issued (to the FDC). The upper two bits of the result status register (status Register Zero - STD) are used to determine the cause of the interrupt. The following four cases are possible: 1) Operation Complete. An overlapped operation is complete. The drive number is found in the lower two bits of STD. The STD data is transferred to the active operation control block, the OPERATION$COMPLETE flag is set, and the OPERATION$IN$PROGRESS flag is reset. 2) Abnormal Termination. A disk operation has abnormally terminated. The drive number is found in the lower two bits of STD. The STD data is transferred to the active control block, the OPERATION$COMPLETE flag is set, and the OPERATION$IN$PROGRESS flag is reset. 3) Invalid Command. The execution of an invalid command (i.e., a sense interrupt command with no interrupt pending) has been attempted. This interrupt signals the successful completion of all interrupt processing. 4) Drive Status Change. A change has occurred in the "ready" status of a disk drive. The drive number is found in the lower two bits of STD. The DRIVE$READY flag for this disk drive is set to the new drive "ready" status and the DRIVE$STATUS$CHANGE flag for the drive is also set. In addition, if a command is currently in progress, the STD data is transferred to the active control block, the OPERATION$COMPLETE flag is set, and the OPERATION$IN$PROGRESS flag is reset. After processing a type (b) interrupt, additional sense interrupt status commands must be issued and processed until an "invalid command" result is returned from the FOC. This action guarantees that all "hidden" interrupts are serviced. In addition to the major driver procedures described above, a number of support procedures are required. These support routines are briefly described in the following paragraphs. 6-568 207885-001 APPLICATIONS OUTPUT$CONTROLS$TO$DMA This procedure outputs the DMA mode, the DMA address, and the DMA word count to the 8237 DMA controller. In addition, the upper four bits of the 20-bit DMA address are output to the address extension latch. Finally, the disk DMA channel is started. OUTPUT$COMMAND$TO$FDC This software module outputs a complete disk command to the 8272 FDC. The number of required command/parameter bytes is found in the COMMAND$LENGTH table. The appropriate bytes are output one at a time (by calls to OUTPUT$BYTE$TO$FDC) from the command portion of the disk operation control block. INPUT$RESULT$FROM$FDC This procedure is used to read result phase status information from the disk controller. At most, seven bytes are read. In order to read each byte, a call is made to INPUT$BYTE$FROM$FDC. When the last byte has been read, a check is made to insure that the FDC is no longer busy. OUTPUT$BYTE$TO$FDC This software is used to output a single command/parameter byte to the FOC. This procedure waits until the FOC is ready for a command byte and then outputs the byte to the FOC data port. INPUT$BYTE$FROM$FDC This procedure inputs a single result byte from the FDC. The software waits until the FDC is ready to transfer a result byte and then reads the byte from the FDC data port. FDC$READY$FOR$COMMAND This procedure assures that the FOC is ready to accept a command/parameter byte by performing the following three steps. First, a small time interval (more than 20 microseconds) is inserted to assure that the RQM flag has time to become valid (after the last byte transfer). Second, the master request flag (RQM) is polled until it is activated by the FOC. Finally, the DIO flag is checked to ensure that it is properly set for FDC input (from the processor) • FDC$READY$FOR$RESULT The operation of this procedure is similar to the FDC$READY$FOR$COMMAND with the following exception. If the FOC BUSY flag (in the Main Status Register) is not set, the result phase is complete and no more data is available from the FOC. Otherwise, the procedure waits for the RQM flag and checks the bIO flag for FDC output (to the processor) • 6-569 207885-001 APPLICATIONS OPBRA~IOR$CLBAR$UP This procedure is called after the execution of a disk operation that has no result phase. OPERATION$CLEAN$UP resets the OPERATION$IN$PROGRESS flag and the GLOBAL$DRIVE$NO variable if appropriate. This procedure is also called to clean up after some disk operation errors. Modifications for polling Operation To operate in the polling mode, the following modifications should be made to the previous routines: 1. The OUTPUT$CONTROLS$TO$DMA routine should be deleted. 2. In EXECUTE$DOCB, immediately prior to WAIT$FOR$OP$COMPLETE, a polling loop should be inserted into the code. The loop should test the RQM flag (in the Main status Register). When RQM is set, a data byte should be written to, or read from, the 8272. The buffer address may be computed from the base address contained in DOCB.DMA$ADDR and DOCB.DMA$ADDR$EXT. After the correct number of bytes have been transferred, an operation complete interrupt will be issued by the POC. During data transfer in the non-DMA mode, the NON-DMA MODE flag (bit 5 of the Main status Register) will be set. This flag will remain set for the complete execution phase. When the transfer is finished, the NON-DMA MODE flag is reset and the result phase interrupt is issued by the POC. 6-570 207885-001 APPLICATIONS 5. 8272 Logical Interface Software Appendix B of this Application Note contains a PL/M listing of an exerciser program for the 8272 drivers. This program illustrates the design of logical interface level procedures to specify disk parameters, recalibrate a drive, seek to a cylinder, format a disk, read data, and write data. The exerciser program is written to operate a standard single-sided 8" floppy disk drive in either the single- or double-density recording mode. Only the eight parameters listed in Table 9 must be specified. All other parameters are derived from these 8 basic variables. Each of these logical interface procedures is described in the following paragraphs (refer to the listing in Appendix B) • SPECIFY This procedure sets the FDC signal timing so that the FOC will interface correctly to the attached disk drive. The SPECIFY procedure requires four parameters, the step rate (SRT), head load time (HLT), head unload time (HUT), and the non-DMA mode flag (ND). This procedure builds a disk operation control block (SPECIFY$DOCB) and passes the control block to the FOC driver module (EXECUTE$DOCB) for execution. (Note carefully the computation required to transform the step rate (SRT) into the correct 8272 parameter byte.) RECALIBRATE This procedure causes the floppy disk read/write head to retract to track O. The RECALIBRATE procedure requires only one parameter - the drive number on which the recalibrate operation is to be performed. This procedure builds a disk operation control block (RECALIBRATE$OOCB) and passes the control block to the FDC driver for execution. SEEK This procedure causes the disk read/write head (on the selected drive) to move to the desired cylinder position. The SEEK procedure is called with three parameters: drive number (DRV), head/side number (HD), and cylinder number (CYL). This software module builds a disk operation control block (SEEK$OOCB) that is executed by the FDC driver. FORMAT The FORMAT procedure is designed to initialize a complete floppy disk so that sectors can subsequently be read and written by system and application programs. Three parameters must be supplied to this procedure: the drive number (DRV), the recording density (DENS), and the interleave factor (INTLVE). The FORMAT procedure generates a data block (FMTBLK) and a disk operation control block (FORMAT$DOCB) for each track on the floppy disk (normally 77) • 6-571 207885-001 APPLICATIONS Table 9: Name Basic Disk Parameters Description . DENSITY The recording mode (FM or MFM). FILLER$BYTE The data byte to be written in all sectors during formatting. . TRACKS$PER$DISK The number of cylinders on the floppy disk. BYTES $PER$ SECTOR The number of bytes in each disk sector. The exerciser accepts 128, 256, and 512 in FM mode, and 256, 512, and 1024 in MFM mode. INTERLEAVE The sector interleave factor for each disk track. STEP $RATE The disk drive step rate (1-16 milliseconds). HEAD $LOAD$TIME The disk drive head load time (2-254 milliseconds). HEAD$UNLOAD$TIME The head unload time (16-240 milliseconds). 6-572 207885-001 APPLICATIONS The format data block specifies the four sector ID field parameters (cylinder, head, sector, and bytes per sector) for each sector on the track. The sector numbers need not be sequential: the interleave factor (INTLVE parameter) is used to compute the logical to physical sector mapping. After both the format data block and the operation control block are generated for a given cylinder, control is passed to the 8272 drivers for execution. After the format operation is complete, a SEEK to the next cylinder is performed, a new format table is generated, and another track formatting operation is executed by the drivers. This track formatting continues until all tracks on the diskette are formatted. In some systems, bad tracks must also be specified when a disk is formatted. these systems, the existing FORMAT procedure should be modified to format bad tracks with a cylinder number of OFFH. For WRITE The WRITE procedure transfers a complete sector of data to the disk drive. Five parameters must be supplied to this software module: the drive number (DRV), the cylinder number (CYL), the head/side number (HO), the sector number (SEC) and the recording density (DENS). This procedure generates a disk operation control block (WRITE$DOCB) from these parameters and passes the control block to the 8272 driver for execution. When control returns to the calling program, the data has been transferred to disk. READ This procedure is identical to the WRITE procedure except the direction of data transfer is reversed. The READ procedure transfers a sector of data from the floppy disk to system memory. Coping With Errors In actual practice all logical disk interface routines would contain error processing mechanisms. (Errors have been ignored for the sake of simplicity in the exerciser programs listed in Appendix B.) A typical error recovery technique consists of a two-stage procedure. First, when an error is detected, a recalibrate operation is performed followed by a retry of the failed operation. This procedure forces the drive to seek directly to the requested cylinder (lowering the probability of a seek error) and attempts to perform the requested operation an additional time. Soft (temporary) errors caused by mechanical or electrical interference do not normally recur during the retry operation: hard errors (caused by media or drive failures), on the other hand, will continue to occur during retry operations. If, after a number of retries (approximately 10), the operation continues to fail, an error message is displayed to the system operator. This error message lists the drive number, type of operation, and failure status (from the FDC). It is the operator's responsibility to take additional action as required. 6-573 207885-001 APPLICATIONS 6. File Systems The file system 'provides the disk I/O interface level most familiar to users of interactive microcomputer and minicomputer systems. In a file system, all data is stored in named disk areas called files. The user and applications programs need not be concerned with the exact location of a file on the disk - the disk file system automatically determines the file location from the file name. Files may be created, read, written, modified, and finally deleted (destroyed) when they are no longer needed. Each floppy disk typically contains a directory that lists all the files existing on the disk. A directory entry for a f'ile contains information such as file name, file size, and the disk address (track and sector) of the beginning of the file. File Allocation File storage is actually allocated on the disk (by the file system) in fixed size areas called blocks. Normally a block is the same size as a disk sector. Files are created by finding and reserving enough unused blocks to contain the data in the file. Two file allocation methods are currently in widespread use. The first method allocates blocks (for a file) from a sequential pool of unused blocks. Thus, a file is always contained in a set of sequential blocks on the disk. Unfortunately, as files are created, updated, and deleted, these freeblock pools become fragmented (separated from one another). When this fragmentation occurs, it often becomes impossible for the file system to create a file even though there is a sufficient number of free blocks on the disk. At this point, special programs must be run to "squeeze" or compact the disk, in order to re-create a single contiguous free-block pool. The second file allocation method uses a more flexible technique in which individual data blocks may be located anywhere on the disk (with no restrictions). With this technique, a file directory entry contains the disk address of a file pointer block rather than the disk address of the first data block of the file. This file pointer block contains pointers (disk addresses) for each data block in the file. For example, the first pointer in the file pointer block contains the track and sector address of the first data block in the file, the second pointer contains the disk address of the second data block, etc. In practice, pointer blocks are usually the same size as data blocks. Therefore, some files will requir~ multiple pointer blocks. TO accommodate this requirement without loss of flexibility, pointer blocks are linked together, that is, each pointer block contains the disk address of the following pointer block. The last pointer block of the file is signalled by an illegal disk address (e.g., track 0, sector 0 or track OFFH, sector OFFH). 6-574 207885-001 APPLICATIONS The Intel File System The Intel file system (described in detail in the RMX-80 Users Guide) uses the second disk file allocation method (previously discussed). In order to lower the system overhead involved in finding free data blocks, the Intel file system incorporates a free space management data structure known as a bit map. Each disk sector is represented by a single bit in the bit map. If a bit in the bit map is set to 1, the corresponding disk sector has been allocated. A zero in the bit map indicates that the corresponding sector is free. With this technique, the process of allocating or freeing a sector is accomplished by simply altering the bit map. File names consist of a basic file name (up to six characters) and a file extension (up to three characters). The basic file name and the file extension are separated by a period (.). Examples of valid file names are: DRIV72.0BJ, XX.TMP, and FILE.CS. In addition, four file attributes are supported (see Figure 3 for attribute definitions) . The bit map and the file directory are placed on prespecified disk tracks (reserved for system use) beginning at track zero. Disk File System Functions Table 2 illustrates the typical functions implemented by a disk file system. As an example, the disk directory function (DIR) lists disk file information on the console display terminal. Figure 3 details the contents of a display entry in the Intel file system. The PL/M procedure outlined in Figure 4 illustrates a disk directory algorithm that displays the file name, the file attributes, and the file size (in blocks) for each file in the directory. 6-575 207885-001 APPLICATIONS -y • .·INVISIBLE 1 - SYSTEM 2· WRITE-PROTECT 3· ;: } (RESERVED) 6· 7 - FORMAT AFN·01949A Directory Entry Presence is a flag that can contain one of three values: OOOH - The file associated with this entry is present on the disk. 07FH - No file is associated with this entrYl the content of the rest of the entry is undefined. The first entry with its flag set to 07FH marks the current logical end of the directory and directory searches stop at this entry. OFFH - The file named in this entry once existed on the disk but is currently deleted. The next file added to the directory will be placed in the first entry marked OFFH. This flag cannot, therefore, be used to (reliably) find a file that has been deleted. A value of OFFH should be thought of as simply marking an open directory entry. File Hame is a string of up to 6 non-blank ASCII characters specifying the name of the file associated with the directory entry. If the file name is shorter than six characters, the remaining bytes contain binary zeros. For example, the name ALPHA would be stored as: 4l4C50484l00H. Extension is a string of up to 3 non-blank ASCII characters that specifies an extension to the file name. Extensions often identify the type of data in the file such as OBJ (object 'module) , or PLM (PL/M source module). As with the file name, unused positions in the extension field are filled with binary zeros. Figure 3. Intel Directory Entry Format 6-576 207885-001 APPLICATIONS Attributes are bits that identify certain characteristics of the file. A 1 bit indicates that the file has the attribute, while a a bit means that the file does not have the attribute. The bit positions and their corresponding attributes are listed below (bit a is the low-order or rightmost bit, bit 7 is the leftmost bit): 0: Invisible. Files with this attribute are not listed by the ISIS-II DIR command unless the I switch is used. All system files are invisible. 1: System. Files with this attribute are copied to the disk in drive 1 when the S switch is specified with the ISIS-II FORMAT command. 2: Write-Protect. Files with this attribute cannot be opened for output or update, nor can they be deleted or renamed. 3-6: These positions are reserved for future use. 7: Format. Files with this attribute are treated are write-protected. In addition, these files a new diskette when the ISIS-II FORMAT command system files all have the FORMAT attribute and be given to any other files. as though they are created on is issued. The it should not EOF count contains the number of the last byte in the last data block of the file. If the value of this field is OBOH, for example, the last byte in the file is byte number l2B in the last data block (the last block is full). N.umber of Data Blocks is an address variable that indicates the number of data blocks currently used by the file. ISIS-II and the RMX/BO Disk File system both maintain a counter called LENGTH that is the current number of bytes in the file. This is calculated as: «NUMBER OF DATA BLOCKS - 1) x l2B + EOF COUNT. Header Block pointer is the address of the file's header block. The high byte of the field is the sector number and the low byte is the track number. The system "finds" a disk file by searching the directory for the name and then using the header block pointer to seek to the beginning of the file. Figure 3. Intel Directory Entry Format (Continued) 6-577 207885-001 APPLICATIONS dir: procedure (drv,dens) declare drv dens sector i dir$ptr dir$entry size (5) public; byte, byte, byte, byte, byte, based rdbptr structure (presence byte, file$name(6) byte,extension(3) byte, attribute byte,eof$count byte, data$blocks address,header$ptr address), byte, invisible$f1ag system$flag protected$f1ag format$f1ag literallv li terally literally literally -1-, - 2- , -4-, -SOH-; 1* The disk directory starts at cylinder 1, sector .2.*1 call seek(drv,l,O)~ do sector=2 to·26~ call read(drv,l,O,sector,dens)~ do dir$ptr=O to 112 by 4~ if dir$entry.presence=7FH then return~ if dir$entry.presence=O then do~ do i=O to 5~ call co(dir$entr.y.file$name(i»~ end~ call co(period)~ do i=O to 2~ call co(dir$entry.extension(i»~ end~ do i=O to 4~ ·call co(space)~ end~ call ~onvert$to$decimal(@size,dir$entry.data$blocks)~ do i=O to 4; call co(size(i»; end; If (dir$entrv.attribute and invisible$flag) <> 0 then call co(-I-); If (dir$entry.attribute and system$flag) <> 0 then call co(-S-)~ If (dir$entry.attribute and protected$flag) <> 0 then call co(-W-)~ If (dir$entry~attribuie and format$flag) <> 0 then call co(-F-)~ end~ end; end~ end dir~ AFN-Q1949A Figure 4. Sample PLJM Directory Procedure 6-578 207885-{)Ol APPLICATIONS 7. Key 8272 Software Interfacing Considerations This section contains a quick review of Key 8272 Software design features and issues. (Most items have been mentioned in other sections of this application note.) Before designing 8272 software drivers, it is advisable that the information in this section be thoroughly understood. 1. Non-DMA Data Transfers In systems that operate without a DMA controller (in the polled or interrupt driven mode), the system software is responsible for counting data transfers to/from the 8272 and generating a TC signal to the FDC when the transfer is complete. 2. processor Command/Result phase Interface In the command phase, the driver software must write the exact number of parameters in the exact order shown in Table 5. During the result phase, the driver must read the complete result status. For example, the Format Track command requires six command bytes and presents seven result bytes. The 8272 will not accept a new command until all result bytes are read. Note that the number of command and result bytes varies from command-to-command. Command and result phases cannot be shortened. During both the command and result phases, the Main Status Register must be read by the driver before each byte of information is read from, or written to, the FDC Data Register. Before each command byte is written, DIO (bit 6) must be low (indicating a data transfer from the processor) and RQM (bit 7) must be high (indicating that the FDC is ready for data). During the result phase, DIO must be high (indicating a data transfer to the processor) and RQM must also be high (indicating that data is ready for the processor). Note: After the 8272 receives a command byte, the RQM flag may remain set for approximately 16 microseconds (with an 8 MHz clock). The driver should not attempt to read the Main Status Register before this time interval has elapsed; otherwise, the driver may erroneously assume that the FDC is ready to accept the next byte. 3. Sector Sizes The 8272 does not support 128 byte sectors in the MFM (double-density) mode. 4. Drive Status Changes The 8272 constantly polls all drives for changes in the drive ready status. This polling begins immediately following RESET. An interrupt is generated every time the FDC senses a change in the drive ready status. After reset, the FDC assumes that all drives are "not ready". If a drive is ready immediately after reset, the 8272 generates a drive status change interrupt. 6-579 207885-001 APPLICATIONS 5. Seek Commands The 8272 'FCC does not perform implied seeks. Before issuing a data read or write command, the read/write head must be positioned over the correct cylinder by means of an explicit seek command. If the head is not'positioned correctly, a cylinder address error is generated. 6. Interrupt processing When the processor receives an ,interrupt from the FCC, the FDC may be reporting one of two distinct events: a) The beginning of the result phase of a previously requested read, write, or scan command. b) An 'asynchronous event such as a seek/recalibrate,completion, an attention, an abnormal command termination, or an invalid command. These two cases are distinguished by the'FDC BUSY flag (bit 4) in the Main Status Register. If the FDC BUSY flag is high, the interrupt is of type (a). If the FDC BUSY flag is low, the interrupt was caused by an asynchronous event (b). A single interrupt from the FDC may signal more than one of the above events. After receiving an interrupt, the processor must 'continue to issue Sense Interrupt Status commands (and service the resulting conditions) until an invalid command code is received. In this manner, all "hidden" interrupts are ferreted out and serviced. 7. Skip Flag (SK) The skip flag is used during the execution of Read Data, Read Deleted Data, Read Track, and various Scan commands. This flag permits the FDC to skip unwanted sectors on a disk track. When performing a Read Data, Read Track, or Scan command, a high SK flag indicates that the FCC is to skip over (not transfer) any 'sector containing a deleted data address mark. A low SK flag indicates that the FDC is to terminate the command (after reading all the data in the sector) when a deleted data address mark is encountered. When performing a Read Deleted Data command, a high SK flag indicates that sectors containing normal data address marks are to be skipped. Note that this is just the opposite situation from that described in the last paragraph. When a data address mark is encountered during a Read Deleted 'Data command (and the SK flag is low), the FCC terminates the command after reading all the data in the sector. 6-580 207885-001 APPLICATIONS B. Bad Track Maintenance The B272 does not internally maintain bad track information. The maintenance of this information must be performed by system software. As an example of typical bad track operation, assume that a media test determines that track 31 and track 66 of a given floppy disk are bad. When the disk is formatted for use, the system software formats physical track 0 as logical cylinder o (C=O in the command phase parameters), physical track 1 as logical track 1 (C=l), and so on, until physical track 30 is formatted as logical cylinder 30 (C=30). Physcial track 31 is bad and should be formatted as logical cylinder FF (indicating a bad track). Next, physical track 32 is formatted as logical cylinder 31, and so on, until physiaal track 65 is formatted as logical cylinder 64. Next, bad physical track 66 is formatted as logical cylinder FF (another bad track marker), and physical track 67 is formatted as logical cylinder 65. This formatting continues until the last physical track (77) is formatted as logical cylinder 75. Normally, after this formatting is complete, the bad track information is stored in a prespecified area on the floppy disk (typically in a sector on track 0) so that the system will be able to recreate the bad track information when the disk is removed from the drive and reinserted at some later time. To illustrate how the system software performs a transfer operation on a disk with bad tracks, assume that the disk drive head is positioned at track 0 and the disk described above is loaded into the drive. If a command to read track 36 is issued by an application program, the system software translates this read command into a seek to physical track 37 (since there is one bad track between 0 and 36, namely 31) followed by a read of logical cylinder 36. Thus, the cylinder parameter C is set to 37 for the Seek command and 36 for the Read Sector command. 6-581 207885-001 APPLICATIONS REPBRERCBS 1. Intel, n8272 Single/Double Density Floppy Disk Controller Data Sheet,n Intel Corporation, 1980. 2. Intel, nAn Intelligent Data Base System Using the 8272," Intel Application Note, AP-116, 1981. 3. Intel, iSBC 208 Hardware Reference Manual, Manual Order No. 143078, Intel Corporation, 1980. 4.. Intel, RMX/80 User I s Guide, Manual Order No. 9800522, Intel Corporation, 1978 5. Brinch Hansen, P., Operating System principles, prentice-Hall, Inc., New Jersey, 1973. 6. Flores, I., Computer Software: programming systems for Digital.Computers, prentice-Hall, Inc., New Jersey, 1965. 7. Knuth, D. E., Fundamental Algorithms, Addison-Wesley publishing Company, Massachusetts, 1975. 8~ Shaw, A. C., The Logical Design of Operating Systems, prentice-Hall, Inc., New Jersey, 1974. 9. Watson, R. W., Time Sharing system Design Concepts, McGraw-Hill, Inc., New York, 1970. 10. Zarrella,'J., Operating Systems: Concepts and principles, Microcomputer Applications, California, 1979. 6-582 207885-001 APPLICATIONS APPENDIX A 8272 FDC DEVICE DRIVER SOFTWARE 6-583 207885-001 APPLICATIONS PL/M-86 COMPILER 8272 FLOPPY DISK CONTROLLER DEVICE DRIVERS ISIS-II PL/M-86 Vl.2 COMPILATION OF MODULE DRIVERS OBJECT MODULE PLACED IN :Fl:driv72.0BJ COMPILER INVOKED BY: plm86 :Fl:driv72.p86 DEBUG $title('8272 floppy disk controller device drivers') $nointvector $optimize (2) $large drivers: do; declare 1* floppy disk port definitions */ literally'30H', fdc$status$port fdc$data$port literally '3lH': declare /* floppy disk commands */ sense$int$status literally /* 8272 status port */ /* 8272 data port */ ~08H~; declare 1* interrupt definiti.ons *1 fdc$int$level literally '33': /* fdc interrupt level */ declare 1* return status and error codes */ error literally ""0"', ok literally"'1"', complete literally"'3", false literally "'0"', true literally"1", error$in literally "not"" propagate$error literally "'return error"', stat$ok stat$busy stat$error stat$command$error stat$result$error stat$invalid 1 1 literally"O'", literally' '"1'", literally '2', literally"'3'", literally '4', literally "5"': /* fde operation completed without errors */ /* "fdc is husy, operation cannot be started */ /* fdc operation error */ /* fdc not ready for command phase */ 1* fdc not ready for r~sult phase */ 1* invalid fdc command */ declare /* masks */ busy$mask DIO$mask RQM$mask seek$mask result$error$mask result$drive$mask result$ready$mask literallv"'lOH"', literallv'40H', literally'80H', literallv"'OFH"', literally'OCOH', literally'03H', literally '08H': declare /* drive numbers */ max$no$drives fdc$general literally '"3'", literally "'4"'; neclare 1* misceJ.laneous control */ any$drive$seeking literally command$code Ii terallv DIO$set$for$input literally DIO$set$for$output literally extract$drive$no literally fdc$busy li ter ally nO$fdc$error literally wait$for$op$complete wait$for$RQM 1 10 1 '((input(fdc$status$port) and seek$mask) <> a)', '(docb.disk$command(O) and lFH)', '((input(fdc$status$port) and DIO$mask)=O)', '((input(fdc$status$port) and DIO$mask)<>O)',' '(docb.disk$command(l) and 03H)', '((input(fdc$status$port) and busy$mask) <> a)', 'possible$error(command$code) and ((docb.disk$result(O) and result$error$mask) = a)', literally '"do while not operation$complete(drive$no) ~ end'", literally 'do while (input (fdc$status$port) and RQM$mask) = 0: end:': declare /* structures */ docb$type literally /* disk operation control block */ "'(dma$op byte,dma$addr word, dma$addr$ext byte,dma$count word, disk$command(9) byte,disk$result(7) byte,misc byte)': $eject declare drive$status$change(4) byte public, drive$ready(4) byte public: /* when set - indicates that drve status changed */ /* current status of drives */ 6-584 207885-001 APPLICATIONS declare operation$in$progress(5) byte, operation$complete(5) byte, operation$docb$ptr(5) pointer, interrupt$docb structure docb$type, globa1$drive$no byte, 11 /* internal flags for operation with multiple drives */ fde execution phase completed */ /* pointers for operations in progress */ 1* temporary dacb for interrupt processing */ 1* /* drive number of non-overlapped operation in progress - if any */ declare /* internal vectors that contain command operational information */ no$result(32) byte 1* no result phase to command */ data(O,O,O,l,O,O,O,O,O,O,O,O,O,O,O,D,O,O,O,O,O,O,O,O,O,0,0,0,0,0,0,0) , immed$result(32) byte 1* immediate result phase for command */ data (0, 0, 0, 0, 1, 0, 0, 0,1, 0, 0,0, 0, 0,0,0, 0,0, 0, a ,0, 0, 0,0, 0, 0, 0, 0,0,0,0,0) , overlap$operation(32) byte 1* command permits overlapped operation of drvies *1 data(O,O,O,O,O,O,O,l,O,O,O,O,O,O,O,l,O,O,O,O,O,O,O,O,O,0,0,0,0,0,0,0), drive$no$present(32) byte 1* drive number present in command information *1 data(O,O,I,O,I,l,l,l,O,l,l,O,l,l,O,l,O,l,O,O,O,O,O,O,O,1,0,0,0,1,0,0), possible$error(32) byte 1* determines if command can return with an error *1 data(O,O,l,O,O,l,l,l,l,l,l,O,l,l,O,l,O,l,O,O,O,O,O,O,O,1,0,0,0,1,0,0), command$length(32) byte 1* contains number of command bytes for each command data(O,0,9,3,2,9,9,2,l,9,2,0,9,6,O,3,O,9,O,O,0,O,0,0,0,9,0,0,0,9,0,0), valid$command(32) byte 1* flags invalid command codes */ data(O,O,l,l,l,l,l,l,l,l,l,O,l,l,O,l,O,l,O,O,O,O',O,O,0,1,0,0,0,1,0,0); 12 $eject 1**** initialization for the 8272 fdc driver software. This procedure m~st be called prior to execution of any driver software. ****1 initialize$drivers: procedure pUblic: 13 1* initialize 8272 drivers *1 14 declare drv$no byte; 15 16 17 18 19 20 do drv$no=O to max$no$drives; 21 22 23 24 ~rive$ready(drv$no)=fa1se, drive$status$change(drv$no)=false, operation$in$progress(drv$no)=false; operation$complete(drv$no)=false: end; 2 2 2 operation$in$progress (fdc$general) =falsej operation$complete(fdc$general)=£alsej global$drive$no=O, end initialize$drivers; 1**** wait until the 8272 fdc is ready to receive command/parameter bytes in the command phase. The 8272 is ready to receive command bytes when the RQM flag is high and the 010 flag is low. ****1 25 fdc$ready$£or$command: procedure byte; 1* wait for valid flag settings in status register *1 26 call time (~); 1* wait for "master request" flag *1 27 wait$for$RQM, 30 /* check data direction flag */ if DIO$set$for$input then return ok; else return error: 32 33 end fdc$ready$for$command, /**** wait until the 8272 fdc is ready to return data bytes in the result phase. The 8272 is ready to return a result byte when the RQM and 010 flags are both high. The busy flag in the main status register will remain set ,until the last data byte of the result phase has been read by the processor. ****1 34 fdc$ready$for$resu1t: procedure byte, 1* wait for valid settings in status register *1 35 call time (1) , 1* result phase has ended when the 8272 busy flag is reset *1 36 i f not fdc$busy then return complete; 6-585 207885-001 *1 APPLICATIONS /* wait for "master request" flag */ wait$for$RQM, 38 /* check data direction flag */ if DIO$set$for$output then return ok; else return error; 41 43 44 end fdc$ready$for$result, /**** output a single command/parameter byte to the 8272 fde. parameter is the byte to be output to the fdc. The "data$byte" ****/ output$byt~$to$fdc: procedure (data$byte) byte; declare data$byte byte, 45 46 1* check 'to see if fde is ready for command if not fdc$readv$for$command then propagate$error; 47 49 */ output (fdc$data$port)=data$byte, return ok; end output$byte$to$fdc, 50 51 /**** input a single result byte from the 8272 fdc. The "data$byte$ptr" parameter is a pointer to the memory location that is to contain the input byte. ****/ input$byte$from$fdc: procedure (data$byte$ptr) byte, declare data$byte$ptr pointer; declare data$byte based data$byte$ptr byte, status byte: 52 53 54 55 56 /* check to see if fdc is ready */ status=fdc$readySfor$result, if ~rror$in status 58 /* check for result phase complete if status=complete then propagate$error~ *1 then return complete; ~o data$byte=input(fdc$data$port) , return oki end input$byte$from$fdc, 61 62 $eject /**** output the drna mode, the drna address, and the drna word count to the 8237 dma controHer. Also output the high order four bits of the address to the address extension latch. Finally, start the disk drna channel. The "docb$ptr" parameter is a pointer to the appropriate disk operation control block. ****/ 63 64 65 1 2 2 output$controls$to$dma: procedure(docb$ptr), declare docb$ptr pointer; declare docb based docb$ptr structure docbtype; declare /* drna port definitions */ dma$upper$addr$port literally'lOH', dma$disk$addr$port literally 'OOH', dma$disk$word$count literally ~OlH~, dma$cornrnand$port literally ~08H~, dma$rnode$port literally ~OBH~, dma$mask$sr$port literally'OAH', dma$clear$ff$port literally'OCH', dma$master$clear$port literally 'ODH', dma$mask$port literally'OFH', 66 dma$disk$chan$start dma$extended$write dma$single$transfer 67 69 70 3 3 literally'OOH', literally'shl(l,5)', literally'shl(l,6)', upper 4 bits of current address */ current address port */ word count port */ command port */ mode port */ mask set/reset port */ /* clear first/last flip-flop port */ /* drna master clear port */ /* parallel mask set port*/ /* /* /* /* /* /* /* drna mask to start disk channel */ /* extended write flag */ /* single transfer flag */ if docb.dma$op < 3 then do, /* set dma mode and clear first/last flip-flop */ output (dma$mode$port) =shl (docb.dma$op, 2) or 40H, output (dma$clear$ff$port)=O, 6-586 APPLICATIONS 71 72 73 /* set output output output 74 75 /* output disk transfer word count to dma controller */ Qutput (dma$disk$word$cQuntl =low(docb.dma$cQunt) ; output (dma$disk$word$count)=high(docb.dma$count) , 76 77 7B dma address */ (dma$disk$addr$port)=low (docb.dma$addr) , (dma$disk$addr$port) =high(docb.dma$addr) , (dma$upper$addr$port)=docb.dma$addr$ext, /* start dma channel a for fdc */ output (dma$mask$sr$port) =dma$disk$chan$start, end; end Qutput$controls$to$dmaj /**** output a high-level disk command to the 8272 fdc. The number of bytes required for each command is contained in the IIcommand$length" table. The "docb$ptr" parameter is a pointer to the appropriate disk operation control block. 79 BO ****/ output$command$to$fdc: procedure (docb$ptr) byte, declare docb$ptr pointerj B1 declare docb based docb$ptr structure docb$type, cmd$byte$no byte, B2 disable; 83 B4 B9 90 91 92 /* output all command bytes to the fde */ do cmd$byte$no=O to command$length(command$code)-l, i f error$in output$byte$to$fdc(docb:disk$command(cmd$byte$no)) then do; enable; propagate$erro[j end; end; enable; return ok: end output$command$to$fdc; /**** input the result data from the 8272 fdc during the result phase (after command execution). The "docb$ptr" parameter is a pointer to the appropriate disk operation control block. ****/ 93 94 95 input$result$from$fdc: procedure (docb$ptr) byte, declare docb$ptr pointer; declare docb based docb$ptr structure docb$type, result$byte$no byte, temp byte, status byte; 96 disable; 97 do result$byte$no=O to 7, status=input$byte$from$fdc(@temp), if error$in status then do; enable: propagate$error; end: if status=complete then do; enable: return oK: end: docb.disk$result(result$byte$no)=temp, end: 98 99 104 109 110 ill 112 114 115 enable: i f fdc$busv then return error; else return ok; end input$result$from$fdc; /**** cleans up after the execution of a disk operation that has no result phase. The procedure is also used after some disk operation errors. "drvll is the drive number, and IICC II is the command code for the disk operation. ****/ 116 117 11B 119 operation$clean$up: procedure (drv,cc) : declare (drv,cc) bytei disable; operation$in$progress(drv)=false: 6-587 207885-001 APPLICATIONS 120 if not Qverlap$operation(cc) then global$drive$no=01 122 enable~ end operation$clean$up; 123 $eject 1**** execute the disk operation control block specified by the pointer parameter "docb$ptr". The "statusSptr" parameter is a pointer to a byte variable that is to contain the status of the requested operation when it has been completed. Six status conditions are possible on return: The specified operation was completed without error. 3 4 S The fde is busy and the requested operation cannot be started. Fda error. (further information is contained in the result storage portion of the disk operation control block - as described in the 8272 data sheet). Transfer error during output of the command bytes to the fde. Transfer error during input of the result bytes from the fdc. Invalid fdc command. ****/ execute$docb: procedure (docb$ptr,status$ptr) public; /* execute a disk operation control block */ 124 declare docb$ptr pointer, status$ptr pointer t declare docb based docb$ptr structure docb$type, status based status$ptr byte, drive$no byte; 125 126 /* check command validity */ if not valid$command(command$code) then do; status=stat$invalid; return; end; 127 /* determine if command has a drive number field - if not, set the drive number for a general fdc command */ if drive$no$present(command$code) then drive$no=extract$drive$no, else drive$no=fdc$genera1; 132 134 /* an overlapped operation can not be performed if the fde is busy */ if overlap$operation(command$code) and fdc$busy then do; status=stat$busy; return; end; 135 /* for a non-overlapped operation, check fde busy or any drive seeking */ if not overlap$operation(command$code) and (fdc$busy or any$drive$seeking) then do; status=stat$busy; return; end; 140 /* check for drive operation in progress - if none, set flag and start operation *1 disable; if operation$in$progress(drive$no) then do; enable; status=stat$busYi return; end; else operation$in$progress(drive$no)=true; 145 146 152 153 154 2 /* at this point, an fde operation is about to begin, so: 1. reset the operation complete flag 2. set the docb pointer for the current operation 3. if this is not an overlapped operation, set the global drive number for the subsequent result phase interrupt. */ operation$comp1ete(drive$no)=O, 2 operation$docb$ptr(drive$no)=docb$ptr 1 if not overlap$operation(command$code) then global$drive$no=drive$no+l1 enable; 155 157 158 159 2 2 161 162 163 164 call output$controls$to$dma(docb$ptr) 1 if error$in output$command$to$fdc(docb$ptr) then do; call operation$clean$up(drive$no,command$code) 1 status=stat$command$error; return; end; /* return immediately if the command has nO result phase or completion interrupt - specify */ if no$result(eommand$code) then do; 165 167 168 169' 170 3 3 3 3 call operation$clean$up(drive$no,command$code) 1 status=stat$ok; return; end; 6-588 207885-001 APPLICATIONS if immed$result(command$code) then do; if error$in input$resu1t$from$fdc(docb$ptr) then do; 171 173 175 176 177 17S 179 ISO lSI lS3 call operation$clean$up(drive$no,command$code) ; 4 4 4 4 3 2 3 3 188 status=stat$result$error; return; end; end; else do; wait$for$op$comp1ete; if docb.misc = error then do; status=stat$result$errori return; end; end; lS9 if no$fdc$error then status=stat$ok; else status=stat$error; 191 192 end execute$docb; $eject /**** copy disk command results from the interrupt control block to the currently active disk operation control block if a disk operation is in progress. ****/ 193 194 195 1 2 2 copy$int$result: procedure(drv); declare drv byte; declare i byte, docb$ptr pointer, docb based docb$ptr structure doch$type; 196 198 199 202 203 204 205 206 3 3 3 3 3 3 if operation$in$progress(drv) then do; docb$ptr=operation$docb$ptr(drv); do i=l to 6; docb.disk$result(i)=interrupt$docb.disk$result(i); end; docb.misc=ok; operation$in$progress(drv)=false; operation$complete(drv)=true; end; end copY$int$result; /**** interrupt processing for 8272 fdc drivers. Basically, two types of interrupts are generated by the 8272: (a)when the execution phase of an operation has been completed, an interrupt is generated to signal the beginning of the result phase (the fdc busy flag is set when this interrupt is received), and (b) when an overlapped operation is completed or an unexpected interrupt is received (the fdc busy flag is not set when this interrupt is received). When interrupt type (a) is received, the result bytes from the operation are read from the 8272 and the operation complete flag is set. When an interrupt of type (b) is received, the interrupt result code is examined to determine which of the following four actions are indicated: 1. An overlapped option (recalibrate or seek) has been completed. The result data is read from the 8272 and placed in the currently active disk operation control block. 2. An abnormal termination of an operation has occurred. The result data is read and placed in the currently active disk operation control block. 3. The execution of an invalid command has been attempted. This signals the successful completion of all interrupt processing. 4. The ready status of a drive has changed. The "drive$ready" and "dr ive$ready$status" change tables are updated. If an operation is currently in progress on the affected drive, the result data is placed in the currently active disk operation control block. After an interrupt is processed, additional sense interrupt status commands must be issued and processed until an invalid command result is returned from the fdc. This action guarantees that all "hidden" interrupts are serviced. ****/ 6-589 APPLICATIONS 207 208 1 2 fdcint: procedure public interrupt fdc$int$leve11 declare ' invalid byte, drive$no byte, docb$ptr pointer, docb based docb$ptr structure docb$type1 209 declare 1* interrupt port definitions */ ocw2 literally'70H', nseoi literally 'shl(1,5)'1 210 declare ;* miscellaneous flags *; result$code literally 'shr(interrupt$docb.disk$result(O) and result$error$mask,6)', result$drive$ready literally '((interrupt$docb.disk$result(O) and result$ready$mask) = 0)' extract$result$drive$no literally' (interrupt$docb.disk$result(O) and result$drive$mask)', end$of$interrupt literally 'output(ocw2)=nseoi'1 /* if the fde is busy when an interrupt is received, then the result phase of the previous non-overlapped operation has begun */ 211 if fdc$busy then do: /* process interrupt if operation in progress */ if global$drive$no <> a 213 then do; 215 216 218 219 220 221 222 223 docb$ptr=operation$docb$ptr(global$drive$no-l) 1 if error$in input$result$from$fdc(docb$ptr) then docb.rnisc=error; 4 4 4 4 4 3 else docb.misc=ok; operation$in$progress(global$drive$no-l)=false1 operation$complete(global$drive$no-l)= true 1 global$drive$no=01 end; end; /* if the fdc is not busy, then either an overlapped operation has been completed or an unexpected interrupt has occurred (e.g., drive status change) *; 224 225 226 else do; invalid=false; do while not invalid; /* perform a sense interrupt status operation - if errors are de;!:.ected, 227 229 in the actual fdc interface, interrupt processing is discontinued */ if error$in output$byte$to$fdc(sense$int$status) then go to ignore1 if error$in input$result$from$fdc(@interrupt$docb) then go to ignore1 231 do case result$code; ;* case a - operation complete *; do; drive$no=extract$result$drive$no; call copy$int$result(drive$no) 1 end; 232 233 234 235 /* case 1 - abnormal termination */ 236 237 238 239 do; drive$no=extract$result$drive$no; call copy$int$result(drive$no) 1 end; /* case 2 - invalid command */ 240 invalid=truei 241 242 243 244 245 5 6 6 6 247 248 249 250 251 6 6 6 5 4 3 252 253 254 /* 'case 3 - drive ready change */ do; drive$no=extract$result$drive$no; call copY$int$result(drive$no)1 drive$status$change (drive$no) =true; if result$drive$ready then drive$ready(drive$no)=truej else drive$ready(drive$no)=false; end; end; end; end; ignore: end$of$interrupt; end fdcint1 1 end drivers; 6-590 207885-001 APPLICATIONS MODULE INFORMATION: CODE AREA SIZE CONSTANT AREA SIZE VARIABLE AREA SIZE MAXIMUM STACK SIZE 564 LINES READ o PROGRAM ERROR(S) 0615H 15570 OOOOH 00 0050H 0032H 800 SOD END OF PL/M-86 COMPILATION 6-591 207885-001 APPLICATIONS APPENDIX B 8272 FDC EXERCISER PROGRAM 6-592 207885-001 APPLICATIONS PL/M-86 COMPILER 8272 FLOPPY DISK DRIVER EXERCISE PROGRAM ISIS-II PL/M-86 Vl.2 COMPILATION OF MODULE RUN72 OBJECT MODULE PLACED IN :Fl:run72.0BJ COMPILER INVOKED BY: plm86 :Fl:run72.p86 DEBUG $title ('8272 floppy disk driver exercise program') $nointvector $optimize(2) $large run72: do; declare docb$type literally /* disk operation control block */ (dma$op byte,dma$addr word,dma$addr$ext byte,dma$cQunt word, disk$command(9) byte,disk$result(7) byte,misc byte)'; declare /* 8272 fdc commands */ literally "0"', fm mfm literally "'1'" , dma$mode literally '0', literally "'1'" , non$dma$mode recalibrate$command literally '7', specify$command li terally '3', read$command literally "'6", literally "5"', write$command literally 'ODH' , format$command literally 'OFH'; seek$command declare dma$ver ify dma$read dma$write dma$noop literally literally literally literally declare /* disk operation control blocks */ format$docb seek$docb recalibrate$docb speci fy$docb read$docb write$docb declare step$rate head$load$time head$unload$tirne filler$byte operation$statu5 interleave format$gap read$wri te$gap index drive density multitrack sector cylinder head tracks$per$disk sectors$per$track bytes$per$sector$code bytes$per$sector structure structure structure structure structure structure docb$type, docb$type, docb$type, docb$type, docb$type, docb$type; byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, byte, wordr /* disk drive head */ /* number of bytes in a sector on the disk */ declare 1* read and write buffers */ fmtblk(104) wrbuf(1024) rdbuf (1024) byte public, byte public, byte public; declare /* disk format initialization tables */ sec$trk$table(3) byte data(26,lS,8), fmt$gap$table(8) byte data(lBH,2AH,3AH,O,O,36H,54H,74H), rd$wr$gap$table(8) byte data(07H,OEH,lBH,O,O,OEH,lBH,3SH); 6-593 20788p-001 APPLICATIONS declare /* external pOinter tables and interrupt vector */ rdbptr (2) word external, wrbptr (2) word external, word external, fbptr (2) intptr (2) word external, intvec(80H) word external; 10 11 12 2 2 13 1 14 2 1 execute$docb: procedure (docb$ptr,statu5$ptr) external: declare docb$ptr pointer, status$ptr pointer; end execut'e$docb; initialize$drivers: procedure external; end initialize$drivers; $eject /**** specify step rate ("srt"), head load time ("hIt"), head un+oad time ("hut"), and dma or non-dma operation ("nd"). ****/ 15 specify: procedure(srt,hlt,hut,nd); 16 declar~ 17 18 specify$docb.dma$op=dma$noop, specify$docb.disk$command (0) =specify$command; specify$docb.disk$command(1)=sh1((not srt)+1,4) or shr(hut,4) , specify$docb.disk$command(2)=(h1t and OFEH) or (nd and 1), call execute$docb(@specify$docb,@operation$status), 19 20 21 22 -(srt,hlt,hut,nd) byte; end specify; 1**** recalibrate disk drive 8272 automatically steps out until the track 0 signal is activated by the disk drive. ****1 recalibrate: procedure (drv) : declare drv byte; 23 24 recalibrate$docb.dma$op=dma$noop; recalibrate$docb.disk$command(O)=recalibrate$command: recalibrate$docb.disk$command(l)=drvl call execute$docb(@recalibrate$docb,@operation$status): 25 26 27 28 end recalibrate; 29 1**** seek drive "drv", head (side) "hd" to cylinder "cyl".' ****1 seek: procedure(drv,cyl,hd)i declare (drv,cy1,hd) byte, 30 31 seek$docb.dma$op=dma$noop; seek$docb.disk$command(O)=seek$commandi seek$docb.disk$command (1) =drv or· sh1 (hd, 2) , 32 33 34 35 seek$docb.disk$command(2)~cy1, 36 call execute$docb(@seek$docb,@operation$status): end seek; 37 1**** format a complete side (llhead") of a single floppy disk in drive "drv". (single or double) is specified by flag "dens". ****1 38 1 39 40 41 42 43 46 47 48 2 2 The density, format: procedure (drv,dens,intlve) : /* format disk */ declare (drv,dens,intlve) byte; declare physical$sector byte; call recalibrate(drv): do cy1inder=0 to tracks$per$disk-1, 1* set sector numbers in format block to zero before computing interleave *1 do physica1$sector=1 to sectors$per$track, fmtb1k((physica1$sector-1)*4+2)=0, end, 1* physical sector 1 equals logical sector 1 *1 physical$sector=l; 1* assign interleaved sectors *1 do sector=l to sectors$per$track: index=(physica1$sector-1) *4, 6-594 207885-001 APPLICATIONS /* change sector and index if sector has already been assigned */ do while fmtblk(index+2) <> 0; index=index+4; physical$sector=physical$sector+l; end; 49 /* set cylinder, head, sector, and size code for current sector _into table */ 53 54 55 56 fmtblk(index)=cylinder; fmtb1k (index+1) =head; fmtb1k(index+2)=sector; fmtb1k (index+3) =bytes$per$sector$code; 60 /* update physical sector number by interleave */ physical$sector=physical$sector+intlve; if physical$sector > sectors$per$track then physical$sector=physical$sector-sectors$per$track; end; 61 /* seek to next cylinder */ call seek (drv,cylinder,head) ; 57 58 /* set up format control block */ 62 63 64 65 66 67 68 69 70 71 72 73 3 3 3 3 3 3 3 3 3 3 3 3 74 format$docb.dma$op=dma$write; format$docb.dma$addr=fbptr(O)+sh1(fbptr(1) ,4); format$docb.dma$addr$ext=O; forrnat$docb.dma$cQunt=sectors$per$track*4-l; format$docb.disk$command(O)=format$command or shl(dens,6); format$docb.disk$command(l)=drv or sh1(head,2); format$docb.disk$command(2)=bytes$per$sector$code; format$docb.disk$command(3)=sectors$per$track; format$docb.disk$command(4)=format$gap, format$docb.disk$command(5)=fi11er$byte; call execute$docb(@format$docb,@operation$status); end; end format; /**** write sector "sec ll on drive "drv" at head "hd" and cylinder "cyl". The disk recording density is specified by the "dens" flag. Data is expected to be in the global write buffer ("wrbuf"). ****/ 75 76 1 2 77 2 2 2 2 2 2 2 2 2 2 2 2 2 78 79 80 81 82 83 84 85 86 87 88 89 91 92 93 write: procedure (drv,cyl,hd,sec,dens) ; declare (drv,cyl,hd,sec,dens) byte; write$docb.dma$op=dma$write: write$docb.dma$addr=wrbptr(0)+sh1(wrbptr(1) ,4); write$docb.dma$addr$ext=O; write$docb.dma$count=bytes$per$sector-l; write$docb.disk$command(O)=write$command or sh1(dens,6) or sh1(mu1titrack,7); write$docb.disk$command(l)=drvor sh1(hd,2); write$docb.disk$command(2)=cy1; write$docb.disk$command(3)=hd; write$docb.disk$command(4)=sec; write$docb.disk$command(5)=bytes$per$sector$code; write$docb.disk$command(6)=sectors$per$track; write$docb.disk$command(7)=read$write$gap; if bytes$per$sector$code = 0 then write$docb.disk$command (8) =bytes$per$sector; else write$docb.disk$command(8)=OFFH; call execute$docb(@write$docb,@operation$status); end write; /**** read sector "sec" on drive "drv" at head "hd" and cylinder "cyl". disk recording density is defined by the "dens" flag. the global read buffer (I'rdbuf"). ****/ 94 95 96 97 98 99 100 101 102 103 104 105 106 107 The Data is read into read: procedure(drv,cyl,hd,sec,dens); declare (drv,cyl,hd,sec,dens) byte: 2 2 2 2 2 2 2 2 2 2 2 2 read$docb.dma$op=dma$read; read$docb.dma$addr=rdbptr(O)+sh1(rdbptr(1) ,4); read$docb.dma$addr$ext=O; read$docb.dma$count=bytes$per$sector-l; read$docb.disk$command(O)=read$command or sh1(dens,6) or sh1(mu1titrack,7); read$docb.disk$command(l)=drv or sh1(hd,2); read$docb.disk$command(2)=cy1; read$docb.disk$command(3)=hd; read$docb.disk$command(4)=sec; read$docb.disk$command(5)=bytes$per$sector$code; read$docb.disk$command(6)=sectors$per$track; read$docb.disk$command(7)=read$write$gap; 6-595 207885-001 APPLICATIONS lOB if bytes$per$sector$code = 0 then read$docb.disk$command(B)=bytes$per$sector; else read$docb.disk$command(B)=OFFH; call execute$docb(@read$docb,@operation$status); 110 III 112 end read; $eject 1**** initialize system by setting up 8237 dma controller and 8259A interrupt controller. ****1 113 114 1 2 llS initialize$system: proceduref declare /* I/O ports */ literally dma$disk$addr$port dma$disk$word$count$port literally literally dma$command$port dma$mode$port literally dma$mask$sr$port literally dma$clear$ff$port literally literally dma$master$clear$port literally dma$mask$port dma$cl$addr$port literally literally dma$cl$word$count$port literally dma$c2$addr$port literally dma$c2$word$count$port dma$c3$addr$port literally dma$c3$word$count$port l:iterally literally icwl literally icw2 literally icw4 oewl literally li terally ocw2 li terally oew3 'OOH', 'OlH', 'OBH', /* current address port */ /* word count port */ /* command port */ /* mode port */ /* mask set/reset port */ /* clear first/last flip-flop port */ "'OBH"', "OAH"', 'OCH' , 1* dma master clear port */ 1* parallel mask set port·/ "'ODH"', "'OFH"', '02H' , "'03H"", '04H', 'OSH', '06H', '07H', '"'08"', '71H' , '71H' , '71H' , '70H' , '70H'; declare /* mise masks and literals *1 dma$extended$write literally'shl(l,S)', dma$single$transfer literally'shl(1,6)', dma$disk$mode li terally '40H', dma$c1$mode literally '41H' , dma$c2$mode literally' 42H', dma$c3$mode li terally '43H', mode$BOB8 li terally '1', interrupt$base Ii terally ... 20H'" , single$controller literally 'shl(l,l)', level$sensitive literally 'shl(l,3)', control$word$4$required literally '1' /* extended write flag */ /* single transfer flag */ '"IOR"",~ base$icwl literally mask$all disk$interrupt$mask literally'OFFH', literally '1'; /* master reset */ /* set dma command mode */ 116 117 output (dma$master$clear$port) =0; output (oma$mode$port)=dma$extended$write; 11B /* set all dma registers to valid values */ /* mask all channels */ output (dma$mask$port)=mask$all; 1* set all addresses to zero */ /* reset first/last flip-flop */ 119 120 121 122 123 124 l2S 126 127 2 2 2 2 2 2 2 2 2 output (dma$clear$ff$port)=O; output (dma$disk$addr$port) =0; output (dma$disk$addr$port) =0; output (dma$cl$addr$port) =0; output (dma$cl$addr$port) =0; output (dma$c2$addr$port) =0; output (dma$c2$addr$port) =0; output (dma$c3$addr$port) =0; output (dma$c3$addr$port) =0; l2B 129 130 131 132 133 134 l3S 136 2 2 2 2 2 2 2 2 2 1* set all word counts to valid values */ output (dma$clear$ff$port) =0; output (dma$disk$word$count$port) =1; output (dma$disk$word$count$port) =1; output (dma$cl$word$count$port) =1 output (dma$c1$word$count$port) =1 output (dma$c2$word$count$port) =1 output (dma$c2$word$count$port)=1 output (dma$c3$word$count$port) =1 output (dma$c3$word$count$port) =1 6-596 /* reset first/last flip-flop */ 207885-001 APPLICATIONS 1* initialize all dma channel modes 137 138 139 140 */ output (dma$mode$port) =dma$disk$mode; output (dma$mode$port) =dma$cl$mode; output (dma$mode$port) =dma$c2$mode; output (dma$mode$port) =dma$c3$mode: 1* initialize 8259A interrupt controller */ Qutput(icwl)=single$controller or level$sensitive or control$word4$required or base$icwl; Qutput(icw2)=interrupt$base; /* set 8088 interrupt mode */ output (icw4)=mode$8088; Qutput(ocwl)=not disk$interrupt$mask: 1* mask all interrupts except disk */ 141 142 143 144 /* initialize interrupt vector for fde */ 145 146 intvec(40H)=intptr(O) ~ intvec(41H)=intptr(1); end initialize$system; 147 $eject first format disk (all tracks on side (head) o. read each sector on every track of the disk forever. ****/ 1**** main program: Then declare drive$ready(4) byte external: 148 1* disable until interrupt vector setup and initialization complete */ disable; 149 150 151 152 153 154 155 156 157 158 159 1 1 1. 1 1 1 1 1 1 1 /* set initial floppy disk parameters */ density=mfm; head=o; multitrack=O; filler$byte=55H; tracks$per$disk=77; bytes$per$sector=1024; interleave=6; step$rate=ll; head$load$time=4o; head$unload$time=240; double-density */ single sided */ no multitrack operation */ for format */ normal floppy disk drive */ 1024 bytes in each sector */ set track interleave factor */ 10ms for SABOO plus 1 for uncertainty */ /* 40ms head load for SASoo */ /* keep head loaded as long as possible */ /* /* /* /* /* /* /* /* /* derive dependent parameters from those above */ bytes$per$sector$code=shr(bytes$per$sector,7); do index=O to 3; if (bytes$per$sector$code and 1) <> 0 then do; bytes$per$sector$code=index; go to donebc; end; else bytes$per$sector$code=shr(bytes$per$sector$code,l); end; 160 161 162 167 168 170 171 donebc: sectors$per$track=sec$trk$table(bytes$per$sector$code-density); format$gap=fmt$gap$table(shl(density,2)+bytes$per$sector$code); read$write$gap=rd$wr$gap$table (shl (density,2)+bytes$pe r$sector$code); 172 173 /* initialize system and drivers */ call initialize$system; call initialize$drivers; 169 174 175 1 1 /* reenable interrupts and give B272 a chance to report on drive status before proceeding */ enable; call time (10) ; 176 1 /* specify disk drive parameters */ call specify {step$rate,head$load$time,head$unload$time,dma$ mode); 178 179 1 2 181 182 183 184 185 186 187 /* run single disk drive #0 */ drive=O; 177 1 /* wait until drive ready */ do while 1; if drive$ready(drive) then go to start; end; start: call format(drive,density,interleave}; do while 1; do cylinder=o to tracks$per$disk-l; callseek(drive,cylinder,head); do sector=l to sectors$per$track; /* set up write buffer */ do index=O to bytes$per$sector-l; wrbuf(index)=index+sector+cylinder; end; 6-597 207885-001 ·APPLICATIONS 190 191 call write(drive,cylinder,head,sector,density); eall read(drive~eylinder,head,seetor,density), 4 4 192 /* eheek read buffer against write buffer */ if empw(@wrbuf,@rdbuf,shr(bytes$per$seetor,l» then halt, end, 194 195 196 4 3 2 endJ endJ 197 1 end run72, MODULE INFORMATION: CODE AREA SIZE 0570H CONSTANT AREA SIZE OOOOH VARIABLE AREA SIZE = 0907H 0022H MAXIMUM STACK SIZE 412 LINES READ o PROGRAM ERROR(S) END OF PL/M-86 COMPILATION <> OFFFFH 13920 00 23110 340 6-598 207885-001 APPLICATIONS APPENDIX C 8272 DRIVER FLOWCHARTS 6-599 207885-001 APPLICATIONS RESET" -DRIVE$READV -DRIVE$STATUSSCHANGE -OPERATION$IN$PROGRESS -OPERATIONSCOMPLETE RETURN RETURN 6-600 207885-001 APPLICATIONS c'------"=;;;;....__ RETURN COMPLETE ) RETURN 6-601 207885-001 APPLICATIONS YES 6-602 207885-001 APPLICATIONS ( ( RETURN RETURN ERROR ) ) ..._~E:.:..R:.:..RO:.:..R_ _- , RETURN 6-603 207885-001 APPLICATIONS ">'=_____ ,( ..,. RETURN INVALID STATUS ) '--------' :::>-'-'~____. ( RETURN ) ~_~B~U~S~V~S~TA~T~U~S~--, >='------( RETURN BUSVSTATU~ ) '-------' ENABLE INTERRUPTS 1------1..( "-------_.... • RETURN ) ~__~B~U~SV~ST~A~T~U~S__~ NO 6-604 207885-001 APPLICATIONS NO YES RETURN RESULT ERROR STATUS NO YES RETURN ERROR STATUS "----~) 6-605 207885-001 APPLICATIONS RESET OPERATIONSINSPROGRESS FLAG SET OPERATION$COMPLETE FLAG 6-606 207885-001 APPLICATIONS RESULT PHASE OF PREVIOUS COMMAND ASYNCHRONOUS INTERRUPT NO NO CALL COPY$INTSRESULT TO PUT OPERATION RESULT INFORMATION INTO THE Doca AESET OPERATION$IN$PROGRESS SET OPERATlON$COMPLETE CALL COPYSINT$RESULT TO PUT OPERATION RESULT INFOAMATION INTO THE DOC a RESET GLOBAL$DRIVESNO 6-607 207885-001 82062 82062 WINCHESTER DISK CONTROLLER • Controls ST506/ST412 Interface Winchester Drives • Multiple Sector Transfer Capability • 5 MBit/Sec Transfer Rate • Implied Seek With Read/Write Commands • 128, 256, 512, and 1024 Byte Sector Lengths • 7 Byte Sector Length Extension For External Error Correction Code • Six High-Level Commands: Restore, Seek, Read Sector, Write Sector, Scan .10, and Write Format • Single +5 Volt Power Supply The 820S2 Winchester Disk Controller (WDC) device interfaces microprocessor systems to Winchester Disks that use theSeagate Technology ST50S/ST412 interface. Examples include the Seagate ST50S and ST412, Shugart SA604 and SASOS, Tandon SOO, and Computer Memories CM520S and CM5412. The device translates parallel data from the microprocessor to a 5 mbitisec, MFM-encoded serial bit stream. It provides all of the drive control logic and, in addition, control signals which simplify the design of an external phase locked loop and write precompensation circuitry. The 820S2 is designed to interface to the host controller through an external sector buffer. TASK. STATUS, DATA REGISTERS DATA 080-7 vee BUS RD CLOCK BUFFER RD GATE WR DATA RD OATA EARLY WRITE _ENCODE CONT1lOL BORO LATE Rwe RESET CRUN RWe se WR CLOCK INTRQ RD DATA READ AO-2 CONT1lOL AM DETECT MFM DECODE liD ViR Os WR FAULT INDEX DRDY . . . . . - - RDCLOCK STEP WR GATE BROY Bes RD GATE ORUN BUFFER CONTROL STEP BcR WRGATE DlR BORO DRIVE INTERFACE Vcc---+ CONTROL vss---...· LATE DRDY -WR DATA WR FAULT TRACK 000 INDEX se Figure 1. Figure 2. 82062 Block Diagram S-S08 Pin Configuration ORDER NUMBER 210446-005 82062 Table 1. Pin Description Symbol Pin No. Type Name and Function BGS 1 0 Buffer Chip Select: Output used to enable reading or writing of the external sector buffer by t~8206~hen low, the host should not able to drive the 82062 data bus, RD, or WR lines. BGR 2 0 Buffer Counter Reset: Output that is strobed by the 82062 prior to read/write operation. This pin is strobed whenever BGS changes state. Used to reset the address counter of the buffer memory. INTRQ 3 0 Interrupt Request: Interrupt generated by the 82062 upon command termination. It is reset when any register is read. Optionally signifies when a data transfer is required on Read Sector commands. N/G 4 RESET 5 I Reset: Initializes the controller and clears all status flags. Does not clear the Task Registers. No connection. Reserved for future use. RD 6 I/O Read: As an input, RD controls the transfer of information from the 82062 registers to the host. RD is an output when the 82062 is reading data from the sector buffer (BGS low). WR 7 I/O Write: As an input, WR controls the transfer of command or task information into the 82062 registers. WR is an output when the 82062 is writing data to the sector buffer (BGS low). GS 8 I Chip Select: Enables RD and WR as inputs for access to the Task Registers. It has no effect once a disk command starts .. Ao-A2 9-11 I Address: Used to select a register from the task register file. DBo-DB7 12-19 I/O Data Bus: Bidirectional8-bit Data Bus with control determined by BGS. When BGS is high the microprocessor has full control of the data bus for reading and writing the Task Registers. When BGS is low the 82062 controls the data bus to transfer data to or from the buffer. GND 20 WR DATA 21 0 Write Data: Open drain output that shifts out MFM data at a rate determined by Write Glock. Requires an external flip-flop clocked at 10 MHz. See note 1. LATE 22 0 Late: Open drain output used to derive a delay value for write precompensation. Valid when WR GATE is high. Active on all cylinders. See note 1. EARLY 23 0 Early: Open drain output used to derive a delay value for write precompensation. Valid when WR GATE is high. Active on all cylinders. See note 1. WR GATE 24 0 Write Gate: High when write data is valid. WR GATE goes low iftheWR FAULT input is active. This output is used by the drive to enable head write current. WR GLOGK 25 I Write Clock: Glock input used to derive the write data rate. Frequency - 5MHz for the ST506 interface. 4.34MHz for the SA 1000 interface. See note 2. DIR 26 0 Direction: High level on this output tells the drive to move the head inward (increasing cylinder number). The state of this signal is determined by the 82062's internal comparison of actual cylinder location vs desired cylinder. STEP 27 0 Step: Provides 8.4 microsecond pulses to move the drive head to another -. cylinder at a programmable frequency. DRDY 28 I Drive Ready: If DRDY from the drive goes low, the command will be terminated. Ground 6-609 210446-005 inter 82062 Table 1. Pin Description (continued) Symbol Pin No. "TYpe Name and Function Index: Signal from the drive indicating the beginning of a track. It is used by the 82062 during formatting, and for counting retries. Index is edge triggered. Only the rising edge is valid. Write Fault: An error input to the 82062 which indicates a fault condition at the drive. If WR FAULT from the drive goes high, the command will be terminated. Track Zero: Signal from the drive which indicates that the head is at the outermost cylinder. Used by the Restore command. Seek Complete: Signal from the drive indicating to the 82062 that the drive head has settled and that reads or writes can be made. SC is edge triggered. Only the rising edge is valid. INDEX 29 I WR FAULT 30 I TRACK 000 31 I SC 32 I RWC 33 0 Reduced Write Current: Signal goes high for all cylinder numbers above the value programmed in the Write Precomp Cylinder register. It is used by the precompensation logic and by the drive to reduce the effects of bit shifting. DRUN 34 I BRDY 35 I BDRQ 36 0 Data Run: This signal informs the 82062 when a field of ones or zeroes has been detected in the read data stream by an external one-shot. This indicates the beginning of an I D field. RD GATE is brought high when DRUN is sampled high for 16 clock periods. See note 2. Buffer Ready: Input used to signal the controller that the buffer is ready for reading (full), or writing (empty), by the host up. Only the rising edge indicates the condition. Buffer Data Request: Activated during Read or Write commands when a data transfer between the host and the 82062's sector buffer is required. Typically used as a DMA request line, or to generate an interrupt. RD DATA 37 I Read Data: Single ended input that accepts MFM data from the drive. See note 2. RD GATE 38 0 RD CLOCK 39 I Read Gate: Output that is high for data anq ID fields. Goes active when DRUN has been high for 16 WR CLOCK periods to permit the external phase lock loop to lock onto the incoming disk data stream. Read Clock: Clock input derived from the external data recovery circuits. See note 2. Vee 40 I D.C. Power: +5V Note 1: This pin requires a pull-up resistor to function properly. A value of 1000 ohms will work satisfactorily. Note 2: This pin requires input levels that are not TTL compatible. These lines can be interfaced to TTL with a pull-up resistor. Too small of a resistor will produce a VIL level that is too high. Too large of a resistor will degrade the signal's rise time. A minimum value for the resistor is determined as follows: (Vee max) - (82062 VIL max) (TTL 10L min) - (82062 IlL max) This would typically be: 5.25V - 0.5V 3kO 1.6 mA - 10 tJA 6-610 210446-005 82062 FUNCTIONAL DESCRIPTION INTERNAL ARCHITECTURE The Intel 82062 Winchester Disk Controller (WDC) integrates much of the logic needed to implement Winchester Disk controller subsystems. It provides MFM-encoded data and all the control lines required by hard disks using the Seagate Technology STS06 or Shugart Associates SAlaOO interface standard. Currently, most S'14 inch and mar:ty8 inch Winchester Drives use this interface. The internal architecture of the 82062 WDC is shown in more detail in Figure 4. The major functional blocks are: PLA Controller The PLA interprets commands and provides all control functions. It is synchronized with WR CLOCK. Due to the higher data rates required by these drives-1 byte every 1.6 usec-the 82062 is designed to interface with the host CPU or I/O controller through an external buffer RAM. The 82062 WDC has four pins that minimize the logic required to design a buffer interface. Magnitude Comparator A 1Q-bit magnitude comparator is used to calculate the direction and number of step pulses needed to move the head from the present to the desired cylinder. Figure 3 shows a block diagram of an 82062 subsystem. The WDC is controlled by the host CPU through six commands: CRC Logic Restore Seek Read Sector Write Sector Scan 10 Write Format Generates and checks the cyclic redundancy check characters appended to the 10 and data fields. The polynomial used is: X16 + X12 + X5 + 1. MFM Encode/Decode These commands use information stored by six task registers. Command execution starts immediately after the command register is loaded-therefore commands require only one byte from the CPU after the WDC has been initialized. Encodes and decodes MFM data to be written/read from the drive. The MFM encoder operates from WR CLOCK, a clock having a frequency equivalent to the bit rate. The MFM decoder operates from RD CLOCK, a bit rate clock generated from the external data separator. RD CLOCK and WR CLOCK need not be synchronized. The 82062 adds all the required track formatting to the data field, including two bytes of CRC. Optionally, these two bytes can be replaced by seven bytes of ECC information for external error correction. 1-------------jBORQ RD CLOCK 1-------------jINTRQ RDOATA EARLY, Rwe LATE 1-_ _ _ _ _--1 ~=====::::l I- 82062 woe WR DATA 10 MHZ DRIVE CONTROL Figure 3. System Block Diagram 6-611 210446-005 inter 82062 080-7 WR DATA WR CLOCK , .. AD f i WR I AO-2 RO CLOCK HOST IFC INTRa REsET cs RD DATA PLA CONTROLLER STEP m ------ BROV DIR 1-.---"1L...._ _ _ _ _...... EARI'1 LATE BORa DROY iiCS WR FAULT· TRACK 000 INDEX GNO SC ------+- RWC WR GATE RD GATE '--_.J-~ Figure 4_ DR UN 82062 Detailed Block Diagram AM Detect The address mark detector checks the incoming data stream for a unique missing clock pattern (Data = A1 H, Clock = OAH) used in each 10 and data field. Host/Buffer Interface Control The Host/Buffer IFC logic contains all of the necessarycircuitryto communicate with the 8-bit bus from the host processor. Drive Interface Control The Drive IFC logic controls and monitors all lines from the drive, with the exception of read and write data. DRIVE INTERFACE The buffer/receivers condition the control lines to be driven down the cable to the drive. The control lines are typically single-ended, resistor terminated TTL levels. The data lines to and from the drive also require buffering, but are differential RS-422 levels. The interface specification to the drive can be found in the manufacturers' OEM manual. The WDC supplies T:rL compatible signals, and will interface to most buffer/driver devices. The data recovery circuits consist of a phase-lock loop data separator and associated components. The 82062 WDC interacts with the data separator thru the DATA RUN (DRUN) and RD GATE signals. A block diagram of a typical data separator circuit is shown in Figure 6. Read data from the drive is presented to the RD DATA input of the WDC, the reference multiplexor, and a retriggerable one-shot. The RD GATE (Pin 38) output will be low when the WDC is not inspecting data. The PLL at this time should remain locked to the reference clock. The drive side of the 82062 WDC requires three sections of external logic. These are buffer/receivers, data separator, and write precompensation. Figure 5 illustrates a drive side interface. 6-612 210446-005 82062 ,X DATA RATE WRITE DATA EARLY WAITE PRECOMP LATE WINCHESTER DRIVE 0 Rwe WRITE DATA READ DATA READ DATA PHASE LOCK READ CLOCK ORUN DRIVE SEL LOOP READ GATE STEP TO NEXT DRIVE 82062 woe DATA RATE WR CLOCK DIRECTION READY ose WRITE FAULT sc TRACK 000 INDEX INDEX TKOQO seEK COMPLETE DADY Rwe WR FAULT HEAD NUMBER OIR WRITE GATE WR GATE STEP DATA BUS DAISY CHAIN TO NEXT DRIVE a ADDRESS (HOLDS DRIVE AND HEAD SELECTS) DATA LATCH Figure 5. Drive Interface AETAIGGEAABLE ONE-SHOT MFM DISK DATA ~------------------------~~DRUN >------"""~----------------------------------------------------------~~ AD DATA 82062 A MUX r----------t~ B t-------....----------+I 1-011--''----------------------------------------...; t-------------__ AD CLOCK AD GATE ~WACLOCK Figure 6. Data Recovery Circuit 6-613 210446-005 inter 82062 When any Read/Write command is initiated and a search for address mark begins, the DRUN input is examined. The DRUN one-shot is set for slightly greater than one bit time, allowing it to retrigger constantly on a field of ones and zeros. An internal counter times out to see that DRUN is high for2 byte times. RD GATE is set by the WDC, switching the data separator to lock onto the incoming data stream. If DRUN falls prior to an additional 7 byte times, RD GATE is lowered and the process is repeated. RD GATE will remain active high until a non-zero, non-address mark byte is detected. It will then lower RD GATE for two byte times (to allow the PLL to lock back on to the reference clock), and start the DRUN search again. If an address mark is detected, RD GATE will be held high and the command will continue searching for the proper 10 field. This sequence is shown in the flow chart in Figure 7. SET RD GATE HIGH The write precompensation logic is controlled by the signals REDUCE WRITE CURRENT (RWC), . EARLY and LATE. The cylinder in which the RWC line becomes active is controlled by the REDUCE WRITE CURRENT register in the Task Register File. It can be used to turn on the precomp circuitry on a predetermined cylinder. If the REDUCE WRITE CURRENT register contents are FFH, then RWC will always be low. RESET RD GATE The signals EARLY and LATE are used to tell the precomp circuitry how much delay is required on the WR DATA pulse about to be sent. The amount of delay is determined externally through a digital delay line or equivalent circuitry. Since the EARLY signal occurs after the fact, WR DATA should be delayed by one interval when both EARLY and LATE are deasserted, two intervals when LATE is asserted, and no delay when EARLY is asserted. An interval is, for example, 12-15 ns. for the ST506 interface. EARLY or LATE will be active slightly ahead of the WR DATA pulse. EARLY and LATE will never be asserted at the same time. EARLY and LATE are always active, and should be gated externally by the RWC signal. HOST PROCESSOR INTERFACE The primary interface between the host processor and the 82062 WDC is through an 8-bit bi-directional data bus. This bus is used to transmit/receive data to both the WDC and a sector buffer. The sector buffer is constructed with either FIFO memory, or static RAM and a counter. Since the WDC will use the data bus when accessing the sector buffer, a transceiver must be used to isolate the host during this time. Figure 8 shows a typical connection to a sector buffer implemented with RAM memory. Whenever the WDC is not using the sector buffer, The BUFFER CHIPSELECT (BCS) is high (disabled). Thisallows the host to access the WDC's Task Register File, and Figure 7. 6-614 PLL Control Sequence 210446-005 82062 When the WDC is done using the buffer, it disables BCS which again allows the host to access the local bus. The READ SECTOR command operates in a similar manner, except the buffer is loaded by the WDC instead of the host processor. to set up parameters prior to issuing a command. It also allows the host to access the RAM buffer. A decoder is used to generate a chip select when AO-2 is '000', an unused address in the WDC. A binary counter is enabled whenever RD or WR go active and is incremented on the trailing edge of the chip select. This allows the host to access sequential bytes within the RAM. The decoder also generates another chip select when AO-2 does not equal '000', allowing access to the WDC's internal registers while keeping the RAM tri-stated. Another control signal called BUFFER DATA REQUEST (BDRQ, not used in Figure 8) is a DMA signal that can inform a DMA controller when the 82062 WDC is requesting data. For further explanation, refer to the individual command descriptions and the A.C. Characteristics. In a READ SECTOR command, interrupts are generated at the termination of the command. An interrupt may be specified to occur either at the end of the command, or when BDRQ is activated. The INTERRUPT line (INTRQ) is cleared either by reading the STATUS register, or by writing a new command in the COMMAND register. During a WRITE SECTOR command, the host processor sets up data in the Task Register File and then issues the command. It then generates a status to inform the host that it may load the buffer with the data to be written. When the counter reaches its maximum count, the BUFFER READY (BRDY) signal is made active (by the "carry" out of the counter), informing the WDC that the buffer is full. (BRDY is a rising edge triggered signal which will be ignored if activated before the WDC issues BCR). BCS is then made active, disconnecting the host through the transceivers, and the RD and WR lines become outputs from the WDC to allow it to access the buffer. AD WR DATA : 4-11 RO WR ~ • =RC}+ I I I =c RO CK Q I I I I HOST CPU SYSTEM DATA ADDR TC -,-- -------- WR DATA CS ---=Q--- jG==] ADDRESS BCR I I I f-- I I I I I 82062 BCS BRDY Os 3 AO·A2 INTERRUPT INTRa RESET RESET LM ..... ..... STB ~ Figure 8. 01 DRIVE HEAD SELECT LATCH CPU Buffer Interface 6-615 210446-005 82062 TASK REGISTER FILE Bit 3 - Reserved Not used. The Task Register File is a bank of registers used to hold parameter information pertaining to each command. These registers and their addresses are: Forced to zero. A2 A1 AO READ WRITE 0 0 0 (Bus TricStated) (Bus Tri-Stated) 0 0 1 Error Flags Reduce Write Curren 0 1 0 Sector Count . Sector Count 0 1 1 Sector Number Sector Number 1 0 0 Cylinder Low Cylinder Low 1 0 1 Cylinder High Cylinder High 1 1 0 SDH SDH 1 1 1 Status Register Command Register Bit 2 - Aborted Command This bit is set if a command was issued while DRDY (Pin 28) is deasserted or WR FAULT (Pin 30) is asserted. The Aborted Command bit will also be set if an undefined command is written into the COMMAND register, but an implied seek will be executed. Bit 1 - TRACK 000 NOTE: Registers are not cleared by RESET. This bit is set only by the RESTORE command. It indicates that TRACK 000 (Pin 31) has not gone active after the issuance of 1024 stepping pulses. ERROR REGISTER Bit 0 - Data Address Mark This read-only register contains specific error status after the completion of a command. The bits are defined as follows: This bit is set during a READ SECTOR command if the Data Address Mark is not found after the proper Sector ID is read. REDUCE WRITE CURRENT REGISTER 7 654 IBBDICRC 3 1- 1 2 o ID This register is used to define the cylinder number where RWC (Pin 33) is asserted: 7 Bit 7 - Bad Block Detect This bit is set when an ID field has been encountered that contains a bad block mark. It is used for bad sector mapping. Bit 6 - CRC Data Field This bit is set when a data field CRC error has ocurred. The sector buffer may still be read but will contain errors. Bit 5 - Reserved Not used. The value (0-255) loaded into this register is internally multiplied by 4 to specify the actual cylinder where RWC is asserted. Thus a value of 01H will cause RWC to activate on cylinder 4, 02H on cylinder 8, and so on. RWC switching points are then 0,4,8, ... 1020. RWC will be asserted when the present cylinder is greater than or equal to the cylinder indicated by this register. For example, the ST506 interface requires precomp on cylinder 128 (80H) and above. Therefore, the REDUCE WRITE CURRENT register should be loaded with 32 (20H). A value of FFH will make RWC stay low, regardless of the actual ,cylinder number. Forced to zero. Bit 4 - IDNot Found This bit is set when the desired cylinder, head, sector, or size parameter cannot be found after 8 revolutions of the disk, or if an ID field CRC error has occured. 6-616 210446-005 82062 SECTOR COUNT REGISTER CYLINDER NUMBER LOW REGISTER This register is used to define the number of sectors that need to be transfered to the buffer during a READ MULTIPLE SECTOR or WRITE MULTIPLE SECTOR command.: This register holds the lower byte of the desired cylinder number: 76543210 ; LS 7 6 5 4 3 o 2 CYLINDER NUMBER HIGH REGISTER This register holds the two most significant bits of the desired cylinder number: SECTOR NUMBER This register holds the sector number of the desi red sector: 6 5 3 4 For a multiple sector command, it specifies the first sector to transferred. It is incremented after each sector is transferred to/from the sector buffer. The SECTOR NUMBER register may contain any value from 0 to 255. The SECTOR NUMBER register is also used to program the Gap 1 and Gap 3 lengths to be used when formatting a disk. See the WRITE FORMAT Command description for further explanation. 7 5 6 L S:IZE DRIVE I , I 3 4 I I \ 6 5 4 3 2 x x x x x (9) (8) The SOH register contains the desired sector size, drive number, and head number parameters. The format is diagramed below. o 2 :HEAD ~=t ........ ::::::::............ ... \ o SECTOR/DRIVE/HEAD REGISTER ____ ---------- ---------- '~~~" \ \ l 7 x Internal to the 82062 WDC is another pair of registers that hold the actual position where the R/W heads are located. The CYLINDER NUMBER HIGH and LOW registers can be considered the cylinder destination for seeks and other commands. After these commands are executed, the internal cylinder position registers' contents are equal to the cylinder high/low registers. If a drive number change is detected on a new command, the WDC automatically reads an 10 field to update its internal cylinder position registers. This affects all commands except a RESTORE. o 2 : It is used in conjunction with the CYLINDER NUMBER HIGH register to specify a range of 0 to 1023. The value contained in the register is decremented after each sector is transferred to/from the sector buffer. A zero represents a 256 sector transfer, a one a 1 sector transfer, etc. This register is a "don't care" when single sector commands are specified. 7 B~TE ~F CY~INDE~ NU~BER ... ...... 6 5 SECTOR SIZE 4 3 DRIVE # 2 1 0 HEAD # 0 0 1 1 0 1 0 1 256 512 1024 128 0 0 1 1 0 1 0 1 DSEL1 DSEL2 DSEL3 DSEL4 0 0 0 0 0 0 1 1 1 0 0 0 1 0 1 HSELO HSEL1 HSEL2 HSEL3 HSEL4 HSEL5 HSEL6 HSEL7 0 1 1 1 1 6-617 1 1 1 0 - 210446-005 inter 82062 080 OB1 DB' BUS 083 TRANSCEIVER C~~~OB4 OB5 DB. OB7 Wrl>------,. AO A1 >---,-_ _ >--f':>o---...J OBOl Q1 091 A 02 092 T 03 HSELO HSEl1 C04 L-_--. L===tDB3 084 H as 0 ~_ HSEL2 82062 OSEL 1 OSEL2 E A' Co ~>--.....:;.--..J DSELJ DSEL4 o E Figure 9. Drive/Head Select Logic Both head number and sector size are compared against the disks' ID field. Head select and drive select lines are not available as outputs from the 82062 WDC and must be generated externally. Figure 9 shows a possible logic implementation of these select lines. Bit 7, the extension bit (EXT), is used to extend the data field by seven bytes when using ECC codes. When EXT =1, the CRC is not appended to the end of the data field, the data field becomes "sector size + 7" bytes long. The CRC is checked on the ID field regardless of the state of EXT. Note that the sector size bits (SIZE) are written to the ID field during a formatting command. The SDH byte written into the ID field is different than the SDH Register contents. The recorded SDH byte does not have the drive number (DRIVE) written but does have the BAD BLOCK mark written. The format is: 7 6 5 4 3 2 o 7 I 5 4 WF SC 6 BUSyl READY I 3 I ORO o 2 CIP I ERROR\ Bit 7 - Busy This bit is set whenever the 82062 WDC is accessing the disk. Commands should not be loaded into the COMMAND register while Busy is set. Busy is set when a command is written into the WDC and is cleared at the end of all commands except READ SECTOR. While executing a READ SECTOR command, Busy is cleared after the sector buffer has been filled. When the Busy bit is set, no other bits in either the STATUS or any other registers are valid. Bit 6 - Ready This bit reflects the state of the DRDY (Pin 28) line. o Bit 5 - Write Fault Note that use of the extension bit requires the gap lengths to be modified as described in the WRITE FORMAT command description. STATUS REGISTER This bit reflects the state of the WR FAULT (Pin 30) line. Whenever WR FAULT goes high, an interrupt will be generated. Bit 4 - Seek Complete The status register is a read-only register which informs the host of certainev~nts performed by the 82062 WDC as well as reporting status from the drive control lines. The INTRQ line will be reset when the status register is read. The format is: This bit reflects the state of the SC (Pin 32) line. Commands which initiate a seek will pause until Seek Complete is set. 6-618 210446-005 82062 INSTRUCTION SET Bit 3 - Data Request The 82062 WDC instruction set contains six commands. Prior to loading the command register, the host processor must first set up the Task Register File with the information needed for the command. Except for the COMMAND register, the registers may be loaded in any order. If a command is in progress, a subsequent write to the COMMAND register will be ignored until execution of the current command is completed as indicated by the command in progress bit in the STATUS register being cleared The Data request bit (ORO) reflects the state of the BDRO (Pin 36) line. It is set when the sector buffer should be loaded with data or read by the host processor, depending upon the command. The ORO bit and the BDRO line remain high until BRDY is sensed, indicating the operation is completed. BDRO can be used in DMA interfacing, while ORO can be used for programmed I/O transfers. Bit 2 - Reserved Not Used. Forced to zero. Bit 1 - Command in Progress When this bit is set, a command is being executed and a new command should not be loaded until it is cleared. Although a command may be executing, the sector buffer is still available for access by the host processor. Only the STATUS register may be read. If other registers are read, the STATUS register contents will be returned. This bit is set whenever any bits in the ERROR register are set. It is the logical 'or' of the bits in the error register and may be used by the host processor to quickly check for successful completion of a command. This bit is reset when a new command is written into the COMMAND register. COMMAND REGISTER This write-only register is loaded with the desired command: 6 7 6 5 4 0 0 0 0 0 0 R3_0 = Bit 0 - Error 7 COMMAND RESTORE SEEK READ SECTOR WRITE SECTOR SCAN 10 WRITE FORMAT 5 4 3 2 1 o The command begins to execute immediately upon loading. This register should not be loaded while the Busy or Command in Progress bits are set in the STATUS register. The INTRO line (Pin 3), if set, will be cleared by a write to the COMMAND register. 0 1 0 0 1 1 0 1 1 1 0 0 3 2 1 1 R3 1 R3 0 I 1 0 0 0 1 0 R2 R2 M M 0 0 R1 R1 0 0 0 0 0 RO RO T T T 0 Rate Field For 5 MHz WR CLOCK: R3-0 = 0000 - =35 0001 0.5 0010 1.0 0011 1.5 0100 2.0 0101 2.5 0110 3.0 0111 3.5 1000 4.0 1001 4.5 1010 5.0 1011 5.5 1100 6.0 1101. 6.5 1110 7.0 1111 7.5 - T = us ms ms ms ms ms ms ms ms ms ms ms ms ms ms ms Retry Enable T= 0 T= 1 Enable Retries Disable Retries M= Multiple Sector Flag M= 0 M= 1 Transfer 1 Sector Transfer Multiple Sectors Interrupt Enable 0 1 6-619 Interrupt at BDRQ time Interrupt at end of command 210446-005 82062 RESTORE COMMAND The RESTORE command is usually used on a power-up comdition. The actual stepping rate used for the RESTORE is determined by the Seek Complete time. A step pulse is issued and the 82062 WDC waits for a rising edge on the Seek Complete (SC) line before issuing the next pulse. If 10 index pulses are received without a rising edge of SC, the 82062 will switch to sensing the level of the SC line. If after 1,024 stepping pulses the TRACK 000 line does not go active, the WDC will set the TRACKOOO bit in the ERROR register and terminate with an INTRQ. An interrupt will also occur if WR FAULT goes active or DRDY goes inactive at any time during execution. NUMBER LOW/HIGH register pair against the internal cylinder position register to see if they are equal. If not, the direction and number of steps calculation is performed and a seek takes place. If an implied seek was performed, the WDC will search until a rising edge of SC is received. The WR FAULT and DRDY lines are monitored throughout the command. The rate field specified R3- o is stored in an internal register for future use in commands with implied seeks. A flowchart of the RESTORE command is shown in Figure 10. RESET INTRa. ERRORS. seT BUSY, CIP RESET Rwe seT DIRECTION OUT STORE STEP RATE SEEK COMMAND PULSE Since all commands except the SCAN ID command feature an implied seek, the SEEK command can be used for overlap seek operations oil multiple drives. The actual stepping rate used is taken from the Rate Field of the command, and is stored in an internal register for future use. If DRDY goes inactive or WR FAULT goes active at any time during the seek, the command is terminated and an INTRQ is generated. iiCR SET INTRa RESET BUSV.CIP The direction and number of step pulses needed is calculated by comparing the contents of the CYLINDER NUMBER LOW/HIGH register pair to the internal cylinder position register. After all steps have been issued, the internal cylinder position register is updated and the command is terminated. The Seek Complete (SC) line is not checked at the beginning or end of the command. If an implied seek was performed, the 82062 will search until a rising edge of SC is received. If 10 index pulses are received without a rising edge of SC, the 82062 will switch to sensing the I.evel of the SC line.. A flowchart of the SEEK command is shown in Figure 11. ISSUE A STEP PULSE PULSE iCii SETINTRQ RESET BUSY,CIP READ SECTOR The READ SECTOR command is used to transfer one or more sectors of data from the disk to the sector buffer. Upon receipt of the READ SECTOR command, the 82062 WDC checks the CYLINDER 6-620 Figure 10. Restore Command Flow 210446-005 82062 When the Seek Complete (SC) line is high (with or without an implied seek having occured), the search for an ID field begins. If T = 0 (retries enabled), the 82062 WDC must find an ID with the correct cylinder number, head, sector size and CRC within 10 revolutions, or an automatic scan ID will be performed to obtain cylinder position information, and then a seek performed (if necessary). The search for the proper I D will be retried for up to 10 revolutions. If the correct sector is still not found, the appropriate error bits will be set and the command terminated. Data CRC errors will also be retried for up to 10 revolutions (if T = 0). 1fT =1 (retries disabled), the I D search must find the correct sector within 2 revolutions or the appropriate error bits will be set and the command terminated. Both the READ SECTOR and WRITE SECTOR commandsfeaturea "simulated completion"toease programming. DRO/BDRO will be generated upon detecting an error condition. This allows the same program flow for successful or unsuccessful completion of a command. When the data address mark is found, the WDC is ready to transfer data to the sector buffer. After the data has been transferred, the I bit is checked. If 1= 0, INTRO is made active coincident with BDRO, indicating that a transfer of data from the buffer to the host processor is required. If I =1, INTRO will occur at the end of the command, i.e. after the bufferis unloaded by the host. An optional M bit may be set for multiple sector transfers. When M =0, one sector is transferred and the SECTOR COUNT register is ignored. When M = 1, multiple sectors are transferred. After each sector is transferred the 82062 decrements the SECTOR COUNT register and increments the SECTOR NUMBER register. The next logical sector will be transferred regardless of any interleave. Sectors are numbered at format time by a byte in the ID field. For the 82062 to make multiple sector transfers to the buffer, the BRDY line must betoggled lowto high for each sector. Transfers will continue until the SECTOR COUNT register equals zero, orthe BRDY line goes active. If the SECTOR COUNT register is nonzero (indicating more sectors are to be transferred but the buifer is full), BDRO will be made active and the host must unload the buffer. After this occurs, the buffer will again be free to accept the remaining sectors from the WDC. This scheme enables the user to transfer more sectors than the buffer memory has capacity for. In summary then, READ SECTOR operation is as follows: 6-621 Figure 11. Seek Command Flow 210446-005 82062 cylinder number, head, and sector size is searched for. Once found, WR GATE is made active and the data is written to the disk. It is necessary to resynchronize the write data since a bit cell can extend from 295 nS to 315 nS during a write cycle. If retries are enabled(T = 0), and if the 10 field cannot be found within 10 revolutions, automatic scan ID and seek commands are performed. The ID Not Found error bit is set and the command is terminated if the correct 10 field is not found within 10additional revolutions. If retries are disabled, (T =1), and if the 10 field cannot be found within 2 revolutions, the ID Not Found error bit isset and the command is terminated. When M = 0 (READ SECTOR) (1) Host: (2) (3) 82062: 82062: ( ( ( ( ( 4) 5) 6) 7) 8) 82062: 82062: 82062 Host: 82062: (9) (10) 82062: Host: Sets up parameters; issues READ SECTOR command. Strobes BCR; sets BCS = O. Finds sector specified; transfers data to buffer. Strobes BCR; sets BCS = 1. SetsBDRO = 1, ORO = 1. If I bit = 1 then go to (9). Reads contents of sector buffer. Waits for BRDY, then sets INTRO = 1; END. Sets INTRO = 1. Reads out contents of buffer; END. During a WRITE MULTIPLE SECTOR command (M = 1), the SECTOR NUMBER register is incremented and the SECTOR COUNT register is decremented. If the BRDY line is asserted after the first sector is transferred from the buffer, the 82062 will transfer the next sector. If BRDY is deasserted, the 82062 will set BDRO and wait for the host processor to place more data in the buffer. In summary then, the WRITE SECTOR operation is as follows: When M = 1 (READ MULTIPLE SECTOR) ( 1) Host: ( 2) ( 3) 82062: 82062: ( 4) 82062: ( 5) ( 8) 82062: 82062: Host: Buffer: ( 9) 82062: (10) (11) 82062: 82062: ( 6) ( 7) Sets up parameters; issues READ SECTOR command. Strobes BCR; sets BCS =O. Finds sector specified; transfers data to buffer. Decrements SECTOR COUNT register; increments SECTOR NUMBER register. Strobes BCR; sets BCS = 1. Sets BDRO =1, ORO = 1. Reads out contents of buffer; Indicates data has been transferred by activating BRDY. When BRDY =1, if Sector Count =0, then go to (11). Go to (2). Set INTRO =1; END. When M = 0,1 (WRITE SECTOR) A flowchart of the READ SECTOR command is shown in Figure 12. WRITE SECTOR The WRITE SECTOR command is used to write one or more sectors of data to the disk from the sector buffer. Upon receipt of WRITE SECTOR command the 82062 WDC checks the CYLINDER NUMBER LO~(HIGH ~egister pair against the internal cylinder position register to see if they are equal. If not the direction and number of steps calculation is 'performed and a seek takes place. The WR FAULT and DRDY lines are checked throughout the command. When the Seek Complete (SC) line is found to be true (with or without an implied seek having occured), the BDRO signal is made active and the host proceeds to load the buffer. When the 82062 senses BRDY going high, the 10 field with the specified ( 1) Host: ( 2) 82062: ( 3) ( 4) ( 5) Host: 82062: 82062: ( 6) 82062: ( 7) 82062 ( 8) 82062 ( 9) 82062 Sets up parameters; issues WRITE SECTOR command. Sets BDRO = 1, ORO =1. Loads sector buffer with data. Waits for BRDY =low to high. Finds specified 10 field; writes sector to disk. If M =0, then set INTRO = 1; END .. Increment SECTOR NUMBER register; decrement SECTOR COUNT register. If SECTOR =0, then set INTRO = 1; END. Go to (2). A flowchart of the WRITE SECTOR command is shown in Figure 13. SCANID The SCAN 10 command is used to update the SECTOR/DRIVE/HEAD, SECTOR NUMBER, and CYLINDER NUMBER LOW/HIGH registers. After the command is loaded, the Seek Complete (SC) line is sampled until it is valid. The DRDY and WR FAULT lines are also monitored throughout execution of the command When the first 10 field is 6-622 210446-005 inter 82062 RESET INTRa ERRORS SET BUSY, CIP SEARCH FOR 10 FIELD NOTE· I I I I I PULSE= SET INTRa, AC RESET BUSY, Clp, Bes *It T bit at command = 1 then dashed path Is taken after 2 index pUlses. Figure 12A. Read Sector Command Flow 6-623 210446-005 82062 "If T bit 01 command uif T bit of command Figure 128. = 1 then dashed path II taken. = 1 then lest I, tor 2 Index pulse •. Read Sector Command Flow 6-624 210446-005, 82062 >--..-----, I *11 retries disabled then dashed path Is taken atler 2 Index pulses, Figure 13. Write Sector Command Flow 6-625 210446-005 82062 found, the 10 information is loaded into the SOH, SECTOR NUMBER, and CYLINDER NUMBER registers. The internal cylinder position register is also updated. If a bad block is detected, the BAD BLOCK bit will also be set. The CRC is checked and if an error is found, the 82062 will retry up to 10 revolutions to find an error-free 10 field. There is no implied seek with this command and the sector buffer is not disturbed. A flowchart of the SCAN 10 command is shown in Figure 14. WRITE FORMAT The WRITE FORMAT command is used to format one track using the Task Register File and the sector buffer. During execution of this command, the sector buffer is used for additional parameter information instead of sector data. Shown in Figure 15 is the contents of the sector buffer for a 32 sector track format with an interleave factor of two. Each sector requires a two byte sequence. The first byte designates whether a bad block mark is to be recorded in the sector's 10 field. An OOH is normal; an 80H indicates a bad block mark for that sector. In the example of Figure 15, sector 04 will get a bad block mark recorded. The second byte indicates the logical sector number to be recorded. This allows sectors to be recorded with any interleave factor desired. The remaining memory in the sector buffer may be filled with any value; its only purpose is to generate a BRDY to tell the 82062 to begin formatting the track. An implied seek is in effect on this command. As for other commands, if the drive number has been changed, an 10 field will be scanned for cylinder position information before the implied seek is performed. If no 10 field can be read (because the track had been erased or because an incomplete format had been been used), an 10 Not Found error will result and the WRITE FORMAT command will be aborted. This can be avoided by issuing a RESTORE command before formatting. *11 retries are disabled. path is taken after 2 Index pulses. The SECTOR COUNT register is used to hold the total number of sectors to be formatted (FFH = 255 sectors), while the SECTOR NUMBER register holds the numberof bytes minus three to be used for Gap 1 and Gap 3; for instance, if the SECTOR COUNT register value is 02H and the SECTOR NUMBER register value is OOH, then 2 sectors are written and 3 bytes of 4EH are written for Gap 1 and Gap 3. The data fields are filled with FFH and the CRC is automatically generated and appended. The sector extension bit in the SOH register should not be set. After the last sector is written the track is filled with 4EH. Figure 14. 6-626 Scan 10 Command Flow 210446-005 inter 82062 FORMAT COMMAND SECTOR BUFFER CONTENTS SECTOR BUFFER ADDRESS BAD BLOCK? LOCICAL SECTOR NUMBER 00 02 04 06 08 OA DC OE 10 12 14 16 18 1A 1C 1E 20 22 24 26 28 2A 2C 2E 30 32 34 36 38 3A 3C 3E 40 00 00 00 00 00 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF 00 10 01 11 02 12 03 13 04 14 05 1'5 06 16 07 17 08 18 09 19 OA 1A OB 1B DC 1C 00 10 OE 1E OF 1F FF FO FF FF The Gap 3 value is determined by the drive motor speed variation, data sector length, and the interleave factor. The interleave factor is only important when 1:1 interleave is used. The form ula for determining the minimum Gap 3 length value is: Gap 3 = (2 • M • S) + K + E M = motor speed variation (e.g., 0.03 for± 3%) S = sector length in bytes K = 25 for interleave factor of 1 K = 0 for any other interleave factor E = 7 if the sector is to be extended Like all commands, a WR FAULT or drive not ready condition will terminate execution of the WRITE FORMAT command. Figure 16shows the format that the 82062 will write on the disk. A flowchart of the WRITE FORMAT command is shown in Figure 17. Figure 15 DATA FIELD USER DATA WRITEGATE~ 10 FIELD Al '" A1H with OAH clock IDENT = MSB of Cylinder Number FE " O~255 Cylinders FF" 256-51' Cylinders Fe = 512-767 Cylinders FD" 768·1023 Cylinders SOH BYTE :: BI15 " " 2 ~ Head Number Bits 3. 4 0 Bits 5. 6 0 Sector Size Bll 7 = Bad Block Mark Sec # = Logical Sector Number Figure 16. DATA FIELD At = A1H with OAH clock Fa '" Data Address Mark: Normal clock USER = Data Field 128 to 1024 Bytes" NOTES 1 GAP1 and 3 length deterfY1med by sector number register conlents during formatting 2. If EXT bit In SOH register is set to 1 then an additional? data by\esare written no CRG bytes are written Track Formal 6-627 210446-005 82062 C FORMAT ) -------r---'" ~ RESETINTRO ERRORS SET CIP,BUSY ACTIVATE BDRO -SCAN ID GET CYL #: NO YES YES SET ABORTED" COMMAND BIT RESET WR GATE, Bes PULSE~ SET INTRa RESET BUSY CIP Figure 17. Write Format Command Flow 6-628 210446-005 82062 ELECTRICAL CHARACTERISTICS ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias ..• O°C to 70°C Storage Temperature •......... -65°C to +150°C Voltage on any pin with respect to GND ................. -0.5V to +7V Power Dissipation .............•........1.5 Watt • NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functiona I opera tion of the device a t these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. D.C. CHARACTERISTICS (TA =DoC to 70°C; VCC MAX UNIT TEST CONDITIONS SYMBOL PARAMETER IlL Input Leakage Current ±10 JlA VIN IOFL VIH Output Leakage Current ±10 JlA VOUT VIL Input Low Voltage VOH Output High Voltage VOL Output Low Voltage Icc C IN Supply Current Input Capacitance CliO I/O Capacitance VIH Input High Voltage VIL Input Low Voltage 0.5 V TRS Rise Time 30 ns Input High Voltage MIN =+5V ± 10%; GND =OV) =Vee to OV =Vee to 0.45V V 2.0 0.8 2.4 V =-100uA V IOH 0.45 V IOL = 1.6mA 4.8mA P21,22,23 200 mA All Outputs Open 10 pF fc 20 pF Unmeasured pins returned toGND =1 MHz For Pins 25,34,37,39 4.6 V 6-629 10% to 90% points 21044fHlOS 82062 A.C. CHARACTERISTICS (TA = O°C to 70°C; Vee = +5V ± 10%; GND = OV) HOST READ TIMING SYMBOL 1 P"RAMETER Address Stable Before RD! 2 Data Delay From RD! 3 RD Pulse Width MIN MAX UNIT 100 TEST CONDITIONS ns 375 ns 0.4 10 f..lS 20 200 4 RD to Data Floating 5 Address Hold Time after ROt 0 ns ns 6 Read Recovery Time 300 ns 7 es Stable before RD I 0 ns See Note 6 ~-2 ~-CD----------~ ~ --""\. CD 1IIi---------.. D80-7 _____ --<~0 ~,. ..~ f>-CD_ HOST WRITE TIMING SYMBOL 8 9 10 11 12 PARAMETER Address Stable Before WR! es Stable Before WR! MIN MAX UNIT 0 10 f..ls 0 0.2 10 10 f..lS Data Setup Time Before WRt WR Pulse Width 0.2 10 f..ls Data Hold Time After WRt 10 ns 13 Address Hold Time After WRt 30 ns 14 es Hold Time After WRt 0 ns 15 Write Recovery Time 1.0 f..ls TEST CONDITIONS f..ls See Note 7 AO-2=>t=~0'-----:-_ _ _ _ _ _ _--->I ~===7J®~5==~~ cs ® 6-630 210446-005 82062 BUFFER READ TIMING (WRITE SECTOR COMMAND) SYMBOL PARAMETER SCSI to RD Valid MIN 15 TYP 16 MAX 100 UNIT ns 17 RD Output Pulse Width 300 400 500 ns 18 Data Setup to ROt 140 19 Data Hold from ROt 0 20 RD Repetition Rate 21 RD Float from BCSt 1.2 15 TEST CONDITIONS See Note 3 ns ns 1.6 2.0 f.JS 100 ns See Note 1 ~~~----------~,~ Jm--(OUTPUT) ;xxx 080-7 ~-------- ®------~~ BUFFER WRITE TIMING (READ SECTOR COMMAND) SYMBOL PARAMETER 22 SCS I to WR Valid MIN 23 WR Output Pulse Width 24 Data Valid from WRI 300 25 Data Hold from WRt 60 26 . WR Repetition Rate 1.2 27 TYP MAX UNIT 100 ns 500 150 ns 2.0 f.JS 100 ns 15 WR Float from SCSt 400 TEST CONDITIONS See Note 3 ns ns 1.6 15 See Note 1 BCS~~~®_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _~,;-z~@ WR (OUTPUT) 080-7 ® ® -------+<.' DATA VALID I~~~----®---~.~I 6-631 210446-005 82062 MISCEllANEOUS TIMING SYMBOL PARAMETER 28 BDRQ Reset from BRDY 40 MIN TYP MAX UNIT 200 ns TEST CONDITIONS 29 BRDY Pulse Width 800 ns See Note 4 30 BeR Pulse Width 1.4 1.6 1.8 f..I.S See Note 1 31 STEP Pulse Width 8.3 8.4 8.7 f..I.S See Note 1 32 INDEX Pulse Width 500 33 RESET Pulse Width 24 34 RESETt to BCR 1.6 ns WR ClK See Note 2 3.2 6.4 f..I.S See Note 1 35 RESETt to WR, CSI 6.4 36 WR CLOCK Frequency 0.25 5.0 5.25 MHz 50% Duty Cycle 37 RD CLOCK Frequency 0.;!5 5.0 5.25 MHz 50% Duty Cycle See Note 5 BROY BORQ f..I.S See Note 1 ~_(ii)L(ii)~ ___ . ~ STEP---./....-l2!:~ 6-632 210446-005 82062 READ DATA TIMING SYMBOL PARAMETER MAX UNIT 38 RD CLOCK Pulse Width 95 2000 ns 39 RD DATA after RD CLOCK! 0 T38 ns 40 RD DATA before RD CLOCK! 20 T38 ns 41 RD DATA Pulse Width 40 T38 ns 42 DRUN Pulse Width 30 MIN TYP TEST CONDITIONS 50%,Duty Cycle ns CAUN WRITE DATA TIMING SYMBOL PARAMETER 43 WR CLOCK Pulse Width 44A WR CLOCK! to WR DATA! 448 WR CLOCKI to WR DATAl 440 WR CLOCK) to WR DATA! 45A WR CLOCK! to EARLY/LATEI 458 WR CLOCKI to EARLY/LATE, 46A WR CLOCK! to EARLY/LATE! 468 WR CLOCK) to EARLY/LATE! MIN MAX UNIT 95 TYP 2000 ns 10 65 ns TEST CONDITIONS Propogation Delay I 10 65 ns 10 65 ns 6-633 210446-005 82062 ~---I 38 ) - - - . . . . , j WRCLOCK WRDATA A.C. TESTING INPUT, OUTPUT WAVEFORM A.C. TESTING LOAD CIRCUIT INPUT OUTPUT ::.=X:: >"" ~'"" <::x= DEVICE UNDER TEST ~Cl= 50pF ::- AC TESTING: INPUTS ARE DRIVEN AT 2.4V FOR A LOGIC .1, AND 0.4SV FOR A LOGIC .0. TIMING MEASUREMENTS ARE MADE AT 2.0V FOR A LOGIC .1, ANOO.8V FOR A LOGIC .0, Cl INCLUDES JIG CAPACITANCE NOTES: 1. Based on WR CLOCK = 5.0 MHz. 2. 24 WR CLOCK periods = 4.8 f.ls at 5.0 MHz. 3. 2 WR CLOCK periods ± 100 ns. 4. When used with a OMA controller BROY must be> 4 f.ls or a spurious BORQ pulse may exist for up to 4 f.ls after the rising edge of BROY. 5. WR CLOCK Frequency = RO CLOCK Frequency ± 15%. 6. RO may be asserted before CS as long as it remains activeforat leasttheminimum.T3 pulse width afterCS is asserted. 7. WR may be asserted before CS as long as it remains active for at least the minimum T11 pulse width after CS is asserted. 6-634 210446-005 82064 WINCHESTER DISK CONTROLLER WITH ON-CHIP ERROR DETECTION AND CORRECTION • • • • Compatible with all Intel and most other microprocessors Controls ST506/ST412 Interface Winchester Disk Drives 5 Mbit/sec Data Transfer Rate Eight High-Level commands: Restore, Seek, Read Sector, Write Sector, Scan ID, Write Format, Compute Correction, Set Parameter • • • Software Compatible with 82062 High-speed "zero wait state" operation with 8 MHz 80186/188 5 or 11-bit correction - span software • selectable Implied seeks with Read/Write • Commands Sector Transfer Capability • Multiple 128, 256, 512 and 1024 Byte Sector • • Lengths Available in 40-Lead Ceramic Dual InLine, 40-Lead Plastic Dual In-Line, and 44-Lead Plastic Chip Carrier Packages (See Packaging Spec., Order #231369) On-chip ECC Unit Automatically corrects errors The 82064 Winchester Disk Controller (WDC) with on-chip error detection and correction circuitry interfaces microprocessor systems to 5%" Winchester disk drives. It is socket and software compatible with the 82062 Winchester Disk Controller, and additionally includes on-chip ECC, support for drives with up to 2k tracks, and has an additional control signal which eliminates an external decoder. The 82064 is fabricated on Intel's advanced HMOS III technology and is available in 40-pin CERDIP and plastic packages. . oeo, BCS Vee BCA RO CLOCK INTRO EiiiLY L.m: RD DATA REID BORa Rii w- miT----, cs .. INTRO ...., ROOAr.. ROQATE OIIUN iili 5 BUFFER CONTROL OORO vcc'15$- 231242-1 Figure 1.82064 Block Diagram RD GATE SOHLE ., '0 '2 08, BROY ORUN Awe SC TRACK 000 WR FAULT INDEX 0" D., OROY 08. D,A DB, WR CLOCK STEP 082 WR GATE DB, DSO lim LiTe VSS WR DATA 231242-2 Figure 2. 82064 Pinout Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. November 1985 6-635 Order Number: 231242-002 © Intel Corporation, 1985 inter 82064 Table 1. Pin Description Symbol Pin No. Type Name and Function BCS 1 0 BUFFER CHIP SELECT: Output used to enable reading or writing of the external sector buffer by the 82064. When low, the host should not be able to drive the 82064 data bus, RD, orWR lines. BCR 2 0 BUFFER COUNTER RESET: Output that is asserted by the 82064 prior to readlwrite operation. This pin is asserted whenever BCS changes state. Used to reset the address counter of the buffer memory. INTRQ 3 0 INTERRUPT REQUEST: Interrupt generated by the 82064 upon command termination. It is reset when the STATUS register is read, or a new command is written to the COMMAND register. Optionally signifies when a data transfer is required on Read Sector commands. SDHLE 4 0 SDHLE is asserted when the SDH register is written by the host. RESET 5 I RESET: Initializes the controller and clears all status flags. Does not clear the Task Register File. RD 6 1/0 READ: Tri-state, bi-directional signal. As an input, RD controls the transfer of information from the 82064 registers to the host. RD is an output when the 82064 is reading data from the sector buffer (BCS low). WR 7 1/0 WRITE: Tri-state, bi-directional signal. As an input, WR controls the transfer of command or task information irito the 82064 registers. WR is an output when the 82064 is writing data to the sector buffer (BCS low). CS 8 I CHIP SELECT: Enables RD and WR as inputs for access to the Task Registers. It has no effect once a disk command starts. AO-2 9-11 I ADDRESS: Used to select a register from the task register file. DBo-7 12-19 1/0 DATA BUS: Tri-state, bi-directionaI8-bit Data Bus with control determined by BCS. When BCS is high the microprocessor has full control of the data bus for reading and writing the Task Register File. When BCS is low the 82064 controls the data bus to transfer to or from the buffer. Vss 20 WRDATA 21 0 WRITE DATA: Output that shifts out MFM data at a rate determined by Write Clock. Requires an external D flip-flop clocked at 10 MHz. The output has an active pullup and pulldown that can sink 4.8 rnA. LATE 22 0 LATE: Output used to derive a delay value for write precompensation. Valid when WR GATE is high. Active on all cylinders. EARLY 23 0 EARLY: Output used to derive a delay value for write precompensation. Valid when WR GATE is high. Active on all cylinders. Ground 6-636 inter 82064 Table 1. Pin Description (Continued) Symbol WRGATE Pin No. Type 24 0 Name and Function WRITE GATE: High when write data is valid. WR GATE goes low if the WR FAULT input is active. This output is used by the drive to enable head write current. WRCLOCK 25 I WRITE CLOCK: Clock input used to derive the write data rate. Frequency = 5 MHz for the ST506 interface. DIR 26 0 DIRECTION: High level on this output tells the drive to move the head inward (increasing cylinder number). The state of this signal is determined by the 82064's internal comparison of actual cylinder location vs. desired cylinder. STEP 27 0 STEP: This signal is used to move the drive head to another cylinder at a programmable frequency. Pulse width = 1.6 /Ls for a step rate of 3.2 /LsI step, and 8.4 /Ls for all other step rates. DRDY 28 I DRIVE READY: If DRDY from the drive goes low, the command will be terminated. INDEX 29 I INDEX: Signal from the drive indicating the beginning of a track. It is used by the 82064 during formatting, and for counting retries. Index is edge triggered. Only the rising edge is valid. WR FAULT 30 I WRITE FAULT: An error input to the 82064 which indicates a fault condition at the drive. If WR FAULT from the drive goes high, the command will be terminated. TRACK 000 31 I TRACK ZERO: Signal from the drive which indicates that the head is at the outermost cylinder. Used to verify proper completion of a RESTORE command. SC 32 I SEEK COMPLETE: Signal from the drive indicating to the 82064 that the drive head has settled and that reads or writes can be made. SC is edge triggered. Only the rising edge is valid. RWC 33 0 REDUCED WRITE CURRENT: Signal goeshigh for all cylinder numbers above the value programmed in the Write Precomp Cylinder register. It is used by the precompensation logic and by the drive to reduce the effects of bit shifting. DRUN 34 I DATA RUN: This signal informs the 82064 when a field of all ones or all zeroes has been detected in the read data stream by an external one·shot. This indicates the beginning of an 10 field. RD GATE is brought high when DRUN is sampled high for 16 clock periods. BRDY 35 I BUFFER READY: Input used to Signal the controller that the buffer is ready for reading (full), or writing (empty), by the host /LP. Only the rising edge indicates the condition. 6-637 82064 Table 1. Pin Description (Continued) Symbol Pin No. Type BORO 36 0 ROOATA 37 I Name and Function BUFFER DATA REQUEST: Activated during Read or Write commands when a data transfer between the host and the 82064's sector buffer is required. Typically used as a OMA request line. READ DATA: Single ended input that accepts MFM data from the drive. ROGATE 38 0 READ GATE: Output that is asserted when a search for an address mark is initiated. It remains asserted until the end of the 10 or data field. ROCLOCK 39 I Vee 40 I READ CLOCK: Clock input derived from the external data recovery circuits. D.C. POWER: + 5V. FUNCTIONAL DESCRIPTION INTERNAL ARCHITECTURE The Intel 82064 Winchester Disk Controller (WOC) interfaces microprocessor systems to Winchester disk drives that use the Seagate ,Technology ST506/ST412 interface. The device translates parallel data from the microprocessor to a 5 Mbitlsec, MFM-encoded serial bit stream. It provides all of the drive control logic and control signals which simplify the deSign of external data separation and write precompensation circuitry. The 82064 is designed to interface to the host processor through an external sector buffer. The internal architecture of the 82064 is shown in more detail in Figure 3. It is made up of seven major blocks as described below. PLA Controller The PLA interprets commands and provides all control functions. It is synchronized with WR CLOCK. Magnitude Comparator On-chip error detection algorithms include the CRCI CCITI and a 32-bit computer generated ECC polynomial. If the ECC code is selected, the 82064 provides three possible error handling techniques if an error is detected during a read operation: 1. Automatically correct the data in the sector buffer, providing the host with good information. 2. Provide the host with the error location and pattern,allowing the host to correct the error. 3. Take no action other than setting the error flag. An 11-bit magnitude comparator is used to calculate the direction and number of steps needed to move the heads from the present to the desired cylinder position. It compares the cylinder number in the task file to the internal "present position" cylinder number. A separate high-speed equivelance comparator is used to compare 10 field bytes when searching for a sector 10 field. The 82064 is software compatible with the 82062. 6-638 inter 82064 080·7 WR DATA WR CLOCK RO CLOCK ......-r:::==;_ PO CDNTROLLER IcA STEP DIRC ---1i-I..--.j BROY AD DATA i6HlE mirY WE ......- - - - - - - ' BDRD DRDY Ia WR FAULT TRACK IlOO INDEX Vcc~ SC GND--" AWC WR GATE RDGATE ......-..J""r"" DAUN 231242-3 Figure 3. 82064 Detailed Block Diagram CRC and ECC Generator and Checker The 82064 provides two options for protecting the integrity of the data field. The data field may have either a CRC (SOH register, bit 7 = 0), or a 32-bit ECC (SOH register, bit 7 = 1) appended to it. The 10 field is always protected by a CRC. The CRC m,ode provides a means of verifying the accuracy of the data read from the disk, but does not attempt to correct it. The CRC generator computes and checks cyclic redundancy check characters that are written and read from the disk after 10 and data fields. The polynomial used is: data field CRC error occurs the "ECC/CRC" bit in the error register will be set. The ECC mode is only applicable to the data field. It provides the user with the ability to detect and correct errors in the data field automatically. The commands and registers which must be considered when ECC is used are: 1. SOH Register, bit 7 (CRC/ECG) 2. READ SECTOR Command, bit 0 (T) 3. READ SECTOR and WRITE SECTOR Commands, bit 1 (L) 4. COMPUTE CORRECTION Command X1.6+ X12+ Xs+ 1 5. SET PARAMETER Command The CRC register is preset to all one's before com-· putation starts. 6. STATUS Register, bit 2 - error correction successful 7. STATUS Register, bit 0 - error occurred If the CRC character generated while reading the data does not equal the one previously written an error exists. If an 10 field CRC error occurs the "10 not found" bit in the error register will be set. If a 8. ERROR Register, bit 6 - uncorrectable error To enable the ECC mode, bit 7 of the SOH register must be set to one. 6-639 inter 82064 Bit 0 (T) of the READ Command controls whether or not error correction is attempted. When T = 0 and an error is detected, the 82064 tries up to 10 times to correct the error. 'If the error is successfully corrected, bit 2 of the STATUS Register is set. The host can interrogate the status register and detect that an error occurred and was corrected. If the error was not correctable, bit 6 of the ERROR Register is set. If the correction span was set to 5 bits, the host may now execute the SET PARAMETER Command to change the correction span to 11 bits, and attempt the read again. If the error persists, the host can read the data, but it will contain errors. When T = 1 and an error is detected, no attempt is made to correct it. Bit 0 of the STATUS Register and bit 6 of the ERROR Register are set. The user now has two choices: MFM ENCODER/DECODER Encodes and decodes MFM data to be written/read from the drive. The MFM encoder operates from WR CLOCK, a clock having a frequency equal to the bit rate. The MFM decoder operates from RD CLOCK, a bit rate clock generated by the external data separator. RD CLOCK and WR CLOCK need not be synchronous. The MFM encoder also generates the write precompensation control signals. Depending on the bit pattern of the data, EARLY or LATE may be asserted. External Circuitry uses these signals to compensate for drift caused by the influence one bit has over another. More information on the use of the EARLY and LATE control signals can be found in the section which describes the drive interface. 1.' Ignore the error and make no attempt to correct it. 2. Use the COMPUTE CORRECTION Command to determine the location and pattern of the error, and correct it within the user's program. When the COMPUTE CORRECTION Command is implemented, it must be done before executing any command which can alter the contents of the ECC Register. The READ SECTOR, WRITE SECTOR, SCAN ID, and FORMAT Commands will alter this register and correction will be impossible. The COMPUTE CORRECTION Command may determine that the error is uncorrectable, at which pOint the error bits in the STATUS and ERROR Registers are set. Although ECC generation starts with the first bit of the F8H byte in the data ID field, the actual ECC bytes written will be the same as if the A 1H byte was included. The ECC polynomial used is: Address Mark (AM) Detection An address mark is comprised of two unique bytes preceeding both the ID field and the data field. The first byte is used for resynchronization. The second byte indicates whether it is an ID field or a data field. The first byte, A 1H, normally has a clock pattern of OEH; however, one clock pulse has been suppressed, making it OAH. With this pattern, the AM detector knows it is looking at an address mark. It now examines the next byte to determine if it is an ID or data field. If this byte is 111101 XX or 111111 XX it is an ID field. Bits 3, 1, and 0 are the high order cylinder number bits. If the second byte is F8H, it is a data field. Host/Buffer Interface Control For automatic error correction, the external sector buffer must be implemented with a static RAM and counter, not with a FIFO. The SET PARAMETER Command is used .to select a 5-bit or 11-bit correction span. When the L Bit (bit 1) of the READ SECTOR and WRITE SECTOR commands is set to one, they are referred to as READ LONG and WRITE LONG commands. For these commands, no CRC or ECC characters are generated or checked by the 82064. In effect, the data field is extended by 4 bytes which are passed to/from the sector buffer. With proper use of the WRITE SECTOR, READ LONG, WRITE LONG, and READ SECTOR Commands,a diagnostic routine may be developed to test the accuracy of the error correction process. The primary interface between the host processor and the 82064 is an 8-bit bi-directional bus. This bus is used to transmit and receive data for both the 82064 and the sector buffer. The sector buffer consists of a static RAM and counter. Since the 82064 makes the bus active when accessing the sector buffer, a transceiver must be used to isolate the host during this time. Figure 4 illustrates a typical interface with sector buffer. Whenever the 82064 is not using the sector buffer, the BUFFER CHIP SELECT (BCS) is high (disabled). This allows the host access to the 82064's Task Register File and to the sector buffer. A decoder is used to generate BeS when AO-2 is '000', 'an unused address in the 82064. A binary counter is enabled whenever RD or WR go active. The location within the sector buffer which is addressed by the counter will be accessed. The counter will be incremented by the trailing edge of the RD or WR. This allows the host to access se- 6:-640 a intJ 82064 Ro WR DATA Ro ~l--C 19:1TRANS~ -- WR DATA BUS (8) '// ~>~ HOST CPU SYSTEM MR 3J ADDRESS I r BCR 00 •• •• •• TC E Ox --- A DATA o t - r-82064 ••• ••• WE I-- Cs AX i:. BCS -CS 3, r--0 DATA INTERRUPT REOUEST fiE A, 0 0 E C 0 0 OB O_ 7 '/. CP OMA CONTROLLER ° RST 11 T I AO-2 BROY BORO INTRO 231242-4 Figure 4. Host Interface Block Diagram quential bytes within the sector buffer. The decoder also generates a CS for the 82064 whenever AO-2 does not equal '000', allowing access to the 82064's internal Task Register File while keeping the sector buffer tri-stated. During a WRITE SECTOR Command, the host processor sets up data in the Task Register File and then issues the command. The 82064 asserts BUFFER COUNTER RESET (BCR) to reset the counter. It then generates a status to inform the host that it can load the sector buffer with data to be written. When the counter reaches its maximum count, the BUFFER READY (BRDY) signal is asserted by the carry out of the counter, informing the 82064 that the sector buffer is full. (BRDY is a rising edge triggered signal which will be ignored if asserted before the 82064 asserts BCR.) BCS is then asserted, discon- 6-641 necting the host through the transceivers, and the RD and WR lines become outputs from the 82064 to allow access to the sector buffer. When the 82064 is done using the buffer, it deasserts BCS which again allows the host to access the local bus. The READ SECTOR command operates in a similar manner, except the buffer is loaded by the 82064 instead of the host. Another control signal, BUFFER DATA REQUEST (BDRQ), can be used with a OMA controller to indicate that the 82064 is ready to send or receive data. When data transfer is via a programmed I/O environment, it is the responsibility of the host to interrogate the ORQ status bit to determine if the 82064 is ready (bit 3 of the status register). For further explanation, refer to the individual command descriptions and the A.C. Characteristics. inter 82064 When INTRa is asserted, the host is signaled that execution of a command has terminated (either a normal termination or an aborted command). For the READ SECTOR command, interrupts may be programmed to be asserted either at the termination of the command, or when BDRa is asserted. INTRa will remain active until the host reads the STATUS register to determine the cause of the termination, or writes a new command into the COMMAND register. Drive Interface The drive side of the 82064 WDC requires three sections of external logic. These are the control line buffer/receivers, data separator, and write precompensation. Figure 5 illustrates a drive interface. The buffer/receivers condition the control lines to be driven down the cable to the drive. The control lines are typically single-ended, resistor terminated, TIL levels. The data lines to and from the drive also require buffering. This is typically done with differential RS-422 drivers. The interface specification for the drive will be found in the drive manufacturer's OEM The 82064 asserts SDHLE whenever the SDH register is being written. This signal can be used to latch the drive and head select information in an external register for decoding. Figure 5 illustrates one method. DB O_ 4 j. r-;;-;:-o • A Q ~ - HSELO HSEL1 HSEL2 DSEL1 DSEL2 r-- DSEL3 I-- DSEL4 Q H Q D E C 0 D E y~t-- '-SDHLE RD GATE DRUN RD DATA RD CLOCK DATA SEPARATOR 82064 HOST <= WR DATA ~ " D8 0 _/' EARLY LATE RWC STEP DIR DRDY WR rAULT TRACK 000 INDEX SC WR GATE WRITE PRECOMPENSATION AND SYNCHRONIZATION DISK DRIVE INTERrACE/ BurrER 231242-5 Figure 5. Drive Interface Block Diagram 6-642 inter 82064 manual. The 82064 supplies TTL compatible signals, and will interface to most buffer/driver devices. The data recovery circuits consist of a phase locked loop, data separator, and associated components. The 82064 interacts with the data separator through the DATA RUN (DRUN) and RD GATE signals. A block diagram of a typical data separator circuit is shown in Figure 6. Read data from the drive is presented to the RD DATA input of the 82064, the reference multiplexor, and a retriggerable one shot. The RD GATE output will be de asserted when the 82064 is not inspecting data. The PLL should remain locked to the reference clock. The write precompensation Circuitry is designed to reduce the drift in the data caused by interaction between bits. It is divided into two parts, REDUCED WRITE CURRENT (RWC) and EARLY/LATE writing of bits. A block diagram of a typical write precompensation circuit is shown in Figure 8. The cylinder in which the RWC line becomes active is controlled by the REDUCE WRITE CURRENT register in the Task Register File. When a cylinder is written which has a cylinder number greater than or equal to the contents of this register, the write current will be reduced. This will decrease the interaction between the bits. Drift may also be caused by the bit pattern. With certain combinations of ones and zeroes some of the bits can drift far enough apart to be difficult to read without error. This phenomenon can be minimized by using EARLY and LATE as described below. The 82064 examines three bits, the last one written, the one being written, and the next one to be written. From this, it determines whether to assert EARLY or LATE. Since the bit leaving the 82064 has already been written, it is too late to make it early. Therefore, the external delay circuit must be as follows: When any READ or WRITE command is initiated and a search for an address mark begins, the DRUN input is examined. The DRUN one-shot is set for slightly longer than one bit time, allowing it to retrigger constantly on a field of all ones or all zeroes. An internal counter times out to see that DRUN is asserted for two byte times. RD GATE is asserted by the 82064, switching the data separator to lock on to the incoming data stream. If DRUN is deasserted prior to an additional seven byte times, RD GATE is deasserted and the process is repeated. RD GATE will remain asserted until a non-zero, non-address mark byte is detected. The 82064 will then deassert RD GATE for two byte times to allow the PLL to lock back on the reference clock, and start the DRUN search again. If an address mark is detected, RD GATE remains asserted and the command will continue searching for the proper ID field. This sequence is shown in the flow chart in Figure 7. EARLY asserted and LATE deasserted delay no = = EARLY deasserted and LATE deasserted one unit delay (typically 12-15 ns) EARLY deasserted and LATE asserted units delay (typically 24-30 ns) = two EARLY and LATE are always active, and should be gated externally by the RWC signal. Figure 8 illustrates one method of using these signals. 250 NSEC RETRIGGERABLE ONE-SHOT MFM DISK ::: DATA L~,mo - A MUX I DRUN ~ f-- PHASE COMP J C ~ RD DATA r~ AND VCO B +2 82064 ..... RD CLOCK RD GATE I +2 L WR CLOCK 110 MHZ 1 OSC 231242-6 Figure 6. Data Separator Circuit 6-643 inter 82064 NO 231242-7 Figure 7. PLL Control Sequence 6-644 inter 82064 DELAY LINE WR DATA J - - - - 4 12NS EARLY 1----1 24NS Q LATEJ----I c WR DATA TO DRIVE 82064 10t.lHZ OSC RWC~----------e--+----------------~~ .....- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - . TO DRIVE 231242-9 Figure 8. Write Precompensation Circuit TASK REGISTER FILE Bit 6 - GRG/EGG Data Field Error (GRG/EGG) The Task Register File is a bank of nine registers used to hold parameter information pertaining to each command, status information, and the command itself. These registers and their addresses are: When in the GRG mode (SOH register, bit 7 = 0), this bit is set when a GRG error occurs in the data field. When retries are enabled, ten more attempts are made to read the sector correctly. If none of these attempts are successful bit 0 in the STATUS register is also set. If one of the attempts is successful, the GRG/EGG error bit remains set to inform the host that a marginal condition exists; however, bit 0 in the STATUS register is not set. A2 0 0 0 0 A1 0 0 0 0 AD 0 1 0 1 0 1 0 1 READ BUS TRI·STATED ERROR REGISTER SECTOR COUNT SECTOR NUMBER CYLINDER LOW CYLINDER HIGH SDH STATUS WRITE BUS TRI·STATED REDUCE WRITE CURRENT SECTOR COUNT SECTOR NUMBER CYLINDER LOW CYLINDER HIGH SDH COMMAND When in the EGG mode (SOH register, bit 7 = 1), this bit is set when the first non-zero syndrome is detected. When retries are enabled, up to ten attempts are made to correct the error. If the error is successfully corrected, this bit remains set; however, bit 2 of the STATUS register is also set to inform the host that the error has been corrected. If the error is not correctable, the GRG/EGG error bit remains set and bit 0 of the STATUS register is also set. NOTE: These registers are not cleared by RESET being asserted. ERROR REGISTER This read only register contains specific error information after the termination of a command. The bits are defined as follows: The data may be read even if uncorrectable errors exist. o NOTE: If the long mode (L) bit is set in the READ or WRITE command, no error checking is performed. DAM Bit 7 - Bad Block Detect (BB) Bit 5 - Reserved This bit is set when an 10 field has been encountered that contains a bad block mark. It is used for bad sector mapping. Not used. Forced to zero. 6-645 inter 82064 Bit 4 - 10 Not Found (10) This bit is set to indicate that the correct cylinder, head, sector, or size parameter could not be found, or that a CRC error occurred in the 10 field. This bit is set on the first failure and remains set even if the error is recovered on a retry. When recovery is unsuccessful, the Error bit (bit 0) of the STATUS register is also set. For a SCAN 10 command with retries enabled (T = 0), the Error bit in the STATUS register is set after ten unsuccessful attempts have been made to find the correct 10. With retries disabled (T = 1), only two attempts are made before setting the Error bit. For a READ or WRITE command with retries enabled (T = 0), ten attempts are made to find the correct 10 field. If there is still an error on the tenth try, an auto-scan and auto-seek are performed. Then ten more retries are made before setting the Error bit. When retries are disabled (T = 1), only two tries are made. No auto-scan or auto-seek operations are performed. The value (OO-FFH) loaded into this cylinder is internally multiplied by four to specify the actual cylinder where RWC is asserted. Thus a value of 01 H will cause RWC to be asserted on cylinder 04H, 02H on . cylinder OSH, ... , 9CH on cylinder 270H, 9DH on cylinder 274H, and so on. RWC will be asserted when the present cylinder is greater than or equal to four times the value of this register. For example, the S1506 interface requires precomp on cylinder SOH and above. Therefore, the REDUCE WRITE CURRENT register should be loaded with 20H. A value of FFH causes RWC to remain deasserted, regardless of the actual cylinder number. SECTOR COUNT REGISTER This register is used to define the number of sectors that need to be transferred to the buffer during a READ MULTIPLE SECTOR or WRITE MULTIPLE SECTOR command. I7 1 6. 1 5 I 4 I 3 I 2 I o 1 Bit 3 - Reserved Not used. Forced to zero. Bit 2 - Aborted Command (AC) Command execution is aborted and this bit is set if a command was issued while DRDY.is deasserted or WR FAULT is asserted. This bit will also be set if an undefined command is written to the COMMAND register; however, an implied seek will be execute.d. Bit 1 - Track 000 Error (TKOOO) This bit is set during the execution of a RESTORE command if the TRACK 000 pin has not gone active after the issuance of 2047 step pulses. The value contained in the register is decremented after each sector is transferred to/from the sector buffer. A zero represents a 256 sector transfer, a one a one sector transfer, etc. This register is a "don't care" when single sector commands are specified. SECTOR NUMBER REGISTER This register holds the sector number of the desired sector. I Bit 0 - Data Address Mark (DAM) Not Found This bit is set during the execution of a READ SECTOR command if the DAM is not found following the proper sector 10.. REDUCE WRITE CURRENT REGISTER This register is used to define the cylinder number where the RWC output (Pin 33) is asserted. 7 6 I 5 I 4 I 3 I 2 1 CYLINDER NUMBER + 4 6-646 7 I 6 I 5 1 41 3 1 2' SECTOR NUMBER I 1 I 0 I For a multiple sector command, it specifies the first sector to be transferred. It is incremented after each sector is transferred to/from the sector buffer. The SECTOR NUMBER register may contain any value from 0 to 255. The SECTOR NUMBER register is also used to program the Gap 1 and Gap 3 lengths to be used when formating a disk. See the WRITE FORMAT comr:nand description for further explanation. intJ 82064 the drive number recorded, but does have the bad block mark written. The format of the SDH byte written on the disk is: CYLINDER NUMBER LOW REGISTER This register holds the lower byte of the desired cylinder number. I 7 I 6 I 5 I 4 I 3 I 2 I It is used with the CYLINDER NUMBER HIGH register to specify the desired cylinder number over a range of 0 to 2047. CYLINDER NUMBER HIGH REGISTER 4 3 o o 2 1 HEAD STATUS REGISTER The status register is used to inform the host of certain events performed by the 82064, as well as reporting status from the drive control lines. Reading the STATUS register deasserts INTRQ. The format is: This register holds the three most significant bits of the desired cylinder number. Bit 7 - Busy The CYLINDER NUMBER LOW/HIGH register pair determine where the R/W heads are to be positioned. The host writes the desired cylinder number into these registers. Internal to the 82064 is another pair of registers that hold the present head location. When any command other than a RESTORE is executed, the internal head location registers are compared to the CYLINDER NUMBER registers to determine how many cylinders to move the heads and in what direction. This bit is asserted when a command is written into the COMMAND register and, except for the READ command, is deasserted at the end of the command. When executing a READ command, Busy will be deasserted when the sector buffer is full. Commands should not be loaded into the COMMAND register when Busy is set. When the Busy bit is set, no other bits in the STATUS or ERROR registers are valid. Bit 6 - Ready The internal head location registers are updated to equal the CYLINDER NUMBER registers after the completion of the seek. This bit reflects the status of DRDY (pin 28). When this bit equals zero, the command is aborted and the status of this bit is latched. When a RESTORE command is executed, the internal head location registers are reset to zero while DIR and STEP move the heads to track zero. Bit 5 - Write Fault (WF) SECTOR/DRIVE/HEAD (SDH) REGISTER This bit reflects the status of WR FAULT (pin 30). When this bit equals one the command is aborted, INTRQ is asserted, and the status of this bit is latched. The SDH register contains the desired sector size, drive number, and head parameters. The format is shown in Figure 9. The EXT bit (bit 7) is used to select between the CRC or ECC mode. When bit 7 = 0 the ECC mode is selected for the data field. When bit 7 = 1 the CRC mode is selected. The SDH byte written in the ID field of the disk by the FORMAT command is different than the SDH register contents. The recorded SDH byte does not have Bit 4 - Seek Complete (SC) This bit reflects the status of SC (pin 32). When a seek or implied seek has been initiated by a command, execution of the command pauses until the seek is complete. This bit is latched after an aborted command error. 6-647 intJ 82064 7 6 5 3 4 o 2 .. ,.,.. 6 5 SECTOR SIZE 4 3 DRIVE # 2 1 0 HEAD # 0 0 1 1 0 1, 0 1 256 512 1024 128 0 0 1 1 0 1 0 1 DSEL1 DSEL2 DSEL3 DSEL4 0 0 0 0 1 1 1 1 0 0 1 1 0 0 0 1 0 HSELO HSEL1 HSEL2 HSEL3 HSEL4 HSEL5 HSEL6 HSEL7 1 1 1 0 1 0 1 - 231242-10 NOTE: Drive select and head select lines must be generated externally. Figure 3 represents one method of achieving this. Figure 9. SOH Register Format Bit 3 - Data Request (DRQ) Bit 0 - Error The DRQ bit reflects the status of BDRQ (pin 36). It is asserted when the sector buffer must be written into or read from. DRQ and BDRQ remain asserted until BRDY indicates that the sector buffer has been filled or emptied, depending upon the command. BDRQ can be used for DMA interfacing, while DRQ is used in a programmed 1/0 environment. This bit is set whenever any bits in the ERROR register are set. It is the logical 'or'· of the bits in the ERROR register and may be used by the host processor to quickly check for nonrecoverable errors. The host must read the ERROR register to determine what type of error occurred. This bit is reset when a new command is written into the COMMAND register. Bit 2 - Data Was Corrected (DWC) When set, this bit indicates that an ECC error has been detected during a read operation, and that the data in the sector buffer has been corrected. This provides the user with an indication that there may be a marginal condition within the drive before the errors become uncorrectable. This bit is forced to zero when not in the ECC mode. Bit 1 - Command In Progress (CIP) When this bit is set a command is being executed and a new command should not be loaded.· Although a command is being executed, the sector buffer is still available for access by the host. When the 82064 is no longer Busy (bit 7 = 0) the STATUS register can be read. If other registers are read while CIP is set the contents of the STATUS register will be returned. COMMAND REGISTER The command to be executed is written into this write-only register: 1716151413121 1 101 COMMAND The command sets Busy and CIP, and begins to execute as soon as it is written into this register. Therefore, all necessary information should be loaded into the Task Register File prior to entering the command. Any attempt to write a register will be ignored until command execution has terminated, as indicated by the CIP bit being cleared. INTRQ is deassert~d when the COMMAND register is written. 6-648 inter 82064 COMMAND RESTORE SEEK READ SECTOR WRITE SECTOR SCANID WRITE FORMAT COMPUTE CORRECTION SET PARAMETER 7 6 5 4 0 0 0 0 0 0 0 0 3 2 1 T = 1 Disable retries. 0 0 0 1 R3 R2 Rl RO 1 1 1 R3 R2 Rl I M L 0 M L 0 1 0 0 1 1 1 0 0 1 0 1 0 0 0 0 II 0 0 0 1 0 0 0 0 0 0 0 0 0 S = Error Correction Span S = 0 5-bit span. S = 1 ll-bit span. RO T T T 0 0 RESTORE COMMAND S The RESTORE command is used to pOSition the R/W heads over track zero. It is usually issued by the host when a drive has just been turned on. The 82064 forces an auto-restore when a FORMAT command has been issued following a drive number change. R3-0 = Stepping Rate Field For 5 MHz WR CLOCK: R3-0 = 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 35}Ls 0.5 ms 1.0 ms 1.5 ms 2.0 ms 2.5 ms 3.0 ms 3.5 ms 4.0 ms 4.5 ms 5.0 ms 5.5 ms 6.0 ms 6.5 ms 3.2}Ls 16}Ls The actual step rate used for the RESTORE command is determined by the seek complete time. A step pulse is issued and the 82064 waits for a rising edge on the SC line before issuing the next pulse. If the rising edge of SC has not occurred within ten revolutions (INDEX pulses) the 82064 switches to sensing the level of SC. If after 2047 step pulses the TRACK 000 line does not go active the 82064 will set the TRACK 000 bit in the ERROR register, assert INTRa, and terminate execution of the command. An interrupt will also occur if WR FAULT is asserted on DRDY is deasserted at any time during execution. I = Interrupt Control I = 0 INTRa occurs with BDRO/DRO indicating the sector buffer is full. Valid only when M = o. I = 1 INTRa occurs when the command is completed and the host has read the sector buffer. M = Multiple Sector Flag M = 0 Transfer one sector. Ignore the SECTOR COUNT register. M = 1 Transfer multiple sectors. Long Mode 0 Normal mode. Normal CRC or ECC functions are performed. L = 1 Long mode. No CRC or ECC bytes are developed or error checking performed on the data field. The 82064 appends the four additional bytes supplied by the host or disk to the data field. L L = = T = Retry Enable T = 0 Enable retries. 6-649 The rate field specified (R3-0) is stored in an internal register for future use in commands with implied seeks. A flowchart of the RESTORE command is shown in Figure 10. SEEK COMMAND The SEEK command can be used for overlapping seeks on multiple drives. The step rate used is taken from the Rate Field of the command, and is stored in an internal register for future use by those commands with implied seek capability. The direction and number of step pulses needed are calculated by comparing the contents of the CYLINDER NUMBER registers in the Task Register File to the present cylinder position stored internally. After all the step pulses have been issued the present cylinder position is updated, INTRa is asserted, and the command terminated. infef 82064 If DRDY is deasserted or WR FAULT is asserted during the execution of the command, INTRa is asserted and the command aborts setting the AC bit in the ERROR register. If an implied seek is performed, the step rate indicated by the rate field is used for all but the last step pulse. On the last pulse, the command execution continues until the rising edge of SC is detected. If 10 INDEX pulses are received without a rising edge of SC, the 82064 will switch to sensing the level of SC. RESET INTRa EAROAS. SET BUSY, CIP RESET Rwe SET OIRECTIQN - OUT STORE STEP RATE A flowchart of the SEEK command flow is shown in Figure 11. READ SECTOR PULseID SET INTRQ The READ SECTOR command is used to transfer one or more sectors of data from the disk to the sector buffer. Upon receipt of the command, the 82064 checks the CYLINDER NUMBER LOW/HIGH register pair against the internal cylinder position register to see if they are equal. If not, the direction and number of steps calculation takes place, and a seek is initiated. As stated in the description of the SEEk command, if an implied seek occurs, the step rate specified by the rate field is used for all but the last step pulse. On the last step pulse the seek continues until the rising edge of SC is detected. RESET BUSV.CIP If the 82064 detects a change in the drive number since the last command, an auto-scan ID is performed. This updates the internal cylinder position register to reflect the current drive before the seek begins. After the 82064 senses SC (with or without an implied seek) it must find an ID field with the correct cylinder number, head, sector size, and CRC. If retries are enabled (T = 0), ten attempts are made to find the correct ID field. If there is still an error on the tenth try, an auto-scan ID and auto-seek are performed. Then ten more retries are attempted before setting the ID Not Found error bit. When retries are disabled (T = 1) only two tries are made. No autoscan or auto-seek operations are performed. ISSUE A STEP PULSE When the data address mark (DAM) is found, the 82064 is ready to transfer data into the sector buffer. When the disk has filled the sector buffer, the 82064 asserts BDRa and DRa and then checks the I flag. If I = 0, INTRa is asserted, signaling the host to read the contents of the sector buffer. If I = 1, INTRa occurs after the host has read the sector buffer and the command has terminated. If after successfully reading the ID field, the DAM is not found the DAM Not Found bit in the ERROR register is set. 231242-11 Figure 10. Restore Command Flow 6-650 intJ 82064 YES YES 231242-12 Figure 11. Seek Command Flow 6-651 inter 82064 An optional M flag can be set for multiple sector transfers. When M = 0, one sector is transferred and the SECTOR COUNT register is ignored. When M = 1, multiple sectors are transferred. After each sector is transferred, the 82064 decrements the SECTOR COUNT register and increments the SECTOR NUMBER register. The next logical sector is transferred regardless of any interleave. Sectors are numbered during the FORMAT command by a byte in the ID field. For the 82064 to make multiple sector transfers to the sector buffer, the BRDY signal must be toggled from low to high for each sector. The transfers continue until the SECTOR COUNT register equal zero. If the SECTOR COUNT is not zero (indicating more sectors remain to be read), and the sector buffer is full, BDRa will be asserted and the host must unload the sector buffer. Once this occurs, the sector buffer is free to accept the next sector. WR FAULT and DRDY are monitored throughout the command execution. If WR FAULT is asserted or DRDY is deasserted, the command will terminate and the Aborted Command bit in the ERROR register will be set. For a de.scription of the error checking procedure on the data field see the explanation in the section entitled "CRC and ECC Generator and Checker." Both the READ and WRITE commands feature a "simulated completion" to ease programming. BDRa, DRa, and INTRa are generated in a normal manner upon detection of an error condition. This allows the same program flow for successful or unsuccessful completion of a command. In summary then, the READ as follows: ~ECTOR operation is When M = 0 (Single Sector Read) 1. HOST: Sets up parameters. Issues READ SECTOR command. 2. 82064: Asserts BCA. 3. 82064: Finds sector specified. Asserts BCR and BCS. Transfers data to sector buffer. 4. 82064: Asserts BCA. Deasserts BCS. 5. 82064: Asserts BDRa and DRa. 6. 82064: If I = 1 then go to 9. 7. HOST: Read contents of sector buffer. 8. 82064: Wait for BRDY, then assert INTRa. End. 9. 82064: Assert INTRa. 10. HOST: Read contents of sector buffer. End. When M= 1 (Multiple Sector Read) 1. HOST: Sets up parameters. Issues READ SECTOR command. 2. 82064: Asserts BCA. 3. 82064: Finds sector specified. Asserts BCR and BCS. Transfers data to sector buffer. 4. 82064: Asserts BCA. Deasserts BCS. 5. 82064: Asserts BDRa and DRa. 6. HOST: Reads contents of sector buffer. 7. SECTOR· BUFFER: Indicates data has been transferred by asserting BRDY. 8. 82064: When BRDY is asserted, decrement SECTOR COUNT, increment SECTOR NUMBEA. If SECTOR COUNT = 0, go to 11. 9. 82064: Go to 2. 10. 82064: Assert INTRa. A flowchart of the READ SECTOR command is shown in Figure 12. WRITE SECTOR The WRITE SECTOR command is used to write one or more sectors of data from the sector buffer to the disk. Upon receipt of the command, the 82064 checks the CYLINDER NUMBER LOW/HIGH register pair against the internal cylinder position register to see if they are equal. If not, the direction and number of steps calculation takes place, and a seek is initiated. As stated in the description of the SEEK command, if an implied seek occurs, the step rate specified by the rate field is used for all but the last step pulse. On the last step pulse the seek continues until the rising edge of SC is detected. If the 82064 detects a change in the drive number since the last command, an al,lto-scan ID is performed. This updates the internal cylinder position register to reflect the current drive before the seek begins. After the 82064 senses SC (with or without an implied seek) BDRa and DRa are asserted and the host begins filling the sector buffer with data. When BRDY is asserted, a search for the ID field with the correct cylinder number, head, sector size, and CRC is initiated. If retries are enabled (T = 0), ten attempts are made to find the correct ID field. If there is still an error on the tenth try, an auto-scan ID and auto-seek are performed. Then ten more retries are attempted before setting the ID Not Found error bit. When retries are disabled (T = 1) only two tries are made. No auto-scan or auto-seek operations are performed. 6-652 82064 231242-13 *If T bit of command = 1 then dashed path is taken after 2 index pulses. Figure 12a. Read Sector Command Flow 6-653 inter 82064 NO *If T,bit of command = 1 then dashed path is taken. ·*If T bit of command = 1 then test is for 2 index pulses. Figure 12b. Read Sector Command Flow (Continued) 6-654 231242-14 inter 82064 When the correct 10 is found, WR GATE is asserted and data is written to the disk. When the CRC/ECC bit (SOH Register, bit 7) is zero, the 82064 generates a two byte CRC character to be appended to the data. When the CRC/ECC bit is one, four ECC bytes replace the CRC character. When L = 1, the polynomial generator is inhibited and neither CRC or ECC bytes are generated. Instead four bytes of data supplied by the host are written. change in drive numbers, only the internal position register is updated. If a bad block is detected, the BAD BLOCK bit will also be set. During a WRITE MULTIPLE SECTOR command (M = 1), the SECTOR NUMBER register is incremented and the SECTOR COUNT register is decremented. If BRDY is asserted after the first sector is read from the sector buffer, the 82064 continues to read data from the sector buffer for the next sector. If BRDY is deasserted, the 82064 asserts BORa and waits for the host to place more data in the sector buffer. A flowchart of the SCAN 10 command is shown in Figure 14. In summary then, the WRITE SECTOR operation is as follows: When M = 0,1 1. HOST: Sets up parameters. Issues READ SECTOR command. 2.82064: Asserts BORa and ORO. 3. HOST: Loads sector buffer with data. 4. 82064: Waits for riSing edge of BRDY. 5.82064: Finds specified 10 field. Writes sector to disk. 6.82064: If M = 0, asserts INTRa. End. 7.82064: Increments SECTOR NUMBER. Decrements SECTOR COUNT. 8.82064: IF SECTOR COUNT = 0, assert INTRa. End. 9. 82064: Go to 2. A flowchart of the WRITE SECTOR command is shown in Figure 13. SCANID The SCAN 10 command is used to update the SOH, SECTOR NUMBER, and CYLINDER NUMBER LOW/HIGH registers. After the command is loaded, the SC line is sampled until it is valid. The DRDY and WR FAULT lines are also monitored throughout execution of the command. If a fault occurs the command is aborted and the appropriate error bits are set. When the first 10 field is found, the 10 information is loaded into the SOH, SECTOR NUMBER, and CYLINDER NUMBER registers. The internal cylinder position register is also updated. If this is an auto-scan caused by a If an 10 field is not found, or if a CRC error occurs, and if retries are enabled (T = 0), ten attempts are made to read it. If retries are disabled (T = 1), only two tries are made. There is no auto-seek in this command and the sector buffer is not disturbed. WRITE FORMAT The WRITE FORMAT command is used to format one track using information in the Task Register File and the sector buffer. During execution of this command, the sector buffer is used for additional parameter information instead of data. Shown in Figure 15 is the contents of a sector buffer for a 32 sector track with an interleave factor of two. Each sector requires a two byte sequence. The first byte designates whether a bad block mark is to be recorded in the sector's 10 field. An OOH is normal; an 80H indicates a bad block mark for that sector. In the example of Figure 15, sector 04 will get a bad block mark recorded. The second byte indicates the logical sector number to be recorded. This allows sectors to be recorded with any interleave factor desired. The remaining memory in the sector buffer may be filled with any value; its only purpose is to generate a BRDY to tell the 82064 to begin formatting the track. If the drive number has been changed since the last command, an auto-restore is initiated, positioning the heads to track 000. The internal cylinder position register is set to zero and the heads seek to the track specified in the Task Register File CYLINDER NUMBER register. This prevents an 10 Not Found error from occuring due to an incompatible format, or the track having been erased. A normal implied seek is also in effect for this command. The SECTOR COUNT register is used to hold the total number of sectors to be formatted (FFH = 255 sectors), while the SECTOR NUMBER register holds the number of bytes, minus three, to be used for Gap 1 and Gap 3. If, for example, the SECTOR COUNT register value is 02H and the SECTOR NUMBER register value is OOH, then 2 sectors are formatted and.3 bytes of 4EH are written for Gap 1 and Gap 3. The data fields are filled with FFH and the CRC or ECC is automatically generated and appended. After the last sector is written the track is filled with 4EH. 6-655 inter 82064 °If retries disabled then dashed path is taken after 2 index pulses. Figure 13. Write Sector Command Flow 6-656 82064 RESET INTRa, ERRORS SET BUSY. CIP SET INTRQ. AC RESET BUSY. CIP SEARCH FOR ANY 10 FIELD NO UPDATE SOH. CYL. SECTOR, CYL POS, REG'S 'If retries are disabled, path is taken after 2 index pulses. 23t242-16 Figure 14. Scan 10 Command Flow 6-657 inter 82064 DATA ADDR 00 08 10 18 20 28 30 38 40 0 1 2 3 4 5 6 00 00 80 00 00 00 00 00 FF 00 02 04 06 08 OA OC OE FF 00 00 00 00 00 00 00 00 FF 10 12 14 16 18 1A 1C 1E FF 00 00 00 00 00 00 00 00 FF 01 03 05 07 09 08 OD OF FF 00 00 00 00 00 00 00 00 FF FF FF FF 7 11 13 15 17 19 18 10 1F FF : : FO FF FF FF FF FF Figure 15. Format Command Buffer Contents The Gap 3 value is determined by the drive motor speed variation, data sector length, and the interleave factor. The interleave factor is only important when 1:1 interleave is used. The formula for determining the minimum Gap 3 length is: and the pattern examined. If the pattern is correctable, the procedure is stopped and the count and pattern are written to the sector buffer, following the syndrome. The process is also stopped if the count exceeds the sector size before a correctable pattern is found. Gap 3 = (2.M.S)+K+E where: When the command terminates the sector buffer contains the following data: M = motor speed variation (e.g., 0.03 for + 3%) S = sector length in bytes K = 18 for an interleave factor of 1 o for any other interleave factor E = 2 if ECC is enabled (SOH register, bit 7 = 1) Syndrome MSB Syndrome Syndrome Syndrome LSB Error Pattern Offset Error Pattern Offset Error Pattern MSB Error Pattern Error Pattern LSB As for all commands, if WR FAULT is asserted or OROY is deasserted during execution of the command, the command terminates and the Aborted Command bit in the ERROR register is set. Figure 16 shows the format which the 82064 will write on the disk. A flowchart of the WRITE FORMAT command is shown in Figure 17. COMPUTE CORRECTION The COMPUTE CORRECTION command determines the location and pattern of a single burst error, but does not correct it. The host, using the data provided by the 82064, must perform the actual correction. The COMPUTE CORRECTION command is used following a data field ECC error. The command initiating the read must specify no retries (T = 1). The COMPUTE CORRECTION command first writes the four syndrome bytes from the internal ECC register to the sector buffer. Then the ECC register is clocked. With each clock, a counter is incremented As an example, when the Error Pattern Offset is zero the following procedure may correct the error. The first data byte of the sector is exclusive OR'd with the MSB of the Error Pattern, the second data byte with the second byte of the Error Pattern, and the third data byte with the LSB of the Error Pattern. If the sector buffer count exceeds the sector size, or if the error burst length is greater than that selected by the Set Parameter command, the ECC/CRC error in the ERROR register and the Error bit in the STATUS register is set. SET PARAMETER This command selects the correction span to be used for the error correction process. A 5-bit span is selected when bit zero of the command equals 0, and an 11-bit span when bit zero equals 1. The 82064 defaults to a 5-bit span after a RESET. 6-658 intJ 82064 REPEATED FOR EACH SECTOR ~ GAP4 GAP1 4E 4E (1) r - - I D FIELD ~ 14 BYTES '00' A 1 I D E N T C L Y 0 L W H E A D S E C # C R C 1 C R C 2 ,----DATA F I E L D - 3 BYTES 12 BYTES '00' '00' I : I WRITE GATE ORUN-.J F A 1 USER DATA 8 2 CRC OR 4 ECC 3 BYTES '00' GAP3 4E (1 ) '" ; III j --1J:~':---------+-----------+:----~L-' t I I I I I I I 11 1//////////1//////$1:1 t1 I I 1 I I ; W///1///I/J///14 I ' ~-------- _____ I....____ READ GATE---.J 231242-17 ID FIELD A1 = = A 1H with OAH Clock IDENT HEAD = Bits 0, 1, 2 = Head Number Bits 3,4 = 0 Bits 5, 6 = Sector Size Bit 7 = Bad Block Mark Sec # = Logical Sector Number Bits 3, 1, 0 = Cylinder High FE = 0-255 Cylinders FF = 256-511 Cylinders FC = 512-767 Cylinders FD = 768-1023 Cylinders F6 = 1024-1279 Cylinders F7 = 1280-1535 Cylinders F4 = 1536-1791 Cylinders F5 = 1792-2047 Cylinders DATA FIELD A1 F8 USER = = = A 1H with OAH clock Data Address Mark; Normal Clock Data Field 128 to 1024 Bytes NOTE: 1. GAP 1 and 3 length determined by Sector Number Register contents during formatting. Figure 16. Track Format 6-659 inter 82064 RESET WR GATE, BCS PULSE BeR, SET INTRQ RESET BUSY, ClP 231242-18 Figure 17. Write Format Command Flow 6-660 82064 • Notice: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied Exposure to absolute maximum rating conditions for extended periods may affect device reliability. ELECTRICAL CHARACTERISTICS ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias ...... O°C to 70°C Storage Temperature .......... - 65°C to + 150°C Voltage on any pin with respect to GND ................. - 0.5V to + 7V Power Dissipation ....................... 1.5 Watt NOTICE Specifications contained within the following tables are subject to change. D.C. CHARACTERISTICS Symbol = O°C to 70°C; Vee = + 5V ± 1O~/o; GND = OV) (T A Parameter IlL Input Leakage Current Min IOFL Output Leakage Current VIH Input High Voltage VIL Input Low Voltage VOH Output High Voltage VOL Output Low Voltage Max Units ±10 )-LA ±10 )-LA 2.0 Test Conditions = Vee to OV VOUT = Vee to 0.45V VIN V 0.8 V V IOH 0.40 0.45 V IOL 2.4 = -100)-LA = 1.6 mA 6.0 mA P21, 22, 23 lee Supply Current 160 mA All Outputs Open CIN Input Capacitance 10 pF fc CliO I/O Capacitance 20 pF Unmeasured pins returned toGND 30 ns 0.9Vto 4.2V = 1 MHz For Pins 25, 34, 37, 39 (WR CLOCK, DRUN, READ DATA, READ CLOCK) TRS Rise Time A.C. CHARACTERISTICS = O°C to 70°C; Vee = + 5V ± 10%; GND = OV) (TA HOST READ TIMING WR CLOCK = 5.0 MHz Symbol Parameter Min 1 Address Stable Before RD ,.t, Max 0 ,.t, Units 2 Data Delay from RD 70 ns 3 RD Pulse Width 0.2 10 )-Ls 4 RD to Data Floating 10 200 ns 5 Address Hold Time after RD i 0 ns 6 Read Recovery Time 300 ns 7 CS Stable before RD 0 ns ,.t, 6-661 Test Conditions ns See Note 6 inter 82064 AO-2 ~ X'-___ ADDRESS STABLE - -T-G)-. cs ®- 1--""---0 ______ - 0 - r----- ~~~ ~-JI RO-----~ 1~-lC@ OBO-7 - - - - -....CX-O-A-TA-VA-L-IO....) 231242-19 HOST WRITE TIMING WR CLOCK = 5.0 MHz Symbol Parameter J, 8 Address Stable Before WR 9 CS Stable Before WR 10 Data Setup Time Before WR 11 WR Pulse Width 12 14 i . Address Hold Time After WR i CS Hold Time After WR i 15 47 13 J, i Data Hold Time After WR Min Max Units 0 10 p,s 0 10 p,s 0.16 10 p,s 0.2 10 p,s 0 ns 0 ns 0 ns Write Recovery Time 300 ns SDHLE Propagation Delay 20 150 Test Conditions See Note 7 ns AO-2»~_~X,--- 1+- _-T-0- GD cs ~~------------~~' WR----~I_--([j)---Ir----- -@ SOHLE - - - - - - t " ' \ 231242-20 6-662 inter 82064 BUFFER READ TIMING (WRITE SECTOR COMMAND) WR CLOCK = 5.0 MHz Symbol Parameter Min 16 BCS J, to RD Valid 17 RD Output Pulse Width 300 140 Typ 0 18 Data Setup to RD i 19 Data Hold from RD i 0 20 RD Repetition Rate 1.2 21 RD Float from BCS i 0 400 Max Units 100 ns 500 ns Test Conditions See Note 3 ns ns 1.6 2.0 p.s 100 ns See Note 1 ~~~@--------------~,~ Jm--(OUTPUT) ;xxx ~--------®------~~ 231242-21 BUFFER WRITE TIMING (READ SECTOR COMMAND) WR CLOCK = 5.0 MHz Symbol Parameter 22 BCS J, to WR Valid 23 WR Output Pulse Width 24 Data Valid from WR Min Typ 0 300 25 t Data Hold from WR i 60 26 WR Repetition Rate 1.2 27 WR Float from BCS i 0 400 1.6 Max Units 100 ns 500 ns 150 ns 200 ns 2.0 p.s 100 ns Test Conditions See Note 3 See Note 1 ::~~~®~--------------------------~' ~ (OUTPUT) DBO·7 ® --------+<' DATA VALID 231242-22 6-663 82064 MISCELLANEOUS TIMING Parameter Min 28 BDRQ Reset from BRDY 20 29 BRDY Pulse Width 400 30 BCR Pulse Width 1.4 Symbol Typ Max Units 200 ns ns See Note 4 1.6 1.8 p,s See Note 1 1.7 _p,s Step Rate = 3.2 p,s/step 8.7 p,s All other step rates 31 STEP Pulse Width 1.5 1.6 7.9 8.4 32 INDEX Pulse Width 500 33 RESET Pulse Width 24 34 RESET i to BCR 0 Test Conditions ns WRCLK See Note 2 3.2 6.4 p,s See Note 1 p,s See Note 1 35 RESET i to WR, CS ,J.. 6.4 36 WR CLOCK Frequency 0.25 5.0 5.25 MHz 50% Duty Cycle 37 RD CLOCK Frequency 0.25 5.0 5.25 MHz See Note 5 BRDY BDRD :~®;et --t ~ .f --t ~ ( _~6~®L(i!~ . m~ ~ WR CLOCK STEP~-~~ INDEX~ RD CLOCK 231242-23 231242-24 READ DATA TIMING WR CLOCK = 50 MHZ Symbol 38 Parameter RD CLOCK Pulse Width Min 95 39 RD DATA after RD CLOCK,J.. 10 40 RD DATA before RDCLOCK i 20 41 RD DATA Pulse Width 40 42 DRUN Pulse Width 30 6-664 Typ Max Units Test Conditions 2000 ns 50% Duty Cycle ns ns T38/2 ns ns intJ 82064 DR UN 231242-25 WRITE DATA TIMING WR CLOCK Symbol 43 = 5.0 MHZ Parameter Min WR CLOCK Pulse Width Typ Max Units Test Conditions 95 2000 ns 50% Duty Cycle 10 65 ns 10 65 ns 10 65 ns Propagation Delay 44A WR CLOCK i to WR DATA i 448 WR ClOCKJ,. toWR DATAJ,. 44D WR CLOCK J,. to WR DATA i 45A WR CLOCK i to EARLY flATE J,. 458 WR CLOCK J,. to EARLY flATE J,. 46A WR CLOCK i to EARLY flATE 468 WR CLOCK J,. to EARLY flATE i i WA CLOCK WRDATA 231242-26 6-665 infef 82064 A.C. TESTING INPUT, OUTPUT WAVEFORM A.C. TESTING LOAD CIRCUIT Input Output 2.4 20 045 0.8 '> ¥ DEVICE 20 TEST POINTS UNDER ~ " TEST 08 ~C';50PF -=- 23t242-27 231242-28 AC Testing: Inputs Are Driven At 2.4V For A Logic .1, And O.4SV For A Logic .0. Timing Measurements Are Made At 2.0V For a Logic .1, And O.BV For A Logic .0. CL Includes Jig Capacitance NOTES 1. Based on WR CLOCK = 5.0 MHz 2. 24 WR CLOCK periods = 4.8 I-'s at 5.0 MHz. 3. 2 WR CLOCK periods ± 100 ns. 4. Previous restrictions on BRDY no longer apply. There are no restrictions on when BRDY may come. BRDY may be connected directly to BDRO. 5. WR CLOCK Frequency = RD CLOCK Frequency ± 15%. 6. RD may be asserted before CS as long as it remains active for at least the minimum. T3 pulse width after CS is asserted. 7. WR may be asserted before CS as long as it remains' active for at least the minimum T11 pulse width after CS is asserted. 6-666 APPLICATION NOTE AP-182 July 1984 Multimodule ™ Winchester Controller Using the 82062 J. SLEEZER TECHNICAL MARKETING ® INTEL CORPORATION, 1984 Order Number: 231133-002 6-667 MULTIMODULETM WINCHESTER CONTROLLER USING THE 82062 CONTENTS INTRODUCTION ST506 Winchester Drive Overview 82062 WINCHESTER DISK CONTROLLER Clock Inputs Microprocessor Interface Sector Buffer Control Data Transfer Logic Drive Interface Microprocessor Interfaces PIN DESCRIPTIONS TASK REGISTER FILE Error Register Reduce Write Current Register Sector Count Register Sector Number Cylinder Number Low Register Cylinder Number High Register Sector/Drive/Head Register Status Register Command Register PROGRAMMING THE 82062 Commands Software Section: General Programming APPLICATION EXAMPLE iSBX Bus Multimodule Boards The SBX82062 Design Example Software Driver Overview 6-668 231133-002 CONTENTS CONTENTS APPENDIX A APPENDIX B STS06 INTERFACE SOFTWARE DRIVER THE STS06 INTERFACE Data Transfer Rate ID Fields APPENDIX C SCHEMATICS APPENDIX D Sector Interleaving Electrical Interface PAL SCHEMATICS ST 412 HP (High Performance) Interface 6-669 231133-002 Ap·182 drives. These posltIoners are used mainly because of their low cost. INTRODUCTION The 82062 Winchester Disk Controller (WDC) was developed to ease the complex task of interfacing Winchester disk drives to microprocessor systems. Specifically, the 82062 WDC interfaces to drives that conform to the ST506 specification, which is the dominant interface for 5'/. inch drives. This Application Note provides some background on the 82062 WDC, the drive interfaces and general software routines. It concludes with a design example using the 82062 WDC interfaced to the SBXTM bus. Appendix B contains the listing of the software necessary to operate this controller board. ST506 Winchester Drive Overview Since the 82062 WDC interfaces only to drives conforming to the ST506 specification, this overview will limit itself to those drives. A summary of the STS06 specification is shown in Appendix A for those who are not familiar with it. The ST506 Winchester Disk contains from I to 8 hard disks (or platters) with the average being 2 to 3 disks. These disks are made from aluminum (hence the term hard disk) anrl are coated with some type of recording media. The recording media is typically made of magnetic-oxide, which is similar to the material used on floppy disks and cassette tapes. Each side of a hard disk is coated with recording media and each side can store data. Each surface of a disk has its own read/write head. Hard disk drives are sealed units because the R/W heads actually fly above the disk surface at about 8 to 20 microinches. A piece of dust or dirt, which appears as a boulder to the gap between the heads and the disk surface, will wreak havoc upon the disk media. The R/W heads are mechanically connected together and move as a single unit across the surface of the disk. There are 2 basic methods for positioning the heads. The first is with stepper motors, which is the most common method and is also used on most floppy disk The second method of positioning the heads is to use a voice-coil mechanism. These units do not move in steps but swing across the disk. These mechanisms generally permit greater track density than steppers, but also require complex feedback electronics which increases the cost of the drive. Generally, voice-coil head positioners use closed loop servo positioning, as compared to the open loop positioning used with stepper motors. The surface of a disk is divided logically into concentric circles radiating from the center as shown in Figure I. Each concentric circle is called a track. The group of same tracks on all cylinders is collectively called a cylinder. The number of tracks on a surface (which affects storage density) is determined by the head positioners. Typically, stepper head positioners have fewer tracks than drives that use a voice coil positioner. Which type of positioner is used is irrelevant to the 82062 as positioners are part of the drive electronics. The 82062 can access up to 1024 tracks per surface. Once the surface is divided into cylinders it is further divided radially (as with a pie). The area between the radial spokes is referred to as a sector. The numoer of sectors per track is determined by many variables, but is basically determined by the number of data bytes and the length of the ID field (which locates a sector). Figure 2 shows one manufacturer's specifications for their drive. The manufacturer formats the drive with 32-256 byte sectors per track. Alternatively, the drive could be reformatted to contain 17-512. byte sectors per track. This second option has fewer sectors per track but stores more data. Determining how many bytes each sector contains is done by extensive analysis of the hardware and operating system. The 82062 WDC is programmable for sector size during formatting. The order in which sectors are logically numbered on the track is called interleaving. An interleave factor of four would have three sectors separating logically se- 231133-1 Figure 1 6-670 231133-002 AP-182 Capacity Unformatted Per Drive Per Surface Per Track Formatted Per Drive Per Surface Per Track Per Sector Sectors per Track Transfer Rate before repositioning the heads to another track. Repositioning the heads generates a longer delay due to the mechanical delay of moving the heads. Switching to another head incurs no mechanical positioning delay. Only one head can be selected at a time. 6.38 Megabytes I. 59 Megabytes 10416 Bytes Hard disk drives tend to be faster than floppies for two reasons. The speed at which the disk spins is about 10 times faster than the floppy (a floppy spins at 360 rpm). This yields an immediate one-tenth reduction in access times for the same size drive. While both ST506 drives and floppies use stepper motors, the steppers utilized by the hard disk drives are approximately twice as fast as those used by floppies. 5.0 Megabytes 1.25 Megabytes 8192 Bytes 256 Bytes 32 5.0 Megabits per second Access Time Track to Track Average (Inc. Settle) Maximum (Inc. Settle) Settling Time 3 ms 170 ms 500 ms 15 ms Average Latency 8.33 ms Functional Specifications Rotational speed Recording density Flux densi ty Track density Cylinders Tracks R/W Heads Disks 3600 rpm± 1% 7690 bpi max 7690 fci 255 tpi 153 612 4 2 82062 WINCHESTER DISK CONTROLLER The 82062 WDC provides most of the functions necessary to interface between a microprocessor and an ST506 compatible disk drive. The 82062 converts the high level commands and parallel data of a microprocessor bus into ST506 compatible disk control signals and serial MFM encoded data. This section presents a detailed description of the 82062 and a discussion of various techniques which can be used to interface the 82062 to a microprocessor. The internal structure of the 82062 is divided into several sections as shown in Figure 3. They are: I. the microprocessor interface which includes the status and task registers; 2. sector buffer control; Figure 2. A Typical Drive Specification 3. the drive interface; quential sectors. Starting at the index pulse, an example of four way interleaving is: 4. and the data transfer section, which includes the CRC logic and the conversion and MFM encoding/ decoding of microprocessor data. Sector I, Sector X, Sector Y, Sector Z, Sector 2, Sector . . . Interleaving is used primarily because one sector at a time is transferred from disk to sector buffer to system RAM. Without interleaving, the delay in transferring data would result in sectors on the disk rotating past the heads. The operating system would then have to wait one disk revolution to get to the next sector (a 16.7 msec delay). With interleaved sectors, the next logical sector would be positioned beneath the heads after the previous sector of data had been transferred to the system RAM. Interleaving unfortunately slows down the overall transfer rate from the disk. A 5 Mbit/second transfer rate averages out to a 1.25 Mbit/second transfer rate when many sectors are transferred with four way interieaving. Again, how much interleaving to use is determined by extensive hardware/software benchmarking. Whenever data is stored on a multiple platter disk drive, the same track on all surfaces whould be used Clock Inputs The 82062 has two clock inputs: read clock (RD CLOCK) and write clock (WR CLOCK). The PLA controller, the processor interface, buffer control and MFM encoding sections operate off the WR CLOCK input. The RD CLOCK input is used only for decoding the MFM data stream. The clocks may be asynchronous to one another. Both clocks have non-TTL compatible inputs. The easiest method to interface to TTL requires a pull-up resistor to satisfy their input voltage needs. The resistor's value must be compatible with the VIL specification of these pins. See the Pin Descriptions Section for more specific information. Microprocessor Interface The microprocessor interface of the 82062 contains the control logic which permits commands and data to be 6-671 231133-002 AP-182 080·7 -f4 DATA REG 1/0 BUFFERS MFM J--. WR DATA ....._E_N_C_O_D_E_R--II_ WR CLOCK MFM DECODER RD WR RD CLOCK AO-2 INTRQ RESET AM DETECT CS PLA CONTROLLER I- RD DATA STEP DIR BCR BRDY EARLY BDRQ LATE BCS TRACK 000 Vcc---' GND--+ WR GATE RD GATE DRUN 231133-2 Figure 3. 82062 Internal Block Diagram transferred between the host and the 82062. The interface consists of an 8 bit, tri-state, bidirectional data bus; the task registers; a 3 to 8 address decoder for selecting one of the seven registers; and the general read, write, and chip select logic. Externally, the 82062 expects a buffer equal in size to a sector on the disk, and tri-state transceivers between the sector buffer and the microprocessors data bus in order to isolate itself from the microprocessor during disk data transfers. AO-A2, Data Bus These three address lines are active high signals and select one of the seven register locations in the 82062. They are not latched internally. If the three addresses are equal to 0 and the 82062 is selected, the data bus is kept tri-stated to ease interfacing to a sector buffer. The 82062's data bus is controlled by both the microprocessor and the 82062. The microprocessor has control for loading the registers and command. During disk reads or writes, control switches to the 82062 so that it may access the local sector buffer when transferring data between the disk and the buffer. RD, WR,CS The chip select (CS) is typically decoded from the higher order address lines. CS only permits data to be placed into, or read from, the 82062's task registers. Once a disk operation starts, CS no longer efffects the 82062. RD and WR are bidirectional lines and are used to read or write the 82062's registers by the host microprocessor and are valid only if CS is present. The 82062 will drive RD and WR when transferring data between the sector buffer and the disk. A signal is provided to tri-state the RD and WR lines from the host during a buffer access. This is covered in the Sector Buffer Control Section. Interrupts An interrupt is issued at the end of all commands, and the interrupt is cleared by reading any register. For the Read Sector command only, the 82062 allows the user the option of an interrupt ~ither at the termination of the command, as is the case with all other commands, 6-673 231133-002 AP-182 Polled Interface Since the 82062 isolates itself from the host during several commands, the host cannot read the status register during some periods to deterinine what course should be taken. In Figure 10, trying to read the status register when BeS is active will return indeterminate data. To prevent the microprocessor from reading this indeterminate data, a hardware generated "Busy" pattern should be driven onto the data bus if BeS is active. This is shown in Figure 11. The status register contains a data request (DRQ) bit whose timing is equal to the BDRQ output signal, thus making a polled operation possible. DRQ will stay set in the status register until a BRDY is generated. One design issue with the polled interface occurs when the microprocessor is polling the status and the 82062 deactivates Bes. The microprocessor would normally read the hardware busy pattern. If BeS is deasserted, the hardware pattern is disabled and the microprocessor will start to read the real status register. The read cycle may almost be finished, and the read access period of the 82062 will not be satisfied. The data returned to the microprocessor will be invalid. Interrupt Interface . There are cases where the designer does not want to tie up the microprocessor with polling. The typical 82062 design will need two interrupts per command. One for a data transfer and one for the completion of the command. The 82062 has an output to issue an interrupt when the command has finished. However for data transfers an interrupt must be generated from the BDRQ line as shown in Figure 12 (whether a DMA controller is used or not). When a data transfer is needed, the 82062 will activate the BDRQ line. The microprocessor will be interrupted and do the data transfer function. BDRQ will stay active until BROY is generated, so the system must either use edge triggered interrupts or must not write the end-of-interrupt byte until BDRQ is removed (this is true of Intel's 8259A). PIN DESCRIPTIONS Pin. No. Type Name and Function BCS Symbol 1 0 Buffer Chip Select: Output used to enable reading or writing of the external sector buffer by the 82062. When low, the host should not be able to drive the 82062 data bus, RD, or WR lines. BCR 2 0 Buffer Counter Reset: Output that is strobed by the 82062 prior to read/write operation. This pin is strobed whenever BCS changes state. Used to reset the address counter of the buffer memory. INTRQ 3 0 Interrupt Request: Interrupt generated by the 82062 upon command termination. It is reset when any register is read. Optionally signifies when a data transfer is required on Read Sector commands. N/C 4 RESET 5 I Reset: Initializes the controller and clears all status flags. Does not clear the Task Registers. RD 6 I/O Read: As an input, RD controls the transfer of information from the 82062 registers to the host. RD is an output when the 82062 is reading data from the sector buffer (BCS low). WR 7 I/O Write: As an input, WR controls the transfer of command or task information into the 82062 registers. WR is an output when the 82062 is writing data to the sector buffer (BCS low). CS 8 I Chip Select: Enables RD and WR as inputs for access to the Task Registers. It has no effect once a disk command starts. Address: Used to select a register from the task register file. No connection. Reserved for future use. AO-A2 9-11 I DBO-DB7 12-19 I/O Data Bus: Bidirectional 8-bit Data Bus with control determined by BCS. When BCS is high the microprocessor has full control of the data bus for reading and writing the Task Registers. When BCS is low the 82062 controls the data bus to transfer data to or from the buffer. 6-674 231133-002 AP-182 Pin Descriptions (continued) Symbol Pin. No. Type Name and Function GND 20 Ground. WR DATA 21 0 Write Data: Open drain output that shifts out MFM data at a rate determined by Write Clock. Final stage requires an external flip·flop clock at 10 MHz. See note 1. LATE 22 0 Late: Open drain output used to derive a delay value for write precompensation. Valid when WR GATE is high. Active on all cylinders. See note 1. EARLY 23 0 Early: Open drain output used to derive a delay value for write precompensation. Valid when WR GATE is high. Active on all cylinders. See note 1. WR GATE 24 0 Write Gate: High when write data is valid. WR GATE goes low if the WR FAULT input is active. This output is used by the drive to enable head write current. WR CLOCK 25 I Write Clock: Clock input used to derive the write data rate. Frequency - 5 MHz for the ST506 interface, 4.34 MHz for the SA 1000 interface. See Note 2. DIR 26 0 Direction: High level on this output tells the drive to move the head inward (increasing cylinder number). The state of this signal is determined by the 82062's internal comparison of actual cylinder location vs desired cylinder. STEP 27 0 Step: Provides 8.4 microsecond pulses to move the drive head to another cylinder at a programmable frequency. DRDY 28 I Drive Ready: If DRDY from the drive goes low, the command will be terminated. INDEX 29 I Index: Signal from the drive indicating the beginning of a track. It is used by the 82062 during formatting, and for counting retries. Index is edge triggered. Only the rising edge is valid. WR FAULT 30 I Write Fault: An error input to the 82062 which indicates a fault condition at the drive. If WR FAULT from the drive goes high, the command will be terminated. TRACK 000 31 I Track Zero: Signal from the drive which indicates that the head is at the outermost cylinder. Used by the Restore command. SC 32 I Seek Complete: Signal from the drive indicating to the 82062 that the drive head has settled and that reads or writes can be made. SC is edge triggered. Only the rising edge is valid. RWC 33 0 Reduced Write Current: Signal goes high for all cylinder numbers above the value programmed in the Write Precomp Cylinder register. It is used by the precompensation logic and by the drive to reduce the effects of bit shifting. DRUN 34 I Data Run: This signal informs the 82062 when a field of ones or zeros has been detected by an external one-shot. This indicates the beginning of an ID field. RD GATE is brought high when DRUN is sampled high for 16 clock periods. See Note 2. BRDY 35 I Buffer Ready: Input used to signal the controller that the buffer is ready for reading (full), or writing (empty), by the host fLP. Only the rising edge indicates the condition. 6-675 231133-002 AP-182 I I o Figure 5. Data Address Mark from issuing a similar data byte and possibly confusing detection logic. MFM Encoding/Decoding The MFM encoding section will receive 8 bit parallel data when a valid command has been recognized and BRDY has gone high. The parallel data is first serial· ized and converted to an intermediate, NRZ encoded, data stream. The serial NRZ data is sent to the MFM encoding section and then transferred to the disk. De· coding "of the MFM bit stream (during disk reads) hap· pens in reverse order. The control logic operates off the write clock (WR CLOCK) running at a frequency of the desired tranfer rate. The MFM decoding portion operates off of the read clock (RD CLOCK) input, which is supplied by an external phase lock loop. The two clocks need not be synchronized to each other. Data is written (and hence read) with the most significant bit first. Address Mark Detector The address mark is a unique 2 byte code written at the beginning of each ID field and· data field .. This address mark serves two purposes. It tells the controller what type of data is about to be received so that internal computations can be performed, and to ensure that ID fields are not sent to the host. The second purpose is to align the serial data back to the. original 8 bit boundaries that existed when data was written (there are no byte boundaries on a disk). An address mark is always preceded by the all zeros synchronization field. The 82062 starts comparing the incoming data stream when the synchronization field ends. A high speed comparator is used since the 82062 does not yet know where the proper' byte boundaries are. When a proper comparison of the address mark is made the controller starts asscmbling bytes, starting with the second byte of the address mark. The first byte of the address mark is an "AI" Hex, but purposely violates the MFM encoding rules by removing a clock pulse. In Figure 5, the first example is of a norm,al MFM encoded AIH. The second example is of the address mark and shows the missing clock pulse. The non-MFM compatible AI is to prevent the host The second byte specifies either an ID or data field and is encoded according to normal MFM rules. It is either an "F8" Hex for a data field, or "FC(' through "FF" for an ID field. The different values correspond to a range of cylinders on the drive in increments of 256 tracks. The 82062 makes no use of this information, but writes it for compatibility with the ST506 specification during formatting. CRC Generation/Checking The CRC generator computes and checks the cyclic redundancy check bytes that are appended to the ID and data fields. CRC generation/checking is always done on ID fields. Data fields have a choice between 82062 CRC or externally supplied ECC. Read Sector commands with a CRC error will still have transferred the data into the sector buffer. When bit 7 in the SDH register is low (enabling CRC for data fields) the CRC bytes are not transferred to the sector buffer or host. . The generator polynomial for the CRC-CCITT (CRC16) code is: x16 x12 + + x12 + x5 + 1 x4 + x3 + x2 = + (x + 1) (x15 x + 1) + x14 + x13 + The code's capability is as follows: a) Detects all occurrences of an odd number of bits in error. b) Detects all single, double, and triple bit errors if the record length (including check bits) is less than 32,767 bits. c) Detects all single-burst errors of sixteen bits or less. d) Detects 99.99695% of all possible 17 bit burst er· rors, and 99.99847% of all possible longer burst, assuming all errors are possible and equally probable. The CRC code has some double-burst capability when used with short records (sectors). For a 256 byte sector the code will detect double-bursts as long as the total number of bits in error does not exceed 7. 6-676 231133-002 AP-182 head from the present cylinder position to the desired position. A separate high speed equivalence comparator is used to compare ID field bytes when searching for a sector ID field. PLA Control The PLA Controller interprets command sent by the microprocessor. Its operation is synchronized to the WR CLOCK input. The PLA controller is started when a command is written into the command register. It generates control signals and operates in a handshake mode when communicating with the MFM decoding block. Drive Interface The drive interface of the 82062 contains the logic that makes possible the storage and reliable recovery of data. This interface consists of the drive and head select logic, the disk control signals, and read and write data logic as shown in Figure 6. This section describes the external circuitry which is required to complete the 82062's drive interface. Magnitude Comparator A 10 bit magnitude comparator is used to calculate the direction and number of step pulses needed to move the 2X DATA RATE _,~a~ EARLY LATE AWC WRITE PRECOMP I-- n WINCHESTER DRIVE 0 12 '/2 READ DATA READ CLOCK DRUN READ GATE I PHASE LOCK LOOP r-- WRITE DATA READ DATA DRIVE SEL ~ STEP 82062 WDC DATA RATE OSC WR CLOCK 0 ~ DIRECTION TO NEXT DRIVE ~ READY ~ WRITE FAULT ~ TRACK 000 INDEX TRACK 000 DRDY WR FAULT DIR WR GATE STEP --- ... ~ :: SC ::. ::....... : INDEX SEEK COMPLETE AWC HEAD NUMBER WRITE GATE :.. DATA BUS- 0 ADDRESS- 71 DAISY CHAIN TO NEXT DRIVE °7 (HOLDS DRIVE AND HEAD SELECTS) DATA LATCH 231133-5 Figure 6. Drive Interface 6-677 231133-002 Ap·182 MULTIPLEXOR ...--------t A WR DATA FLIP FLOP 8 2 0 6 2 _..J:::::;:---.a TO DISK C 10 MHz .----1 } SELECT LINES EARLY LATE RWC 231133-6 Figure 7. Write Precompensation Logic Drive/Head Select The 82062 has no outputs for selecting the head or drive. Therefore these signals must be generated by the user as shown in Figure 6. Data bits 0-4 should be latched whenever the SDH register is written. Bits 0-2 would then be driven onto the drive cable with open collector buffers. Bits 3 and 4 would be decoded after being latched, then buffered for the cable. The head information written to the 82062's SDH register is used to write the proper ID fields during formatting. Changing the drive bits in the SDH register will cause a Scan ID to be performed by the 82062 to update non user accessible registers. Drive Control The drive control (STEP, DIR, WR FAULT, TRACK 000, INDEX, SC, RWC, and WR GATE) signals are merely conditioned for transmission over the drive cable. The purpose of each pin can be found in the sec- tion on Pin Descriptions and their use in the Command Section. WR DATA, EARLY, LATE Figure 7 is a diagram of the interface required on the write data line. The final stage of the MFM encoding requires applying the WR DATA to an external flipflop clocked at 10 MHz. The 82062 monitors the serial write data output for particular bit patterns that require precompensation to prevent bit shifting. EARLY and LATE are active on all cylinders and will normally require that RWC be factored into them to activate the data precompensation on the proper cylinder. A delay line is required to generate the delayed data for precompensation since the actual delay varies between drive manufacturers. EARLY and LATE go active in the same clock period that generates the data bit to be . shifted. 1 - - - - - - - - 1 DRUN r-----------------~RDGATE FROM DISK 82062 ;>r-~~r::::::-""""~""""""r=====~""~RDDA~ VCO RD CLOCK 10 MHz OSC I-------.. WR CLOCK 231133-7 Figure 8. Data Recovery Logic 6-678 231133-002 AP-182 RD Data, DRUN, RD Gate The read data interface is shown in Figure 8, and consists of the data run (DRUN) signal and a phase lock loop to generate the RD CLOCK input to decode the serial data. DRUN is generated from a retriggerable one-shot with a period just exceeding one bit cell. A sync field consisting of a string of clock pulses will continually retrigger the one-shot producing a steady high level on DRUN. The 82062 counts off 16 clock pulses internally, and if DRUN is still active, will make RD GATE active. Any byte other than an address mark will deactivate RD GATE and the sequence starts over. quest input. The DMA controller will generate reads or writes which will increment an address counter. BRDY indicates that the data transfer has finished and is issued off the carry-out line (or high order address line) of the counter. The 82062 will assert BDRQ at this point and activate BCS to prevent the host from intefering with disk/buffer transfers. There can be no polling for a data transfer or a register read without an interrupt in this scheme. The phase lock loop generates RD CLOCK which is used to decode the incoming serial data. Until RD GATE is activated by the 82062, the phase lock loop (PLL) should be locked onto a local 10 MHz clock to minimize PLL lock-up times. When RD GATE is activated, the PLL starts locking onto the incoming data stream, which should consist of the all zeros sync field. Once the PLL locks onto this synch field, the 82062 will start examining the serial data for a non-zero byte. A non-zero byte will be indicated by DRUN dropping since the address mark follows the sync field and is an "AI" Hex. This sequence is shown in Figure 9. If the address mark is detected, and if it was preceded by at least 9 bytes of zeros, RD GATE will stay active. The 82062 will then assemble bytes of data, and ensure the proper ID field is found. If a non-zero or non-address mark byte was detected, RD GATE will go inactive for a minimum of 2 byte times. If a data field or the wrong ID field is detected, or the ID field was not preceded by 8 bytes of zeros, then RD GATE goes inactive and the sequence starts over with the 82062 examining the DRUN input. RESET RD GATE Microprocessor Interfaces This section shows the general 82062 interfaces to a microprocessor system. There are essentially four interfaces which consist of a combination of polled, DMA, and interrupts. While the 82062 was designed to interface directly to one type, it accommodates all with minor additional logic. DMA Interface The 82062 is designed to use a DMA controller for data transfer between its sector buffer and the host system, and to interrupt the host when the command has finished. This interface is shown in Figure 10. When the 82062 determines that a transfer is needed between the sector buffer and the host (either at the beginning of a command or through BRDY going active in a multiple sector transfer), it will assert BDRQ. BDRQ will initiate a DMA transfer via theDMA re- DONE 231133-8 Figure 9. PLL Control Sequence 6-679 231133-002 AP-182 ~-----IBRDY 82062 TO uP ~~---------+~-------------------IBCSI 8237A 1--l1>--------~H--------------____I WRI ~-------~-.--------------___IRDI 1-----~--------------------------__1BDRa INTRa 231133-9 Figure 10.82062 DMA Interface t------iBROY 82062 ,231133-10 Figure 11. 82062 Polled Interface I------IBROY 82062 t----------l~----------------____IBCSI ~--------4_+----------------___IROI ~-----------.----------------___IWRI BORa INTRa 231133-11 Figure 12. 82062 Interrupt Interface 6-680 231133-002 AP-182 Bit 2 - Aborted Command Sector Number This bit is set if a command was issued or in progress while DRDY (Pin 28) was deasserted or WR FAULT (Pin 30) was asserted. The Aborted Command bit will also be set if an undefined command is written into the COMMAND register, but an implied seek will be executed. This register holds the sector number of the desired sector: Bit 1 - TRACK 000 For a multiple sector command it specifies the first sector to be transferred. It is decremented after each sector is transferred to/from the sector buffer. The SECTOR NUMBER register may contain any value from 0 to 255. The ID Not Found bit will be set if the desired sector cannot be located on the track. This bit is set only by the RESTORE command. It indicates that TRACK 000 (Pin 31) has not gone active after the issuance of 1024 stepping pulses. 7 6 4 5 o 2 3 SECTOR NUMBER Bit 0 - Data Address Mark This bit is set during a READ SECTOR command if the Data Address Mark is not found after the proper Sector ID is read. The SECTOR NUMBER register is also used to program the Gap 1 and Gap 3 lengths to be used when formatting a disk. See the WRITE FORMAT command description for further explanation. Reduce Write Current Register Cylinder Number Low Register This register is used to define the cylinder number where RWC (Pin 33) is asserted: This register holds the lower byte of the desired cylinder number: 7 6 5 4 3 2. o 7 6 4 5 3 o 2 CYLINDER NUMBER I 4 LS BYTE OF CYLINDER NUMBER The value (0-255) written into this register is internally multiplied by 4 to specify the actual cylinder where RWC is asserted. Thus a value of 01H will cause RWC to activate on cylinder 4, 02H on cylinder 8 and so on. RWC will be asserted when the present cylinder is greater than or equal to the cylinder indicated by this register. For example, one ST506 compatible drive requires precompensation on cylinder 128 (80H) and above. Therefore the REDUCE WRITE CURRENT register should be loaded with 32 (20H). A value of FFH will keep the RWC output inactive regardless of the actual cylinder number. It is used in conjunction with the CYLINDER NUMBER HIGH register to specify a range of 0 to 1024 tracks. Cylinder Number High Register This register holds the two most significant bits of the desired cylinder number: 7 6 543 2 Ix x x x x X Sector Count Register This register is used to define the number of sectors that need to be transferred to the buffer during a READ MULTIPLE SECTOR or WRITE MULTIPLE SECTOR command. 7 6 5 4 3 2 o # OF SECTORS The value contained in the register is decremented after each sector is transferred to/from the sector buffer. A zero represents a 256 sector transfer, a one a I sector transfer, etc. This register is ignored when single sector commands are specified in the Command register. = x o (9) (8) ignored The 82062 contains a pair of registers that store the actual position where the R/W head are located. The CYLINDER NUMBER HIGH and LOW registers are considered the cylinder destination registers for seeks and other commands. The 82062 compares its internal registers to the destination registers and issues the number of steps in the right direction to make both sets of registers equal. After a command is executed, the internal cylinder position registers' contents are equal to the cylinder high/low registers. If a drive number change is detected on a new command, the 82062 automatically reads an ID field to update its internal cylinder position registers. This affects all commands except a RESTORE. 6-681 231133-002 AP-182 Pin Descriptions (continued) Pin. No. Type BORQ Symbol 36 0 Buffer Data Request: Activated during Read or Write commands when a data transfer between the host and the 82062's sector buffer is required. Typically used as a OMA request line, or to generate an interrupt. Name and Function RO DATA 37 I Read Data: Single ended input that accepts MFM data from the drive. See note 2. ROGATE 38 0 ROCLOCK 39 I Read Clock: Clock input derived from the external data recovery circuits. See note 2. Vee 40 I D.C. Power: 10 Read Gate: Output that is high for data and fields. Goes active when ORUN has been high for 16 WR CLOCK periods to permit the external phase lock loop to lock onto the incoming disk data stream. + 5V NOTES: I. This pin requires a pull·up resistor to function properly. A value of 1000 ohms will work satisfactorily. 2. This pin requires input levels that are not TTL compatible. These lines can be interfaced to TTL with a pull-up resistor. Too small of a resistor will produce a VIL level that is too high. Too large of a resistor will degrade the signal's rise time. A minimum value for the resistor is determined as follows: (Vee max) - (82062 VIL max) = Resistor (TTL IOL min.) - (82062 IlL max) TASK REGISTER FILE The Task Register File is a bank of registers used to hold parameter information pertaining to each command. These registers and their addresses are: A2 A1 AO 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 READ WRITE (Bus Tri-Stated) Error Flags Sector Count Sector Number Cylinder Low Cylinder High SOH Status Register (Bus Tri-Stated) Reduce Write Current Sector Count Sector Number Cylinder Low Cylinder High SOH Command Register Bit 7 - Bad Block Detect This bit is set when an ID field has been encountered that contains a bad block mark. The bad block bit is set only during formatting. The 82062 will terminate a command if an attempt is made to read a sector that contains this bit. Bit 6 - eRe Data Field This bit is set when a data field eRe error has occurred. The sector buffer may still be read but will contain errors. NOTE: Registers are not cleared by RESET Bit 5 - Reserved. Not used. Set to zero. Error Register Bit 4 - ID Not Found This read-only register contains specific error status after the completion of a command. If any bit in this register is set, then the Error bit in the Status Register will also be set. The bits are defined as follows: This bit is set when the desired cylinder, head, sector or size parameter cannot be found after 8 revolutions of the disk, or if an ID field eRe error has occurred. 76543210 IBBO ICRC 1-110 I-I AC ITKOOO IOM I Bit 3 - Reserved. Not used. Set to zero. 6-682 231133-002 AP-182 Sector IDrive/Head Register During other non-data transfer commands, Busy should be ignored as it will go active for short periods. The SDH register contains the desired sector size, drive number, and head number parameters. The format is shown below. Bit 6 - Ready 7 EXT 6 5 SECT SIZE 4 3 DRIVE 2 This bit reflects the state of the DRDY (Pin 28) line at the time the microprocessor reads the status register. Transitions on the DRDY line will abort a command and set the aborted command bit in the error register. 0 HEAD # Bit 5 - Write Fault Both head number and sector size are compared against the disk's ID field. Head select and drive select lines are not available as outputs from the 82062 and must be generated externally. This bit reflects the state of the WR FAULT (Pin 30) line. Transitions on this line will abort a command and set the aborted command bit in the error register. Short transitions on DRDY and WR FAULT may not show up in the status register. These pins are not latched until the microprocessor reads the status and by that time the error condition may have disappeared. However the aborted command bit will be set to notify the host of an error. To hold short transitions on these pins it is recommended that they be latched. Bit 7, the extension bit (EXT), is used to extend the data field by seven bytes when using ECC codes for READ/WRITE SECTOR commands. When EXT = 1, the CRC is not appended to the end of the data field and the data field becomes "sector size + 7" bytes long. The CRC is checked on the ID field regardless of the state of EXT. The SDH byte written into the ID field is different than the SDH Register contents. The reccorded SDH byte does not have the drive number (DRIVE) written but does have the BAD BLOCK mark written. The EXT bit must not be set during the Format command. Bit 4 - Seek Complete This bit reflects the state of the SC (Pin 32) line. Commands which initiate a seek will pause until Seek Complete is set. Note that use of the extension bit requires the gap lengths to be modified as described in the WRITE FORMAT command description. Bit 3 - Data Request The Data request bit (DRQ) reflects the state of the BDRQ (Pin 36) line. It is set when the sector buffer should be loaded with data or read by the host processor, depending upon the command. The DRQ bit and the BDRQ line remain high until BRDY is sampled, indicating the operation has completed. Status Register The status register is a read-only register which informs the host of certain events. This register is a flowthrough latch until the microprocessor reads it at which point the drive status lines are latched. The INTRQ line will be reset when this register is read. The format is: I 76543210 I I I I BUSY READY WF SC DRO I-I I CIP ERROR Bit 2 - Reserved Not used. Set to zero. I Bit 7 - Busy This bit is set whenever the 82062 is transferring data between its sector buffer and the disk and reflects the state of the BCS pin. When BCS is active, the host should not access the sector buffer or any 82062 register. The 82062 will be generating a RD or WR pulse every 1.6 fl.sec and the host must not interfere with these data transfers. Busy is cleared when the data transfer operation is completed. Bit I - Command in Progress When this bit is set, a command is being executed and a new command should not be loaded until it is cleared. Although a command may be executing, the sector buffer is still available for access by the host processor. If CIP is set, only the status register can be read regardless of which register is selected. Bit 0 - Error This bit is an OR of the contents of the error register. Any bit being set in the error register sets this bit. This bit is cleared when a new command is loaded. 6-583 231133-002 AP-182 Command Register COMMAND T - This write-only register is loaded with the desired command: 7 6 5 4 o 2 3 T T = = 6 5 4 3 2 Retry Enable 0 1 M= COMMAND 7 Enable Retries Disable Retries Multiple Sector Flag M = 0 Transfer 1 Sector M = 1 Transfer Multiple Sectors The 82062 begins to execute immediately upon loading any value into this register. This register should not be written while the Busy or Command in Progress bits are set in the STATUS register. The INTRQ line (Pin 3) if set, will be cleared by a write to the COMMAND register. . I = I = 0 I = 1 Interrupt Enable Interrupt at BDRQ time Interrupt at end of command Instruction Set Programming the 82062 The 82062 WDC instruction set contains six commands. Prior to loading the command register, the host processor must first set up the Task Register File with the information needed for the command. Except for the COMMAND register, the registers may be loaded in any order. If a command is in progress, a subsequent write to the COMMAND register will be ignored. A command is finished when the command in progress (CIP) bit in the STATUS register is cleared. See the Command Section for an explanation of each command. This section consists of two parts. The first part gives an explanation of each command, a flowchart showing the 82062's sequence of events, and the commands' sequence of events as seen by the host microprocessor. The second section shows flowcharts of general software routines and their PLM equivalent, for both polled and interrupt driven software. COMMAND RESTORE SEEK READ SECTOR WRITE SECTOR SCANID WRITE FORMAT R 3-0 = 7 6 5 4 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 0 1 0 Rate Field For 5 MHz WR Clock: 0000- ::::35 f..ts 0001 - 0.5 ins 0010 -1.0 ms 0011 -1.5 ms 0100-2.0 ms 0101-2.5ms 0110 - 3.0 ms 0111 -,- 3.5 ms 1000-4.0 ms 1001 - 4.5 ms 1010-5.0 ms 1011 -5.5 ms 1100 -6.0 ms 1101-6.5 ms 1110-7.0ms 1111 -7.5 ms 3 1 R3 1 R3 0 I 1 0 0 0 1 0 2 1 R2 R2 M M 0 0 Rl Rl 0 0 0 0 RO RO T T T 0 The designer must remember that the 82062 expects a full sector buffer that can be isolated from the host during data transfers between the 82062 and the disk. Since the 82062 assumes a full sector buffer is available, it does not check for data overrun or underrun error conditions. If such a condition occurs, corruption of data will happen and the host will have no indication of an error. The design must guarantee against over-run and under-run conditions when not using the sector buffer approach. Commands A command is placed into the command register only after the Task Registers have been written with proper values. The Task Registers may be loaded in any order. A command, once started, can only be terminated by a hardware reset to the 82062. This may corrupt data on the disk by removing necessary control signals out of sequence. The general sequence of a command is as follows: - The host loads the Task Registers - The host loads the Command Register The 82062 locates the correct cylinder - Data transfer takes place The 82062 issues an interrupt 6-684 231133-002 AP-182 Restore Command - o 0 0 1 R3 R2 R 1 RO The Restore command is used to position the heads to cylinder O. This command must be issued to the 82062 on power-up to initialize internal registers. The user specified rate field (R3-RO) is stored internally for FUTURE use in commands with implied seeks. The step rate value is not used with this command. The actual stepping rate used is dependent upon the handshake delay between the 82062 issuing a step pulse and the drive returning a seek complete for each track (roughly 20 ms). After each step pulse is issued, the 82062 waits for a rising edge on the Seek Complete (SC) line before issuing the next pulse. If 8 index pulses are received without a rising edge on SC, the 82062 will switch to sampling the level of the SC line. If after 1,024 step pulses the Track 00 signal has not gone active,· the ( RESTORE 82062 will terminate the command and set the TRACK 000 bit in the Error Register. The command will terminate ifWR Fault goes active or DRDY goes inactive at any time. Figure 13 is a flow chart of the command. This command should precede the format command. The format command will be aborted if an ID field is not present (because the disk was never formatted) and ) SET ABORTED COMMAND BIT SET TRACK 000 ERROR ISSUE A STEP PULSE 231133-12 231133-13 Figure 13. Restore Command Flow Figure 14. Seek Command Flow 6-685 231133-002 AP-182 a new drive is selected. Recall the 82062 will do a Scan ID to update internal registers when the drive is changed. This information is used to calculate the number of steps required to get to the destination cylinder. When the heads are positioned to track zero the 82062 will not try to read an ID field, but will issue the correct number of steps. Read Sector Command 0010lMOT The READ SECTOR command is used to transfer one or more sectors of data from the disk to the sector buffer. Upon receipt of the READ SECTOR command, the 82062 checks the CYLINDER NUMBER LOW/HIGH register pair against an internal cylinder position register to see if they are equal. If not, the direction and number of steps are calculated and a seek takes place. If an implied seek is performed, the 82062 Seek Command 1 1 1 R3 R2 R1 RO o The Seek command positions the heads to the cylinder specified in the Task Registers. The direction and number of step pulses issued is calculated by comparing the cylinder high/low regi~ters to an internal "present position" cylinder register. The present position register is updated after all step pulses are issued and the command is terminated. The Seek Complete input is not checked. The actual stepping rate is taken from the rate field bits (R3-RO) and stored for future use. The command terminates at once if WR FAULT goes active or DRDY goes inactive at any time. Figure 14 is a flowchart of the command. SET INTRC. AC RESET BUSY, CIP Since the data transfer commands feature implied seeks, this command is of use mainly to those using multiple drives and software that can take advantage of overlapped seeks. Scan 10 Command 0100000T The Scan ID command is used by both the 82062 and the host to update the SDH, the Sector Number, Cylinder and internal present position registers. Once the command is issued, the Seek Complete line is sampled until valid. The first ID field found, as indicated by the address mark, is loaded into the previously mentioned registers. The Bad Block bit will be set if detected, and the command will terminate. ID CRC errors will start the search sequence over for a maximum of 10 index pulses, but the registers will be loaded with whatever data the 82062 had perceived as ID information. Improper states on WR Fault on DRDY will terminate the command. Figure 15 is the flow chart of the command. The main use for this command is to determine where the heads are currently located and what size the sectors are (i.e. 256, 512 etc.). Without this command, it would be necessary to recall the heads to track zero and then step out to the desired cylinder each time a drive was changed. Specifying the wrong sector size would yield an ID not found error. This command enables the system to read the disk drive to determine what size sectors were'recorded. 6-686 SET BAD BLOCK BIT 'IF RETRIES ARE DISABLED, PATH IS TAKEN AFTER 2 INDEX PULSES 231133-14 Figure 15. Scan 10 Command Flow 231133-002 AP-182 will search until a rising edge of SC is received. The WR FAULT and DRDY lines are monitored throughout the command. When the data address mark is found, the 82062 is ready to tranfer data to the sector buffer. After the data has been transferred, the I bit is checked. If I = 0, INTRQ is made active coincident with BDRQ, indicating that a transfer of data from the buffer to the host processor is required. If I = I, INTRQ will occur at the end of the command, i.e. after the buffer is unloaded by the host. Once the Seek Complete (SC) line is high (with or without an implied seek having occurred), the search for an ID field begins. If T = 0 (retries enabled), the 82062 must find an ID with the correct cylinder number, head, sector size, and CRC within 10 revolutions, or a Scan ID and re-Seek will be performed. The search for the proper ID will again be tried for up to 10 revolutions. If the correct sector is still not found, the appropriate error bits will be set and the command terminated. Data CRC errors will also be retried for up to 10 revolutions (if T = 0). The M bit is set for multiple sector transfers. When M = 0; one sector is transferred and the SECTOR COUNT register is ignored. When M = I, multiple sectors are transferred. After each sector is transferred, the 82062 decrements the SECTOR COUNT register and increments the SECTOR NUMBER register. The next logical sector will be transferred regardless of any interleave. Sectors are numbered at format time. If T = I (retries disabled), the ID search must find the correct sector within 2 revolutions or the appropriate error bits will be set and the command terminated. Both the READ SECTOR and WRITE SECTOR commands feature a "simulated completion" to ease programming. DRQ/BDRQ will be generated upon detecting an error condition. This allows the same program flow for successful or unsuccessful completion of a command. Multiple sector transfers continue until the SECTOR COUNT register equals zero, or the BRDY line goes active (low to high). If the SECTOR COUNT register is non-zero (indicating more sectors are to be transferred but the buffer is full), BDRQ will be made active and the host must unload the buffer. After this occurs, the buffer will again be free to accept the remaining sectors from the 82062. This scheme enables the user to transfer more sectors than the buffer memory has capacity for. In summary then, READ SECTOR operation is as follows: When M = 0 (READ SECTOR) . ( 1) ( 2) ( 3) ( ( ( ( ( ( 4) 5) 6) 7) 8) 9) (10) (11 ) Host: 82062: 82062: 82062: 82062: 82062: Host: 82062: 82062: Host 82062: Sets up parameters; issues READ SECTOR command. Strobes BCR; sets BCS = Finds sector specified; transfers data to buffer. Strobes BCR; sets BCS = 1. Sets BORa = 1; ORO = 1. If I bit = 1 go to (9). Reads contents of sector buffer. Waits for BRDY, then sets INTRa = 1: END. Sets INTRa = 1. Reads out contents of buffer; END. If I = 1 wait for BRDY, then clear BORa; END. o. When M = 1 (READ MULTIPLE SECTOR) (1) (2) (3) (,4) (5) (6) (7) (8) (9) (10) (11) Host: 82062: 82062: 82062: 82062: 82062: Host: 82062: 82062: 82062: 82062: Sets up parameters; issues READ SECTOR command. Strobes BCR; sets BCS = o. Finds sector specified; transfers data to buffer. Decrements SECTOR COUNT register; increments SECTOR NUMBER register. Strobes BCR; sets BCS = Sets BORa = 1; ORO = 1. Reads out contents of buffer. Waits for BRDY. When BRDY = 1, if Sector Count = 0 then go to (11). Go to (2). Set INTRa = 1; End. o. A flowchart of the READ SECTOR command is shown in Figures 16A and 16B. 6-687 231133-002 AP·182 Write Sector Command 01110MOT The WRITE SECTOR command is used to write one or more sectors of data to the disk from the sector buffer. Upon receipt of a WRITE SECTOR command the 82062 checks the CYLINDER NUMBER LOW/ HIGH register pair against the internal cylinder position register to see if they are equal. If not, the direction and number of steps calculation is performed and a seek takes place. The WR FAULT and DRDY lines are checked throughout the command. When the Seek Complete (SC) line is found to be true (with or without an implied seek having occurred), the BDRQ signal is made active and the host proceeds to load the buffer. Once BRDY goes high, the ID field with the specified cylinder number, head, and sector size is searched for. Once found, WR GATE is made active and the data is written to the disk. If retries are enabled (T = 0), and if the ID field cannot be found within 10 revolutions, a Scan ID and re-Seek are performed. If the correct ID field is not found within 10 additional revolutions, the ID Not Found error bit is set and the command is terminated. If retries are disabled, (T = I) and if the ID field cannot be found within 2 revolutions, the ID Not Found error bit is set and the command is terminated. During a WRITE MULTIPLE SECTOR command (M = I), the SECTOR NUMBER register is decremented and the SECTOR COUNT register is incremented after the transfer to the disk takes place. During multiple sector transfers if BRDY is asserted after the first sector is transferred from the buffer, the 82062 will transfer the next sector before issuing BDRQ. The 82062 will set BDRQ and wait for the host processor to place more data in the buffer. In summary then, the WRITE SECTOR operation is as follows: When M = 0, 1 (WRITE SECTOR) (1) (2) (3) (4) (5) (6) (7) (8) (9) Host: 82062: Host: 82062: 82062: 82062: 82062: 82062: 82062: Sets up parameters; issues WRITE SECTOR command. Sets BDRO = 1, DRO = 1. Loads sector buffer with data. Waits for BRDY = 0 to 1. Finds specified ID field; writes sector to disk. If M = 0, then set INTRO = 1; END. Increment SECTOR NUMBER register; decrement SECTOR COUNT register. If SECTOR = 0, then set INTRO = 1; END. Goto (2). A flowchart of the WRITE SECTOR command is shown in Figure 17. Write Format Command 01010000 The WRITE FORMAT command is used to format one track using the Task Register File and the sector buffer. During execution of this command, the sector buffer is used for additional parameter information instead of sector data. Shown in Figure 18 is the contents of the sector buffer for a 32 sector/track format with an interleave factor of two. Each sector requires a two byte sequence. The first byte designates whether a bad block mark is to be recorded in the sector's ID field. A 00 Hex is normal: an 80H indicates a bad tllock mark for the sector. In the example of Figure 18, sector 04 will get a back block mark recorded. Any attempt to access sector 4 in the future will terminate the command. The second byte indicates the logical sector number to be recorded. This allows sectors to be recorded with any interleave factor desired. The remaining memory in the sector buffer may contain any value. Its only purpose is to generate a BRDY to tell the 82062 to begin formatting the track. An implied seek is in effect on this command. As for other commands, if the drive number has been changed an ID field will be scanned for cylinder position information before the implied seek is performed. If no ID field can be read (because the track had been erased or because an incomplete format had been used), an ID N ot Found error will result and the WRITE FORMAT command will be aborted. This can be avoided by issuing a RESTORE command before formatting. The SECTOR COUNT register is used to hold the total number of sectors to be formatted (01 H = 1 sector: OOH = 256 sectors), while the SECTOR NUMBER register holds the number of bytes (minus three) to be used for Gap 1 and Gap 3. For instance, if the SECTOR COUNT register value is 02H and the SECTOR NUMBER register value is OOH, then 2 sectors are written on a track and 3 bytes of 4EH are written for Gap 1 and Gap 3. The data fields are filled with FFH and the CRC is automatically generated and appended. All gaps are filled with 4EH. After the last sector is written, the track is filled with 4EH until the index pulse terminates the write. The Gap 3 value is deter6-688 231133-002 AP-182 PERFORM SEEK COMMAND PULSE BCR SET INTRa, AC RESET BUSY, CIP, BCS 'IF T= 1 THEN DASHED PATH IS TAKEN AFTER 2 INDEX PULSES. 231133-15 Figure 16A, Read Sector Command Flow 6-689 231133-002 AP-182 PULSE BCR SET ERROR. INTRO RESET BUSY CIP RESET BORO PULSE BCR SET INTRO RESET CIP 231133-23 Figure 168. Read Sector Command Flow 6-690 231133-002 AP-182 "IF RETRIES ARE DISABLED THE DASHED PATH IS TAKEN AFTER 2 INDEX PULSES 231133-16 Figure 17. Write Sector Command Flow 6-691 231133-002 AP-182 00 80 00 00 FF AA 00 00 04 08 OC FF AA 00 00 10 00 14 00 18 00 1C FF FF AA AA 00 .00 00 00 00 00 FF AA 00 01 05 09 00 FF AA 00 00 00 00 00 FF AA 00 11 15 19 10 FF AA 00 00 00 00 00 FF AA 00 02 06 OA OE FF AA 00 00 00 00 00 FF 12 15 19 1E FF 00 00 00 00 FF AA AA AA 00 00 00 03 07 08 OF FF AA 00. 00 00 00 00 FF AA 00 13 17 18 1F FF AA 00 Figure 18. Sector Buffer Contents For Format mined by the drive motor speed variation, data sector length, and the interleave factor. The interleave factor is only important when 1:1 (no) interleave is used. The formula for determining the minimum Gap 3 length value is: Gap 3 = = M S = K = K = E = (2 • M • S) + K + E motor speed variation (e.g., 0.03 for sector length in bytes 25 for interleave factor of I 0 for any other interleave factor 7 if the sector is to be extended This chapter describes the software in a general manner and Appendix Bcontains the actual implementation used to exercise the 82062 SBX board. Polled Mode As discussed in the Polled Interface Section, the 82062 does not directly support polled operation for data transfers without the addition of hardware. This section is based upon the polled interface as described in the Polled Interface Section. ± 3%) The six 82062 commands can be divided into two groups, those with data transfers and those without. The commands that do not use the sector buffer are: Restore, Seek and Scan ID. The functions of each command are explained in the Commands Section. Figure 21 is a flowchart of a polled operation and a PLM example. As with all commands, a WR FAULT or drive not ready condition, will terminate execution of the WRITE FORMAT command. Figure 19 shows the format that the 82062 will write on the disk. The extend bit in the SDH register must not be set during the Format command. The last status that was read will contain any error conditions that might have occurred during the command., A flowchart of the WRITE FORMAT command is shown in Figure 20. For commands that do make use of the sector buffer, the size of the sector buffer will affect the software. If the sector buffer is equal in size to one sector, then a carry out of an address counter (for the sector buffer) as the buffer is being filled will indicate to the 82062 that the command should continue. If the sector buffer SOFTWARE SECTION: GENERAL PROGRAMMING This section describes the software needed to communicate with the 82062 in order to store and retrieve data. INn"" n ~ GAP 4 4E 'L r--~-------- REPEATED FOR EACH SECTOR L-+ 10 FIELD I 0 GAP 1 14 BYTES A E 4E 00 1 N T r--DATA FIELD~ ~ C Y L S S E 0 C H # C R C 1 R 3 BYTES 12 BYTES C 00 00 A F 1 8 USER DATA 2 WRITE GATE 1 C C C R R 3 BYTES GAP 3 4E C C 00 1 2 -.J 231133-17 Figure 19.82062 Sector Format 6-692 231133-002 AP-182 RESET INTRC. ERRORS SET CIP, BUS'{ ACTIVATE SORO NO YES SET ABORTED COMMAND BIT 231133-18 Figure 20. Write Format Command Flow 6-693 231133-002 AP-182 size is equal to two or more disk sectors, and only one sector is being transferred, then the carry out signal would not go active, and the 82062 will be forever waiting for BRDY. In this case an I/O port would have to be used to generate this signal for the 82062 so that command execution can finish. Figure 22 is a flowchart of the READ SECTOR command, and its PLM representation. The WRITE SECTOR and FORMAT TRACK commands are equivalent in terms of software interfacing. Their flowcharts and their PLM equivalents are shown in Figure 23. Figure 24 also works for multiple sector transfers. However, the BRDY signal must be generated in hardware (the carry-out of an address counter). Interrupt Mode Once the command register is written the 82062 requests a data transfer before locating the proper track. Once the buffer is filled and BRDY is asserted, the 82062 will locate the target track and sector. If the ID· is not located before the selected number of retries have occurred, the 82062 will terminate the command. The data transferred to the sector buffer will not have been used. Once the command has finished (i.e., CIP = 0), the status and error registers will inform the host of an error. Figure 24 is the PLM routine that allows for all six of the commands. It differs from the READ and WRITE routines in that the direction that data is to be transferred is determined by the command. Interrupt driven software is chosen when the microprocessor must execute other tasks and cannot sit waiting for the disk to reposition its heads, as in a polled environment. The delay in repositioning heads can be anything from a couple of milliseconds to· a second or more. The 82062's interrupt (INTRQ) pin goes active to indicate that the command has finished. The READ SECTOR command provides the programmable choice of having the interrupt occur at the end of the data transfer or the normal end of the command. The reason for this option is that when the 82062 signals that a data transfer is required (via BDRQ, DRQ) the disk has been read and the data has been placed in the buffer. The host would remove the data and issue BRDY. The 82062 would then issue an interrupt indicating that the command has finisped. The interrupt procedure would only have to read the status register. If the interrupt is issued at BDRQ the host would remove the buffer data > ___-' YES 231133-19 Disk$Operation: Procedure; Call Write$82062$Task$Reg's; /* Write Task Registers */ Output (Command$Reg) = Command; Status = Input (Status$Reg); /* Read Status Reg * / Do while Status and CIP = CIP; /* Wait until command finishes * / Status = Input (Status$Reg); End; End Disk$Operation; Figure 21. Polling Status 6-694 231133-002 AP-182 READ SECTOR COMMAND 231133-20 Disk$Operation: Procedure; Call Write$82062$Task$Regs; Output (Command $ Reg) = Command; Status = Input (Status$Reg); Do while Status and CIP = CIP; I f Status and DRQ = DRQ then Do; Call Read$Data$From$Buffer; Output (BRDY$PORT) = 01; End; Status = Input (Status$Port) End; End Disk$Operation; Figure 22. Polling For Read Data 6-695 231133-002 AP-182 WRITE, FORMAT COMMANDS NO MOVE OATA FROM SYSTEM RAM TO SECTOR BUFFER 231133-21 Disk$Operation: Procedure; Call Write$82062$Task$Regs; Output (Command$Reg) = Command; Status = Input (Status$Reg); Do while status and CIP = CIP; I f status and DRQ = DRW then do; Call Write$Data$to$Buffer; Output (BRDY$Port) = 01; /* Make BRDY go active */ End; Status = Input (Status$Reg) End; End Disk$Operation; Figure 23. Polling For Write Data 6-696 231133-002 AP-182 Disk$Operation: Procedure; Call Write$82062$Task$Regs; /* Write registers */ Output (Command$Reg) = Command; /* Start command 0/ Status = Input (Status$Reg); /* Read status 0/ Do while status and CIP = CIP; /* Is a command in progress * / If status and DRQ = DRQ then do; /* Data transfer? = yes 0/ If command = Read$Sector then Call Read$Data$From$Buffer; /0 Remove data 0/ Else Call Write$Data$to$Buffer; /* Send data */ Output (BRDY$PORT) = 01; /* Toggle BRDY 0 to 1 0/ End; End Disk$Operation; Figure 24. Complete Polled Flow Start$Disk$Operation: Procedure; Call Write$82062$Task$Reg's; Output (Command $ Reg) = Command; End Start$Disk$Operation; Figure 25. Interrupt Mode; Starting a Disk Transfer and generate BRDY. At this point the status and error registers contain valid information. Generating an interrupt at BDRQ time may save some systems some software overhead. The WRITE SECTOR and FORMAT commands do not have this option because the sector buffer is filled before the track and sector are located. Hence, there can be significant delays between asking for data and the command terminating. In an interrupt driven environment, the 82062 can interface to a DMA controller for data transfers between the sector buffer and the host's RAM. If a DMA controller is not available an interrupt must be generated via the BDRQ line. However, BDRQ can stay active for long periods of time (until BRDY is generated). The interrupt sensing logic must take this into account to avoid being retriggered constantly. Intel's 8259A Interrupt Controller 8259A provides that capability. It should be programmed for edge triggered interrupts or the end of interrupt byte must not be issued until BDRQ is removed to prevent retriggering. Figure 25 is a PLM example of starting a disk operation in an interrupt driven environment. The command slarts, arid some indefinite amount of time later an interrupt would be generated, indicating service is required. If a DMA controller is used, it would have to be programmed and initialized before the command is issued to the 82062. Recall that once a data transfer between the microprocessor and 82062 has finished, BRDY must be set high. As long as BRDY is generated from hardware, no microprocessor intervention is needed. If BRDY is generated by an I/O port the microprocessor will have to perform this function (this will be the case with any system that has a sector buffer larger than one sector). (One option could be to generate an interrupt from the terminal count pin of the DMA controller. The microprocessor would then issue a BRDY.) Data transfers between host RAM and the sector buffer would be handled-without microprocessor intervention. The interrupt would then signal that the command has finished as shown in Figure 26. The only operation the host processor would perform is to check the status register of the 82062 for any error conditions. If BDRQ is used to generate an interrupt in addition to the normal interrupt, then the routines shown in Figure 27 will check the status register to see if a data transfer should be executed or if the command is finished. If DRQ is not set, the command has finished and any error conditions would be in the status register. Another possibility would be to have separate interrupt routines for the two possible sources of interrupts 6-697 231133-002 AP-182 End$of$Transfer: Procedure Interrupt; Status = Input (Status$Register); Output (8259A PIC) = End$of$Interrupt; End End$of$Transfer; Figure 26. Checking Status via Interrupt Service$Disk$Controller: Procedure Interrupt; Status = Input (Status$Port); I f Status and DRQ = DRQ then Call Transfer$Data$To/From$Buffer;/* Enable DMAC */ Output (8259A PIC) = End$of$Interrupt; End Service$Disk$Controller; Figure 27. Complete Interrupt Procedure (INTRQ, BRDQ). There would then be no need to test the status to see which interrupt had occurred. APPLICATION EXAMPLE This section shows an application using the 82062 interfaced to the SBX bus. A quick overview of the SBX bus is provided (pin descriptions, general wave forms) as a background for the application. Designing the 82062 onto al). SBX Multimodule board was chosen to highlight the size and complexity differences between earlier TTL, MSI, LSI-based disk controller boards and what is possible using the 82062. Both the hardware and software sections will be applicable to most other designs using the 82062. This design example is called SBX82062 and does not represent a real product offered by Intel Corporation. Appendix C contains the schematic of the SBX board. The advantage of the SBX Multimodule is that it permits the system to be tailored for specific needs with a minimum of effort. The advantage of an SBX based disk controller is that a current system can make use of the capacity, reliability and speed of a hard disk with no (or minimal) hardware redesign. iSBX Bus Multimodule Boards The iSBX Multimodule boards are small, specialized, I/O mapped boards which plug onto base boards. The iSBX boards connect to the iSBX bus connector and convert the iSBX bus signals to a defined I/O interface. Base Boards The base board decodes I/O addresses and generates the chip selects for the iSBX Multimodule boards. In 8bit systems, the base board decodes all but the lower three addresses in generating the iSBX Multimodule board chip selects. In 16-bit systems, the base board decodes all but the lower order four addresses in generating the iSBX Multimodule board chip selects: Thus, a base board would normally reserve two blocks of 8 I/O ports for each iSBX socket it provides. There are two classes of base boards, those with Direct Memory Access (DMA) support and those without. Base boards with DMA support are boards with DMA controllers on them. These boards, in conjunction with an iSBX Multimodule board (with DMA capability), can perform direct I/O to memory or memory to I/O operations. iSBX Bus Interface The iSBX bus interface can be grouped into six functional classes: I. Control Lines 2. Address and Chip Select Lines 3. Data Lines 4. Interrupt Lines 5. Option Lines 6. Power Lines 6-698 231133-002 AP-182 iSBX BOARD USER CONNECTOR iSBX BOARD INTEL SUPPLIED ~:. CONNECTOR n .. !: ~ ~ 231133-22 Figure 28. iSBX Multimodule Board Concept (Double Wide) Control Lines The following signals are classified as control lines: COMMANDS: lORD (I/O Read) IOWRT (I/O Write) DMA: MDRQT (DMA Request) MDACK (DMA Acknowledge) TDMA (Terminate DMA) INITIALIZE: RESET CLOCK: MCLK (iSBX Multimodule Clock) SYSTEM CONTROL: MWAIT MPST (iSBX Multimodule Board Present) base board's DMA device requesting a DMA cycle. MDACK is an active low input signal to the iSBX Multimodule board from the base board DMA device acknowledging that the requested DMA cycle has been granted. TDMA is an active high output signal from the iSBX Multimodule board to the base board. TDMA is used by the iSBX Multimodule board to terminate DMA activity. The use of the DMA lines is optional as not all base boards will provide DMA channels and not all iSBX Multimodule boards will be capable of supporting a DMA channel. Initialize Lines (Reset) This input line to the iSBX Multimodule board is generated by the base board to put the iSBX Multimodule board into a known internal state. Clock Lines (MCLK) Command Lines (lORD, IOWRT) T.he command lines are active low signals which provIde the communication link between the base board and the iSBX Multimodule board. An active command line, conditioned by chip select, indicates to the iSBX Multimodule board that the address lines are valid and the iSBX Multimodule board should perform the specified operation. DMA Lines (MDRQT, MDACK, TDMA) The DMA lines are the communication link between the DMA controller device on the base board and the iSBX Multimodule board. MDRQT is an active high output signal from the iSBX Multimodule board to the This input to the iSBX Multimodule board is a timing signal. The 10 MHz (+ 0%, - 10%) frequency can vary ·from base board to base board. This clock is asynchronous from all other iSBX bus signals. System Control Lines (MWAIT, MPST) These output signals from the iSBX Multimodule board control the state of the system. An active MW AIT (Active Low) will put the CPU on the board into wait states providing additional time for the iSBX Multimodule board to perform the requested operation. MWAIT must be generated from address 6-699 231133-002 AP·182 (address plus chip select) information only. If MWAIT is driven active due to a glitch on the CS line during address transitions, MWAIT must be driven inactive in less than 75 ns. The iSBX Multimodule. board pnysent (MPST) is an active low signal (tied to signal ground) that informs the base board I/O decode logic that an iSBX Multimodule board has been installed. Address and Chip Select Lines The software for communicating to the SBX board is intended to be interrupt driven. Polling for data transfers is not supported. Reading the status without an interupt is not recommended. During the times the 82062 is accessing the sector buffer, the SBX82062 will isolate itself from the host. To support polling, a hardware generated busy pattern should be driven onto the hosts's data bus as is shown in the Polled Interface section. The sector buffer stores up to 2 kbytes of disk data, for multiple sector transfers. The SBX board only interfaces to one drive (for space reasons), but four drives could be used with the addition of a read data multiplexor (one IC) and the drive data cables. The address and chip select lines are made up of two groups of signals. Adress Lines: MAO-MA2 Chip Select Lines: MCSO-MCSI The base board decodes I/O addresses and generates the chip selects for the iSBX Multimodule boards. The base board decodes all but the lower order three addresses in generating the iSBX Multimodule board chip selects. Microprocessor Interface Figure 29 is a block diagram ,of the SBX82062's microprocessor interface. The I/O port assignments are listed in Table I. The functional blocks of the interface are: Sector Buffer Isolation Logic Wait State Logic Sector Buffer Sector/Drive/Head Register Logic Table 6-1.110 Port Assignments Address Lines (MAO-MA2) These positive true input lines to the iSBX Multimodule boards are generally the least three significant bits of the I/O address. In conjunction with the command and chip select lines, they establish the I/O port address being accessed. In 16-bit systems, MAO- MA2 may be connected to ADRI-ADR3 of the base board address lines. Port Address Read Write 80H 82H 84H 86H 88H 8AH 8CH 8EH 90H 92H 94H Sector Buffer Error Reg Sector Count Sector Number Cylinder Low Cylinder High SOH Reg Status Reg None None None Sector Buffer RWCReg Sector Count Sector Number Cylinder Low Cylinder High SOH Reg Command Reg None Asserts BCR Asserts BROY Chip Select Lines (MCSO-MCS1/) In an 8-bit system, these input lines to the iSBX Multimodule board are the result of the base board I/O decode logic. MCS is an active low signal which conditions the I/O command signals and thus enables communication with the iSBX Multimodule boards. Address assignments are determined by the host board. The SBX82062 Design Example Sector Buffer Isolation Logic The SBX82062 Multimodule board will interface an ST506 compatible drive to any host board having an SBX connector. Two restrictions on the disk drive are that there is a maximum of 1024 cylinders and/or 8 heads. The SBX connector cannot supply the power-up current requirements of the drive. The drive must be connected directly to the power supply. The SBX82062 in Appendix C does not support DMA transfers. The version in Appendix D does support DMA transfers. Since this multi module has a 2 kbyte sector buffer, the host microprocessor must generate a BRDY by accessing an I/O port during data transfers. The host will be isolated from the SBX board whenever the 82062 is accessing its sector buffer which is enabled by BCS. The host's control signals, RD, WR, MCSO, and MCSI and data bus are also disabled at the same time to prevent any data in the sector buffer from being corrupted. The host should wait for an interrupt before reading the 82062's Status register. Attempting to read the SBX board while BCS is active will return invalid data, since the SBX board will have the data bus tristated. NOTE: 6-700 231133-002 AP-182 MWAIT -MFM WA DATA +MFM WR OATA +MFM AD OATA -MFM RD DATA INDEX TAACKO SC AEACY WR FAULT 7' LS374 HDO HOI HD2 Dsii DSI DS2 OS, Figure 29 6-701 231133-002 lORD 74504 4 3 .... ... rT- 15 lORD ~ 8 P1 10 MHZ 4A6 QA A B QB CLR QC QD QE QF "11 iii QG '"CD QH c a1- ~4 ~ ~ ~ ~ 2 en 9 74508 10 DELAYED READ C '" ml I L BCS lD I )( 0> I -..j 0 I\) 22 3: C ;:; 3" 0 ~ 20 MCSl P1 a. c iD 1111 MCSO ~P1 ~ 13 IOWR I Pl B 0' () '"c 7 Dr PAL 16L8 18 BDWR 3 17 ClK 37 5 P1 8 P1 '"b<> '" RP1 8 ~ lK RPl RPl RAMSEl 8 BDWR 2C8.,3C8 RAMSEL 2C8 C ):0 ... 4 16 IOBCR IOBCR 2C8 15 IOBRDY IOBRDY 3D8 2C8,:,3C8 CD N 6 14 CS CS MAO 7 13 LTCH SDH LTCH SDH 2A8 MAl 8 12 BDRD BDRD 2D8,:3C8 MA2 9 11 74504 9 £>0 8 MDACK 2C8 AO-2 3C8 MR 3C8 B UDl MAO I MDACK P1 J +5V 3 UB3 5 P1 A D "0 I MAl 11 'J I ~P1 3 Pl MA2 9 DI '" c;; - UB3 P1 10 '"~ I 19 2 1 1 74508 2- 16 UB2 _ 6 Q CLR 11 ~ ~ ;f 2C8- 1.4 PR Q~ D 3 '" ~I RPl 7 !'» CD MWAIT +5V 74LS164 UDl D 2 3 4 5 6 7 8 II INTEL CORPORATION RESET __ MPST 82062 SBX SIZE V B I CODE DAII: 7 6 IA TITLE 5 4 3 I NUMBER SEPT 1984 062PAL.DWG IA REV -.- -. -- SHEET 1 OF 4 2 231133-35 AP-182 Wait State Logic Interrupts The wait state logic drives the 'not ready' line, MW AIT, active whenever the host reads the SBX board. MW AIT does not go active for buffer or 82062 register writes. This logic was required for two reasons. First, a delayed read is generated, because the address setup to RD margin of the SBXbus is less than the 82062's needs (50 ns vs 100 ns). Second, the RD to data valid access period of the 82062 (375 ns), is greater than the SBX bus' full speed read cycle (275 ns) permits. MW AIT is deactivated after allowing for the delayed RD and the access period of the 82062. This delay is accomplished with a 500 ns delay line. The first tap at 100 ns generates the read request to allow for the address setup margin. The next tap 400 ns later removes MW AIT to allow the host to continue. While the interrupt line is programmable (to notify of an end of command or data transfer request for the Read Sector command only), software will ensure that the interrupt from the 82062 signifies command termination. The BDRQ line is OR'ed with the 82062's INTRQ line or BDRQ can generate its own interrupt. BDRQ is also gated off-board for a DMA controller. Disk Interface Figure 30 is a block diagram of the interface between the 82062 and the disk drive. The functional blocks are: Write Data Logic Read Data Logic (PLL) Drive Control Sector Buffer Write Data Logic The sector buffer consists of an address counter (using , Is393's) and a 2 kbyte static RAM. The address counter is incremented on the trailing edge of a valid RD or WR cycle, either host microprocessor or 82062 initiated. The counter is reset by a hardware reset, the 82062 buffer reset BCR, or by accessing an I/O port to provide software control. The 82062 will issue BCR each time BCS changes state (i.e. twice per sector). Resetting the buffer counter can be put under software control for multiple sector transfers. BRDY going high tells the 82062 that the buffer is available for its use. BRDY is generated by the address counter, by filling or emptying the entire buffer in multiple sector transfers, or from an I/O port when single sector transfers are done (since single sectors won't use all 2 kbytes of the buffer, the hardware signal will not be generated). When the 82062 is using the buffer, BCS will be low, and the RD or WR line will be pulsed every I. 6 microseconds. When the 82062 is using the buffer it prevents access by the host by tristating the read, write, select and data lines with a low on BCS. SOH Register Logic The drive and head select bits must be latched externally to the 82062, since these outputs are not provided. An 8 bit latch is strobed on the trailing edge of the WR pulse when the SDH register is selected. The two drive select bits are then demultiplexed to provide a one of four drive select line. If multiple drives are used then these outputs would also be used to select which disk's read data line would be gated into the PLL.· The WR DATA output requires a D flip-flop clocked at 10 MHz to complete the conversion of data to MFM. The output of this D flip-flop is true MFM and is sent to a delay line. A delay line determines the amount of delay for precompensation. No delay corresponds to shifting the data bit early; the first tap is approximately 12 ns of delay and is the "normal", or no delay and the second tap provides 12 ns of delay, referenced to the "normal" write data. Which output is selected is determined by the states on RWC, Early and Late. This function was generated with a 74s151 multiplexer. When R WC is inactive EARLY and LATE only select "normal" data since they are always active. The precompensated write data is then driven onto the data cable by an RS-422 driver. Read Data Logic The PLL generates the RD CLOCK that is used to decode the serial MFM data from the drive. A selected drive issues read data, unless WR GATE is active. A one-shot generates a pulse of 220-270 ns to provide the DRUN input. Only during an all zero's or one's field will the DRUN input stay high, as it will be retriggered every 200 ns (the minimum distance that separates continuous clock and data bits). As soon as DRUN is determined to be valid, the RD GATE output will go active, switching the PLL from the 10 MHz local clock input to disk data. The PLL will synchronize to the incoming serial data and generate a Read Clock of the proper timing and phase. The 82062 will then start to search for the address mark which is indicated by DRUN going low at the address mark. 6-703 231133-002 AP-182 RD GATE DRUN RD DATA RD CLOCK DATA RECOVERY - 82062 HOST ( WRITE PRECOMPENSATION AND SYNCHRONIZATION WR DATA EARLY LATE RWC DATA/CTRL STEP DIR DRDY WR FAULT TRACK 000 r=1 ·1 DRIVE BUFFERI RECEIVERS INDEX SC WR GATE 231133-24 Figure 30. 82062 Disk Interface Block Diagram No detail is provided herein on PLL design, as it is beyond the scope of this document. PLL design should be left to experienced designers, since minute changes in temperature and component values will drastically affect the soft error rate. As an alternative, several companies manufacture very high speed PLL chips for MFM encoded disk drives. Besides being fairly easy to design in, they reduce the number of components and board area needed for the sophisticated PLL. Command Rwc Reg Sector Cnt. Sector Num. Cyl Low Cyl High SOH Reg Status Reg Error Reg Host Buffer Software Driver Overview Byte Byte Byte Byte Byte Byte Byte Byte Byte Pointer Figure 31 Presented in Appendix B is a listing of the software used to exercise the SBX 82062 board. Communication between the host software and the SBX driver routine is done through a structure located in system RAM. The host routine fills in required parameters, then passes the address of this communication block to the SBX driver routine. The driver routine pulls necessary values from this command block (CBL), executes a disk operation, then fills the CBL with the 82062's register contents, plus status and error information. The command block structure is shown in Figure 31. The host board did not have a DMA controller available, so an interrupt is issued from the BDRQ line and OR'ed with the 82062's interrupt line as interrupt sources were limited by the host. When an interrupt occurs, the interrupt procedure checks for either a data transfer, and executes it, or the completion of the command. If the interrupt signifies command completion, the interrupt procedure fills the command block with the 82062's task, status and error registers. 6-704 231133-002 AP-182 In this example, the host software examines one byte in the command block and until this byte is changed to a 00, no other command blocks will be passed to the disk driver routine. An alternative would be to issue a software interrupt to notify the microprocessor that the disk operation has finished and the command block contains parameters from the last operation and that a new disk command could start. The driver for this example allows polling for non-data transfer commands, and must use interrupts for data transfers. As mentioned earlier, microprocessor intervention is required since the sector buffer is much larger than one sector and will not generate a BRDY. The microprocessor must write to an I/O port, which sets BRDY, after each host to sector buffer transfer. An actual software implementation would not include the polling and interrupt routines together, as only one method would generally be used. The calling routine, which would normally be a directory program, places the values for which sector, number of sectors, etc., in the CBL. The disk routine is called and the address of this structure is passed on the stack. The disk driver places these parameters in the 82062's Task registers and initiates a command. If the interrupt driven method was chosen, the disk driver routine returns to the calling routine. This permits other processing to be performed while the disk is executing a command. At some point, an interrupt will be generated, either from BRDY or INTRQ. Control will pass to the driver and the status register will be checked. If a data transfer is needed, either the microprocessor can transfer data or a DMA controller can perform the function. Once the transfer of data to the buffer is finished the microprocessor must set BRDY through an I/O port. 6-705 231133-002 APPENDIX A ST5061NTERFACE THE ST506 INTERFACE The encoding rules for MFM are fairly simple: The ST506 interface is a modified version of Shugarts floppy disk drive interface and has been promoted by Seagate Technology. This interface is intended to be easy and low in cost to implement, yet provide a medium level of performance. The interface rigidly defines several areas: the hardware interconnects, the data transfer rate, the data encoding method, and how the disk is formatted. 1. A clock bit is written when the previous and the cur- rent bit cell does not contain a data bit. 2. A data bit is written whenever there is a "one" from the user. Sync fields are composed of zeroes which generates a series of clock bits in the bit cell's. A phase lock loop locks on to the data stream during this period and generates a signal of the proper phase and frequency which is used to decode the combined clock and data serial data stream. Data Transfer Rate The data transfer rate depends upon the linear bit density of the disk media and the speed at which the disk spins. ST506 specifies a 5 Mbit/second transfer rate. The typical STS06 drive has a nominal linear density of 10,416 bytes and a disk speed of 3600 rpm, which yields a 5 Mbit/second data transfer rate. No deviation from 5 Mlbits second is allowed. Increasing the linear density to increase storage capacity would require a decrease in disk speed. Otherwise, the data rate would increase. This decrease in disk speed would cause access times to increase, which many would deem unacceptable. To increase storage capacity, and remain ST506 compatible, either the number of cylinders and/or the number of platters can increase. Disk Format All disk media must be written with a specified format so that data may be reliably stored and retrieved. The smallest unit of controller accessible data is the sector which typically contains sync fields, ID fields, and a data field, and buffer fields. The format of the disk required by ST506 is shown in Figure A-2. It should be noted that this format is fixed in the 82062. The user has options only for GAPI and 3 length (when changing sector size or ECC) and whether to have 82062 CRC checking or user supplied ECC syndrome bits. Data Encoding Gap 1 - Index Gap ST506 requires that the serial data, sent between the drive and the controller, be encoded according to MFM rules. The basic unit of storage is a bit cell, which stores one bit infromation. This bit cell is divided into two halves, consisting of a clock bit and a data bit (see Figure A-I). Gap 1 serves two purposes. The first is to allow for variations in the index pulse timing due to motor speed variations. The second purpose is to allow a small delay to permit a different head to be selected without missing a sector. This is more of a data transfer optimization function and requires the disk controller to know which head is to be selected, when the last sector of a track has been read, and the next logical sector in the file exists on another platter. The 82062 does not switch heads automatically. Whether this scheme can be used or not depends upon the fLP being able to alter one register in the 82062, before the next sector p!lsses beneath the heads. CLOCK BIT DATA BIT CLOCK BIT I DATA BIT This gap is typically 12 bytes long and is written by the 82062 as 4E Hex. THIS WOULD EQUAL A USER 0 THIS WOULD EQUAL A USER 1 - B~~OC~~L - - - - - . Gap 2 - Write Splice Gap 231133-25 This gap follows the CRC bytes of the ID field and continues up to the data field address mark. When upFigure A·1 6-706 231133-002 AP-182 dating a previously written sector, motor speed variations could turn on the write coil, as the head was passing over the ID field. This gap prevents this from occurring. The value written is OOH and also serves as the PLL sync field for the data field. The minimum value is determined by the "lock up" performance of the PLL. The 82062 writes sixteen bytes for this field once WG is activated. The user has no control over this field. formatting. The user has no control over the number of bytes written with the 82062. 10 Fields The controller uses ID fields to locate any individual sector. An address mark of two bytes precedes the ID field and the data field in a sector. An address mark tells the controller the nature of the upcoming information. ID fields are used by the disk controller and are not passed to the host. Gap 3 - Post Data Field Gap Gap 3 is very similar to Gap 2 as it is used as a speed tolerance buffer also. Without this gap, and with the motor speed varying slightly, it would be possible for the upcoming sector's sync field and ID field to be overwritten. This value is '4E' H and is typically 15 bytes long. The 82062's Gap 3 length is programmable. The exact value is dependent upon several factors. Refer to 82062 Format command, Software Section: General Pro'gramming Section. Sector Interleaving Sector interleaving occurs when logical sectors are in a non-sequential order, which is determined during formatting. An advantage is that there is a delay between logically sequential sectors. This delay can be used for data processing and then deciding if the next sector should be read. Without interleaving, the next sector could slip by, imposing a one revolution delay (approx. 16.7 ms). An additional benefit to this delay is that bus utilization is reduced by spreading the data transfer over a greater amount of time. The delay between sectors can be determined as follows: Gap 4 - Track Buffer Gap This gap follows the last sector on a track and is written until an index pulse is received. Its purpose is to prevent the last sector from overflowing past the index gap, and absorb track length variations when ECC is used (ECC uses more bytes than CRC). The value is '4E' H and is about 320 bytes when CRC and 256 byte sectors are used. The 82062 writes this field only during ~ 1 Revolution Period Sectors/Track x (Interleave factor - 1) Delay For the typical ST506 drive with four-way interleaving this yields 1.57 ms of delay. REPEATED FOR EACH SECTOR ,---DATA F I E L D - r---ID FIELD-. I o C L HE SE CR CR 3 BYTES 12 BYTES GAP 1 14 BYTES A E YO 4E' 00 1 A C C C 00 00 NLW o # 1 2 T GAP 4 4E = A F 1 8 USER DATA C R C 1 1 C R 3 BYTES GAP 3 4E 00 C 2 WRITEGATE~ DATA FIELD 10 FIELD A1 = A1 HEX WITH OA HEX CLOCK F8 = DATA ADDRESS MARK; NORMAL CLOCK USER = DATA FIELD 128 TO 1024 BYTES A1 = A1 HEX WITH OA HEX CLOCK IDENT = 2LS.B. = CYLINDER HIGH FE = 0-255 CYLINDERS FF = 256-511 CYLINDERS FC = 512-767 CYLINDERS FD = 768-1023 CYLINDERS 1, 2 = HEAD NUMBER BITS 3, 4 = 0 BITS 5, 6 = SECTOR SIZE BIT 7 = BAD BLOCK MARK SEC # = LOGICAL SECTOR NUMBER HEAD = BITS 0, 231133-26 Figure A-2. Format Field 6-707 231133-002 AP-182 HOST SYSTEM FLAT CABLE OR TWISTED PAIR 20 FEET MAXIMUM ST506 2 RESERVED I--- RESERVED (HD SELECT 22) _ 4 -WRITE GATE 6 -SEEK COMPLETE 8 -TRACK 0 1 3 .• 5 - 7 ~ 9 ~ 11 ~ 13 ~ 10 -WRITE FAULT 12 -HEAD SELECT 2 0 14 15 RESERVED 16 -HD SELECT 2' 18 17 • -INDEX 20 -READY 22 19 21 23 -STEP 24 • -DRIVE SELECT 1 -DRIVE SELECT 2 25 26 27 28 29· -DRIVE SELECT 3 30 -DRIVE SELECT 4 32 31 • 33 -DIRECTION IN 34 V V 231133-27 Figure A-3 The disadvantage to interleaving is that file transfers take longer, which may slow dpwn the overall system. A four-way interleaved disk will have the transfer rate reduced to an average of 1.25 Mbit/sec. host of certain conditions. A diagram of the 34 pin control connector is shown in Figure A-3. The driver/receiver logic diagram is shown in Figure A-4 and the electrical characteristics are: The 82062 leaves the logical sector sequence to the user. True False Voltage Current 0.0 VDC to 0.4 VDC 2,5 VDC to 5.25 VDC -40 mA (IOL max.) 250 p.A (IOH open) ELECTRICAL INTERFACE The interface to the ST506 drive is divided into three categories and they are: 1. control signals, 2. data signals, 3. power. +5V 2200 7438 20 FT. Control Signals The functions of the control signals are not covered in detail here. Their purpose can be found in the pin descriptions section. All control lines are digital in nature and either provide signals to the drive or inform the 231133-28 Figure A·4 6-708 231133-002 AP-182 Data Signals The lines associated with the transfer of read/write data between the host and the drive are differential in nature and may not be multiplexed between drives. There is one pair of balanced lines for each read and write data line per drive and must conform to the RS-422 specification. Figure A-5 shows the receiver/transmitter combination. 20 FT. HIGH TRUE Z=10S 231133-29 Figure A-5. E1A RS22 Driver/Receiver Pair Flat Ribbon or Twisted Pair 6-709 231133-002 APPENDIX B SOFTWARE DRIVER SERIES-III PL/M-86 V2.3 COMPILATION OF MODULE DISK_IO_MODULE OBJECT MODULE PLACED IN :F2:DISKIO.OBJ COMPILER INVOKEO BY: PLM86.86 :F20ISKIO. P86 STITLE('82062/SBX DISK CONTROLLER') DISK_IO_MODULE:DO; (* CBL_PTR IS A POINTER TO A COMMAND BLOCK- HENCE CBL. THIS COMMAND BLOCK RESIDES IN RAM AND CONTAINS ALL VALUES REGUIRED BY THIS PROGRAM TO OPERATE THE 82062 DISK CONTROLLER. ONCE THIS PROCEDURE IS CALLED, THE CBL IS REMAIN UNTOUCHED UNTIL THE COMMAND BYTE IS SET TO A 00 VALUE. THIS ROUTINE WILL CALL THE CALLING PROGRAM WHEN A COMMAND IS COMPLETED. REV DESCR IPTION NAME DATE I/JUL/84 1.0 INITIAL J. SLEEZER *1 1* LITERALLY 'LITERALLY', 'OFFH', LIT 'DOH', LIT 'WHILE TRUE'; LIT DECLARE LIT TRUE FALSE FOREVER 3 DECLARE BASE_ADDR SCTR BFFR ERR_REG SEC_CNT _REG SEC_NUM_REG CYL_LOW_REG CYL_HI_REG S_DR_HD_REG STATUS REG COMMAND REG WR]Cf1P:::REG BFFR_RESET BFFR_RDY SEC_BUF 1* 1******* 4 *1 PROGRAM CONSTANTS 2 BOARD ADDRESSING FOR THE 86(05 '80H', 'BASE A.DDR', 'BASE-ADDR + 'BASE:::ADDR + 'BASE_ADDR + 'BASE_ADDR + 'BASE_ADDR + 'BASE ADDR + 'BASE-ADDR + 'BASE-ADDR + 'BASE:::ADDR + '92H', '94H' , '2048'; LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT 82062 COMMANDS DECLARE RESTORE SEEK FORMAT SCAN 10 READ-SEC WR ITE SEC ECC_EN NO INTERPT INTR ON CMD MUL T:::ScTR LIT LIT LIT LIT LIT LIT LIT LIT LIT LIT *1 02H', 04H', 06H', OSH', 1* READ ONLY *1 OAH' OCH' J j OEH', OEH', 02H' J 1* READ ONLY *1 1* WR ITE ONLY *1 1* WR ITE ONLY *1 ********1 , IFH', '7FH', '50H', '40H', '20H " '30H', 'SOH', 'DOH " 'OSH " '04H '; 1* TO BE DR '0 WITH VALUE IN SOH REG *1 231133-36 6-710 231133-002 AP-182 1* STATUS REGISTER BITS DECLARE ERR CIP DRG SC WRF DRDY BUFBSY 5 1* 6 7 *1 'OIH' , LIT LIT LIT LIT LIT LIT LIT '02H', 'BOH " '10H', '20H' , '40H', 'BOH'; PROGRAM VARIABLES 1* USER WILL NEVER SEE THIS EIT SET *1 *1 DECLARE CMD_BLOCK_PTR CEL POINTER, BASED COMMAND PRECMP S_CNT SCTR LOW_CYL HI _CYL SOH STATUS ERRS INTERUPT RET PROC BUFF]TR DECLARE EUFFER]TR BUFF STATUS ERRORS COMMAND POINTER, BUFFER ]TR ( 1 ) BYTE, BASED BYTE, BYTE, BYTE; CMD_ELOCK]TR STRUCTURE BYTE, BYTE, BYTE, BYTE, BYTE, BYTE, EYTE, BYTE, BYTE, BYTE, POINTER, POINTER) ; ( $EJECT 1***************************-********1 1* 82062 POLL ROUTINE *1 1************************************1 8 POLL: PROCEDURE; 9 2 DECLARE COUNT 10 11 12 13 15 17 18 19 20 21 2 2 2 3 3 4 4 3 22 2 COUNT = 7FFFFH; 1* LOOP FAILSAFE - TWEAK AS REGUIRED *1 STATUS = INPUT(STATUS REG); DO WHILE «STATUS AND-(CIP OR DRDY» = (CIP OR DRDY»; IF COUNT = 00 THEN RETURN; IF (STATUS AND DRG) = DRG THEN DO; CALL XFER DATA; END; STATUS = INPUT(STATUS_REG); COUNT = COUNT - 1; END; 1* IF THE ROUTINE EXP IRES DUE TO COUNT = 0, ALL DISK 1* REG VALUES IN THE CBL WILL CONTAIN THE STATUS REG 1* WHICH WILL = A BUSY PATTERN AND caL. COMMAND WILL 1* CONTAIN 00, INDICATING THE COMMAND IS FINISHED END POLL; 3 3 m~ORD; *1 *1 *1 *1 1*******************.************************************************1 1* TRANSFER DATA BETWEEN HOST RAM AND ONBOARD SECTOR BUFFER 1***************************************************** ••••• *.********1 23 24 XFER_DATA: PROCEDURE; 2 DECLARE CNT INDEX SZ 1 SECTR_SZ BYTE, WORD, BYTE, WORD; 231133-37 6-711 231133-002 AP-182 25 26 28 30 32 2 2 2 2 2 SZI = (SHR(CBl.SDH,5) AND 03H), IF SZI = 00 THEN SECTR_SZ = 256, 01 THEN SECTR SZ ELSE IF SZI ELSE IF SZI = 02 THEN SECTR-SZ ELSE IF SZI = 03 THEN SECTR:SZ 34 35 2 2 IF CBl.SDH AND EC~_EN = ECC EN THEN SECTR_SZ = SECTR_SZ + 7, 36 37 38 39 40 41 42 43 2 2 3 IF ( ( (CBL. COMMAND AND OFOH = READ SEC) DR (CBL. COMMAND AND OFOH = WR ITE SEC» AND (CBl. COMMAND AND OFH = MUlT SCTR» THEN 00,1* VARIOUS SECTOR SIZES*I CNT = (SEC BUF/CBl. S CNTl, 1* ARE POSSIBLE. THIS FIGURES *1 DO WHILE (CNT * SECTR SZ) :> SEC_BUF, 1* HOW MANY SECTORS Will FIT *1 CNT = CNT - I, 1* INTO THE BOARDS SECTOR BFFR *1 END, SECTR_SZ = SECTR_SZ * CNT, END, 3 4 4 3 3 44 46 47 48 49 50 51 52 53 54 2 3 55 2 56 2 1* OBTAIN SECTOR SIZE BITS 1* REGISTER *1 512, 1024, 128, FROM SOH *1 4 4 3 2 3 4 4 3 OUTPUT(BFFR_RDY) 00, 1* ACTIVATES 062'S BRDY lINE *1 END XFER_DATA' $EJECT I*********************~**************/ UPDATE COMMAND BLOCK *1 1************************************1 57 UPDATE_CBl: 58 59 60 61 62 63 64 2 2 2 2 2 2 2 65' 2 PROCEDURE, CBl.S_CNr = INPUT (SEC_CNT_REG), CBl.SCTR = INPUT(SEC NUM REG), CBl.lOW_CYl = INPUT(CYl_LOW_REG), CBl.HI_CYl = INPUT(CYl_HI_REG), CBl.SDH = INPUT(S DR HD REG), CBl.STATUS = STATUS,- CBl. ERRS = INPUT (ERR_REG), END UPDATE_CBL, 1******************************** '~****/ WRITE THE CBl TO 82062 1*************************************1 66 WR_CBl: PROCEDURE, 67 68 69 70 71 72 2 2 2 2 2 73 2 2 OUTPUT(WR PCMP REG) CBl. PRECMP, OUTPUT (SEC_CNT:REG) CBl.S_CNT' OUTPUT(SEC NUM REG) = CBl.SCTR, OUTPUT(CYl-lOW-REG) CBl.lOW CYl, OUTPUT(CYl-HI REG·) = CBL. HI CYl, OUTPUT(S_DR_HO_REG) = CBl.SOH, END WR3Bl, $EJECT 231133-38 6-712 231133-002 AP-182 1******************************************1 /***** MAIN PROGRAM ***********1 DIS~: 74 2 76 2 2 77 PROCEDURE(CBl_PTR) PUBLIC; DECLARE CBl_PTR POINTER; 75 CMD_BlOC~_PTR BUFFER_PTR '* ADDRESS OF STRUCTURE *' ; CBl_PTR; BUFF_PTR; = CBl. 1* THAT CONTAINS 82062 '* TASK REG DATA *1 *1 '* A DUMMY COMMAND TD READ*, ,*THE CURRENT REG VALUES CAll WR CBl; IF CBl. COMMAND = 99H THEN DO; CAll .UPDATE CBl; CBl. COMMAND - = 00; CBl.STATUS INPUT(STATUS_REG); RETURN; END; *' 78 79 81 82 83 84 85 2 2 86 88 89 90 91 2 3 3 3 IF (INPUT(STATUS REG) AND DRDY) <> DRDY THEN DD; CEl. STATUS = INPUT(STATUS REG); CEl. COMMAND ; OOH; RETURN; END; 92 2 OUTPUT(BFFR_RESET) = OOH; 93 94 2 2 IF (CEl.CDMMAND AND OFOH) = READ SEC THEN , . FOR PRDGRAM CONSISTENCY.' CBl. COMMAND; CBl. COMMAND OR-INTR_ON_CMD;" SET INTERUPT FDR CDMMAND*' TERMINATION ., 95 96 97 99 100 101 102 103 2 OUTPUT(COMMAND REG) ; CBl. COMMAND; CAll TIME LENGTH(VALID_CMDS) THEN DO, CALL WRITEA(@('INVALID COMMAND',CR,LF,OO», 12 = 0, END; CHAR = Cli IF CHAR = VALID CMDS(12) THEN COMMAND = TRUE, 12 = 12 + 1 i END, DO CASE (12 1* 380 381 382 383 384 385 386 387 389 390 1 DO, 1); CASE 0 - READ SECTOR *1 CALL WRITEA(@('READ SECTOR COMMAND',CR,LF,LF,OQ», CALL WR ITE REGS, DISK IS NOT BUSY = FALSE, cr1DjlLK(INDX). COMMAND = READ_SECT; CALL WRITEA(@('MULTIPLE SECTOR'S? >',00», CHAR = CI, IF CHAR = 'Y' THEN DO, CALL WRITEA(@( 'YES - ',00», CMD BLK(INDX).COMMAND = CMD BLK(INDX).COMMAND OR MULT SCTR, CALL WRITEA(@('OO NOT EXCEED BUFFER LIMIT! ',CR,LF,QO», END; ELSE CALL WRITEA(@('NO',CR,LF,OO», CALL WRITEA(@('AUTOMATIC RETRIES? ::",00», CHAR = CI, IF CHAR = 'N' THEN DO, CALL WRITEA(@( 'NO', CR, LF, 00», CMD BLK(INDX).COMMANO = CMO_BLK(INOX).COMMANO OR NO_RETRYS, END, ELSE CALL WRITEA(@('YES',CR,LF,OO»; 7 . END, CALL DISK(@CMD_BLK(INDX», 231133-42 6-716 Ap·182 404 405 406 407 408 409 410 411 414 415 5 6 6 6 6 6 6 6 6 7 7 416 417 418 7 7 6 419 420 421 423 424 6 6 6 7 7 425 426 7 6 427 428 6 6 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 5 6 6 6 6 6 6 6 6 6 6 6 7 7 6 6 6 6 7 8 8 8 8 7 8 8 8 8 7 7 6 6 6 6 6 6 6 6 6 6 412 1* DOl CASE 1 - WRITE SECTOR *1 CALL WRITEA(@('WRITE SECTOR COMMAND',CR,LF,LF,OO»I CALL WR ITE_REGSI CALL DATA_PATI DISK IS NOT BUSY ~ FALSEI CMD_BLK(INDX). COMMAND = WRITE_SCTI CALL WRITEA«!( 'MULTIPLE SECTOR'S? )',00»1 CHAR = CII IF CHAR = 'Y' THEN DOl CALL WRITEA «!( 'YES - ',00»; CMD BLK(INDX). COMMAND = CMD_BLK(INDX).COMMAND DR MULT SCTRI CALL WRITEA«!('DO NOT EXCEED BUFFER LIMIT" ',CR,LF,OO»I END; ELSE CALL WRITEA«!( 'NO', CR, LF, 00»·1 CALL WR ITEA «! ('ENABLE RETR IES ? )', 00) ); CHAR = CI I IF CHAR = 'N' THEN DOl CALL WRITEA(@('NO',CR,LF,OO»I CMD BLK(INDX),COMMAND • CMD_BLK(INDXl.COMMAND OR NO_RETRYSI ENOl ELSE CALL WRITEA«!( 'YES',CR,LF,OO»I CALL DISK(I!CMD_BLK( INDX»I ENDI 1* DOl CASE 2 - FORMAT TRACK *1 CALL WRITEA(@('FORMAT TRACK',CR,LF,LF,OO»I CALL WRITE REGSI DISK_IS_NOT_BUSY = FALSEI CMD BLK(INDX) COMMAND FORMAT; CALL WR !TEA (I! (' INTERLEAVE FACTOR? (1 TO ?»', 00» I I_FACTOR = CI - '0'; CALL CO(I FACTOR + '0')1 CALL CO(CA); = CALL CO(LF}; FRMT BFFR SIZE = (2 * (CMD_BLK(INDX), S_CNT) + 1)1 DO 1-= 0 TO FRMT BFFR SIZE; BUFFER ( I) = CO; END; LOG_SECT _NUM = 0; 1= II MAKING TABLE = TRUE; DO WHILE MAKING_TABLE; DO WHILE I <= FRMT_BFFR_SIZEI BUFFER(I) = LOG SECT NUM; LOG_SECT_NUM = LOG_SECT_NUM + II I = I +(1 FACTOR * 2); ENOl IF LOG_SECT_NUM < CMD_BLK(INDX),S CNT THEN DOl I = I - (FRMT BFFR SIZE + III IF (I = 1) OR-(BUFFER(I) () 00) THEN r = I + 2; ENOl ELSE I1AKING_TABLE = FALSE I END; CALL WRITEA«!('256 TRACKS IS THE LIMIT',CR,LF,OO»; CALL WRITEA«!('HOW MANY TRACKS? IN HEX ;>',00»1 TRACKS = HEXIN(TRACKS)I CALL CO(CR)I CALL CO(LF)I CALL WRITEA(I!('HOW MANY SURFACES? I.E. ,01 )',00»; PLATTERS = HEXIN(PLATTERS)I CALL CO(CR); CALL CO(LF); TRACK_CNT = 1; 231133-43 6-717 231133-002 AP-182 470 471 6 7 472 7 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 8 8 8 8 8 8 8 8 8 8 9 8 8 8 7 488 7 489 490 491 492 493 494 495 496 7 7 7 497 498 499 500 501 502 503 5 6 6 6 7 7 6 6 6 1* DO. CASE 3 - SCAN 10 *1 6 5 1* DO. 6 6 6 507 6 508 6 6 6 511 512 513 514 515 516 517 END. CALL WRITEA(@(' SCAN ID', CR, LF, LF, 00)). CALL WR I TE REGS. DISK_IS_NOT_BUSY = FALSE. Ct1D BLK( INDX). COMMAND = SCAN ID. CALL DISK(@CMD BLK(INDX)). END. - 504 505 506 509 510 DO WHILE TRACK_CNT (= TRACKS. PLAT CNT = I. DO WHILE PLAT CNT (= PLATTERS. CALL UPDATE CMD ELK. CALL CO(CR)~ CALL WR!TEA(@('TRACK = ',00)). CALL DISP_HEX(@TRACK_CNT, I). CALL WR !TEA (@( '. HEAD = , 00) ) • AA = DISK_REGS(SDH) AND 07H. CALL DISP HEX(@AA.I). CMD_BLK(INDX). COMMAND = FORMAT. CALL DISK(@CMD BLK(INDX)). DO WHILE CMD_BLK(INDX). COMMAND <) DO. END. PLAT CNT = PLAT CNT + I. DISK=REGS(SDH) ~ DISK_REGS(SDH) + I. ENDI DISK REGS(SDH) = DISK REGS(SDH) - (PL.ATTERS). DISK-REGS(CYL LB) = DISK REGS(CYL LB) + I. IF DISK_REGS(CYL_LB) = 00 THEN DISK_REGS(CYL_HB) DISK_REGS(CYL_HB) + I. TRACK CNT = TRACK CNT + I. CALL UPDATE_CMD_BLK. END. CALL CO( CR). CALL CO(LF). CASE 4 - SEEK TRACK *1 6 CALL WRITEA(@('SEEK TRACK',CR,LF,LF,OO)). CALL WR I TE_REGS. CMD_BLK(INDX). COMMAND = SEEK OR STEP_RATE. DISK_IS_NOT_BUSY = FALSE. CALL DISK(@CMD BLK(INDX)). END. 1* CASE 5 - RESTORE *1 DO. CALL WRITEA(@(' RESTORE COMMAND',CR,LF,LF,OO)). CALL WR I TE_REGS. Ct1D_BLK ( INDX). COMMAND = RESTORE OR STEP _RATE. DISK_IS_NOT_BUSY = FALSE. CALL DISK(@CMD_BLK(INDX)). END. 5 1* DO. 6 5 6 6 6 6 6 518 519 520 521 522 523 524 6 6 525 526 527 5 6 528 6 529 530 5 6 531 6 6 6 6 CASE 6 - READ DISK REGISTER FILE *1 CALL WR!TEA(@(' READ DISK REGISTERS',CR.LF.LF,OO»). CMD_BLK(INDX).COMMAND = 99H. CALL DISK(@CMD_BLK(INDX)). CALL DISP _CMD_BLK. CMD_BLK(INDX).COMMAND = OFFH. 6 END. 1* DO. CASE 7 - HELP TABLE *1 CALL lOR !TEA ( OR HEFH> > >',00»; CHAR = CI; CALL CO(CHAR); CALL CO(CR); CALL CO(LF); IF CHAR = 'A' THEN DO; INDEX = 0; DO WHILE CHAR <> ESC; DO I = 0 TO 255; CALL CO (BUFFER (INDEX + I»; END; INDEX = INDEX + I; CHAR = CI; END, END; IF CHAR = 'H' THEN DO, INDEX = 0, DO WHILE CHAR <) ESC; CALL DISP HEX(!BUFFER(INDEX),256), INDEX = INDEX + 256; CHAR = CI; END, END; 6 6 6 6 6 6 7 7 8 9 9 8 B 8 7 6 7 7 8 8 8 8 7 END; 6 END; 1* DO CASE *1 END, 1* IF *1 ELSE DO, CALL WRITEA«(!('*** DISK IS BUSY ***',CR,QO», END, 5 4 3 4 4 IF CMD BLK(INDX).COMMAND = 00 THEN DO; DI SK_I S_NOT _BUSY = TRUE; CALL DISP STATUS, END, - 3 4 567 568 4 569 3 CASE 9 - DISPLAY BUFFER DATA *1 4 END, 1* FOREVER *1 END MAIN, END HOST _MODULE, 571 MODULE INFORMATION: 570 2 1 OFD8H CODE AREA SIZE CONSTANT AREA SIZE = 09;JCH 04BOH VARIABLE AREA SIZE 003EH MAXIMUM STAC~ SIZE 868 LI NES READ o PROGRAM WARNINGS o PROGRAM ERRORS 40560 2364D 1152D 62D DICTIONARY SUMMARY: 31KB MEMORY AVAILABLE 12KB MEMORY USED (38%) OKE DISK SPACE USED END OF PL/M-86 COMPILATION 231133-45 6-719 231133-002 - lORD IS lORD PI ~ ) 22 MCSO PI 20 MCSI PI 1310WR PI RPI 74LS126 S .. 6 +5V +5V 1 71 ~4 ~LS74 RPI 74LS126 12Jo 11 1 6 ~13 74L5126 +5Y 74LS04 , _ 2 RPI r 1 S g .. 8 MWAIT ~ ~ RPt 1 4 +5V I~06 4 74508 ~ 10 5..JUHl UDI 6 ~3 X4 2 0 PR l! ~ CLR 14 Qti- TTL 1 UB2 Q pL ~1 DELAV LINE ~ 4 lOONS! TAP ~ ~ ~ UBI BCS +SY 74LS126 2 3 Uoll 1 I iiiiRD 8 ~RP1 ~' 1 ~ +~ II ; 4 1 RPI 3 iW +SY r+ -J Moll 3 2 o MAO 1 Q) I f\) Yiit=7 G2A G2ii Gl C B A VI 745138 ~ Uol2 Y7~ 4 7Mol2 8 L 3 2 1 "" 8 Moll PI 11 MAO PI I - YO G2B G1 C 745138 B Vi Vi Y6 Uol3 15 ~ P'¥.- Y2 Y3 ~ ~ A "\7 5 RESET :>~M~l G2A ~ ~ ->< ~ II 8 RolMSEL ~3 LTCH SOH 10 ']UB3 1 74LS32 MR Y7 ~ INTEL CORPORATION TITLE UD1 8 r Mol 74LS04 5 .... 0"'0 ::1:"'0 »0 .... - 9 74S08 2 S PI CS ~~ ~ 10 VS Pf" (I)> mm i:z iOiiiIiY 13 12 1 RPI MCSO IDBCR Yipt- +"SV I BDWR 82082 I S~El CODE NUMBER DATE JUNE 1984 I' sax llREY 082ARY,DWG A 'SHEET 1 OF 4' - 231133-31 0 0 (I) RAMSEL eLR aOWR 13 74508 SORD '2 UB3 ~. • II 10 UCl 7~04., -.~ r!- UDl r0- • 'OA~~ Rl lOB 7 rt-~ 'Qe~~ 6 s 74LS393 100 ~~ ~ ~----2QA I ~~ UE, 7450. BeR 4 ~ I> 74L504 2 61 UB3 ,OA 2 UD1 2QO 02 11 03 13 A:l AS AS A7 ~ 06~ 2016 07 ,. ~ A9 D4~ 05~ A4 23 22 AS A9 A10 ~~~ f-sA;o Rl RP2 2 2 ~ 4 74LS393 100 ~~ , :~ Il 20CI: 5 3 2QB~ ----.:::-. R2 IOBCR 4 :; • 00 01 10 AD A' A2 UEJ WEC"E y,. DE 20 An r*< ~-----2QA ~ ~~~ R2 'f' -...J UE2 t > "0 2ao L..:-- .!.. !::'1 CO I\) MOO 33 2 MOl 31 3 M0229 4 M0327 S MD719 17 00 0, ~: 03 02 92 83 14 A4 B. AS 74LS245 85 13 A6 86 '2 • •, lORD B, Al 7 MDS 23 M0621 BO A' A2 6 MD425 ,. AO A7 B7 O' OS 06 07 11 T os 19 OE ~ 10 ~2D T-l, B""QUTPUT 8 T, HDSEL2 DSELO, 1 4Q 9 74LS374 ~:~ LTCH SOH 5 30 6 40 13 50 HDSELO HDSEll 10 2 2Q ~3D UC2 DSEL2,3 50 12 INTEL CORPORATION ~~~ 80 80 TITLE 82062 SBX ~ DE~ U02 S~E I I DATE '" ~ 8 I 7 I 6 I 5 I 4 I 3 I ;1 CODE NUMBER 062PAL2.DWG SEPT 2 198~.L I REV A SHEET 2 OF 4 1 W 'f a ~ 1133321NT 023 6 7 IOoRDY ~74S74 !._ 12120 PR aL MORQT E1 D A11 11 UB2 CK eLR E2~""'~E4 apl!- Y,3 CLR Mil 3 1 1 UHl 2 L.L 5 6 7 8 74$08 BDRD BDWR CS C ---2!... rl MA Ol I -J N N ~ 19 DO 01 02 03 18 17 16 04 05 06 r-... 12 13 12 WG RWC STEP OIR AD WCLK WR CS BORa INDEX AO A1 A2 DO 01 02 03 TRKOO SC WR FAULT DRDY t UCl WD RC Ro RG oRUN LATE . EARLY 74508 MiI~8 . 24 33 27 5 UI1 3~o!,,4 ~O~ 6 t-ui1 14LS11 UK1 UK1 30 28 I 510<> 38 34 22 23 WR DATA RDCLK RD DATA I b'" iG ,~06'2 DIR IN 34 'J;INoEX'20~ r'WV" r""fv'"r'I/II'¥" C TRACK 000 10 7~LS1~ ~.r'VII'v- SEEK COMPLETE·8 UK1 ~- UK1 READY 22 ~~~ 'T SHT 4 » "a WRITE FAULT 12 UK,,~4~'1, ~r'VII'v- .!.. CCI N J' NOTE: ALL UNUSED CONN PINS ARE TIED TO GRND oRUN LATE EARLY B ---- HOO 14 7407 lJ>2 UD3 1G L UC3 8 ~~'~ RDGATE ~ 1YO 2G 1C 13 C;; RWC2 STEP 24 -- u ..... oSEL2.3 DSELO. 1 '" U03 11~06'0 74LS14 6 5 31 32 21 39 37 WG6 !":UI1 +5V 29 PUlWP '~'0 "'01 D HD2 4 iC· ~ 10 ~U11 ____________~__________~[.J! UI1 A 9~068 26 UF3 HoSEL1 HDSEL2 74LS04 P1 12 P1 14 ,.!:!... 26LS31/4 1i);; UI1 74n~ HDSELO eTC MINTR1 MINTRO ~FROMUH2 82062 06 07 ~ 11 74Ls32 Mil 15 04 14 05 07 B BRDV BCR BCS INTRQ V e .... ··e 13 V flL 2 BeR BCS E3 .....Q m m DSO 26 7407 31>4 OS128 7407 .!p6 U03 OS230 U03 7407 21>8 U03 INTEL CORPORATION' OS332 TITLE J1 SIZE a 82062 A sax REV A 8 I 7 I +5V "T' 6 I I 5 I 4 I 3 2 I Pll +5V 1 ~ +5V RP3 DRUN 3Bl D D 1 uF ~~ PUP1 5 ___________+.. 26lS32 ~4J UG2 B 265ns ClR - t-- C C 3Bl RD GATE 3Bl RD ClK a> I --J 11 "'"7R'P2 .....j 3Bl 3Bl RD DATA I\) 74S151 D7 ~ W r----~_::':'---..:;,!!.!!!...---+-E.lD6 3Bl WR DATA 1~ ~ '"::1 W 'f o o '" ~~~ I~ It, I,£'n PUPl DO UK2 I- STB INTEL CORPORATION L-~~~--------~IA 82062 sax I TITLE REV RWC I 7 I 6 I 5 I 4 I 3 r- ._- co I\) 6 INB OUTB+ ....8:---:-' 9 15 INA OUTB- .... 11,....-:::~ 3Dl WGEN 4 EN OUTC-.'-1-0-~ 12 EN Ul2 OUTC+ ...._ _, ~l lC8, 4B8 4D5 ..... I OUTA+ 2 OUTA- 3 OUTD- 13 OUTD+ 14 B ~ "" ..,. 8 INC IND t-- D3 D2 1~ 3Dl 1 7 6 D4 B 13Bl EARLY A W > "tI J2 26lS31 A 2231133-34 APPENDIXD This appendix contains a schematic of the previous design using PAL's to replace the random logic. The previous design could not do DMA transfers and inserted a large delay when transferring data from buffer RAM to the system. The PAL version does do DMA transfers and buffer reads happen at full SBX bus speed. One other minor change was to replace the 500 ns delay line with a 74LSl64, which is a more cost effective solution. This schematic is only a paper design since only random logic was replaced with the PAL's. PAL Equation's PAL - Page 1: BDRD/ = (lORD/ • MDACKIl (DELAYED-READ/ • CLK) IF BCS LTCHSDH/ = + (lORD/ • MCSO/ • MAO • MAl • MA2) (MCSO/ • MAO/ • MAl • MA2 • IOWRIl + RAMSEL/ (MCSO • MAO • MAl • MA2) IOBRDY/ (MCS1/ • MAO/ • MAl • MA2/ • IOWR/) IOBCR/ = BDWR/ = Cst + (BCSIl + (MDACKIl (MCS1/ • MAO • MAl/ • MA2/' IOWRIl (IOWRIl IF BCS (MCSO/) IF BCS CLK (MCSO/ • MAO • MAl/ • MA21l +~ (MCSO/ • MAO/ • MAl • MA21l + (MCSO/ • MAO • MAl • MA21l + (MCSO/ • MAO/ • MAl/ • MA2) + (MCSO/ • MAO • MAl/ • MA2) + (MCSO/ • MAO/ • MAl • MA2) + (MCSO/ • MAO • MAl • MA2) PAL - Page 2: MINTR1/MDRQT = MINTRO = COUNT = (PIN2) (BDWR/ RSTCOUNT = OE/ = CLR/ = (PIN1) + + (INTRQ) BDRDIl • (RAMSELIl (IOBCRIl (MDACKIl (IOBCRIl + + + (BCRIl (CSIl (BCRIl 6-724 231133-002 2 3 4 5 6 7 8 lORD 74504 3 .. 4 .... ri- 15 lORD D 4A6 +5V 74L5164 UDI ~ Pl 10 MHZ MWAIT ~ A QA B OB f4-- CLR OC OD OE 7cl OF OG OH RPI 7 ~4 2 D r;..... 16 Pl ::> D 04 O~ PR 6 UB2 _ 3 7- if 2C8 6 0 CLR ~ 1 1 74508 ,.!!.... 2 9 74508 10 3 UB3 RPl lK 8 UB ;,~ RPl RPl DELAYED READ C 22 q> L BCS lDl I MCSO ~Pl "" I\:> (J1 _ 20 MCSI B 7 IOWR I I 19 2 18 BDWR 3 17 CLK 4 16 IOBCR RAMSEL W 'f o o '" I\) 3D8 15 IOBRDY IOBRDY 14 CS CS 2C8.:3C8 MAO 7 13 LTCH SDH LTCH SDH 2A8 MAl 8 12 BDRD 2D8.:.3C8 MA2 9 11 MDACK 2C8 BDRD 9 t>o 8 AO·2 3C8 MR 3C8 B UDI MDACK I II INTEL CORPORATION TITLE 82062 RESET Pl '"~ 2C8 5 MAl MAO PI ....'1JCD I 74504 PI 37 ) 8 2C8 C ):0 MA2 11 PI 5 RAM5EL IOBCR ~Pl A 2C8. 3C8 I PI 9 BDWR 6 PI "' 13 PI PAL 16L8 NUMBER MPST V IA sax 062PAL.DWG IA REV SHEET 1 OF 4 5 4 3 2 231133-35 :101 IORQ 5 6 7 8 2 3 4 ~o ., ----}ii-I t~". I MDRGT:I4~ ~ :~~ :!~ ~--- D 3Dt INTRQ 181 SORD • 17 CLR 4 ,. COUNT 15 RSTCOUNT tet IIDWA I 3CI 8CR • '" 7) MMSEL I • ,., IOBCR • I ~ '3 '.2 1t DOt-=-----..., R' . I 181 CS D 3 '2.0 ~A2 DE t2 .... ,ac .,v UEO ~; '" C or, INTRO ON IIDRQ WI. W4, W7. WI INTAl ON IOAQ W1, W3, WI, .7 MOROT ON lORa W" W3, W5, W' ,. 20'. 208 lAl~ C 01 D2 felS313 tac ____ ~--t---ft~~Jlb [,"'" i~ q> ..... I\) ITIADY 3D. » 'U ... I UEZ ZOD CD en N _a _8 7fLS24! MDOn 12 _~ B _ M ~ ::: ::: tet M M ~ 1ID71' lORD • 1 ~ A7 T DE UC2 II I I I :~I~· IIIII :I - 1D 10 • 2 2Q T.t,8 z 0UTPUT so so A TD ID '.'~ '" ~ co 6 o '" 8 '\7 7 B -01 HDSELD HOSELI 381 HDSELf : c;; I I I I I DO Ill- ~- K _ -' Ii l' 6 5 DSELO. 1 :sAl 12 50 10 ,. 10 11 10 ,. INTEL CORPORATION DSEU.:I 'TITLE SIZE I CODE I NUMBER iii B UD2 DATE 4 82062 3 SEPT 1984 2 'A sax REV 0I2PAL2.DWQ I A ·SHEET 20F 4 231133-32 6 7 8 5 2 3 4 ,B, + 5V D 2C, 74574! 10 S~ STBRDY'1 2D, CL~ 2ea BCR ¥I ,B, (I) I --I f\) --I 2Bl 1'3 LL 5 6 7 8 ~ AD 9 1.0-2 ~ 2A, 7406 HDSELO to. 2 ~ HOSEL, Ull 3~ 21., HOSEL2 21.1 BRDY BCR BCS INTRa MR RD WR CS BDRO AD A' A2 " 1.2 19 DO '8 0' '7 02 '6 D3 15 D4 '4 05 '3 D6 '2 D7 00 01 02 03 04 05 51>!! '1.1 WG RWC STEP DIR WCLK INDEX TRKOO SC WR FAULT DRDY B2062 WO RC RD RG ORUN LATE EARLY 24 33 27 26 25 MRi~ 1 UH, 8 r ......... rWGEN 7~~ I 5'0 PULWP WROATA RO CLK RD DATA RD GATE DRUN EARLY LATE ~ 4CI 4C8 4C8 7 rwv- INDEX 20"';';' r-"N'r"~ TRACK 000'0 SEEK COMPLETE 8 14~s~a ~ UK' ~ ~ 7220 W o '" I N B '41""""1 HOD '4 H01'8 HD2 4 74D7 1.(>2 UD3 ~ DS'28 7407 U03 DS230 U03 B 9-1> I A U03 2C ""C. OSD 26 7407 3t>4 2G 10 1YO 1Yl lY2 1t>& lC INTEL CORPORATION 7407 DS332 :I, UC3 8 ...."aCD '-:;r ITITLE 7 SEPT 1884 6 5 4 3 IA 82082 SBX NUMBER 't' o :t- READY 22 330 UL3 40' 4B8 4B8 UI1 +5V '"~ c WRITE FAULT 12 U':(, 1~~'~1 ~-J..NvUK' D STEP 24 ~ 7:LS'~ ~..NVI.- UKI 41.8 DlR IN 34 ....UI' + V 30 28 ,ea RWC2 ".!:40~ 12 WCLK 4B6 3' 32 BCS Rwe WG6 ~3 '1~406 '0 l4LS_l~ 2D8 2D8 r0- ,7!'",0 ttiDl "'UI1 29 2' 39 37 38 34 22 23 484 74LS04 ,iO;: '0 9~068 "UI1 UF3 Ull AI2A'~ 21.1 OSELO. , " 7450B 35 2 1 D6 D7 B '21 UB3 PR a 19 UB2 CK CLR II ,1., MR ,B, BDRD ,C, BOWR ,B, CS C ,:r.;; BDRa INTRa 082PAL3.0WG I REV SHEET 3 OF 4 2 231133-33 A . I 8 I 7 +5Y 6 i ~ 5 1 ~;~k 1 uF T.01uF t--t-4~WIo--I+5Y DRUN ClK 20 3 5 10MHz 4A8 26LS32 UG2 4 B 265n. ClR - ...+---.....1 OUTD 13 OUTC IND+ IND- 2 14 3 I- 011 +5Y V 9 3B1 RD GATE 3B1 RO K 3B1 -I3B1 1- RP2 C 11 ~ 'l' -J 3B1 D PUP1 MFM 19 " 1 k 1% I 2 RP3 T.D1ut cl I 3 +5Y 1""1 ;.5k o I 4 PLl ~ RP3 1 +5Y .... 28lS31 745151 I\.) D7 12 ns (Xl wr 381 WR DATA 1 RP2 ---JtI',..,..,.~~-&'::..I ~INO t:!:1INC 6 t!- t- OUTA+iOUTA3 OUTD- 13 OUTD+ 14 IB B 13Bl EARLY 1 RP2 10 +12 n. ~~ INB INA ....11 M - I 4A610MHZ 3C4 9 _ _ _~.1 EN UK2 C B EN OUTB+ .... 6_.:::.1 OUTB- _8_~ OUTC- 11 13 Ul2 0UTC+ 10 I- 14 STB OUT UF1 A I -~7 1Ca.4Ba 20MHz INTEL CORPORATION I 405 82062 TITLE IA sax REY 301 ~ c;; '"6 2 A RWC a 7 I 8- I 5 T 4 I 3 2 231133-34 . l> J2 "U .... co II) UPI·452 CHMOS SINGLE CHIP SLAVE MICROCONTROLLER 83452 - 8K X 8 Mask Programmable Internal ROM 87452 - 8K X Internal EPROM 80452 - External ROM/EPROM 16-Bit Timer/Counters to 16 MHz Clock • Two • Rate Boolean Processor • Software Compatible with the MCS-51 Bit Addressable RAM • Family • 8 Interrupt Sources • Programmable 128-Byte Bi-Directional FIFO Slave • Interface • Channel Full Duplex Serial 83452187452/80452:1.6 • • Two DMA Channels 256 x 8-Bit Internal RAM 34 Additional Special Function • Registers • 40 Programmable I/O Lines • 64K Program Memory Space Data Memory Space • 64K 68-Pin PGA • (See Packaging Spec .• Order: # 231369) The Intel 83452/87452/80452 Universal Peripheral Interface, UPITM-452, is a 68 pin CHMOS Microcontroller with a sophisticated bi-directional FIFO buffer interface on the slave bus and a two channel DMA processor on-chip. The UPI-452 is the newest member of Intel's UPI family of products. It is a general-purpose slave microcontroller that allows the designer to grow a customized interface solution. The UPI-452 contains a complete 80C51 CPU core with twice the on-chip data and program memory. The sophisticated slave FIFO module acts as a buffer between the UPI-452 internal CPU and the external host CPU. To both the external host and the internal CPU, the FIFO module looks like a bi-directional bottomless buffer that can both read and write data. The FIFO manages the transfer of data independent of the UPI-452 core CPU and generates an interrupt or DMA request to either CPU, host or internal, as a FIFO service request. The FIFO consists of two channels:the Input FIFO and the Output FIFO. The division of the FIFO module array, 128 bytes, between Input channel and Output channel is programmable by the user. Each FIFO byte has an additional ninth bit to distinguish between a data byte and a Data Stream Command byte. Additionally, Immediate Commands allow direct, interrupt drive, bi-directional communication between the UPI-452 internal CPU and external host CPU, bypassing the FIFO. The on-chip DMA processor allows high speed data transfers from one writeable memory space to another. As many as 64K bytes can be transferred in a single DMA operation. Three distinct memory spaces may be used in DMA operations; Internal Data Memory, External Data Memory, and the Special Function Registers. Like the 80C51, the CHMOS UPI-452 has Normal, Idle and Power Down Modes. 6-729 November 1985 Order Number: 231428-001 l li: o c:'" ,Q 00 _z ~~ _"'z ~I !i 0 :ti ~~~~ g o > 'i'N>"I~~ "'I "'0 I tn 1"'"1 r ." c" c ... CD ..... jill " z ~,..::j~(II~ .....z!:::u> ~o5~~ » ... n • - - - - - - - - - ~ I. ---'Hr, " r--I+----------1t---{F-~:ll I~ i i i FIFO FIFO HOST - I C;r~~~L MODULE C~~-::~iL INT~~~ACE I ::. 0> ..!.J Co) 0 i FIFO ~~~ CD n c !!!.. HSTAT ... .t; ';lIo. 1i a..::.;;.::..&.::.:;.;. III ,;::..I, i! IMMEDIATE COMMAND I I I I HOST DMA AND INTERRUPT REQUEST CONTROL L.-..;;;;;;o;.;......1 I I c: "U 7"" .j:o, (II N +~---i~-"' 0" n ;II; C iii" ~ @ cc iil 3 DMA TIMING AND CONTROL DCONO SARO DARO BCRO @) ~ ~ Sm"S DCONl SAR 1 DAR 1 BCR 1 r -------------------~ © Iiiiil ~ 'liiI © ~ ~ ~ C::3 © ~ UPI·452 r------------------------, ." N I o ~ peON Tl1 PSEN ALE EA RST seON TMOD TeON TL 1 z Q", ... ", u'" :::>~ ...... "''' "'''' " L-____________________________________________________ ~~ ...... -lQ L-------------------------------------------------------~~~i ----------------~ 231428-2 Figure 1. Architectural Block Diagram (Continued) 6-731 inter UPI-452 UPI MICROCONTROLLER FAMILV Packaging The UPI-452 joins the current members of the UPI microcontroller family. UPI's are derivatives of the MCSTM family of microcontrollers. Because of their on-chip system bus interface, UPI's are designed to be system bus "slaves", while their microcontroller counterparts are intended as system bus "masters". In addition to the UPI-452, which is based on the MCS-51 family, Intel makes the following UPI microcontrollers: The first UPI-452 versions to be offered will be the 87452 (EPROM) and 83452 (ROM-Less). These UPI Microcontrollers are fully supported by Intel's EPROM programmers (iUP-201) and development tools (ICE, ASM and PLM). The 80452 comes in a 68-pin PGA (Pin Grid Array) package, while the 87452 will be offered in a hybrid package. This hybrid package will consist of the standard 68-pin PGA package with a 2764A EPROM soldered on top (see Figure 2). These two packages allow designers to use either on-chip EPROM or external memory for their initial designs. The 83452 (ROM version) will come in the standard 68-pin PGA package. UPI Family (Slave Configuration) MCSFamily (Master Configuration) 8041A 8048AH 6MHz 64 1K - 8741AH 8748H 6MHz 64 - 1K .8042 8742H Speed RAM (Bytes) ROM (Bytes) EPROM (Bytes) 8049AH 12 MHz 128 2K - 8749H 12MHz 128 - 2K 12 MHz 256 2K - 12 MHz 256 - 2K - 8042A 8742AH 83452 80C51 16 MHz 256 8K - 87452 80C51 16MHz 256 - 8K _68 -66 -64 -62 -60 -58 -56 -54 -52 - 1 - 2 -67 -65 -63 -61 _59 -57 -55 -53 -51 - 3 _4 - 5 - 6 - 7 - 8 -50 -49 -48 -47 -46 -45 - 9 -10 -44 -43 -11 -12 -42 -41 -13 -14 -40 -39 -15 -16 -38 -37 -17 -19 -21 -23 _25 -27 -29 -31 -33 -36 -35 231428-4 -18 -20 -22 -24 -26 -28 -30 -32 -34 231428-3 Figure 2a_ Top View of UPI-452 68-Pin Package 6-732 UPI-452 t---------1.15o~.010 .025 TYP SQ.--------I "a ~IN .. g~ "' l.F==::j=j=====*=:j=::::f==f::=:j=~~-.575:t SWEDGE PIN (4) PLes PINS B2. 81 D, K2,AND Kl0 @@@@ @ CO) @ @ @@ @@ @@ t--{. &l---t .010 -t----l--#- .500 ~ .003 .400:t .003 @ @ .300i .003 .200~ .003 ! .100:1: .003 I ----.---- I @@ @@ i @@ @@ @@ @@ @@@@@ @@@@@ @@@@ @@@ PIN # 1 ID CORNER 231428-5 .018 +.008 -.003 ! SEATING PLANE! .0SOi .005 ........L...~_~ 231428-6 Figure 2b. Bottom View of UPI·452 S8·Pin PGA Package 6-733 inter UPI-452 UPI-452 PIN DESCRIPTIONS Symbol Pin # 9/43 60 Type I I XTAL1 38 I XTAL2 PortO (ADO-AD7) PO.O .1 .2 .3 .4 .5 .6 PO.7 Port 1 (AO-A7) (HLD, HLDA) P1.0 .1 .2 .3 .4 .5 .6 P1.7 Port 2 (A8-A15) P2.0 .1 .2 .3 .4 .5 .6 .7 Port 3 P3.0 .1 .2 .3 .4 .5 .6 P3.7 39 Vss Vee 0 I/O 8 10 11 12 13 14 15 16 I/O 7 6 5 4 3 2 1 68 I/O 29 28 27 25 24 23 22 21 I/O 67 66 65 64 63 62 61 59 Name and Function Circuit Ground. + 5V power supply during normal, idle, power down, programming and verification operation. Input to the oscillator's high gain amplifier. A crystal or external source can be used. Output from the high gain amplifier. Port 0 is an 8-bit open drain bi-directionall/O port. It is also the multiplexed low-order address and data local expansion bus during accesses to external memory. It is used for data input and output during programming and verification. External pull ups are required during program verification. Port 0 can sink/source eight LS TTL inputs. Port 1 is an 8-bit quasi-bi-directional I/O port. It is used for low-order address byte during programming and verification. Port 1 can sink/ source four LS TTL inputs. Pins P1.5 and P1.6 are multiplexed with HLD and HLDA respectively whose functions are defined as below: Port Pin Alternate Function P1.0-P1.4 . (No Special Function) P1.5 HLD -Parallel interface's hold input/output Signal P1.6 HLDA -Parallel interface's hold acknowledge output P1.7 (No Special Function) Port 2 is an 8-bit quasi-bi-directionall/O port. It also emits the highorder 8 bits of address when accessing local expansion bus external memory (or during 87452 programming and verification) . Port 2 can sink/source four LS TTL inputs . Port 3 is an 8-bit quasi-bi-directionall/O port. It is also multiplexed with the interrupt, timer, local serial channel, RD/ and WR/ functions that are used by various options. The output latch corresponding to a Special Function Register must be programmed to a one (1) for that function to operate. Port 3 can sink/source four LS TTL inputs. The alternate functions assigned to the pins of Port 3 are as follows: Port Pin Alternate Function P3.0 RxD - Serial input port P3.1 TxD - Serial output port INTO - Interrupt 0 Input P3.2 P3.3 INT1 - Interrupt 1 Input P3.4 TO -Input to counter 0 P3.5 T1 -Input to counter 1 WR/ - The write control signal latches the P3.6 data from Port 0 outputs into the External Data Memory on the local bus. RD/ - The read control signal latches the P3.7 data from Port 0 outputs on the local bus. 6-734 inter UPI-452 UPI-452 PIN DESCRIPTIONS (Continued) Symbol Pin # Name and Function Type Port 4 P4.0 .1 .2 .3 .4 .5 .6 .7 I/O 30 31 32 33 34 35 36 37 RST 20 I ALE/PGM 18 I/O PSEN 19 0 EA 17 I DBO DB1 DB2 DB3 DB4 DB5 DB6 DB7 58 57 56 55 54 53 52 51 I/O CS AO A1 A2 44 I 40 41 42 READ 46 I WRITE 47 I DROIN/ INTROIN 49 0 DROOUT/ INTROOUT 48 0 Port 4 is an 8-bit quasi-bi-directionall/O port. Port 4 can sink/source four TTL inputs. It is also used as the control signals during EPROM programming and verification as follows: Alternate Function Port Pin '1' during program and verify P4.5 '0' during program and verify P4.6 '0' during verify - used as output enable P4.7 '1' during programming w/ ALE = 0 Note: see Programming and Verification Characteristics in AC/DC Specification section. A high level on this pin for two machine cycles while the oscillator is running resets the device. An internal pulldown resistor permits Poweron reset using only a capacitor connected to Vee. This pin does not receive the power down voltage as is the case for HMOS MCS-51 family members. This function has been transferred to the Vee pin. Provides Address Latch Enable output used for latching the address into external memory during normal operation. Receives the program pulse input during EPROM programming. ALE can sink/source eight LS TTL inputs. The Program Store Enable output is a control signal that enables the external Program Memory to the bus during normal fetch operation. PSEN can sink/source eight LS TTL inputs. When held at TTL high level, the UPI-452 executes instructions from the internal ROM/EPROM when the PC is less than 8192 (8K, 200H). When held at a TTL low level, the UPI-452 fetches all instructions from external Program Memory. Slave Data Bus is an 8-bit bi-directional bus. It is used to transfer data and commands between the UPI-452 and the host processor. This bus can sink/source eight LS TTL inputs. This pin is the Chip Select of the UPI-452. These three address lines are used to interface with the host system. They define the UPI-452 operations. The interface is compatible with the Intel microprocessors and the MULTIBUS. This pin is the read strobe from the host CPU. Activating this pin causes the UPI-452 to place the contents of the Output FIFO (either a command or data) or the Host Status/Control Special Function Register on the Slave Data Bus. This pin is the write strobe from the host. Activating this pin will cause the value on the Slave Data Bus to be written to the Input FIFO as a command or data. This pin requests an input transfer whenever the Input Channel requires data. This output pin requests an output transfer whenever the Output Channel requires service. If the external host to UPI-452 DMA is enabled, and a Data Stream Command is at the Output FIFO, DROOUT is deactivated and INTRO is activated (see 'GENERAL PURPOSE DMA CHANNELS' section). 6-735 intJ UPI·452 UPI·452 PIN DESCRIPTIONS (Continued) Pin # Type Name and Function INTRO Symbol 50 0 This output pin is used to interrupt the host processor when an Immediate Command Out or an error condition is encountered. It is also used to interrupt the host processor when the FIFO requests service if the DMA is disabled and INTROIN and INTROOUT are not used. DACK 45 I This pin is the DMA acknowledge for the Slave Data Bus Input and Output Channels. When activated, a write command will cause the data on the Slave Data Bus to be written as data to the Input Channel (to the Input FIFO). A read command will cause the Output Channel to output data (from the Output FIFO) on to the Slave Data Bus. This pin should be driven high (+ 5V) in systems which do not have a DMA controller (see Address Decoding). VeelVpp 26 I + 5V power supply during operation. The Vee pin receives the + 12V EPROM programming and verification supply voltage. It is also the standby power pin for power down mode. Introduction This data sheet describes the unique features of the UPI-452. Refer to the 80C51 data sheet for a description of the UPI-452's core CPU functional blocks including; The UPI-452 slave microcontroller is essentially an 80C51 with double the program and data memory, a slave interface which allows it to be connected directly to the host system bus as a peripheral, a FIFO buffer module, a two channel DMA processor, and a fifth I/O port (Figure 3). The UPI-452 retains all of the 80C51 architecture, and is fully compatible with . the MCS-51 instruction set. - Timers/Counters -1/0 Ports - Interrupt timing and control (other than FIFO and DMAinterrupts) - Serial Channel - Local Expansion Bus - Program/Data Memory structure ARCHITECTURAL OVERVIEW The Special Function Register (SFR) interface concept introduced in the MCS-51 family of microcontrollers has been expanded in the UPI-452. To the 25 Special Function Registers of the MCS-51, the UPI-452 adds 34 more. These additional Special Function Registers, like those of the MCS-51, provide access to the UPI-452 functional elements including the FIFO, DMA and added interrupt capabilities. Several of the 80C51 core Special Function Registers have also been expanded to support added features of the UPI-452. - Power-Saving Modes of Operation • - CHMOS Features - Instruction Set • except 87452 hybrid package Figure 3 contains a conceptual block diagram olthe UPI-452. Figure 4 provides a functional block diagram. 231428-7 Figure 3. UPI-452 Conceptual Block Diagram 6-736 UPI·452 OPTIONAL FEATURES: -SERIAL CHANNEL -EXTERNAL INTERRUPTS -HLD!HLD ACK -LOCAL EXPANSION BUS -RD I I -WR I I I -EXTERNAL COUNTER INPUT -EPROM PROGRAM AND VERIFY CONTROL 231428-8 Figure 4. UPI·452 Functional Block Diagram FIFO Buffer Interface FIFO PROGRAMMABLE FEATURES A unique feature of the UPI-452 is the incorporation of a 128 byte FIFO array at the host-slave interface. The FIFO allows asynchronous bi-directional transfers between the host CPU and the internal CPU. The division of the 128 bytes between Input and Output channels is user programmable allowing maximum flexibility. If the entire 128 byte FIFO is allocated to the Input channel, a high performance Host can transfer up to 128 bytes at one time, then dedicate its resources to other functions while the internal CPU processes the data in the FIFO. Various handshake signals allow the external Host to operate independently and without frequent monitoring of the UPI-452 internal CPU. The FIFO Buffer insures that the slave processor receives data in the same order that it was sent by the host without the need to keep track of addresses. Three slave bus interface handshake methods are supported by the UPI-452: DMA, Interrupt and Polled. The FIFO is nine bits wide. The ninth bit acts as a command/data flag. Commands written to the FIFO by either the host or internal CPU are called Data Stream Commands or DSCs. DSCs are written to the input FIFO by the Host via a unique external address. DSCs are written to the output FIFO by the internal CPU via the COMMAND OUT Special Function Register (SFR). When encountered by the host or internal CPU a Data Stream Command can be used as an address vector to user defined service routines. DSCs provide synchronization of data and commands between the Host and internal CPU. Size of Input/Output Channels The 128 bytes of FIFO space can be allocated between the Input and Output channels via the Channel Boundary Pointer (CBP) SFR. This register contains the number of address locations assigned to the Input channel. The remaining address locations are automatically assigned to the Output FIFO. The CBP SFR can only be programmed by the internal CPU during Freeze Mode (See FIFO-External Host Interface Freeze Mode description). The CBP is initialized to 40H (64 bytes) upon reset, and can range from OOH-7FH. The number in the Channel Boundary Pointer SFR is actually the first address location of the Output FIFO. Writing to the CBP SFR reassigns the Input and Output FIFO address space. Whenever the CBP is written, the Input FIFO pointers are reset to zero and the Output FIFO pointers are set to the value in the CBP SFR. All of the FIFO space may be assigned to one channel. In such a situation the other channel's data path consists of a single SFR (FIFO IN/COMMAND IN or FIFO OUT/COMMAND OUT SFR) location. 6-737 intJ UPI-452 FIFO Read/Write Pointers These normally operate in auto-increment (and autorollover) mode, but can be reassigned by the internal CPU during Freeze Mode (See FIFO-External Host Interface Freeze Mode description). Threshold Register The input FIFO Threshold SFR contains the number of empty bytes that must be available in the Input FIFO to generate a Host interrupt. The Output FIFO Threshold SFR contains the number of bytes, data and/or DSC(s), that must be in the FIFO before an interrupt is generated.The Threshold feature prevents the Host from being interrupted each time the FIFO needs to load or unload one byte of data. The thresholds, therefore, allow the FIFO's operation to be adjusted to the speed of the Host, optimizing the overall interface performance. Immediate Commands The UPI-452 provides, in addition to data and DSCs, a third direct means of communication between the external host and internal CPUs called Immediate Commands. As the name implies, an Immediate Command is available to the receiving CPU immediately, via an interrupt, without being entered into the FIFO as are Data Stream Commands. Like Data Stream Commands, Immediate Commands are written either via a unique external address by the host CPU, or via dedicated SFR by the internal CPU to the external host CPU. The DSC and/or Immediate Command interface may be defined as either Interrupt or Polled under user program control via the Interrupt Enable (IE) and Interrupt Enable Priority (IEP) Special Function Registers, for the internal CPU and via the Host Control SFR for the external host CPU. of the three writeable memory spaces: Internal Memory, External Memory and the Special Function Register array. The Special Function Register array appears as a set of unique dedicated memory addresses which may be used as either the source or destination address of a DMA transfer. Each DMA channel is independently programmable via dedicated Special Function Registers for mode, source and destination addresses, and byte count to be transferred. Each DMA channel has five programmable modes: - Burst Mode - Alternate Cycle Mode - External Demand Mode - FIFO Demand and Alternate Cycle Mode - Serial Port Demand Mode A complete description of each mode and DMA operation may be found in the section titled "General Purpose DMA Channels". FIFO/SLAVE INTERFACE FUNCTIONAL DESCRIPTION Overview The FIFO is a 128 Byte RAM array with recirculating pointers to manage the read and write accesses. The FIFO consists of an Input and an Output channel. Access cycles to the FIFO by the internal CPU and external Host are interleaved and appear to be occurring concurrently to both the internal CPU and external Host. Interleaving access cycles ensures efficient use of this shared resource. The internal CPU accesses the FIFO in the same way it would access any of the Special Function Registers e.g., direct and register indirect addressing as well as arithmetric and logical instructions. Input FIFO Channel DMA The UPI-452 contains a two channel internal DMA controller which allows transfer of data between any The Input FIFO Channel provides for data transfer from the external Host to the internal CPU (Figure 5). The registers associated with the Input Channel during normal operation are listed in Table 1*. Table 1. Input FIFO Channel Registers . . 1) 2) 3) 4) 5) 6) Register Name Description Input Buffer Latch FIFO IN SFR COMMAND IN SFR Input FIFO Read Pointer SFR Input FIFO Write Pointer SFR Input FIFO Threshold SFR Host CPU Write only Internal CPU Read only Internal CPU Read only Internal CPU Read only Internal CPU Read only Internal CPU Read only . See FIFO-EXTERNAL HOST INTERFACE FREEZE MODE section for Freeze Mode SFR characteristics description . 6-738 intJ UPI-452 EXTERNAL ADDRESS HOST DATA BUS INPUT WRITE POINTER (ORPR) t: CD INPUT FIFO :I: .... Z THRESHOLD SFR Z INPUT WRITE POINTER (ORPR) 231428-9 Figure 5. Input FIFO Channel Functional Block Diagram The host CPU writes data and Data Stream Commands into the Input Buffer Latch on the rising edge of the external WR signal. External addressing determines whether the byte is a data byte or Data Stream Command and the FIFO logic sets the ninth bit of the FIFO accordingly as the byte is moved from the Input Buffer Latch into the FIFO. A "1" in the ninth bit indicates that the incoming byte is a Data Stream Command. The internal CPU reads data bytes via the FIFO IN SFR, and Data Stream Commands via the COMMAND IN SFR. A Data Stream Command will generate an interrupt to the internal CPU prior to being read and after completion of the previous operation. The DSC can then be read via the COMMAND IN SFR. Data can only be read via the FIFO IN SFR and Data Stream Commands via the COMMAND IN SFR. Attempting to read Data Stream Commands as data by addressing the FIFO IN SFR will result in "OFFH" being read, and the Input FIFO Read Pointer will remain intact. (This prevents accidental misreading of Data Stream Commands.) Attempting to read data as Data Stream Commands will have the same consequence. The Input FIFO Channel addressing is controlled by the Input FIFO Read and Write Pointer SFRs. These SFRs are read only registers during normal operation. However, during Freeze Mode (See FIFO-External Host Interface Freeze Mode description), the internal CPU has write access to them. Any write to these registers in normal mode will have no effect. The Input Write Pointer SFR contains the address location to which datal commands are written from the Slave Bus Input/Slave Bus Command registers. The write pointer is automatically incremented after each write and is reset to zero if equal to the CBP, as the Input FIFO operates as a circular buffer. If a write is performed on an empty FIFO, the first byte is also written into the FIFO IN or COMMAND IN SFR. If the Host continues writing while the Input FIFO is full, an external interrupt, if enabled, is sent to the host to signal the overrun condition. The writes are ignored by the FIFO control logic and the cycle is terminated. Similarly, an internal CPU read of an empty FIFO will cause an underrun error interrupt to be generated to the internal CPU and a value of "OFFH" will be read by the internal CPU. 6-739 UPI-452 The Read Pointer SFR holds the address of the next byte to be read from the Input FIFO. An Input FIFO read operation post-increments the Input Read Pointer SFR and loads a new data byte to the FIFO IN SFR or a Data Stream Command into the COMMAND IN SFR at the end of the read cycle. A FIFO Request for Service (via DMA, Interrupt or a flag) is generated to the Host whenever more data can be written into the Input FIFO. For efficient utilization of the Host, a "threshold" value can be programmed into the Input FIFO Threshold SFR. The range of values of the Input FIFO Threshold SFR can be from 0 to (CBP-2). The Request for Service Interrupt is generated only after the Input FIFO has room to accommodate a threshold number of bytes or more. The threshold is equal to the total num- ber of bytes in the Input FIFO minus the number of bytes programmed in the Input FIFO Threshold SFR. With this feature the Host is assured that it can write at least a threshold number of bytes to the Input FIFO channel without worrying about an overrun condition. Once the Request for Service is generated it remains active until the Input FIFO becomes full. Output FIFO Channel The Output FIFO Channel provides data transfer from the UPI-452 internal CPU to the external Host (Figure 6). The registers associated with the Output Channel during normal operation are listed in Table 2*. OUTPUT FIFO 231428-10 Figure 6. Output FIFO Channel Functional Block Diagram Table 2. Output FIFO Channel Registers 1) 2) 3) 4) 5) 6) Register Name Description Output Buffer Latch FIFO OUT SFR COMMAND OUT SFR Output FIFO Read Pointer SFR Output FIFO Write Pointer SFR Output FIFO Threshold SFR Host CPU Read only Internal CPU Read and Write Internal CPU Read and Write Internal CPU Read only Internal CPU Read only Internal CPU Read only 'See "FIFO·EXTERNAL HOST INTERFACE FREEZE MODE" section for Freeze Mode register characteristics description. 6-740 inter UPI·452 The UPI-452 internal CPU transfers data to the Output FIFO via the FIFO OUT SFR and commands via the COMMAND OUT SFR. If the byte is written to the COMMAND OUT SFR, the ninth bit is automatically set (= 1) to indicate a Data Stream Command. If the byte is written to the FIFO OUT SFR the ninth bit is cleared (= 0). Thus the FIFO OUT and COMMAND OUT SFRs are the same but the address determines whether the byte entered in the FIFO is a DSC or data byte. The Output FIFO preloads a byte into the Output Buffer Latch. When the Host issues a RD/ signal, the data is immediately read from the Output Buffer Latch. The next data byte is then loaded into the Output Buffer Latch and an interrupt, if enabled, is generated if the byte is a DSC (ninth bit is set). The operation is carefully timed such that an interrupt can be generated in time for it to be recognized by the Host before its next read instruction. Internal CPU write and external Host read operations are interleaved at the FIFO so that they appear to be occurring concurrently. The Output FIFO read and write pointer operation is the same as for the Input Channel. Writing to the FIFO OUT or COMMAND OUT SFRs will increment the Output Write Pointer SFR but reading from it will leave the write pointer unchanged. A rollover of the Output FIFO Write Pointer causes the pointer to be reset to the value in the Channel Boundary Pointer (CBP) SFR. If the external host attempts to read a Data Stream Command as a data byte it will result in invalid data being read. The DSC is not lost because the invalid read does not increment the pointer. Similarly attempting to read a data byte as a Data Stream Command has the same result. A Request for Service is generated to the external Host under the following two conditions: 1.) Whenever the internal CPU has written a threshold number of bytes or more into the Output FIFO (threshold = (OTHR) + 1). The threshold number should be chosen such that the bus latency time for the external Host does not result in a FIFO overrun error condition on the internal CPU side. The threshold limit should be large enough to make a bus request by the UPI-452 to the external host CPU worthwhile. Once a request for service is generated, the request remains active until the Output FIFO becomes empty. The range of values of the FIFO Output Threshold (OTHR) SFR is from 1 to the Output FIFO Size. The threshold number can be programmed via the OTHR SFR. 6-741 2.) The second type of Request for Service is called "Flush Mode" and occurs when the internal CPU writes a Data Stream Command into the Output FIFO. Its purpose is to ensure that a data block entered into the Output FIFO, which is less than the programmed threshold, will generate a Request for Service interrupt, if enabled, and be read, or "Flushed" from the Output FIFO, by the external host CPU regardless of the status of the OTHR SFR. Immediate Commands Immediate Commands provide direct communication between the external Host and UPI-452. Unlike Data Stream Commands which are entered into the FIFO, the Immediate Command is available to the receiving CPU directly, bypassing the FIFO. The Immediate Command can serve as a program vector pointing into a jump table in the recipients software. Immediate Command Interrupts are generated, if enabled, and a bit in the appropriate Status Register is set when an Immediate Command is input or output. A similar bit is provided to acknowledge when an Immediate Command has been read and whether the register is available to receive another command. The bits are reset when the Immediate Commands are read. Two Special Function Registers are dedicated to the Immediate Command interface. External addressing determines whether the Host is accessing the Input FIFO or the Immediate Command IN (IMIN) SFR. The internal CPU writes Immediate Commands to the Immediate Command OUT (IMOUT) SFR. Both processors have the ability to enable or disable Immediate Command Interrupts. By disabling the interrupt, the recipient of the Immediate Command can poll the status SFR and read the Immediate Command at its convenience. Immediate Commands should only be written when the appropriate Immediate Command SFR is empty (as indicated in the appropriate status SFR:HCON/SCON). Similarly, the Immediate Command SFR should only be read when there is data in the Register. The flowcharts in Figure 7a and 7b illustrate the proper handshake mechanisms between the external Host and internal CPU when handling Immediate Commands. UPI-452 r---------------- SET SET , • -... OPERATES OPERATES INT~RRUPT INT~RRUPT , ,, , ,, ~ ~ SET SET Q \::.J , , .IC .IC GENERATES OPERATES INTERRUPT INT~RRUPT ,, ,, 231428-11 ,,-----231428-12 Figure 7a. Handshake Mechanisms for Handling Immediate Command IN Flowchart Figure 7b. Handshake Mechanisms for Handling Immediate Command OUT Flowchart 6-742 UPI-452 HOST & SLAVE INTERFACE SPECIAL FUNCTION REGISTERS Slave Interface Special Function Registers The Internal CPU interfaces with the FIFO slave module via the following registers: 1) Mode Special Function Register (MODE) 2) Slave Control Special Function Register (SLCON) 3) Slave Status Special Function Register (SSTAT) Each register resides in the SFR Array and is accessible via all direct addressing modes except bit. 1) MODE Special Function Register (MODE) The MODE SFR provides the primary control of the external host-FIFO interface. It is included in the SFR Array so that the internal CPU can configure the external host-FIFO interface should the user decide that the UPI-452 slave initialize itself independent of the external host CPU. The MODE SFR can be directly modified by the internal CPU through direct address instructions. It can also be indirectly modified by the external host CPU by setting up a MODE SFR service routine in the UPI-452 program memory and having the host issue a Command, either Immediate or DSC, to vector to that routine. Symbolic Physical Address Address MODE MD6 MD5 MD4 OF9H (MSB) Status On Reset: 1* o (LSB) o MD7 (reserved)" MD6 Request for Serivce to external CPU via; o 1* 1* 1* 1* 1 = DMA (DRQIN/DRQOUT) request to external host when the Input or Output FIFO channel requests service . o = Interrupt (INTRQIN/INTRQOUT or INTRQ) to external host when the Input or Output FIFO channel requests service or a DSC is encountered in the I/O Buffer Latch MD5 Configure DRQINIINTRQIN and DRQOUT IINTRQOUT to be either; 1 = Actively driven in both directions Open drain (tri-state) Configure INTRQ to be either; o= MD4 Actively driven in both directions Open drain (tri-state) (reserved) •• 1 = o= MD3 MD2 (reserved)" MD1 - (reserved) •• MOO (reserved)" 2) Slave Control SFR (SLCON) The Slave Control SFR is used to configure the FIFO-internal CPU interface. All interrupts are to the internal CPU. 6-743 UPI·452 Symbolic Address SLCON Physical Address IFI OFI ICII ICOI FRZ IFRS OFRS 0 IFI 0 OE8H (LSB) (MSB) Status On Reset: 0 0 0 l' 0 I 0 Enable Input FIFO Interrupt (due to Underrun Error Condition, Data Stream Command or Request Service) 1 = Enable 0= Disable OFI Enable Output FIFO Interrupt (due to Overrun Error Condition or Requet Service) 1 = Enable 0= Disable Note: If the DMA is configured to serivce a FIFO demand, then the Request for Service Interrupt is not generated. ICII Generate Interrupt when a command is written to the Immediate Command in Register 1 = Enable 0= Disable ICOI Generate Interrupt when Immediate Command Out Register is Available 1 = Enable o= FRZ Disable Enable Freeze Mode SC2 1 = Normal operation Freeze Mode (reserved) •• IFRS Type of Input FIFO Channel Request for Service o= 1 = Request when Input FIFO not empty o= OFRS Request when Input FIFO full Type of Output FIFO Channel Request for Service 1 = Request when Output FIFO not full o= Channel Request when Output FIFO empty 3) Slave Status SFR (SSTAT) The bits in the Slave Status SFR reflect the status of the FIFO-internal CPU interface. It can be read during an internal interrupt service routine to determine the nature of the interrupt or read during a polling sequence to determine a course of action. Symbolic Address Physical Address SSTAT OE9H o o o (MSB) (LSB) 6-744 inter SST7 UPI·452 Output FIFO Overrun Error Condition 1 = No Error o= SST6 1 = o= SST5 Error (latched until Slave Status SFR is read) Immediate Command Out Register Status Full (Le. Host CPU has not read previous Immediate Command Out sent by internal CPU) Available Freeze Mode Status 1 = Normal Operation Freeze Mode in Progress o= SST4 Output FIFO Request for Service Flag 1 = Output FIFO does not request service o= SST3 1 = o= SST2 No Underrun Error Underrun Error (latched until Slave Status SFR is read) Immediate Command In SFR Status 1 = o= SST1 Output FIFO requests service Input FIFO Underrun Error Condition Flag Empty Immediate Command received from host CPU Data Stream Command/Data at Input FIFO Flag 1 = Data (not DSC) o= DSC (at COMMAND IN SFR) (Note: Only if SSTO = 0, if SSTO = 1 then undetermined) SSTO Input FIFO Request For Service Flag 1 = o= Input FIFO Does Not Request Service Input FIFO Request for Service NOTES: • A '1' will be read from a. SFR reserved location. "'reserved'-these locations are reserved for future use by Intel Corporation. EXTERNAL HOST INTERFACE SPECIAL FUNCTION REGISTERS The external host CPU has direct access to the following SFRs: 1) Host Control Special Function Register 2) Host Status Special Function Register It can also access other SFRs by commanding the internal CPU to change them accordingly via Data Stream Commands or Immediate Commands. The protocol for implementing this is entirely determined by the user. 1) Host Control SFR (HCON) By writing to the Host Control SFR, the host can enable or disable FIFO interrupts and DMA requests and can reset the UPI-452. 6-745 inter ~@W~OO©[§ OOO~@OOIMl~jjO@OO UPI·452 Symbolic Address HCON Physical Address HC7 HC6 HCS HC4 HC3 HC1 (MSB) Status On Reset: 0 HC7 HC6 HCS HC4 HC3 HC2 HC1 HCO 0 OE7H (LSB) 0 0 0 1" 0 . 1* I Enable Output FIFO Interrupt due to Underrun Error Condition, Data Stream Command or Service Request 1 = Enable 0= Disable Enable Input FIFO Interrupt due to Overrun Error Condition, or Service Request 1 = Enable 0= Disable Enable the generation of the Interrupt due to Immediate Command Out being present 1 = Enable 0= Disable Enable the Interrupt due to the Immediate Command in Register being Available for a new Immediate Command byte 1 =·Enable 0= Disable Reset UPI-4S2 1 = Software RESET o = Normal Operation (reserved)"" Select between INTRQ and INTRQIN/INTRQOUT as Request for Service interrupt signal when DMA is disabled 1 = INTRQ o = INTRQIN or INTRQOUT (reserved)'" 2) Host Status SFR (HSTAT) The Host Status SFR provides information on the FIFO-Host Interface and can be used to. determine the source of an external interrupt during polling. Like the Slave Status SFR, the Host Status SFR reflects the current status of the FIFO-external host interface. Symbolic Physical Address Address HSTAT OE6H -- Output FIFO Status -+ Status On Reset: o (MSB) 0/1* (LSB) 6-746 UPI-452 HST7 HST6 HST5 HST4 HST3 HST2 HST1 Output FIFO Underrun Error Condition 1 = No Underrun Error o = Underrun Error (latched until Host Status Register is read) Immediate Command Out SFR Status 1 = Empty o = Immediate Command Present Data Stream Command/Data at Output FIFO Status 1 = Data (not DSC) o = DSC (present at Output FIFO COMMAND OUT SFR) (Note: Only if HST4 = 0, if HST4 = 1 then undetermined) Output FIFO Request for Service Statue 1 = No Request for Service o = Output FIFO Request for Service due to; a. Output FIFO containing the threshold number of bytes or more b. Internal CPU sending a block of data terminated by a DSC (DSC alone clears upon being read) InPut FIFO Overrun Error Condition 1 = No Overrun Error o = Overrun Error (latched until Host Status Register is read) Immediate Command In SFR Status 1 = Full (Le. Internal CPU has not read previous Immediate Command sent by Host) 0= Empty Reset value; '0' - if read by the external Host '1' - if read by internal CPU (reads shadow latch - see Freeze Mode description) Freeze Mode Status 1 = Freeze mode in progress. (In freeze mode, the bits of the Host Status SFR are forced to a '1' initially to prevent the external Host from attempting to access the FIFO. The definition of the Host Status SFR bits during freeze mode can be found in Freeze Mode description) o= Normal Operation HSTO Input FIFO Request Service Status 1 = Input FIFO does not request service o = Input FIFO request service due to the Input FIFO containing enough space for the host to write the threshold number of bytes or more Note: • A '1' will be read from a SFR reserved location • "reserved' - these locations are reserved for future use by Intel Corportion FIFO MODULE - EXTERNAL HOST INTERFACE Overview The FIFO-external host interface supports asynchronous bi-directional 8-bit data transfers for a Host operating up to 10 MHz. The host interface is fully compatible with Intel microprocessor local busses and with MULTIBUS. The FIFO has two specialized DMA request pins for Input and Output FIFO channel DMA requests. These are multiplexed to provide a dedicated Request for Service interrupt (DRQIN/INTRQIN, DRQOUT /INTRQOUT). The external Host can program, under user defined protocol, thresholds into the FIFO Input and Output Threshold SFRs which determine when the FIFO Request for Service interrupt is generated. The FIFO module external Host interface is configured by the internal CPU via the MODE SFR. The external Host can enable and disable the interfacing pins (INTRQ, DRQINIINTRQIN and DRQOUT /INTRQOUT) via the Host Control SFR. Data Stream Commands in the Input FIFO channel allow the Host to influence the processing of data blocks and are sent with the data flow to maintain synchronization. Data Stream Commands in the Output FIFO Channel allow the internal CPU to perform the same function, and also to set the Output FIFO Request Service status logic to the host CPU regardless of the programmed value in the Threshold SFR. Slave Interface Address Decoding The UPI-452 determines the desired Host function through address decoding. The lower three bits of the address as well as the Read, Write, Chip Select and DMA Acknowledge are used for decoding. Table 3 shows the pin states and the Read or Write operations associated with each configuration. 6-747 inter UPI-4S2 Table 3. UPI·452 Address Decoding DACK CS A2 A1 AO 1 1 1 0 X X X 0 0 0 1 0 0 0 1 0 0 1 0 1 1 0 Read Write No Operation Data or DMA from Output FIFO Channel No Operation Data or DMA to Input FIFO Channel 1 Data Stream Command from Output FIFO Channel Data Stream Command to Input FIFO Channel 1 0 Host Status SFR Read Reserved 0 1 1 Host Control SFR Read Host Control SFR Write 0 1 0 0 Immediate Command SFR Read Immediate Command to SFRWrite 0 X 1 1 X X X X Reserved DMA Data from Output FIFO Channel Reserved DMA Data to Input FIFO Channel NOTES: 1. Attempting to read a DSC as a data byte will result in invalid data being read. The read pointers are not incremented so that the DSC is not lost. Attempting to read a data byte as a DSC has the same result. 2. If DACKI is active the UPI-452 will attempt a DMA operation when RDI orWRI becomes active regardless of the DMA enable bit (MD6) in the MODE SFR. Care should be taken when using DACK/. For proper operation, DACKI must be driven high (+ 5V) when not using DMA. Interrupts to the Host b. Output FIFO error condition interrupts are generated when the Output FIFO is underrun. TheUPI-452 interrupts the external Host via the INTRQ pin. In addition, the DRQIN and DRQOUT pins can be multiplexed as interrupt request lines, INTRQIN and INTRQOUT respectively, when DMA is disabled. This provides two special FIFO "Request for Service" interrupts. c. There are also interrupts due to the presence of a Data Stream Command in the output FIFO. There are six FIFO-related interrupt sources; two From The Input FIFO; three From The Output FIFO; and one from the Immediate Command Out SFR. INPUT FIFO: The Input FIFO interrupt is generated whenever: a. The Input FIFO contains space for a threshold number of bytes. b. When an Input FIFO overrun error condition exists. The appropriate bits in the Host status SFR are set and the interrupt is generated only if enabled. OUTPUT FIFO: The Output FIFO Request forService Interrupt operates in the same manner as the Input FIFO interrupt: a. When the FIFO contains the threshold number of bytes or more. A Data Stream Command interrupt is used to halt normal processing, using the command as a vector to a service routine. When DMA is disabled, the user may program (through HC1) INTRQ to include FIFO Request for Service Interrupts or use INTRQIN and INTRQOUT as Request for Service Interrupts. IMMEDIATE COMMAND OUT SFR: a. An Immediate Command Out Interrupt is generated when the internal CPU writes to the Immediate Command Out SFR. It allows the internal CPU to bypass the FIFO when communicating with the external Host. b. An Immediate Command Interrupt is generated when the Immediate Command SFR is empty. FREEZE MODE: When the internal CPU invokes FIFO Freeze Mode, for example at reset or to reconfigure the FIFO interface, INTRQ is activated. The INTRQ can only be deactivated by the external Host reading the Host Status SFR (HST1 remains active until Freeze Mode is disabled by the internal CPU). 6-748 intJ UPI-4S2 Once an interrupt is generated, INTRO will remain high until no interrupt generating condition exists. For a FIFO underrun/ overrun error interrupt, the interrupt condition is deactivated by the external Host reading the Host Status SFR. An interrupt is serviced by reading the Host Status SFR to determine the source of the interrupt and vectoring the appropriate service routine. DMA Requests to the Host The UPI-452 generates two DMA requests, DROIN and DROOUT, to facilitate data transfer between the Host and the Input and Output FIFO channels. A DMA acknowledge, DACK, is used as a Chip select and initiates a data transfer. The external READ and WRITE signals select the Input and Output FIFO respectively. The CS and address lines can also be used as a DMA acknowledge for processors with onboard DMA controllers which do not generate a DACK signal. The internal CPU can configure the UPI-452 to request service from the external host via DMA or interrupts by programming Mode SFR MD6 bit. In addition the external Host enabled DMA requests through bits 6 and 7 of the Host Control SFR. When a DMA request is invoked the number of bytes transferred to the Input FIFO is the total number of bytes in the Input FIFO (as determined by the CBP SFR) minus the value programmed in the Input FIFO Threshold SFR. The DMA request line is activated only when the Input FIFO has a threshold number of bytes that can be transferred. The Output FIFO DMA request is activated when a DSC is written by the internal CPU at the end of a block of data (Flush Mode) or when the Output FIFO threshold is reached. The request remains active until the Input FIFO becomes full or the Output FIFO becomes empty. If a DSC is encountered the DMA request is dropped until the DSC is read. The DMA request will be reactivated after the DSC is read and remains active until the Output FIFO becomes empty or another DSC is encountered. When a block of data is being transferred via DMA and if a DSC is encountered, the Output FIFO DMA request will be automatically deactivated prior to a DSC being read out of the FIFO. IN/COMMAND IN and FIFO OUT/COMMAND OUT Special Function Registers. All of the 80C51 instructions involving direct addressing may be used to access the FIFO's SFRs. The FIFO IN, COMMAND IN and Immediate Command In SFRs are actually read only registers, and their Output counterparts are write only. Internal DMA transfers data between Internal memory, External Memory and the Special Function Registers. The Special Function Registers appear as another group of dedicated memory addresses and are programmed as the source or destination via the DMAO/DMA 1 Source Address or Destination Address Special Function Registers. The FIFO module manages the transfer of data between the external host and FIFO SFRs. Internal CPU Access to FIFO Via Software Instructions The internal CPU has access to the Input and Output FIFOs via the FIFO IN/COMMAND IN and FIFO OUT/COMMAND OUT SFRs which reside in the Special Function Register Array. At the end of every instruction that involves a read of the FIFO IN/COMMAND IN SFR, the SFR is written over by a new byte from the Input FIFO channel when available. At the end of every instruction that involves a write to the FIFO OUT/COMMAND OUT SFR, the new byte is written into the Output FIFO channel and the write pointer is incremented after the write operation (post incremented). The internal CPU reads the Input FIFO by using the FIFO IN/COMMAND IN SFR as the source register in an instruction. Those instructions which read the Input FIFO are listed below: ADD A,FIFO IN/COMMAND IN ADDC A,FIFO IN/COMMAND IN PUSH FIFO IN/COMMAND IN ANL A,FIFO IN/COMMAND IN ORL A,FIFO IN/COMMAND IN XRL A,FIFO IN/COMMAND IN CJNE A,FIFO IN/COMMAND IN, rei SUBB A,FIFO IN/COMMAND IN MOV direct,FIFO IN/COMMAND IN MOV @Ri,FIFO IN/COMMAND IN MOV Rn,FIFO IN/COMMAND IN MOV A,FIFO IN/COMMAND IN FIFO MODULE - INTERNAL CPU INTERFACE Overview The Input and Output FIFOs are accessed by the internal CPU through direct addressing of the FIFO 6-749 UPI-452 After each access to these registers, they are over· written by a new byte from the FIFO. NOTE: Instructions which use the FIFO IN or COMMAND IN SFR as both a source and destination register will have the data destroyed as the next data byte is rewritten into the FIFO IN register at the end of the instruction. These instructions are not support· ed by the UPI·452 FIFO. Data can only be read through the FIFO IN SFR and DSCs through the COMMAND IN SFR. Data read through the COM· MAND IN SFR will be read as OFFH, and DSDs read through the FIFO IN SFR will be read as OFFH. The Immediate Command in SFR is read with the same instructions as the FIFO IN and COMMAND IN SFRs. The FIFO IN, COMMAND IN and Immediate Com· mand In SFRs are read only registers. Any write op· eration performed on these registers will be ignored and the FIFO pointers will remain intact. The internal CPU uses the FIFO OUT SFR to write to the Output FIFO and any instruction which uses the FIFO OUT or COMMAND OUT SFR as a desti· nation will invoke a FIFO write. DSCs are differenti· ated from data by writing to the COMMAND OUT SFR. In the FIFO, Data Stream Commands have the ninth bit associated with the command byte set to "1". The instructions used to write to the Output FIFO are listed below: MOV MOV MOV POP MOV MOV FIFO FIFO FIFO FIFO FIFO FIFO NOTE: Instructions which use the FIFO OUTICOMMAND OUT SFRs as both a source and destination regis· ter cause invalid data to be written into the Output FIFO. These instructions are not supported by the UPI·452 FIFO. GENERAL PURPOSE DMA CHANNELS Overview There are two identical General Purpose DMA Chan· nels on the UPI·452 which allow high speed data transfer from one writeable memory space to anoth· er. As many as .64K bytes can be transferred in a single DMA operation. The following memory spaces can be used with DMA channels: • Internal Data Memory • External Data Memory • Special Function Registers The Special Function Register array appears as a limited group of dedicated memory addresses. The Special Function Registers may be used in DMA transfer operations by specifying the SFR as the source of destination address. The Special Function Registers which may be used in DMA transfers are listed in Table 4. Table 4 also shows whether the . SFR may be used as Source or Destination only, or both. OUTICOMMOUT, A OUT/COMMOUT, direct OUT/COMMOUT, Rn OUTICOMMOUT OUTICOMMOUT, #data OUT/COMMOUNT, @Ri Table 4. DMA Accessible Special Function Registers , SFR Symbol Address Accumulator B Register FIFO IN COMMAND IN FIFO OUT COMMAND OUT Serial Data Buffer Port 0 Port 1 Port 2 Port 3 Port 4 AlACC B FIN CIN FOUT COUT SBUF PO P1 P2 P3 P4 OEOH OFOH OEEH OEFH OFEH OFFH 099H 080H 090H OAOH OBOH OCOH Source Only Destination Only Either Y Y Y Y Y Y Y Y Y Y Y Y 6·750 inter UPI-4S2 DIFRS - Input FIFO Request Service The FIFO can be accessed during DMA by using the FIFO IN SFR as the DMA Source Address Register (SAR) or the FIFO OUT SFR as the Destination Address Register (DAR). (Note: Since the FIFO IN SFR is a read only register, the DMA transfer will be ignored if it is used as a DMA DAR. This is also true if the FIFO OUT SFR is used as a DMA SAR.) DOFRS - Output FIFO Request Service (DIFRS differs from bit 0 of the Slave Status SFR (SSTO - Input FIFO Request Service flag) in that it is deactivated when a DSC is to be read from the Input FIFO.) Each DMA channel is software programmable to operate in either Block Mode or Demand Mode. In the Block Mode, DMA transfers can be further programmed to take place in Burst Mode or Alternate Cycle mode. In Burst Mode, the processor halts its execution and dedicates its resources to the DMA transfer. In Alternate Cycle Mode, DMA cycles and instruction cycles occur alternately. Architecture There are three 16 bit and one 8 bit Special Function Registers associated with each DMA channel. • The 16 bit Source Address SFR (SAR) points to the source byte. • The 16 bit Destination Address SFR (DAR) points to the destination. In Demand Mode, a DMA transfer occurs only when it is demanded. Demands can be accepted from an external device (through External Interrupt pins, EXTO/EXT1) or from either the Serial Channel or FIFO flags. In this way, a DMA transfer can be synchronized to an external device, the FIFO or the Serial Port. If the External Interrupt is configured in Edge Mode, a single byte transfer occurs per transition. The external interrupt itself will occur if enabled. If the External Interrupt is configured in Level Mode, DMA transfers continue until the External Interrupt request goes inactive or the byte count becomes zero. The following flags activate Demand Mode transfers of one byte to/from the FIFO or Serial Channel: RI - Serial Channel Receiver Buffer Full TI - Serial Channel Transmitter Buffer Empty • The 16 bit Syte Count SFR (SCR) contains the number of bytes to be transferred and is decremented when a byte transfer is accomplished. • The DMA Control SFR (DCON) is eight bits wide and specifies the source memory space, destination memory space and the mode of operation. In Auto Increment mode, the Source Address and/ or Destination Address is incremented when a byte is transferred. When a DMA transfer is complete (SCR = 0), the DONE bit is set and a maskable interrupt is generated. The GO bit must be set to start any DMA transfer (also, the Slave Control SFR FRZ bit must be set to disable Freeze Mode). The two DMA channels are designated as DMAO and DMA 1, and their corresponding registers are suffixed by 0 or 1; e.g. SARO, DAR1, etc. To transfer 64K bytes of data the SCR should be programmed to zero. DMA Special Function Registers DMA Control SFR: DCONO, DCON1 Symbolic Address Physical Address DCONO 092H DCON1 093H Reset Status: DCONO and DCON1 = OOH infef UPI-452 Bit Definition: DONE DAS IDA 0 0 1 1 0 1 0 1 '. Destination Address Space External Data Memory without Auto-Increment External Data Memory with Auto-Increment Special Function Register Internal Data Memory SAS ISA 0 0 1 1 0 1 0 1 Source Address Space External Data Memory without Auto-Increment External Data Memorywith Auto-Increment Special Function Register Internal Data Memory OM TM 0 0 1 1 0 1 0 1 DMA Transfer Mode Alternate-Cycle Transfer Mode Burst Transfer Mode FIFO or Serial Channel Demand Mode External Demand Mode DMA transfer Flag: o tinues until BCR decrements to zero (zero byte count), then an interrupt is generated (if enabled). No interrupts are recognized during a DMA operation once started. DMA transfer is not completed. DMA transfer is complete. NOTE: This flag is set when contents of the Byte Count SFR decrements to zero. It is reset automatically when the DMA vectors to its interrupt routine. GO Enable DMA Transfer: o Disable DMA transfer (in all modes). 1 Enable DMA transfer. If the DMA is in the Block mode, start DMA transfer if possible. If it is in the Demand mode, enable the channel and wait for a demand. NOTE: The GO bit is reset when the BCR decrements to zero. DMA Transfer Modes The following five modes of DMA operation are possible in the UPI-452. BURST MODE In BURST mode the DMA is initiated by setting the GO bit in the DCON SFR. The DMA operation con- INPUT CHANNEL:The FIFO Input Channel can be used in burst mode by specifying the FIFO IN SFR as the DMA Source Address. DMA transfers begin when the GO Bit in the DMA Control SFR is set. The number of bytes to be transferred must be specified in the Byte Count SFR (BCR) and auto-incrementing of the SAR must be disabled. Once the GO bit is set nothing can interrupt the transfer of data until the BCR is zero. In this mode, a Data Stream Command encountered in the FIFO will be held in the COMMAND IN SFR with the pointers frozen, and invalid data (FFH) will be read through the FIFO IN SFR. If the Input FIFO becomes empty during the block transfer, an OFFH will be read until BCR decrements to zero. OUTPUT CHANNEL:The Output FIFO Channel can be used in burst mode by specifying the FIFO OUT or COMMAND OUT SFR as the DMA Destination Address. DMA transfers begin when the GO bit is set. This mode can be used to send a block of data or a block of Data Stream Commands. If the FIFO becomes full during the block transfer, the remaining data will be lost. (Note: All interrupts including FIFO interrupts are not recognized in Burst Mode. Burst Mode transfers should be used to service the FIFO only when the user is certain that no Data Stream Commands are in the block to be transferred (Input FIFO) and that 6-752 UPI-4S2 the FIFO contains enough space to store the block to be transferred. In all other cases Alternate Cycle or Demand Mode should be used.) 2. ALTERNATE CYCLE MODE Alternate cycle mode is useful when CPU processing must occur during the DMA transfers. In this mode, a DMA cycle and an instruction cycle occur alternately. The interrupt request is generated (if enabled) at the end of the process, i.e. when BCR decrements to zero. The transfer is initiated by setting the GO bit in the DCON SFR. 3. EXTERNAL DEMAND MODE The DMA can be initiated by an external device via External Interrupt 0 and 1 (INTO/EINT1) pins. The INTO pin demands DMAO (Channel 0) and INT1 demands DMA 1 (Channel 1). If the interrupts are configured in edge mode, a single byte transfer is accomplished for every request. Interrupts also result (INTO or INT1) after every byte transfer (if enabled). If the interrupts are configured in level mode, the DMA transfer continues until the request goes inactive or BCR= O. In either case, a DMA interrupt is generated (if enabled) when BCR = O. The GO bit must be set for the transfer to begin. 4. FIFO DEMAND AND ALTERNATE CYCLE DEMAND MODES Although any DMA mode is possible using the FIFO buffer, only Demand and Alternate Cycle Demand Modes make sense. Demand Mode DMA transfers using the Input FIFO Channel are set-up by setting the GO Bit and specifying the FIFO IN register as the DMA Source Address Register. The BCR should be set to the maximum number of expected transfers. The user must also program bit 1 of the Slave Control Register (SC1) to determine whether the FIFO Request For Service Flag will be set when the FIFO becomes not empty or full. Once the Request For Service Flag is set by the FIFO, the DMA transfer begins, and continues until the request flag is deactivated. While the request is active, nothing can interrupt the DMA (i.e. it behaves like burst mode). The DMA Request is held active until one of the following occurs: 1) The FIFO becomes empty 2) A Data Stream Command is encountered (this generates a FIFO interrupt and DMA operation resumes after the Data Stream command is read.) 3) BCR = 0 (this generates a DMA interrupt and sets the DONE Bit) DMA Destination Address SFR and a transfer is started by setting the GO bit. The user programs bit o of the Slave Control SFR (SCO) to determine whether a demand occurs when the Output FIFO is not full or empty. DMA transfers begin when the Request For Service Flag is set by the FIFO logic and continue as long as the flag is set. The Flag remains set until one of the following occurs: 1) The FIFO becomes full 2) BCR = 0 (this generates a DMA interrupt and sets the DONE bit) Alternate cycle demand mode is also useful for FIFO transfers of a less urgent nature. As mentioned before, CPU instruction cycles are interleaved with DMA transfer cycles, allowing true parallel processing. This mode differs from FIFO Demand Mode in that CPU instruction cycles must be interleaved with DMA transfers, even if the FIFO is demanding DMA. In FIFO Demand Mode, CPU cycles would never occur if the FIFO demand was present. In either mode, the FIFO logic resets the interrupt flag after transferring the byte, so the interrupt is never generated. 5. SERIAL PORT DEMAND MODE Demand mode is the logical choice when using the Serial Port. The DMA's can be activated by one of the Serial Channel Flags, Receiver Interrupt (RI) or Transmitter Interrupt (TI). After the GO bit is set, the DMA is activated if one of the following conditions takes place; SARO DARO SARO DARO = = = = SBUF and RI flag is set SBUF and TI flag is set FIFO In and IFRS flag is set FIFO OUT and OFRS flag is set NOTE: TI flag must be set by software to initiate the first transfer. When the DMA transfer begins, only one byte is transferred at a time. The serial port hardware automatically resets the flag after completion of the transfer, so an interrupt will not be generated. The DMA interrupt (if enabled) is not generated until BCR=O. DMA transfers to the Output FIFO Channel are similar. The FIFO OUT or COMMAND OUT SFR is the 6-753 UPI-4S2 The balance of the PCON SFR bits are described in the "80C51 Register Description:Power. Control SFR" section below. EXTERNAL MEMORY DMA: When transferring data to or from external memory via DMA, the HOLD (HLD) and HOLD-ACKNOWLEDGE (HLDA) signals are used for handshaking. The HOLD and HOLD-ACKNOWLEDGE are active low signals which arbitrate control of the local bus. The UPI-452 can be used in a system where multimasters are connected to a single parallel Address/ Data bus. The HLD/HLDA signals are used to share resources (memory, peripherals, etc.) among all the processors On the local bus. The UPI-452 can be configured in any of three different External Memory Modes controlled by bits 5 and 6 (REQ & ARB) in the PCON SFR (Table 5). Each mode is described below: Latency When the GO bit is set, the UPI-452 finishes the current instruction. before starting the DMA operation. Thus the maximum latency is 3.0 microseconds (at 16 MHz). DMA Interrupt Vectors Each DMA channel has a unique vectored interrupt associated with it. There are two vectored interrupts associated with the two DMA channels. The DMA interrupts are enabled and priorities set via the Interrupt Enable and Priority SFR (see "Interrupts" section). The interrupt priority scheme is similar to the scheme in 80C51. REQUESTER MODE: In this mode, the UPI-452 is not the bus master, but must request the bus from another device. The UPI-452 configures port pin PI.6 as a HLD output and pin PI.7 as a HLDA input. The UPI-452 issues a HLD signal when it needs external access for a DMA channel. It uses the local bus after re.ceiving the HLDA signal from the bus master,' and will not release the bus until its DMA operation is complete. ARBITER MODE: In this mode, the UPI-452 is the bus master. It configures port pin PI.6 as HLD input and pin PI.7 as HLDA output. When a device asserts the HLD signal to use the local bus, the UPI-452 asserts the HLDA signal after current instruction execution is complete. If the UPI-452 needs an external access via a DMA channel, it waits until the requester releases the bus, HLD goes inactive. When a DMA operation is complete (BCR decrements to zero), the DONE flag in the respective DCON (DCONO or DCON1) SFR is set. If the DMA interrupt is enabled, the DONE flag is reset automatically upon vectoring to the interrupt routine. , Interrupts When DMA is Active DISABLE (NON-DMA). MODE: When external program memory is accessed by an instruction or by program counter overflow beyond the internal ROM address, or when external data memory is assessed by MOVX instructions, the HLD/HLDA sequence is not initiated, since this is not a DMA memory access. If a Burst Mode DMA transfer is in progress, the interrupts are not serviced until the DMA transfer is complete. This is also true for level activated External Demand DMA transfers. During Alternate Cycle DMA transfers, however, the interrupts are serviced at the end of the DMA cycle. After that, DMA cycles and instruction execution cycles occur alternately. In the case of edge activated External Demand Mode DMA transfers, the interrupt is serviced at the end of DMA transfer of that single byte. Table 5. DMA MODE CONTROL - PC ON SFR Physical Address SymbOlic Address -* PCON ARB REQ -* -* (MSB) *Defined as per MLS-51 Data Sheet Reset Status: OOH -* -* -* (LSB) Definition: ARB REQ 0 0 1 1 0 1 0 1 HLD/HLDA logic is disabled. The UPI-452 is in the Requester Mode. The UPI-452 is in the Arbiter Mode. Invalid 6-754 87H inter UPI-452 (due to the priority of DMAO). Once DMA1 becomes active, the execution will follow the normal sequence. DMA Arbitration Only one of the two DMA channels is active at a time, except when both are configured in the Alternate Cycle mode. In this case, the DMA cycles and Instruction Execution cycles occur in the following order: 1. DMA Cycle O. If DMAO is already in the Alternate Cycle mode and DMA 1 is activated in Burst Mode, the DMA 1 Burst transfer will follow the DMAO Alternate Cycle transfer (after the completion of the next instruction). 2. Instruction execution. If the UPI-452 (as a Requester) asserts a HLD signal to request a DMA transfer (see "External Memory DMA")and its other DMA Channel requests a transfer before the HLDA signal is received, the channel· having higher priority is activated first. 3. DMA Cycle 1. 4. Instruction execution. DMAO has priority over DMA 1 during simultaneous activation of the two DMA channels. If one DMA channel is active, the other DMA channel, if activated, waits until the first one is complete. If, while executing a DMA transfer, the Arbiter receives a HLD signal, and then before it can acknowledge, its other DMA Channel requests a transfer, it then completes the second DMA transfer before sending the HLDA signal to release the bus to the HLD request. If DMAO is already in the Alternate Cycle mode and DMA 1 is activated in Alternate Cycle Mode, it will take two instruction cycles before DMA 1 is activated The DMA Transfer waveforms are in Figures 8-11. OSC nnJ1Jl.ArtiLrtil-nJi.Jl.iLrul-rul-nJi.nilsJUr \. ALE 1"\ PSEN PORT2 PORTO Rli -0( - S( URCE ADDR X A7-AO I\. iss ~ A1S-A DATA IN DES NATION ADD ESS A7- 0 X A15 A8 DATA OUT 1/ r \ VIR DMA CYCLE 231428-13 \ Figure 8. DMA Transfer from External Memory to External Memory 6-755 inter UPI-4S2 DMA CYCLE S2 Sl 53 S6 S5 54 CLOCK 'I Sl S2 53 ALE PSEN PORT 2 INST ADDR SOURCE ADDRESS A 15-A8 PORTO DATA IN RD TROLV 1--....-------J-+---l-----if 1-- TRHOX 1 - - - - - TRLRH - - - - - I 231428-14 Figure 9. DMA Transfer from External Memory to Internal Memory Sl S2 S3 S4 S5 S6 Sl S2 S3 CLOCK ALE PORT 2 INST ADDR DESTINATION ADDRESS PORTO A15-A8 DATA OUT I. TOVWX I---~_---+-TWLWH-+---·I- TWHQX DMA CYCLE - - - - - - - - - 1 231428-15 Figure 10. DMA Transfer from Internal Memory to External Memory 6-756 inter UPI-4S2 SI 52 -~ \. 53 54 55 56 52 51 53 CLOCK ALE \ \. f\PORT2 PORTO A15-A8 A15-A8 -< IN5T I A7-AO INSTRUCTION EXECUTION DMA CYCLE II-I--231428-16 Figure 11. DMA Transfer from Internal Memory to Internal Memory Table 6. Interrupt Priority Interrupt Source Priority Level (highest) o External Interrupt 0 1 Internal Timer/Counter 0 2 DMA Channel 0 Request External Interrupt 1 3 4 DMA Channel 1 Request 5 Internal Timer/Counter 1 FIFO - Slave Bus Interface Buffer 6 Serial Channel 7 (lowest) INTERRUPTS Overview The UPI-452 provides eight interrupt sources (Table 6). Their operation is the same as in the 80C51, with the addition of new interrupt sources for the UPI-452 FIFO and DMA features. These added interrupts have their enable and priority bits in the Interrupt Enable and Priority (IEP) SFR. The IEP SFR is in addition to the 80C51 Interrupt Enable (IE) and Interrupt Priority (IP) SFRs. The added interrupt sources are also globally enabled or disabled by the EA bit in the Interrupt Enable SFR. Table 6 lists the eight interrupt sources in order of priority. Table 7 lists the eight interrupt sources and their respective address vector location in program memory. (DMA interrupts are discussed in the "General Purpose DMA Channels" section. Additional interrupt information for Timer/Counter, Serial Channel, External Interrupt may be found in the Microcontroller Handbook for the 80C51.) Table 7. Interrupt Vector Addresses Interrupt Source Starting Address External Interrupt 0 3 (003H) 11 (OOBH) Internal Timer/Counter 0 External Interrupt 1 19 (013H) Internal Timer/Counter 1 27 (01 BH) Serial Channel 35 (023H) FIFO - Slave Bus Interface Buffer 43 (02BH) 51 (033H) DMA Channel 0 Request DMA Channel 1 Request 59 (03BH) FIFO Module Interrupts to Internal CPU The FIFO module generates interrupts to the internal CPU whenever the FIFO requests service or when a Data Stream Command is in the COMMAND IN SFR. The Input FIFO will request service whenever it becomes full or not empty depending on bit 1 of the Slave Control SFR (IFRS). Similarly, the Output FIFO requests service when it becomes empty or not full as determined by bit 0 of the Slave Control SFR (OFRS). Request for Service interrupts are generated only if enabled by the internal CPU and if DMA requests are disabled via the MODE SFR and the Interrupt Enable SFR. 6-757 infef UPI·452 A Data Stream Command Interrupt is generated whenever there is a Data Stream Command in the COMMAND IN SFR. The interrupt is generated to ensure that th internal interrupt is recognized before another instruction is executed. Interrupt, the main program instruction is not executed (to prevent misreading of invalid data). One instruction from the main program is executed between two consecutive interrupt service routines as in the 80C51. However, if the second interrupt service routine is due to a Data Stream Command Each of the three interrupt special function registers (IE, IP and IEP) is listed below with its corresponding bit definitions. Interrupt Enabling and Priority Interrupt Enable Register (IEC) Physical Address Symbolic Address EA IEC ES ET1 EX1 ETO EXO OA8H (LSB) (MSB) Position Function EA 1E.7 - 1E.6 1E.5 IE.4 1E.3 IE.2 IE.1 IE.O Enables all interrupts. If EA = 0, no interrupt will be acknowledged. If EA = 1, each interrupt source is individually enabled or disabled by setting or clearing its enable bit. (reserved) (reserved) Serial Channel interrupt enable Internal Timer/Counter 1 Overflow Interrupt External Interrupt Request 1. Internal Timer/Counter 0 Overflow Interrupt External Interrupt Request O. Symbol ES ET1 EX1 ETO EXO Interrupt Priority Register (I PC) A priority level of 0 or 1 may be assigned to each interrupt source, with 1 being higher priority level, through the IPC and the IEP (Interrupt Enable and Priority) SFR. A priority level of 1 interrupt can interrupt a priority level 0 service routine to allow nesting of interrupts. Symbolic Address Physical Address IPC PSC PT1 PX1 PTO PXO (LSB) (MSB) 6-758 OB8H inter Symbol UPI-452 Position Function IP.7 IP.6 IP.5 IP.4 IP.3 IP.2 IP.1 IP.O (reserved) (reserved) (reserved) Local Serial Channel Internal Timer/Counter 1 External Interrupt Request 1 Internal Timer/Counter 0 External Interrupt Request 0 Priority Within A Level (lowest) PSC PT1 PX1 PO PXO - 0.7 0.5 0.3 0.1 0.0 (highest) Interrupt Enable and Priority Register (lEP) The Interrupt Enable and Priority Register establishes the enabling and priority of those resources not covered in the Interrupt Enable and Interrupt Priority SFRs. Physical Address Symbolic Address I PFIFO I EDMAO I EDMA1 I PDMAO I PDMA1 I EFIFO I IEP (MSB) Symbol PFIFO EDMAO EDMA1 PDMAO PDMA1 EFIFO OFBH (LSB) Position Function IEP.7 IEP.6 IEP.5 IEP.4 IEP.3 IEP.2 IEP.1 IEP.O (reserved) (reserved) Slave Bus Interrupt Priority DMA Channel 0 Interrupt Enable DMA Channel 1 Interrupt Enable DMA Channel 0 PriorityDMA Channel 1 Priority Enable FIFO Buffer Interrupt Enable Priority Within a Level 0.6 0.2 0.4 disabled during Freeze Mode, and the internal CPU has write access to all of the FIFO control SFRs (Table 9). FIFO-EXTERNAL HOST INTERFACE FREEZE MODE Overview Initialization During Freeze Mode the internal CPU can reconfigure the FIFO interface. Freeze Mode is provided to prevent the host from accessing the FIFO during a reconfiguration sequence. The internal CPU invokes Freeze Mode by clearing bit 3 of the Slave Control SFR (SC3). INTRQ becomes active whenever Freeze Mode is invoked to indicate the freeze status. The interrupt can only be deactivated by the Host reading the Host Status SFR. During Freeze Mode only two operations are possible by the Host to the UPI-452 slave, the balance are disabled, as shown in Table B. The internal DMA At reset, the FIFO - Host interface is automatically frozen (SC3 = 0). The CBP SFR and the Output FIFO Read and Write Pointers are set to 40H. The Input FIFO Threshold SFR is set to BOH and the Output FIFO Threshold SFR is set to one. The Input FIFO Read and Write Pointer SFRs are set to zero. The Input and Output FIFO channels may be reconfigured by programming any of these Special Function Registers. Once the FIFO channel configuration sequence is complete, the internal CPU should set SC3 (CS3 = 1) to enable normal FIFO operation. 6-759 UPI·452 Table 8. Slave Bus Interface Status During Freeze Mode , Interface Pins; DACK CS 1 1 Operation In Normal Mode Status In Freeze Mode A2 A1 AO READ WRITE 0 0 1 0 0 1 Read Host Status SFR Operational 0 0 1 1 0 1 Read Host Control SFR Operational 1 0 0 1 1 1 0 Write Host Control SFR Disabled 1 0 0 0 0 0 1 Data or DMA Data from Output Channel Disabled 1 0 0 0 0 1 0 Data or DMA Data to Input Channel Disabled 1 0 0 0 1 0 1 Data Stream Command from Output Channel Disabled 1 0 0 0 1 1 0 Data Stream Command to Input Channel Disabled 1 0 1 0 0 0 1 Read Immediate Command Out from Output Channel Disabled 1 0 1 0 0 1 0 Write Immediate Command In to Input Channel Disabled 0 X X X X 0 1 DMA Data from Output Channel Disabled 0 X X X X 1 0 DMA Data to Input Channel Disabled Invoking Freeze Mode During Normal Operation When the UPI-452is in normal operation, Freeze Mode should not be arbitrarily invoked by clearing SC3 (SC3 = 0) because the external Host runs asynchronously to the internal CPU. Invoking Freeze Mode without first stopping the external Host from accessing the UPI-452 will not guarantee a clean break with the external Host. The proper way to invoke Freeze Mode is by issuing an Immediate Command to the external host indicating that Freeze Mode will be invoked. Upon receiving the Immediate Command, the external Host should complete servicing all pending interrupts and DMA requests, then send an Immediate Command back to the UPI-452 acknowledging the Freeze Mode request. After issuing the first Immediate Command, the internal CPU should not perform any action on the FIFO until Freeze Mode is invoked. If Freeze Mode is invoked without stopping the Host, only the last two bytes of data written into or read from the FIFO will be valid. The timing diagram for disabling the FIFO module to the external Host interface is illustrated in Figure 12. Due to this synchronization sequence, the UPI-452 might not go into Freeze Mode immediately after SC3 is cleared. A special bit in the Slave Status Register (SST5) is provided to indicate the status of the Freeze Mode. The Freeze Mode operations described in this section are only valid after SST5 is cleared. As Freeze Mode is invoked, the DRQIN or DRQOUT will be deactivated (stopping the transferring of data), bit 1 of the Host Status SFR will. be set (HST1 = 1), and SST5 will be cleared (SST5 = 0) to indicate to the external Host and internal CPU that the slave interface has been frozen. After the freeze becomes effective, any attempt by the external Host to access the FIFO will cause the overrun and underrun bits to be activated (bits HST7 (for reads) or HST3 (for writes)). These two bits, HST3 and HST7, will be set (deactivated) after the Host Status SFR has been read. External Host writing to the Immediate Command In SFR and the Host Control SFR is also inhibited when the slave bus interface is frozen. Writing to these two registers after Freeze Mode is invoked will also cause HST3 (overrun) to be activated (HST3 = 0). Similarly, reading the Immediate Command Out Register by the external Host is disabled during Freeze Mode, and any attempt to do so will cause the clearing (deactivating, "0") of HST7 bit (underrun). 6-760 UPI·452 DRQIN/..J DRQOUT RD?/WR? s ~ --, " 11 ra n n LJ LJ W W W ! .....-: ------55 II::~_! / 5-----, ~:~~~ll~ 1~~O'i[ET;~:~~f:g:~~~ ) HOST STATUS REGISTER READ HST 3 OR HST 7 TO BE SET S ~<----------------~~------~~~~--~~~----~-1 INTRQ ..1 ________ ______________ .J : -i ' SC3 HST1 FIFO INTERNALLY STOPPED FROM '-.....I~-----I ACCEPTING OR OUTPUTIING DATA -------, (~---------------------------------I - - - - - - - - - - I " nl ~-----------------------I 231428-17 Figure 12. Disabling FIFO to Host Slave Interface Timing Diagram After the slave bus interface is frozen, the internal CPU can perform the following operations on the FIFO Special Function Registers (these opeiations are allowed only during Freeze Mode). For FIFO Reconfiguration To Enhance the Testability 1. Changing the Channel Boundary Pointer SFR. 2. Changing the Input and Output Threshold SFR. Freeze Modes. The registers that require special treatment in Freeze Mode are: HCON, IWPR, IRPR, OWPR, ORPR, HSTST, SSTAT, IMMIN & IMMOUT SFRs. They can be described in detail as follows: Host Control SFR (HCON) During normal operation, this register is written to or read by the external Host. However, in Freeze Mode (i.e. SST5 = 0) the UPI·452 internal CPU has write access to the Host Control SFR and write opera· tions to this SFR by the external Host will not be accepted. If the Host attempts to write to HCON, the Input Channel error condition flag (HST3) will be set. 3. Writing to the read and write pointers of the Input and Output FIFO's. 4. Writing to and reading the Host Control SFRs. 5. Controlling some bits of Host and Slave Status SFRS. 6. Reading the Immediate Command Out SFR and Writing to the Immediate Comand In SFR. Input FIFO Pointer Registers (IRPR &. IWPR) Once the FIFO module is in Freeze Mode, error flags due to overrun and underrun of the Input FIFO point· ers will be disabled. Any attempt to create an overrun or underrun condition by changing the Input FIFO pointers would result in an inconsistency in performance between the status flag and the threshold counter. Description of each of these special functions are as follows: FIFO Module SFRs During Freeze Mode Table 9 summarizes the characteristics of all the FIFO Special Function Registers during normal and 6-761 To enhance the speed of the UPI-452, read operations on the Input FIFO will look ahead by two bytes. Hence, every time the IRPR is changed during Freeze Mode, two NOPs need to be executed so that the two byte pipeline can be updated with the new data bytes pointed to by the new IRPR. The infef UPI-4S2 . Table 9. FIFO SFR's Characteristics During Freeze Mode Label Normal Operation (SST5 = 1) Name Freeze Mode Operation (SST5 = 0) HCON Host Control Not Accessible Read & Write HSTAT Host Status Read Only Read & Write 4 SLCON Slave Control Read & Write Read & Write SSTAT Slave Status Read Only Read & Write 4 IEP Interrupt Enable & Priority Read & Write Read & Write MODE Mode Register Read & Write Read & Write IWPR Input FIFO Write Pointer Read Only Read & Write 5 IRPR Input FIFO Read Pointer Read Only Read & Write 1, 5 OWPR Output FIFO Write Pointer Read Only Read & Write 6 ORPR Output FIFO Read Pointer Read Only Read & Write 2, 6 CBP Channel Boundary Pointer Read Only Read & Write 3 IMIN Immediate Command In Read Only Read & Write IMOUT Immediate Command Out Read & Write Read & Write FIN FIFO IN Read Only Read Only CIN COMMAND IN Read Only Read Only FOUT FIFO OUT Read & Write Read & Write COUT COMMAND OUT Read & Write Read & Write ITHR Input FIFO Threshold Read Only Read & Write OTHR Output FIFO Threshold Read Only Read & Write NOTES: 1. Writing of IRPR will automatically cause the FIFO IN SFR to load the contents of the Input FIFO from that location. 2. Writing to ORPR will automatically cause the IOBL SFR to load the contents of the Output FIFO at that ORPR address. 3. Writing to the CBP SFR will cause automatic reset of the four pointers of the Input and Output FIFO channels. 4. The internal CPU cannot directly change the status of these registers. However, by changing the status of the FIFO channels, the internal CPU can indirectly change the contents of the status registers. 5. Changing the Input FIFO Read/Write Pointers also requires that a consistent update of the Input FIFO Threshold Counter SFR 6. Changing the Output FIFO Read/Write Pointers also requires that a consistent update of the Output FIFO Threshold Counter SFR. Threshold Counter SFR also needs to change by the same number of bytes as the IRPR (increase Threshold Counter if IRPR goes forward or decrease if IRPR goes backward). This will ensure that future interrupts will still be generated only after a threshold number of bytes are available. (See "Input and Output FIFO Threshold SFR" section below.) In Freeze Mode, the internal CPU can also change the content of IWPR, and each change of IWPR also requires an update of the Threshold Counter SFR. Normally, the internal CPU cannot write into the Input FIFO. It can, however, during Freeze Mode by first reconfiguring the FIFO as an Output FIFO (Refer to "Input and Output FIFO Threshold SFR" section below).Changing the IRPR to be equal to IWPR generates a full condition while changing IWPR to be equal to IRPR generates an empty condition. The order in which the pointers are written determines whether a full or empty condition is generated. 6-762 inter UPI-4S2 Output FIFO Pointer SFR (ORPR and OWPR) In Freeze Mode the contents of OWPR can be changed by the internal CPU, but each change of OWPR or ORPR requires the Threshold Counter SFR to be updated as described in the next section. A NOP must be executed whenever a new value is written into ORPR, as just described for changes to IRPR. As before, changing ORPR to be equal to OWPR will generate a full condition, Output FIFO overrun or underrun condition cannot be generated though. these relationships can be used to calculate the offset for the Threshold SFRs. It is best to change the Threshold SFRs only when the FIFO's are empty to avoid this complication. Host Status SFR (HSTAT) When in Freeze Mode, some bits in the Host Status SFR are forced high and will not reflect the new status until the system returns to normal operation. The definition of the register in Freeze Mode is as follows: NOTE: Input and Output FIFO Threshold SFR (ITHR & OTHR) The Input and Output FIFO Threshold SFRs are also programmable by the internal CPU during Freeze Mode. For proper operation of the Threshold feature, the Threshold SFR should be changed only when the Input and Output FIFO channels are empty, since they reflect the current number of bytes available to read/write before an interrupt is generated. Table 10 illustrates the Threshold SFRs range of values and the number of bytes to be transferred when the Request For Service Flag is activated: Table 10. Threshold SFRs Range of Values and Number of Bytes to be Transferred ITHR No. of Bytes No. of Byte~ OTHR (lower Available to (lower Available to be Read Fieven bits) be Written seven bits 0 1 2 • CBPR CBPR-1 CBPR-2 1 2 3 2 3 4 • • • • • • • • CBP-3 CBP-2 3 2 • • • (80H-CBP)-3 (80H-CBP)-2 (80H-CBP)-2 (80H-CBP)-1 (80H-CBP)-1 (80H-CBP) The eighth bit of the Input and Output FIFO Threshold SFR indicates the status of the service requests regardless of the freeze condition. If the eighth bit is a "1 ", the FIFO is requesting service from the external Host. In other words, when the Threshold SFR value goes below zero (2's complement), a service request is generated. Normally the ITHR SFR is incremented for each read operation by the Host and decremented for each write by the internal CPU. The OTHR SFR is decremented by internal CPU writes and incremented by external Host reads. Thus if the pointers are moved when the FIFO's are not empty, The internal CPU reads this shadow latch value when reading the Host Status SFR. The shadow latch will keep the information for these bits so normal operation can be resumed with the right status. The following bits are cleared (= 0) when Freeze Mode is invoked; HST7 Output FIFO Error Condition Flag 1 = No error. o = An invalid read has been done on the output FIFO or the Immediate Command Out Register by the host CPU. NOTE: The normal underrun error condition status is disabled. If an Immediate Command Out (IMOUT) SFR read is attempted during Freeze Mode, the ocntents of the IMOUT SFR is output on the Data Buffer and the error status is set (= 1). HST6 Immediate Command Out SFR Status During normal operation, this bit is cleared (=0) when the IMOUT SFR is written by the UPI-452 internal CPU and set (= 1) when the IMOUT SFR is read by the external Host. Once the host-slave interface is frozen (Le. SST5 = 0), this bit will be read as a 1 by the host CPU. A shadow latch will keep the information for this bit so normal operation can be resumed with the correct status. Shadow latch: 1 = Internal CPU reads the IMOUT SFR o = Internal CPU writes to the IMOUT SFR HST5 Data Stream Command at Output FIFO This bit is forced to a "1" during Freeze Mode to prevent the external host CPU from trying to read the OSC. Once normal operation is resumed, HST5 will reflect the Data/Command status of the current byte in the Output FIFO. Shadow Latch (read by the internal CPU): 1 = No Data Stream Command (OSC) o = Data Stream Command at Output FIFO 6-763 infef UPI-4S2 HST4 Output FIFO Service Request Status When Freeze Mode is invoked, this bit no longer reflects the Output FIFO Request Service Status. This bit wll be forced to a "1". HST3 Input FIFO Error Condition Flag 1 = No error. o ~ One of the following operations has been attempted by the external host and is invalid: 1) Write into the Input FIFO 2) Write into the Host Control SFR 3) Write into the Immediate Comamnd In SFR NOTE: The normal Input FIFO overrun condition is disabled. HST2 Immediate Command In SFR Status This bit is normally cleared when the internal CPU reads the IMIN SFR and set when the external host CPU writes into the IMIN SFR. When the host-slave interface is frozen, reading and writing of the IMIN will change the· shadow latch of this bit. This bit will be read as a "1" by the external Host. Shadow latch. 1 = Internal CPU writes into IMIN SFR o = Internal CPU reads the IMIN SFR HST1 Freeze Mode Status 1 = Freeze Mode. o = Normal Operation (non-Freeze Mode). NOTE: This bit is used to indicate to the external Host that the host-slave interface has been frozen and hence the external Host functions are now reduced as shown in Table 8. HSTO Input FIFO Request Service Satus When slave interface is frozen this bit no longer reflects the Input FIFO Request Service Status. This bit will be forced to a "1". Slave Status SFR (SSTAT) The Slave Status SFR is a read-only SFR. However, once the slave interface is frozen, most of the bits of this SFR can be changed by the internal CPU by reconfiguring the FIFO and accessing the FIFO Special Function Registers. SST7 Output FIFO Overrun Error Flag Inoperative in Freeze Mode. SST6 Immediate Command Out SFR Status In Freeze Mode, this bit will be cleared when the internal .CPU -reads the Immediate Command Out SFR and set when the internal CPU writes to- the Immediate Command Out Register. SST5 FIFO-External Interface Freeze Mode Status This bit indicates to the internal CPU that Freeze M6de is in progress and that it has write access to the FIFO Control, Host control and Immediate Command SFRs. SST4 Output FIFO Request Service Status During normal operation, this bit indicates to the internal CPU that the Output FIFO is ready for more data. The status of this bit reflects the position of the Output FIFO read and write pointers. Hence, in Freeze Mode, this flag can be changed by the internal CPU indirectly as the read and write pointers change. SST3 Input FIFO Underrun Flag Inoperative during Freez:e Mode. During normal operation, a read operation clears (= 0) this bit when there are no data bytes in the Input FIFO and deactivated (= 1) when the Slave Status SFR is read. In Freeze Mode, this bit will not be cleared by an Input FIFO read underrun error condition, nor will it be reset by the reading of the Slave Status SFR. SST2 Immediate Command In SFR Status This bit is normally activated (= 0) when the external host CPU writes into the Immediate Command In SFR and deactivated (= 1) when it is read by the internal CPU. In Freeze Mode, this bit will not be activated (= 0) by the external Host's writing of the Immediate Command IN SFR since this function is disabled. However, this bit will be cleared (= 0) if the internal CPU writes to the Immediate Command In SFR and it will be set = 1) if it reads from the register. SST1 Data Stream Command at Input FIFO Flag In Freeze Mode, this bit operates normally. It indicates whether the next byte of data from the Input FIFO is a DSC or data byte. If it is a DSC byte, reading from FIFO IN SFR will result in reading invalid data (FFH) and vice versa. In Freeze Mode, this bit still reflects the type of data byte available from the Input FIFO. 6-764 inter UPI-4S2 SSTO Input FIFO Service Request Flag During normal operation, this bit is activated (= 0) when the Input FIFO contains bytes that can be read by the internal CPU and deactivated (=1) when the Input FIFO does not need any service from the internal CPU. In Freeze Mode, the status of this bit should not change unless the pointers of the Input FIFO are changed. In this mode, the internal CPU can indirectly change this bit by changing the read and write pointers of the Input FIFO but cannot change it directly. Program Memory can be up to 64K by1es. The lower 8K of Program Memory may reside on-chip. The Data Memory consists of 256 by1es of on-chip RAM, up to 64K bytes of off-chip RAM and a number of "SFRs" (Special Function Registers) which appear as yet another set of unique memory addresses. The 80C51 Special Function Registers are listed in Table 11 a, and the additional UPI-452 SFRs are listed in Table 11 b. A brief description of the 80C51 core SFRs is also provided below. Accessing External Memory As in the 80C51 , accesses to external memory are of two types: Accesses to external Program Memory and accesses to external Data Memory. Immediate Command In/Out SFR . (IMMIN/IMMOUT) If Freeze Mode is in progress, writing to the Immediate Command In SFR by the external host will be disabled, and any such attempt will cause HST3 to be cleared (= 0). Similarly, the Immediate Command Out SFR read operation (by the host) will be disabled internally and read attempts will cause HST7 to be cleared (= 0). External Program Memory is accessed under two conditions: 1) Whenever signal EA is active; or 2) Whenever the program counter (PC) contains a number that is larger than 1FFFH. This requires that the ROM less versions have EA wired low to enable the lower 8K program by1es to be fetched from external memory. Internal CPU Read and Write of the FIFO During Freeze Mode In normal operation, the Input FIFO can only be read by the internal CPU and similarly, the Output FIFO can only be written by the internal CPU. During Freeze Mode, the internal CPU can read the entire contents of the Input FIFO by programming the CBP SFR to 7FH, setting the IRPR SFR to zero, and then the IWPR SFR to zero. Programming the pointer registers in this order generates a FIFO full signal to the FIFO logic and enables internal CPU read operations. If the IWPR and IRPR are already zero, the write pOinter should be changed to a non-zero value to clear the empty status then the pointers can be set to zero. External Data Memory is accessed using either the MOVX @DPTR (16 bit address) or the MOVX @Ri (8 bit address) instructions. In a similar manner, the internal CPU can write to all 128 by1es of the FIFO by setting the CBP SFR to zero, setting OWPR SFR to zero, and then setting ORPR SFR to zero. This generates a FIFO empty Signal and allows internal CPU write operations to all 128 by1es of the FIFO. The Threshold registers also need to be adjusted when the pointers are changed.(See "Input and Output FIFO Threshold SFR" section below.) MEMORY ORGANIZATION The UPI-452 has separate address spaces for Program Memory and Data Memory like the 80C51. The 6-765 Table 11a. 80C51 Special Function Registers; Symbol 'ACC 'B 'PSW SP DPTR 'PO 'P1 'P2 'P3 'IP OlE TMOD TCON THO TLO TH1 TL1 'SCON SBUF 'PCON Name Accumulator B Register Program Status Word Sfack Pointer Data Pointer (consisting of DPH and DPL) PortO Port 1 Port 2 Port 3 Interrupt Priority Control Interrupt Enable Control Timer/Counter Mode Control Timer/Counter 2 Control Timer/Counter 0 (high byte) Timer/Counter 0 (low byte) Timer/Counter 1 (high byte) Timer/Counter 1 (low byte) Serial Control Serial Data Buff Power Control Address OEOH OFOH ODOH 81H 82H 80H 90H OAOH OBOH OB8H OA8H 89H OC8H 8CH 8AH 8DH 8SH 98H 99H 87H infef UPI-452 Table 11b. UPI-452 Additional Special Function Registers ITHR OTHR *SLCON SSTAT *IEP MODE IWPR IRPR ORPR OWPRCBP IMMIN IMMOUT FIN CIN FOUT COUT *P4 HSTAT HCON DCONO DCON1 SARLO SARHO SARL1 SARH1 DARLO DARHO DARL1 DARH1 BCRLO BCRHO BCRL1 BCRH1 Input FIFO Threshold Output FIFO Threshold Slave Control Slave Status Interrupt Enable & Priority Mode Register Input Write Pointer Input Read Pointer Output Read Pointer Output Write Pointer Channel Boundary Pointer Immediate Command In Immediate Command Out FIFO IN COMMAND IN FIFO OUT COMMAND OUT Port 4 Host Status Host Control DMAO Control DMA 1 Control DMA Source Address low byte/ hi byte/ channel 0 low byte/ hi byte/ channel 1 DMA Destination Address low byte/ hi byte/ channel 0 low byte/ hi byte/ channel 1 DMA Byte Count low byte/ hi byte/ channel 0 low byte/ hi byte/ channel 1 B REGISTER The B SFR is used during multiply and divide operations. For other instructions it can be treated as another scratch pad regster. OF6H OF7H OE8H OE9H OF8H OF9H OEAH OEBH OFAH OFBH OECH OFCH OFDH OEEH OEFH OFEH OFFH OCOH OE6H OE7H 92H 93H PROGRAM STATUS WORD The PSW SFR contains program status information as detailed in Table 12. STACK POINTER The Stack Pointer register is 8 bits wide. It is incremented before data is stored during PUSH and CALL executions. While the sta:ck may reside any· where in on-chip RAM, the Stack Pointer is initialized to 07H after a reset. This causes the stack to begin at location 08H. DATA POINTER The Data Pointer (DPTR) consists of a high byte (DPH) and a low byte (DPL). Its intended function is to hold a 16-bit address. It may be manipulated as a 16-bit register or as two independent 8-bit registers. OA2H OA3H OB2H OB3H PORTS 0 TO 4 PO, P1, P2, P3 and P4 are the SFR latches of Ports 0, 1, 2, 3 and 4, respectively. OC2H OC3H OD2H OD3H SERIAL DATA BUFFER OE2H OE3H OF2H OF3H The SFRs marked with an asterisk (') are both bit· and byte· address· able. The functions of the SFRs are as follows: The Serial Data Buffer is actually two separate registers, a transmit buffer and a receive buffer register. When data is moved to SBUF, it goes to the transmit buffer where it is held for serial transmission. (Moving a byte to SBUF is what initiates the transmission.) When data is moved from SBUF, it comes from the receive buffer. TIMER/COUNTER SFR Miscellaneous Special Function Register Description Register pairs (THO, TLO), and (TH1, TL 1) are the 16-bit counting registers for Timer/Counters 0 and 2. 80C51 SFRs POWER CONTROL SFR (PCON) ACCUMULATOR ACC is the Accumuator SFR. The mnemonics for accumulator-specific instructions, however, refer to the accumulator simply as A. The PCON Register (Table 13) controls the power down and idle modes in the UPI-452, as well as providing the ability to double the Serial Channel baud rate. There are also two general purpose flag bits available to the user. Bits 5 and 6 are used to set the DMA mode (see "General Purpose 'DMA Channels" section), and bit 4 is not used. 6-766 infef UPI-4S2 Table 12. Program Status Word Physical Address Symbolic Address PSW CY AC FO RS1 RSO ODOH P OV (LSB) (MSB) Symbol Position CY AC Fa RS1 RSO OV PSW.7 PSW.6 PSW.5 PSW.4 PSW.3 PSW.2 PSW.1 PSW.O P Name Carry Flag Auxiliary Carry (For BCD operations) Flag a (user assignable) Register Bank Select bit l ' Register Bank Select bit 0' Overflow Flag (reserved) Parity Flag '(RS1, RSO) enable Internal RAM register banks as follows: RS1 RSO a a 1 1 a 1 a 1 Internal RAM Register Bank BankO Bank 1 Bank 2 Bank 4 Table 13. peON Special Function Register Symbolic Address Physical Address PCON SMOD ARB I GF1 REO GFO PD IDL Symbol Position Function SMOD PCON7 ARB REO GF1 GFO PD PCON6 PCON5 PCON4 peON3 PCON2 PCON1 IDL PCONO Double Baud rate bit. When set to a 1, the baud rate is doubled when the serial port is being used in either Mode 1, 2 or 3. DMA Arbiter control bit' DMA Requestor control bit' (reserved) General-purpose flag bit General-purpose flag bit Power Down bit. Setting this bit activates power down operation. Idle Mode bit. Setting this bit activates idle mode operation. - 087H (LSB) (MSB) ~ 'See "DMA Transfer Mode" deSCription. NOTE: If 1's are written to PO and IOL at the same time, PO takes precedence. The reset value of peON is (OOOXOOOO). 6-767 UPI-41ATM [p~~[bUIMlUOO~[fltl UNIVERSAL PERIPHERAL INTERFACE 8-BIT SLAVE MICROCONTROLLER Compatible With All • Fully Microprocessor Families II 8-Bit CPU plus ROM, RAM, I/O, Timer and Clock in a Single Package II One 8-Bit Status and Two Data Registers for Asynchronous Siave-to-Master Interface Interchangeable ROM and EPROM • Versions I/O • Expandable RAM Power-Down Capability • Over 90 Instructions: 70% Single Byte • Available in EXPRESS Interrupt, or Polled Operation • DMA, Supported • -Standard Temperature Range 1024 x 8 ROM/EPROM, 64 x 8 RAM, • 8-Bit Timer/Counter, 18 Programmable I/O Pins II • 3.6 MHz 8741A-8Available -Extended Temperature Range 8741A Available in 40-Lead Cerdip Package. 8041A in Both 40-Lead Plastic and 44-Lead Plastic Leaded Chip Carrier Packages. (See Packaging Specifications, Order #231369) The I ntel® UPI-41 A'· is a general purpose, programmable interface device designed for use with a variety of 8-bit microprocessor systems. It contains a low cost microcomputer with program memory, data memory, 8-bit CPU, I/O ports, timer/counter, and clock in a single 40-pin package. Interface registers are included to enable the UPI device to function as a peripheral controller in MCS-48'·, MCS-80'·, MCS-85'·, MCS-86'·, and .other 8-bit systems. The UPI-41A ™ has 1K words of program memory and 64 words of data memory on-chip. To allow full user flexibility the program memory is available as ROM in the 8041A version or as UV-erasable EPROM in the 8741A version. The 8741A and the 8041A are fully pin compatible for easy transition from prototype to production level designs. The device has two 8-bit, TTL compatible I/O ports and two test inputs. Individual port lines can function as either inputs or outputs under software control. I/O can be expanded with the 8243 device which is directly compatible and has 16 I/O lines. An 8-bit programmable timer/counter is included in the UPI device for generating timing sequences or counting external inputs. Additional UPI features include: single 5V supply, low power standby mode (in the 8041A), single-step mode for debug (in the 8741 A), and dual working register banks. Because it's a complete microcomputer, the UPI provides more flexibility for the designer than conventional LSI interface devices. It is designed to be an efficient controller as well as an arithmetic processor. Applications include keyboard scanning, printer control, display multiplexing and similar functions which involve interfacing peripheral devices to microprocessor systems. DIP PIN CONFIGURATION BLOCK DIAGRAM INlER,.U PlCC PIN CONFIGURATION 8 '"' r~'~ . ~M.DO'" _ A~CHS '---..7.'=~ ,., PORT 2 SYNC---- C5-- 7 EA,-S RD- 9 39 -Pl,"OBF 38-P" A,--- 10 36-_P" WR- 11 SYNC- 13 oo~- 14 Ol-~--= ~~ !!l:------_ PAO!l4--- 0,- 1IIm'·---_ 31 N C - - 12 17 8041A 11 -PI' ~~:: 30-P,o 29 --Voo 1 r"UAL1---EJ L nnTJ.l LC,O"-, ClOC~ T,",NII 1(l.&U---_ Intel Corporation Assumes No Responsibilty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses afe Implied. ©tNTEl CORPORATION. 1985 6-768 SEPT. 1985 231316-002 inter UPI-41ATM Table 1. Pin Description Signal Description Do-D7 (BUS) Three-state, bidirectional DATA BUS BUFFER lines used to interface the UPI-41 A to an 8-bit master system data bus. Signal P10- P17 8-bit, PORT 1 quasi-bidirectional 1/0 lines. P20- P27 8-bit, PORT 2 quasi-bidirectional 1/0 lines. The lower 4 bits (P20-P23) interface directly to the 8243 1/0 expander device and contain address and data information during PORT 4-7 access. The upper 4 bits (P24 -P27) can be programmed to provide Interrupt Request and DMA Handshake capability. Software control can configure P24 as OBF (Output Buffer Full), P25 as IBF (Input Buffer Fu~ as DRQ (DMA Request), and P27 as DACK (DMA ACKnowledge). WR 1/0 read input which enables the master CPU to read data and status words from the OUTPUT DATA BUS BUFFER or status register. CS Chip select input used to select one UPI-41 A out of several connected to a common data bus. Ao Address input used by the master processor to indicate whether byte transfer is data or command. During a write operation flag F1 is set to the status of the Ao input. TEST 0, TEST 1 Inputs for a crystal, LC or an external timing signal to determine the internal oscillator frequency. SYNC Output signal which occurs once per UPI41 A instruction cycle. SYNC can be used as a strobe for external circuitry; it is also used to synchronize single step operation. EA External access input which allows emulation, testing and PROMIROM verification. PROG Multifunction pin used as the program pulse input during PROM programming. During 1/0 expander access the PROG pin acts as an addressldata strobe to the 8243. RESET 1/0 write input which enables the master CPU to write data and command words to the UPI41 A INPUT DATA BUS BUFFER. RD Description XTAL1, XTAL2 Input used to reset status flip-flops and to set the program counter to zero. RESET is also used during PROM programming and verification. RESET should be held low for a minimum of8 instruction cycles after power-up. Input pins which can be directly tested using conditional branch instructions. SS Single step input used in the 8741A in conjunction with the SYNC output to step the program through each instruction. Vee +5V main power supply pin. VDD +5V during normal operation. +25V during programming operation. Low power standby pin in ROM version. VSS Circuit ground potential. T 1 also functions as the event timer input (under software control). TO is used during PROM programming and verification in the 8741 A. 6-769 231316-002 inter PROGRAMMING, VERIFYING, AND ERASING THE 8741A EPROM 6. Data applied to BUS 8. V DD = 25v (programm ing power) 9. PROG 10. V DD Programming Verification In brief, the programming process consists of: activating the program mode, applying an address, latch ing the addres~, applying data, and applying a programming pulse. Each word is programmed completely before moving on to the next and is followed by a verification step. The follow· ing is a list of the pins used for programming and a descrip· tion of their functions: Pin Function XTAL 1 Clock Input (1 to 6MHz) Reset Initialization and Address Latching Test 0 Selectlon of Program or Verify Mode EA Activation of ProgramlVerify Modes BUS Addre~s P20·1 Address Input VDD PROG Programming Power Supply and Data Input Data Output During Verify Program Pulse Input WARNING: An attempt to program a missocketed 8741 A will result in severe damage to the part. An indication of a properly socketed part is the appearance of the SYNC clock output. The lack of this clock may RESET = 5v (latch address) 7. 11. = Ov followed by one 50ms pulse to = 5v TEST 0 = 5v (verify mode) 23V 12. Read and verify data on BUS 13. TEST 0 = Ov 14. RESET 15. Programmer should be at conditions of step 1 when 8741A is removed from socket. = Ov and repeat from step 5 8741A Erasure Characteristics The erasure characteristics of the 8741A are such that erasure begins to occur when exposed to light with wavelengths shorter than approximately 4000 Ang· stroms (A). It should be noted that sunlight and certain types of fluorescent lamps have wavelengths in the 3000-4000A range. Data show that constant exposure to room level fluorescent lighting could erase the typical 8741A in approximately 3 years while it would take ap· proximately one week to cause erasure when exposed to direct sunlight. If the 8741A is to be exposed to these types of lighting conditions for extended periods of time, opaque labels are available from Intel which should be placed over the 8741A window to prevent unintentional erasure. be used to disable the programmer. The recommended erasure procedure for the 8741A is exposure to shortwave ultraviolet light which has a wavelength of 2537 A. The integrated dose (i.e., UV inten· sity x exposure time) for erasure should be a minimum of 15 w·sec/cm 2. The erasure time with this dosage is approximately 15 to 20 minutes using an ultraviolet lamp with a 12,000 "W/cm'2 power rating. The 8741A should be placed within one inch of the lamp tubes duro ing erasure. Some lamps have a filter on their tubes which should be removed before erasure. The Program/Verify sequence is: 1. CS = 5V, EA = 5V, RESET = OV, TESTO = 5V, VOO = 5V. clock applied or internal oscillator operating, BUS and PROG floating. AO= OV, 2. Insert 8741A in programming socket 3. TEST 0 = Ov (select program mode) 4. EA = 23V (activate program mode) 5. Address applied to BUS and P2D-l 6-770 231316-002 UPI_41ATM UPI·41A™ FEATURES AND ENHANCEMENTS 1. Two Data Bus Buffers, one for input and one for out· put. This allows a much cleaner Master/Slave protocol. df 8 INTERNAL DATA BUS If "EN FLAGS" has been executed, P25 becomes the IBF (Input Buffer Full) pin. A "1" written to P25 enables the IBF pin (the pin outputs the inverse of the IBF Status Bit). A "0" written to P25 disables the IBF pin (the pin remains low). This pin can be used to indicate that the UPI·41A is ready for data. INPUT DATA BUS 00- 07 L....-----JBU~;ER OBF (INTERRUPT REOUESn OUTPUT DATA BUS BUFFER fijJ' (INTERRUPT REOUEsn (8) DATA BUS BUFFER INTERRUPT CAPABILITY 2. 8 Bits of Status FO 1 IBF EN FLAGS OBF 1 Op Code: OF5H DO ST 4-ST 7 are user definable status bits. These bits are defined by the "MOV STS, A" single byte, single cycle instruction. Bits 4-7 of the accumulator are moved to bits 4-7 of the status register. Bits 0-3 of the status register are not affected. MOV STS, A 5. P26 and P27 are port pins or DMA handshake pins for use with a DMA controller. These pins default to port pins on Reset. Op Code: 90H 1,10101,101010101 If the "EN DMA" instruction has been executed, P26 becomes the DRQ (DMA ReQuest) pin. A "1" written to P26 causes a DMA request (DRQ is activated). DRQ is deactivated by DACK· RD, DACK· WR, or execution of the "EN DMA" instruction. 3. RD and WR are edge triggered. IBF, OBF, F, and INT change internally after the trailing edge of RD or WR. If "EN DMA" has been executed, P27 becomes the DACK (DMA ACKnowledge) pin. This pin acts as a chip select input for the Data Bus Buffer registers during DMA transfers. FlAGS AFFECTED AD orWR 4. P24 and P25 are port pins or Buffer Flag pins which can be used to interrupt a master processor. These pins default to port pins on Reset. . If the "EN FLAGS" instruction has been executed, P24 becomes the OBF (Output Buffer Full) pin. A "1" written to P24 enables the OBF pin (the pin outputs the OBF Status Bit). A "0" written to P24 disables the OBF pin (the pin remains low). This pin can be used to indicate that valid data is available from the UPI· 41A (in Output Data Bus Buffer). 6-771 UPI·41A ORO~ OROn DACK~ DACK 8257 DMA HANDSHAKE CAPABiliTY EN OMA Op Coda: OESH 0, 231316-002 intJ UPI-41ATM APPLICATIONS ,--808SA 8048 ADDRI==:::":::=i~~ --TO CONTROLr-______rrfl Figure 1. SOSSA-UPI-41A Interface Ali Ali WR WR UPI·41A PORT CONTROL 2 BUS DATA BUS 8 eli ¢!J ¢!J AO -TO DBB -T1 ... 0 Figure 2. S04S-UPI-41A Interface KEYBOARD MATRIX 8243 EXPANDER UPI·41A DATA BUS CONTROL BUS L Figure 3. UPI-41A-S243 Keyboard Scanner CONTROL BUS Figure 4. UPI-41A Matrix Printer Interface 6-772 231316-002 UPI-41ATM ABSOLUTE MAXIMUM RATINGS· Ambient Temperature Under Bias ......... O·C to 70'C Storage Temperature ............. - 65'C to + 150'C Voltage on Any Pin With Respect to Ground .......................... -0.5V to +7V Power Dissipation ......................... 1.5 Watt 'COMMENT: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. D.C. AND OPERATING CHARACTERISTICS TA=O'C to 70'C, Vss=OV, Vcc=voo= +5V :!:10%' Parameter Min. Max. Unit V IL Input Low Voltage (Except XTAL 1, XTAL2, RESET) -0.5 0.8 VILI V IH Input Low Voltage (XTALl, XTAL2, RESET) V V Symbol Test Conditions - 0.5 0.6 Input High Voltage (Except XTAL 1, XTAL2,IjIESET) 2.2 Vee 3.8 Vee 0.45 V V IOL=2.0 mA 0.45 V IOL=1.6rnA 0.45 V IOL=1.0rnA V 10H= -400 "A VIHI Input High Voltage (XTALl, XTAL2, RESET) VOL V OL1 V OL2 Output Low Voltage (0 0 -0 7 ) V OH Output High Voltage (0 0-0 7 ) 2.4 V OHI Output High Voltage (All Other Outputs) 2.4 V 10H= -50 "A IlL I nput Leakage Current (To, T I, RD, WR, CS, A o, EA) :!:10 "A loz III Output Leakage Current (0 0-0 7, High Z State) Low Input Load Current (P'OP17' P20 P27 ) Low Input Load Current (RESET, SS) ±10 0.5 "A mA Vss :S VIN Vss +0.45 V IL = 0.8V 0.2 rnA 15 rnA V IL =0.8V Typical = 5 mA 125 mA Typical = 60 rnA ILiI 100 lec+ 100 Output Low Voltage (PIOP17, P20 P27 , Sync) Output Low Voltage (Prog) Voo Supply Current Total Supply Current :S :S Vee VIN :S Vee A.C. CHARACTERISTICS TA=O'C to 70'C, Vss=OV, Vcc=Voo= +5V :!:10%' DBB READ Symbol Min, Parameter Max. Unit 0 ns 0 ns tAR CS, Ao Setup to RD I tRA CS, Ao Hold After ROt tRR RD Pulse Width tAD t RO CS, Ao to Data Out Delay 225 ns RDI to Data Out Delay 225 ns 250 Test Conditions ns tOF Fmt to Data Float Delay 100 ns tCY Cycle Time (Except 8741A·8) 2.5 15 tCY Cycle Time (8741A·8) 4.17 15 "s p's Min. Max, Unit CL =150 pF CL= 150 pF 6.0 MHz XTAL 3.6 MHz XTAL DBB WRITE Symbol Parameter 0 ns 0 ns 250 ns tAW CS, Ao Setup to WRI tWA tww CS, Ao Hold After WR t WR Pulse Width tow Data Setup "to WR f 150 ns two Data Hold After WRf 0 ns 6-773 Test Conditions 231316-002 inter UPI-41ATM A.C. TIMING SPECIFICATION FOR PROGRAMMING TA=O°C to 70°C, VCC= +5V ±10% * Symbol , Min. Parameter tAW Address Setup Time to RESET I 4tcy tWA Address Hold Time After RESET I 41CY tow Data in Setup Time to PROG I 4tcy two Data in Hold Time After PROG I 4tcy tpH RESET Hold Time to Verify 4tcy tvoow Voo Setup Time to PROG I 4tcy tVOOH Voo Hold Time After PROG I 0 tpw Program Pulse WIdth 50 trw Test 0 Setup Time for Program Mode 4tcy tWT Test 0 Hold Time After Program Mode 4tcy too Test 0 to Data Out Delay tww RESET Pulse Width to Latch Address 4tcy tr, tf Voo and PROG Rise and Fall Times 0.5 tCY CPU Operation Cycle Time 5.0 tRE RESET Setup Time Before EA I. 4tcy Note: Max. Unit 60 mS Test Conditions 4tcy 2.0 I-'S I-'S If TEST 0 is high, too can be triggered by RESET t. * For Extended Temperature EXPRESS, use M8741 A electrical parameters. D.C. SPECIFICATION FOR PROGRAMMING TA = 25°C ±5°C, Vcc = 5V ±5%, Voo = 25V ±1V Symbol Parameter Min. Max. Unit 24.0 26.0 V Voo Voltage Low Level 4.75 5.25 V PROG Program Voltage High Level 21.5 24.5 V VOOH Voo Program Voltage High Level VOOL VPH VPL PROG VOltage Low Level VEAH EA Program or Verify Voltage High Level 21.5 0.2 V 24.5 V VEAL EA Voltage Low Level 5.25 V 100 Voo High Voltage Supply Current 30.0 mA IPROG PROG High Voltage Supply Current 16.0 mA lEA EA High Voltage Supply Current 1.0 mA Max. Unit Test Conditions A.C. CHARACTERISTICS-PORT 2 T A =O·Ct070·C,: Vcc= +5V ±10% Symbol Parameter Min. tcp Port Control Setup Before Falling Edge of PROG 110 tpc Port Control Hold After Falling Edge of PROG 100 tPR PROG to Time P2 Input Must Be Valid tPF Input Data Hold Time top Output Data Setup Time tpo Output Data Hold Time tpp PROG Pulse Width 0 6-774 Test Conditions ns ns 810 ns 150 ns 250 ns 65 ns 1200 ns 231316-002 inter UPI_41ATM A.C. CHARACTERISTICS-DMA Symbol Min. Parameter 0 ns ICAC RD or WR 10 DACK 0 ns IACD DACK 10 Data Valid 225 ns I CRO RD or WR 10 DRQ Cleared 200 ns IACC r----: 15 pF w + SV XTAL1 470Q 1·6 mHz I (INCLUDES XTAL....L SOCKET, STRAY) C L =150pF DRIVING FROM EXTERNAL SOURCE CRYSTAL OSCILLATOR MODE <" Test Conditions Unit Max. DACK 10 WR or RD l>--+-------::.j XTAll c:::J i I , L_____ 15-25pF (INCLUDES SOCKET, STRAY) 3 + SV XTAL2 470Q I-= ' - - - -.......---'-1XTAL2 CRYSTAL SERIES RESISTANCE SHOULD BE <75Q AT 6 MHz; --_______~»(~_________ A_D_D_R_E_ss_r8_-9_I_V_A_L_rO________ J»(~_______ N_E_X_T_A_D_D_R_E_SS_V_A_L_'_D_____________ NOTES: " PROG MUST FLOAT IF EA IS LOW (I ••. , 23V), OR IF TO=SV FOR THE 8741A. FOR THE 8041A PROG MUST ALWAYS FLOAT. 2. XTAL 1 ANO XTAL 2 DRIVEN BY 3,6 MH: CLOCK Will GIVE 4.17 /,sec ICY' THIS IS ACCEPT· ABLE FOR 8741A·8 PARTS AS WELL AS STANDARD PARTS. 3. AO MUST BE HELD LOW (I .... = OV) DURING PROGRAMNERIFY MODES. * The 8741A EPROM can be programmed by either of two Intel products: 1. PROMPT-48 Microcomputer Design Aid, or 2. Universal PROM Programmer (UPP series) peripheral of the Intellec'" Development System with a UPP-848 Personality Card. 6-777 231316-002 UPI-41ATM WAVEFORMS-DMA DACK AD WR DATA BUS - 'AC~ =----:iCAC-1'Ace .1,....----.. I -'ACD~I~ ~ - _ICAC ORa - ~ VALID ~ \ -Ic}- -'CRJ- INPUT AND OUTPUT WAVEFORMS FOR A.C. TESTS 2.4----"'"V2.2....... Ao .a- ' - -_ _ _...I 0.45 - . /2.2V TEST POINTS ....... o.aA 1.----- Table 2. UPI™ Instruction Set Mnemonic Accumulator ADD A,Rr ADD A,@Rr ADD A,#data ADDC A,Rr ADDC A.@Rr ADDC A. #data ANL A.Rr ANL A,@Rr ANL A,#data ORL A,Rr ORL A.@Rr ORL A.#data XRL A,Rr Description Mnemonic Bytes Cycles XRL A,@Rr Add register to A Add data memory to A Add immediate to A Add register to A with carry Add data memory to A with carry Add immed. to A with carry AND register to A AND data memory to A AND immediate to A OR register to A OR data memory to A OR immediate to A Exclusive OR register to A 1 1 2 1 1 1 2 1 1 1 2 2 1 1 2 1 1 2 1 1 1 2 1 1 2 1 XRL A,#data INCA DEC A CLR A CPL A DAA SWAP A RL A RCL A RR A RRC A 6-778 Description Exclusive OR data memory to A Exclusive OR immediale 10 A Increment A Decrement A Clear A Complement A Decimal Adjust A Swap nibbles of A Rotate A left Rotate A left through carry Rotate A right Rotate A right through carry· Byles Cycles 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 231316-002 UPI-41ATM Table 2. UPI'M Instruction Set (Cont'd.) Mnemonic Input/Output In A,Pp OUTL Pp,A ANL Pp,#data ORL Pp,#data In A,DBB OUT DBB,A MOV STS,A MOVD A,Pp MOVD Pp,A ANLD Pp,A ORLD Pp,A Data Moves MOV A,Rr MOVA,@Rr MOVA,#data MOV Rr,A MOV@Rr,A MOV Rr,#data MOV@Rr, #data MOVA,PSW MOV PSW,A XCH A,Rr XCH A,@Rr XCHD A,@Rr MOVPA,@A MOVP3, A,@A Timer/Counter MOVA,T MOV T,A STRT T STRT CNT STOP TCNT EN TCNTI DIS TCNTI Description Bytes Cycles Mnemonic Control EN DMA Input port to A Output A to port AND immediate to port OR immediate to port Input DBB to A, clear IBF Output A to DBB, set OBF A4-A7 to Bits 4-7 of Status Input Expander port to A Output A to Expander port AND A to Expander OR A to Expander port 1 1 2 2 1 2 2 2 2 1 EN I DIS I EN FLAGS 1 1 SEL RBO 1 1 SEL RB1 1 2 NOP 1 2 1 1 2 2 Registers INC Rr INC@Rr Move register to A Move data memory to A Move immediate to A Move A to register Move A to data memory Move immediate to register Move immediate to data memory Move PSW to A Move A to PSW Exchange A and register Exchange A and data memory Exchange digit of A and register Move to A from current page Move to A from page 3 1 1 1 1 2 1 1 2 1 1 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Read Timer/Counter Load Timer/Counter Start Timer Start Counter Stop Timer/Counter Enable Timer/Counter Disable Timer/ Counter Interrupt DEC Rr Subroutine CALL addr RET RETR Flags CLR C CPLC CLR FO CPL FO CLR F1 CPL F1 Branch JMP addr JMPP@A DJNZ Rr,addr JC addr JNC addr JZ addr JNZ addr JTO addr JNTO addr JT1 addr JNT1 addr JFO addr JF1 addr JTF addr JN1BF addr JOBF addr JBb addr 6-779 Description Enable DMA Handshake Lines Enable IBF Interrupt Disable IBF Interrupt Enable Master Interrupts Select register bank 0 Select register bank 1 No Operation Bytes Cycles 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Jump to subroutine Return Return and restore status 2 1 1 2 2 2 Clear Carry Complement Carry Clear Flag 0 Complement Flag 0 Clear F1 Flag Complement F1 Flag 1 1 1 1 1 1 1 1 1 1 1 1 Jump unconditional Jump indirect Decrement register and jump Jump on Carry=1 Jump on Carry=O Jump on A Zero Jump on A not Zero Jump on TO=1 Jump on TO=O Jump on T1 =1 Jump on T1 =0 Jump on FO Flag=1 Jump on F1 Flag=1 Jump on Timer Flag=1, Clear Flag Jump on ISF Flag=O Jump on OBF Flag=1 Jump on Accumulator Bit 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 Increment register Increment data memory Decrement register 231316-002 UPITM-42: 8042/8742AH UNIVERSAL PERIPHERAL INTERFACE 8-BIT SLAVE MICROCONTROLLER ROM and EPROM • Interchangeable Versions 12 MHz • UPI-42: Pin, Software and Architecturally • Compatible with 8041A/8741A 8-Bit CPU plus ROM, RAM, I/O, Timer/ • Counter and Clock in a Single Package • • • 2048 x 8 ROM/EPROM, 128 x 8 RAM, 8-Bit Timer/Counter, 18 Programmable I/O Pins One 8-Bit Status and Two Data Registers for Asynchronous Siave-toMaster. Interface DMA, Interrupt, or Polled Operation Supported Fully Compatible with all Intel and Most • Other Microprocessor Families Expandable I/O • Sync Available • Over 90ModeInstructions: • Available in EXPRESS70% Single Byte • - Standard Temperature Range Programming™ Algorithm • -inteligent Fastest EPROM Programming Available In 40-Lead Cerdlp • 8742AH Package 8042 Available in both 40-Lead Plastic and 44-Lead Plastic Leaded Chip Carrier Packages (See Packaging Spec., Order #231369) The Intel UPI-42 is a general-purpose Universal Peripheral Interface that allows the designer to develop customized solution for peripheral device control. It is essentially a "slave" microcontroller, or a microcontroller with a slave interface included on the chip. Interface registers are included to enable the UPI device to function as a slave peripheral controller in the MCSTM Modules and iAPX family, as well as other 8-, 16-bit systems. To allow full user flexibility, the program memory is available in either ROM or UV-erasable EPROM. All UPI-42 devices are fully pin compatible for easy transition from prototype to production level designs. These are the memory configurations available. UPI Device 8042 8742AH ROM EPROM RAM 2K - 256 - 2K 256 Programming Voltage 12.5V \1\ ,. I~ HiivJlIi.It.... N • " - • , ' 311444342".0 0 'W- '" '" '" '. " '"'" ,~ '" ' .. '" '. ~~..r~>RV ..P..f'fll~ 210393-3 210393-1 Figure 1. Block Diagram 210393-2 Figure 3. PLCC Pin Configuration Figure 2. DIP Pin Configuration Intel Corporation assumes no responsibility for the use of any circuitry other than Circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. November 1985 © Intel Corporation, 1985 6-780 Order Number: 210393-002 inter UPI-42 Table 1. Pin Description DIP Symbol Pin No. PLCC Pin Type No. TEST 0, 1 2 TEST 1 39 43 I Name and Function TEST INPUTS: Input pins which can be directly tested using conditional branch instructions. FREQUENCY REFERENCE: TEST 1 (T1) also functions as the event timer input (under software control). TEST (To) is used during PROM programming and verification in the 8742AH. 11 is also used during "sync mode" to reset the instruction state to SI and synchronize the internal clock to PH 1. See the Sync Mode Section. ° XTAL 1, 2 3 3 4 I XTAL2 INPUTS: Inputs for a crystal, LC or an external timing signal to determine the internal oscillator frequency. RESET 4 S I RESET: Input used to reset status flip·flops and to set the program counter to zero. RESET is also used during PROM programming and verification. SS S 6 I SINGLE STEP: Single step input used in conjunction with the SYNC output to step the program through each instruction (8742AH). This should be tied to + SV when not used. This pin is also used to put the device in synch mode by applying 12.SV to it. CS 6 7 I CHIP SELECT: Chip select input used to select one UPI microcomputer out of several connected to a common data bus. EA 7 8 I EXTERNAL ACCESS:, External access input which allows emulation, testing and PROM I ROM verification. This pin should be tied low if unused. RD 8 9 I READ: 1/0 read input which enables the master CPU to read data and status words from the OUTPUT DATA BUS BUFFER or status register. Ao 9 10 I COMMAND/DATA SELECT: Address Input used by the master processor to indicate whether byte transfer is data (Ao = 0, Fl is reset) or command (Ao = 1, Fl is set). WR 10 11 I WRITE: 1/0 write input which enables the master CPU to write data and command words to the UPIINPUT DATA BUS BUFFER. SYNC 11 13 0 OUTPUT CLOCK: Output Signal which occurs once per UPI·42 instruction cycle. SYNC can be used as a strobe for external circuitry; it is also used to synchronize single step operation. 12-19 14-21 1/0 DATA BUS: Three-state, bidirectional DATA BUS BUFFER lines used to interface the UPI42 microcomputer to an 8-bit master system data bus. P10- P17 27-34 30-33 3S-38 1/0 PORT 1: 8-bit, PORT 1 quasi-bidirectional 1/0 lines. P10-P14 and P17 access the signature row and security bit on the 8742AH. P20- P27 21-24 24-27 3S-38 39-42 1/0 PORT 2: 8-bit, PORT 2 quasi-bidirectional 1/0 lines. The lower 4 bits (P20-P23) interface directly to the 8243 1/0 expander device and contain address and data information during PORT 4- 7 access. The upper 4 bits (P24 -P27) can be programmed to provide interrupt Request and DMA Handshake capability. Software control can configure P24 as Output Buffer Full (OBF) interrupt, P25 as Input Buffer Full (IBF) interrupt, P26 as DMA Request (DRO), and P27 as DMA ACKnowledge (DACK). PROG 1/0 Do-D7 (BUS) 2S 28 PROGRAM: Multifunction pin used as the program pulse input during PROM programming. During 1/0 expander access the PROG pin acts as an addressldata strobe to the 8243. This pin should be tied high if unused. + SV main power supply pin. Vee 40 44 POWER: VDD 26 29 POWER: + SV during normal operation. + 12.5V during programming operation. Low power standby pin in EPROM and ROM versions. VSS 20 22 GROUND: Circuit ground potential. 6-781 inter UPI·42 During the time that the host CPU is reading the status register, the UPI·42 is prevented from up· dating this register or is 'locked out.' UPI·42 FEATURES 1. Two Data Bus Buffers, one for input and one for output. This allows a much cleaner Master/Slave protocol. 00-07 df INTERNAL DATA 8US INPUT DATA BUS BUFFER ,------,(8) OUTPUT JI DATA BUS BUFFER (8) 210393-4 2. 8 Bits of Status 1ST71 ST61 ST51 ST41 F1 I Fo IIBF I OBF I 4. P24 and P25 are port pins or Buffer Flag pins which can be used to interrupt a master proces· sor. These pins default to port pins on Reset. If the "EN FLAGS" instruction has been execut· ed, P24 becomes the OBF (Output Buffer Full) pin. A "1" written to P24 enables the OBF pin (the pin outputs the OBF Status Bit). A "0" written to P24 disables the OBF pin (the pin remains low). This pin can be used to indicate that valid data is avail· able from the UPI·41A (in Output Data Bus Buff· er). If "EN FLAGS" has been executed, P25 becomes the IBF (Input Buffer Full) pin. A "1" written to P25 enables the IBF pin (the pin outputs the inverse of the IBF Status Bit. A "0" written to P25 disables the IBF pin (the pin remains low). This pin can be used to indicate that the UPI·42 is ready for data. D7 D6 D5 D4 D3 D2 D1 Do ST4-ST 7 are user definable status bits_ These bits are defined by the "MOV STS, A" single byte, single cycle instruction. Bits 4-7 of the acccumu· lator are moved to bits 4-7 of the status register. Bits 0-3 of the status register are not affected. MOV STS, A OBF (INTERRUPT RECUESn i1fF (INTERRUPT REOUEST) Op Code: 90H 210393-5 Data Bus Buffer Interrupt Capability 3. RD and WR are edge triggered. IBF, OBF, F1 and INT change internally after the trailing edge of RD orWR. EN FLAGS Op Code: OFSH I I I 0 0 DO AD or "'{Po 210393-6 6-782 inter UPI·42 5. P26 and P27 are port pins or DMA handshake pins for use with a DMA controller. These pins default to port pins on Reset. If the "EN DMA" instruction has been executed, P26 becomes the DRO (DMA Request) pin. A "1" written to P26 causes a DMA request (DRO is activated). DRO is deactivated by DACK-RD, DACK-WR, or execution of the "EN DMA" instruction. If "EN DMA" has been executed, P27 becomes the DACK (DMA ACKnowledge) pin. This pin acts as a chip select input for the Data Bus Buffer registers during DMA transfers. 8041AHI ORa~ OROn DACK~ OACK 8048H WR PORT I ~'-----Rii 00 ----IWR i------....==-----,!\ CONTROL BUS 'If . _ . 2( DATA:~==<> i~ TO PERIPHERAL UPI·42 Das DEVICES -T, 210393-10 Figure 4. 8048H-UPI-42 Interface 8257 8741A 210393-7 UPI·42 DMA Handshake Capability EN DMA op Code: OE5H o DATA BUS Do 6. When EA is enabled on the UPI-42, the program counter is placed on Port 1 and the lower three bits of Port 2 (MSB = P22, LSB = P10). On the UPI-42 this information is multiplexed with PORT DATA (see port timing diagrams at end of this data sheet). CONTROL BUS 210393-9 Figure 5. UPI-42-8243 Keyboard Scanner 7. The 8742AH supports the inteligent Programming Algorithm. (See the Programming Section.) z 0 ;:: in APPLICATIONS 8088 AODR CONTAOlE===~~ . . ~ 8 r-----.--'\I -TO --T1 z 0 ;:: ~ in ~ ~ 0 m g: 2 Z II 0. ~l PORT 2 TO PERIPHERAL DEVICES 210393-8 Figure 3. 8088-UPI-42 Interface 210393-11 Figure 6. UPI-42 80-Column Matrix Printer Interface 6-783 UPI-42 PROGRAMMING, VERIFYING, AND ERASING THE 8742AH EPROM Programming Verification In brief, the programming process consists of: activating the program mode, applying an address, latching the address, applying data, and applying a programming pulse. Each word is programmed completely before moving on to the next and is followed by a verification step. The following is a list of the pins used for programming and a description of their functions: Pin Function XTAL1 2 Clock Inputs Reset Initialization and Address Latching Test 0 Selection of Program or Verify Mode EA Activation of ProgramlVerify Signature Row/Security Bit Modes BUS Address and Data Input Data Output During Verify 8742AH Erasure Characteristics The erasure characteristics of the 8742AH are such that erasure begins to occur when exposed to light with wavelengths shorter than approximately 4000 Angstroms (A). It should be noted that sunlight and certain types of fluorescent lamps have wavelengths in the 3000-4000A range. Data show that constant exposure to room level fluorescent lighting could erase tile typical 8742AH in approximately 3 years while it would take approximately one week to cause erasure when exposed to direct sunlight. If the 8742AH is to be exposed to these types of lighting conditions for extended periods of time, opaque labels are available from Intel which should be placed over the 8742AH window to prevent unintentional erasure. WARNING The recommended erasure procedure for the 8742AH is exposure to shortwave ultraviolet light which has a wavelength of 2537 A. The integrated dose (i.e., UV intensity x exposure time) for erasure should be a minimum of 15 w-sec/ cm 2. The erasure time with this dosage is approximately 15 to 20 minutes using an ultraviolet lamp with a 12,000 /J-W / cm 2 power rating. The 8742AH should be placed within one inch of the lamp tubes during erasure. Some lamps have a filter on their tubes which should be removed before erasure. Exposure of the 8742AH to high intensity UV light for long periods may cause permanent damage. An attempt to program a missocketed 8742AH will result in severe damage to the part. An indication of a properly socketed part is the appearance of the SYNC clock output. The lack of this clock may be used to disable the programmer. inteligent Programming™ Algorithm P20-22 Address Input VDD Programming Power Supply PROG Program Pulse Input The ProgramlVerify sequence is: 1. Ao = OV, CS = 5V, EA = 5V, RESET = OV, TEST 0 = 5V, VDD = 5V, clock applied or internal oscillator operating, BUS floating, PROG 5V. 2. Insert 8742AH in programming socket 3. TEST 0 = OV (select program model) 4. EA 5. VDD 12.5V (active program mode) = = 12.5V (programming power) 6. Address applied to BUS and P20-22 7. RESET = 5V (latch address) 8. Data-applied to BUS 9. PROG = Vee followed by one 1 ms pulse to OV 10.TEST 0 = 5V (verify mode) 11. Read and verify data on BUS 12. TEST 0 13. RESET = = OV OV and repeat from step 6 The 8742AH inteligent Programming Algorithm rapidly programs Intel 8742AH EPROMs using an efficient and reliable method particularly suited to the production programming environment. Typical programming time for individual devices is on the order of 10 seconds. Programming reliability is also ensured as the incremental program margin of each byte is continually monitored to determine when it has been successfully programmed. A flowchart of the 8742AH inteligent Programming Algorithm is shown in Figure 7. The inteligent Programming Algorithm utilizes two different pulse types: initial and overprogram. The duration of the initial PROG pulse(s) is one millisecond, which will then be followed by a longer overprogram pulse of length 3X msec. X is an iteration counter and is equal to the number of the initial one millisecond pulses applied to a particular 8742AH location, before a correct verify occurs. Up to 25 one-millisecond pulses per byte are provided for before the overprogram pulse is applied. 14: Programmer should be at conditions of step 1 when 8742AH is removed from socket Please follow the inteligent Programming flow chart for proper programming procedure. 6-784 intJ UPJ-42 210393-12 Figure 7 6-785 inter UPI-42 The entire sequence of program pulses and byte verifications is performed at Vee = 6.0V and Voo = 12.SV. When the inteligent Programming cycle has been completed, all bytes should be compared to the original data with Vee = S.O, Voo = 12.SV. Verification: Since the security bit address overlaps the address of the security byte of the signature row, it can be used to check indirectly whether the security bit has be.en programmed or not. Therefore, the security bit verification is a mere read operation of the security byte of the signature row (1 = security bit programmed; 0 = security bit unprogrammed). Note that during the security bit programming, reading security byte = FFH does not necessarily indicate that the security bit has been successfully programmed. Thus, it is recommended that two known bytes in the EPROM array be read and the wrong data should be read at least once, because it is highly improbable that random data coincides with the correct ones twice. Verify A verify should be performed on the programmed bits to determine that they have been correctly programmed. The verify is performed with TO = SV, Voo = 12.SV, EA = 12.SV, SS = SV, PROG = SV, AO = OV, and CS = SV. SECURITY BIT The security bit is a single EPROM cell outside the EPROM array. The user can program this bit with the appropriate access code and the normal programming procedure, to inhibit any external access to the EPROM contents. Thus the user's resident program is protected. There is no direct external access to this bit. However, the security byte in the signature mode has the same address and can be used to check indirectly whether the security bit has been programmed or not. The security bit has no effect on the signature mode, so the security byte can always be examined. SIGNATURE MODE SECURITY BIT PROGRAMMING! VERIFICATION Programming: a. Read the security byte of the signature row. Make sure it is OOH. b. Apply access code to appropriate inputs to put the device into security mode. c. Apply high voltage to EAand Voo pins. d. Follow the programming procedure as per the inteligent Programming Algorithm with DBO-DB7 = high. Not only the security bit, but also the security byte of the signature row is programmed. e. Verify that the security byte of the signature row contains FFH. f. Read two known bytes from the EPROM array and verify that the wrong data are retrieved in at least one verification. If the EPROM can still be read, the security bit may have not been fully programmed though the security byte in the signature row has. The UPI-42 has an additional 32 bytes of EPROM available for Intel and user signatures and miscellaneous purposes. The 32 bytes are partitioned as follows: A. Test code/checksum-This ROM memory can accommodate up to 2S bytes of code for testing the internal nodes that are not testable by executing from the external memory. The checksum is used in the ROM testing only. B. Intel signature-This allows the programmer to read from the UPI-42 the manufacturer of the device and the exact product name. It facilitated automatic selection of EPROM size and programming voltages. Location 10H contains the manufacturer code. For Intel, it is 89H. Location 11 H contains the device code. The code is 43H for the 8042; it is 42H for the 8742AH. C. User signature-The user signature memory is implemented in the EPROM and consists of 2 bytes for the customer to program his own signature code (for identification purposes and quick sorting of previously programmed materials). D. Test signature (8)-This memory is used to store testing information such as: test data, bin number, etc. (for use in quality and manufacturing control). E. Security byte-This. byte is used to check whether the security bit has been programmed or not (see the security bit section). 6-786 intJ UPI·42 The signature mode can be accessed by setting P10 = 0, P11 = 1, P12 = 1, P13 = 1, P14 = 1, and then following the programming and/or verification procedures. The location of the various address partitions are as follows: Address Test Code/Checksum 0 16H OFH 1EH Intel Signature 10H 11H User Signature 12H 13H Test Signature (B) 14H 15H Security Byte 1FH Alternate Address Device Type No. of Bytes - EPROM/ROM 25 ROM 2 - EPROM 2 EPROM 2 DFH EPROM 1 DOH SYNC MODE SYNC mode allows the UPI-42 to be forced externally into a known state upon reset. It can be used to synchronize multiple parts on a printed circuit board. It clears the oscillator prescaler, the phases, and the Time State Generator. Since, under normal operation, the RS signal can occur asynchronously with respect to the UPI-42's internal state, it cannot beguaranteed that a RS will leave several devices in the same state. SYNC mode is activated when the S8 pin is at a voltage level of 12V. The actual synchronization D1H starts when the TO pin is raised to VIH during XTAL 1 = O. After 3 XT AL 1 pulses, the prescaler is forced into a known state, which sets both PH1 and PH2 to a "0" state as shown. The Time State Generator is completely reset with TS1 =TS2=TS3=TS4= TS5 = 0, and the input to TS1 is equal to a "1" state. SYNC is removed when TO is brought from "1" to "0" during the next XT AL = O. The subsequent PH2= 1 and PH1 =0, then PH2=0, and PH1 = 1 will latch a "1" into TS1. A normal reset is then given to put the device into proper operation. What state the device will be in after the RS becomes a "1" can be determined by tracking how many XTAL 1 cycles occur during RS. 6-787 inter UPI-42 SYNC MODE TIMING DIAGRAMS XTAL 1 XTAL2 TO PH1 PH2 ....--------------+-~ TS1 TS3 i--------TS5 --'--'----+1 12V--------------------------------------~~~ Ss 5V \ \ OV - - - - - - - - -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - • 210393-13 Minimum Specifications SYNC Operation Time, tSYNC = 3.5 XTAL 1 Clock cycles. Reset Time, tRS = 4 Icy. NOTE: The rising and falling edges of TO should not coincide with the falling edge of XTAL 1 clock. 6-788 intJ UPI-42 ACCESS CODE The following table summarizes the access codes required to invoke the SYNC mode, signature mode, and the security bit, respectively. Also, the programming and verification modes are included for comparison. Control Signals Access Code Data Bus Port 2 Modes TO Programming Mode 0 0 Verification Mode 1 1 Sync Mode Signature Mode Prog Verify Security Bit Prog Voo Vee RST SS EA PROG 0 0 1 2 3 4 5 6 7 0 1 2 Port 1 0 1 2 3 4 7 Address Address 00/11 X X X X VOOH Vee Data In Address VOOH Vee Address Address 00/11 X X X X VOOH Vee Data Out Address 1 HV 1 VOOH Vee 1 1 HV STB 0 1 HV 1 1 1 HV 1 STB High 0 HV 0 X 0 0 1 HV 1 VOOH Vee Addr. (See Sig Row Table) 0 0 0 0 1 1 HV STB VOOH Vee Data In 0 0 0 1 0 1 HV 1 VOOH Vee Addr. (See Sig Row Table) 0 0 0 1 1 1 HV 1 VOOH Vee Data Out 0 0 0 0 0 1 HV 1 VOOH Vee 1 1 1 1 1 1 1 1 0 0 0 0 1 1 HV STB VOOH Vee 1 1 1 1 1 1 1 1 0 0 0 Vee X X X X X X X X X X X X X X X X X Vee ABSOLUTE MAXIMUM RATINGS* + 70 e + 150 e Ambient Temperature Under Bias .... ooe to 0 Storage Temperature .......... -65°e to 0 Voltage on Any Pin with Respect to Ground .............. - O.5V to + 7V Power Dissipation ......................... 1.5 W 0 1 1 1 1 1 • Notice: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied Exposure to absolute maximum rating conditions for extended periods may affect device reliability. 6-789 UPI·42 D.C. CHARACTERISTICS Symbol TA = O°Cto + 70°C. vee = VOO = +5V ±10% 8042/8742 Parameter Min Max Units Notes VIL Input Low Voltage (Except XTAL 1. XTAL2. RESET) -0.5 0.8 V VIL1 Input Low Voltage (XTAL1. XTAL2. RESET) -0.5 0.6 V VIH Input High Voltage (Except XTAL 1. XTAL2. RESET) 2.0 Vee V VIH1 Input High Voltage (XTAL 1. RESET) 3.5 Vee V VIH2 Input High Voltage (XTAL2) 2.2 Vee V VOL Output Low Voltage (00-07) 0.45 V IOL 2.0 mA VOL1 Output Low Voltage (P1OP17. P20P27. Sync) 0.45 V IOL 1.6 mA VOL2 Output Low Voltage (PROG) 0.45 V VOH Output High Voltage (00-07) 2.4 VOH1 Output High Voltage (All Other Outputs) 2.4 IOH = -50 p,A IlL Input Leakage Current (To. T 1. RO. WR. CS. Ao. EA) ±10 p,A Vss :s: IOFL Output Leakage Current (00-07. High Z State) ±10 p,A Vss +0.45 :s: VOUT:S: Vee lu Low Input Load Current (P1OP17. P20P27) 0.3 mA IU1 Low Input Load Current (RESET. SS) 0,.2 mA 100 Voo Supply Current Icc + 100 Total Supply Current V , = = IOL = IOH = 1.0 mA -400 p,A VIN :s: 20 mA 135 mA = 0.8V = 0.8V Typical = 5 mA Typical = 60 mA VIN IIH Input Leakage Current (P1O-P17. P20-P27) 100 p,A CIN Input Capacitance 10 pF CIO 1/0 Capacitance 20 pF VIL VIL = Vee D.C. CHARACTERISTICS-PROGRAMMING TA = 25°C ± 5°C. Vee = 6V ± 0.25V. Voo = 12.5V ± 0.5V Symbol Parameter Min Max Units 12 13 V(1) VOOH Voo Program Voltage High Level VOOL Voo Voltage Low Level 4.75 5.25 V VPH PROG Program Voltage High Level 2.0 5.5 V VPL PROG Voltage Low Level -0.5 0.8 V VEAH Inpl!t High Voltage for EA. SS 12.0 13.0 V(2) VEAL EA Voltage Low Level 5.25 V 100 Voo High Voltage Supply Current 30.0 mA IpROG PROG High Voltage Supply CUrrent 1.0 mA lEA EA Voltage Supply Current 1.0 mA NOTES: 1. Voltages over 13V applied to pin VDD will permanently damage the device. 2. VEAH must be applied to EA before VDOH and removed after VDDL' 3. Vee must be applied simultaneously or before VDD and must be removed simultaneously or after VDD. 6-790 Vee intJ UPI-42 A.C. CHARACTERISTICS TA = oaCto +70aC, vss = OV, vcc = voo = +5V ±10% DBB READ Symbol Parameter Min -L Max Units 0 ns 0 ns 160 ns tAR CS, AD Setup to RD tRA CS, AD Hold After RD i tRR RD Pulse Width tAO CS, AD to Data Out Delay 130 ns tRO RD -L RD i to Data Out Delay 130 ns to Data Float Delay 85 ns Max Units tOF DBB WRITE Symbol Parameter Min -L tAW CS, AD Setup to WR tWA CS, AD Hold After WR tww WR Pulse Width tow Data Setup to WR two Data Hold After WR i 0 ns 0 ns 160 ns 130 ns 0 ns i i CLOCK Symbol Min Max Units tCY Cycle Time Parameter 1.25 9.20 p.s(1) tCYC Clock Period 83.3 613 tPWH Clock High Time 33 tpWL Clock Low Time 33 tR Clock Rise Time 10 ns tF Clock Fall Time 10 ns ns ns ns NOTE: 1. ICY = 15/f(XTAL) A.C. CHARACTERISTICS DMA Symbol Parameter Min Max Units tACC DACK to WR or RD 0 ns tCAC RD or WR to DACK 0 ns tACO DACK to Data Valid 130 ns tCRQ RD or WR to ORO Cleared 110 ns(1) NOTE: 1. CL = 150 pF. 6-791 inter UPI·42 A.C. CHARACTERISTICS-PROGRAMMING TA = 25°C ±5°C, VCC = 5V ±5%, Voo (8742AH ONLY) = +5V ±0.5V Parameter Symbol Min tAW Address Setup Time to RESET i 4tCY tWA Address Hold Time After RESET i 4tCY tow Data in Setup Time to PROG two Data in Hold Time After PROG tPH RESET Hold Time to Verify 4tCY tpw Initial Program Pulse Width 0.95 tTW Test 0 Setup Time for Program Mode 4tCY tWT . Test 0 Hold Time After Program Mode 4tCY too Test 0 to Data Out Delay i Max Units 1.05 ms(1) 4tCY !- 4tCY· 4tcy tww RESET Pulse Width to Latch Address ti, tf Voo and PROG Rise and Fall Times tCY CPU Operation Cycle Time tRE RESET Setup Time Before EA i 4tCY topw Overprogram Pulse Width 2.85 tOE EA High to Voo High 1tCY 4tCY 0.5 100 /-Ls 4.0 /-Ls ms(2) 78.75 NOTES: 1. Typical Ini1ial Program Pulse width tolerance = 1 ms ± 5%. 2. This variation is a function of the iteration counter value, X. 3. If TEST 0 is high, tDO can be triggered by RESET t . A.C. CHARACTERISTICS PORT2TA = O°Cto + 70°C, VCC = +5V ±10% Parameter f(tCy)(3) tcp Port Control Setup Before Falling Edge of PROG 1/15 tCy-28 55 ns(1) tpc Port Control Hold After Falling Edge ofPROG 1/10tCY 125 ns(2) tpR PROG to Time P2 Input Must Be Valid tpF Input Data Hold Time top Output Data Setup Time 2/10 tCY 250 ns(1) tpo Output Data Hold Time 1/10 tCy-80 45 ns(2) tpp PROG Pulse Width 6/10 tCY 750 ns Symbol NOTES: 1. CL = 2. CL = 3. tCY = Min 8/15tCy-16 0 80 pF. 20 pF. 1.25 ,",5. 6-792 Max Units 650 ns(1) 150 ns(2) UPI-42 A.C. TESTING INPUT/OUTPUT WAVEFORM A.C. TESTING LOAD CIRCUIT INPUTIOUTPUT ::5 =x:: > TEST POINTS < ::x= 210393-14 210393-15 DRIVING FROM EXTERNAL SOURCE-TWO OPTIONS ,------------------------------, ,------------------------------, + 5V >6 MHz 410,,> XTALl }>---+------'-j XTAll 410') XTAL2 L--~-"l XTAL2 210393-16 210393-17 Rise and Fall Times Should Not Exceed 10 ns. Resistors to Vcc are Needed to Ensure VIH = 3.SV if TIL Circuitry is Used. LC OSCILLATOR MODE L C NOMINAL 45 H 20 pF 5.2 MHz 120 H 20 pF 3.2 MHz CRYSTAL OSCILLATOR MODE 1=_1_ 27T.J[Ci C~2_J ~=~:~,122 ,- : - =r= ~ = C' = C 2 210393-18 Each C Should be Approximately 20 pF, including Stray Capacitance. 6-793 XTAU I f--'----'---~ XTAL2 C3 + 3Cpp Cpp '" 5-10 pF Pin-to-Pin Capacitance __ C1 C2 C3 210393-19 5 pF (STRAY 5 pF) (CRYSTAL + STRAY) 8 pF 20-30 pF INCLUDING STRAY Crystal Series Resistance Should be Less Than 30n at 12 MHz; Less Than 7Sn at 6 MHz; Less Than lBon at 3.6 MHz. inter UPI-42 WAVEFORMS READ OPERATION-DATA BUS BUFFER REGISTER ts OR AO ~ )( (SYSTEM'S ADDRESS BUSt -lA~- -110111.- 'RR \ RD V mEAD CONTROL: --'Of -'RO-'A() 210393-20 WRITE OPERATION-DATA BUS BUFFER REGISTER ~ORAO ==xt_ _ _ _~ ~ r_,.. _~~-_~,w_w- (SYSTEM'S ~------------------ ADDRESS OUSt ___ - (WA ITE CONTROL I WR DATA BUS DATA (INPUT! MAYCHANQ( 'V V DATA 1'--OATAVAlIO_~ ----------------~ MAY CHANGE ~-------------------- 210393-21 CLOCK TIMING 2.4V XTAL2 1.6V .45V tCYC 210393-22 6-794 UPI-42 WAVEFORMS (Continued) COMBINATION PROGRAM/VERIFY MODE I PROGRAt.4 I---- VEAH (12V) EA V1H (5V} V1L(OV) TO V1H (5V) V1L(OV) RESET DB o-DB 7 P20·P22 V1H1 (5V) V1L1 (OV) V'H(5V) V1L{OV) - P ---, - VERIFY END OF' PROG 0'" 00 vERIFY \. - - tTW - tWT ~ \. I--tAW- I--tw~. X ADDRESS V1H (5V) -- DATA IN -r- too T X ADDRESS - to'l- I VIL(OV) tDW - NEXT ADDRESS tad \... tpw - V,"(5V) " XOATA OUT}-{ NEXT ADDRESS V1L(OV) VOOH (12.5 V) ---I-- PRDGRAI.! t... ~_ J--- Voo VODL(5V) PROG to, ~ I--tWD 210393-23 NOTES: 1. Ao must be held low (OV) during program/verify modes. 2. For VIH. VIH1. Vil. Vll1. VOOH. and VOOl. please consult the D.C. Characteristics Table. 3. When programming the 8742AH. a 0.1 /-IF capacitor is required across VOO and ground to suppress spurious voltage transients which can damage the device. VERIFY MODE 12.5V EA 5V OV 12.5V vaa 5V RESET --------1' I _____---JJ 5V OV \,-_~J \ ----ADDRESS P20- P22 5V OV X DATA OUT NEXT ADDRESS X DATA OUT ________________-JX~______A_DD_R_ES_S_____JX~_____N_EX_T_A_D_D_RE_S_5________ 210393-24 NOTES: 1. PROG must float if EA is low. 2. PROG must always float for 8042. 3. TO must be held high (5V). 4. PlO-P17 = 5V or must float. 5. P24-P27 = 5V or must float. 6. Ao must be held low during programming/verify modes. 6-795 inter UPI-42 WAVEFORMS (Continued) DMA '\ - 'ACC - '---'CAC - - DATA BUS 'ACC - -'CAC - VALID VALID -'ACD- Jl ORO - 'CR ~- 210393-25 PORT 2 SYNC EXPANDER PORT OUTPUT PORT 20_3 DATA EXPANDER PORT peRT 20_3 OATA INPUT PROG 210393-26 PORT TIMI~G SYNC P 1O•17 P2Q.22 DURING EA / PORT DATA / \ X X PC PORT DATA \ X PC 210393-27 On the Rising Edge of SYNC and EA is Enabled, Port Data is Valid and can be Strobed on the Trailing Edge of Sync the Program Counter Contents are Available. 6-796 intJ UPI·42 Table 2. UPITM Instruction Set Mnemonic Description ACCUMULATOR ADDA, Rr Add register to A ADDA,@Rr Add data memory toA ADD A, #data Add immediate to A ADDCA, Rr Add register to A with carry ADDCA,@Rr Add data memory to A with carry ADDC A, #data Add immediate to A with carry ANLA, Rr AND register to A ANL,A@Rr AND data memory toA ANLA, #data AND immediate to A ORLA, Rr OR register to A ORL,A, @Rr OR data memory toA ORLA, #data OR immediate to A XRLA, Rr Exclusive OR registertoA XRLA,@Rr Exclusive OR data memory to A XRLA, #data Exclusive OR imme-. diatetoA INCA IncrementA DECA Decrement A CLRA Clear A CPLA Complement A DAA Decimal Adjust A SWAP A Swap nibbles of A RLA Rotate A left RLCA Rotate A left through carry RRA Rotate A right RRCA Rotate A right through carry INPUT/OUTPUT INA, Pp Input port to A OUTLPp, A Output A to port ANL Pp, #data AND immediate to port ORL Pp, #data OR immediate to port INA, DBB Input DBB to A, clear IBF OUTDBB,A Output A to DBB, setOBF MOVSTS,A A4-A7 to Bits 4-7 of Status MOVDA, Pp Input Expander port to A MOVDPp,A Output A to Expander port ANLD Pp,A AND A to Expander port ORLD Pp, A OR A to Expander port Bytes Cycles Mnemonic 1 1 1 1 DATA MOVES MOVA, Rr MOVA,@Rr 2 1 2 1 1 1 2 2 1 1 1 1 2 1 1 2 1 1 2 1 2 1 1 1 2 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 MOVA, #data MOVRr,A MOV@Rr,A MOV Rr, #data MOV@Rr, # data MOVA,PSW MOVPSW,A XCHA,Rr XCHA,@Rr XCHDA,@Rr MOVPA, @A MOVP3,A,@A 1 1 2 2 2 2 2 2 1 1 1 1 1 1 1 2 1 2 1 2 1 2 Description Bytes Cycles Move register to A Move data memory toA Move immediate to A Move A to register Move A to data memory Move immediate to register Move immediate to data memory MovePSWtoA MoveAtoPSW Exchange A and register Exchange A and data memory Exchange digit of A and register Move to A from current page Move to A from page 3 1 1 1 1 2 1 1 2 1 1 2 2 2 2 1 1 1 TIMER/COUNTER MOVA, T Read Timer/Counter MOVT,A Load Timer/Counter STRTT Start Timer STRTCNT Start Counter STOP TCNT Stop Timer/Counter EN TCNTI Enable Timer/ Counter Interrupt DIS TCNTI Disable Timer/ Counter Interrupt CONTROL ENDMA ENI DISI EN FLAGS SELRBO SELRB1 NOP REGISTERS INCRr INC@Rr DECRr 6-797 Enable DMA Handshake Lines Enable IBF Interrupt Diable IBF Interrupt Enable Master Interrupts Select register bank 0 Select register bank 1 No Operation Increment register Increment data memory Decrement register 1 1 1 1 1 1 1 1 2 1 2 1 1 1 1 1 1 1 1 1 r 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 inter Table 2. UPITM Instruction Set (Continued) Mnemonic 'Description Bytes Cycles 2 1 1 2 2 2 Clear Carry Complement Carry Clear Flag 0 Complement Flag 0 Clear F1 Flag Complement F1 Flag 1 1 1 1 1 1 1 1 1 1 1 1 Jump unconditional Jump indirect Decrement register and jump Jump on Carry = 1 Jump on Carry = 0 Jump on A Zero Jump on A not Zero Jump on TO = 1 Jump on TO = 0 JumponT1 = 1 JumponT1 = 0 Jump on FO Flag = 1 Jump on F1 Flag = 1 Jump on Timer Flag = 1, Clear Flag Jump on IBF Flag =0 Jump on OBF Flag = 1 Jump on Accumulafor Bit 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 SUBROUTINE 'CALLaddr Jump to subroutine RET Return RETR Return and restore status FLAGS CLRC CPLC CLRFO CPLFO CLRF1 CPLF1 BRANCH JMPaddr JMPP@A DJNZ Rr, addr JCaddr JNCaddr JZaddr JNZaddr JTO addr JNTO addr JT1 addr JNT1 addr JFO addr JF1 addr JTFaddr JNIBFaddr JOBF addr JBb addr 6-798 8243 MCS-48® INPUT/OUTPUT EXPANDER • • • • Low Cost Simple Interface to MCS-48® Microcomputers Four 4-Bit 1/0 Ports AND and OR Directly to Ports • • • • 24-Pin DIP Single 5V Supply High Output Drive Direct Extension of Resident 8048 1/0 Ports The Intel® 8243 is an input/output expander designed specifically to provide a low cost means of I/O expansion for the MCS-48® family of single chip microcomputers. Fabricated in 5 volts NMOS, the 8243 combines low cost, single supply voltage and high drive current capability. The 8243 consists of four 4-bit bidirectional static I/O ports and one 4-bit port which serves as an interface to the MCS-48 microcomputers. The 4-bit interface requires that only 4 I/O lines of the 8048 be used for I/O expansion, and also allows multiple 8243's to be added to the same bus. The I/O ports of the 8243 serve as a direct extension of the resident I/O facilities of the MCS-48 microcomputers and are accessed by their own MOV, ANL, and ORL instructions. PORT 4 PORT 5 PORT 2 PORT 6 ""~B PSO vee P41l PSl "'1 PS2 P42 PS3 P43 P60 cs P61 PROG P62 P23 P63 P22 P73 P21 P72 P20 P71 GND P70 POAT 7 Figure 2. 8243 Pin Configuration Figure 1. 8243 Block Diagram Intel Corporallon Assumes No ResponslblllY lor the Use of Any Clfcultry Other Than INTEL CORPORATION, 1980 Clrcultr~ 6-799 Embodied In dn Inll!1 Product No Other Clfcud Patell! Licenses are Implied 231317-001 intJ 8243 Table 1. Pin Description Symbol Pin No. PROG 7 Clock Input. A hig'h to low transition on PROG signifies that address and control are available on P20-P23, and a low to high transition signifies that data is available on P20-P23. CS 6 Chip Select Input. A high on CS inhibits any change of'output or intern al status. P20-P23 GND P40-P43 P50-P53 P60-P63 P70-P73 VCC 11-8 Power On Initialization Initial application of power to the device forces input/output ports 4, 5, 6, and 7 to the tri-state and port 2 to the input mode. The PROG pin may be either high or low when power is applied. The first high to low transition of PROG causes device to exit power on mode. The power on sequence is initiated if vee drops below lV. Function P21 P20 Four (4) bit bi-directional port contains the address and control bits on a high to' low transition of PROG. During a low to high transition contai ns the data for a selected output port if a write operation, or the data from a selected port before the low to high transition if a read operation. 0 0 1 0 1 0 1 Port Port Port Port 4 5 6 7 P23 P22 0 0 1 0 1 0 Instruction Code Read Write ORlD ANlD Write Modes o volt supply, 12 2-5 Four (4) bit bi-directionall/O ports. 1,23-21 May be programmed to be input 20-17 (during read), low impedance 13-16 latched output (after write), or a tristate (after read). Data on pins P20-P23 may be directly written, ANDed or ORed with previous data. 24 Address Code The device has three write modes. MOVD Pi, A directly writes new data into the selected port and old data is lost. ORlD Pi, A takes new data, OR's it with the old data and then writes it to the port. ANlD Pi, A takes new data, AND's it with the old data and then writes it to the port: Operation code and port address are latched from the input port 2 on the high to low transition ofthe PROG pin. On the lowto high transition of PROG data on port 2 is transferred to the logic block of the specified output port. After the logic manipulation is performed, the data is latched and outputed. The old data remains. latched until new valid outputs are entered. +5 volt supply. , FUNCTIONAL DESCRIPTION General Operation The 8243 contains four 4-bit I/O ports which serve as an extension of the on-chip I/O and are addressed as ports 4-7. The following operations may be performed on these ports: Read Mode All communication between the 8048 and the 8243 occurs over Port 2 (P20-P23) with timing provided by an output pulse on the PROG pin of the processor. Each transfer consists of two 4-bit nibbles: The device has one read mode. The operation code and port address are latched from the input port2 on the high to low transition of the PROG pin. As soon as the read operation and port address are decoded, the appropriate outputs are tri-stated, and the input buffers switched on. The read operation is terminated by a low to high transition of the PROG pin. The port (4, 5, 6 or 7) that was selected is switched to the tri-stated mode while port 2 is returned to the input mode. The first containing the "op code" and port address and the second containing the actual 4-bits of data. A high to low transition of the PROG line indicates that address is present while a low to high transition indicates the presence of data. Additional 8243's may be added to the 4-bit bus and chip selected using additional output lines from the 8048/8748/ 8035. Normally, a port will be in an output (write mode) or input (read mode). If .modes are changed during operation, the first read following a write should be ignored: all following reads are valid. This is to allow the external driver on the port to settle after the first read instruction removes the low impedance drive from the 8243 output. A read of any port will leave that port in a high impedance state. • • • • Transfer Accumulator to Port. Transfer Port to Accumulator. AND Accumulator to Port. OR Accumulator to Port. 6-800 231317-001 8243 ABSOLUTE MAXIMUM RATINGS· 'NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Ambient Temperature Under Bias. . . . . . .. 0' C to 70' C Storage Temperature ............... -65'C to +150'C Voltage on Any Pin With Respect to Ground .............. -0.5 V to +7V Power Dissipation ............................ 1 Watt D,C. CHARACTERISTICS Symbol TA = O'C to 70'C, VCC = 5V Parameter Min 10% Typ Max Units VIL Input Low Voltage -0.5 0.8 V VIH Input High Voltage 2.0 VCC+0.5 V VOLI Output Low Voltage Ports 4-7 0.45 V VOL2 Output Low Voltage Port 7 1 V VOHI Output High Voltage Ports 4-7 2.4 IILI Input Leakage Ports 4-7 -10 20 ",A -10 10 ",A IIL2 Input Leakage Port 2, CS, PROG VOL3 Output Low Voltage Port 2 ICC VCC Supply Current VOH2 Output Voltage Port 2 IOL Sum of alllOL from 16 Outputs V 10 .45 V 20 mA 72 mA 2.4 Test Conditions = 4.5 mA' =20 mA IOH = 240",A Vin = VCC to OV Vin = VCC to OV IOL = 0.6 mA IOL IOL IOH = 100",A 4.5 mA Each Pin 'See following graph for additional sink current capability A,C. CHARACTERISTICS Symbol TA = O'C to 70'C, VCC = 5V Min Parameter 10% Max Units Test Conditions 100 ns Code Valid After PROG 60 ns 20 pF Load Data Valid Before PROG 200 ns 80 pF Load ns 20 pF Load ns 20 pF Load tA Code Valid Before PROG tB tc to Data Valid After PROG tH Floating After PROG tK PROG Negative Pulse Width 700 50 20 0 tcs CS Valid BeforelAfter PROG tpo Ports 4-7 Valid After PROG tLPl Ports 4-7 Valid BeforelAfter PROG tACC Port 2 Valid After PROG '.4 150 ns ns 700 100 0'.'.0 ns 100 pF Load ns 650 ----'X > 80 pF Load ns 80 pF Load TEST POINTS 0.45---....J 6-801 231317-001 intel· 8243 WAVEFORMS PROG ~ PORT2 _________________ 'K ________________ ~ FLOAT FLOAT PORT2 IpO PORTS 4-7 OUTPUT VALID PREVIOUS OUTPUT VALID I,p PORTS 4-7 INPUTYALID 'CS 'CS 6-802 231317-001 8243 125 .. , ;( g ~ Q ".... ffi a: 75 a: GUARANTEED WORST CASE ::> 0 "z iii 5. OF ANY 110 PORT PIN vs. TOTAL SINK CURRENT OF ALL PINS ~ ;! ....0 25 ,. 11 12 13 MAXIMUM SINK CURRENT ON ANY PIN@ .4SV MAXIMUM tOl WORST CASE PIN (mA) Figure 3 Example: This example shows how the use of the 20 rnA sink capability of Port 7 affects the sinking capability of the other I/O lines. Sink Capability The 8243 can si nk 5 mA @ .45V on each of its 16 1/0 lines simultaneously. If, however, all lines are not sinking simultaneously or all lines are not fully loaded, the drive capability of any individual line increases as is shown by the accompanying curve. An 8243 will drive the following loads simultaneously. For example, if only 5 of the 16 lines are to sink current at one time, the curve shows that each of those 5 lines is capable of sinking 9 mA @ .45V (if any lines are to sink 9 mA the total 10l must not exceed 45 mA or five 9 mA loads). 2 loads-20 rnA @ 1V (port 7 only) 8 loads-4 rnA @ .45V 6 loads-3.2 rnA @ .45V Is this within the specified limits? Example: How many pins can drive 5 TTL loads (1.6 rnA) assuming remaining pins are unloaded? ,IOl = (2 x 20) + (8 x 4) + (6 x 3.2) = 91.2 rnA. From the curve: for 10l = 4 rnA, ,IOl = 93 rnA. since 91.2 rnA < 93 rnA the loads are within specified limits. 10l =5 x 1.6 rnA =8 rnA ,IOl = 60 rnA from curve # pins = 60 rnA.;. 8 rnA/pin = 7.5 = 7 Although the 20 rnA @ 1V loads are used in calculating ,IOl, it is the largest current required @ .45V which determines the maximum allowable dOL. In this case, 7 lines can sink 8 rnA for a total of 56mA. This leaves 4 mA sink current capability which can be divided in any way among the remaining 8 I/O lines of the 8243. NOTE: A10 to 50KO pullup resistor to +5V should be added to 8243 outputs when driving to 5V CMOS directly. 6-803 231317-001 intel' 8243 -=CS I/O PROG .4 I/O '5 I/O P6 I/O '7 I/O PROG TEST INPUTS 8048 8243 DATA IN .2 Figure 4, Expander Interface PROG '20·'23 ~\1.-._ _ _- '/ --{'-_---'X'-_____)>--ADDRESS (4·BITS) BITS 1,0 BITS 3,2 ~!1 ~~~~E 11 ! AND 001 "" PORT ADDRESS 11.J DATA (4·BITS) Figure 5. Output Expander Timing PORT 1 8048 .AOG~--------------~----------------~------------~--~-----------------J Figure 6. Using Multiple 8243'5 6-804 231317-001 intJ MICROPROCESSOR PERIPHERALS UPFM USER'S MANUAL APRIL 1982 6-805 ORDER NUMBER: 231318-001 CHAPTER 1 INTRODUCTION Accompanying the introduction of microprocessors such as the 8080, 8085, 8088, and 8086 there has been a rapid proliferation of intelligent peripheral devices. These ,l'pecial purpose peripherals extend CPU performance and flexibility in a number of important wa:vs. Table 1-1. Intelligent Peripheral Devices 8255 (GPIO) 8253 (TIMER) Programmable Peripheral Interface Programmable Communication Interface Programmable Interval Timer 8257 (DMA) Programmable DMA Controller 8259 Programmable Interrupt Controller 8271 (SDFDC), 8272 (DDFDC) Programmable Floppy Disk Controllers 8273 (SDLC) Programmable Synchronous Data Link Controller 8274 Programmable MultiprotocolSerial Communications Controller Programmable CRT Controllers Programmable Keyboard/Display Controller 8251A (DSART) 8275/8276 (CRT) 8279 (PKD) 8291A, 8292, 8293 designed for communication disciplines, parallel I/O, keyboard encoding, interval timing, CRT control, etc. Yet, in spite of the large number of devices available and the increased flexibility built into these chips, there is still a large number of microcomputer peripheral control tasks which are not satisfied. With the introduction of the Universal Peripheral Interface (UP!) microcomputer, Intel has taken the intelligent peripheral concept a step further by providing an intelligent controller that is fully user programmable. It is a complete single-chip microcomputer which can connect directly to a master processor data bus. It has the same advantages of intelligence and flexibility which previous peripheral chips offered. In addition, the UPI is userprogrammable: it has 1K bytes of ROM or EPROM memory for program storage plus 64 bytes of RAM memory for data storage or initialization from the master processor. The UPI device allows a designer to fully specify his control algorithm in the peripheral chip without relying on the master processor. Devices like printer controllers and keyboard scanners can be completely self-contained, relying on the master processor only for data transfer. The UPI family currently consists of five components: Programmable GPIB System Talker, Listener, Controller Intelligent devices like the 8272 floppy disk controller and 8273 synchronous data link controller (see Table 1-1) can preprocess serial data and perform control tasks which off-load the main system processor. Higher overall system throughput is achieved and software complexity is greatly reduced. The intelligent peripheral chips simplify master processor control tasks by performing many functions externally in peripheral hardware rather than internally in main processor software. Intelligent peripherals also provide system flexibility. They contain on-chip mode registers which are programmed by the master processor during system initialization. These control registers allow the peripheral to be configured into many different operation modes. The user-defined program for the peripheral is stored in main system memory and is transferred to the peripheral's registers whenever a mode change is required. Of course, this type of flexibility requires software overhead in the master system which tends to limit the benefit derived from the peripheral chip. • • • • • 8741A microcomputer with 1K EPROM memory 8041AH micr~computer with 1K ROM memory 8042 microcomputer with 2K ROM memory 8243 I/O expander device 8742 microcomputer with 2K EPROM memory The 8741A, 8041AH, 8742 and 8042 single chip microcomputers are functionally equivalent except for the type and amount of program memory available with each. These devices have the following main features: • • • • • • • • In the past, intelligent peripherals were designed to handle very specialized tasks. Separate chips were 6-806 8-bit CPU 8-bit data bus interface registers 1K by 8 bit ROM or EPROM memory (2K for 8042/8742) 64 by 8 bit RAM memory (128 bytes for 8042/8742) Interval timer/event counter Two 8-bit TTL compatible I/O ports Resident clock oscillator 12 MHZ operation, 1.25 f.Lsec instruction cycle for 8041AH, 8742, 8042 INTRODUCTION HOST PROCESSOR KEYBOARD OAT A ~ PRINTER CONTROL BUS BUS \ ADDRESS BUS Figure 1-1. Inter1acing Peripherals To Microcomputer Systems HMOS processing has been applied to the UPI fam· ily to allow for additional performance and memory capability while reducing costs. The 8041AH, 8741A, 8042,8742 are all pin and software compatible. This allows growth in present designs to incorporate new features and add additional performance. For new designs, the additional memory and performance of the 8042/8742 extends the UPI 'grow your own solution' concept to more complex motor control tasks, 80·column printers and process control applications as examples. at any time. An interrupt to the UPI processor is automatically generated (if enabled) when DBBIN is loaded. Because the UPI contains a complete microcomputer with program memory, data memory, and CPU it can function as a "Universal" controller. A designer can program the UPI to control printers, tape transports, or multiple serial communication channels. The UPI can also handle off· line arithmetic processing, or any number of other low speed con· trol tasks. The 8243 device is an I/O multiplexer which allows expansion of I/O to over 100 lines (if seven devices are used). All three parts are fabricated with Nchannel MOS technology and require a single, 5V supply for operation. INTERFACE REGISTERS FOR MULTIPROCESSOR CONFIGURATIONS In the normal configuration, the 8041AH/8741A, 8042/8742 interfaces to the system bus, just like any intelligent peripheral device (see Figure 1-1). The host processor and the 8041AH/8741A, 8042/8742 form a loosely coupled multi· processor system, that is, communications between the two processors are direct. Common resources are three addressable reg· isters located physically on the 8041AH/8741A, 8042/8742. These registers are the Data Bus Buffer Input (DBBIN), Data Bus Buffer Output (DBBOUT), and Status (STATUS) registers. The host processor may read data from DBBOUT or write commands and data into DBBIN. The status of DBBOUT and DBBIN plus user· defined status is supplied in STATUS. The host may read STATUS a041AH, 8042 MASK PROGRAMMED 'ROM 8741A,8742 ELECTRICALLY PROGRAMMABLE LIGHT ERASABLE EPROM Figure 1-2. Pin Compatible ROM/EPROM Versions 6-807 INTRODUCTION POWERFUL 8-BIT PROCESSOR The UPI contains a powerful, 8-bit CPU with as fast as 1.25 ILsec cycle time and two single-level interrupts. Its instruction set includes over 90 instructions for easy software development. Most instructions are single byte and single cycle and none are more than two bytes long. The instruction set is optimized for bit manipulation and I/O operations. Special instructions are included to allow binary or BCD arithmetic operations, table lookup routines, loop counters, and N -way branch routines. Features for Peripheral Control The UPI 8-bit interval timer/event counter can be used to generate complex timing sequences for control applications or it can count external events such as switch closures and position encoder pulses. Software timing loops can be simplified or eliminated by the interval timer. If enabled, an interrupt to the CPU will occur when the timer overflows. The UPI I/O complement contains two TTL-compatible 8-bit bidirectional I/O ports and two generalpurpose test inputs. Each of the 16 port lines can individually function as either input or output under software control. Four of the port lines can also function as an interface for the 8243 I/O expander which provides four additional 4- bit ports that are directly addressable by UPI software. The 8243 expander allows low cost I/O expansion for large control applications while maintaining easy and efficient software port addressing. SPECIAL INSTRUCTION SET FEATURES • For Loop Counters: Decrement Register and Jump if not zero. • For Bit Manipulation: AND to A (immediate data or Register) OR to A (immediate data or Register) XOR to A (immediate data or Register) AND to Output Ports (Accumulator) OR to Output Ports (Accumulator) Jump Conditionally on any bit in A • • P~3 1/'-----''-1 8243 16 I/O LINES P20 8041AH/8741A, 8042/8742 For BDC Arithmetic: Decimal Adjust A Swap 4-bit Nibbles of A Exchange lower nibbles of A and Register Rotate A left or right with or without Carry For Lo()kup Tables: Load A from Page of ROM (Address in A) Load A from Current Page of ROM (Address in A) . PROG 1--------' 12 I/O LINES Figure 1-4. 8243110 Expander Interface PERIPHERAL CONTROL OFF-LINE ARITHMETIC PROCESSING 1*---- ~~~~~NICATION Figure 1-3. Interface8 And Protocol8 For Multlproce88or SY8tem8 6-808 INTRODUCTION On-Chip Memory The UPI's 64 (128) bytes of data memory include dual working register banks and an 8-level program counter stack. Switching between the register banks allows fast response to interrupts. The stack is used to store return addresses and processor status upon entering a subroutine. The UPI program memory is available in two types to allow flexibility in moving from design to prototype to production with the same PC layout. The 8741A, 8742 device with EPROM memory is very economical for initial system design and development. Its program memory can be electrically programmed using the Intel Universal PROM Programmer. When changes are needed, the entire program can be erased using UV lamp and reprogrammed in about 20 minutes. This means the 8741A/8742 can be used as a single chip "breadboard" for very complex interface and control problems. After the 8741A/8742 is programmed it can be tested in the actual production level PC board and the actual functional environment. Changes required during system debugging can be made in the 8741A/8742 program much more easily than they could be made in a random logic design. The system configuration and pC layout can remain fixed during the development process and the turn around time between changes can be reduced to a minimum. At any point during the development cycle, the 8741A!8742 EPROM part can be replaced with the low cost 8041AH, 8042 respectively with factory mask programmed memory. The transition from system development to mass production is made smoothly because the 8741A and 8041AH, 8742 and 8042 parts are completely pin compatible. 8742s or 6-809 8042s can be used in an 8041AH/8741 socket. This feature allows extensive testing with the EPROM part, even into initial shipments to customers. Yet, the transition to low-cost ROM is simplified to the point of being merely a package substitution. PREPROGRAMMED UPI's The 8292, 8294, and 8295 are 8041A's that are programmed by Intel and sold as standard peripherals. The 8292 is a GPIB controller, part of a three chip GPIB system. The 8294 is a Data Encryption Unit that implements the National Bureau of Standards data encryption algorithm. The 8295 is a dot matrix printer controller designed especially for the LRC 7040 series dot matrix impact printers. These parts illustrate the great flexibility offered by the UPI family. DEVELOPMENT SUPPORT The UPI microcomputer is fully supported by Intel with development tools like the UPP PROM programmer already mentioned. An ICE-41A in-circuit emulator is also available to allow UPI software and hardware to be developed easily and quickly. The combination of device features and Intel development support make the UPI an ideal component for low-speed peripheral control applications. UPI DEVELOPMENT SUPPORT • • • • • • • 8048/8041AH/8042 Assembler Universal PROM Programmer UPP Series ICE-41A Module MULTI-ICE Insite User's Library Application Engineers Training Courses CHAPTER 2 FUNCTIONAL DESCRIPTION The UPI-41AH, 42 microcomputer is an intelligent peripheral controller designed to operate in iAPX86, 88, MCS-85, MCS-80, MCS-51 and MCS-48 systems. The UPt'S architecture, illustrated in Figure 2-1, is based on a low cost, single-chip microcomputer with program memory, data memory, CPU, I/O, event timer and clock oscillator in a single 40pin package. Special interface registers are included which enable the UPI to function as a peripheral to an 8-bit master processor. This chapter provides a basic description of the UPI microcomputer and its system interface registers. Unless otherwise noted the descriptions in this sec- I CLOCK J 1 a-BIT CPU tion apply to both the 8741A, 8742 (with UV erasable program memory) and the 8041AH, 8042 (with factory mask programmed memory). These two devices are so similar that they can be considered identical under most circumstances. All functions described in this chapter apply to the 8041AH, 8042, and 8741A, 8742. PIN DESCRIPTION The 8041AH/8741A, 8042/8742 are packaged in 40pin Dual In-Line (DIP) packages. The pin configuration for both devices is shown in Figure 2-2. Figure 2-3 illustrates the UPI Logic Symbol. I 1024 X a, 2048 PROGRAM MEMORY x8 64 X a, 128 x8 DATA MEMORY a-BIT TIMER/COUNTER (ROM/EPROM) I I a·BIT DATA BUS INPUT REGISTER II II J I II II 8-BIT DATA BUS OUTPUT REGISTER 8·BIT STATUS REGISTER II 18 1/0 LINES II PERIPHERAL INTERFACE SYSTEM INTERFACE AND 1/0 EXPANSION Figure 2-1. UPI-41AH, 42 Single Chip Microcomputer 6-810 FUNCTIONAL DESCRIPTION TEST 0 Vee XTAL1 TEST 1 XTAL2 P27 / DACK ReSET P26 /DR Q 55 P2S /mF Cs P24 / 08F EA P17 AD P'6 AO P,s WR PROGRAM PllOU +SV GNO,....1-, PORT #1 PORT #2 P" SYNC P'3 DO P'2 0, P" 02 P,o 03 Voo 0, PROG Os P23 06 .22 07 P2' V55 P20 { DATA BUS SUFFER INTERFACE CONTROL INTERFACE ~~ WRITE CONTROLI DATA CHIP SELECT Figure 2-2. Pin Configuration Figure 2-3. Logic Symbol The following section summarizes the functions of each UPI-41A pin. NOTE that several pins have two or more functions which are described in separate paragraphs. Table 2-1. Pin Description Symbol Pin No. Type DO-D7 (BUS) 12-19 I/O PlO-P I7 P20-P 27 27-34 21-24 35-38 I/O I/O WR 10 I RD 8 I CS 6 I AO 9 I TEST 0, TESTl I 39 I Name and Function Data,Bus: Three-state, bidirectional DATA BUS BUFFER lines used to interface the UPI-41AH, 42 microcomputer to an 8-bit master system data bus. Port 1: 8-bit, PORT 1 quasi-bidirectionalI/O lines. Port 2: 8-bit, PORT 2 quasi-bidirectional I/O lines. The lower 4 bits (P20-P23) interface directly to the 8243 1/0 expander device and contain address and data information during PORT 4-7 access. The upper 4 bits (P24-P27) can be programmed to provide interrupt Request and D,MA Handshake capability. Software control can configure P24 as Output Buffer Full (OBF) interrupt, P25 as Input Buffer Full (lBF) interrupt, P26 as DMA Request (DRQ), and P27 as DMA ACKnowledge (DACK). Write: I/O write input which enables the master CPU to write data and command words to the UPI-4IA INPUT DATA BUS BUFFER. Read: 1/0 read input which enables the master CPU to read data and status words from the OUTPUT DATA BUS BUFFER or status register. Chip Select: Chip select input used to select one UPI-4IAH, 42 microcomputer out of several connected to a common data bus. Command/Data Select: Address input used by the master processor to indicate whether byte transfer is data (AO=O) or command (AO=I). Test Inputs: Input pins which can be directly tested using conditional branch instructions. Frequency Reference: TEST 1 (TI) also functions as the event timer input (under software control). TEST 0 (TO) Is used during PROM programming and verification in the 874lA, 8742. 6-811 FUNCTIONAL DESCRIPTION Tabla 2·1. Pin Description (Continued) Symbol Nama and Function Pin No. Type XTALl, XTAL2 SYNC 2 3 I 11 0 EA 7 I PROG 25 I/O RESET 4 I SS 5 I VCC VDD 40 26 VSS 20 Inputs: Inputs for a crystal, LC or an external timing signal to determine the internal oscillator frequency. Output Clock: Output signal which occurs once per UPI-41A instruction cycle. SYNC can be used as a strobe for external circuitry; it is also used to synchronize single step operation. External Access: External access input which allows emulation, testing and PROM/ ROM verification. ...-Program: Multifunction pin used as the program pulse input during PROM programming. During I/O expander access the PROG pin acts as an address/data strobe to the 8243. Reset: Input used to reset status flip-flops and to set the program counter to zero. RESET is also used during PROM programming and verification. Single Step: Single step input used in conjunction with the SYNC output to step the program through each instruction. Power: +5V main power supply pin. Power: +5V during normal operation. +25V during programming operation, +21 \' for programming 8742. Low power standby pin in ROM version. Ground: Circuit ground potential. The following sections provide a detailed functional description of the UPI microcomputer. Figure 2-4 il- lustJ;ates the functional blocks within the UPI device. v. ""'" D, ""- PIO- ." Dm ...-, " ...... ",.... --, RESIDENT MI',nlle ...,.. ....,.. . ...."" ---......... iii . cs .- -..... "'*' 0/. ""'" is PORT,,·, .'.:rt{ l!' ~~r 11( ~~. {::: ,oo _ _ _ _ ......, { ...... ".-"" 'CC--_-+5SUWt.Y ' s s - -_ _ Figura 2-4. UP1-41AH, 42'" Block Diagram 6-812 Poo- P" FUNCTIONAL DESCRIPTION storage. Each of these memory locations is directly addressable by a 10-bit program counter. Depending on the type of application and the number of program changes anticipated, two types of program memory are available: CPU SECTION The CPU section of the UPI-41AH, 42 microcomputer performs basic data manipulations and controls data flow throughout the single chip computer via the internal 8-bit data bus. The CPU section includes the following functional blocks shown in Figure 2-4: • Arithmetic Logic Unit (ALU) • Instruction Decoder .' Accumulator • Flags • • The 8041AH and 8741A, 8042 and 8742 are functionally identical parts and are completely pin compatible. The 8742 and 8042 can be used in 8041AH, 8741A sockets. The 8041AH, 8042 has ROM memory which is mask programmed to user specification during fabrication. The 8741A/8742 are electrically programmed by the user using the Universal PROM Programmer (UPP series) with a UPP-848 or UPP549 Personality Card. It can be erased using ultraviolet light and reprogrammed at any time. Arithmetic Logic Units (ALU) The ALU is capable of performing the following operations: • • • • • • • 8041AH, 8042 with mask programmed ROM Memory 8741A, 8742 with electrically programmable EPROM Memory ADD with or without carry AND, OR, and EXCLUSIVE OR Increment, Decrement Bit complement Rotate left or right Swap BCD decimal adjust A program memory map is illustrated in Figure 2-5. Memory is divided into 256 location 'pages' and three locations are reserved for special use: In a typical operation data from the accumulator is combined in the ALU with data from some other source on the UPI-41AH, 42 internal bus (such as a register or an I/O port). The result of an ALU operation can be transferred to the internal bus or back to the accumulator. 2047 PAGE 7 { PAGE 6 { 1792 179 1 1536 1535 PAGE 5 { If an operation such as an ADD or ROTATE re- 1280 1279 quires more than 8 bits, the CARRY flag is used as an indicator. Likewise, during decimal adjust and other BCD operations the AUXILIARY CARRY flag can be set and acted upon. These flags are part of the Program Status Word (PSW). PAGE 4 { 8042 8742 1024 1023 PAGE 3 + B041AH, { 8741A 768 767 PAGE 2 { 512 511 PAGE 1 Instruction Decoder During an instruction fetch, the operation code (opcode) portion of each program instruction is stored and decoded by the instruction decoder. The decoder generates outputs used along with various timing signals to control the functions performed in the ALU. Also, the instruction decoder controls' the source and destination of ALU data. { 25. 255 - : PROGRAM MEMORY The UPI-41AH, 42 microcomputer has 1024, 2048 8bit words of resident, read -only memory for program LOCATION 7 - TIMER INTERRUPT VECTORS PROGRAM HERE PAGE 0 Accumulator The accumulator is the single most important register in the processor. It is the primary source of data to the ALU and is often the destination for results as well. Data to and from the I/O ports and memory normally passes through the accumulator. ,.... - LOCATION 3 - 18F ~ INTERRUPT VECTORS PROGRAM HERE LOCATION 0 - 7 6 5 4 3 ADDRESS 2 1 o~ VECTORS RESET PROGRAM HERE PROGRAM MEMORY MAP Figure 2-5. Program Memory Map INTERRUPT VECTORS 1) 6-813 Location 0 Following a RESET input to the processor, the next instruction is automatically fetched from location O. FUNCTIONAL DESCRIPTION 2) 3) Location 3 An interrupt generated by an Input Buffer Full (IBF) condition (when the IBF interrupt is enabled) causes the next instruction to be fetched from location 3. 127 , . . - - - - - - - - - - , 8042 USER RAM 64 X 8 ~;I----------1 Location 7 A timer overflow interrupt (when enabled) will cause the next instruction to be fetched from location 7. USER RAM 32 X 8 ~~ 1----------1 BANK 1 WORKING Following a system RESET, program execution begins at location O. Instructions in program memory are normally executed sequentially. Program control can be transferred out of the main line of code by an input buffer full (IBF) interrupt or a timer interrupt, or when a jump or call instruction is encountered. An IBF interrupt (if enabled) will automatically transfer control to location 3 while a timer interrupt will transfer control to location 7. DATA MEMORY The UPI-41AH, 42 universal peripheral interface has 64, 128 8-bit words of random access data memory. This memory contains two working register banks, an 8-level program counter stack and a scratch pad memory, as shown in Figure 2-6. The amount of scratch pad memory available is variable depending on the number of addresses nested in the stack and the number of working registers being ' used. Addressing Data Memory The first eight locations in RAM are designated as working registers Ro-R7. These locations (or registers) can be addressed directly by specifying a register number in the instruction. Since these locations are easily addressed, they are generally used to store frequently accessed intermediate results. Other locations in data memory are addressed indirectly by using Ro or R I to specify the desired address. Since all RAM locations (including the eight working registers) can be addressed by 6 bits (UPI-4IAH), and! or 7 bits (UPI42), the most significant bit(s) of the address (6 and 7, or 7 only) are ignored. 8X8 WHEN BANK 1 -------'Ro--------- :JTEO 23 a LEVEL STACK OR USER RAM 16 X 8 BANKO WORKING REGISTERS 8X8 All conditional JUMP instructions and the indirect JUMP instruction are limited in range to the current 256-location page (that is,. they alter PC bits 0-7 only). If a conditional JUMP or indirect JUMP begins in location 255 of a page, it must reference a destination on the following page. Program memory can be used to store constants as well as program instructions. The UPI-41AH, 42 instruction set contains an instruction (MOVP3) designed specifically for efficient transfer of look-up table information from page 3 of memory. DIRECTLY ADDRESSABLE -------R1'-------24 I REGISTERS -------~-------- -------M-------- ADDRESSED INDIRECTLY THROUGH R1 OR AO (AO' OR R1') DIRECTLY ADDRESSABLE WHEN BANK 0 IS SELECIEO Figure 2-6. Data Memory Map Working Registers Dual banks of eight working registers are included in the UPI-41AH, 42 data memory. Locations 0-7 make up register bank 0 and locations 24-31 form register bank 1. A RESET signal automatically selects register bank O. When bank 0 is selected, references to Ro-R7 in UPI-4IAH, 42 instructions operate on locations 0-7 in data memory. A "select register bank" instruction is used to select between the banks during program execution. If the instruction SEL RBI (Select Register Bank 1) is executed, then program references to RO-R7 will operate on locations 24-31. As stated previously, registers 0 and 1 in the active register bank are used as indirect address registers for all locations in data memory. Register bank 1 is normally reserved for handling interrupt service routines, thereby preserving the contents of the main program registers. The SEL RBI instruction can be issued at the beginning of an interrupt service routine. Then, upon return to the main program, an RETR (return & restore status) instruction will automatically restore the previously selected bank. During interrupt processing, registers in bank 0 can be accessed indirectly using Ro' and RI'. If register bank 1 is not used, registers 24-31 can still serve as additional scratch pad memory. 6-814 FUNCTIONAL DESCRIPTION Program Counter Stack RAM locations 8-23 are used as an 8-level program counter stack. When program control is temporarily passed from the main program to a subroutine or interrupt service routine, the lO-bit program counter and bits 4-7 of the program status word (PSW) are stored in two stack locations. When control is returned to the main program via an RETR instruction, the program counter and PSW bits 4-7 are restored. Returning via an RET instruction does not restore the PSW bits, however. The program counter stack is addressed by three stack pointer bits in the PSW (bits 0-2). Operation of the program counter stack and the program status word is explained in detail in the following sections. DATA MEMORY LOCATION STACK POINTER 11 1 I 23 I 22 I 21 11 0 10 1 I 20 I 19 I '" I 100 01 1 01 0 The stack allows up to eight levels of subroutine 'nesting'; that is, a subroutine may call a second subroutine, which may call a third, etc., up to eight levels. Unused stack locations can be used as scratch pad memory. Each unused level of subroutine nesting provides two additional RAM locations .for general use. 17 I I 16 I 15 I 14 I 13 I 12 I 11 I 10 00 1 PSW(4-7) I pe{S-g) PCI4-7) I PC(O-3) 000 MS. LSB Figure 2-7. Program Counter Stack The following sections provide a detailed description of the Program Counter Stack and the Program Status Word. A 3-bit Stack Pointer which is part of the Program Status Word (PSW) determines the stack pair to be used at a given time. The stack pointer is initialized by a RESET signal to OOH which corresponds to RAM locations 8 and 9. PROGRAM COUNTER The UPI-41AH, 42 microcomputer has a IO-bit program counter (PC) which can directly address any of the 1024, 2048 locations in program memory. The program counter always contains the address of the next instruction to be executed and is normally incremented sequentially for each instruction to be executed when each instruction fetches occurs. When control is temporarily passed from the main program to a subroutine or an interrupt routine, however, the PC contents must be altered to point to the address of the desired routine. The stack is used to save the current PC contents so that, at the end of the routine, main program execution can continue. The program counter is initialized to zero by a RESET signal. PROGRAM COUNTER STACK The Program Counter Stack is composed of 16 locations in Data Memory as illustrated in Figure 2-7. These RAM locations (8 through 23) are used to store the lO-bit program counter and 4 bits of the program status word. An interrupt or CALL to a subroutine causes the contents of the program counter to be stored in one of the 8 register pairs of the program counter stack. 6-815 The first call or interrupt results in the program counter and PSW contents being transferred to RAM locations 8 and 9 in the format shown in Figure 2-7. The stack pointer is automatically incremented by 1 to point to locations 10 and 11 in anticipation of another CALL. Nesting of subroutines within subroutines can continue up to 8 levels without overflowing the stack. If overflow does occur the deepest address stored (locations 8 and 9) will be overwritten and lost since the stack pointer overflows from07H to OOH. Likewise, the stack pointer will underflow from OOH to 07H. The end of a subroutine is signaled by a return instruction, either RET or RETR. Each instruction will automatically decrement the Stack Pointer and transfer the contents of the proper RAM register pair to the Program Counter. PROGRAM STATUS WORD The 8-bit program status word illustrated in Figure 2-8 is used to store general information about program execution. In addition to the 3-bit Stack FUNCTIONAL DESCRIPTION CY SAVED IN STACK STACK POINTER I I AC FO MSB BS I- S2 S, So I • Bit 6 • Bit 7 LSB Figure 2-8. Program Status Word Pointer discussed previously, the PSW includes the following flags: • CY - Carry • AC - Auxiliary Carry • FO - Flag 0 • BS - Register Bank Select The Program Status Word (PSW) is actually a collection of flip-flops located throughout the machine which are read or written as a whole. The PSW can be loaded to or from the accumulator by the MOV A, PSW or MOV PSW,A instructions. The ability to write directly to the PSW allows easy restoration of machine status after a power-down sequence. The upper 4 bits of the PSW (bits 4, 5, 6, and 7) are stored in the PC Stack with every subroutine CALL or interrupt vector. Restoring the bits on a return is optional. The bits are restored if an RETR instruction is executed, but not if an RET is executed. PSW • • • • mented and tested with conditional jump instructions. It may be used during data transfer to an external processor. Auxiliary Carry (AC) The flag status is determined by an ADD instruction and is used by the Decimal Adjustment instruction DAA. Carry (CY) The flag indicates that a previous operation resulted in overflow of the accumulator. CONDITIONAL BRANCH LOGIC Conditional Branch Logic in the UPI-41AH, 42 allows the status of various processor flags, inputs, and other hardware functions to directly affect program execution. The status is sampled in state 3 of the first cycle. Table 2-2 lists the internal conditions which are testable and indicates the condition which will cause a jump. In all cases, the destination address must be within the page of program memory (256 locations) in which the jump instruction occurs. OSCILLATOR AND TIMING CIRCUITS The 8041A's internal timing generation is controlled by a self-contained oscillator and timing circuit. A choice of crystal, L-C or external clock can be used to derive the basic oscillator frequency. bit definitions are as follows: Bits 0-2 Stack Pointer Bits SO, SI, S2 Bit 3 Not Used Bit 4 Working Register Bank 0= Bank 0 1 = Bank 1 Bit 5 Flag 0 bit (FO) This is a general purpose flag which can be cleared or com ple- The resident timing circuit consists of an oscillator, a state counter and a cycle counter as iJIustrated in Figure 2-9. Figure 2-10 shows instruction cycle timing. Table '2-2. Conditional Branch Instructions Device Accumulator Accumulator bit Carry flag User flag Timer flag Test Input 0 Test Input 1 Input Buffer flag Output Buffer flag Instruction Mnemonic addr JZ JNZ addr addr JBb JC addr addr JNC JFO addr JFl addr JTF addr JTO addr JNTO addr JTl addr JNTl addr JNIBF addr JOBF addr 6-816 Jump Condition Jump if: All bits zero Any bit not zero Bit "b" = 1 Carry flag = 1 Carry flag = 0 FO flag = 1 Fl flag = 1 Timer flag = 1 TO = 1 TO = 0 Tl = 1 Tl = 0 IBF flag = 0 OBF flag = 1 FUNCTIONAL DESCRIPTION 5VNC----------------~~L-----------2.5 psac CYCLE t-"""?'"-i- L 1 SYNC OUTPUT (2.5 psecj Oscillator Configuration Table 2·3. Instruction ANl pp. DATA Felch Instruction Increment Program Counter ORl pp. DATA Felch Increment Program Counter OUTl Pp.A DECODE OUTPUT ADDRESS INC. PC 51 Felch Instruction Felch [nstrucHon 53 1 54 1 5, 55 INPUT INST. EXECUTION OUTPUT ADDRESS I I I Instruction Cycle Timing State Counter The output of the oscillator is divided by 3 in the state counter to generate a signal which defines the state times of the machine. Each instruction cycle consists of five states as illustrated in Figure 2-10 and Table 2-3. The overlap of address and execution operations illustrated in Figure 2-10 allows fast instruction execution. Instruction Timing Diagram 55 51 52 Timer - - Read Port Increment Timer Output To Pori - - Increment Timer Read Port Felch Immediate Data - Increment Timer Read Pori Felch Immediale Oala - Increment Timer - - Read P2 Lower Increment Timer Output Data To P2 Lower - - - 53 I CYCLE 1 52 Increment Program Counter Increment Program Counter IN A.Pp INPUT INST. Figure 2·10. Oscillator The on-board oscillator is a series resonant circuit with a frequency range of 1 to 12 (8041AH-2/ 8042/8742) MHz. Pins XTAL 1 and XTAL 2 are input and output (respectively) of a high gain amplifier stage. A crystal or inductor and capacitor connected between XTAL 1 and XTAL 2 provide the feedback and proper phase shift for oscillation. Recommended connections for crystal or L-C are shown in Figure 2.11. INSTRUCTION 52 I INTERNAL TIMING Figure 2·9. 5, 55 54 Increment MOVD A.Pp Felch Instruction MOVO Pp,A Fetch Instruction Incremenl Output Program Counter Opcode/Address Increment Outpul Program Counter Opcode/Address ANlD Pp.A Fetch Instruction Increment Output Program Counter Opcode/Address Increment Timer Output Oala ORlD Pp.A Felch Instruction Increment Output Program Counter Opcode/Address Increment Timer Output Data - J (Conditional) Felch Instruction Increment Program Counter Sample Condition Increment Timer - Fetch Immediate Dala MOV STS. A Felch Instruction Increment Program Counter - Increment Timer Update Status Register IN A.DBB Fetch Instruction Increment Program Counler - OUT DBB.A Fetch Instruction Increment Program Counter increment Timer Output To Pori 5TRT T 5TRT CNT Felch Instruction Increment Program Counter Fetch Instruction Incremenl Program Counler - Starl Counter STOP TCNT - Increment Timer EN I Felch Instruction Increment Program Counter - Enable Interrupt DIS I Felch tnstruction Increment Program Counler Disable Interrupt EN DMA Felch Instruction Increment Program Counter EN FLAGS Fetch Instruclion Increment Program Counter - - OMA Enabled OAO Cleared OBF.IBF Output Enabled SlOp Counter 6-817 CYCLE 2 53 S4 55 - - Incremcnt Program Counter Output To Pori Output To Port - Increment Program Counler Update Program Counter - FUNCTIONAL DESCRIPTION r 20 pF ~ XTAl1: 8042 8742 B041AH 8741A 8042 8742 XTAL 2 XTAL 2 15·25 pF Figure 2-11. XTAL 1 3 POPF I' B041AH 8741A ± '3 2 Recommended Crystal and L-C Connections Cycle Counter The output of the state counter is divided by 5 in the cycle counter to generate a signal which defines a machine cycle. This signal is call SYNC and is available continously on the SYNC output pin. It can be used to synchronize external circuitry or as a general purpose clock output. It is also used for synchronizing single-step. An external clock signal can also be used as a frequency reference to the 8741AH, 8741A, 8742 or 8042; however, the levels are not TTL' compatible. The signal must be in the 1-12 MHz frequency range and must be connected to pins XTAL 1 and XTAL 2 by buffers with a suitable pull-up resistor to guarantee that a logic "I" is above 3.8 volts. The recommended connection is shown in Figure 2-12. Frequency Reference The external crystal provides high speed and accurate timing generation. A crystal frequency of 5.9904 MHz is useful for generation of standard communication frequencies by the 8041AH/8741, 8042/8742. However, if an accurate "frequency reference and maximum processor speed are not'required, an inductor and capacitor may be used in place of the crystal as shown in Figure 2"11. INTERVAL TIMER/EVENT COUNTER The 8041AH, 8042 has a resident 8-bit timer/ counter which has several software selectable modes of operation. As an interval timer, it can generate accurate delays from 80 microseconds to 20.48 milliseconds without placing undue burden on the processor. In the counter mode, external events such as switch closures or tachometer pulses can be counted and used to direct program flow. A recommended range of inductance and capacitance combinations is given below: • L = 130 /LH corresponds to 3 MHz • L = 45 /LH corresponds to 5 MHz Timer Configuration Figure 2-13 illustrates the basic timer/counter configuration. An 8-bit register is used to count pulses from either the internal clock and prescaler or from an external source. The counter is presettable and readable with two MOV instructions which transfer the cOJ;ltents of the accumulator to the counter and vice-versa (i.e. MOV T, A and MOV A, T). The counter is stopped by a RESET or STOP TCNT instruction and remains stopped until restarted either as a timer (START T instruction) or,asa counter (START CNT instruction). Once started, the counter will increment to its maximum count (FFH) and overflow to zero continuing its count until stopped by a STOP TCNT instruction or RESET. +5V Ie -lD<>-1-----<'---l XTAL 1 B041AH 8741A 8042 8742 '--Oo-+--( XTAL 2 STANDARD TTL OR OPEN COLLECTOR Figure 2-12. The increment from maximum count to zero (overflow) results in setting the Timer Flag (TF) and generating an interrupt request. The state of the overflow flag is testable with the conditional ju,mp Recommended Connection For External Clock Signal 6-818 FUNCTIONAL DESCRIPTION o XTAL 1 PRESCALER XTAL 2 OSCILLATOR Ie- 32) TIMER EXTERNAL INPUT SLTEST' 8-81T COUNTER COUNTER o STOP Figure 2-13. Timer Counter instruction, JTF. The flag is reset by executing a JTF or by a RESET signal. The timer interrupt request is stored in a latch and ORed with the input buffer full interrupt request. The timer interrupt can be enabled or disabled independent of the IBF interrupt by the EN TCNTI and DIS TCTNI instructions. If enabled, the counter overflow will cause a subroutine call to location 7 where the timer service routine is stored. If the timer and Input Buffer Full interrupts occur simultaneously, the IBF source will be recognized and the call will be to location 3. Since the timer interrupt is latched, it will remain pending until the DBBIN register has been serviced and will immediately be recognized upon return from the service routine. A pending timer interrupt is reset by the initiation of a timer interrupt service routine. Event Counter Mode The STRT CNT instruction connects the TEST 1 input pin to the counter input and enables the counter. Note this instruction does not clear the counter. The counter is incremented on high to low transitions of the TEST 1 input. The TEST 1 input must remain high for a minimum of one state in order to be registered (250 ns at 12 MHz). The maximum count frequency is one count per three instruction cycles (267 kHz at 12 MHz). There is no minimum frequency limit. Timer Mode The STRT T instruction connects the internal clock to the counter input and enables the counter. The 6-819 input clock is derived from the SYNC signal of the internal oscillator and the divide·by-32 prescaler. The configuration is illustrated in Figure 2-13. Note this instruction does not clear the timer register. Various delays and timing sequences between 40 J.isec and 10.24 msec can easily be generated with a minimum of software timing loops (at 12 MHz). Times longer than 10.24 msec can be accurately measured by accumulating multiple overflows in a register under software control. For time resolution less than 40 J.isec, an external clock can be applied to the TEST 1 counter input (see Event Counter Mode). The minimum time resolution with an external clock is 3.75 J.isec (267 kHz at 12 MHz). TEST 1 Event Counter Input The TEST 1 pin is multifunctional. It is automatically initialized as a test input by a RESET signal and can be tested using UPI-41A conditional branch instructions. In the second mode of operation, illustrated in Figure 2-13, the TEST 1 pin is used as an input to the internal 8-bit event counter. The Start Counter (STRT CNT) instruction controls an internal switch which connects TEST 1 through an edge detector to the 8-bit internal counter. Note that this instruction does not inhibit the testing of TEST 1 via conditional Jump instructions. In the counter mode the TEST 1 input is sampled once per instruction cycle. After a high level is detected, the next occurence of a low level at TEST 1 FUNCTIONAL DESCRIPTION will cause the counter to increment by one. • Input Buffer Full (IBF) interrupt • Timer Overflow interrupt The IBF interrupt forces a CALL to location 3 in program memory; a timer-overflow interrupt forces a CALL to location 7. The IBF interrupt is enabled by the EN I instruction and disabled by the DIS I instruction. The timer-overflow interrupt is enabled and disabled by the EN TNCTI and DIS TCNTI instructions, respectively. The event counter functions can be stopped by the Stop Timer/Counter (STOP TCNT) instruction. When this instruction is executed the TEST 1 pin becomes a test input and functions as previously described. TEST INPUTS There are two multifunction pins designated as Test Inputs, TEST 0 and TEST 1. In the normal mode of operation, status of each of these lines can be directly tested using the following conditional Jump instructions: • JTO Jump if TEST 0 = 1 • JNTO Jump if TEST 0 = 0 • JT1 Jump if TEST 1 = 1 • JNT1 Jump if TEST 1 = 0 The test inputs are TTL compatible. An external logic signal connected to one of the test inputs will be sampled at the time the appropriate conditional jump instruction is executed. The path of program execution will be altered depending on the state of the external signal when sampled. INTERRUPTS The 8041AH/8741A, 8042/8742 has the following internal interrupts: WR a Figure 2-14 illustrates the internal interrupt lo~ An IBF interrupt request is generated whenever WR and CS are both low, regardless of whether interrupts are enabled. The interrupt request is cleared upon entering the IBF service routine only. That is, the DIS I instruction does not clear a pending IBF interrupt. Interrupt Timing Latency When the IBF interrupt is enabled and an IBF interrupt request occurs, an interrupt sequence is initiated as soon as the currently executing instruction is completed. The following sequence occurs: • A CALL to location 3 is forced. • The program counter and bits 4-7 of the Program Status Word are stored in the stack. • The stack pointer is incremented. IBF INTERRUPT REQUEST es IBF INTERRUPT IBF REQUEST INTERRUPT RECOGNIZED RESET IBF INTERRUPT a EN I ENABLE IBF INTERRUPT ENABLE DIS I RESET TIMER OVERFLOW a =..1"L::.....;=---!>-____-l TIMER INTERRUPT REQUEST TIMER INTERRUPT RECOGNIZED RETR EXECUTED a RESET TIMER INTERRUPT ENABLE 01$ TeNTI EXECUTED RESET Figure 2-14. Interrupt Logic 6-820 INTERRUPT IN PROGRESS FUNCTIONAL DESCRIPTION Location 3 in program memory should contain an unconditional jump to the beginning of the IBF interrupt service routine elsewhere in program memory. At the end of the service routine, an RETR (Return and Restore Status) instruction is used to return control to the main program. This instruction will restore the program counter and PSW bits 4-7, providing automatic restoration of the previously active register bank as well. RETR also re-enables interrupts. A timer-overflow interrupt is enabled by the EN TCNTI instruction and disabled by the DIS TCNTI instruction. If enabled, this interrupt occurs when the timer/counter register overflows. A CALL to location 7 is forced and the interrupt routine proceeds as described above. The interrupt service latency is the sum of current instruction time, interrupt recognition time, and the internal call to the interrupt vector address. The worst case latency time for servicing an interrupt is 7 clock cycles. Best case latency is 4 clock cycles. Interrupt Timing Interrupt inputs may be enabled or disabled under program control using EN I, DIS I, EN TCNTI and DIS TCNTI instructions. Also, a RESET input will disable interrupts. An interrupt request must be removed before the RETR instruction is executed to return from the service routine, otherwise the processor will re-enter the service routine immediately. Thus, the WR and CS inputs should not be held low longer than the duration of the interrupt service routine. The interrupt system is single level. Once an interrupt is detected, all further interrupt requests are latched but are not acted upon until execution of an RETR instruction re-enables the interrupt input logic. This occurs at the beginning ofthe second cycle of the RETR instruction. If an IBF interrupt and a timer-overflow interrupt occur simultaneously, the IBF interrupt will be recognized first and the timeroverflow interrupt will remain pending until the end of the interrupt service routine. External Interrupts An external interrupt can be created using the UPI41AH, 42 timer/counter in the event counter mode. The counter is first preset to FFH and the EN TCNTI instruction is executed. A timer-overflow interrupt is generated by the first high to low transition of the TEST 1 input pin. Also, if an IBF interrupt occurs during servicing of the timer/counter interrupt, it will remain pending until the end of the service routine. 6-821 Host Interrupts And DMA If needed, two external interrupts to the host system can be created using the EN FLAGS instruction. This instruction allocates two I/O lines on PORT 2 (P24 and P25). P24 is the Output Buffer Full interrupt request line to the host system; P25 is the Input Buffer empty interrupt request line. These interrupt outputs reflect the internal status of the OBF flag and the IBF inverted flag. Note, these outputs may be inhibited by writing a "0" to these pins. Reenabling interrupts is done by writing a "I" to these port pins. Interrupts are typically enabled after power on since the I/O ports are set in a "I" condition. The EN FLAG's effect is only cancelled by a device RESET. DMA handshaking controls are available from two pins on PORT 2 of the UPI-41A microcomputer. These lines (P26 and P27) are enabled by the EN DMA instruction. P26 becomes DMA request (DRQ) and P27 becomes DMA acknowledge (DACK). The UPI program initiates a DMA request by writing a "I" to P26. The DMA controller transfers the data into the DBBIN data register using DACK which acts as a chip select. The EN DMA instruction can only be cancelled by a chip RESET. RESET The RESET input provides a means for internal initialization of the processor. An automatic initialization pulse can be generated at power-on by simply connecting a.l /lfd capacitor between the RESET input and ground as shown in Figure 2-15. It has an internal pull-up resistor to charge the capacitor and a Schmitt-trigger circuit to generate a clean transition. A 2-stage sychronizer has been added to support reliable operation up to 12 MHz. If automatic initialization is used, RESET should be held low for at least 10 milliseconds to allow the power supply to stabilize. If an external RESET signal is used, RESET may be held low for a minimum of 8 instruction cycles. Figure 2-15 illustrates a configuration using an external TTL gate to generate the RESET input. This configuration can be used to derive the RESET signal from the 8224 clock generator in an 8080 system. The RESET input performs the following functions: • • • • • • • • Disables Interrupts Clears Program Counter to Zero Clears Stack Pointer Clears Status Register and Flags Clears Timer and Timer Flag Stops Timer Selects Register Bank 0 Sets PORTS 1 and 2 to Input Mode FUNCTIONAL DESCRIPTION B041AH 8741A 8042 8742 EXTERNAL RESET SIGNAL OPEN COLLECTOR ' Figure 2·15. External Reset Configuration DATA BUS BUFFER Two 8-bit data bus buffer registers, DBBIN and DBBOUT, serve as temporary buffers for commands and data flowing between it and the master processor. Externally, data is transmitted or received by the DBB registers upon execution of an INput or OUTput instruction by the master processor. Four control signals are used: • AO • • CS RD WR • tween the DBB and the UPI accumulator is under software control and is completely asynchronous to the external processor timing. This allows the UPI software to handle peripheral control tasks independent of the main processor while still maintaining a data interface with the master system. Configuration Figure 2-16 illustrates the internal configuration of the DBB registers. Data is stored in two8"bit buffer registers, DBBIN and DBBOUT. DBBIN and DBBOUT may be accesse~ the external processor using the WR line and the RD line, respectively. The data bus is a bidirectional, three-state bus which can be connected directly to an 8-bit microprocessor system. Four control lines (WR, RD, CS, AO) are used by the external processor to transfer data to and from the DBBIN and DBBOUT registers. Address input signifying ·control or data Chip Select Read strobe Write strobe Transfer can be implemented.with or without UPI program interference by enabling or disabling an internal UPI interrupt. Internally, data transfer be- Wii CONTROL BUS ii6 cs 00 SYSTEM INTERFACE UPI~41AH, 42 DATA . BUS "\r-_-I---,1",8)_-I BUS CONTENTS DU.,ING STATUS READ ST7 St:6 STs ST4 F1 FO IBF OSF 07 06 05 D4 .03 02 01 DO 2·16. Data Bus Buffer Configuration 6-822 FUNCTIONAL DESCRIPTION SYSTEM INTERFACE An 8-bit register containing status f1ags is used to indicate the status of the DBB registers. The eight status f1ags are defined as follows: • • • • • Figure 2-17 illustrates how an UPI-Microcomputer can be connected to a standard 8080-type bus system. Data lines DO-D7 form a three-state bidirectional port which can be connected directly t~ the system data bus. The UPI bus interface has sufficient drive capability (400 f.lA) for small systems, however, a larger system may require buffers. OBF Output Buffer Full This flag is automatically set when the UPI-Microcomputer loads the DBBOUT register and is cleared when the master processor reads the data register. IBF Input Buffer Full This flag is set when the master processor writes a character to the DBBIN register and is cleared when the UPI INputs the data register contents to its accumulator. FO This is a general purpose f1ag which can be cleared or toggled under UPI software control. The f1ag is used to transfer UPI status information to the master processor. Fl Command/Data This f1ag is set to the condition of the AO input line when the master processor writes a character to the data register. The Fl f1ag can also be cleared or toggled under UPIMicrocomputer program control. ST4 Through ST7 These bits are user defined status bits. They are defined by the MOV STS A instruction. ' Four control signals are required to handle the data and status information transfer: • WR I/O WRITE signal used to transfer data from the system bus to the UPI DBBIN register and set the Fl f1ag in the status register. • RD I/O READ signal used to transfer data from the DBBOUT register or status register to the system data bus. • CS CHIP SELECT signal used to enable one 8041A out of several connected to a common bus. • AO Address input used to select either the 8-bit status register or DBBOUT register during an I/O READ. Also, the signal is used to s~t the Fl f1ag in the status register during an I/O WRITE. All f1ags in the status register are automatically cleared by a RESET input. ) AO a-SIT SYSTEM BUS - iDA lOW ~ RESET ~ L... 8 AO ~ DATA BUS <) cs \7 470 t I RO WR PORT 2 8 8 ..y 'v RESET XTAL 1 XTAL 2 TEST1 TEST 0 I PERIPHERAL INTERFACE Figure 2-17. CONTROL BUS ¢2 a04,1A/8741A PORT 1 ~ Al \ 00-0 7 ADDRESS BUS Interface to 8080 System Bus 6-823 -v +5V 470 -v +5V FUNCTIONAL DESCRIPTION The WR and RD signals are active low and are standard MCS-80 peripheral control signals used to synchronize data transfer between the system bus and peripheral devices. The CS and AO signals are decoded from the address bus of the master system. In a system with few I/O devices a linear addressing configuration can be used where AO and Al lines are connected directly to AO and CS inputs (see Figure 2-17). Data Read Table 2-4 illustrates the relative timing of a DB BOUT Read. When CS, AO, and RD are low, the contents of the DBBOUT register is placed on the three-state Data lines DO-D7 and the OBF flag is cleared. The master processor uses CS, AO, WR, and RD to control data transfer between the DBBOUT register and the master system. The following operations are under master processor control: Table 2-4. CS RD WR AO 0 0 0 0 1 0 0 1 1 x 1 1 0 0 x 0 1 0 1 x Data Transfer Controls Read DBBOUT register Read STATUS register Write DBBIN data register Write DBBIN command register Disable DBB Status Read Table 2-4 shows the logic sequence re~ed for a STATUS register read. When CS and RD are low with AO high, the contents of the 8-bit status register appears on Data lines DO-D7. Data Write Table 2-4 shows the sequence for writing information to the DB BIN register. When CS and WR are low, the contents of the system data bus is latched into DBBIN. Also, the IBF flag is set and an interrupt is generated, if enabled. Command Write During any write (Table 2-4), the state of the AO input is latched into the status register in the Fl (command/data) flag location. This additional bit is used to signal whether DBBIN contents are command (AO = 1) or data (AO = 0) information. INPUT/OUTPUTINTERFACE The UPI-41A has 16 lines for input and output functions. These I/O lines are grouped as two 8-bit TTL compatible ports: PORTS 1 and 2. The port lines can individually function as either inputs or outputs under software control. In addition, the lower 4 lines of PORT 2 can be used to interface to an 8243 I/O expander device to increase I/O capacity to 28 or more lines. The additional lines are grouped as 4-bit ports: PORTS 4, 5, 6, and 7. PORTS 1 and 2 PORTS 1 and 2 are each 8 bits wide and have the same I/O characteristics. Data written to these ports by an OUTL Pp,A instruction is latched and remains unchanged until it is rewritten. Input data is sampled at the time the IN, A,Pp instruction is executed. Therefore, input data must be present at the PORT until read by an INput instruction. PORT 1 and 2 inputs are fully TTL compatible and outputs will drive one standard TTL load. Circuit Configuration The PORT 1 and 2 lines have a special output structure (shown in Figure 2-18) that allows each line to serve as an input, an output, or both, even though outputs are statically latched. Each line has a permanent high impedance pull-up (50Kfl) which is sufficient to provide source current for a TTL high level, yet can be pulled low by a standard TTL gate drive. Whenever a "1" is written to a line, a low impedance pull-up (5K) is switched in momentarily (500 ns) to provide a fast transition from 0 to 1. When a "0" is written to the line, a low impedance pull-down (300g) is active to provide TTL current sinking capability. To use a particular PORT pin as an input, a logic "1" must first be written to that pin. NOTE: A RESET intializes all PORT pins to the high impedance logic "1" state. An external TTL device connected to the pin has sufficient current sinking capability to pull-down the pin to the low state. An IN A,Pp instruction will sample the status of PORT pin and will input the proper logic level. With no external input connected, the IN A,Pp instruction inputs the previous output status. . This structure allows input and output information on the same pin and also allows any mix of input and output lines on the same port. However, when inputs and outputs are mixed on one PORT, a PORT write will cause the strong internal pull-ups to turn on at all inputs. If a switch or other low impedance device is connected to an input, a PORT write ("1" to an input) could cause current limits on internal lines to 6-824 FUNCTIONAL DESCRIPTION INTERNAL BUS Figure 2-18. Quasi-Bidirectional Port Structure be exceeded. Figure 2-19 illustrates the recommended connection when inputs and outputs are mixed on one PORT. The bidirectional port structure in combination with the UPI-41AH, 42 logical AND and OR instructions provides an efficient means for handling single line inputs and outputs within an 8-bit processor. The lower half of PORT 2 provides an interface to the 8243 as illustrated in Figure 2-20. The PROG pin is used as a strobe to clock address and data information via the PORT 2 interface. The extra 16 I/O lines are referred to in UPI software as PORTS 4, 5, 6, and 7. Each PORT can be directly addressed and can be ANDed and ORed with an immediate data mask. Data can be moved directly to the accumulator from the ~xpander PORTS (or vice-versa). PORTS 4, 5, 6, and 7 By using an 8243 I/O expander, 16 additional I/O lines can be connected to the UPI-41AH, 42 and directly addressed as 4-bit I/O ports using UPI-41AH, 42 instructions. This feature saves program space and design time, and improves the bit handling capability of the UPI-41AH, 42. PORT 1,' 8041AH 8741A r---o l The 8243 I/O ports, PORTS 4,5,6, and 7, provide more drive capability than the UPI-41AH, 42 bidirectional ports. The 8243 output is capable of driving about 5 standard TTL loads. 1K NPUT PORT 1,2 B041AH 8042 8742 8741A 804. 8742 _ INCORRECT UNLESS ALL LINES ON THE PORT ARE INPUTS Figure 2-19. !-"'II\{I,---o l RECOMMENDED WHEN INPUTS AND OUTPUTS ARE MIXED ON A PORT Recommended PORT Input Connections 6-825 NPUT-=- FUNCTIONAL DESCRIPTION *l -=- TEST INPUTS 2 a041AH 8741A 8042 8742 / P5-PORT5 4 I/O P6 - PORT 6 4 I/O P7 - PORT 7 4 I/O BITS 0,1 o~ 01 10 X ADDRESS (4-8IT5) 11 DATA (4-8IT5) Figure 2-20. PORT ADDRESS , BITS 2,3 0fr 01 . 10 11 READ WRITE OR AND > 8243 Expander Interface Multiple 8243's can be connected to the PORT 2 interface. In normal operation, only one of the 8243's would be active at the time an Input or Output command is executed. The upper half of PORT 2 is used to provide chip select signals to the 8243's. Figure 221 shows how four 8243'8 could be connected. Soft- DstTsA '-_--"-_/I DBB > I/O PROG \ --< 4 00-03 4 PROG P20-P23 P4- PORT 4 8243 P20·P23 PROG THAN ONE EXPANDER IS USED CS I/O 12 CHIP SELECT CONNECTION IF MOR ware is needed to select and set the proper PORT 2 pin· before an INPUT or OUTPUT command to PORTS 4-7 is executed. In general, the software overhead required is very minor compared to the added flexibility of having a large number of I/O pins available. 8041AH 8;o~iA 8742 CO~3~OL /---:;--" CONTRO~ORT 1 K:::]=) PORT2~:Jc:==::-===~~=====r====~=-::========~::~========~::J PROG~----- __ ~ +-_______ ______-J ______ Figure 2-21. Multiple 8243 Expansion 6-826 ~ CHAPTER 3 INSTRUCTION SET The UPI-41AH, 42 Instruction Set is opcode-compatible with the MCS-48 set except for the elimination of external program and data memory instructions and the addition of the data bus buffer instructions. It is very straightforward and efficient in its use of program memory. All instructions are either 1 or 2 bytes in length (over 70% are only 1 byte long) and over half of the instructions execute in one machine cycle. The remainder require only two cycles and include Branch, Immediate, and I/O operations. The UPI-41AH, 42 Instruction Set efficiently handles the single-bit operations required in control applications. Special instructions allow port bits to be set or cleared individually. Also, any accumulator bit can be directly tested via conditional branch instructions. Additional instructions are included to simplify loop counters, table look-up routines and N-way branch routines. The UPI-41AH, 42 Microcomputer handles arithmetic operations in both binary and BCD for efficient interface to peripherals such as keyboards and displays. chine status accordingly and provide a means of restoring status after an interrupt or of altering the stack pointer if necessary. Accumulator Operations Immediate data, data memory, or the working registers can be added (with or without carry) to the accumulator. These sources can also be ANDed, ORed, or exclusive ORed to the accumulator. Data may be moved to or from the accumulator and working registers or data memory. The two values can also be exchanged in a single operation. The lower 4 bits of the accumulator can be exchanged with the lower 4 bits of any of the internal RAM locations. This operation, along with an instruction which swaps the upper and lower 4-bit halves ofthe accumulator, provides easy handling of BCD numbers and other 4-bit quantities. To facilitate BCD arithmetic a Decimal Adjust instruction is also included. This instruction is used to correct the result of the binary addition of two 2-digit BCD numbers. Performing a decimal adjust on the result in the accumulator produces the desired BCD result. The accumulator can be incremented, decremented, cleared, or complemented and can be rotated left or right 1 bit at a time with or without carry. The instruction set can be divided into the following groups: • Data Moves • Accumulator Operations • Flags • Register Operations • Branch Instructions • Control • Timer Operations • Subroutines • Input/Output Instructions A subtract operation can be easily implemented in UPI-41AH, 42 software using three single-byte, single-cycle instructions. A value can be subtracted from the accumulator by using the following instructions: • Complement the accumulator • Add the value to the a<::cumulator • Complement the accumulator Data Moves (See Instruction Summary) The 8-bit accumulator is the control point for all data transfers within the UPI-41AH, 42. Data can be transferred between the 8 registers of each working register bank and the accumulator directly (i.e., with a source or destination register specified by 3 bits in the instruction). The remaining locations in the RAM array are addressed either by RO or Rl of the active register bank. Transfers to and from RAM require one cycle. Constants stored in Program Memory can be loaded directly into the accumulator or the eight working registers. Data can also be transferred directly between the accumulator and the on-board timer/ counter, the Status'Register (STS), or the Program Status Word (PSW). Transfers to the STS register alter bits 4-7 only. Transfers to the PSW alter ma6-827 Flags There are four user accessible flags: • Carry • Auxiliary Carry • FO • Fl The Carry flag indicates overflow of the accumulator, while the Auxiliary Carry flag indicates overflow between BCD digits and is used during decimal adjust operations. Both Carry and Auxiliary Carry are part of the Program Status Word (PSW) and are stored in the stack during subroutine calls. The FO and Fl flags are general-purpose flags which can be cleared or complemented by UPI instructions. FO is accessible via the Program Status Word and is stored in the stack with the Carry flags. Fl reflects the condition of the AO line, and caution must be used when setting or clearing it. INSTRUCTION SET Register Operations The working registers can be accessed via the accumulator as explained above, or they can be loaded with immediate data constants from program memory. In addition, they can be incremented or decremented directly, or they can be used as loop counters as explained in the section on branch instructions. Additional Data Memory locations can be accessed with indirect instructions via Ro and RI. Branch Instructions The UPI-4IAH, 42 Instruction Set includes 17 jump instructions. The unconditional jump instructiortallows jumps anywhere in the IK words of program memory. All other jump instructions are limited to the current page (256 words) of program memory. Conditional jump instructions can test the following inputs and machine flags: • • • • • • • • • • TEST 0 input pin TEST !.input pin Input Buffer Full flag Output Buffer Full flag Timer flag Accumulator zero Accumulator bit Carry flag FO flag FI flag The conditions tested by these instructions are the instantaneous values at the time the conditional jump instruction is executed. For instance, the jump on accumulator zero instruction tests the accumulator itself, not an intermediate flag. The decrement register and jump if not zero (DJNZ) instruction combines decrement and branch operations in a single instruction which is useful in implementing a loop counter. This instruction can designate any of the 8 working registers as a counter and can effect a branch to any address within the current page of execution. A special indirect jump instruction (JMPP @A) allows the program to be vec.tored to any one of several different locations based on the contents ofthe accumul!\tor. The contents of the accumulator point to a location in program memory. which contains the jump address. As an example, this instruction could .be used to vector to anyone of several routines based on an ASCII character which has been loaded into the accumulator.' In this way, ASCII inputs can be used to initiate various routines. Control The UPI-4IAH, 42 Instruction Set has six instructions for control of the DMA, interrupts, and selection of working register banks. The UPI-4IAH, 42 provides two instructions for control of the external microcompu~er system. IBF and OBF.flags can be routed to PORT 2 allowing interrupts of the external processor. DMA handshaking signals can also be enabled using lines from PORT 2. The IBF interrupt can be enabled and disabled using two instructions. Also, the interrupt is automatically disabled following a RESET input or dur. ing an interrupt service rC1utine. The working register bank switch instructions allow the programmer to immediately substitute a second 8 register bank for the one in use. This effectively provides either 16 working registers or the means for quickly saving the contents of the first 8 registers in response to an interrupt. The user has the option of switching register banks when an interrupt occurs. However, if the banks are switched, the original bank will automatically be restored upon execution of a return and restore status (RETR) instruction at t1!e end of the interrupt service routine. Timer The 8-bit on-board timer/counter can be loaded or read via the accumulator while the counter is stopped or while counting. The counter can be started as a timer with an internal clock source or as a'll event counter or timer with an external clock applied to the TEST 1 pin. The instruction executed determines which clock source is used. A single instruction stops the counter whether it is operating with an internal or an external clock source. In addition, two-instructions allow the timer interrupt to be enabled or disabled. Subroutines Subroutines are entered by executing a call instruction. Calls can be made to any address in the IK word program memory. Two separate return instructions determine whether or not status (i.e., the upper 4 bits of the PSW) is restored upon return from a subroutine. Input/Output Instructions Two 8-bit .data bus buffer registers (DBBIN and DBBOUT) and an 8-bit status register (STS) enable the UPI-4IA universal peripheral interface to communicate with the external microcomputer system. Data can be INputted from the DBBIN register to 6-828 INSTRUCTION SET the accumulator. Data can be OUTputted from the accumulator to the DBBOUT register. The STS register contains four user-definable bits (ST4-ST7) plus four reserved status bits (IBF, OBF, Fa, and Fl). The user-definable bits are set from the accumulator. The UPI-41AH, 42 peripheral interface has two 8bit static I/O ports which can be loaded to and from the accumulator. Outputs are statically latched but inputs to the ports are sampled at the time an IN instruction is executed. In addition, immediate data from program memory can be ANDed and ORed directly to PORTS 1 and 2 with the result remaining on the port. This allows "masks" stored in program memory to be used to set or reset individual bits on the I/O ports. PORTS 1 and 2 are configured to allow input on a given pin by first writing a "I" to the pin. INSTRUCTION SET DESCRIPTION The following section provides a detailed description of each UPI instruction and illustrates how the instructions are used. For further information about programming the UP I, consult the 8048/8041A Assembly Language Manual. Four additional4-bit ports are available through the 8243 I/O expander device. The 8243 interfaces to the UPI-41AH, 42 peripheral interface via four PORT 2 . lines which form an expander bus. The 8243 ports have their own AND and OR instructions like the on-board ports, as well as move instructions to transfer data in or out. The expander AND or OR instructions, however, combine the contents of the accumulator with the selected port rather than with immediate data as is done with the on-board ports. Table 3-2. Mnemonic Accumulator A,Rr ADD A,@Rr ADD ADD A,#data A,Rr ADDC A,@Rr ADDC ADDC A,#data ANL A,Rr A,@Rr ANL A,#data ANL A,Rr ORL A,@Rr ORL A,#data ORL A,Rr XRL A,@Rr XRL XRL A,#data INC A DEC A CLR A CPL A DA A SWAP A RL A RLC A RR A RRC A Table 3-1. Symbols and Abbreviations Used Symbol Definition A C DBBIN DBBOUT FO,F1 I P PC Pp PSW Rr SP STS T TF TO,T1 # @ Accumulator Carry Data Bus Buffer Input Data Bus Buffer Output FLAG 0, FLAG 1 (C/D flag) Interrupt Mnemonic for "in-page" operation Program Counter Port designator (p = 1,2, or 4-7) Program Status Word Register designator (r = 0-7) Stack Pointer Status register Timer Timer Flag TEST 0, TEST 1 Immediate data prefix Indirect address prefix Double parentheses show the effect of @, that is, @RO is shown as ((RO)). Contents of (( )) () Instruction Set Summary Operation Description Add register to A Add data memory to A Add immediate to A Add register to A with carry Add data memory to A with carry Add immediate to A with carry And register to A And data memory to A And immediate to A Or register to A Or data memory to A Or immediate to A Exclusive Or register to A Exclusive Or data memory to A Exclusive Or immediate to A Increment A Decrement A Clear A Complement A Decimal Adjust A Swap nibbles of A Rotate A left Rotate A left through carry Rotate A right Rotate A right through carry 6-829 Bytes Cycles 1 1 2 1 1 1 2 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 2 1 1 2 1 1 2 1 1 2 1 1 1 1 1 1 1 1 1 1 INSTRUCTION SET Table 3·2. Mnemonic Instruction Set Summary (Con't.) Operation Description Bytes Cycles Input port to A Output A to port And immediate to port Or immediate to port Input DBB to A, clear IBF Output A to DBB, Set OBF A4-A 7 to bits 4-7 of status Input Expander port to A Output A to Expander port And A to Expander port Or A to Expander port 1 1 2 2 1 1 1 1 1 1 1 2 2 2 2 1 1 1 2 2 2 2 Move register to A Move data memory to A Move immediate to A Move A to register Move A to data memory Move immediate to register Move immediate to data memory MovePSW toA Move A toPSW Exchange A and registers Exchange A and data memory Exchange digit of A and register Move to A from current page Move to A from Page 3 1 1 2 1 1 2 2 1 1 1 1 1 1 1 1 1 2 1 1 2 2 1 1 1 1 1 2 2 Read Timer/Counter Load Timer/Counter Start Timer Start Counter Stop Timer/Counter Enable Timer/Counter Interrupt Disable Timer/Counter Interrupt 1 1 1 1 1 1 1 1 1 1 1 1 1 Enable DMA Handshake Lines Enable IBF interrupt Disable IBF interrupt Enable Master Interrupts Select register bank 0 Select register bank 1 No Operation 1 1 1 1 1 1 1 1 1 1 1 1 1 Increment register Increment data memory Decrement register 1 1 1 1 1 1 Jump to subroutine Return Return and restor~ status 2 1 1 2 2 2 Clear Carry Complement Carry Clear Flag 0 Complement Flag 0 Clear Fl Flag Complement Fl Flag 1 1 1 1 1 INPUT /OUTPUT A,Pp Pp,A Pp,#data Pp,#data A,DBB DBB,A STS,A A,Pp Pp,A Pp,A Pp,A IN OUTL ANL ORL IN OUT MOV MOVD MOVD ANLD ORLD DATA MOVES MOV MOV MOV MOV MOV MOV MOV MOV MOV XCH XCH XCHD MOVP MOVP3 A,Rr A,@Rr A,#data Rr,A @Rr,A Rr,#data @Rr,#data A,PSW PSW,A A,Rr A,@Rr A,@Rr A,@A A,@A TIMER/COUNTER MOV MOV STRT STRT STOP EN DIS A,T T,A T CNT TCNT TCNTI TCNTI 1 CONTROL EN EN DIS EN SEL SEL NOP DMA I I FLAGS RBO RBI 1 REGISTERS INC INC DEC Rr @Rr Rr SUBROUTINE CALL RET RETR addr FLAGS CLRC CPLC CLRFO CPLFO CLRFI CPLFI 1 1 1 6-830 1 1 1 1 INSTRUCTION SET Table 3-2. Mnemonic Instruction Set Summary (Con't.) Operation Description BRANCH JMP addr JMPP @A DJNZ Rr,addr addr JC JNC addr JZ addr JNZ addr JTO addr JNTO addr JTl addr JNTI addr JFO addr JFl addr JTF addr JNIBF addr JOBF addr JBb addr Jump unconditional Jump indirect Decrement register and jump on non-zero Jump on Carry=l Jump on Carry=O Jump on A Zero Jump on A not Zero .Jump on TO=l Jump on TO=O Jump on Tl=l Jump on Tl=O Jump on FO Flag=l Jump on Fl Flag=l Jump on Timer Flag=l Jump on IBF Flag=O Jump on OBF Flag=1 Jump on Accumulator Bit Bytes Cycles 2 1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ALPHABETIC LISTING ADD A,Rr Opcode: Exampie: Add Register Contents to Accumulator LI_o________o~I_1___r2___r1___ ro~1 The contents of register 'r' are added to the accumulator. Carry is affected. r=O-7 (A) -- (A) + (Rr) ADDREG: ADD A,R6 ;ADD REG 6 CONTENTS ;TOACC ADD A,@Rr Opcode: Example: Add Data Memory Contents to Accumulator LI_o________o~l_o___o___o___r~1 The contents of the standard data memory location addressed by register 'r' bits 0-5 are added to the accumulator. Carry is affected. r=O-1 (A) -- (A) + «Rr» ADDM: MOV RO,#47 ;MOVE 47 DECIMAL TO REG 0 ADD A,@RO ;ADD VALUE OF LOCATION ;47 TO ACC ADD A,#data Opcode: Example: I 0 Add Immediate Data to Accumulator 0 q 0 I 0 0 This is a 2-cycle instruction. The specified data is added to the accumulator. Carry is affected. (A) -- (A) + data ADDID: ADD A,#ADDER ;ADD VALUE OF SYMBOL ;'ADDER' TO ACC 6-831 INSTRUCTION SET ADDC A,Rr Add Carry and Register Contents to Accumulator ~I_0________1~1_1__r_2__r_1__ro~1 Opcode: The content of the carry bit is added to accumulator location O. The contents of register 'r' are then added to ' the accumulator. Carry is affected. (A) - (A) + (Rr) + (C) r=0-7 ADDRGC: ADDC A,R4 ;ADD CARRY AND REG 4 , ;CONTENTS TO ACC Example: ADDC A,@Rr Ope ode: Example: Add Carry and Data Memory Contents to Accumulator I0 Example:' ANL A,Rr Opcode: Example: ANL A,@Rr Opcode: Example: I0 ~ 0 0 ________ r I ~ The content of the carry bit is added to accumulator location O. Then the contents of the standard data memory location addressed by register 'r' bits 0-5 are added to the accumulator. Carry is affected. (A) - (A) + «Rr» + (C) r=0-1 ADDMC: MOV R1,#40 ;MOV '40' DEC TO REG 1 ADDC A,@R1 ;ADD CARRY AND LOCATION 40 ;CONTENTS TO ACC ADDC A,#data Ope ode: 1 L -_ _ _ _ _ _ _ _ I0 Add Carry and Immediate Data to Accumulator 0 0 1 I0 0 This is a 2-cycle instruction. The content of the carry bit is added to accumulator location O. Then the specified data is added to the accumulator. Carry is affected. (A) - (A) + data + (C) AD DC A,#255 ;ADD CARRY AND '225' DEC ;TOACC Logical AND Accumulator With Register Mask ~I_0_____0___1~1._1__r_2__r1___ro~1 Data in the accumulator is logically ANDed with the mask contained in working register 'r'. (A) - (A) AND (Rr) r=0-7 ANDREG: ANL A,R3 ;'AND' ACC CONTENTS WITH MASK ;MASK IN REG 3 Logical AND Accumulator With Memory Mask ~I_0_____0___1~1_o__o___o___r~1 Data in the accumulator is logically ANDed with the mask contained in the data memory location referenced by register 'r', bits 0-5. (A) - (A) AND «Rr» r=0-1 ANDDM: MOV RO,#OFFH ;MOVE 'FF' HEX TO REG 0 ANL A,#OAFH ;'AND' ACC CONTENTS WITH ;MASK IN LOCATION 63 6-832 INSTRUCTION SET ANL A,#data Opcode: Example: Logical AND Accumulator With Immediate Mask 0_ _ _ 0 _1...J..1_0_0_ _1-.l1 • 1d7 d6 d5 d41 d3 d2 d 1 dO 1 LI This is a 2-cycle instruction. Data in the accumulator is logically ANDed with an immediately-specified mask. (A) -- (A) AND data ANDID: ANL A,#OAFH ;'AND' ACC CONTENTS :WITH MASK 10101111 ANL A,#3+X/Y ;'AND' ACC CONTENTS ;WITH VALUE OF EXP ;'3+X/Y' ANL Pp,#data Opcode: 11 Logical AND Port 1-2 With Immediate Mask 0 0 1 11 0 P1 PO 1 • 1d7 d6 d5 d41 d3 d2 d1 dO 1 This is a 2-cycle instruction. Data on port 'p' is logically ANDed with an immediately-specified mask. (Pp) -- (Pp) AND data p= 1-2 Note: Bits 0-1 of the opcode are used to represent PORT 1 and PORT 2. If you are coding in binary rather than assembly language, the mapping is as follows: Bits p1 pO Port o o o X o 2 Example: 1 1 ANDP2: ANL P2,#OFOH ANLD Pp,A Logical AND Port 4-7 With Accumulator Mask Opcode: 11 0 0 1 11 1 X ;'AND' PORT 2 CONTENTS ;WITH MASK 'FO' HEX ;(CLEAR P20-23) 1 P1 PO 1 This is a 2-cycle instruction. Data on port 'p' on the 8243 expander is logically ANDed with the digit mask contained in accumulator bits 0-3. (Pp) -- (Pp) AND (AO-3) p=4-7 Note: Example: The mapping of Port 'p' to opcode bits P1,PO is as follows: ~ PO Port o o 0 1 4 5 1 1 0 1 ANDP4: ANLD P4,A 6 7 ;'AND' PORT 4 CONTENTS ;WITH ACC BITS 0-3 6-833 INSTRUCTION SET CALL address Opcode: 1 Subroutine Call 0 ag aa 1 1 0 o 0 1 • 1a7 a6 as a41 a3 a2 a1 aO 1 This is a 2-cycle instruction. The program counter and PSW bits 4-7 are saved in the stack. The stack pointer (PSW bits 0-2) is updated. Program control is then passed to the location specified by 'address'. Execution continues at the instruction following the CALL upon return from the subroutine. «SP» -- (PC), (PSW4-7) (SP) -- (SP) + .1 (PCa-g) -- (addra-g) (PCO-7) -- (addrO-7) Add three groups of two numbers. Put subtotals in locations 50,51 and total in location 52. MOV RO,#50 ;MOVE '50' DEC TO ADDRESS ;REGO BEGADD: MOV A,R1 ;MOVE CONTENTS OF REG 1 ;TO ACC ADD A,R2 ;ADD REG 2 TO ACC CALL SUBTOT ;CALL SUBROUTINE 'SUBTOT' ADD A,R3 ;ADD REG 3 TO ACC ADD A,R4 ;ADD REG 4 TO ACC CALL SUBTOT ;CALL SUBROUTINE 'SUBTOT' ADD A,R5 ;ADD REG 5 TO ACC ADD A,R6 ;ADD REG 6 TO ACC CALL SUBTOT ;CALL SUBROUTINE 'SUBTOT' Example: SUBTOT: MOV @RO,A INCRO RET CLR A ;MOVE CONTENTS OF ACC TO ;LOCATION ADDRESSED BY ;REGO ;INCREMENT REG 0 ;RETURN TO MAIN PROGRAM Clear Accumulator Opcode: 10 0 0 10 The contents of the accumulator are cleared to zero. (A) -- OOH CLR C Clear Carry Bit Opcode: 11 0 0 10 During normal program execution, the carry bit can be set to one by the ADD, ADDC, RLC, CPLC, RRC, and DAA instructions. This instruction resets the carry bit to zero. (C) -- 0 CLR F 1 Clear Flag 1 Opcode: _1_0_ _ _0--1.1_0_ _ _0_---' L..I The F 1 flag is cleared to zero. (F1)--0 6-834 INSTRUCTION SET CLR FO Clear Flag 0 I 1 Opcode: 0 0 0 I0 0 Flag 0 is cleared to zero. (FO) - 0 CPL A Complement Accumulator Opcode: IL O_0_ _ _ 1....L1_0_ _ _1--.J1 The contents of the accumulator are complemented. This is strictly a one's complement. Each one is changed to zero and vice-versa. (A) - NOT (A) Assume accumulator contains 01101010. CPLA: CPL A ;ACC CONTENTS ARE COMPLE;MENTED TO 10010101 Example: CPL C Complement Carry Bit Opcode: I 1 0 I0 The setting of the carry bit is complemented; one is changed to zero, and zero is changed to one. (C) - NOT (C) Set C to one; current setting is unknown. CTO 1: CLR C ;C IS CLEARED TO ZERO CPL C ;C IS SET TO ONE Example: CPL FO 0 Complement Flag 0 I 1 Opcode: 0 0 1 I 0 0 The setting of Flag 0 is complemented; one is changed to zero, and zero is changed to one. FO- NOT (FO) CPL F1 Complement Flag 1 Opcode: IL1_0_ _ _ 1....L1_0_ _0_1--.J1 The setting of the F1 Flag is complemented; one is changed to zero, and zero is changed to one. (F1) - NOT (F1) 6-835 INSTRUCTION SET DA A Decimal Adjust Accumulator ~I_0_____0___1-L1_0________~ Opcode: The S-bit accumulator value is adjusted to form two 4-bit Binary Coded Decimal (BCD) digits following the binary addition of BCD numbers. The carry bit C is affected. If the contents of bits 0-3 are greater than nine, or if AC is one, the accumulator is incremented by six. The four high-order bits are then checked. If bits 4-7 exceed nine, or if C is one, these bits are increased by six. If an overflow occurs, C is set to one; otherwise, it is cleared to zero. Assume accumulator contains 9AH. DA A ;ACC ADJUSTED TO 01H with C set Example: C o AC 0 o o o DEC A ADD SIX TO HIGH DIGIT RESULT DEC Rr I0 0 0 0 I0 The contents of the accumulator are decremented by one. (A)-(A)-1 Decrement contents of data memory location 63. MOV RO,#3FH ;MOVE '3F' HEX TO REG 0 MOV A,@RO ;MOVE CONTENTS OF LOCATION 63 ;TOACC DEC A ;DECREMENT ACC MOV @RO,A ;MOVE CONTENTS OF ACC TO ;LOCATION 63 Example: Decrement Register Opcode: Example: 1~_1_____0___0-L1_1__r_2__r_1__ro~1 The contents of working register 'r' are decremented by one. (Rr) - (Rr) - 1 r=0-7 DECR1: DEC R1 ;DECREMENT ADDRESS REG 1 Disable IBF Interrupt Opcode: Note: INITIAL CONTENTS ADD SIX TO LOW DIGIT Decrement Accumulator Opcode: DIS I ACC 9AH 06H A1H 60H 01H 0_ _ 0_0_~1O_ _ _O_~ LI The input Buffer Full interrupt is disabled. The interrupt sequence is not initiated by WR and CS, however, an IBF interrupt request is latched and remains pending until an EN I (enable IBF interrupt) instruction is executed. The IBF flag is set and cleared independent of the IBF interrupt request so that handshaking protocol can continue normally. 6-836 INSTRUCTION SET DIS TCNTI Disable Timer I Counter Interrupt Opcode: LI0_0 _ _ _1---L_o_ _0_----'11 The timer / counter interrupt is disabled. Any pending timer interrupt request is cleared. The interrupt sequence is not initiated by an overflow, but the timer flag is set and time accumulation continues. DJNZ Rr, address Opcode: Decrement Register and Test 11 This is a 2-cycle instruction. Register 'r' is decremented and tested for zero. If the register contains all zeros, program control falls through to the next instruction. If the register contents are not zero, control jumps to the specified address within the current page. (Rr) ..... (Rr) - 1 If R 0, then; (PCO-7) ..... addr A 10-bit address specification does not cause an error if the DJNZ instruction and the jump target are on the same page. If the DJNZ instruction begins in location 255 of a page, it will jump to a target address on the following page. Otherwise, it is limited to a jump within the current page. Increment values in data memory locations 50-54. MOV RO,#50 ;MOVE '50' DEC TO ADDRESS "* Note: Example: MOV R3,#05 INCRT: INC @RO INC RO DJNZ R3,INCRT NEXT-- ° ;REG ;MOVE '5' DEC TO COUNTER ;REG 3 ;INCREMENT CONTENTS OF ;LOCATION ADDRESSED BY ° ° ;REG ;INCREMENT ADDRESS IN REG ;DECREMENT REG 3--JUMP TO ;'INCRT' IF REG 3 NONZERO ;'NEXT' ROUTINE EXECUTED ;IF R3 ZERO 19 EN DMA Enable DMA Handshake Lines Opcode: LI_1_ _ _0....JILo_ _ _ o_....J DMA handshaking is enabled using P26 as DMA request (DRO) and P27 as DMA acknowledge (DACK). The DACK line forces CS and AO low internally and clears DRO. EN FLAGS Enable Master Interrupts oPcode:1~_1________1~1_O_____o__~ The Output Buffer Full (OBF) and the Input Buffer Full (lBF) flags (lBF is inverted) are routed to P24 and P25. For proper operation, a "1" should be written to P25 and P24 before the EN FLAGS instruction. A "0" written to P24 or P25 disables the pin. 6-837 INSTRUCTION SET EN I Enable IBF Interrupt Opcode: 10 °° 010 ° The Input Buffer Full interrupt is enabled. A low signal on WR and CS initiates the interrupt sequence. EN TCNTI Opcode: Enable Timer/Counter Interrupt 1,-0_0_ _0-,-1o_ _o_1-,1 The timer I counter interrupt is enabled. An overflow of this register initiates the interrupt sequence. IN A,DBB Input Data Bus Buffer Contents to Accumulator Opcode: Data in the DBBIN register is transferred to the accumulator and the Input Buffer·Fuli (lBF) flag is set to zero. (A)- (DBB) (IBF)INDBB: IN A,DBB ;INPUT DBBIN CONTENTS TO ;ACCUMULATOR ° Example: IN A,Pp 0_0_ _0--,-10_0_ _0--,1 <-I Input Port 1-2 Data to Accumulator Opcode: Example: I° ° ° ° 11 ° P1 PO I This is a 2-cycle instruction. Data present on port 'p' is transferred (read) to the accumulator. (A) - (Pp) . p= 1-2 (see ANL instruction) INP12: IN A,P1 ;INPUT PORT 1 CONTENTS ;TOACC MOV RB,A ;MOVE ACC CONTENTS TO ;REGB IN A,P2 ;INPUT PORT 2 CONTENTS ;TOACC MOV R7,A ;MOVE ACC CONTENTS TO REG 7 INC A Inprement Accumulator Opcode: I° ° ° 1 I° The contents of the accumulator are incremented by one. (A)+-(A)+ 1 Example: Increment contents of location 10 in data memory. INCA: MOV RO,#10 ;MOV '10' DEC TO ADDRESS ;REGO MOV A,@RO ;MOVE CONTENTS OF LOCATION ;10TO ACC INC A ;INCREMENT ACC MOV @RO,A ;MOVE ACC CONTENTS TO ;LOCATION 10 6-838 INSTRUCTION SET INC Rr Increment Register Opcode: 1 1 JBb address ° °°° 1 1 °°° r 1 Jump If Accumulator Bit is Set Opcode: 1b2 b1 bO 1 1 °° This is a 2-cycle instruction. Control passes to the specified address if accumulator bit 'b' is set to one. (PCO-7) - addr if b=1 (PC) - (PC) + 2 if b=O JB41S 1: JB4 NEXT ;JUMP TO 'NEXT ROUTINE ;IF ACC BIT 4=' Example: JC address Jump If Carry Is Set Opcode: LI_,_ _ _ _1--'-1_0_ _ _ _ 0--'1 • 1a7 a6 a5 a41 a3 a2 a 1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if the carry bit is set to one. (PCO-7) - addr if C= 1 .(PC) - (PC) + 2 if C=O JC,: JC OVERFLOW ;JUMP TO 'OVFLOW' ROUTINE ;IF C=1 JFO address Example: ro 1 The contents of the resident data memory location addressed by register 'r' bits 0-5 are incremented by one. r=0-1 «Rr» - «Rr» + 1 ;MOVE ONES TO REG 1 INCDM: MOV R1,#OFFH ;INCREMENT LOCATION 63 INC @R1 Example: Opcode: r2 r1 Increment Data Memory Location Opcode: Example: 1 11 The contents of working register 'r' are incremented by one. (Rr) - (Rr) + 1 r=0-7 INCRO: INC RO ;INCREMENT ADDRESS REG Example: INC @Rr °°° Jump If Flag 0 Is Set L-_o_ _ _'-LI_o_ _ _ _o--'1 • 1a7 a6 a5 a41 a3 a2 a 1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if flag (PCO-7) - addr if FO= 1 JFOIS1: JFO TOTAL ;JUMP TO 'TOTAL' ROUTINE ;IF FO=1 6-839 °is set to one. INSTRUCTION· SET JF1 address Jump If C/O Flag (F1) Is Set OPcode:1L-_0_ _ _ _1--'--1_0_ _ _ _0--'1 • 1a7 a6 a5 a41 a3 a2 a 1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if the C/D flag (F 1) is set to one. (PCO-7) -- addr if F 1= 1 JF 11S 1: JF 1 FILBUF ;JUMP TO 'FILBUF' ;ROUTINE IF F 1= 1 Example: JMP address Opcode: la10 a9 as ° 1 ° This is a 2-cycle instruction. Bits 0-9 of the program counter are replaced with the directly-specified address. (PCS-9) -- addr S-9 (PCO-7) -- addr 0-7 JMP SUBTOT ;JUMP TO SUBROUTINE 'SUBTOT' JMP $-6 ;JUMP TO INSTRUCTION SIX LOCATIONS ;BEFORE CURRENT LOCATION JMP 2FH ;JUMP TO ADDRESS '2F' HEX Example: JMPP @A Direct Jump Within 1K Block Indirect Jump Within Page Opcode: Example: 11...-1_°-...,_ _1_1'--° __0_ _ _--' This is a 2-cycle instruction. The contents of the program memory location pointed to by the accumulator are substituted for the 'page' portion of the program counter (PC 0-7). (PCO-7) .... «A» Assume accumulator contains OFH JMPPAG: JMPP @A ;JMP TO ADDRESS STORED IN ;LOCATION 151N CURRENT PAGE JNC address Opcode: Example: Jump If Carry Is Not Set '--_ _ _ _0_1L..,0 _____0--'1 • 1a7 a6 a5 a41 a3 a2 a1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if the carry bit is not set, that is, equals zero. if C=O (PCO-7) .... addr ;JUMP TO 'NOVFLO' ROUTINE JCO: JNC NOVFLO ;IFC=O JNIBF address Opcode: Example: Jump If Input Buffer Full Flag Is Low L-1_1___0__1--'--I_o_ _ _ _o--'l. 1a7 a6 a5 a41 a3 a2 a 1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if the Input Buffer Full flag is low (lBF=O). (PCO-7) .... addr if IBF=O LOC 3:JNIBF LOC 3 ;JUMP TO SELF IF IBF=O ;OTHERWISE CONTINUE 6-840 INSTRUCTION SET JNTO address Opcode: Example: Jump If TEST 0 Is Low LI0_ _ 0-'--_ _ 0...LI_o_ _ _ _o---'I-l a 7 a6 a5 a41 a3 a2 a1 aol This is a 2-cycle instruction. Control passes to the specified address, if the TEST sampled during SYNC. (PCO-7) - addr if TO=O JTOLOW: JNTO 60 ;JUMP TO LOCATION 60 DEC ;IF TO=O JNT1 address Opcode: Example: Example: Jump If TEST 1 Is Low This is a 2-cycle instruction. Control passes to the specified address if the TEST 1 signal is low. Pin is sampled during SYNC. (PCO-7) - addr if T 1=0 JT1LOW: JNT1 OBBH ;JUMP TO LOCATION 'BB' HEX ;IF T 1=0 Jump If Accumulator Is Not Zero '--_0__0__1_1'-0 _____ 0-'1 - I a7 a6 a5 a41 a3 a2 a 1 ao Example: JTF address Opcode: Example: I This is a 2-cycle instruction. Control passes to the specified address if the accumulator contents are nonzero at the time this instruction is executed. (PCO-7) - addr if Aif=O JACCNO: JNZ OABH ;JUMP TO LOCATION 'AB' HEX ;IF ACC VALUE IS NONZERO JOBF Address Opcode: signal is low. Pin is 1_o .... ___O__0.....L.I_o_ _ _ _o-'1 - I a7 a6 a5 a41 a3 a2 a1 ao I JNZ address Opcode: ° Jump If Output Buffer Full Flag Is Set 11 ° ° °I° ° I - I a7 a6 a5 a41 a3 a2 a 1 ao I This is a 2-cycle instruction. Control passes to the specified address if the Output Buffer Full (OBF) flag is set (= 1) at the time this instruction is executed. (PCO-7) - addr if OBF= 1 JOBFHI: JOBF OAAH ;JUMP TO LOCATION 'AA' HEX ;IF OBF=1 Jump If Timer Flag Is Set 10 0- ° 1 10 This is a 2-cycle instruction. Control passes to the specified address if the timer flag is set to one, that is, the timer I counter register overflows to zero. The timer flag is cleared upon execution of this instruction. (This overflow initiates an interrupt service sequence if the timer-overflow interrupt is enabled.) (PCO-7) - addr if TF= 1 JTF1: JTF TIMER ;JUMP TO 'TIMER' ROUTINE ;IF TF=1 6-841 INSTRUCTION SET JTO address Opcode: Example: Jump If TEST 0 Is High LI_0_o_ _ _1---,-I_o~_ _ _0-,1. 1a7 a6 a5 a41 a3 a2 a1 ao I. This is a 2-cycle instruction. Control passes to the specified address if the TEST sampled during SYNC. (PCO-7) - addr if TO= 1 ",TOHI: JTO 53 ;JUMP TO LOCATION 53 DEC ;IF To=1 JT1 address Opcode: Example: JZ address Opcode: Example: MOV A,PSW Opcode: Example: signal is high (= t). Pin is Jump If TEST 1 Is High 1 °. ° 1 1 1 ° o 1 • 1a7 a6 a5 a41 a3 a2 a 1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if the TEST 1 signal is high (= 1). Pin is sampled during SYNC. (PCO-7)- addr if T1=1 JT1HI: JT1 COUNT ;JUMP TO 'COUNT' ROUTINE ;IF T1=1 Jump If Accumulator Is Zero 1.-.1_1___0__0-,-1_0_ _ _ _ 0-'1 • 1a7 a6 a5 a41 a3 a2 a 1 ao 1 This is a 2-cycle instruction. Control passes to the specified address if the accumulator contains all zeros at the time this instruction is executed. ' if A=O (PCO-7) - addr JACCO: JZ OA3H ;JUMP TO LOCATION 'A3' HEX ;IF ACC VALUE IS ZERO MOV A,#data Example: ° Move Immediate Data to Accumulator This is a 2-cycle instruction. The a-bit value specified by 'data' is loaded in the accumulator. (A) - data MOV A,#OA3H ;MOV 'A3' HEX TO ACC Move PSW Contents to Accumulator LI1_ _0_0--,-10_ _ _1--,1 The contents of the program status word are moved to the accumulator. (A)- (PSW) Jump to 'RB1SET' routine if bank switch, PSW bit 4, is set. BSCHK: MOV A,PSW ;MOV PSW CONTENTS TO ACC JB4 RB1 SET ;JUMP TO 'RB1SET' IF ACC ;BIT 4=1 6-842 INSTRUCTION SET MOV A, Rr Move Register Contents to Accumulator ~I_1________1~1_1___r2___r1___ro~1 Opcode: Eight bits of data are moved from working register 'r' into the accumulator. (A) -- (Rr) r=0-7 MAR: MOV A,R3 ;MOVE CONTENTS OF REG 3 ;TOACC Example: MOV A,@Rr Opcode: Move Data Memory Contents to Accumulator L-11_ _ _ _ 1---1.I_o_o_o_--'r1 The contents of the data memory location addressed by bits 0-5 of register 'r' are moved to the accumulator. Register 'r' contents are unaffected. r=0-1 (A) -- «Rr» Assume R1 contains 00110110. Example: MADM: MOV A,@R1 MOV A,T Move Timer/Counter Contents to Accumulator Opcode: Example: MOV PSW,A Opcode: Example: ;MOVE CONTENTS OF DATA MEM ;LOCATION 54 TO ACC L-lo_ _ _ o_0---l.I_o_o_ _o--,1 The contents of the timer / event-counter register are moved to the accumulator. The timer / event-counter is not stopped. (A) -- (T) Jump to "EXIT" routine when timer reaches '64', that is, when bit 6 is set-assuming initialization to zero. TIMCHK: MOV A,T ;MOVE TIMER CONTENTS TO ;ACC JB6 EXIT ;JUMP TO 'EXIT' IF ACC BIT ;6=1 Move Accumulator Contents to PSW ° 1 1 ° The contents of the accumulator are moved into the program status word. All condition bits and the stack pointer are affected by this move. (PSW) -- (A) Move up stack pOinter by two memory locations, that is, increment the pointer by one. INCPTR: MOV A,PSW ;MOVE PSW CONTENTS TO ACC INC A ;INCREMENT ACC BY ONE MOV PSW,A ;MOVE ACC CONTENTS TO PSW 6-843 . INSTRUCTION SET MOV Rr,A Opcode: Example: Move Accumulator Contents to Register ,-1_1_0_ _ _0--,-1_1_r_2_r_1_3l_rO-J The contents of the accumulator are moved to register 'r'. r=0-7 (Rr) - (A) MRA MOV RO,A ;MOVE CONTENTS OF ACC TO ;REG . MOV Rr,#data Opcode: Example: MOV @Rr,A Opcode: Example: .11 Example: Move Immediate Data to Register ° This a 2-cycle instruction. The a-bit value specified by 'data' is moved to register 'r'. (Rr) - data r=0-7 MIR4: MOV R4,#HEXTEN ;THE VALUE OF THE SYMBOL ;'HEXTEN' IS MOVED INTO ;REG 4 MIR5: MOV R5;#PI*(R*R) ;THE VALUE OF THE ;EXPRESSION 'PI*(R*R)' ;IS MOVED INTO REG 5 MIR6: MOV R6,#OADH ;'AD' HEX IS MOVED INTO ;REG 6 Move Accumulator Contents to Data Memory 11 ° °° 1 0· ° r 1 '------~----~ The contents of the accumulator are moved to the data memory location whose address is specified by bits 0-5 of register 'r'. Register 'r' contents are unaffected. «Rr» - (A) r=0-1 Assume RO contains 11000111. MDMA: MOV @R,A ;MOVE CONTENTS OF ACC TO ;LOCATION 7 (REG) MOV @Rr,#data Opcode: ° 11 Move Immediate Data to Data Memory ° This is a 2-cycle instruction. The a-bit value specified by 'data' is moved to the standard data memory location addressed by register 'r', bit 0-5. «Rr» - data r=0-1 Move the hexadecimal value AC3F to locations 62-63. MIDM: MOV RO,#62 ;MOVE '62' DEC TO ADDR REGO MOV @RO,#OACH ;MOVE 'AC' HEX TO LOCATION 62 INC RO ;INCREMENT REG TO '63' MOV @RO,#3FH ;MOVE '3F' HEX TO LOCATION 63 ° 6-844 INSTRUCTION SET MOV STS,A Opcode: Move Accumulator Contents to STS Register 11 °° 1 1 °°°° The contents of the accumulator are moved into the status register. Only bits 4-7 are affected. (STS4-7)'" (A4-7) Set ST4-ST7 to "1". Example: MSTS: MOV A,#OFOH MOV STS,A MOV T,A 1 ;SET ACC ;MOVETO STS Move Accumulator Contents to Timer/Counter Opcode: Example: L....0_ _ _ _0...J..1_0_0_ _0--'1 The contents of the accumulator are moved to the timer I event-counter register. (T) ... (A) Initialize and start event counter. INITEC: CLR A MOV T,A STRT CNT MOVD A,Pp Opcode: ;CLEAR ACC TO ZEROS ;MOVE ZEROS TO EVENT COUNTER ;START COUNTER Move Port 4-7 Data to Accumulator 1 °°°° 11 1 P1 PO 1 This is a 2-cycle instruction. Data on 8243 port 'p' is moved (read) to accumulator bits 0-3. Accumulator bits 4-7 are zeroed. (AO-3)'" Pp p=4-7 Note: ° (A4-7)'" Bits 0-1 of the opcode are used to represent PORTS 4-7. If you are coding in binary rather than assembly language, the mapping is as follows: Port Bits P1 PO 4 °° ° 5 6 °1 7 Example: INPPT5: MOVO A,P5 MOVO Pp,A Move Accumulator Data to Port 4, 5, 6 and 7 Opcode: Example: ;MOVE PORT 5 DATA TO ACC ;BITS 0-3, ZERO ACC BITS 4-7 ILo ___0______1_1L-1__1 ___ p_1_p_o~1 This is a 2-cycie instruction. Data in accumulator bits 0-3 is moved (written) to 8243 port 'p'. Accumulator bits 4-7 are unaffected. (See NOTE above regarding port mapping.) (Pp) ... (AO-3) p=4-7 Move data in accumulator to ports 4 and 5. OUTP45: MOVD P4,A ;MOVE ACC BITS 0-3 TO PORT 4 SWAP A ;EXCHANGE ACC BITS 0-3 AND 4-7 MOVD P5,A ;MOVE ACC BITS 0-3 TO PORT 5 6-845 INSTRUCTION SET MOVP A,@A Move Current Page Data to Accumulator oPcode:1L-1_0 ___ °....L1_0_0_ _1--J1 Note: Example: This is a 2-cycle instruction. The contents of the program memory location addressed by the accumulator are moved to the accumulator. Only bits 0-7 of the program counter are affected, limiting the program memory reference to the current page. The program counter is restored following this operation. (A) - «A» This is a 1-byte, 2-cycle instruction. If it appears in location 255 of a program memory page, @Aaddresses a location in the following page. MOV128: MOV A,#128 ;MOVE '128' DEC TO ACC MOVP A,@A ;CONTENTS OF 129TH LOCATION ;IN CURRENT PAGE ARE MOVED TO ;ACC MOVP3 A,@A Move Page 3 Data to Accumulator Opcode: Example: NOP This is a 2-cycle instruction. The contents of the program memory location within page 3, addressed by the accumulator, are moved to the accumulator. The program counter is restored following this operation. (A) - «A» within page 3 Look up ASCII equivalent of hexadecimal code in table contained at the beginning of page 3. Note that ASCII characters are designated by a 7-bit code; the eighth bit is always reset. TABSCH: MOV A,#OB8H ;MOVE 'B8' HEX TO ACC (10111000) ANL A,#7FH ;LOGICAL AND ACC TO MASK BIT ;7 (00111000) MOVP3, A,@A ;MOVE CONTENTS OF LOCATION ;'38' HEX IN PAGE 3 TO ACC ;(ASCII'8') Access contents of location in page 3 labelled TAB 1. Assume current program location is not in page 3. TABSCH: MOV A,#TAB1 ;ISOLATE BITS 0-7 ;OF LABEL ;ADDRESS VALUE MOVP3 A,@A ;MOVE CONTENT OF PAGE 3 ;LOCATION LABELED 'TAB1' ;TOACC The NOP Instruction Opcode: I0 0 0 0 I0 0 0 0 No operation is performed. Execution continues with the following instruction. ORL A,Rr Opcode: Example: Logical OR Accumulator With Register Mask ~1_0______0 __0~1_1___r_2__r_1__ro-"1 Data in the accumulator is logically ORed with the mask contained in working register 'r'. r=0-7 (A) - (A) OR (Rr) ORREG: ORL A,R4 ;'OR' ACC CONTENTS WITH ;MASK IN REG 4 6-846 INSTRUCTION SET ORL A,@Rr Opcode: Logical OR Accumulator With Memory Mask 1,-0_ _ _ 0 _0-LI_o_o_o_r--,1 Data in the accumulator is logically ORed with the mask contained in the data memory location referenced by register 'r', bits 0-5. (A) ... (A) OR «Rr» r=0-1 ORDM: MOVE RO,#3FH ;MOVE '3F' HEX TO REG ORL A,@RO ;'OR' ACC CONTENTS WITH MASK ;IN LOCATION 63 ° Example: ORL A, #data Opcode: Example: Logical OR Accumulator With Immediate Mask 1-10_ _ _ 0 _0-,-1_o_o_ _1--,1 • 1d7 d6 d5 d41 d3 d2 d 1 dO 1 This is a 2-cycle instruction. Data in the accumulator is logically ORed with an immediately-specified mask. (A) -- (A) OR data ORID: ORL A,#'X' ;'OR' ACC CONTENTS WITH MASK ;01011000 (ASCII VALUE OF 'X') ORL Pp,#data Logical OR Port 1-2 With Immediate Mask Example: This is a 2-cycle instruction. Data on port 'p' is logically ORed with an immediately-specified mask. p= 1-2 (see OUTL instruction) (Pp) -- (Pp) OR data ORP1: ORL P1,#OFFH ;'OR' PORT 1 CONTENTS WITH ;MASK 'FF' HEX (SET PORT 1 'TO ALL ONES) . ORLO Pp,A Logical OR Port 4-7 With Accumulator Mask Opcode: Example: OUT OBB,A Opcode: Example: 11 °°° 11 1 P1 PO 1 This is a 2-cycle instruction. Data on 8243 port 'p' is logically ORed with the digit mask contained in accumulator bits 0-3, (Pp) (Pp) OR (AO-3) p=4-7 (See MOVD instruction) ORP7: ORLD P7,A ;'OR' PORT 7 CONTENTS ;WITH ACC BITS 0-3 Output Accumulator Contents to Data Bus Buffer 1 °°°° 10 0 0 1 Contents of the accumulator are transferred to the Data Bus Buffer Output register and the Output Buffer Full (OBF) flag is set to one. (DBB) -- (A) OBF-1 OUTDBB: OUT DBB,A ;OUTPUT THE CONTENTS OF ;THE ACC TO DBBOUT 6-847 INSTRUCTION SET OUTl Pp,A Opcode: Output Accumulator Data to Port 1 and 2 0_0 _ _ _1--L1_1_0_p_1_p----'01 L-I This is a 2-cycle instruction. Data residing in the accumulator is transferred (written) to port 'p' and latched. (Pp) - (A) P= 1-2 Note: Bits 0.;.1 of the opcode are used to represent PORT 1 and PORT 2. If you are coding in binary rather than assembly language, the mapping is as follows: Bits Example: RET p1 o pO Port 0 --X o 1 1 102 1 1 X OUTlP: MOV A,R7 ;MOVE REG 7 CONTENTS TO ACC OUTl P2,A ;OUTPUT ACC CONTENTS TO PORT2 MOV A,R6 ;MOVE REG 6 CONTENTS TO ACC OUTl P1,A ;OUTPUT ACC CONTENTS TO PORT 1 Return Without PSW Restore Opcode: '11 0 0 0 10 0 This is a 2-cycle instruction. The stack pOinter (PSW bits 0-2) is decremented. The program counter is then restored from the stack. PSW bits 4-7 are not restored. (SP) - (SP) - 1 (PC) - «SP» RETR Return With PSW Restore Opcode: 11001100 This is a 2-cycle instruction. The stack pointer is decremented. The program counter and bits 4-7 of the PSW are then restored from the stack. Note that RETR should be used to return from an interrupt, but should not be used within the interrupt service routine as it signals the end of an interrupt routine. (SP) - (SP) - 1 (PC) - «SP» (PSW4-7) - «SP» Rl A Rotate left Without Carry Opcode: Example: 11 0 10 The contents of the accumulator are rotated left one bit. Bit 7 is rotated into the bit 0 position. (A n+1) -- (An) n=0-6 (AO) - (A7) Assume accumulator contains 10110001. RlNC: Rl A ;NEW ACC CONTENTS ARE 01100011 6-848 INSTRUCTION SET RLC A Rotate Left Through Carry Opcode: Example: RR A LI1_ _ _1---...l.-10_ _ _1-,1 The contents of the accumulator are rotated left one bit. Bit 7 replaces the carry bit; the carry bit is rotated . into the bit 0 position. (A n+1) - (An) n=0-6 (AO) - (C) (C) - (A7) Assume accumulator contains a 'signed' number; isolate sign without changing value. RLTC: CLR C ;CLEAR CARRY TO ZERO RLC A ;ROTATE ACC LEFT, SIGN ;BIT (7) IS PLACED IN CARRY RR A ;ROTATE ACC RIGHT - VALUE ;(BITS 0-6) IS RESTORED, ;CARRY UNCHANGED, BIT 7 ;IS ZERO Rotate Right Without Carry Opcode: Example: RRC A '-1_0_ _ _ _1---11_0_ _ _ _---' The contents of the accumulator are rotated right one bit. Bit 0 is rotated into the bit 7 position. n=0-6 (An) - (A n+1) (A7) - (AO) Assume accumulator contains 10110001. RRNC: RRA ;NEW ACC CONTENTS ARE 11011000 Rotate Right Through Carry Opcod~ Example: SEL RBO Opcode: 10 0 10 The contents of the accumulator are rotated right one bit. Bit 0 replaces the carry bit; the carry bit is rotated into the bit 7 position. n=0-6 (An) - (A n+1) (A7) - (C) (C) - (AO) Assume carry is not set and accumulator contains 10110001. RRTC: RRCA ;CARRY IS SET AND ACC ;CONTAINS 01011000 Select Register Bank 0 LI_1___0__0--'-1_0___0_---' PSW BIT 4 is set to zero. References to working registers 0-7 address data memory locations 0-7. This is the recommended setting for normal program execution. (BS) - 0 6-849 INSTRUCTION SET SEL RB 1 Select Register Bank 1 Opcode: Example: ~I_1_____0___1-L1_o_____o__~ PSW bit 4 is set to one. References to working registers 0-7 address data memory locations 24-31. This is the recommended setting for interrupt service routines, since locations 0-7 are left intact. The setting of PSW bit 4 in effect at the time of an interrupt is restored by the RETR instruction when the interrupt service routine is completed. (BS) - 1 Assume an IBF interrupt has occurred, control has passed to program memory location 3, and PSW bit 4 was zero before the interrupt. LOC3: JMP INIT ;JUMP TO ROUTINE 'INIT' SEL RB1 MOV R7,#OFAH ;MOV ACe CONTENTS TO ;LOCATION 7 ;SELECT REG BANK 1 ;MOVE 'FA' HEX TO LOCATION 31 SEL RBO MOVA,R7 RETR ;SELECT REG BANK ;RESTORE ACC FROM LOCATION 7 ;RETURN--RESTORE PC AND PSW INIT: MOV R7,A STOP TCNT Opcode: Example: ° Stop Timer IEvent Counter ILo_______o--'-l_o___o_---' This instruction is used to stop both time accumulation and event counting. Disable interrupt, but jump to interrupt routine after eight overflows and stop timer. Count overflows in register 7. START: DIS TCNTI ;DISABLE TIMER INTERRUPT CLR A ;CLEAR ACC TO ZERO MOV T,A :MOV ZERO TO TIMER MOV R7,A :MOVE ZERO TO REG 7 STRT T ;START TIMER MAIN: JTF COUNT ;JUMP TO ROUTINE 'COUNT' ;IF TF= 1 AND CLEAR TIMER FLAG JMP MAIN ;CLOSE LOOP COUNT: INC R7 ;INCREMENT REG 7 MOV A,R7 ;MOVE REG 7 CONTENTS TO ACC JB3 INT ;JUMP TO ROUTINE 'INT' IF ACC ;BIT 3 IS SET (REG 7=8) JMP MAIN ;OTHERWISE RETURN TO ROUTINE ;MAIN INT: STOP TCNT JMP 7H ;STOP TIMER ;JUMP TO LOCATION 7 (TIMER ;INTERRUPT ROUTINE) 6-850 INSTRUCTION SET STRT CNT Opcode: Example: STRT T Opcode: Example: SWAP A Opcode: Example: XCH A,Rr Opcode: Example: Start Event Counter 0_ _ _ 0 _0--'-_o_ _o_1----'1 ,-I The TEST 1 (T 1) pin is enabled as the event-counter input and the counter is started. The event-counter register is incremented with each high to low transition on the T 1 pin. Initialize and start event counter. Assume overflow is desired with first T 1 input. ST ARTC: EN TCNT! ;ENABLE COUNTER INTERRUPT MOV A,#OFFH ;MOVE 'FF' HEX (ONES) TO ;ACC MOV T,A ;MOVE ONES TO COUNTER STRT CNT ;INPUT AND START Start Timer ~I_0_____0____~1_o_____o__~ Timer accumulation is initiated in the timer register. The register is incremented every 32 instruction cycles. The prescaler which counts the 32 cycles is cleared but the timer register is not. Initialize and start timer. STARTT: EN TCNT! ;ENABLE TIMER INTERRUPT CLR A :CLEAR ACC TO ZEROS MOV T,A ;MOVE ZEROS TO TIMER STRT T ;START TIMER Swap Nibbles Within Accumulator '-10_ _ _ 0_0--'-1_0_ _ _----'11 Bits 0-3 of the accumulator are swapped with bits 4-7 of the accumulator. (A4-7) - - (AO-3) Pack bits 0-3 of locations 50-51 into location 50. PCKDIG: MOV RO,#50 ;MOVE '50' DEC TO REG MOV R1,#51 ;MOVE '51' DEC TO REG 1 XCHD A,@RO ;EXCHANGE BIT 0-3 OF ACC ;AND LOCATION 50 SWAP A ;SWAP BITS 0-3 AND 4-7 OF ACC XCHD A,@R1 ;EXCHANGE BITS 0-3 OF ACC AND ;LOCATION 51 MOV @RO,A ;MOVE CONTENTS OF ACC TO ;LOCATION 51 ° Exchange Accumulator-Register Contents _0__0______0-L1_1__r_2__r_1__ ro~1 LI The contents of the accumulator and the contents of working register 'r' are exchanged. r=0-7 (A) - - (Rr) Move PSW contents to Reg 7 without losing accumulator contents. XCHAR7: XCH A,R7 ;EXCHANGE CONTENTS OF REG 7 ;AND ACC MOV A,PSW ;MOVE PSW CONTENTS TO ACC XCH A,R7 ;EXCHANGE CONTENTS OF REG 7 ;AND ACC AGAIN 6-851 INSTRUCTION SET XCH A,@Rr Exchange Accumulator and Data Memory Contents Opcode: LIo_o_ _ _ 0--LI_o_o_o_r--l1 The contents of the accumulator and the contents of the data memory location addressed by bits 0-5 of register 'r' are exchanged. Register 'r' contents are unaffected. r=0-1 (A) - - «Rr» Decrement contents of location 52. DEC52: MOV RO,#52 ;MOVE '52' DEC TO ADDRESS ;REGO XCH A, @RO ;EXCHANGE CONTENTS OF ACC ;AND LOCATION 52 DEC A ;DECREMENT ACC CONTENTS XCH A,@RO ;EXCHANGE CONTENTS OF ACC ;AND LOCATION 52 AGAIN Example: XCHD A,@Rr Opcode: Example: XRL A,Rr Opcode: Example: XRL A,@Rr Opcode: Example: Exchange Accumulator and Data Memory 4-bit Data L.1_O_O_ _ _1--L1_0_0 __0__r--..-J1 This instruction exchanges bits 0-3 of the accumulator with bits 0-3 of the data memory location addressed by bits 0-5 of register 'r'. Bits 4-7 of the accumulator, bits 4-7 of the data memory location, and the contents of register 'r' are unaffected. (AO-3) - - «RrO-3» r=0-1 Assume program counter contents have been stacked in locations 22-23. XCHNIB: MOV RO,#23 ;MOVE '23' DEC TO REG CLR A ;CLEAR ACC TO ZEROS XCHD A,@RO ;EXCHANGE BITS 0-3 OF ACC ;AND LOCATION 23 (BITS 8-11 ;OF PC ARE ZEROED, ADDRESS ;REFERS TO PAGE 0) ° Logical XOR Accumulator With Register Mask IL_1___0__1-L1_1_r_2_r1_._ro---,1 Data in the accumulator is EXCLUSIVE ORed with the mask contained in working register 'r'. r=0-7 (A) -- (A) XOR (Rr) XORREG: XRL A,R5 ;'XOR' ACC CONTENTS WITH ;MASK IN REG 5 Logical XOR Accumulator With Memory Mask 0 _ 0_--,r1 _1_ _0__1...11_0__ ,-I Data in the accumulator is EXCLUSIVE ORed with the mask contained in the data memory location addressed by register 'r', bits 0-5. (A) -- (A) XOR «Rr» r=0-1 XORDM: MOV R1,#20H ;MOVE '20' HEX TO REG 1 XRL A,@R1 ;'XOR' ACC CONTENTS WITH MASK ;IN LOCATION 32 6-852 INSTRUCTION SET XRL A,#data Logical XOR Accumulator With Immediate Mask Opcode: Example: This is a 2-cycle instruction. Data in the accumulator is EXCLUSIVE ORed with an immediately-specified mask. (A) - (A) XOR data XORID: XOR A,#HEXTEN ;XOR CONTENTS OF ACC WITH ;M~SK EQUAL VALUE OF SYMBOL ;'HEXTEN' 6-853 CHAPTER 4 SINGLE-STEP, PROGRAMMING, AND POWER-DOWN MODES SINGLE-STEP Figure 4-1 illustrates a recommended circuit for single-step operation, while Figure 4-2 shows the tim!!!g relationship between the SYNC output and the SS input. During single-step operation, PORT 1 and part of PORT 2 are used to output address information. In order to retain the normal I/O functions of PORTS 1 and 2, a separate latch can be used as shown in Figure 4-3. The UPI family has a single-step mode which allows the user to manually step through his program one instruction at a time. While stopped, the address of the next instruction to be fetched is available on PORT 1 and the lower 2 bits of PORT 2. The singlestep feature simplifies program debugging by allowing the user to easily follow program execution. +5v +5V 10k 10k HALT PRESET fl} MOMENTARY PUSH TO STEP +5V o +5V 0 0 +5V o TOSS INPUT ON 8741A L-----------~>CLOCK 10k CLEAR FROM '------- C X :: PC8-9 >C \~ 55 OUTPUT I STOP CYCLE ACTIVE CYCLE Figure 4-2. 55 BUTTON Single-Step Timing 6-854 ACTIVE CYCLE SINGLE-STEP, PROGRAMMING, & POWER-DOWN MODES SYNC .,0 .,. 8041AH 8042 8741A 8742 010 .'0 DATA IN .11 011 01 • .,. 01. .,5 015 .'6 016 013 .,3 .17 ,, 017 ,:-.. +5Y , "::' +5Y SYNC ADDRESS DISPLAY 10k ILEDI .17 OC = OPEN COLLECTOR TTL LS = LOW POWER SCHOTTKLY TTL Figure 4-3. Latching Port Data Timing The sequence of single-step operation is as follows: 1) The processor is requested to stop by applying a low level on SS. The SS input should not be brought low while SYNC is high. (The UPI samples the SS pin in the middle of the SYNC pulse). 2) The processor responds to the request by stopping during the instruction fetch portion of the next instruction. If a double cycle instruction is in progress when the single-step command is received, both cycles will be completed before stopping. 3) The processor acknowledges it has entered the stopped state by raising SYNC high. In this state, which can be maintained indefinitely, the IO-bit address of the next instruction to be fetched is present on PORT 1 and the lower 2 . bits of PORT 2. 4) P17INPUT DATA SS is then raised high to bring the processor out of the stopped mode allowing it to fetch the next instruction. The exit from stop is indicated by the processor bringing SYNC low. 5) To stop the processor at the next instruction SS must be brought low again before the next SYNC pulse-the circuit in Figure 4-1 uses the trailing edge of the previous pulse. If SS is left high, the processor remains in the "RUN" mode. Figure 4-1 shows a schematic for implementing single-step. A single D-type flip-flop with preset and clear is used to generate SS. In the RUN mode SS if>· held high by keeping the flip-flop preset (preset has precedence over the clear input). To enter singlestep, preset is removed allowing SYNC to bring SS low via the clear input. Note that SYNC must be buffered since the SN7474 is equivalent to 3 TTL loads. The processor is now in the stopped state. The next instruction is initiated by clocki~'I" into the flipflop. This "I" will not appear on SS unless SYNC is high (i.e., clear must be removed from the flip-flop). In response to SS going high, the processor begins an instruction fetch which brings SYNC low. SS is then reset through the clear input and the processor again enters the stopped state. 6-855 SINGLE-STEP, PROGRAMMING, & POWER-DOWN MODES PROGRAMMING, VERIFYING AND ERASING EPROM (8741A, 8742 EPROM ONLY) The internal Program Memory of the 8741A and 8742 may be erased and reprogrammed by the user as explained in the following sections. See the data sheet for more detail. • c P20, P21 AddressInput • VDD Programming Power Supply • PROG Program Pulse Input NOTE: All set-up and hold times are 4 cycles. The detailed Programming sequence (for one byte) is as follows: Programming The programming procedure consists of the following: activating the program mode, applying an address, latching the address, applying data, and applying a programming pulse. Each word is programmed completely before moving on to the next and is followed by a verification step. Figure 4-4 illustrates the programming and verifying sequence. The following is a list of the pins used for programming and a description of their functions: • XTAL 1, Clock Inpqt XTAL2 1) Initial Conditions: VCC = VDD = 5V; Clock Running; AO = OV, CS = 5V; EA = 5V; DO-D7 and PROG Floating. 2) RESET = OV, TEST 0 = OV (Select Programming Mode); 3) EA = 23V for 8741A EA = l8V for 8742 • RESET Initialization and Address Latching 4) Address applied to DO-D7 and PORTS 20-22. • TEST 0 Selection of Program or Verify Mode 5) RESET = 5V (Latch Address). • EA Activation of Program/Verify Modes 6) Data applied to DO-D7. • DO-D7 Address and Data Input Data Output During Verify 7) VDD = 25V for 8741A VDD = 21 V for 8742 (Programming Power). +5V RESET BUS AND PROG CAN BE DRIVEN ONL V DURING THIS TIME +sv TEST 0 +23V/+1BV EA +sv PO·P7 ( ADDRESS 0-7 P20-21 ( ADDRESS AO-Ag H DATA ) ) +25V/+21V VDD +sv +5V PROG +OV , +23V/+21V Figure 4-4. I Programming Sequence 6-856 L, -GJ[ OUT SINGLE-STEP, PROGRAMMING, & POWER-DOWN MODES 8) PROG = OV followed by one 50 msec pulse of 23V for 8741A PROG = OV followed by one 50 msec pulse of 18V for 8742. 9) VDD = 5V. 10) TEST 0 = 5V (Select Verify Mode). 11) Read data on DO-D7 and verify EPROM cell contents. WARNING An attempt to pro'gram a mis-socketed 8741A or 8742 will result in severe damage to the part. An indication of a properly socketed part is the appearance of the SYNC clock output. The lack of this clock may be used to disable the programmer. Verification Verification is accomplished by latching in an address as in the Programming Mode and then applying "I" to the TEST 0 input. The word stored at the selected address then appears on the DO-D7 lines. Note that verification can be applied to both ROM's and EPROM's independently of the programming procedure. See the data sheet. The detailed Verifying sequence (for one byte) is as , follows: 1) Initial Conditions: VCC = VDD = 5V; Clock Running; AO = OV, CS = 5V; EA = 5V; DO-D7 and PROG Floating. 2) RESET 3) EA = 23V for 8741A EA = 18V for 8742 4) Address applied to DO-D7 and PORTS 20-22. 5) RESET = 5V (Latch Address) 6) Read data on DO-D7 and verify EPROM cell contents. = OV, TEST 0 = 5V (Verify Mode). Erasing The program memory of the 8741A or 8742 may be erased to zeros by exposing its translucent lid to shortwave ultraviolet light. EPROM Light Sensitivity The erasure characteristics of the 8741A or 8742 EPROM are such that erasure begins to occur when exposed to light with wavelengths shorter than approximately 4000 Angstroms. It should be noted that sunlight and certain types of fluorescent lamps have wavelengths in the 3000-4000 Angstrom range, Data shows that constant exposure to room level fluorescent lighting could erase the typical 8741A in approximately 3 years while it would take approximately 1 week to cause erasure when exposed to direct sunlight. If the 8741A or 8742 is to be exposed to these types of lighting conditions for extended periods of time, opaque labels (available from Intel) should be placed over the 8741A or 8742 window to prevent unintentional erasure. The recommended erasure procedure for the 8741A or 8742 is exposure to shortwave ultraviolet light which has a wavelength of 2537 Angstroms. The integrated dose (i.e., UV intensity X exposure time) for erasure should be a minimum of 15W -sec/cm 2 power rating. The erasure time with this dosage is approximately 15 minutes using an ultraviolet lamp with a 12,000 /lW/cm 2 power rating. The 8741A or 8742 should be placed within 1 inch of the lamp tubes during erasure. Some lamps have a filter on their tubes which should be removed before erasure. EXTERNAL ACCESS The UPI family has an External Access mode (EA) which puts the processor into a test mode. This mode allows the user to disable the internal program memory and execute from external memory. External Access mode is useful in testing because it allows the user to test the processor's functions directly. It is only useful for testing since this mode uses DO-D7, PORTS 10-17 and PORTS 20-22. This mode is invoked by connecting the EA pin to 5V. The 11-bit current program counter contents then come out on PORTS 10-17 and PORTS 20-22 after the SYNC output goes high. (PORT 10 is the least significant bit.) The desired instruction opcode is placed on DO-D7 before the start of state Sl. During state Sl, the opcode is sampled from DO-D7 and subsequently executed in place of the internal program memory contents. The program counter contents are multiplexed with the I/O port data on PORTS 10-17 and PORTS 2022. The I/O port data may be de multiplexed using an external latch on the rising edge of SYNC. The program counter contents may be demultiplexed similarly using the trailing edge of SYNC. Reading and/or writing the Data Bus Buffer registers is still allowed although only when DO-D7 are not being sampled for opcode data. In practice, since this sampling time is not known externally, reads or 6-857 SINGLE-STEP, PROGRAMMING, & POWER-DOWN MODES writes on the system bus are done during SYNC high time. Approximately 600ns are available for each read or write cycle. early enough to guarantee the 8041AH or 8042 can save all necessary data before Vee falls outside normal operating tolerance. POWER DOWN MODE (8041AH/8042 ROM ONLY) Extra circuitry is included in the ROM version to allow low-power, standby operation. Power is removed from all system elements except the internal data RAM in the low-power mode. Thus the contents of RAM can be maintained and the device draws only 10 to 15% of its normal power. The Vee pin serves as the 5V power supply pin for all of the ROM version's circuitry except the data RAM array. The VDD pin supplies only the RAM array. In normal operation, both Vee and VDD are connected to the same 5V power supply. To enter the Power-Down mode, the RESET signal to the UPI is asserted. This ensures the memory will not be inadvertently altered by the UPI during power-down. The Vee pin is then grounded while VDD is maintained at 5V. Figure 4-5 illustrates a recommended Power-Down sequence. The sequence typically occurs as follows: 1) 2) A "Power Failure" signal is used to interrupt the processor (via a timer overflow interrupt, for instance) and call a Power Failure service routine. 3) The Power Failure routine saves all important data and machine status in the RAM array. The routine may also initiate transfer of a backup supply to the VDn pin and indicate to external circuitry that the Power Failure routine is complete. 4) A RESET signal is applied by external hardware to guarantee data will not be altered as the power supply falls out of limits, RESE~ must be low until Vee reaches ground potential. Recovery from the Power-Down mode can o~cu~ as any other power-on sequence. An external 1 /-tfd capacitor on the RESET input will provide the necessary initialization pulse. Imminent power supply failure is detected .by user defined circuitry. The signal must occur 1'\ POWER SUPPLY PROCESSOR 1 I INTERRUPTED / PO~i~ ~v~~~r I I1 I 1 I NORMAL I 1 _______ 1_ _ _ __;I1 1 1I FOllOWS -----". . I I-----!-----I--------- ~~6'J:N~~ ~I RE~ '"I- - - - . . . - I I LJI . 1--------- ~I--_,--~ILI------r---DATA SAVE ROUTINE EXECUTED Figure 4-5. ACCESS TO DATA RAM INHIBITED .Power-Down Sequence 6-858 CHAPTER 5 SYSTEM OPERATION BUS INTERFACE the system Data Bus. The OBF flag is cleared automatically. The UPI-4IAH, 42 Microcomputer functions as a peripheral to a master processor by using the data bus buffer registers to handle data transfers. The DBB configuration is illustrated in Figure 5-1. The UPI-4IAH, 42 Microcomputer's 8 three-state data lines (D7-DO) connect directly to the master processor's data bus. Data transfer to the master is controlled by 4 external inputs to the UPI: • AO Address Input signifying command or data Chip Select • Read strobe • Write strobe • CONTROL BUS Reading STATUS The sequence for reading the UPI-4IAH, 42 Microcomputer's 8 STATUS bits is shown in Figure 5-3. This operation causes the 8-bit STATUS register contents to be placed on the system Data Bus as shown. Write Data to DBBIN The sequence for writing data to the DBBIN register is shown in Figure 5-4. This operation causes the system Data Bus contents to be transferred to the DB BIN register and the IBF flag is set. Also, the FI flag is cleared (FI = 0) and an interrupt request is generated. When the IBF interrupt is enabled, a jump to location 3 will occur. The interrupt request is cleared upon entering the IBF service routine or by a system RESET input. WR RO cs AD AD Reading the DBBOUT Register The sequence for reading the DBBOUT register is shown in Figure 5-2. This operation causes the 8-bit contents of the DBBOUT register to be placed on 6-859 iiii ------..\~_ __ ' ; _ _ DATA ---«'----~)- ST7 5T6 STS . ST4 07 06 05 04 Figure 5-3. 03 FO IBF OBF 02 01 00 Status Read SYSTEM OPERATION AO AO 1 Wii - - -..... Wii - -.......\ ' -______ \"'"---_....Jf DATA -< Figure 5-4. )- DATA Figure 5-5. Writing .Data to DBBIN Writing Commands to DBBIN The sequence for writing commands to the DBBIN register is shown in Figure 5-5. This sequence is identical to a data write except that the AO input is latched in the F1 flag (F1 = 1). The IBF flag is set and an interrupt request is generated when the master writes a command to DBB. Operations of Data Bus Registers The UPI-41AH, 42 Microcomputer controls the transfer of DBB data to its accumulator by executing INput and OUTput instructions. An IN A,DBB instruction causes the contents to be transferred to the UPI accumulator and the IBF flag is cleared. , The OUT DBB,A instruction causes the contents of the accumulator to be transferred to the DBBOUT register. The OBF flag is set. The UPI's data bus bufferinterface is applicable to a variety of microprocessors including the 8086, 8088, 8085AH, 8080, and 8048. A description of the interface to each of these processors follows. DESIGN EXAMPLES 8085AH Interface Figure 5-6 illustrates an 8085AH system using a UPI-41AH, 42. The 8085AH system uses a multiplexed address and data bus. During I/O the 8 upper address lines (A8-A15) contain the same I/O address as the lower 8 address/data lines (AO-A7); therefore I/O address decoding is done using only the upper 8 lines to eliminate latching of the address. An 8205 decoder provides address decoding for both the UPI-41AH, 42 and the 8237. Data is transferred -< )- Writing Commands to DBBIN using the two DMA handshaking lines of PORT 2. The 8237 performs the actual bus transfer operation. Using the UPI-41AH, 42's OBF master interrupt, the UPI-41A notifies the 8085AH upon transfer completion using the RST 5.5 interrupt input. The IBF master interrupt is not used in this example. 8088 Interface Figure 5-7 illustrates a UPI-41AH, 42 interface to an 8088 minimum mode system. Two 8-bit latches are used to demultiplex the address and data bus. The address bus is 20-lines wide. For I/O only, the lower 16 address lines are used, providing an addressing range of 64K. UPI address selection is accomplished using an 8205 decoder. The AO address line of the bus is connected to the corresponding UPI input for register selection. Since the UPI-41A is polled by the 8088, neither DMA nor master interrupt capabilities of the UPI-41AH, 42 are used in the figure. 8086 Interface The UPI-41AH, 42 can be used on an 8086 maximum mode system as shown in figure 5-8. The address and data bus is demultiplexed using three 8282 latches providing separate address and data buses: The address bus is 20-lines wide and the data bus is 16-lines wide. Multiplexed control lines are decoded by the 8288. The UPI's CS input is provided by linear selection. Note that the UPI-41AH, 42 is both I/O mapped and memory mapped as a result of the linear addressing technique. An address decoder may be used to limit the UPI-41AH, 42 to a specific I/O mapped address. Address line Al is connected to the UPI's AO input. This insures that the registers of the UPI will have even I/O addresses. Data will be transferred on DO-D7 lines only. This allows the I/O registers to be accessed using byte manipulation instructions. 6-860 SYSTEM OPERATION a085AH IO/M E3 ALE E2 00 AO-A2 0, ADDRESS Aa- A 15 ADO-AD? r-r- ADDRESS/OATA I' I ~ WR AO 1/'-""""........,1 DBB B041AH 8741A 8042 8742 #1 cs t---:"......,,~ 8041AH WR 8741A AO 8042 1/'",""",-" DBB 9742 P2, #2 RD,WR 8048 PORT 0 I¢=:A~~~ DATA BUS CONTROL BUS cs r:::::I::::~ ~ AO ,/,"-=--'" B041AH 8:~~A DBB 8742 #N N .$. 7 Figure 5-11. Distributed Processor System 6-864 110 Chapter 6 APPLICATIONS ABSTRACTS The UPI-41A is designed to fill a wide variety of low to medium speed peripheral interface applications where flexibility and easy implementation are important considerations. The following examples illustrate some typical applications. Keyboard Encoder Figure 6-1 illustrates a keyboard encoder configuration using the UPI and the 8243 I/O expander to scan a 128-key matrix. The encoder has switch matrix scanning logic, N-key rollover logic, ROM look-up table, FIFO character buffer, and additional outputs for display functions, control keys or other special functions. PORT 1 and PORTs 4-7 provide the interface to the keyboard. PORT 1 lines are set one at a time to select the various key matrix rows. When a row is energized, all 16 columns (Le., PORTs 4-7 inputs) are sampled to determine if any switch in the row is closed. The scanning software is code efficient because the UPI instruction set includes individual bit set/clear operations and expander PORTs 4-7 can be directly addressed with single, 2byte instructions. Also, accumulator bits can be tested in a single operation. Scan time for 128 keys is about 10 ms. Each matrix point has a unique binary code which is used to address ROM when a key closure is detected. Page 3 of ROM contains a look-up table with useable codes (Le., ASCII, EBCDIC, etc.) which correspond to each key. When a valid key closure is detected the ROM code corresponding to that key is stored in a FIFO buffer in data memory for transfer to the master processor. To avoid stray noise and switch bounce, a key closure must be detected on two consecutive scans before it is considered valid and loaded into the FIFO buffer. The FIFO buffer allows multiple keys to be processed as they are depressed without regard to when they are released, a condition known as N-key rollover. The basic features of this encoder are fairly standard and require only about 500 bytes of memory. Since the UPI is programmable and has additional memory capacity it can handle a number of other functions. For example, special keys can be programmed to give an entry on closing as well as opening. Also, I/O lines are available to control a 16-digit, 7-segment display. The UPI can also be programmed to recognize special combinations of characters such as commands, then transfer only the decoded information to the master processor. A complete keyboard application has been developed for the UPI-41A. A description is included in this section. The code for the application is available in the Intel Insite Library (program AB 147). PORT 4 4 . PORTS 4 '"z PORT 6 4 u PORT 7 4 ''3" 8243 EXPANDER 1i PORT 2 KEYBOARD MATRIX 0 :!! 8 ROWS ~ 0u r ! PROG 11 9~ !!. ~ 0- n !l; B :l u a: ' PORT 1 I PORr 2 B041A/B741A a CONTROL DBB INTERFACE TO 8-BIT MASTER PROCESSOR ... 'I DATA BUS l I ...'l CONTROL BUS Figure 6-1. ..'l Keyboard Encoder Configuration 6-865 APPLICATIONS Matrix Printer Interface The matrix printer interface illustrated in Figure 6-2 is a typical application for the UPI-41A. The actual printer mechanism could be any of the numerous dot-matrix types and .similar configurations can be shown for drum, spherical head, daisy wheel or chain type printers. The 8295 Printer Controller is an example of an S041A preprogrammed as a dot matrix printer interface. Tape Cassette Controller. Figure 6-3 illustrates a digital cassette interface which can be implemented with the UPI-41A. Two sections of the tape transport are controlled by the UPI: digital data!command logic, and motor servo control. The bus structure shown represents a generalized, 8bit system bus configuration. The UPl's three-state interface port and asynchronous data buffer registers allowit to connect directly to this type of system for efficient, two-way data transfer. The motor servo requires a speed reference in the form of a monostable pulse whose width is proportional to the desired speed. The UPI monitors a prerecorded clock from the tape and uses its onboard· interval timer to generate the required speed reference pulses at each clock transition. The UPl's two on-board I/O ports provide up to 16 input and output signals to control the printer mechanism. The timer/event counter is used for generating a timing sequence to control print head position, line feed, carriage return, and other sequences. The on-board program memory provides character generation for 5 X 7, 7 X 9, or other dot matriX formats. As an added feature a portion of the 64 X 8-bit data memory can be used as a FIFO buffer so that the master processor can send a block of data at a high rate. The UPI can then output characters from the buffer at a rate the printer can accept while tpe master processor returns to other tasks. Recorded data from the tape is supplied serially by the data/command logic and is converted to 8-bit words by the UPI, then transferred to the master processor. At 10 ips tape speed the UPI can easily handle the SOOO bps data rate. To record data, the UPI uses the two input lines to the data/command logic which control the flux direction in the recording head. The·UPI also monitors 4 status lines from the tape transport including: end of tape, cassette DOT MATRIX PRINTER FORM PRINT l.F. SOLENOIDS HOLD z 0 z ~ ..... ~.. ..fa .. g 0 MOTOR DRIVERS I 1= 0 ill 0 ~ w w u. ~ ~ I SOLENOID DRIVERS 1 [70R9 PORT 2 PQRT2 PORT 1/PORT 2 8041A/8741A 099 CONTROL n n 8 4 O· INTERFACE ~ j DATA BUS l TO 8-BIT MASTER PROCESSOR ) CONTROL· BUS Figure 6-2. Matrix Printer Controller 6-866 j APPLICATIONS DATA EOT/BOT 18 1 ". 0007 '" P22 "3 +5V 620 +5V 620 P25 5.5296 MH. P26 )0-->----1 XTAL 1 P27 L:--_ _ _ _ _ _ _--jXTAL 2 V55 Figure 11.UPllnterface on iSBC 80/30 + 5V 00 Figure 12. LED Multiplexing 6-879 APPLICATIONS + 5V ./""' .../"' - -I ~ ----------------- rrrr- !-- "0 "" ../" l> "" III" '" " .I'-----" l> -I ~ l> L Cs .r- M WR E3 E2 00 01 - 02 8205 03 3 r - - - E1 2 r - - - A2 PORT 21 1 A1 O r - - - AO AO r--- 7 6 5 8741A PORT 1: (;l r--- dp I-- 9 I-I-I-I-- e r--- • 3 2 1 r-- 0 ...... '"'- 07 DATA 8041A/ h.. O' 05 06 9~ ~ 9 9 9 9- f a 7 6 • 5 d 3 2 1 c b a SEGMENT DRIVERS Figure 13. UPI Controlled a-Digit LED Display 63 INIT DISPLAY MAP 8x8 INITIALIZE REGISTERS USER RAM 24 x 8 (NOT USeD) 31 ACCUMULATOR STORE NOT USED 2' R6 NOT USED R5 NOT USED R' DIGIT COUNTER R3 TEMPORARY STORE R2 NOT USED R1 - DISPLAY MAP POINTER TURN OFF ALL DRIVERS R7 FILL DI$PLA Y MAP WITH BLANK CHARACTERS REGISTER BANK 1 CLEAR DIGIT COUNTER LOAD AND START TIMER RO 23 STACK 16 x 8 UNUSED 8xa ENABLE TIMER AND ISF INTERRUPTS REGISTER BANK 0 WAIT LOOP OR FOREGROUND TASK CODe Figure 14. Figure 14A. LED Display Controller Data Memory Allocation 6-880 INIT Routine Flow DIGIT DRIVERS APPLICATIONS D15PLA INPUT SWITCH TO RB1 SAVE ACCUMULATOR SWITCH TO RB1 SAVE ACCUMULATOR TURN OFF ALL DIGIT READ AND SAVE OBBIN DRIVERS ISOLATE DIGIT SELECT UPDATE DISPLAY MAP POINTER UPDATE DISPLAY MAP POINTER TO SELECTED DIGIT LOCATION GET SEGMENT INFO FROM DISPLAY MAP NO OUTPUT TO SEGMENT DRIVERS TURN ON DIGIT DRIVER RESTORE ACCUMULATOR RETURN Figure 14B. INPUT Routine Flow LOAD AND START TIMER RESTORE ACCUMULATOR The INPUT routine handles the character input. It is called when an IBF interrupt occurs. After the usual swapping of register banks and saving of the accumulator, DBBIN is read and stored in register R2. DBBIN contains the Display Data Word. The format for this word, Figure 15, has two fields: Digit Select and Character Select. The Digit Select field selects the digit number into which the character from the Character Select field is placed. Notice that the character set is not limited strictly to numerics, some alphanumeric capability is provided. Once DBBIN is read, the offset for the selected digit is computed and placed in the Display Map Pointer Ro.Next the segment information for the selected character is found through a look-up table starting in page 3 of the program memory. This segment information is then stored at the location pointed at by the Display Map Pointer. If the Character Select field specified a decimal point, the segment corresponding to the decimal point is ANDed into the present segment information for that digit. After the accumulator is restored, execution is returned to the main program. RETURN Figure 14C. DISPLA Routine Flow interrupt status by switching register banks and storing the Accumulator, all digit drivers are turned off. The Display Map Pointer is then updated using the Current Digit Register to point at that digit's segment information in the Display Map. This information is output to PORT 1; the segment drivers. The number of the current digit, R3, is then sent to the digit select decoder and the decoder is enabled. This turns on the current digit. The digit counter is incremented and tested to see if all eight digits have been refreshed. If so, the digit counter is reset to zero. If not, nothing is done. Finally, the timer is loaded. and restarted, the Accumulator is restored, and the routine returns execution to the main program. Thus DISPLA refreshes one digit each time it is CALLed by the timer interrupt. The digit remains on until the next time DISPLA is executed. The DISPLA routine simply implements the mUltiplexing actions described earlier. It is called whenever a timer interrupt occurs. After saving pre- The UPI software listing is included as Appendix AI. Appendix A2 shows the 8085A test routine used AFN.Q1536A 6-881 APPLICATIONS If we assume a 50 Hz refresh rate and an S-digit display, this means the DISPLA routine must be CALLed 50XS or 400 times/sec. This transfers, using the timer interval of S7 }LS at 5.5296 MHz, to a timer count of 227. (Recall from the UPI-41A User's Manual that the timer is an "S-bit up-counter".) Hence the TIME equate of 227D in the UPI listing. Obviously, different frequency sources or'display lengths would require that this equate be modified. DISPLAY DATA WORD 7 6 5 4 I 3 2 I 1 I 0 I I 'DIGIT SELECT 7 5 6 DIGIT 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 1 2 3 4 5 6 With the UPI running at 5.5296 MHz, the instruction cycle time is 2.713 }LS. The DISPLA routine requires 2S instruction cycles, therefore, the routine executes in 76 }LS. Since DISPLA is CALLed 400 times/sec, the total time spent refreshing the display during one second is then 30 ms or 3 % of the total UPI-time. This leaves 97.0% for any foreground tasks that could be added. 7 8 I CHARACTER SELECT Figure 15. 4 3 2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0- 0 0 0 0 1 1 1 1 0 0 0 0 11 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 CHAR a 1 2 i While the basic UPI software is useful just as it stands, there are several enhancements that could be incorporated depending on the application. Auto-incrementing of the digit location could be added to the input routine to alleviate the need for the master to keep track of digit numbers. This could be (optionally) either right-handed or left-handed entry a la TI or HP calculators. The character set could be easily modified by simply changing the lookup table. The display could be expanded- to 16 digits at the expense of one additional PORT 2 digit select line, the replacement ofthe 3-to-S decoder with a 4-to-16 decoder, and S more Display Map locations. 'I 5 • 1 e q " b [ d f F 0 H 1 J L " .- Now let's move on to a slightly more complex application that is UPI output-only-a sensor matrix controller. p t u " Sensor Matrix Controller blank LED Display Controller Display Data Word Format to display the contents of a display buffer on the dis- play. The SOS5A software takes care of the display digit numbering. Since the application is input-only for the UPI, the only protocol required is that the master must test IBF before writing a Display Data Word into DBBIN. On the iSBC SO/30, the UPI frequency is at 5.5296 MHz. To obtain a flicker-free display, the whole display must be refreshed at a rate of 50 Hz or greater. Quite often a microprocessor system is called upon to read the status of a large number of simple SPST switches or sensors. This is especially true in a process or industrial control environment. Alarm systems are also good examples of systems with a large sensor population. If the number of sensors is- small, it might be reasonable to dedicate a single input port pin for each sensor. However, as the number of sensors increase, this technique becomes very wasteful. A better arrangement is to configure the sensors in a matrix organization like that shown in Figure ·16. This arrangement of 16 sensors requires only 4 input and 4 output lines; half the number needed if dedicated inputs were used. The line saving becomes even more substantial as the number of sensors increases. AFN-01536A 6-882 APPLICATIONS In Figure 16, the basic operation of the matrix involves scanning individual row select lines in sequence while reading the column return lines. The state of any particular sensor can then be determined by decoding the row and column information. The typical configuration pulls up the column return lines and the selected row is held low. Deselected rows are held high. Thus a return line remains high for an open sensor on the selected row and is pulled low for a closed sensor. Diode isolation is used to prevent a phantom closure which would occur when a sensor is closed on a selected row and there are two or more closures on a deselected row. Germanium diodes are used to provide greater noise margin at the return line input. 2 +v 1 +v If the main processor was required to control such a matrix it would periodically have to output at the row port and then read the column return port. The processor would need to maintain in memory a map of the previous state of the matrix. A comparison of the new return information to the old information would then be made to determine whether a sensor change had occurred. Any changes would be processed as needed. A row counter and matrix map pointer also require maintenance each scan. Since in most applications sensors change very slowly compared to most processing actions, the processor probably would scan the rows only periodically with other tasks being processed between scans. Rather than require the processor to handle the rather mundane tasks of scanning, comparing, and decoding the matrix, why not use a dedicated processor? The UPI is perfect. O+v Figure 17 shows a UPI configuration for controlling up to 128 sensors arranged in a 16X8 matrix. The 4to-16 line decoder is used as the row selector to save port pins and provides the expansion to 128 sensors over the maximum of 64 sensors if the port had been used directly. It also helps increase the port drive capability. The column return lines go directly into PORT 1. Features of this design include complete matrix management. As the UPI scans the matrix it compares its present status to the previous scan. If any change is detected, the location of the change is decoded and loaded, along with the sensor's present state, into DBBOUT. This byte is called a Change Word. The Master processor has only to read one byte to determine the status and coordinate of a changed sensor. If the master had not read a previous Change Word in DBBOUT (OBF=1) before a new sensor change is detected, the new Change ROW SELECT LINES Figure 16. 4x4 Sensor Matrix DO· -y 07 "" Cs RO - PORT 1 8 RETURN LINES B041A/ 8741A 74154 WR AD FIFO NOT EMPTY OBF P24 P25 I-I-P21 I-P20 I-- P23 0 P22 C 15~ 1 16 B G: \ SELECT UNES 128 Sensor Matrix Controller 6-883 MATRIX A G1 ~ ~ Figure 17. 16 x 8 SENSOR APPLICATIONS Word is loaded into an internal FIFO. This FIFO buffers up to 40 changes before it fills. The status of the FIFO and OBF is made available to the master either by polling the UPI STATUS register, Figure 18A, or as interrupt sources on port pins P24 and P25 respectively, Figure 17. The FIFO NOT EMPTY pin and bit are true as long as there are changes not yet read in the FIFO. As long as the FIFO is not empty, the UPI monitors OBF and loads new Change Words from the FIFO into DB BOUT. Thus, the UPI provides complete FIFO management. and updates of the sensor status. Rl is a general FIFO pointer. The FIFO is implemented as a circular ,buffer with In and Out pointer registers which are stored in R4 and R5 respectively. These registers are. moved into FIFO pointer Rl for actual transfers into or out of the FIFO. R2 is the Row Select Counter. It stores the number of the row being scanned. 63 MATRIX MAP 16 x a 48 47 7 6 L W 4 5 3 2 1 0 ~ I OBF IBF CHANGE WORD READY (P25) FIFO 40 X 8 F1 FO FIFO NOT EMPTY (P24) NOT useD Figure 18A. Sensor Matrix Status Register Format osaOUT REGISTER - I 1 1 1 FIFO OUT SENSOR COORDINATE ' - - - - - - - - - - - SENSOR STATE =CLOSED 1 =QPEN a Figure 188. R7 RS RS FIFO IN R' COLUMN COUNTER R3 SCAN ROW SELECT R2 FIFO POINTER R1 MATRIX MAP POINTER RO CHANGE WORD ,-'___1_1_ - COMPARE RESULT CHANGE WORD STORE Sensor Matrix Change Word Format Internally, the matrix scanning software is programmed to run as a foreground task. This allows the timer/counter to be used by any background task although the hardware configuration leaves only 2 inputs (TEST 0 and TEST 1) plus 2 I/O port pins available. Also, to add a background task, the FIFO would have to be made smaller to accommodate the needed register and data memory space. (It would be possible however to turn the table here and make the scanning software timer/counter interrupt-driven where the timer times the scan interval.) , The data memory organization for this application is shown in Figure 19. The upper'16 bytes form the Matrix Map and store the sensor states from the previous scan; one bit for each sensor. The Change Word FIFO occupies the next 40 locations. (The top and bottom addresses of this FIFO are treated as equate variables in the program so that the FIFO size may easily be changed to accommodate the register needs of other tasks.) Register Ro serves as a pointer into the matrix map area for comparisons Figure 19. Sensor Matrix Data Memory Map Register R3 is the Column Counter. This counter is normally set to OOR; however, when a change is detected somewhere in a particular row, it is used to inspect each sensor status bit individually for a change. When a changed counter sensor bit is found, the Row Select Counter and Column Counter are combined to give the sensor's matrix coordinate. This coordinate is temporarily stored in the Change Word Store, register R6. Register R7 is the Compare Result. As each row is scanned, the return information is Exciusive-OR'd with the return information from the previous scan of that row. The result of this operation is stored in R7. If R7 is zero, there have been no changes on that row. A non-zero result indicates at least <:me changed sensor. The basic program operation is shown in the flow chart of Figure 20. At RESET, the software initializes the working registers, the ports, and clears the STATUS register. To get a starting point from which to perform the sensor comparisons, the current status of the matrix is read and stored in the Matrix Map. At this point, the UPI begins looking for changed sensors starting with the first row. 6-884 APPLICATIONS Before delving further into the flow, let's pause to describe the general format of the operation. The UPI scans the matrix one row at a time. If no changes are detected on a particular row, the UPI simply moves to the next row after checking the status of DBBOUT and the FIFO. If a change is detected, the UPI must check each bit (sensor) within the row to determine the actual sensor location. (More than one sensor on the scanned row could have changed.) Rather than test all 8 bits of the row before checking the DBBOUT and FIFO status again, the UPI performs the status check in between each of the bit tests. This ensures the fastest response to the master reading previous Change Words from DBBOUT and the FIFO. INITIALIZATION SCAN AND COMPARE With this general overview in mind, let's go first thru the flow chart assuming we are scanning a row where no changes have occurred. Starting at the Scan-and-Compare section, the UPI first checks if the entire matrix has been scanned. If it has, the various pointers are reset. If not, the address of the next row is placed on PORTs 20 thru 23. This selects the desired row. The state of the row is then read on PORT 1; the column return lines. This present state is compared to the previous state by retrieving the previous state from the matrix map and performing an Exclusive-OR with the present state. Since we are assuming that no change has occurred, the result is zero. No coordinate decoding is needed and the flow branches to the FIFO-DBBOUT Management section. CHANGE WORD ENCODING The FIFO-DBBOUT Management section simply maintains the FIFO and loads DBBOUT whenever Change Words are present in the FIFO and DB BOUT is clear (OBF=O). The section first tests if the FIFO is full. (If we assume our "no-change" row is the first row scanned, the FIFO obviously would not be full.) If it is, the UPI waits until OBF=O, at which point the next Change Word is retrieved from the FIFO and placed in DBBOUT. This "unfills" the FIFO making room for more Change Words, At this point, the Column Counter, R3, is checked. For rows with no changes, the Column Counter is always zero so the test simply falls through. (We cover the case for changes shortly.) Now the FIFO is tested for being empty. If it is, there is no sense in any further tests so the flow simply goes back up to scan the next row. If the FIFO is not empty, DBBOUT is tested again through OBF. If a Change Word is in DBBOUT waiting for the master to read it, nothing can be done and the flow likewise branches up for the next row. However, if the DBBOUT is free and remembering that the previous test showed that the FIFO was not empty, DBBOUT is loaded with the next Change Word and the last two conditional tests repeat. FIFO oaBOUT MANAGEMENT Figure 20. Sensor Matrix Controller Flow Chart 6-885 APPLICATIONS Now let's assume the next row contains several changed sensors. Like before, the row is selected, the return lines read, and the sensor status compared to the previous scan. Since changes have occurred, the Exclusive-OR result is now non-zero. Any l'sin the result reflect the positions of the changed sensors. This non-zero result is stored in the Compare Result register, R7. At this point, the Column Counter is preset to S. To determine the changed sensors' locations, the Compare Result register is shifted bit-bybit to the left while decrementing the Column Counter. After each shift, BIT 7 of the result is tested. If it is a one, a changed sensor has been found. The Column Counter then reflected the sensor's matrix column position while the Scan Row Select register holds it row position. These registers are then combined in R6, the Change Word Store, to form the sensor's matrix coordinate section of the Change Word. The Sth bit ofthe Change Word Store is coded with the sensor's present state (Figure IS). This byte forms the complete Change Word. It is loaded into the next available FIFO position. If BIT 7 of the Compare Result had been zero, that particular sensor had not changed and the coordinate decoding is not performed. In between each shift, test, and coordinate encode (if necessary), the FIFO-DBBOUT Management is performed. It is the Column Counter test within this section that routes the flow back up to the Change Word Encoding section if the entire Compare Result (row) has not been shifted and tested. The FIFO is implemented as a circular buffer with IN and OUT pointers (R4 and R5 respectively). The operations of the FIFO is best understood using an example, Figure 21. This series of figures show how the FIFO, DBBOUT, and OBF interact as changes are detected and Change Words are read by the master. The letters correspond to sequential Change Words being loaded into the FIFO. Note that the figurl;lS show only a 4XS FIFO however, the principles are the same in the 40XS FIFO. Figure 21A shows the condition where no Change Words have been loaded into the FIFO or DBBOUT. In Figure 21B a change, "A", has been detected, decoded, and loaded into the FIFO at the location equal to the value of the FIFO-IN pointer. The FIFO-OUT pointer is reset to the bottom of the FIFO since it had reached the FIFO top. Now that a Change Word is in the FIFO, OBF is checked to see if DBBOUT is empty. Because OBF=O, DBBOUT is empty and the Change Word is loaded from the FIFO location pointed at by the FIFO-OUT pointer. This is shown in Figure 21C. Loading DBBOUT automatically sets OBF. OBF remains set until the master reads DBBOUT. Figures 21D and 21E show two more Change Words loaded into the FIFO. In Figure 21F the first Change Word is finally read by the master resetting OBF. This allows the next Change Word to be loaded into DBBOUT. Note that each time the FIFO is loaded, the FIFO-IN pointer increments. Each time DBBOUT is read the FIFOOUT pointer increments unless there are no more Change Words in the FIFO. Both pointers wraparound to the bottom once they reach the FIFO top. The remaining figures show more Change Words being loaded into the FIFO. When the entire FIFO fills and DBBOUTcan not be loaded (OBF=I), scanning stops until the master reads DBBOUT making room for more Change Words. As was mentioned earlier, two interrupt outputs to the master are available: Change Word Ready (P25, OBF) and FIFO NOT EMPTY (P24). The Change Word Ready interrupt simply reflects OBF and is handled automatically by the UPI since an EN FLAGS instruction is executed during initialization. The FIFO NOT EMPTY interrupt is generated and cleared as appropriate, each pass through the FIFO management code. . No debouncing is provided although it could be added. Rather, the scan time is left as an equate variable so that it could be varied to account for both deb ounce time and expected sensor change rates. The minimum scan time for this application is 2msec when using a 6MHz clock. Since the matrix controller is coded as a foreground task, scan time simply uses a software delay loop. The UPI software is included as Appendix B1. Appendix B2 is SOS5A test software which builds a Change Word buffer starting at BUFSRT. This software simply polls the STATUS register looking for Change Word Ready to go true. DB BOUT is then read and loaded into the buffer. Now let's move on to an application which combines both the foreground and background concepts. Combination 1/0 Device The final UPI application was designed especially to add additional serial and parallel I/O. ports to the iSBC SO/30. This UPI simulates a full-duplex UART (U niversal Asynchronous Receiver/Transmitter) combined with an S-bit parallel I/O port. Features of the UART include: software selectable baud rates (110, 300, 600, or 1200 baud), double buffering for both the transmitter and receiver, and receiver testing for false start bit, framing, and overrun errors. For parallel I/O, one S-bit port is programmable for either input or output. The output port is statically latched and the input port is sampled. 6-886 APPLICATIONS A) e:] 08F 0 c:J D 08F IN OBBOUT 8) e:] 08F 0 DBBOUT C) D 08F 0 OSSOUT D) D 08F 0 DBBOUT E) D 08F 0 omtt F) OSSOUT FIFO fiFO EMPTY ~H : FIFO CHANGE A FIN ALL Y READ G) 0 D OUT 08F IN H) D 08F IN 0 DBBOUT D IN 08F H" C OUT ~'" FIFO CHANGE 0 DETECTED oo,~ 0 J) IN D 0 FIFO CHANGE E DETECTED ~1!f" FIFO OSSOUT CHANGE F DETECTED, FifO FULL. SCANNING STOPPED UNTIL B IS READ FIFO CHANGE C DETECTED FIFO Operation Example 6-887 ...-IN E OS BOUT FIFO CHANGE B DETECTED . FIFO CHANGE 8 LOADED INTO DBBQUT DBBOUT FIFO CHANGE A LOADED INTO DBBOUT, FIFO EMPTY Figure 21A-J. -tr- DBBOUT (MASTER READS OBBQUTj FIFO CHANGE A DETECTED oo,H oo,lf o",-tr OUT APPLICATIONS Figure 22 shows the interface of this combination I/O device to the dedicated UPI socket on the iSBC 80/30. The only external requirement is a 76.8 kHz source which serves as the baud rate standard. The internal baud rates are generated as multiples of this external clock. This clock is obtained from one of the 8253 counters. Otherwise, an RS-232 driver and receiver already available for UPI use in serial I/O applications. Sockets are also provided for termination of the parallel port. either the receiver or the parallel input port, the FO and Fl flags (BITs 2 and 3) code the source. Thus, when the master finds OBF set, it must decode FO and Fl to determine the source. STATUS FORMAT OBF-DATA AVAILABLE ISF-BUSY ~=Fl I L NOT USED INTERRUPT L~======= Tx FRAMING ERROR ' - - - - - - - - - - - OVERRUN ERROR PARALLEL PORT FO F1 OPERATION (SF = 1) TxD NO OPERATION PARALLEL I, 0 DATA SERIAL 1:0 DATA RxD COMMAND ERROR TICK SAMPLE EXT CLOCK(76.8 KHz) FROM 8253 Figure 22. Combination I/O Device There are three commands for this application. Their format is shown in Figure 23. The CONFIGURE command specifies the serial baud rate and the parallel I/O direction. Normally this command is issued once during system initialization. The I/O command causes a parallel I/O operation to be performed. If the parallel port direction is out, the UPI expects the data byte immediately following an I/O command to be data for the output port. If the port is in the input direction, an I/O command causes the port to be read and the data placed in DBBOUT. The RESET ERROR command resets the serial receiver error bits in the STATUS register. COMMAND FORMAT COP A-120D BAUD SELECT B- 600 BUAO SELECT c- 300 BAUD SELECT 0- 110 BAUD SELECT P-PARALlEL I/O OIRECTION O-INPUT 1-0UTPUT Figure 23. o I/O COMMAND o RES~T ERROR COMMAND Combination I/O Command Format The STATUS register format is shown in Figure 24. Looking at each bit, BIT 0 (OBF) is the DATA AVAILABLE flag. It is set whenever the UPI places data into DBBOUT. Since the data may come from Figure 24. STATUS Register Format BIT 1 (IBF) functions as a busy bit. When IBF is set, no writes to DBBIN are allowed. BIT 5 is the TxINT (Transmitter Interrupt) bit. It is asserted whenever the transmitter buffer register is empty. The master uses this bit to determine when the transmitter is ready to accept a data character. BITS 6 and 7 are receiver error flags. The framing error flag, BIT 6, is set whenever a character is received with an invalid stop bit. BIT 7, overrun error, is set if a character is received before the master has read a previous character. If an overrun occurs, the previous character is overwritten and lost. Once an error occurs, the error flag remains set until reset by a RESET ERROR command. A set error flag does not inhibit receiver operation however. Figure 25 shows the port pin definition for this application. PORT 1 is the parallel I/O port. The UART uses PORT 2 and the Test inputs. P20 is the transmitter data out pin. It is set for a mark and reset for a space. P23 is a transmitter interrupt output. This pin has the same timing as the TxINT bit in the STATUS register. It is normally used in interruptdriven systems to interrupt the master processor when the transmitter is ready to accept a new data character. The OBF flag is brought out on P24 as a master interrupt when data is available in DBBOUT. P26 is a diagnostic pin which pulses at four times the selected baud rate. (More about this pin later.) The receiver data input uses the TEST 0 input. One of the PORT 2 pins could have been used, however, the 6-888 APPLICATIONS PORT PIN DEFINITION PORT !!!! 0-7 63 PARALLEL lID Tx Data NOT USED NOT USED Tx INTERRUPT OaF INTERRUPT NOT USED NOT USED (TICK SAMPLE) NOT USED TO Rx DATA T1 EXTERNAL CLOCK (76.8 kHz) USER RAM (NOT USED) 32 FUNCTION 31 AC TEMP. STORE R7 30 COMMAND STORE R6 R5 29 Tx STATUS - 28 Tx BUFFER R' 27 Tx SERIALIZER R3 26 Tx TICK COUNTER R2 25 BAUD RATE CONSTANT R1 2. NOT USED RO 23 TxSTS Combination 1/0 Port Definition R7 Rx DESERIALIZER R6 Rx TICK COUNTER R5 Rx HOLDING R' software can test the TEST 0 in one instruction without first reading a port. Ax STATUS-RxSTS R3 NOT USED R2 NOT USED R1 The TEST 1 input is the baud rate external source. The UART divides this input to determine the timing needed for the selected baud rate. The input is a non-synchronous 76.8 kHz source. NOT USED RO Figure 26. Internally, when the CONFIGURE command is received and the selected baud rate is determined, the internal timer/counter is loaded with a baud rate constant and started in the event counter mode. Timer/counter interrupts are then enabled. The baud rate constant is selected to provide a counter interrupt at four times the desired baud rate. At each interrupt, both the transmitter and receiver are handled. Between interrupts, any new commands and data are recognized and executed. REGISTER BANK a Combination 1/0 Register Map RxSTS FORMAT Ax FLAG-POSSIBLE START BIT START FLAG-GOOD START BIT BYTE FINISHED FLAG L~=== DATA READY FLAG ---======== ' - - - - - - - FRAMING ERROR L aVERRRUN ERROR I, 0 DIRECTION L---_ _ _ _ _ _ _ _ _ L 0 FLAG Figure 27. As a prelude to discussing the flow charts, Figure 26 shows the register definition. Register Bank 0 serves the UART receiver and parallel I/O while Register Bank 1 handles the UART transmitter and commands. Looking at RBO first, R3 is the receiver status register, RxSTS. Reflected in the bits of this register is the current receiver status in sequential order. Figure 27 shows this bit definition. BIT 0 is the Rx flag. It is set whenever a possible start bit is received. BIT 1 signifies that the start bit is good and character construction should begin with the next received bit. BIT 1 is the Good Start flag. BIT 2 is the Byte Finished flag. When all data bits of a character are received, this flag is set. When all the bits, data and stop bits are received, the assembled character is loaded into the holding register (R4 in Figure 27) BIT 3, the Data Ready flag, is set. The foreground routine which looks for commands and data continuously, looks at this bit to determine when the receiver has received a character. BITS 4 and 5 signify any error conditions for a particular character. BANK 1 STACK (ONE LEVEL USeD) STATUS STORE Figure 25. REGISTER RxSTS Register The parallel I/O port software uses BITS 6 and 7. BIT 6 codes the I/O direction specified by the last CONFIGURE command. BIT 7 is set whenever an I/O command is received. The foreground routine tests this bit to determine when an I/O operation has been requested by the master. As was mentioned, R4 is the receiver holding register. Assembled characters are held in this register until the foreground routine finds DBBOUT free, at which time the data is transferred from R4 to DBBOUT. R5 is the receiver tick counter. Recall that counter interrupts occur at four times the baud rate. Therefore, once a start bit is found, the receiver only needs to look at the data every four interrrupts or tick counts. R5 holds the current tick count. R6 is the receiver de-serializing register. Data characters are assembled in this register. R6 is preset to 80H when a good start bit is received. As each bit is 6-889 APPLICATIONS sampled every four timer ticks, they are rotated into the leftmost bit of Ra. The software knows the character assembly is complete when the original preset bit rotates into the carry. An image ofthe upper 4 bits ofthe STATUS register is stored in R7. These bits are the TxINT, Framing and Overrun bits. This image is needed since the UPI may load the upper 4 STATUS register bits from its accumulator; however, it cannot read STATUS directly. In Register Bank I (Figure 26), RI holds the baud rate constant which is found from decoding the baud rate select bits of the CONFIGURE command. The counter is reloaded with this constant every timer tick. Like the receiver, the transmitter only needs to update the transmitter output every four ticks. R2 holds the transmitter tick count. The value of R2 determines which portion of the data is being transmitted; start bit, data bits, or stop bit. The transmit serializer is Rg. Rg holds the data character as each character bit is transmitted. R4 is the transmitter holding register. It provides the double buffering for the transmitter. While transmitting one character, it is possible to load the next character into R4 via DBBIN. The TxINT bit in STATUS and pin on PORT 2 reflect the "fullness" of R4. If the ,holding register is empty, the interrupt bit and pin are set. They are reset when the master writes a: new data byte for the transmitter into DBBIN. The transmitter status register (TxSTS) is RS. Like RxSTS,TxSTS contains flag bits which indicate the current state of the transmitter. This flag bit format is shown in Figure 28. TxSTS BIT 0 is the Tx flag. It is set whenever the transmitter is transmitting a character. It is set from the beginning of the start bit until the end of the stop bit. BITl is the Tx request flag. This bit is set by the foreground routine when it transfers a new character from DBBIN to the Tx holding register, R4. The transmitter software uses this flag to tell if new data is available. It is reset when the transmitter , transfers the character from the holding register to the serializer. TxSTS FORMAT 1716i'~'14131211~ , I. I I I Tx FLAG - TRANSMITTING . REQUEST FLAG L__ II ~~=_==PIPELINED START BIT DATA FLAG BIT Figure 28. NOT USED TxSTS Register BIT 2 is the pipelined Tx data bit. The transmitter uses a pipelining technique which sets up the next , output level in BIT 2 after processing the current timer tick. The output level is always changed at the same point after a timer tick -interrupt. This technique ensures that no bit timing distortion results from different length processing paths through the receiver and transmitter routines. BIT g of TxSTS is the Start Bit flag. It is set by the transmitter when the start bit space is set up in the pipelined data bit. This allows the transmitter to differentiate between the start bit and the data bits on following timer ticks. The flow charts for this application are shown in Figures 29A-F. At reset, the INIT routine is executed which initializes the registers and port pins. After initialization, IBF and OBF are tested in MNLOOP. These flags are tested continually in this loop. If IBF is set, FI is tested for command or data and execution is transferred to the appropriate routine (CMD or DATA). If IBF=O, OBF is checked. If OBF=O (DBBOUT is free), the Rx data ready and I/O flags in RxSTSare tested. If Rx data ready is set, the received data is retrieved from the Rx holding register and transferred to DBBOUT. Any error flags associated with that data are also transferred to STATUS. If the I/O flag is set and the I/O direction is input, PORT I is read and the data transferred to DBBOUT. In either case, FO and FI are set to indicate the data source. If IBF is set by a command write to DBBIN, CMD reads the command and decodes the desired operation. If an I/O operation is specified" the I/O flag is set to indicate to the MNLOOP and DATA routines' that an I/O operation is to be performed. If the command is a CONFIGURE command, the constant for the selected baud rate is loaded into both Baud Rate Constant register and the timer/counter. The timer/ counter is started in the event counter mode and timer/counter interrupts are enabled. In addition, the I/O port is initialized to alII's ifthe I/O direction bit specifies an input port. If the command is a RESET ERROR command, the two error flags in STA. TUS are cleared. If the IBF flag is set by a data write, the DATA routine reads DBBIN and places the data in the appropriate place. If the I/O flag is set, the data is for the output port so the port is loaded. If the I/O flag is reset, the data is for the UART transmitter. Data for the transmitter resets the TxINT bit and pin plus sets the Tx request flag in TxSTS. The data is transferred to the Tx holding register, R4. 6-890 APPLICATIONS SET FRAMING ERROR IN STATUS OUTPUT Figure 29A. INIT Flow Chart Once a CONFIGURE command is received and the counter started, timer/counter interrupts start occurring at four times the selected baud rate. These interrupts cause a vector to the TIMINT routine, Figure 29D. A 76.8 kHz counter input provides a 13.02 JlS counter resolution. Since it requires several UPI instruction cycles to reload the counter, the counter is set to two counts less than the desired baud rate and the counter is reloaded in TIMINT synchronous with the second low-going transition after the interrupt. Once the counter is reloaded, an output port (P26) is toggled to give an external indi- cation of internal counter interval. This is a helpful diagnostic feature. After the tick sample output, the pipelined transmitter data in TxSTS is output to the TxD pin. Although this occurs every timer tick, the pipelined data is changed only every fourth tick. The receiver is now handled, Figure 29E. The Rx flag in RxSTS is examined to see if the receiver is currently in the process of receiving a character. If it is not, the RxD input is tested for a space condition which might indicate a possible start bit. If the input is a mark, no start bit is possible and execution AFN·Ol536A 6-891 APPLICATIONS . Figure 29B. CMO Flow Chart branches to the transmitter flow, XMIT. If the input is a space, the Rx flag is set before proceeding with XMIT. If the Rx flag is found set when entering ReV, the receiver is in the process of receiving a character. If so, the start bit flag is then tested to determine if a good start bit was received. The Rx tick counter is initialized to 4 and the Rx deserializer is set to SOH. ' A mark indicates a bad start bit; the Rx flag is reset to abort the reception. If the start bit flag is set, the program is .somewhere in the middle of the received character. Since 'the data should be sampled every fourth timer tick, the tick counter is decremented and tested for zero. If non-zero no sample is needed and execution continues with XMIT. If zero, the tick counter is reset to four. Now the byte finished flag is tested to determine if the data sample is a data or stop bit. If reset, the sample is a data bit. The sample is done and the new bit rotated into the Rx deserializer. If this rotate Figure 29C. Data Flow Chart AFN.ol536A 6-892 APPLICATIONS If the start bit flag is reset, the Tx tick counter is incremented and tested. The test is performed modulo 4. lithe counter mod 4 is not zero, it has not been four ticks since the transmitter was handled last so the routine simply returns. If the counter mod 4 is zero, it is time to handle the transmitter and the Tx flag is tested. The Tx flag indicates whether the transmitter is active. If the transmitter is inactive, no character is currently being transmitted so the Tx request flag is tested to see if a new character is waiting in the Tx buffer. If no character is waiting (Tx request flag=O), the Tx interrupt pin and bit are set before returning to the foreground. If there is a character waiting, it is retrieved from the buffer and placed in the Tx serializer. The Tx request flag is reset while the Tx and start bit flags are set. A space is placed in the Tx pipelined data bit so a start bit will be output on the next tick. Since the Tx buffer is now empty, the Tx interrupt bit and pin are set to indicate the availability of the buffer to the master. The routine then returns to the foreground. Figure 290. TIMINT Flow Chart sets the carry, that data bit was the last so the byte finished flag is set. If the carry is reset, the data bit is ,not the last so execution simply continues with XMIT. Had the byte finished flag been set, this sample is for the stop bit. The RxD input is tested and if a space, the framing error flag is set. Otherwise, it is reset. Next, the Rx data ready flag is tested. If it is set, the master has not read the previous character so the overrun error flag is set. Then the Rx data ready flag is set and the received data character is transferred into the Rx holding register. The Rx, start bit, and byte finished flags are reset to get ready for the next character. Execution of the transmitter routine, XMIT, follows the receiver, Figure 29F. The transmitter starts by checking the start bit flag in TxSTS. Recall that the actual transmit data is output at the beginning of the timer routine. The start bit flag indicates whether the current timer tick interrupt started the start bit. If it is set, the pipelined data output earlier in the routine was the start of the start bit so the flag is reset and the Tx tick counter is initialized. Nothing else is done this timer tick so the routine returns to the foreground. 6-893 If the tick counter mod 4 is zero and the Tx flag indicates the transmitter is in the middle of a character, the tick counter is checked to see what transmitter operation is needed. If the counter is 2BH (40D), all data bits plus the stop bits are complete. The character is therefore done and the Tx flag is reset. If the counter is 24H (36D), the data bits are complete and the next output should be a mark for the stop bit so a mark is loaded into the Tx pipelined data bit. If neither of the above conditions are met for the counter, the transmitter is some place in the data field, so the next data bit is rotated out of the Tx serializer into the pipelined data bit. The next tick outputs this bit. At this point the program execution is returned to the foreground. That completes the discussion of the combination I/O device flow charts. The UPI software listing is shown in Appendix Cl. Appendix C2 is example BOS5A driver software. Several observations concerning the drivers are appropriate. Notice that since the receiver and input port of the UPI use the OBF flag and interrupt output, the interrupt and flag are cleared when the master reads DBBOUT. This is not true for the transmitter. There is always some time after a master write of new transmitter data before the transmitter bit and pin are cleared. Thus in an interruptdriven system, edge-sensitive interrupts should be APPLICATIONS Figure 29E. used. For polled-systems, the software must wait after writing new data for IBF=O before re-examining the Tx interrupt flag in STATUS. Notice that this application uses none of the user data memory above Register Bank 1 and only 361 bytes of program memory. This leaves the door open for many improvements. Improvements that come to mind are increased buffering of the transmit or received data, modem control pins, and parallel port handshaking inputs. This completes our discussion of specific UPI applications. Before concluding, let's look briefly at two debug techniques used during the development of RCV Flow Chart these applications that you might find useful in your own designs. DEBUG TECHNIQUES Since the UPI is essentially a single-chip microcomputer, the classical data, address, and control buses are not available to the outside world during normal operation. This fact normally makes debugging a UPI design difficult; however, certain "tricks" can be included in the UPI software to ease this task. If a UPI is handling multiple tasks, it is usually easier to code and debug each task individually. This is fairly standard procedure. Since each task usually utilizes only a subset of the total number of I/O pins, 6-894 APPLICATIONS ( XMIT ) ( RETR RETR ) AETR ) MARK TO P1PELINED DATA FLAG (STOP) ( RETR ) SET Tx INT ( RETR ) Figure 29F. XMIT Flow Chart coding only one task leaves some I/O pins free. Port output instructions can then be added in the task code being debugged which toggle these unused pins to determine which section of task code is being executed at any particular time. The task can also be made to "wait" at various points by using an extra pin as an input and adding code to loop until a particular input condition is met. . One example of using an extra pin as an output is included in the combination serial/parallel device code. During initial development the receiver was not receiving characters correctly. Since this could be caused by incorrect sampling, three lines of code were added to toggle BIT 6 of PORT 2 at each tick of the sample clock. This code "is at lines 184 and 185 of the listing. Thus by looking at the location of the tick 6-895 sample pulse with respect to the received bit, the UPI sampling interval can be observed. The tick sample time was incorrect and the code was modified accordingly. Similar techniques could be applied at other locations in the program. The EPROM version of the UPI (8741A) also contains another feature to aid in debug: the capability to single step thru a program. The user may step thru the program instruction-by-instruction. The address of the next instruction to be fetched is available on PORT 1 and the lower 2 bits of PORT 2. Figure 30 shows the timing used in the discussion below. When the single step input, SS, is brought low, the internal processor responds by stopping during the fetch portion of the next instruction. This action is acknowledged by the processor raising the SYNC APPLICATIONS SV: ~,-___I___......~:~~:_i_~L_l_:.F x::: X X ~~ I.r ~~~~i'Na _ .....I._--STOPPEO-+ACTIVE ...... PORTS PORT DATA VALID ADDRESS INSTRUCTION Figure 30. , Single Step Timing the next low-going transition of SYNC causes the 7474 to clear, lowering SS. While sync is low, the port data is valid and the current instruction is executing. Low SYNC is also used to enable the tristate buffers when the ports are used as inputs. When execution is complete, SYNC goes high. This transition latches the valid port data in the 74LS374s. SYNC going high also signifies that the address of the next instruction will appear on the port pins. This state can be held indefinitely with the address data displayed on the LEDs. output. The address of the instruction to be fetched is then placed on the port pins. This state may be held indefinitely. To step to the next instruction, SS is raised high, which causes SYNC to go low, which is then used to return SS low. This allows the processor to advance to the next instruction. If SS is left high, the processor continues to execute at normal speed until SS goes low. To preserve port functionality, port data is valid while SYNC is low. Figure 31 shows the external circuitry required to implement single step while preserving port functionality. S1 is the RUN/STOP switch. When in the RUN position, the 7474 is held preset so SS is high and the UPI executes normally. When switched to STOP, the preset is removed and When the S2 is depressed, the 7474 is set which causes SS to go high. This allows the processor to fetch and execute the instruction whose address was displayed. SYNC going low during execution, clears 74LS374 +s +5 +s 2D 2a 1D 1a 8D 8a S1 ;s. RUN 55 P21 C 7400 74L$314 +s . 8D41A1 8741A • 1 OF 10 PORT LINES 7407 : SYNC P10 1D +s Figure 31. Single Step External Circuitry 6-896 1a LATCHED PORT DATA APPLICATIONS the 7474 lowering SS. Thus the processor again stops when execution is complete and the next fetch is started. All UPI functions continue to operate while single stepping (the processor is actually executing NOPs internally while stopped). Both IBF and timer/ counter interrupts can be serviced. The only change is that the interval timer is prescaled on single stepped instructions and, of course, will not indicate the correct intervals in real time. The total number of instruction which would have been executed during a given interval is the same however. The single step circuitry can be used to step through a complete program; however, this might be a timeconsuming job if the program is long or if only a portion is to be examined. The circuitry could easily be modified to incorporate the output toggling technique to determine when to run and stop. If you would like to step thru a particular section of code, an extra port pin could replace switch S1. Extra instructions would then be added to lower the port when entering the code section and raise the port when exiting the section. The program would then stop when that section of code is reached allowing it to be stepped through. At the end of the section, the program would execute at normal speed. CONCLUSION Well, that's it. Machine readable (floppy disk or paper tape) source listings of UPI software for these applications are available in Insite, the Intel library .of user-donated programs. Also available in Insite are the source listings for some of Intel's pre-programmed UPI products. For information about Insite, write to: Insite Intel Corp. 3065 Bowers Ave. Santa Clara, Ca 95051 6-897 APPENDIX AI 6-898 APPLICATIONS Fl A5M4B ISIS-I I LOC F'3. LED PRINT< Lf' ) NC10I3JECT MCS-A8/UPI-41 MACRO ASSEMELER, OBJ LINE V3.0 PAGE SOURCE STATEMENT 1 $MOD41A 2 *********************************************** UPI-41A a-DIGIT LED DISPLAY CONTROLLER *********************************************** 4 5 6 7 , B j THIS PROGRAM USES THE UPI-41A AS A LED DISPLAY CONTROLLER 9 j WHICH SCANS AND REFRESHES EIGHT SEVEN-SEGMENT LEO DISPLAYS. 10 j THE CHARACTERS ARE DEFINED BY INPUT FROM A MASTER CPU IN THE 11 j FORM OF ONE EIGHT BIT WORD PER DIGIT-CHARACTER SELECTION. 12 13 14 ********************************************************************* 15 J 16 17 I REGISTER DEFINITIONS: 18 REGISTER 19 20 RO 21 J R1 22 R2 23 R3 24 R4 25 R5 R6 26 27 R7 28 29 J ********************************************************************** 30 ; PORT PIN DEFINITIONS: 31 PIN 32 PO-7 33 34 35 SEJECT , RBO RB1 DISPLAY MAP POINTER NOT USED NOT USED NOT USED DATA WORD AND CHARACTER STORAGE NOT USED DIGIT COUNTER NOT USED NOT USED NOT USED NOT USED NOT USED NOT USED NOT USED ACCUMULATOR STORAGE NOT USED PORT 1 FUNCTION PORT 2 SEGMENT DRIVER CONTROL DIGIT DRIVER CONTROL 6-899 FUNCTION APPLICATIONS ISIS-II MCS-48/UPI-41 MACRO ASSEMBLER. LOC DB') LINE V3.0 PAGE 2 SOURCE STATEMENT 36 ; ************************************************************************ 37 ; DISPLAY DATA WORD BIT DEFINITION: 38 B IT FUNCTION 39 40 , 0-4 CHARACTER SELECT 41 5-7 DIGIT SELECT 42 43 j CHARACTER SELECT: 44 D4 D3 D2 D1 DO CHARACTER 45 0 0 0 0 0 0 4b 0 0 0 0 1 1 47 0 0 0 1 0 2 48 0 0 0 1 1 3 49 0 0 0 0 4 '0 , 0 0 0 1 0 0 1 0 6 '2 , 0 0 1 1 7 1 53 , 0 0 0 0 1 8 .4 0 0 0 1 9 50 , 0 0 1 0 A 56 , 0 0 1 1 B 57 0 1 0 0 C .8 , 0 0 1 D 59 0 1 0 E 60 1 1 1 1 0 F 61 1 0 0 0 0 62 0 0 0 1 1 G 63 1 0 0 1 0 H 64 , 0 0 1 I 1 65 0 1 0 .J 0 66 , 0 1 0 1 L 67 , 0 1 1 0 N 68 1 1 1 0 0 69 0 0 P 0 70 0 0 1 R 71 , 0 1 0 T 72 0 1 1 U y 73 , 0 0 74 0 1 7. 1 0 7b "BLANK" , , " , 77 78 ; DIGIT SELECT: 79 80 81 82 , 83 84 85 8b , 87 D7 0 0 0 0 D6 0 0 1 1 0 0 DO 0 1 0 1 0 1 0 1 DIGIT NUMBER 1 2 3 4 5 6 7 B 88 J *********************************************************************** 89 SEJECT 6-900 APPLICATIONS 1815-1 I LOC MCS-.04B/UPI-41 MACRO ASSEMBLER. DB..} LINE 90 91 92 93 94 95 96 FFFI V3.0 PAGE 3 SOURCE STATEMENT *********************************************************************** J EQUATES ; j THE FOLLOWING COCE DESIGNATES "TIME" AS A VARIABLE. THIS j ADJUSTS THE AMOUNT OF CYCLES THE TIMER COUNTS BEFORE 1 A TIMER INTERRUPT OCCURS AND REFRESHES THE DISPLAY. APPROXIMATELY ;:50 TIMES PER SECOND. TINE EGU -OFH ; TIMER VALUE 2. '5MSEC ***************************************************************'It.it****** 0000 0000 0409 0002 00 0003 0436 0000 00 0006 00 0007 041D 0009 D5 CODA BADe Dooe B838 OOOE 23FF 0010 AD 0011 0012 0013 D015 18 F8 B20E BBOO 0017 23F1 0019 62 OOIA 55 0018 25 DOlC 0", 97 j 98 INTERRUPT BRANCHING 99 I THIS PORTION OF MEMORY IS DEDICATED FOR USE OF RESET AND 100 ,INTERRUPT BRANCHI NG. WHEN THE INTERRUPTS ARE ENABLED THE 101 i CODE AT THE FOLLOWING DESIGNATED SPOTS ARE EXECUTED WHEN A 102 ; RESET OR A INTERRUPT OCCURS. 103 ORG 0 104 JMP START ; RESET 10~ NOP I 106 ""MP INPUT J IBF INTERRUPT 107 NOP 108 NOP 109 JMP j TIMER INTERRUPT DISPLA 110 ; ************************************************************************* III J INITIALIZATION 112 J THE FOLLOWING CODE SETS UP THE UPI-41 AND DISPLAY HARDWARE 113 I INTO OPERATIONAL FORMAT. THE DISPLAY IS TURNED OFF, THE DISPLAY 114 j MAP IS FILLED WITH "BLANK" CHARACTERS, THE TIMER SET AND THE II~ I INTERRUPTS ARE ENABLED. II. 117 START: SEL RBI P2, .. OSH liB ORL J TURN DIGIT DRIVERS OFF 119 RO. #38H J DISPLAY MAP POINTER, BOTTOM OF DISPLAY MAP MOV A,IOFFH 120 DLKMAP: MOV J FF="BLANK" @:RO, A 121 MOV I BLANK TO DISPLAY MAP j INCREMENT DISPLAY MAP POINTER 122 INC RO 123 A, RO ; DISPLAY MAP POINTER TO ACCUMULATOR MOV BLKMAP J BLANK DISPLAY MAP TILL FILLED 124 JB' R3. ,",DOH 125 MOV ; SET DIGIT COUNTER TO 0 A, .. TIME ; TIMER VALUE 12. MOV T, A 127 MOV i LOAD TIMER 128 STRT i START TIMER T 129 ; ENABLE TIMER INTERRUPT EN TCNTI ; ENABLE IBF INTERRUPT 130 EN I 131 i ************************************************************************ 132 USER PROGRAM 133 i A USERS' PROGRAM WOULD INITIALIZE AT THIS POINT. THE FOLLOWING 134 ; CODE IS UND CONCLUDED WITH 135 ; SYNC CHARACTERS (OAAH). A CHECKSUM BYTE IMMEDIATELY PRECEEDS THE 136 j FINAL SYNC. WHEN READING, THE CONTROLLE********************************it**** 137 $EJECT 6-901 APPLICATIONS ISIS-II MCS-49/UPI-41 MACRO ASSEMBLER, Lac OB0 V3.0 PAGE SOURCE STATEMENT LINE ****************.****************tf************************************* ) DISPLAY ROUTINE 138 ; 139 140 141 142 143 144 0010 001E OOlF 0021 0022 0024 002~ 0026 0027 0026 0029 002A 002C 002E 0030 0032 0033 0034 003~ 0' AF 8A08 PB 4338 A8 FO 39 FB 3A 19 0307 ~630 BBOO 23F1 62 '" FF 93 I THIS PORTION OF THIS PROGRAM IS AN INTERRUPT ROUTINE WHICH IS j ACTED UPON WHEN THE TIMER COUNT IS COMPLETED. THE ROUTINE UPDATES ; ONE DISPLAY DIGIT FROM THE DISPLAY MAP PER INTERRUPT SEQUENTIALLY, I THUS EIGHT TIMER INTERRUPTS WILL HAVE REFRESHED THE ENTIRE DISPLAY. ; REGISTER BANK 1 IS SELECTED AND THE ACCUMULATOR IS SAVED UPON 14~ ; ENTERING THE ROUTINE. ONCE THE DISPLAY HAS BEEN REFRESHED THE TIMER 146 I IS RESET AND THE ACCUMULATOR AND PRE-INTERRUPT REGISTER DANK IS RESTORED. 147 148 DISPLA: BEL ,REGISTER BANK 1 RBI 149 ,SAVE ACCUMULATOR MOV R7. A P2, :lOSH ; TURN DIGIT DRIVERS OFF 150 ORL A, R3 MOV j DIGIT COUNTER TO ACCUMULATOR 1" 152 , "OR". TO GET DISPLAY MAP ADDRESS ORL A, *38H 153 RO. A ; DISPLAY MAP POINTER MOV 104 ; GET CHARACTER FROM DISPLAY MAP MOV A. !!RO Pl, A 155 OUTL j OUTPUT CHARACTER TO SEGMENT DR IVERS ; DIGIT COUNTER VALUE TO ACCUMULATOR 106 MOV A. R3 P2, A ,OUTPUT TO DIGIT DRIVERS OUTL 1'7 158 j INCREMENT DIGIT COUNTER INC R3 A, #07H 159 XRL J CHECK IF AT LAST DIGIT 160 JNZ SETIME ,RESET TIMER IN NOT LAST DIGIT 161 R3. ~OOH I RESET DIGIT COUNTER MOV j T I MER VALUE 162 SETIME: MOV A, *TIME 163 MOV T.A I LOAD TIMER 164 STRT T I START TIMER ; RESTORE ACCUMULATOR 165 MOV A. R7 166 ; RETURN RETR ********************************************************************** 167 I 169 'E~ECT 6-902 APPLICATIONS ISIS-I I MCS-4B/UPI-41 MACRO ASSEMBLER. LOC 00..) LINE V3.0 PAGE SOURCE STATEMENT 169 0036 D5 0037 AF 0038 22 0039 AA 003A 47 0038 77 003C 5307 003E 4338 0040 A8 0041 FA 0042 531F 0044 E3 0045 AA 0046 0048 004A 0040 004C 004E 004F 0050 D37F C64E FA AO 0451 FA 50 AO 0051 FF 0052 93 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 160 166 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 j ********************************************""*****11'******* •• ********-11"*_ INPUT CHARACTER AND DIGIT ROUTINE ; THIS PORTION OF THE PROGRAM IS AN INTERRUPT ROUTINE WHICH ; IS ACTED UPON WHEN THE IBF BIT IS SET. THE ROUTINE GETS THE ; DISPLAY DATA WORD FROM THE DDB AND DEFINES BOTH THE DIGIT AND ; THE CHARACTER TO BE DISPLAYED. THIS IS DONE BY MEANS OF A j CHARACTER LOOP-UP TABLE AND A DISPLAY MAP FOR DIGIT AND CHARACTER ) LOCATION. SPECIAL CONSIDERATION IS TAKEN FOR A DECIMAL POINT WHICH IS I SIMPLY ADDED TO THE·EXISTING CHARACTER IN THE DISPLAY MAP. REGISTER I BANK 1 IS SELECTED AND THE ACCUMULATOR IS SAVED UPON ENTERING l THE ROUTINE. ONCE THE DATA WORD HAS BEEN FULLY DEFINED THE ACCUMULATOR J AND THE PRE-INTERRUPT REGISTER SANK IS RESTORED. I INPUT: SEL MOV IN MOV SWAP RR ANL ORL MOV MOV ANL MOVP3 MOV XRL JZ MOV MOV JMP DPOINT: 204 RETURN: 205 206 ; MOV ANL MOV MOV RETR RBI R7. A A.DBB R2. A A A A. :tt07H A.138H RD. A A. R2 A. #lFH A.@A R2. A A. #7FH DPOINT A. R2 @RO.A RETURN A. R2 A.@RO @RO,A A, R7 ; REGISTER BANK 1 ; SAVE ACCUMULATOR GET DATA ; SAVE DATA WORD ; DEFINE DIGIT LOCATION J ; ; ; ; ; ; DIGIT LOCATION IN DIGIT POINTER SAVED DATA WORD TO ACCUMULATOR DEFINE CHARACTER LOOK-UP-TABLE LaC. GET CHARACTER SAVE CHARACTER IS CHARACTER DECIMAL POINT ; SAVED CHARACTER TO ACCUMULATOR CHARACTER TO DISPLAY MAP J SAVED CHARACTER TO ACCUMULATOR i"AND" WITH OLD CHARACTER ) BACK TO DISPLAY MAP ; RESTORE ACCUMULATOR i ********************************************************************** 207 SEJECT 6-903 APPENDIX All 6-904 APPLICATIONS ISIS-I I MCS-48/UPI-41 ,MACRO ASSEMBLER, LOC OBJ LINE V:]. 0 PAGE 6 SOUR CE STATEMENT 208 ; ****************************************************************iI-**** 209 LOOK-UP TABLE THIS LOOK-UP TABLE ORIGINATES IN PAGE 3 OF THE UPI-41 PROGRAM 210 211 I MENORY. IT IS USED TO DEFINE THE CORRECT LEVEL OF EACH SEGMENT 212 j AND DECIMAL POINT FOR A SELECTED CHARACTER FROM THE INPUT ROUTINE. 213 I INVERSE LOGIC IS USED BECAUSE OF THE SPECIFIC DRIVER CIRCUITRY. THUS 214 ,A 1 ON A GIVEN SEGMENT MEANS IT I S OFF AND A 0 MEANS IT IS ON. 21~ I 216 J *******SEGMENTS******** , DP 217 ORG 300H G F E D C D A 218 CHO: ,1 DB OCOH 1 0 0 0 0 0 0 219 CH1: DD OF9H ;1 1 1 1 1 0 0 1 220 CH2: ,I DB OA4H 0 1 0 0 1 0 0 221 CH3: ;1 DB oaOH 0 1 1 0 0 0 0 222 CH4: ,1 DD 99H 0 0 0 1 1 1 0 DB ; 1 223 CH': 92H 0 0 1 0 0 1 224 CH6: DB ,1 82H 0 0 0 0 0 1 22~ CH7: ,1 DB OF8H 1 1 1 1 0 0 226 CH8: DB ; 1 80H 0 0 0 0 0 0 0 227 CH9: ,1 DB 98H 0 0 0 0 0 1 1 228 CHA: ; 1 DB 88H 0 0 1 0 0 0 0 ,1 229 CHB: DB 83H 0 0 0 0 0 1 1 230 CHC: DB ,1 OC6H 0 0 0 1 0 1 231 CHD: ;1 DB OA1H 1 0 0 0 0 1 232 CHE: ;1 DB 86H 0 0 0 0 0 1 233 CHF: ;1 DB 8EH 0 0 0 1 0 234 CHOP: ,0 DB 7FH 1 1 1 1 1 235 CHG: ; 1 DB OC2H 0 1 0 0 1 0 236 CHH: ;1 DB 89H 0 0 0 0 0 237 CHI: ,1 DB OF13H 1 1 1 1 0 1 ,1 238 CHJ: DB OE1H 1 1 0 0 0 0 239 CHL: ; 1 1 DB OC7H 0 0 0 1 1 1 240 CHN: ,1 OA8H DB 0 0 1 0 1 1 241 CHO: ; 1 DB OA3H 0 0 0 0 1 1 242 CHP: ,1 DB BCH 0 0 1 0 0 243 CHR: ; 1 DB OAFH 0 0 1 1 1 244 CHT: ,I DB 87H 0 1 0 1 1 0 24::1 CHU: ,1 DB OC1H 1 0 0 0 0 246 CHY: ,1 DB 91H 0 0 0 0 1 247 CHDASH: DD O13FH 0 1 " 248 CHAFOS: DB ,1 OFDH 1 0 249 BLANK: ; 1 1 DB OFFH 1 250 ; ************************************************************************ END 2"1 , 0300 0300 0301 0302 0303 0304 030~ 0306 0307 0308 0309 030A 0308 030C 0300 030E 030F 0310 0311 0312 0313 0314 031~ 0316 0317 0318 0319 031A 0318 031C 0310 031E 031F CO F9 A4 DO 99 92 82 F8 80 98 88 83 C6 AI 86 8E 7F C2 89 FB El C7 AB A3 Be AF 87 Cl 91 BF FD FF USER SYMBOLS 031F BLANK CH6 0306 CHD 0300 CHJ 0314 CHY 031C BLKMAP CH7 CHOASH CHL DISPLA ASSEMBLY COMPLETE, OOOE 0307 0310 031~ 0010 CHO CH8 CHDP CHN DPOINT 0300 0308 0310 0316 004E CHI CH9 CHE CHO INPUT 0301 0309 030E 0317 0036 CH2 CHA CHF CHP RETURN NO ERRORS 6-905 0302 030A 030F 0318 0051 CH3 CHAPOS CHG CHR SETIME 0303 031E 0311 0319 0030 CH4 CHB CHH CHT START 0304 0308 0312 031A 0009 CH5 CHC CHI CHU TIME 0305 030C 0313 031I3 FFFl APPLICATIONS LOC OBJ 4889 99E5 9992 99E4 4899 E5 4891 c:; 4802 2A2848 4995 II6ee 4997 7E 4888 E61F 4gefl 88 4889 4F 499C CD1D49 499F 78 4918 C629 4B12 DA1A48 4915 47 4916 23 4917C39749 491A C1 4918 E1 491C C9 SOlmSTATEI£NT SEQ 1 2 0085A SliaRtlffIl£ TO DISPUl'/ THE 8-DIGIT BlFFER STARTlIll 3 AT THE LOCATlIJl POINTED AT ay ItSGSRT ON TI£ UPI-CONfRtUED 4 LED DISPUlY. 5 6 INPUTS:I'ISGSRT - /ESSIG: START LOCATION POINTER 7 DESTROYS: A, FIF'S 8 CfUS: OOTCIR 9 19 ORG 488eH U STATUS EIlU 9E5H ; UPI STATUS ~T 12IBF ; UPI IBF FLAG IflSK EIlU 92H 13 DBBIN EOO ; UPI DBBIN PIJlT .9E4H 14 ; 15 DSPl.R'I: PUSH H ;SAYE HL 16 a ;SfM. 8C PUSH 17 LHLD ; LOAD HL WITH IESSIG: START fI!)R ItSGSRT B,(9! 18 I1YI ; INITIALIZE DIGIT CWflER 19 S1: IKl\I ; GET CIR FOOl BUFFER A," ; I1AKE IT 5 ails ANI 1FH 29 fI)() ; ROO IN DIGIT COUN1ER a 21 C,A ; SAllE TOTAL IN C IKl\I 22 ; OUTPUT CIR PLUS LOCATlIJl TO UPI OUTCHR 23 CALL A,a ; GET DIGIT COUNTER 24 ItOV ; INC FOR I£XT DIGIT ADI 29H 25 ; DONE IF CARR'! SET JC ~XIT 26 a,A ; RESTORE DIGIT COUNTER 27 IKl\I ; INC IESSAGE POINTER H INX 29 ; GO GEl I£XT CIR S1 JKP 29 39; ;RESIORE 8C 31 EXIT: PIJ' ; RESTORE HL 32 POP ;RETWI RET 33 34 ; 35 ; SUBROOTlI£ TO OUTPUT CIt1 TO UPI 36; 4910 491F 4921 4924 4925 4927 9992 !a5 E6ll2 C21D49 79 D3E4 C9 37 39 39 48 41 42 43 44 45 46 OUTCIR: IN ANI JN2 IKl\I OUT STATUS IBF OOTCHR A,C D88IN ; READ UPI STAM ;LOIlI( AT llif ; WAIT UNTIL IBF=0 ; GET CHR ; OUTPUT CIR TO 1.1'1 DBBIN ; RETURN 92H ; LOCATION OF KESSIG: START POINTER RET ; I'ISGSRT: os ; Ell> 6-906 APPLICATIONS FI ASM48 1515- I I LaC F3: SENSOR NOOBJECT PRINT(: LP: ) MCS-48/UP I -41 MACRO ASSEMBLER, 0['-.1 PAGE V3. 0 SOURCE STATEMENT LINE 1 '$M0041A 2 ************.**************** .. **************** UPI-41A SENSOR MATRIX CONTROLLER 3 •5 .. *.**********.*.***.**************************. 6 THIS PROGRAM USES THE UPI-41A AS A SENSOR MATRIX CONTROLLER. 7 j IT HAS MONITORING CAPABILITIES OF UP TO 128 SENSORS. THE COORDINATE 8 ; AND SENSOR STATUS OF EACH DETECTED CHANGE IS AVAILABLE TO THE MASTER 9 ; MICROPROCESSOR IN A SINGLE BYTE. A 40Xe FIFO QUEUE IS PROVIDED FOR 10 ; DATA BUFFERING. BOTH HARDWARE OR POLLED INTERRUPT MET Hans CAN BE USED 11 ; TO NOTIFY THE MASTER OF A DETECTED SENSOR CHANGE. 12 13 j .****.*****.** •• *** •••• *** ••••• ** ••••••• * •• **************************** 14 15 ; REGISTER DEFINITIONS: 16 REGISTER 17 18 RO 19 Rl 20 R2 21 R3 22 R4 R, 23 24 R6 R7 2' 26 RBO RBI MATRIX MAP POINTER FIFO POINTER SCAN ROW SELECT COLUMN COUNTER FIFO-IN FIFO-OUT CHANGE WORD COMPARE NOT NOT NOT NOT NOT NOT NOT NOT USED USED USED USED USED USED USED USED 27 ; *********************************************************************** 28 29 ,PORT PIN DEFINITIONS: 30 31 i PIN PORT 1 FUNCTION 32 33 ; PO-7 COLUMN LINE INPUTS 34 35 36 37 PIN PORT 2 FUNCTION PO-3 P4 P5 ROW SELECT OUTPUTS FIFO NOT EMPTY INTERRUPT 08F INTERRUPT NOT USED P6-7 38 i *********************************************************************** 39 40 .EJECT 6-907 APPLICATIONS 1515-1] NCS-48/UPI-41 MACRO ASSEMBLER. LOC aBv LINE V3 0 PAGE 2 SOURCE STATEMENT 41 ; ************************************************.******************** 42 43 ; CHANGE WORD BIT DEFINITION: 44 4~ FUNCTION BIT 46 47 00-6 SENSOR COORDINATE SENSOR STATUS 48 D7 49 :50 ; *********************************.************************************* 51 52 ; STATUS REGISTER BIT DEFINITION: 53 ~4 FUNCTION BIT 55 56 OBF DO 01-3 ~7 IBF. FO. F1 (NOT USED) ~8 D4 FIFO NOT EMPTY 59 05-7 USED DEFINED (NOT USED) 60 , 61 ** * **** ** ... ***** ***** ***** ** * ** *** ** .. ****** ***** ... *. ** .. * * _.. 62 63 EQUATES ; .* *- _.* . -*- *- 64 OOOF 0008 002F 65 66 67 68 69 70 71 72 73 74 ; THE FOLLOWING CODE DESIGNATES THREE VARIABLES; SCANTM. FIFOBA ; AND FIFOTA. SCANTM ADJUSTS THE LENGTH OF A DELAY BETWEEN • SCANNING SWITCH. THIS SIMULATES DEBOUNCE FUNCTIONS FIFOBA ; IS THE BOTTOM ADDRESS OF THE FIFO. FIFOTA IS THE TOP ADDRESS ,OF THE FIFO THIS MAIoC.ES IT POSSIBLE TO HAVE A FIFO 3 TO 40 ; BYTES IN LENGTH. ; ********************************************************************* SCANTM n FIFOBA 76 FIFOTA EGU EGU EQU OFH OSH 2FH • SCAN TIME ADJUST .FIFO BOTTOM ADDRESS . FIFO TOP ADDRESS 77 78 $EJECT 6-908 APPLICATIONS IS I 5- I I LOC MCS-48/UP I -41 013,) MACRO ASSEMBLER, LINE PAGE V3. 0 SOURCE STATEMENT 79 ; 80 ** ....... ** ******* ... **** *4************************* *************** *it*it** ... 81 INITIALIZATION 82 83 j THE PROGRAM STARTS AT THE FOLLOWING CODE UPON RESET. 84 i THIS INITIALIZATION SECTION THE REGISTERS THAT MAINTAIN THE MATRIX WITHIN 85 j MAP, FIFO AND ROW SCANNING ARE SET UP PORT 1 IS SET HIGH FOR USE 86 j AS AN INPUT PORT FOR THE COLUMN STATUS BIT 4 OF STATUS REGISTER 15 87 j WRITTEN TO CONVEY A FIFO EMPTY CONDITION THE INITIAL COLUMN STATUS 88 j OF ALL THE ROWS IN THE SENSOR MATRIX IS THEN READ INTO THE MATRIX 89 • MAP. ONCE THE MATRIX MAP 15 FILLED THE OEF INTERRUPT (PORT 2-4) IS 90 i ENABLED. 91 92 ; 93 0000 0000 1383F 0002 BAOF 0004 BeD8 9~ ORG INITMX 96 97 0006 I3D2F 0008 89FF 98 99 DODA 2300 Dooe 90 0000 FA DaDE 3A DOOF 09 100 0010 0011 0012 0014 0015 0016 0018 *********************************************************************** 94 101 102 FILLMX 103 MOV MOV MOV MOV ORL MOV MOV MOV DUTL IN AD 104 105 FA 106 C618 107 JZ C8 CA 108 DEC DEC 040D BALD DOlA FA ODIE 3A ODIC F5 109 110 I I I OBFINT 112 MOV MOV JMP MOV MOV 113 oUTL 114 EN 0 RO.tt3FH R2,ttOFH R4, ttFIFOBA R~, ttFIFDTA PI, #OFFH A, .. OOH ST5, A A,R2 P2,A A, PI @RO, A A,R2 DEFINT RO R2 FILLMX R2,#IOH A, R2 P2, A FLAGS MATRIX MAP POINTER REGISTER, TOP ADDRESS SCAN ROW SELECT REGISTER, TOP ROW FIFO INPUT ADDRESS REGISTER, BOTTOM OF FIFO FIFO OUTPUT ADDRESS REGISTER, TOP OF FIFO INITIALIZE PORT 1 HIGH FOR INPUTS INITIALIZE STATUS REGISTER, FIFO EMPTY WRITE TO STATUS REGISTER, BITS 4-7 sCAN ROW SELECT TO ACCUMULATOR OUTPUT SCAN ROW SELECT TO PORT 2 INPUT COLUMN STATUS PORT 1 LOAD MATRIX MAP WITH COLUMN STATUS CHECK SCAN ROW SELECT REGISTER VALUE FOR 0 IF 0 ENABLE OBF INTERRUPT DECREMENT TO NEXT MATR I X MAP ADDRESS DECREMENT TO SCAN NEXT ROW FILL NEXT MATRIX MAP ADDRESS BIT 4 HIGH IN ROW SCAN SELECT REGISTER ROW SCAN SELECT VALUE TO ACCUMULATOR INITIALIZE PORT 2, BIT 4 FOR "EN FLAGS" ENABLE OBF INTERRUPT PORT 2, BIT 4 115 116 '!iEJECT 6-909 APPLICATIONS ISIS-I I LOC MCS-4B/UPI-41 MACRO ASSEMBLER, OBJ LINE 117 lIB 11 q 120 121 122 123 124 125 126 127 12B 129 130 131 132 133 134 PAGE V3.0 SOURCE STATEMENT i********************************************************************** SCAN AND COMPARE ) THE FOLLOWING CODE IS THE SCAN AND COMPARE SECTION OF THE PROGRAM. ,UPON ENTERING THIS SECTION A CHECK IS MADE TO SEE IF THE ENTIRE MATRIX ,HAS BEEN SCANNED. IF SO THE REGISTERS THAT MAINTAIN THE MATRIX MAP AND ROW ; SCANNING ARE RESET TO THE BEGINNING OF THE SENSOR MATRIX. IF THE ENTIRE ,MATRIX HASNT BEEN SCANNED THE REGISTERS INCREMENT TO SCAN THE NEXT ROW. i FROM THIS POINT ON THE ROW SCAN SELECT REGISTER IS USED FOR TWO FUNCTIONS. i BITS 0-3 FOR SCANNING AND BITS 4 AND :5 FOR THE EXTERNAL INTERRUPTS. THUSLY ,ALL USAGE OF THE REGISTERS IS DONE BY LOGICALLY MASKING IT SO AS TO ONLY ,AFFECT THE FUNCTION DESIRED. ONCE THE REGISTERS ARE RESET. ONE ROW OF THE ; SENSOR MATRIX IS SCANNED. A DELAY IS EXECUTED TO ADJUST FOR SCAN TIME ,(DEBOUNCE). A BYTE OF COLUMN STATUS IS THEN READ INTO THE MATRIX MAP. ; AT THE TIME THE NEW COLUMN STATUS IS COMPARED TO THE OLD. THE RESULT IS j STORED IN THE COMPARE REGISTER. THE PROGRAM IS THEN ROUTED ACCORDING TO ,WHETHER OR NOT A CHANGE WAS DETECTED. 13~ 001D ODIE 0020 0022 0023 0024 0026 0028 0029 002B 002C 0020 002E 0030 0032 0033 0034 0035 0036 FA ~3OF C626 C8 CA 042C B83F FA 430F AA FA 3A BBOF EB30 09 20 DO AF C669 136 ; **** tf *tf**.* *tf**tftf ****.tf tf **tf***** ****************** ******************* 137 13B ADJREG: MOV A. R2 SCAN ROW SELECT TO ACCUMULATOR 139 ANL A.tfOFH CHECK FOR 0 SCAN VALUE ONLY, NOT INTERRUPT 140 ,JZ RSETRG IF 0 RESET REG I STERS 141 DEC RO DECREMENT MATRIX MAP POINTER 142 DEC DECREMENT SCAN ROW SELECT R2 143 ,JMP SCANMX SCAN MATRIX 144 MOV RO •• 3FH RESET MATRIX MAP POINTER REGISTER. TOP ADDRESS A, R2 MOV SCAN ROW SELECT TO ACCUMULATOR 14' 146 ORL RESET SCAN ROW SELECT, NO INTERRUPT CHANGE A. *OFH 147 R2, A MOV SCAN ROW SELECT REGISTER 148 SCANMX: MOV A. R2 SCAN ROW SELECT TO ACCUMULATOR 149 OUTL P2. A OUTPUT SCAN ROW SELECT TO PORT 2 150 MOV SET DELAY FOR OUTPUT SCAN TIME R3. *SCANTM R3.DELAY2 1'1 DELAY2: D,JNZ DELAY IN A. PI INPUT COLUMN STATUS FROM PORT 1 TO ACCUMULATOR 1'2 153 XCH A. I!:RO STORE NEW COLUMN STATUS SAVE OLD IN ACCUMULATOR XRL A. I!:RO COMPARE OLD WITH NEW COLUMN STATUS 1'4 155 MOV R7. A SAVE COMPARE RESULT IN COMPARE REGISTER ,JZ CHFFUL IF THE SAME. CHECK IF FIFO IS FULL 1'7 158 $EJECT "" 6-910 APPLICATIONS 1515-1 I LOC MCS-48/UPI-41 MACRO ASSEMBLER, OB~ LINE 1 ~9 V3.0 PAGE SOURCE STATEMENT j 160 161 162 *********** ••••• ***** •••• **** ••••••••••• ********* ••• *******.****** •••••• CHANGE WORD ENCODING 163 j THE FOLLOWING CODE IS THE CHANGE WORO ENCODING SECTION. THIS 164 ; SECTION IS ONLY EXECUTED IF A CHANGE WAS DETECTED. THE COLUMN COUNTER 16~ i IS SET AND DECREMENTED TO DESIGNATE EACH OF THE 8 COLUMNS. THE COMPARE 166 ; REGISTER IS LOOKED AT ONE BIT AT A TIME TO FIND THE EXACT LOCATION OF 167 j THE CHANGE(S). WHEN A CHANGE IS FOUND IT 15 ENCODED BY GIVING IT A 168 j COORDINATE FOR ITS LOCATION. THIS IS DONE BY COMBINING THE PRESENT VALUE 169 ; IN THE ROW SCAN SELECT REGISTER AND THE COLUMN COUNTER. THE ACTUAL STATUS 170 ; OF THAT SENSOR IS ESTABLISHED BY LOOKING AT THE CORRESPONDING BYTE IN 171 ; THE MATRIX MAP. THIS STATUS IS COMBINED WITH THE COORDINATE TO ESTABLISH 172 ; THE CHANGE WORD. 173 174 175 0038 BB08 003A CB 003B FO 77 0030 AO Q03C 003E 003F 0040 0041 0043 0045 FF 0046 ~30F 77 AF F24~ 0469 FA 0048 E7 0049 E7 004A E7 0048 4B THE CHANGE WORD 176 177 RRLOOK: 178 179 180 181 182 183 184 185 lS6 ENCODE: 187 188 189 190 191 MOV DEC MOV RR MOV MOV RR MOV ~B7 ~MP MOV ANL RL RL RL ORL R3.ttOSH R3 A, BUILD A BlfFER 3 ; STfRTlIIl AT IIlFSRT. REIi B COOAINS TIE /lII1BER (f CIfNlES 4 ; lP!ll EXIT. TIE IIIXHUI IUIIIER (f CIfNlES IN ANI' 01£ CfU. 5; IS 255. 6; 7 ; IIf'UTS: IIlTHIIil 8 ; OOTPUTS: CIfNlE 9; IQI) BlfFER AT IIlFSRT CIfNlE IQI) crurr IN REIi B 18 ;CfU.S: IIlTHIIil 11; 4888 88E5 88E4 9818 8001 ·4388 4888 4883 4885 4887 4889 218843 8688 0BE5 E611 C8 488R 0BE5 480C E681 488E C/l8548 4811 0BE4 4813 n 481423 4815 84 4816 C8 4817 C38548 12 13 STATIJS 14 DBBOOT 15mO 16 OOF 17 IIlFSRT 18 ; 19 STflRT: 28 21 1'(ll1: 22 23 24 25 26 27 alG EIlU EIlU EIlU EQU EIlU LXI IIYI IN /WI 4800H 8E5H 8E4H 1111 81H 4381Jl H, BUFSRT B,8IJl STATUS FIFO OR OOF RZ IN /WI JZ IN STATUS OOF I'(ll1 D!I8OOT 28 29 38 I«lY It. A INX INR H 8 31 32 33 ; 3400 RZ Jill' I'(ll1 6-914 LPI STA1US POlT LPI DBBOOT POlT FIFO lilT Ell'TI' IIASK OOF IIASK BlfFER STfRT LOCATION INITIALIZE BUFFER POINTER ClEfR CIfNlE WOOl crurrER RERO lI'l STATUS TEST FIFO lilT Ell'TI' All> OOF ~ IF ZERO RERO LPI STATUS TEST OOF Fl.OO WRIT IF lilT REfI)Y RERO CIflNGE WORD LOllI) BUFFER WITH CIfNlE WORD INC BlfFER POINTER INC CIR«lE IQI) COUNTER EXIT IF COUNTER = 256 CHECK IF PllRE CIfNlE WOROS APPLICATIONS 1515-/1 1l:5-48IlPl-41 PKRO A55E11lLER, V2. a 11'-41 CQIlltfHlON 110 DEVICE LOC OOJ SEQ S(J.m STATEl£NT 1 $10)42 2 i *************************t.'UOO*t***********1 I I I til I ********** 3; 4 ; TIllS 1JPl-41 PROGRff1 IIt'LE/£HTS A FlU-DlRE)( IHiT WITIl OII-CHIP 5 ; BfU) RATE GEl£RATION IN CQIllNATION WITIl AN a-BIT PfiRLEL 110 6 ; PORT. TIlE IlfU) RA1E 15 5ELECTABLE FmI ua 10 12e9 B/lIJ). TI£ 7 ; PARfUEL 110 ron 15 I'ROORIfIItfRE FIJ1 EITI£R INFUT OR emPUT. a; 9 ; IHTERRlJ'T OOTPUTS ARE A'lAILfIlLE FIJ1 DATA RVAILfIlLE ON TIlE RECEI~ 1a ; fill) PflffiLLEL INFUT. 11£ STATUS REGISTER I'IJST BE REAO TO DmRPHNE u ; IIHCH ~ CfUSED TI£ INTrnM'T. THE FLAGS Fa AND F1 COIlC TIlE 12 ; INTERRIJPT~. Fa fill) F1 ALSO GIVE AN IPI>ICATION OF rotIANI) 13 ; ERRORS. 14 ; 15 i *********************************************************************** 16 ; 17 ; REGISTER DEFINlllON 18 ; 19 ; R8Il a 29; 21; 1 2'.1 ; 2 23 ; 3 4 24 ; 25; 26 ; 27 ; 28; 5 6 7 NOT USEe NOT USED NOT USED RX STATUS (RXSTS) RX IU.DIPll RX TICK CruffER RX DE5ERIALIZER STATUS REG ST~ RBi NOT USED RATE COIlS] ANT TICK COlMfER SERIALI2ER BUFFER STA1US (TXSTS) COI'IIIAN!) STORE ACe. IImRRIJP1 SRVE BfU) TX TX 1X 1X 29 ; *********************************************************************** 38; 31 $EJECT 6-915 APPLICATIONS LOC IJlJ SEQ so.m STATEIEHT 32; 33 ;**... 1 34 ; I 11*1111111111 I I' ' ............. '11 IIII ********......... 35;catffN)S 36; 37 ; m.F1Gt»:: 8 8 8 ABC D P 38; 39; 48; Ii - 1288 IIfU) SillCT 41 ; D - U8 IIfU) SELECT E - PARfl.LEL 110 DIRECTlIJl 8 - IIf'UT B - 688 BIW saECT C - 388 IIIU) SElECT 42; 43; 44; 1 - OOTPUT 45 ; 46 0; 47 ; 110: RESET 18888888 888888 ~:11 48; (1'EIlI'OOI11O~T1IJl) (RESET RX ~ IN STAnIS) 49 i~**********""'''''''*******1 58; 51 ; STATUS REGISTER D!:FINITIIJl 52; 51 ; 54; 55; 56; 57; 58; 59; 68; 61 ; 62; 63; 64; 65; 66; 67; 68; 6!1; 78; BIT D!:FINITIIJl 8 1 2 3 4 5 6 7 OOF - DATA AVAILABLE IEF -!AJS'/ Fe F1 NOT USED TXINT - TX INlET I' mIIlNG ERRCR 0'v'ERR\JI ERRCR 10 DIRECTlOO 10 FlAG ~l~T TX FlAG - TRlftiI1lnlNG ~ REQI.£ST BVTE - ~ IN BlfFER TX PIf'£l.INED DATA 811 STfRT 811 FLAG I«lT USB) I«lT USED NOT lJ5EI> I«lT USB) 89; 'f ***••••*...*****..**«=tt***************..... 99 ; ********************tt 91; 92 ; PORT 2 DEFINIlIOOS 93 ; 94 ; BIT 95; 96; 97 ; 98; 99 ; 100 ; 4 1B1; 0 182 ; i, 1BL 7 DEFINITIOO TX DATH I«lT USB) NOT USB) IX INTERRl.fT !J8F INTERRlJ'T (RX OR 110 DATA A'lAllABlE) NOT USB) NOT USED (TJCI: SAllPLE) I«lT USED 184 ; 195 ; ..*******************.*************************************** I t 186 ; 1B7 ; MISC. II *.* 188 ; T9 INPUT RX DATA T1 INPUT 76.8KHZ (1 221l8I1HZI16) 11B; EXTClOCl: 111; 112 i **********************.*.......*************************** I 113 ; 114 $EJECT 189 ; 6-917 I I I II I I 1.. * APPLICATIONS LOC C81 8001 8882 ge84 8988 8918 8828 8848 8888 11881 8882 8848 8888 ge84 887F 8883 8828 8824 ge84 88FB 8888 8988 8828 8828 883F 8849 8888 8001 88FE 8988 9883 988S 5(UCE STRID£HT U5; U6 j **********'_ _ _,.. II"'I . . . . . . .~**************.****:M****** 117 ; U8;~ EQUATES: 119 ; 128 RXFLG EQU 81H ; RECEI"" FLAG IN RXSTS 121SR1FLG EQU 82H ; START BIT FLAG IN RXSTS 122 BFFLG EQU 84H ; 8'ITE FINISI£l) FLAG IN. RXSTS 123 DATROY EQU 88H ; DATR REff)Y FLAG IN RXSI S 124 FRRIER EQU 1SH ; FRRIIING ~ FLAG IN RXSTS 125 Il\mj EQU 28H ; MRRUN ERROR FLAG IN RXSTS 126 l00IR EQU 48H ; 110 DIRECTI~ FLAG IN RXS·'S 127/1RG EQU OOH ; 110 REQl£ST FLAG IN RXSTS 128 TlIl'l.G EQU 91H ; TX FLAG IN TXST5 129 REIlFLG EQU 82H ; REQUEST ME FLAG IN TXSTS 138 mOOT EIlU 48H ; TICK SIftPlE BIT IN PORT 2 131 RXINTL EQU OOH ; RX DESERIRLIZER IN/TIRLIZATI~ 132 TlCSRT EQU 84H ; TICK INiTlRLIZATIlfI 133 RSC/tSI( EQU i'fH ; ASCII /IASK 134 TIme EQU 93H ; TX TICK Ill) /IASK 135 Tl\E1I) EQU 48D i TICK coon RT END fF IX CHlRRCTER 136 STPoo EQU 36D ; liCK coon AT 00 OF TX DATA 84H ; rIRRJ( IlUTPIIT 137 1ffIlK' EQU 138 SPACE EQU 8F8H ; SPACE OOTPUT OOH ; GEIERlI. CLE/f( 139 ZERO EQU 149 TXINT EQU 88H ; TX INTERRIJ'T OUTPUT IN PORT 2 141 TXBIT EQU 2 8 H , TX INTEkRLf'T BIT IN STAT1JS 142 TIIall oQU 32D ; TIlER ClfISTRNT RRII LOCATION 143 RSTERR EQU 3FH ; RESET ERRU1/IASK FOR STATUS 144 FESTS EQU 48H ; FRfIItING ERROR BIT IN STAM 8IlH ; O'IERRUN ERROR BIT I N STATUS 145 OYSTS EIlU 81H ; rIRRJ( IlUTPUT TO PORI 146 ttKllUT EQU 147 SPOUT EQU 8FEH ; SPACE WTPUT TO PORT 88H IX START BIT FLfI(j 148 S81T EQU 149 RXSTS EQU R3 RX STATUS REGISTER 158 TXSTS EQU R5 TX STATUS REGISTEk 151 ; 152 $EJECT 6-918 APPLICATIONS LOC IIIJ SEQ S!UCE 5TA1EI£NT 153 ; ...................... 1 154 ; 155 ; R58 YECTlI! LOCATION 156 ; 157 ;***............... 1111 158 ; 159 lI!G B988H 168 ; 161 RESET: SEL RIl8 162 JII' INIl 163 ; III I I . II I It.11 rllllill I 11**111111 .tlllllll ...... 8887 D5 B888 RF 8889 F9 8IIIlR 88 B888 5688 8880 62 8812 FD 88178418 8819 8R81 .... 11 II. 165 ; 166 ; rIl£R INlBlRlI'T LOCATION - TII£R IS SET TO 4 rI~ lIE 8IID RIllE. 111: 167 ; RECEI'IER fII) TRffISIIITTER 1ft: SEJrlICED E'taN FIX.!! 1116 lICKS. !>tfllfRE 168 ;DElRY LIO' IS USED FlI! TI"IIil FII£-lLNIIil. RB1 R1 POINTS Rll1£LRY 169 ; CONSTANT RT INlBlRlI'T. 1<1-1 POINTS R1 TII£R CONSTRNl. 179 ; 171 ;'" II J rtt..............._ I 1111 ................. 111111111111111.* 172 ; 173 lI!G 8987H 174 ; ; INlBlRlI'l PROCESSIIil IN RB1 RBi 175 TI"INT: SEL ; 5RYE fUtII.l.fIll1! IN R7 R7,R lIllY 176 R,R1 ;GET TII£R CONSTANT lIllY 177 ; DElRY TO GET INTO 11 HIGf I«lP fill ; WRIT IJITIL 11 IS LOI INI1 179 INT1: JT1 T,R ; lIEN LCR> COlNTER lIllY 180 181 ; 182 ;TICK SfII'LE OOTPUT 183 ; P2,If«)T TICOUT 184 P2..TICWl 185 186 ; 187 ; ...***********... 1111111111 ........********111 111111+' 1111 ....... 188 ; 189 ; TRffISIIITTER OOTPUT - lIItE CRITICAL TfIS1(5 DOI£ FINST. DATR BIT OlITPUl 198 ; PIP8.INE~ IN TXSTS BIl 2 IS OOTPUT IOl 191 ; 192 81113 5219 8815 9fFE I I II MU* ;GET INTO RII8 RT R58 ; GO TO INITIALIZATION 164;11111***1111 II .............. ' 11987 II *****..... ;****111111 . . . . . . 1111111. III 1111*******111111111111111111 .......... 193 ; 194 TXOOT: lIllY 195 JB2 196 fit. 197 JIll' 198 IO.JT:. lI!L 199 ; It TXSTS IO.JT P2,1SPOUT ; GET Tl( STRTUS ; TEST PIf'ELII£D DATR ; OOTPUT SPOCE IF RESeT ; DO RECEIVER RCV P2.M<0lIT *. -.. 298 ; ................... 2B1 ; ; OUTPUT t'fR' _H •••• tt IS SET I II II t.t.-t. I II I 1.*******'." 282 ; SHiH OF RECEI'IER FLOI - RXSIS REGISTER 283 ; I«l.DS RECEIVER STRTUS. 284 ; 295 8818 C5 i************"'IIIIIIII"'*~"'''''' 286 ; 287 RCV: SEL RII8 6-919 ; SWITCH TO RX BfN( APPLICATIONS lOC (EJ SEQ S(UCE STATEI£I(f 991C FB 298 lIlY 891D 1226 289 J[j8 II. RXSTs RCY1 JT8 lOUT (I1l R.IRXFlG RXSTs.A IOIIT 991F 3668 8821 4381 8823 III 88248468 218 211 212 213 214 215 216 217 218; 219 ; sTIIIl lIlY .III' ; GET RXSTs ; TEST WEC£IYI: FI.Rl ; 8 - 1«1 CII! I£IItl RECl:I'yg) ; 1 - POSsIIilE STIIIT ~IT. DO TESI ; TEST 00 IN'UT ; 8 - SI'ACL SET RIC FI.Rl ; 1 - 1ft!(. GO ClECK IOIIT ; SPACC - SET RIC FI.Rl ; RESTIRE RXSTs ; 00 IftI)lE XItTR BI1 lID 228 ; B826 3238 8828 3633 88211 4382 882C III 882I) BE88 882F BI)84 8831 8468 883] 53FE 8835 III 8836 8468 11838 ED68 883R lIOII4 883C 5240 883£ 883F 8841 8842 8843 97 2642 A7 FE 67 8844 RE 8845 E668 8847 8848 884A 8848 FB 4384 III 8468 884D 2668 221 RCY1: 222 223 224 225 226 227 228 191 JTB RCY3 RCY2 (I1l A.ISRTFlG RXSTs.A R6.IRXINTl R5.'TICSRT IOIIT lIlY lIlY lIlY ; FIRST lEST STfI!T BIl ~lRG ; TEST 00 1/f'Ul ; 8 - SPACE. 00ll STIIIl BIT ; 1 - RK. BfI) STfI!T BIl. IGIlJRE ; 00ll STllll - SET STIIIT BIT FI.Rl ; REST(Jl( RXSTS ; 5ETlI' RIC DESERIRlIZER ;llH> RIC liCK CMTER ; GO IftI)lE IOITR .III' ; ; BfI) STIIIT BIT - R£SET FlAGS ; RCY2: IN. A.II«IT RXFlG ;RE5I:.' R£Cl:I~ FI.Rl RXSTS,A 234 lIlY ; R£STIRE RXSTs 2]5 ; 00 IftI)lE IOITR .III' IOIIT 236 ; 237 ; IN nlOOlE II' CII! - SIffI.f EVERY 4 linER TICI(S 238 ; ; IIlIT IMll 41li TICK R5.IOIIT 239 RCY3: DJHZ ;RElIH> RJ( TICK ~lER 1(5••TICSRT lIlY 248 ; TEST BYTE FINI5I£D flAG RCY5 192 241 ; B - nlOOlE II' CII!. ClIITIIIJE 242 ; 1 - I)(J£ Nil H 51(1' BITS 243 ; CI.EfI! CIWI BEFIRE ROTA~ ClR C 244 ; 1EST 00 IN'UT RCY4 M8 245 ;00 IS RK. SET CfI!RY CPl C 246 ; GET DE5B 997F B499 299 ; III 11111***..*** 291 , 292 ,STAlT OF TRfIISIIHTER FLOW - TRfIISIIlllI:R IS SElNIC8l EVERY 4 TICKS. 293 ,TI£ TX TICK COLmER SERVES AS TI£ TX 811 CWITER. TRfIISIIIlTER STATUS 294 , IS HElD IN TI£ TXSTS REGISTER. 295 , 296 ; ............................................... 111111 ................. 297, 298 lOIlT: sa ,BE m WE'RE IN R81 R81 299 lIlY R.TXSTS ,GET TX STAT\.IS 388 J81 SRTBIT ,THIS IS STfRT GF STfRT BIT 381 II«: R2 ,II«: TX TICK CWITER lB2 lIlY R. 11XTlC ,TEST TICK CWITER 10) 4 383 fN.. A.R2 lB4 JNZ RET1.IlN ,IF IIlN-ZERO. "IOOlE GF BIT A. TXSTS ,ZERO. GET lXSTS lB5 ItOY lB6 A ,Cm>LEl£NT FOR 8 TEST CI'I. 387 JB8 ,TEST TX FIJIi Xl!T4 388 ) 8 - t«lT TXIt«l. CI£CK FOR 1£11 CII! lB9 ,1 - CURRENTLY IN CII! R.llXE/1) 318 lIlY ,CI£CK FOR 00 GF MTR III) ST(I' 311 XRL R.R2 ,XII! WITH CtJRENT TICK crull 312 JNZ XIIl1 1 t«lT Da£. CONTIIlE 313 lIlY R. TXSTS 1 Da£. GET TXSTS 314 fit. R.INlT TXFLG ,RESET TX FIJIi 315 lIlY ,RESTORE TXSTS TXSTS.A 316 JIll RET1.IlN lGO EXIT 317, 6-921 APPLICATIONS LOC OOJ 9881 2324 9883 Dfl Il884 968C 8986 FD 8887 4384 Il889 fI) Il88A 8488 888C F8 67 Il88E fII Il88I) Il88F FD 8898 F697 8892 SJF8 9894 fI) 9995 8488 8897 4384 8899 fI) 889A 8488 889C J2A8 889E Fe 889F fII 89A8 FD eeA1 53FD 89AJ 4J89 II9A5 5JF8 88A7 fI) 88A8 8A98 88AA C5 88AB FF 88AC 4328 88AE AF fl9AF 98 SEll 500lCE STATEI£Nf 318 ; Cl£C!( IF 11'5 TIlE FOR STIP BIT 319 ; It ISTf'EII) ; (;/£c!( FOR STIF BIT TIlE 328 001: /lOY A,R2 ;~ WITH llc!( CWfTER :l21 lIRl XIIT2 ; NOT TIlE, 00 !£XT BIT :l22 JNZ J23; J24 ; TRANSIt IT sTIP BIl :l25 ; It TJ(5Ts ; GEl TX STAM /lOY J26 It IIfIlI( ; S£Tlf PIPRII£D sTIP BIT J27 0Rl TJ(5Ts,A J28 /lOY ; RESTORE TX STATUS ;RE~ :l29 JIt' R£T~ 3J8 ; m ; IN "IDOlE IF CII! - TRANSIIIT I£XT BIT 3J2 ; m 002: /lOY A,R3 ; Ii:1 IX SERIAlIZER 334 RRC A ; ROTATE !£XT BIT INTO CARRY Il5 /lOY R3,A ;R5TORE SERIAlIZER A, TJ(5Ts 3J6 /lOY ; (£[ IX STAM FOR plPRINED DflTA 337 IC XIIB ; OUTPUT A IIlRK IF 1 338 A, ISPACE IN. ; R£SET TXDflTA BIT JJ9 TXSTs, A /lOY ;R£5TORE TX STATUS 348 JIt' R£TLIIN ;00 EXIT A,1IfIlI( 341 XIITJ: 0Rl ; SET TXDflTA BIl 342 /lOY TXSTS, A ; RESTOR!: TX STATUS 343 JIt' R£TLI1N ; 00 EXIT 344 ; 345 ; TEST R£Qt£ST Flffi sita NOT C~TlY TRANSIIITTING 346 ; 347 004: 181 ; TEST TX R£llI£sT Flffi ~ ;a - NO CII! WAITING IN 8tFFER 348 349 ; 1 - CHR WAITING IN 8U'FER ItR4 ; CHR I.UTlNG. GET IT F~ HOLDING 358 /lOY R3,A ; PUT IN SERIAllZER 351 /lOY ; GET TJ(5Ts It TXSTs 352 IIOY It II«IT R£IlFLG· ; R£SET R£QlJEST Flffi 353 IN. ; SET TX ANI) START BIT FLffiS It ITXFlG OR SBIT 354 0Rl A,ISPACE ;S£Tlf TXDflTA FOR START BIT 355 IN. TJ(5TS,A ; RESTORE TXST5 356 /lOY 357 ; 35B ; TX BlfFER ~ - SET TXINT PIN ANO BIT 359 ; 368 XIIT5: 0Rl nlTXINT ; SET TXINT PIN J61 sa RB8 ; SWITCH FOR ~15 ;GET STs J62 /lOY ItR7 J6J 0Rl It ITXBIl ; SE1 TXINT BIl R7,A ; R£STORE STS /lOY J64 STS, A ;LOAO STAlUS /lOY J65 J66 ; 30( ; *******************************.**********.*******....********..... 368 ; J69 ; EXIT FOR TIlER INTERRIJ>T RWTIP£ POINT 378 ; 371 ; ••tt.....************************************....*********************. 372 ; II9B8 1)5 373 R£T~: sa RS1 IlIIB1 FF 81182 93 374 J75 376; /lOY RETR ItR7 ; IRE SIft WE'R£ IN RBi ; RESTORE A ; ~ WITH R£5TORE .t._*****""""."""",,******- Tn ;.... I I I I I I I I I 111 I II I II II 378 ; 379 ; GET HERE IF INTERRIJ>T 15 FIRS] FOR START BIT - ClEAR START BIT Flffi IN JB8 ; TJ(5Ts ANI) S£Tlf TX Tic!( COIJITER J81 ; III 382 ; .., _, $>'... $>11...'*'11... ' .. _ ....................... 1111111' I J83; It INOT SBIT RESET START BIT Flffi IN TJ(5Ts 384 SRTBIT: IN. TXSTS,A R£STORE TX STATUS 385 /lOY R2, I81H INITIAliZE TX TIC!( CWfTER J86 /lOY ~ 387 JIt' ~ JB8 ; 389 $EJECT -*',...,..,.. '*'11...'..'**'_........ 6-922 APPLICATIONS LOC SWICE STRTEIEHT (RJ 3!iIIl; ~;M'*II~'MII*"M*"'~~*.~""~.'*'.'~'~'~'~~~.II.'M'~~"~~"" 392 ; 393 ; 00fRI) REcmll2ER - GET !ERE FRO! IIIF IIUTE WITH F1 SET. 00fRI) 394 ; 15 5l~ IN R6. BfU) RIllE SELECTI(It BITS ARE EYILI.ImJ) RUiIl TO LEFT. 395 ; 11£ FIRST SET BIT FIXN> DETERltINES THE BfU) RATE. If AN IIMl.ID 00fRI) 3S6 ; 15 DETECTED. BOTH F1 AND FO ARE S£T AND I«l ACTI(It IS TlI 1 ; ; I£RE WITH EITHER 10 OR RESET ERROR WIIN) ; 10ER: JB6 ERR5T IF BIT 6 SET. RESET ERROR FLAGS 10 Am IN RXST5 sa RB9 I9JY ftRXSTS GET RXSTS ORL ftllOFLG SU 10 fUll lIlY RXSTS.A RESTORE RX5T5 CP\. F1 RESET F1 DQ£, JIll' BACK TO IIIIN LOOP JII' IH.P1 449 441 442 443 RESET ERROR 444 00fRI) 6-923 APPLICATIONS LOC OOJ 8131 9132 8m 9135 9136 C5 FF 53JF IF 99 am as 8138 4414 913fl as 9138 95 8BC 4414 91:lE B954 9149 244(; SEQ SOOlCE SlRTEIENT 445 Ekf6T: SEL 446 ItOY RII9 R,R7 fl.lRSTERR R7,R SlS,R F1 1H.P1 ; SlS IN RII9 ; GET SlS ; RESET ERr<1ll FI.OOS ; REST!J 452 ; 453 ; COllIN) ERr<1ll - SET BOTH F1 IN) F8· 454 ; ;SET FB 455 ERRCR: ClR F8 456 CPL FB ; I)(J£, BACK TO IIIIN LOOP 457 JlI' IH.P1 458 ; 459 ; 118 BfW ctllSTffITS 469 ; R1,1-(1741)-2O) iLIR) 118 BfW COOSHIH 461 8119: ItOY ; (;() START TII£R SlTII~ JlI' 462 463 ; 464 ; 308 BfW Cl»6TRNTS 465 ; 9142 B9C2 9144 244(; 9146 99E2 9149 244(; 914R B9F2 914C 9140 914E 814F 9159 9151 F9 62 45 25 as 4414 RL '-(641)-20) 466 8308: ItOY SHlMR 46? JlI' 469 ; 469 ; 609 BfW CONSTffITS 471iJ . 471 B609: ItOY R1, '-(J2D-2O) STTIMR 472 JII> 473 ; 474 ; 1299 BfW CONSTANTS 475 ; RL '-(160-20) 476 B129I!: ItOY 477 ; 478 ; SHIH C!UITER 479 ; fH1 488 SlTIMR: ItOY . T,R ItOY 491 SlRT 00 492 TOOl EN 483 F1 CPL 4B4 IH.P1 JlI' 4B5 496 ; 487 $EJECT 6-924 ; U.ft) l8(j BfW ctllSTffIT ; GO SlARl crulTER ; LIH> 609 BfW CONSlRNT ; GO SlART CWlTER ; LIft) 120iI BfW Cl»6TffIT ; GET crullER CONSTIlIT ; LIR) C!UITER ; START crurrER ; EtfIBLE 1I1£R INTERRlJ'TS ;RESET F1 ; DONE, BfICI( TO ItRIN LOOP APPLICATIONS UK: IIIJ SEQ 488 ; •• ~;""~'MII*.~'MIJ*'~'''M'~~'M'~''''*"I~'*"*'~'*''''*"~'''M'~II*' 4~; 491 492 493 494 495 496 497 11153 CS 11154 FB 11155 F2f;7 11157 FF 11158 53Df II15A IF 11158 ~ 1115C 'IfF? 11151: D5 11151' 22 11168 fr: 11161 FD 11162 4382 11164 II) 1116:> 4414 11167 537F 11169 III 111611 22 8168 39 1116C 4414 4~ ;DATR ROOTII£ - Gl:T IDE WITH IIF II!ITE WITH Fl RESET. THIS ROOTI~ ; FIRST TESTS IF THE 110 FUli IS SET IN THE RX>TS REGlS1ER. IF SO, THE DATA ; IS FlJ/ THE WIPIIT PIIIT. OTHERWISE. THE DATA IS FIR THE T19iSIIITTER fH) ; IS PIJl:El) IN lIE TX BU'FER REGISTER. THE TXINT BIT fH) PIN fIR!: RESET. ; •••• •...... ;~I~'*IIM.~'*'M'*'_*'M'~'*"''''''~'''~'*'M'~',"_''~ '_~_''.'''''.~ ; DATA: SEl R88 499 lIlY R.RXSTS 588 5B1 JB7 10000R lIlY R.R7 R.II«lTTXBIT R7.R STS,A P2.1I«lT TXINT RII1 R.088 R4,R R. TXSTS R.IR£IlflG TXSTS,R IIlP1 5112 58l 584 585 IN. lIlY lIlY IN. 586 587 sa 5B8 lIlY lIlY 589 518 IN IIa. 511 lIlY 512 ill ; JII' 514 ; 10 DATR ROOTINE 515; 516 10000TA: IN. R.1I«lT IlFLG RXSTS,R 517 lIlY 518 IN R.088 Pi,R 51~ OOTL IIlP1 S2Il JII' 6-925 ;DRTR IIN>LED IIOSTLY IN RIl8 ;GET RXSTS ; IF 10 FLf(j SET, DATR IN FOR 110 ;GET STS ; RESET TXINT BIT IN' STS ; RESTORE STS ; LOll) STRTUS ; RESET TXINT PIN TXSTS IN RBi READ DATA PUT DATA IN TX BLfFER GET lXSTS SET RElllEST FUli IN TXSTS RESTORE lXSTS BID( TO IIUN LOOP RESET 10 FUli RESTORE RXSTS READ 10 DATA FRat 088IN OOlPUT TO PORT 1 DONE. IIf£K TO "fUN U)(P APPLICATIONS lOC OOJ 5(UCE STATEl£NT 523 , 524 ; *******.***************************~""***********4'f:"'" S2:J , 526 ,INITIAlIZATIOO - GET tm AT RESET. THIS ROUTINE RESET5 TI£ INTERRIJ'T 527 ,OUTPUTS fill) EtfiIlES TI£It fill) ClEARS TIE fPPRlPRlATE STATUS fH) DATA 52B ,REGI5TER5. 529 , 539 ; ...**********************************************************........... 531, 532 533 , 9298 82Il2 9283 8285 8286 8297 9ff:7 F5 2398 III AD II' 82Il8 D5 82Il9 f£ 82IlA BD84 82IlC 0614 828E 7612 921e 2453 9212 2499 9214 869C 9216 C5 9217 FB 9218 721E 921A mc 1121C 449C 1121£ 85 II21F 95 11229 11221 9223 11224 11226 A5 922E F8 B235 . FB 534 INIT: 53:> 516 537 538 539 549 ~ II299H ANl P2, 18F7H FlAGS It lZERO RXSTS, A A5,A R7,A RB1 R6,A TX5TS, IIfRK EN IIJY PllV PllV IIJY SEl I10V PllV ,RE5E1 TlUNl PIN ,EIIlBI.E INl ERRLPT5 OUTPUT ,ClEAR A ,CLEAR RXSTS ,ClEAR RX TICK COltITER ,ClEAR STS , SW ITCH Blft(S ,CLEAR COIf'IGURE STORE ,SETUP PIf'El.INED Tl( DATA 541 542 543 , 544 j ***************... I 1...*' *I 11 ***** I I I r I I , I III ...*' I I , I I '***........ 545, 546 "tUN lOOP - IBF fill) OBF ARE IflII)lED IN THIS llXl'. IF 18f=L Tlio 547 ,AI'PROPRIATE COItIfN) ~ DATA ROUTINE 15 ACCESSED. IF IBF=9, If£N OBF 549 , 15 TESTED. IF OBF=L IBF IS TESTED AGAIN. AS 5COl AS OBF=9, RXSTS 549 , IS EXIItINE~ TO SEE IF DATA 15 WAITING F~ 0Ul PUT. II£N RX DATA 559 ,READY 15 SET, Fe 15 SET fill) Fl IS~, fill) TIE DATH 15 TRIIISFERRED 551 ,FRO! TI£ RX IOJlING REGISTER INTO DBBOUT AFTER TESTING F~ ERR~ 552 ,FlAGS. ANY EIlRIR FlAGS SET ARE TRfIISFERREO TO TIE 51 ATUS REGISTER 55J ,IF TIE 110 FlAG 15 SET, TIE ~T 15 READ fill) TI£ DATA TRANSfERRED TO 554 ,DBBOUT. 555 , 5S6 ; *************************************************** I I I 1************ 557 , ,IF IBF=9, TI:5T OOF 558 1ti.00P: JNIBF IN..P1 ,IBF=L TEST F1 F~ COIIflII) Clt)J1 559 JF1 ,F1=9, JIJI' TO DATA ROUTINE DATA 568 JIf' CIt) ,OUT-IF-ffllE COI9IfN) JIJI' 561 Clt)J1: JIf' ,WAIT UNTil DBBOUT 15 FREE IH.OOP 56< 1N..P1: JOBF ,RXSTS IN R89 RB9 563 SEl ,GET RX5TS ItRXST5 564 I10V ,TEST RX DAl A R!:ADY FlRll RXR~Y 565 JB3 ,TEST 10 FlRll 10FlAG 566 JB7 567 JIf' IH.OOP 'llXl' 56B , 569 ,RX DAI A READY - TRANSfER TO D8BOOT 579 , ,SET Fe F8 571 RXRIlY: CLR Fe 572 CPl ,RE5ET Fl 5"(3 CLR F1 ,CHECK FRfflING ~ FlAG RXF 574 JB4 ,GET RXSTS It RXSTS 5-"5 RXRIlY1: I10V ,CHECK F~ ~ EIlRIR RXO 576 JB5 ,GET RXSTS AGAIN A,RXSTS 577 RXRIlY2: PllV 6-926 APPLICATIONS LOC OOJ 8227 53t7 578 IN. 579 IllV 588 IllV ruT 581 S82 JIIP 583; 584 ; FRftIIMl ERROR 585 ; 586 RlIf: ItOY IlRL 587 ItOY 588 ItOY 589 599 JIll' 591 ; 592 ; 0\IERRtJj ERROR 593 ; 594 00: ItOY 595 IlRL 596 IllV 597 J10Y 598 JIf> 599 ; 6SO ; 10 Fl.ffi S£T 691 ; 6a2 IDFLfIJ: IllV 683 JB6 684 CLR 685 CLR 686 C!'I. 687 IN. ItOY 688 IN 689 ruT 618 JMP 611 612 ; END 613 9229 III 922A FC 922B 92 a22C 440C Il22E 922F 9231 9232 9233 FF 4340 ~ 99 4423 ~FF 9236 4388 8238 SOOlCE STRTEIEHT SCQ ~ 9239 99 923A 4426 923C FB 823D D20C 923F as 9240 AS 8241 B5 9242 537F 9244 All 9245 89 9246 92 9247 44eC II. II«lT (DRTJ1I)I' RXSTS, A II.R4 D88,R ; RESET 5I.I'E FI.ffiS OR Fl1IIER OR IlYRLIO ; RESTORE RXST5 ; GET DRTA FRO! I«LDIMl REG ; PUT IN D!I8OUT ;LOO' MOO' Fl.ffi 5U ;GET ST5 ; !lET fRlllIMl IORROR FI..OO ; RESTORE STS ; LIlAIl STATUS ; CONTItu: II.R7 II. 1FES1S R7,A 515, A RlIJID\'1 Fl.ffi S£T II.R7 II. IOVSTS R7,A STS,A RXRDY2 ; GET ST5 ; S£T O'lERRltl ERROR Fl.ffi ; RESTORE ST5 ;LIlAIl STATUS ;CONTItu: TEST DIRECTION A, RXSTS IH.OO' F8 F1 F1 II.II«lT HRG RXSTS, A A,P1 DBB,H MIlIlF ; GET RXST5 ; PORT 15 rulPUl - NIl ACTION ; RESET F8 ; S£T F1 ; RESET III Fl.ffi ; RESTORE RXSTS ; R£RI) PORT 1 ; PUT DRTA IN D!I8OUT ; LOOP USER 5'II1BOL5 A5C/1SK Cl'l)2 INIT MKOUT RCY2 REQFLG RXRDY SRTFLG TXEND XIIT2 007F 9121 9200 9001 0033 8002 II21E 0092 0029 ease 8119 CllDJ1 INT1 IROO' RCY3 ! The scan counter provides the timing to scan the keyboard and display. The four MSB's (M3~M6) scan the display digits and provide column scan to the keyboard via a 4 to 16 decoder. The three LSB's (MO-M2) are used to multiplex the row return lines into the 8278. Display Address Registers and Display RAM The Display Address registers hold the address of the word currently being written or read by the CPU and the two 4-bit nibbles being displayed. The read/write addresses are programmed by CPU command. They also can be set to auto increment after each read or write. The display RAM can be directly read by the CPU after the correct mode and address is set. Data entry to the display can be set to either left or right entry. Keyboard Debounce and Control The 8278 system configuration is shown in Figure 3. The rows of the matrix are scanned and the outputs TO TONE GENERATOR ANALOG DETECTOR BP ERROR RlHYS~ J KCl M.' ClR ANALOG MULTIPLEXER IRQ J M3 B041Ai a 8741A 00-07 --B-- TO 8080. B085 OR 8048 MASTER PROCESSOR WR iiD AD CS RESET SYNC '"!6 "0 83"··· oSo 4 TO 16 DECODE - ~ ! 16 ~ I I CAPACITIVE KEYBOARD MATRIX 8 OR 16 DIGIT DISPLAY Figure 3. ~~TSCAN System Configuration for Capacitive-Coupled Keyboard 6-932 I APPLICATIONS TO TONE GENERATOR BP I Rl ERROR I M2 ClR DIGITAL MULTIPLEXER IRQ MO 8041A/ 8741A 00-0 7 a TO B080, 8085 OR 8048 MASTER PROCESSOR --8-- - WR RD ~6 AD RESET I M3 83-··· .BO I 4 TO 16 DECODE ~- 16 --I I ll. I 16 4TO 16 DECODE Cs i - I I I CONTACT KEYBOARD MATRIX 16 DIGIT SCAN 8 OR 16 DIGIT DISPLAY Figure 4. System Configuration for Contact Keyboard COMMANDS The 8278 operating mode is programmed by the master CPU using the AO. WR and DO-D7 inputs as shown below: AD. Cs 3 _____vA_L_D \ WR 00-0 7 INVALID ___ ~X'_ __ '_NV_A_Ll_D_ / X VALID X INVALID The master CPU presents the proper command on the DO-D7 data lines with AO =1 and then sends a WR pulse. The command is latched by the 8278 on the rising edge ofthe WR and is decoded internally to set the proper operating mode. See the 8041A/874IA data sheet for timing details. Where the mode set bits are defined as follows: K-the keyboard mode select bit O-normal key entry mode I-special function mode: Entry on key closure and on key release D-the display entry mode select bit O-left display entry I-right display entry I-the interrupt request (IRQ) output enable bit. O-enable IRQ output I-disable IRQ output E-the error mode select bit O-erroron mUltiple key depression I-no error on multiple key depression N-the number of display digits select 0-16 display digits 1-8 display digits NOTE: The default mode following a RESET input is all bits zero: READ FIFO COMMAND CODe 1011101010101010 Command Summary KEYBOARD/DISPLAY MODE SET READ DISPLAY COMMAND CODe CODe 6-933 I0I I I I I I I I 1 1 AI A3 A2 Al Ao APPLICATIONS Where AI indicates Auto Increment and Aa-Ao is the address of the next display character to be read out. AI = 1 AUTO increment AI = 0 no AUTO increment WRITE DISPLAY COMMAND CODE I I 0·1 0 I AI I Asl A2 IAl I AO I 1 Where AI indicates Auto Increment and Aa-Ao is the address of the next display character to be written. CLEAR/BLANK COMMAND CODE I 1 I 0 I ' I uo IBO Icol CF ICE I Where the command bits are defined as follows: CE = Clear ERROR CF = Clear FIFO CD = Clear Display to all High BD = Blank Display to all High UD = Unblank Display The display is cleared and blanked following a Reset. Status Read The status register in the 8278 can be read by the master CPU using the AO, RD, and DO-D7 inputs as shown below: AO.CS ~ RD The 8278 places 8-bits of status information on the DO-D7 lines following (AO, CS, RD) = 1,0,0 inputs from the master. Status Format I Sa I S2 I S, I So I BIKE I'SF IOBF I . De 05 04 Oa 02 A multiple key closure error will set the KE flag and prevent further key entries until cleared. The IBF andOBF flags signify the status of the 8278 data buffer registers used to transfer information (data, status or commands) to and from the m,aster CPU. The IBF flag is set when the master CPU writes Data or Commands to the 8278. The IBF flag is cleared by the 8278 during its response to the Data or Command. The OBF flag is set when the 8278 has output data ready for the master CPU. This flag is cleared by a master CPU Data READ. The Busy flag in the status register is used as a LOCKOUT signal to the master processor during response to any command or data write from the master. The master must test the Busy flag before each read (during a sequence) to be sure that the 8278 is ready with valid DATA. The ERROR and TONE outputs from the 8278 are set high for either type of error. Both types of error are cleared by the CLR input, by the CLEAR ERROR command, or by a reset. The FIFO and Display buffers are cleared independently of the Errors. VALID \'---_/ 07 STATUS DESCRIPTION The Sa-So status bits indicate the number of entries (0 to 8) in the 8-level FIFO. A FIFO overrun will lock status at 1111. The overrun condition will prevent further key entries until cleared. 0, DO Where the status bits are defined as follows: IBF = Input Buffer Full Flag OBF = Output Buffer Full Flag KE = Keyboard Error Flag (multiple depression) B = BUSY Flag Sa-So = FIFO Status FIFO status is used to indicate the number of characters in the FIFO and to indiate whether an error has occurred. Overrun occurs when the entry of another character into a full FIFO is attempted. Underrun occurs when the CPU tries to read an empty FIFO. The character read will be the last one entered. FIFO status will remain at 0000 and the error condition will not be set. Data Read The master CPU can read DATA from the 8278 FIFO or Display buffers by using the AD, RD, and DO-D7 inputs. The master sends a RD pulse with AO = 0 and CS = 0 and the 8278 responds by outputting data on lines !2ll:D7. The data is strobed by the trailing edge of RD. 6-934 APPLICATIONS DATA READ SEQUENCE Before reading data, the master CPU must send a command to select FIFO or Display data. Following the command, the master must read STATUS and test the BUSY flag and the OBF flag to verify that the 8278 has responded to the previous command. A typical DATA READ sequence is as follows: BUSY J L '--__--'I DBF READ DISPLAY OR FIFO COMMAND FROM MASTER FIRST OAT A BYTe READY t MASTER READS DATA NEXT BYTe READY 8278 PROCESSING NEXT BYTe -J IBF WRITE DISPLAY COMMAND 3 . . .___ WR -JX VA_Ll_D_ _ _ 8278 READY 8278 READY MASTER WRITES NEXT BYTE INTERFACE CONSIDERATIONS If two key closures occur during the same scan the ERROR output is set, the KE flag is set in the Status word, the TONE output is activated and IRQ is set, and no further inputs are accepted. This condition is cleared by a high signal on the CLEAR input or by a system RESET input or by the CLEAR ERROR command. Data Write The master CPU can write DATA to the 8278 Display buffers by using the AO, WR imd DO-D7 inputs as follows: cs 8278 MASTER READY DATA WRITE FOR FIRST BYTE COM,..AND OR DATA Scanned Keyboard Mode With N-key rollover each key depression is treated independently from all others. When a key is depressed the debounce logic waits for a full scan of 128 keys and then checks to see if the key is still down. If it is, the key is entered into the FIFO. After the first read following a Read Display or Read FIFO command, successive reads may occur as soon as OBF rises. AO, L In the special function mode both the key closure and the key release cause an entry to the FIFO. The release is entered with the MSB=1. Any key entry triggers the TONE output for 10ms. INVALID \'-----'/ The master CPU presents the Data on the DO-D7 lines with Ao=O and then sends a WR pulse. The data is latched by the 8278 on the rising edge of WR. The HYS and KCL outputs enable the analog multiplexer and detector to be synchronized for interface to capacitive coupled keyboards. Data Format In the scanned keyboard mode, the code entered into the FIFO corresponds to the position or address of the switch in the keyboard. The MSB is relevant only for special function keys in which code "0" signifies closure and "I" signifies release. The next four bits are the column count which indicates which column the key was found in. The last three bits are from the row counter. BIT 543 o DATA WRITE SEQUENCE Before writing data to the 8278, the master CPU must first send a command to select the desired display entry mode and to specify the address of the next data byte. Following the commands, the master must read STATUS and test the BUSY flag (B) and IBF flag to verify that the 8278 has responded. A typical sequence is shown below. 1 FOR SPECIAL FUNCTION MODE AND KEY RELEASED o FOR KEY DEPRESSED Display Display data is entered into a 16X4 display register and may be entered from'the left, from the right or 6-935 APPLICATIONS COUNT I Yo I HY. KCL ('--_--JX'--_--JX X n l'--____--In'--_--In t RL SAMPL:ED t Figure 5. SCANCVCLE X X X n t n t ~ Keyboard Timing .. I IRQ BP --------------------~ ERROR KEY 1 DEPRESSED KEY 1 KEY 1 ENTERED READ BY MASTER Figure 6. KEY 2 DEPRESSED KEY 3 DEPRESSED Key Entry and Error Timing DISPLAY CHARACTER I Me ------------------1 --I1 M5__________________________________________ Bo-B. \\.-----J! \'------J! '\...-----J! \\...-----J! \\.-----J! \\.-----J! \'-----_ Figure 7. Display Timing 6-936 APPLICATIONS into specific locations in the display register. A new data character is put out on BO-Bg each time the M6-Mglines change (i.e., once every.O.75ms with a 6 MHz crystal). Data is blanked during the time the column select lines change by raising the display outputs. Output data is positive true. LEFT ENTRY The left entry mode is the simplest display format in that each display position in the display corresponds to a byte (or nibble) in the Display RAM. ADDRESS o in the RAM is the left-most display character and ADDRESS 15 is the right-most display character. Entering characters from position zero causes the display to fill from the left. The 17th character is entered Qack in the left-most position and filling again proceeds from there. AUTO INCREMENT In the Left Entry mode, Auto Incrementing causes the address where the CPU will next write to be incremented by one and the character appears in the next location. With non-Auto Incrementing the entry is both to the same RAM address and display position. Entry to an arbitrary address in the Left Entry-Auto Increment mode has no undesirable side effects and the result is predictable: 0 1ST ENTRY Right entry is the method used by most electronic calculators. The first entry is placed in the rightmost display character. The next entry is also placed in the right-most character after the display is shifted left one character. The left-most character is shifted off the end and is lost. 14 15 15 3 1 3 4 3RD ENTRY 11 1 1 2 13 0 1 2 2 1 3 16TH ENTRY 1 3 1 4 3 14 I 4 2 6 5 COMMAND 10010101 ENTER NEXT AT LOCATION 5 AUTO INCREMENT 0 3RD ENTRY 3 1 3 0 4TH ENTRY 4 1 1 2 1 3 5 1 1 2 1 3 1 4 15 In the Right Entry mode, Auto Incrementing and non-Incrementing have the same effect as in the Left Entry except that the address sequence is interrupted. 4 15 1ST ENTRY 11 3 Note that now the display position and register address do not correspond. Consequently, entering a character to an arbitrary position in the Auto Increment mode may have unexpected results. Entry starting at Display RAM ADDRESS 0 with sequential entry is recommended. A Clear Display command should be given before display data is entered if the number of data characters is not equal to 16 (or 8) in this mode. 4 5 6 0 2ND ENTRY I 3 0 116117 1 16 1 DISPLAY RAM 0 6 1 ADDRESS 0 1151161171 15 6 1 1 2 1 3 1141151161 14 17TH ENTRY 1 1 2 0 1 4 DISPLAY RAM 1 ADDRESS 6 0 2ND ENTRY 16TH ENTRY 0 11 3 5 1 0 2ND ENTRY DISPLAY RAM 1 ADDRESS 1ST ENTRY 4 1 0 RIGHT ENTRY 3 4 5 6 1 1 2 0 COMMAND 10010101 ENTER NEXT AT LOCATION 5 AUTO INCREMENT 3 4 3RD ENTRY 4 4TH ENTRY 6-937 6 6 0 1 1 2 1 3 5 6 1 3 1 4 0 1 1 2 1 3 APPLICATIONS Starting at an arbitrary location operates as shown below. . o COMMAND 10010101 3 4 5 DISPLAY RAM 7 r----r"11---'--1--r----111r----r"1---'--1--r---111ADDRESS ENTER NEXT AT LOCATION 5 AUTO INCREMENT 2 3 4 1 3 4 9TH ENTRY 0 6 I I I 2ND ENTRY 6TH ENTRY 0 5 I I 1ST ENTRY 1 . 2 I I I I I I I I I 4 5 6 7 6 1 I I I I I I I 5 6 7 8 9 2 2 3 3 1,4 I Entry appears to be from the initial entry point. 6-938 APPLICATION NOTE AP-161 September 1983 ® INTEL CORPORATION, 1983 NOVEMBER 1983 ORDER NUMBER: 230795-001 6-939 AP-161 COMPLEX PERIPHERAL CONTROL WITH THE UPI-42 TABLE OF CONTENTS INTRODUCTION DOT MATRIX PRINTING THE PRINTER MECHANISM HARDWARE INTERFACE TECHNICAL BACKGROUND SOFTWARE Introduction Functional Overview. Memory and Register Allocation Description of Functional Blocks and Flowcharts CONCLUSION APPENDICES Appendix A. Software Listing Appendix B. Printer Enhancements Appendix C. Printer Mechanism Drive Circuit Schematics FIGURES 1. UPI-42 Pin Configuration 2. UPI-42 Block Diagram 3. UPI-41A, 42 Functional Block Diagram 4. Character E in 5 x 7 Dot Matrix Format 5. Carriage Stepper Motor Assembly 6. Print Head Solenoid Assembly l Hardware Interlace Block Diagram 8. Hardware Interlace Schematic 9. UPI-42 and 8243 I/O Port Map 10. Siepper Motor Step Sequence Waveforms 11. Carriage Stepper Motor Step Sequence 12. Paper Feed Stepper Motor Step Sequence 13. Carriage Stepper Motor Drive Timing 14. Carriage Stepper Motor Predetermined Time Constants 15. Paper Feed Stepper Motor Predetermined Time Constants 16. PTS Lags PT Timing 1l PTS Leads PT Timing 18. Components of Print Head Assembly Line Motion and Printing 19. Data Memory Allocation Map 20. Register Bank 0 Register Assignment 21. Register Bank 0 Status Byte Flag Assignments 6-940 230795-001 AP-161 22. Register Bank 1 Register Assignment 23. Register Bank 1 Status Byte Flag Assignments 24. Program Memory Allocation Map 25. ASCII Character Code TEST Output and Print Example 26. Carriage Stepper Motor Phase/Step Data FLOWCHARTS 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. Main Program Body Power-On/Reset Initialization Home Print Head Assembly External Status Switch Check Character Buffer Fill Carriage Stepper Motor Drive and Line Printing Carriage Stepper Motor Acceleration Time Storage Process Characters for Printing Translate Character-to-Dots Decelerate Carriage Stepper Motor Paper Feed Stepper Motor Drive Addtional sources of information on Intel's UPI devices; "UPI User's Manual" Includes the following Application Notes; Programmable Keyboard Interface Using the 8295 Dot Matrix Printer Controller An 8741 Al8041 A Digital Cassette Controller "8048 Family Applications Handbook" "1983 Microprocessor and Peripheral Handbook" "MCS-48 and UPI-41A/42 Assembly Language Manual" "Specifications for Impact Dot Matrix Printer Model-3210", Epson, Jan 8,1981 6-941 230795-001 AP-161 INTRODUCTION The UPI-42 is the newest member of Intel's Universal Peripheral Interface (UPI) microcomputer family. It represents a significant growth in UPI capabilities resulting in a broader spectrum of applications. The UPI-42 incorporates twice the EPROM/ROM of the UPI-41 A, 2048 vs 1024 bytes"twice the RAM, 128 vs 64 bytes, and operates at a maximum speed twice that of the UPI-41A, i.e. 12 MHz vs 6 MHz. The ROM based 8042 and the EPROM based 8742 provide more highly integrated solutions for complex stepping motor and dot matrix printer applications. Those applications previously requiring a microprocessor plus a UPI chip can now be implemented entirely with the UPI-42. The software features of the UPI-42, such as indirect Data and Program Memory addressing, two independent and selectable 8 byte register banks, and directly software testable I/O pins, greatly simplify the external interface and ~oftware flow. The software and hardware design of the UPI-42 allows a complex peripheral to be controlled with a minimum of external hardware. TEST 0 Vee XTAL1 TEST1 XTAl2 P27 REsEr P28 ORO !is Os P24 OBF EA P17 p,. AO P,s Another member of the UPI family is the Intel 8243 Input/ Output Expander chip. This chip provides the UPI-4IA and UPI-42 with up to 16 additional independently programmable I/O lines, and interfaces directly to the UPI-41 A/ 42. Up to seven 8243s can be cascaded to provide over 100 I/O lines. The UPI is a single chip microcomputer with a standard microprocessor interface. The UPI's architecture, illustrated in Figure 3, features on-chip program memory, ROM (804IA/8042) or EPROM (874IA/8742), data memory (RAM), CPU, timer/counter, and I/O. Special interface registers are provided which enable the UPI to function as a peripheral to an 8-bit central processor. 6Aci< P25 iiF Ali Until recently, the dedicated control processor approach was usually not cost effective due to the large number of components needed; CPU, RAM, ROM, I/O, and Timer/ Counters. To help make the approach more cost effective, in 1977 Intel introduced the UPI-4I·family of Universal Peripheral Interface controllers consisting of an 8041 (ROM) device and an 8741 (EPROM) device. These devices integrated the common microprocessor system functions into one 40 pin package. The UPI-42 family, consisting ofthe 8042 and 8742, further extends the UPl's cost effectiveness through more memory and higher speed. WA p,. SYNC P'3 Go P'2 D, PII D2 P,o D3 VDD D. MOO DS P23 Do P22 D, P2, Vss P2. Figure 1. UPI-42 Pin Configuration Many microcomputer systems need real time control of peripheral devices such as a printer, keyboard, complex motor control or process control. These medium speed but still time consuming tasks require a fair amount of system software overhead. This processing burden can be reduced by using a dedicated peripheral control processor Using one ofthe UPI devices, the designer simply cod'es his proprietary peripheral control algorithm into the UPI device itself, rather than into the main system software. The UPI device then performs the peripheral control task while the host processor simply issues commands and transfers data. With the proliferation of microcomputer systems, the use of UPIs or slave microprocessors to off load the main system microprocessor has become quite common. This Application Note describes how the UPI-42 can be used to control dot matrix printing and the printer mechanism, using stepper motors for carriage/print head assembly and paper feed motion. Previous Intel Application Notes AP-27, AP-54, and AP-91 describe using intelligent processors and peripherals to control single solenoid driven printer mechanisms with 80 'character line buffering and bidirectional printing. This Application Note expands on these previous themes and extend's the concept of complex device control by incorporating full 80 character line buffering, bidirectional printing, as well as drive and feedback control of two four phase stepper motors. The Application Note assumes that the reader is familiar with the 8042/8742 and 8243 Data Sheets, and UPI-4IA/42 Assembly Language. Although some background information is included, it also assumes a basic understanding of stepper motors and dot matrix printer mechanisms. A complete software listing is included in Appendix A. 6-942 230795-001 AP-161 I/O PORT 1 PlO~ P17 DATA , ~;~i{;, 1"~; MEMOAY Wi< Ril- "" PERIPIiERAL INTERFACE CONTROL LOGIC PORT 4·7 EXPANDER INTEAFACE lKX82KX8 PROM ROM PROGR ... '" MEMORY CRYSTAL, Le, OR CLOCK '>0 - - _ PROM PROGAAM SUPPLY POWER { Vee - - _ +S5UPPLY " , - - _ GROUND 8-BIT TIMER EVENT COUNTER Figure 2. UPI-42 Block Diagram DOT MATRIX PRINTING A dot matrix printer print head typically consists of seven to nine solenoids, each of which drives a stiff wire, or hammer, to impact the paper through an inked ribbon. Characters are formed by firing the solenoids to form a matrix of"dots" (impacts of the wires). Figure 4 shows how the character "E" is formed using a 5 x 7 matrix. The columns are labeled CI through C5, and the rows R I through R 7. The print head moves left-Ioright across the paper, so that at time Tl the head is over column Cl. The character is formed by activating the proper solenoids as the print head sweeps across the character position. Dot matrix printers are a cost effective way of providing good quality hard copy output for microcomputer systems. There is an ever increasing demand for the moderately priced printer to provide more functionality with improved cost and performance. Using stepper motors to control the paper feed and carriage/ print head assembly motion is one way of enabling the dot matrix printer to provide more capabilities, such as expanded or contracted characters, dot or line graphics, variable line and character spacing, and subscript or superscript printing. However, stepper motors require fairly complex contol algorithms. Previous solutions involved the use of a main CPU, UPI, RAM, ROM, and I/O onboard the peripheral. The CPU acted as supervisor and used parallel processing to achieve accurate stepper motor control via a UPI, character buffering via the I/O device, RAM, and ROM. The CPU performed realtime decoding of each character into adot matrix pattern. This Application Note demonstrates that the increased memory and performance of the UPI-42 facilitates integrating these control functions to reduce the cost and component count. THE PRINTER MECHANISM The printer mechanism used in this application is the Epson Model 3210. It consists of four basic subassemblies; the chassis or frame, the paper feed mechanism and stepper motor, the carriage motion mechanism and stepper motor, and the print head assembly. The paper feed mechanism is a tractor feed type. It accomodates up to 8.5 inch wide paper (not including tractor feed portion). There is no platen as such; the paper is moved through the paper guide by two sprocketed wheels mounted on a center sprocket shaft. The sprocket shaft is driven by a four phase stepper motor. The rotation of the stepper motor is transmitted to the sprocket shaft through a series of four reduction gears. 6-943 230795-001 AP-161 I CLOCK ! ! I 8-BITCPU 1024 x 8, 2048 x 8 PROGRAM MEMORY (ROM/EPROM) 64 x 8, 128 x 8 DATA MEMORY 8-BIT TIMERICOUNTER II II I U II I 8-BIT STATUS REGISTER 18 1/0 LINES I I 8-BIT DATA BUS INPUT REGISTER 8-BIT DATA BUS OUTPUT REGISTER I II II v SYSTEM INTERFACE PERIPHERAL INTERFACE AND 1/0 EXPANSION Figure 3. UPI-41A, 42 Functional Block Diagram Cl C2 C3 C4 C5 Rl R2 R3 DODD DODD R4 R5 R6 DODD DODD R7 Figure 4. Character E In 5 X 7 Dot Matrix Format The carriage motion mechanism consists of another four phase stepper motor which controls the left-toright or right-to-left print head assembly motion. The print speed is 80 CPS maximum. Both the speed of the stepper motor and the movement of the print head assembly are independently controllable in eitherdirection. The rotation of the stepper motor is converted to the linear motion of the print head assembly via a series of reduction gears and a toothed drive belt. The drive belt also controls a second set of red uction gears which advances the print ribbon as the print head assembly moves. Two optical sensors provide feedback information on the carriage assembly position and speed. The first of these optical sensors, called the 'HOME RESET' or HR, is mounted near the left-most physical positic'l to which the print head assembly can move. As the print head assembly approaches the left-most position, a flange on the print head assembly interferes with the light source and sensor, causing the output ofthe sensor to shift from a logic level one to zero. The right-most printer position is monitored in software rather than by another optical sensor. The right-most print position is a function of the number of characters printed and the distance required to print them. The second optical sensor, called the'PRINTTIMING SIGNAL' or PTS, provides feedback on carriage stepper motor velocity and relative position within a 6-944 230795-001 AP-161 STEPPER MOTOR ~ OPTICAL SENSOR PRINT HEAD ASSEMBLY TOOTHED DRIVE BELT REDUCTION GEARS Figure 5. Carriage Stepper Motor Assembly given step of the motor. The feedback is generated by the optical sensor as an "encoder disk" moves across it. Figure 5 illustrates the carriage stepper motor, optical sensor, encoder disk and reduction gears, and drive belt assembly. The optical sensor outputs a pulse train with the same period as the phase shift signal used to drive the stepper, but slightly out of phase with it when the motor is at a constant speed (see Software Functional Block: Phase Shift Data for additional details). The disk acts as a timing wheel, providing feedback to the UPI software of the carriage speed, position, and optimum position for energizing the print head solenoids. The two optical sensors are monitored under software and provide the critical feedback needed to control the print head assembly and paper feed motion accurately. The process of stepper motor drive and control via feedback signals is called "closed loop" stepper motor control, and is covered in more detail in the software discussion. contracted characters, as well as line or block gra phics (see Appendix B, Printer Enhancements). It also facilitates printing lower case ASCII characters with "lower case descenders." That is to say, certain lower case letters (e.g. y, p, etc.) will print below the bottom part of all upper case letters. DOT WIRE I The print head assembly consists of nine solenoids and nine wires or hammers. Figure 6 illustrates a print head assembly. The available dot matrix measures 9 x 9. This large matrix enables the Epson 3210 print mechanism to print a variety of character fonts, such as expanded or MAGNETIC POLE Figure 6. Print Head Solenoid Assembly 6-945 230795-001 AP-161 , ....._--0 STEPPER MOTOR CONTROL l' ·5V 'o---l P40-43 ON LINE/SELECT PRINT MECHANISM DRIVE CIRCUIT w ""ili c z ~ CONTROL: P50-53 (CURRENT LIMITING) a: w'" ... '" ....... :::>'" Ol ~ T.8 ~ HR OPTICAL SENSOR UPI-42 C PT3 OPTICAL SENSOR 0.. oj ..J ..J "ifa: f0- CI) o DATA STROBE T1 WR P27~_ _ _ _~P~R~IN~T~H~E~A~D~T~R~IG~G~E~R~________~-; P24 P25 P10-17 ~----------------------------------' J: PRINT HEAD SOLENOID DATA P26~----------------, Figure 7. Hardware Interface Block Diagram HARDWARE DESCRIPTION Figure 7 shows a block diagram of the UPI-42 and 8243 interface to the printer mechanism drive circuit. A complete schematic is shown in Figure 8. The UPI-42 provides all signals necessary to control character buffering and handshaking, paperfeed and carriage motion stepper motor timing, print head solenoid activation, and monitoring of external status switches. The, Epson 3210 printer mechanism manual recommends a specific interface circuit to provide proper drive levels to the stepper motors windings and print head solenoids. The hardware interface used for this Application Note followed those recomendations exactly (see Appendix C, Printer Mechanism Drive Circuit Schematics). I/O Ports The lower half of the U'PI-42 Port 2, pins 0-3, provides an interface to the 8243 110 expander. The PROG pin of the UPI-42 is used as a strobe to clock address and data information via the Port 2 interface. The extra 16 110 lines of the 8243 become PORTS 4, 5, 6, and 7 to the UPI software. Combined, the UPI-42 and 8243 provide a total of 28 independently programmable 1/0 line. These lines are, used as follows: 6-946 230795-001 AP-161 ." ...,.!'-'M>----- .,--------I'E(P!l.PEAENOh "b " TEST ,.. !'-'M>----- \ "M'~m \ M~"''''.• ONiOFI .~. s:T:~~~s· LINE \,:.,r I,· ~ EDGt CONNECTOR '''r'M>----,,,p.'M>----- ~$K _5. PA00I""'--_ _----' T,I""'--------->~+-Cw::"':r. .. :::t#1 19 08, 101-"-------.;H>7--« 114~~~.U DATA STROBE 10 WR H P" 3' P" Pn 31 HA AESET, IHA) '"r. ISII _ _ _ P'!"f PRINTHEAO 'CII(Y~::-I--4.-4> _ _ _ _ Il2CCL . LIMITER CII. S.M 07H ~- "egls,e, Bank 0: Slepper Motor Forward/Rererle Accelerallon/Drlve figure 19. Da.- Memory A"ocatlon Map Once the line is printed and the carriage stepper motor drive rQutine has been completed, a Linefeed is forced. The paper feed stepper motor drive subroutine tests the'· number of lines to move, and energizes the paper feed . stepper motor for the required distance. The lines per page default is 66; if 66 lines have been received, a Formfeed to Top-of-Next-Page is performed. The TopOf-Page is set at Power On/ Reset. When the EOF code is received, the EOF status flag is set. When the last line has been printed, the EOF check will force the print head assembly to the HOME position. The EOF flag is tested following each Paper Feed stepper motor drive. The next entry to the External Status Check subroutine begins a loop which waits for input from either the external status switches or the host system. Register Bank 0 is used for stepper motor drive functions. Register Bank I is used for character processing. Each register bank's register assignments is listed in Figure 20 and 22, respectively. Each register bank has one register allocated as a Status Register. Figure 21 and 23 detail the Status Register flag assignments. Note that bit 7 of each Status Byte is used as a print head assembly motion direction flag. This saves coding of the Select Register Bank (SEL RBn) instruction at each point the flag is checked. RegIster Bank 0 Register The software character dot matrix used in this application is 5 x 7 of the available 9 x 9 print head solenoid matrix. Although lower case descenders and block/ line graphics characters are not implemented, Appendix B, Printer Enhancements, discusses how and where these enhancements could be added. The software implements the full 95 ASCII printable characters set. 6-954 RO R1 R2 R3 R4 R5 R6 R7 Program Description Label TmpROO TStrRO GStR20 PhzR30 CntR40 TConRO LnCtRO OpnR70 RBO Temporary Register Store Time Register General Status Register Stepper Motor Step Register Count Register Time Constant Register Line Count Register Available, Scratch Figure 20. Register Bank 0 Register Assignment 230795-()()1 AP-161 Bit Definition illustrates the Program Memory allocation map by page, Accel/Decelerate Drive Ready::: l/NotRdy::.O 1 'Do Not Print/Do-Print 1 Form Feed/Q~ Line Feed Page Hex Address Description L..._ _ _ 1 FaiiSafeiO-oConstanl Time Window L-_ _ _ _ Accel/Deceleralion Initialization 1 Done/O:: Not Done . Stepper Motor at Speed and Pnnt Head Not Left of Home 1 Sync!O:.:Not Sync"d, Print Head Initiaiize and Fire Stepper Motor Direction L-to-R- 1, R-to-L-=Q Figure 21. Register Bank 0 Status Byte Flag Assignments Register Program Label Description RO R1 TmpR10 CAdrR1 RBO Temporary Register R2 ChStR1 R3 R4 COtCR1 COotR1 R5 CCntR1 R6 R7 StrCR1 OpnR71 Page 7 1792·2047 Character to Dot Pattern Lookup Table: Page 2: ASCII 50H·7EH Page 6 1536·1791 Character to Dot Pattern Lookup Table: Page 1: ASCII 20H·4FH (sp·M) Page 5 1280·1535 Miscellaneous Subroutines: InitAl/AIiOIt Clear Data Memory Home Print Head Assembly Character Print Test Initialize Carriage Stepper Motor Delay Stepper MOlor Deselect Page 4 1024·1279 Paper Feed Stepper Motor Drive Page 3 768·1023 Stepper Motor Step LookUp Table(lndexed) Character Processing and Translation Print Head Firing Page 2 51-767 Carriage Stepper Motor Acceleration Time Calculation and Storagp Stepper Motor Deceleration Character Data Memory Address Register Character Processing Status Byte Register Character Dot Count Register Character Dot Temporary Storage Register Character Count Temporary Register Store Character Register Available/Scratch Figure 22. Register Bank 1 Register Assignment Bit Definition CB Registers; 1=lnitialize 10=00 Not Initialize. Page 1 256·511 Carriage Stepper Motor Drive Page 0 0-255 Initialization ~ Jump-an-Reset Main Program Body External Status Switch Check Character Buffer Fill 1=CR/(LF)/0=Not CR/(LF) Character Buffer Full= 1/Not Full=O, 1=EOF/OoNat EOF (unused) "'"-_ _ _ _ _ Character Lookup Table Page: 1=Pg. 1, O=Pg. 2 Character Initialized. 1= Done/O=Not Done ' - - - - - - -_ _ Carnage Stepper Motor Direction: Figure 24. Program Memory Allocation Map L-ta-R-1, R-ta-LoO Software Functional Blocks Figure 23. Register Bank 1 Status Byte Flag Assignments Below is a decription and flow chart for each of the ten software blocks listed above, Program Memory Allocation (EPROM/ROM) 1. Power-On/Reset Initialization The UPI-42 has 2048 bytes of Program Memory divided into eight pages, each 256 bytes. Figure 24 The first operational part in Flow Chart No. I is the Power-On or Reset Initialization, Flowchart No, 2 illustrates the Initialization sequence in detail. 6-955 230795·001 inter ( Ap·161 START ) I I The Data Memory locations OOH through I FH are not cleared. These locations are Register Bank 0 (OOH07H), Program Stack (08H-17H), and Register Bank I (18H-I FH) (see Figure 19). Clearing the Program Registers-or Stack would cause the initialization subroutine to become lost. The registers are used from the beginning of the program. Care is taken to initialize the registers and stack accurately prior to each program subroutine as required. DISABLE INTERRUPTS J l Upon power-on, it is necessary to initialize the two stepper motors, verify their operation, and locate the print head assembly in the left-most 'HOME' position. This sequence serves as a system checkout. If a failure occurs, the motorS are deselected and tlie external status light is turned on. Each stepper motor is selected and energized for a sequence of four steps. This serves to align and stabilize each stepper motor's rotor position, preventing the rotor from skipping or binding when the first drive sequence begins. RESET PRINT HEAD TRIGGER TURN DF' ALL PRINT HEAD SOLENOIDS SET PRINT HEAD TRIGGER INACTIVE SET HOST S'/STEM HANDSHAKE ACTIVE CLEAR RBO/RB1 STATUS REGISTERS I CLEAR DATA MEMORY (2OH·7FH) I t I INITIALIZE CARRIAGE AND PAPER FEED STEPPER MOTORS. I ! / HOME PRINT HEAD ASSEMBLV (FLOWCHART '4) I I l 41ET DEFAULT REGISTERS AND FLAGS ! RETURN / At the end of each stepper motor's initialization, the last step data address. is stored in one of the Data Memory pseudo registers. The last step data address is recalled at the beginning of the next corresponding stepper motor drive sequence, and used as the basis of the next step sequence. This ensures that the stepper motor always receives the exact next step data, in sequence, to garantee smooth stepper motor motion. This also garantees the motor never skips or jerks, which would misalign the start, stop, and character dot column positions. A stepper motor not being driven has its last phase data output held constant to stabilize it. J I Following any stepper motor drive sequence of either motor, a delay of 30-60 ms occurs by switching the current to Hold Current, stabilizing the motor before it is deselected. Flow Chart No.2. Power-On/Reset Initialization Initialization first disables both interrupts. This is done as a precaution to prevent the system software from hanging-up should an interrupt occur before the proper registers and Data Memory values are initialized. 2. Home Print Head Assembly Initialization then deactivates the system electronics. This is also a precaution to protect the printer mechanism and includes the print head solenoid (trigger and data) lines and the stepper motor select lines. The host system handshake 'Signals are activated to inhibit data transfer from the host until the printer is ready to accept data: Next, Data Memory is cleared from 20H to 7FH. This includes; the 80 byte Character Buffer, the II byte Stored Time Constants buffer, and the 4 bytes used as pseudo registers. The pseudo registers are Data Memory locations used as if they were registers. They serve as storage loacations for step data used in accurately' reversing the direction of the carriage stepper motor, and stablizing either of the stepper motors not being driven. 6-956 At the end of the carriage stepper motor four step initialization, the output of the HR optical sensor is tested. The level of the HR signal indicates which drive sequence will be required to 'HOME' the print head assembly. If the print head-assembly is to the right of HR, HR is high, the print head assembly need only be moved to from Right-to-Left until HR is low, then decelerated to locate the physical home position. If HR is low, the print head assembly must be moved first Left-to-Right until HR is high, then RighHo-Left to locate both the logical and physical 'HOME' positions. In each case, the software accelerates the carriage stepper motor, generating the Stored Time Constants then decelerates the stepper motor using the Stored Time Constants (see Background section above). Flow Chart No.3 details the HOME print head assembly subroutine. Figures 13 and 18 illustrate the components of acceleration and print head assembly line motion.-230795-001 inter AP-161 HOME position, the software enters a loop which continually monitors the four external status switches, and exits if anyone is active. Flow Chart No.4 details the External Status Switch Check subroutine. Flow Chart No.4. External Status Switch Check If the LlNEFEED or FORM FEED switch is set, the Paper Feed subroutine is called. The Paper Feed subroutine is discussed in detail below. If the ONLINE switch is set, the Character Buffer (CB) Fill subroutine is called. Flow Chart No.3. HOME Print Head Assembly The carriage stepper motor drive subroutines used to HOME the print head assembly and to print, are the same. A status flag, called Do-Not-Print, determines whether the Character Processing subroutine is called. The flag is set by the subroutine which calls the Carriage Stepper Motor Drive subroutine. Details of the carriage and paper feed stepper motor drive and character processing subroutines are covered separately below. 3. External Status Switch Check Once the system is initialized and the print head is at the If the Character Print TEST switch is set, the Data Memory Character Buffer(CB) is automatically loaded with the ASCII code sequence, beginning at 20H (a Space character), the first ASCII printable character code. The software then proceeds as if the CB had been filled by characters received from the host system. The External Status Switch Check subroutine is exited and character printing begins. When the line has finished printing, a linefeed occurs (as shown in the main program Flow Chart No.1) and the program returns to the External Status Switch Check subroutine. If the TEST switch remains active, the ASCII character code is incremented and program continues as before. This will eventually print all 95 ASCII printable characters. An example of the TEST printer output, the complete ASCII character code printed, is shown in Figure 25. CHARACTER BUFFER FILL (fLOWCHART 1151 Flow Chart No.4. External Status Switch Check 230795-001 AP-161 4. Caracler Buffer Fill The Character Buffer (CB) Fill subroutine is called from three points within the main program; External Status Switch subroutine, and the Delay subroutine following the carriage and paper feed stepper motor drive subroutines. Flowchart No.5 details the Character Buffer Fill subroutine operation. cy , N~ I I ENABLE INTERRUPTS • < INPUT BUFFER FULL "- CHARACTER BUFFER INITIALIZATION DONE DECREMENT CHARACTER BUFfER SIZE END Of CHARACTER BUFFER , SET EXIT FLAGS , LOAD CB WITH 20H N < l t CHARACTER BUFFER PAD t N I ACKNOWLEDGE & READ CHARACTER < t ASCII PR~NTABLE CHARACTER <; I >Nt N I LOAD CHARACTER INTO CHARACTER BUFFER ~ CR OR IF LOAD CB WITH CR seT CB PAD FLAG ENABLE INTERRUPTS READ NEXT CHARACTER ASSUME IT'S IF & IGNORE < EOF N ~. SET EOF & CB FUll FLAGS CLEAR C8 PAD FLAG t RETURN < FORM FEED N >v--t seT FF & CB fULL FLAGS CLEAR CB PAD FLAG ~ RETURN LOAD CB WITH 20H J DECREMENT CB ADDRESS t CB FULL OR CB PAD "- /' RETURN I • N I I J J < I INITIALIZE CHARACTER BUFFER FILL ,/N " I RETURN N t' ENABLE INTERRUPTS I RETURN 1- The approximate 80 ms total pre-deselect delay at the end of each stepper motor drive sequence, 40 ms carriage and 40 ms paper feed stepper motor pre-deselect delay, is sufficient to load an entire 80 character line. Half the CB is filled at the end of printing the current line, and the second half is filled at the end of a paper feed. There is no time lost in printing throughput due to filling the character buffer. Character input is interrupt driven. When the IBF interrupt is enabled, a transmitted character sets the IBF interrupt and IBF Program Status flag. Three instructions make up the IBF interrupt service routine. This short routine disables further interrupts, sets the BUSY handshake line active, inhibiting further transmission by the host, and returns. The subroutine can be executed at virtually any point in the software flow without effectinll the printer mechanism operation. Processing of the received character takes place during one of the three program segments mentioned above. The BUSY line remains active until the character is processed by the CB Fill subroutine. The CB is 80 bytes frbm the top of Data Memory (30H-7FH). It is a FIFO for forward, left-to-right printing, and a LIFO for reverse, right-to-left, printing. Loading the CB always begins at the top, 7FH. One character may be loaded into the buffer each time the CB Fill subroutine is called. The CB is always filled with 80 bytes of data prior to printing. If the total number of characters input up to a Carriage Return (CR)/ Linefeed (LF), does not completely fill the CB, the CR code is loaded into the CB and the balance of the CB is padded with 20H (Space Character) until the CB is full. A Linefeed (LF) character [ollowing.a Carriage Return is ignored. A LF is always forced at the end ofa printed line. When the CB is full, the CB Full status byte flag is set and printing can begin. A LF character alone is treated as a CR/ LF at the end of a full 80 character line. This is a special case of a printed line and is handled during character processing for printing (see No.7, Processing Characters for Printing, below). A Formfeed (FF) character sets the FF status byte flag. The flag is tested at each paper feed stepper motor drive subroutine entry. When the software is available to load the CB with a character, entry to the CB Fill subroutine checks three status flags; CB Full, CB Pad, and IBF flag. If the CB Full flag is set, the program returns without entering the body of the CB Fill subroutine. The CB Pad flag will cause another Space character to be loaded. If the IBF flag is not set, the program returns. If the IBF flag is set, the character is read from the Data Bus Buffer register, tested for printable or non printable ASCII code, and, if printable, loaded into the CB. If the character is a non-printable ASCII code and not an acceptable ASCII control code (CR, LF, FF, EOF), a 20H (Space Character) is loaded into the CB. Exiting the CB Full subroutine with the CB Full or CB Flow Chari No.5. Character Buffer Fill 6-958 230795-001 AP-161 :: ,,' r I'*$.'~:?: . I,: )l+, - •. ,' ~312:3456~789 ,i <== >'7"t?14BC [JEFGH I ·JKL"'lt·KIPG.!RSTUI.)~'J~ '?I?~i8CDEFGH I .-'~:.:L"'lHClF'OF~STUI)L'J::<'l2[ .... ] ..... _ -3bcde:f''9h.i j k ll")n ! "#:t~,~~~: '':: )::t:+, .... '. ", ~_:112'~:4567:=:9: ,: = >?tI-'ABC:[.'EFCiH 1.-'~ ';: 'PAE:C['EFGH .-'kl_.t·lt·~OF·OR:~;TUI)l,J::::\'Z[ J .... __ ....3bcdE:f·:lh.i.,j k l"(lnol='~ r #$%&',' ):t.+,.-. Dl~3456'789:~',:=)1eA8C[)EFGHI,JkLMt~OPQRS1-UI,IWXY2[~,.]·"_"abcde~3hij~~lMno~~r j:~.~:!., '':: /t·+, -- •.' 0 1';'::"::4567:::9 ; = ':"'';;'f~HE:CDEFGH I ,... W:L_t'1HOF'OP~':;TUI)~,t'::'·.·'2[ "', J ..... _ ab,=def";;I~-1 i j k l"'tt"lOF'-=ir-s %&,,~ )*+,--.,,~01234567:~:9 :~:=)1'~A8C~EFGHIJ~~LM~~OPQRSTUl,JW~ :t:+" -. (1.1 :2::::45~?:::~74 .: .:,' = >";:'I!-'ABC[!EFGH I ·JVl_r·lHOF'c!P:~:TUI)l'J;:<·"'Z[ ].,.._. ?tbcde:f·3h i j k 1 L'·Ir-toF·-=lr-st. u , ( ).,'+. '--. ,"'C'Il 2:,::4::i6-;-"::::9 ; =.:: '?("~iE:C:['EFCiH I .J~::Lt'1t'KIP()F:'=:TUI)H>::\'Z[ ], .. _." =:tbcd€:f·:th.i.. ..:i k 1 f'·It"tC,j:::·-::j t-:::t IJ' ..I ( )l+ ... - _ ,,' (1 t:..: .::4 ':;67:'::'3 . = ,:' '/'I?":'IE:C ['EFGH I J~':Lt'ltKIPC!F::~,TUI.ll'J>::""·Z[ J ..' __ ,;:jbcdE:f··=,h.i j k 1 f··WICtF·,=it·st U',..'1.0.1 .":4:+., "". ,"'(11~: ::456 ;':::9 ,., = >'';;'I?~iE:C:DEFGH 1 ,..H:::l_r·1t·~C1F'c!P'::;TUI ...ll·J:":""':T ". J' __ .:1bf=dE.:f '='~'I i j k 11·'·It"lop·=i t-st.IY.H.J)-( ,:+., _. _ ~.) I ~::.::::4:i67::::~ .. ~ I~'HE:I.::["E~~:(~H 1 ..Jkl...t·1t·IOF·("F·:~; TUI)l,J>::'{Z[ ] .... :;b,=def·'3h.i j k l"·ln.:,i==,·=i t-st U',,II..,I:t<::I + . -. ,,~~~ 1.~: '::45r;'?:~:::~ ". ';'I?H8C[)EF~C:iH J ..It-::l.t·lt'~I~IF·c!R:::;TU1.ll·I::<· ..'2r: J .._ ,;j,bcd.::~ f"3h.i j k I "'It"lOP"=i t-:::t· U' .. ·'I.,.I)(~:: ~~ 1. ~:' ~:4~it:7:.::·..":j ~ ""~HF:t:C'EFGH I H'L!'ltl(IF'CIF""TUI'l,j;.. :',=C J '3bc,~ef9hi,jk10ltlO~'~rstUt,llJ~:::IZ( -- ~ /0 1. :~:' ~::,.~~r:::?:::'3 "'?Hr:C['F:FC;H I JfI.JItKIF'I:oF:'" T1J"l,r:'i=[ J' :;bcd.::~f :3h.i. j I:: ll''-It"i,:,,:: .. =i t·.st 1_". '•.,I:H· ~I::: -( : ~ ~31.~·'~:4':::;'~~ ?:~:':~ . 1"'~~IE:Cr!EFI..~H I ,I.: ,L t·lt·~OF'C'F'·~, TI .. II.rl·J~::\'Z[ J :otl--",,::d~-:: f ::If-. i. i k 1,'·wLoj:::..=i t·:-:t, IY,'1",I:H: ::'~z <: : J ~::11 :2 ,~:4, 5 t-: ;"::::~? ','I?;,[':; [:oEFGH 1 JI'l,I'ltl0F'I,:'P',-,HII,I\,j;:','=C J :;:I~:,,::.::!+:=:f 3h.i j k It"'II'"I()t,:·::j I·::;;t Iy.' .... }<: :"001= :~ : :~ (1.1 '::3"~ ~'~:~-"'::::::~ 'i·t!"H[:I' ["FFI:'H'[ J~, L l'lt'~I-:tF'i")F:::, TIJI)l'J;'=:·.-'::~[ "'" J :=.b..-::: ,:.--1,::: f '~h ,i. j I: l'-"It"tof: '=i t· .~t., 1_II.'I..,':H:::I7: :': : =:- .-., 12345t~~'?:::::? -::: ,': '?(!-'~~r-:i" {"!:=FGH I rL L,I··1t'~ClF'I}F"~:,TUII!'J;:":'''''Z[ J _ ::,jbc,.-j.~t' 3h i j ~: l ....lnc'j::' =it·:=t I_I'..!I.,):...::.-:I:: { : J- '-'.' ! ~?:=:,~ 56 ?::::::,~ ,,' 1";<[:" ['EFC;H 1 IfTt'lt IOr'l 'F'::,TU' '1,1:':',':,[ _ :=!bcdE. f ,Ih., j k l'''ln.:.;:: =.J t·~·1: 1.)'.'1".1:-':::1:: C ~ } '-'.' !" ~:4'5tS·;··,:::·;. ''-'';'>,E:CI -FFCH 1 ,If lJ,lt 1'''iPCq;':''TlJ',ll,r:','.?[ 'J' :~b.::,::i>:~f;:ll". J . .i k l'-'-ltv:I~,:·:.--i t'st U'.' •.,I:.';:.-:I::: {: j .'" I "*I 'l::~f:~::':.~:·.-:' :::: .. ;: 1.;;'~1E:Cr'FF'~r.:,H I J~:':Lr·1t-~I')F'I~!P'::·1 !..It ,ll,I:":'I";-;{ 1 ::IL·,c,.::I"O·f":::'.·I.i..:i k ll'-Ir'p:,;'-::' =I t'::::t 1..1',.'10.''''" ',~:: :: : =: ' I "=I'Ll =" '"liE"', [,EH;H I ,II Lt'It1Clf":'F:',.-nlll l,l::·,'::T ] . ~b,=,::h:::-t· 3h.i j k 1 ("Inoj:::·::j t-.:::t U',.'I.,I)( :-:17: { : } ,'" t "#:r·: ":"I',:,nE:I~ [!EFI,~H I rl,,'Lt'1t~nF't:IF"::, rrJI IH: :,-:"'::'[ J ::..bc,:::h:"::t· 3h.i. ) k ll'-lnc:I~':"'''i t-~-7:t 1...1'.,".',I:H: :017 <. : ::; I "#:t~·~:!: ",I?HF:C ['E:FC,H I If Lt'1tlC1F'C'F:'"TU''i,C:',',7[ J '1t:.cd,::: f 3h j. j 1:' 11'wl':'P :::; t·s.t U'.,II,',I·o' :'--1::::-: :: : :::.-" I "#~i:\::~ , ""HE:( ['I:'F(;11 [ II Lt·lt II)F":'F"', [,-,111,1:- :',':',[, J ~L.o::,:Jo:: f ==ih ~ j k 11'1t'1'::'f:':;:1 t·:=,-·1: 1),.-'10.1),: :""'= :::: ,,, t "#:t\~::· '. , I?HE~C['EFCH I II "J'lt'10F'C'F""TI.I' 1\·1: :','::[ :'..t::,,::dE'_f'~h;, j 1,:.i'-"Lt"iOj;:--:,-1t-Stl.J'!I".I:":'jZ{:::' ! "#l:~'~~':' '.: :1 =, "'I~;iE':C['E-F C;H r ..If I t·ltl0F""'FSnll,'I·C:',':T 1 ~bC".:I.~:f ?h,~ j L 1 f"lnoi'" '::'it· _=::1: U'., 'I.' I:H' '::1:0:: :: : ::: ... , I "#~l~~S:: ',.. :' t· = >'i·!?HE:C["EFCH 1 J~·:L!·lt'~OF'C1F'·-:::TUI.II·J::':""·:,:~[ J :::.I:,cdef ';:Ih j I: 11"'lt ... o;'-:: ::'1 f' .~t. 1,.I'.. ,'I',I·H: :.~::: -:: : ::: ':" ",,?,'IE:C['I'TCH I _WLt'lt ICIF'OF"" TU"l,J:-:"(:T ~!::·,.::dE f"~h.i. j k l .... lnc'~~ ::j t':;:::1: 1-" 'I".I'H: :01:7 -:: : J- ..., I "#$~~~':' ,,: )l+. = >"'!'AE:C['EH~H I ..,IfU,ItH:,IF'C'F:::,TU')1'1:,,:','2T :.:il:::·cd-=. f' 3h.i.. j k 1 1'' 1 t"I0 t"" =i t-.ST. '.-,'·.!I.,':":::-tz -:: : }... ! "#l:~'~~::''-: :....:-t.,.3b,-:::d+:=~f·:;Ih.i..j kll'-Ino~~,,::jt .. :~t U'·,'I'.I:·1: ':1:7 ( : ::- .. ,' ! ,,#=·t~~~~· 0:: :,,:t:+ -. ," I?AE":C'EFC;H I ,'f'Lt-ItK'f"I:'F':"TU"I·I:-:",':':C ·?t'?(iBC(!ETC.iH 1 J~', L..t'1t·Klr-'I,·IF"~; TI..rr.II·J;:'·;·'I''Z[ J :~b::d,:::f ~h.i. j k 1 f"II'"I(:,f''':'1 t-::::1; I..P,..'I,'.I:,,: :;~::: { : ~ J "#:t~,~:=,,'':: >:t:+., - • t:,".:iE:C['EF(;iH.l .JkL.Nt·KrF·CI~;':~; I UI.IH~<·/:::T] :':Ir.:,cd.::: t"'3h.i..j k 1 f'lno::.i:::"';:1 ~- ::·t, IYII".I:H: ::lZ -:: : .}.. .! "#:t~,~:=,: . ',: \t.-t·" ---. ""'0 HE:C(>FFCiH I ,_HO:LJ·H'~OPCtF"':;TUJ"q·J>::""'Z[ ].... :::~bo::dE:f ':,Ih.i. j k 1"·H"1!:'~":":-.J ~':st U'"'I,,.I:H·:.-:I:: { : =: .'" ! "#$~'~~:: '0:: ):t:1-., '-' •.····01 BCe,EF:CiH I ,... W'L.t·1t·~CtFCIF':~; I"LII.)I·.I::<'.... :::T '~1b,.:,::::Io:::f '3h.i. J ~.: 1 f"In.:,F,,"!",II·S1:, U'·.'I,',I:H: :~2'. -:: : ~j .".' ! "#~t~·~~~:: '< >:t:+ . '- ~ ,.... 012 CDEFI::=:iH I ..J~::Lt·lt·KIi=-·r}F~';::TI.Jt,II·I><·""Z[] ::Ibcd('.:t' 3h.i.. j k 1. .... It"tO~': '=i t·.;t·U'.. 'I...I:..: ::..~= -:: : j- .'" ! "#$~'~~:: '':: ):4::+.,'- ..... ~?ll:2:3 DE:FCiH I ... 1."', Lr'1t·~crF'OR:::;TUI..rt'J~':\'Z[ J.. ... ~bcd~=:f ·=:.h i. j \:: ll'It"tOf:' =1t-st '-".-".,.1:": :=':: :: : =: ,".' I "#~t~·~:~:, ''-: >:t+ ...- ..... 0 1234 EF:CH I ..rt-::L..t,1t·~ClF'C!F"::;TUI...rt,~::,:\·Z[ ". ] ,,_ ~bcdt!::f··9h.i...j k I L·"lnOf:,·=i t-:::t U',)I...I·H: ~z. { : =:- ,'., ! "#:;-~::.~~::'':: :.'l+,,·- ..""(112345 FC;H I .JkL_t'1HOF'c!P:::;TUI')l'J::<\'::~[ "". J' _._ 3bcdE~f' :;tl-l ,; j k 1 ..··lno;::··=lt":::t.I,J',) •..,.:O.( :='z <: : .'} ,'" I I'tt:t~,~~~: '':: ):*:+., - • . -- (1 .l.23456 GH I ..J~:::U-'H·lCIPC!F:~.:"rut')l'J::·::·r'~:[ ],'........ ,~bcdE:f"3h.i. j k 11""lnoj:~"=i t"st U'·.,'I,..I}( ~~= ! "#$~'~~:; '''-: >:t:+ .. --. ,.... ~) 1234567 HI ·J~ :;\·Z[ ],.,.,._.... ,:;b,=dE:.f'3h ... j k l .. ··.t"lc'j:::··::jt·~:;1:. U'·... I.,.I)( ::..~::: { : ::- ,",' ! "#:t~.~~: '':: ):t:·+" -- .···(112:34567:~:9 : ~ NEXT :;TEP DATA TO OUTPUT INITIALIZE TIME CONSTANT REGISTER SELECT CAflR1AGE STEPPER MOTOR LOAD TIIoIIER WITH PT MASK PAP£R FHO LAST STEP , CARRIAGE Next, the carriage and paper feed stepper motor step data is initialized. The last step data output to the paper feed stepper motor is loaded into the Last Phase pseudo register. This data is masked with each step data output to the carriage stepper motor. Masking the step data in this manner guarantees the paper feed motor signals do not change as the carriage stepper motor is being driven. Figure 26 illustrates the carriage stepper motor step sequence verses the actual step data output for clockwise rotation, Left-to-Right motion, and counterclockwise rotation, Right-to-Left print head assembly motion. An eight step sequence is depicted in the figure. Note that the sequence for Right-to-Left motion is the reverse of the sequence for Left-to-Right motion. Note also, that for the L-to-R sequence step 4 is the same as step 0, step 5 the same as step I, etc., through step 7 matching step 3. The four step sequence simply repeats itself until the motor is stopped via the Deceleration subroutine. Nur ST!:P DATA OUTPUT STEP OATA START TIMER CARRIAGE STEPPER MOTOR AT CONSTANT SI'EED L-to-R Motion Sequence Phase/Step Data (3210) R-to-L Motion Sequence (3210) BCD 0 1 2 3 1001 1010 0110 0101 7 6 5 4 0000 0001 0010 0011 4 5 6 7 1001 1010 0110 0101 3 2 1 0 01 00 01 01 01 1 0 0111 Figure 26. Carriage Stepper Motor Phase/Step Data When the carriage stepper motor is driven for a specific direction of print head assembly motion, the step sequence must be consistant for the motion to be smooth and accurate. The same holds true for the transition from one direction of motion to the other. Since the sequence for one direction is the opposite for the other direction, incrementing the sequence for L-to-R and decrementing for R-to-L provides the needed step data flow. For example, referring to Figure 26, if the print head assembly moved L-to-R and the last step output was#l, the first step for R-to-L motion would be #7. Thus, when the carriage stepper motor is initialized for a clockwise (L-to-R) or counterclockwise (R-to-L) rotation, the last step sequence number is incremented or decremented to obtain the proper next step. In this way, the smooth motion of the stepper motors is assured. Flow Chart No.6. Carriage Stepper Motor Drive/Line Printing The step data is referenced indirectly via the step sequence number. The step data is stored in a Program Memory look-up table whose addresses correspond to the step sequence numbers. For example, as shown in 6-960 230795-001 AP-161 Figure 26, at location 0 the step data" JOOI" is stored. This method is particularly well suited to the UPI-42 software. The UPI-42 features a number of instructions which perform an indirect move or data handling operation. One of these instructions, MOVP3 A,@A, unlIke the others, allows data to be moved from Page 3 of Program Memory to any other page of Program Memory. This instruction allows the step data to be centrally located on Page 3 of Program Memory and accessed by various subroutines. Entry to the Failsafe time loop sets the Failsafe/ Constant Time Window status flag. This flag is tested by the Acceleration Time Storage subroutine for branching to the proper time storage calculation to be perf?r~ (see Figure 13 and Block 6 below for further descnptIon). During the Failsafe timer loop, if PTS is detected and verified as true, the Failsafe timer value is read and stored in the Time Storage register. This value is used during the next Acceleration Time Storage subroutine call to calculate the Stored Time Constant (see Block 6 below). If PTS is invalid, the flow returns to the timer loop just exited, again waiting for PTS or Failsafe time out. Each time the carriage stepper motor step data is output, the step data lookup table address is incremented or decremented, depending upon the direction of rotation and tested for restart of the sequence. The address is te~ted because the actual step data, Figure 26, is not a linear sequence and thus is not an easily testable condition for restarting the sequence. The sequence number is tested for rollover of the sequence count from 03H to 04H and clockwise motor rotation via the Jump on Accumulator Bit instruction (JBn), with OOH loaded to restart the sequence. The same bit is tested when decrementing the sequence count for counterclockwise motor rotation, R-to-L motion, because the count roBs over from OOH to OFFH, with 03H loaded to restart the sequence. During the PT time loop, if PTS is detected and verified, the Sync flag is tested for entry to the print h~ad solenoid firing subroutine. This flag is set by the fmt entry to the Character Processing subroutine. The flag synchronizes the solenoid firing with charact~r ~roces.s ing. Only if characters are processed for pnntm~ :-VIII the solenoids be enabled, via the Snyc flag, for fmng. This prevents the solenoids from being fired without valid character dot data present. As described in the Background section "Relationship Between PTS and PT," PTS is the point of peek angular velocity within a step of the motor. After PTS. is detected the motor speed ramps down, compensatmg for the overshoot of the rotor motion. PTS is the optimum time for print head solenoid firing, as shown in Figure 13. This is the most stable point of ~otor rotation and, thus, the print head assembly motIon. If PTS is detected during PT, printing is enabled, the Sync flag is set, and the solenoid trigger is fired. At this point the UPI-42 Timer/ Counter is loaded, the step signal is output, and the timer started. The next step data to be output has been determined and the At-Speed flag is tested for entry to one of two subroutines; Stepper Motor Acceleration Time Storage or Character Processing. The firstentry to the Acceleration Time Storage subroutine initializes the subroutine and returns. All other entries to one of the two subroutines perform the necessary operations, detailed below (Blocks 6 and 7), and returns. The program loops until the PT times out or the PTS level change is detected. PTS is tied to TO of the UPI-42. The level present on TO is directly tested via conditional jump instrunctions. The software loops on poBing the timer Time Out Program Status flag and the TO input level. The firing of the solenoid trigger, following PT~, is .v~ry time critical. The time between PTS and solenOid fmng must be consistant for accurate dot column alignment throughout the printed line. The software is designed to meet this requirement by placing all character proces.sing and motor control overhead before t~e solen?ld firing subroutine is called. The actual .mst~uctlO.n sequence which fires the print head solenOid tngger IS plus or minus one instruction for any call to the subroutine. As described in the Background section above (shown in Figure 13), ifPT times out before PTS is detected, the software waits for PTS before outputing the next step signal. If PT times out before PTS, a second timer count value is loaded into the UPI-42 timer. The timer value is called "Failsafe."This is the maximum time the stepper motor can be selected, with no rotor motion, and not damage the motor. If PTS is not detected, either the carriage stepper motor is not rotating or the optical sensor is defective. In either case, program excution halts, the motor is deselected, and the external status light is turned on to indicate a malfunction. A system reset is required to recover from this condition. The Failsafe time is approximately 20 milliseconds, including PT. Once the timer loop is complete, the software tests for Exit conditions. If the Exit conditions fail, the software loops to output the next step signal, starts the PT timer, and continues to accelerate the carriage stepper motor, or process, and print characters. If the Exit test is t.rue, the carriage stepper motor is decelerated to a fixed position, and the program returns to the main program flow (see Flowchart I). The exit conditions are different for the two directions of print head assembly motion. For L-to-R printing, if a Carriage Return (CR) character code is read from CB, the carriage stepper motor drive terminates and the motor is decelerated to a fixed position. There are two conditions for terminating carriage stepper motor drive upon detecting a CR during L-to-R motion. If les~ than half a character line (40 characters) has been pnnted, The Failsafe time loop also serves as a means of tracking the elapsed time between PT time out and PTS. 6-961 230795-001 inter AP-161 the print head assembly returns to the HOME position to start the next printed line. Otherwise, the print head assembly continues to the right-most position for a full 80 character line, and then begins printing the next line from R-to-L. R-to-L printing always returns the print head assembly to the HOME position before the next line is printed L-to-R. When HR is high, character printing always stops and the carriage stepper motor drive subroutine exits to the deceleration subroutine. If the Failsafe! Constant flag is set, PTS lagged PT. The time from PT time out toPTS, Tx(see Figure 13), must be added to the PT and stored in Data Memory. As described above, if PT lagged PT, the Failsafe time is loaded and PTS is again polled during the time loop. When PTS occurs within the Failsafe time, the timer is stopped and the timer value stored. The UPI-42 timer is an up timer, which means that the value stored is the time remaining of the Failsafe time when PTS occured. The elapsed time must be calculated by subtracting the time remaining (the value stored) from the Failsafe time constant. This is done in software by using two's complement arithmetic. If the Failsafe flag is not set PTS led PT, and PT is the Stored Time Constant stored. 6. Accelerate Stepper Motor Time Storage As described above, when the carriage stepper motor is accelerated the step time required to guarantee the motor is at a constant rate of speed translates to a specific distance traveled by the print head assembly (see Figure 18). In order to position the print head assembly accurately for bi-directional printing, the distance traveled during deceleration must be the same as during acceleration. The Carriage Motor Acceleration Time Storage subroutine calculates the step times needed to accelerate the carriage stepper motor, and stores them in Data Memory for use as PT during deceleration. Indirect addressing of Data Memory is used to reference the Stored Time Constant Data Memory location. The Data Memory location address is decremented each time the AccelerationTime Storage subroutine is exited and a Stored Time Constant has been generated. The last Acceleration Time Storage subroutine exit sets the At-Speed status flag and initializes the character processing registers and flags. The first call of the Carriage Stepper Motor Acceleration Time Storage subroutine initializes the required registers and status flags. The time calculation begins with the second carriage stepper motor step signal output. The program returns to the carriage stepper.motor drive subroutine and loops on PT. Each subsequent call of the Acceleration Time Storage subroutine tests the Failsafe! Constant flag and branches accordingly (see Flow Chart 7). The Acceleration Time Storage subroutine has two parts which correspond to PTS leading or PTS lagging PT. 3. Process Characters for Printing The Character Processing subroutine is entered only if the Home Reset (HR) optical sensor signal is high and printing is enabled. Otherwise, the software simply returns to the Carriage Stepper Motor Drive subroutine. There are two cases when printing is not enabled; during the HOME subroutine operation, and when the print head assembly returns to the HOME position after printing less than half an 80 character line. If printing is enabled, the Sync status flag is set. y ry< TIME STORAGE INITIALIZATION DONE ;:> ~N I INITIALIZE TIME STORAGE REGISTERS I .1 .+ r;;< TIME STORAGE DONE r I INITIALIZE CHARACTER PROCESSING REGISTERS J t < FAILSAFE TIME WINDOW ENTERED I I P CALCULATE TIME TO STORE (PT -+- TX) RESET FAILSAFE FLAG 1 I + DECREMENT DATA MEMORY ADDRESS DECREMENT STEPS TO seTRE COUNT I • RETURN I ~ I STORE PT I I Flow Chart No.7. Carriage Stepper Motor Acceleration Time Storage J All character processing operations use the second UPI42 Data Memory Register Bank, RBI. Register Bank I is independent of Data Memory Register Bank 0, used for stepper motor control. The use of two independent register banks greatly simplfies the software flow, and helps to ensure the accuracy of event sequences that must be handled in parallel. Each register bank must be initialized only once for any entry to either the Carriage Stepper Motor Drive or Character Processing subroutines. A single UPI-42 Assembly Language instruction selects the appropriate register bank. Initializing the character processing registers includes loading the maximum character count (80), dot matrix size count (6), and CB start address. The CB start address is print direction dependant, as described in Block 4, above. Character processing reads a character from the CB, tests for control codes, translates the character to dots, and conditionally exits, returning to the Carriage Stepper Motor Drive subroutine. Flow Chart 8 details the character processing subroutine. 6-962 230795-001 AP-161 9 < ~ INITIALIZATION DONE .N l seT SYNC STATUS FLAG I + ry-<: acter dot column (blank column) had been entered. The next character, in this case the first character in the line, is translated and printing can begin. This method of intiializing the Character Processing subroutine utilizes the same software for both start-up and normal character flow. Once a character code has been translated to a dol matrix pattern starting address in the look-up table, all subsequent entries to the Character Processing subroutine simply advance the dot column data address and outputs the data. > SAME CHARACTER RE-ENTRY N~ The decision to translate the character to dots during the blank column time was an arbitary one. As was the choice of the blank column following rather than preceding the actual character dot matrix printing. READ CHARACTER FROM CB + ASCII PRINTABLE v< > N. < CR V • IN I I TRANSLATE CHARACTER TO DOTS (FLOWCHART 119) I COLUMN DATA r I 1 CB fULL, REGISTER INITIALIZATION, -N< I I L-TQ_R PRINTING r STATUS FLAG < RESET CHARACTER INITIALIZATION STATUS FLAG t RETURN I 80 CHARACTERS PRINTED N r I 1 RESET STATUS FLAGS CB FULL, SYNC, PRINT NOT READY I + I t Vt I Character-to-dot pattern translation involves converting the ASCII code into a look-up table address, where the first of the five bytes of charcter dot column data is stored. The address is then incremented for the next column of dot pattern data until the full character has been printed. > SET DO NOT PRINT CHARACTER DOT MATRIX COMPLETE N I SYNC, EOLN ~ • ~ 4.' Translate Character-to-Dots RESET STATUS FLAGS I ~ GET CHARACTER DOT LESS THAN HALF OF LINE PRINTED> N t REPLACE CHARACTER WITH 20H (SPACE) J I ADVANCE CB FOR DIRECTION OF PAINTING . I ,I ADVANCE CHARACTER DOT MATRIX ADDRESS FOR DIRECTION OF PRINTING GET CHARACTER DOT COLUMN DATA AND OUTPUT L RETURN Flow Chart No.8. Process Characters for Printing Each character requires six steps of the carriage stepper motor to print; five for the 5 character dot columns and I for the blank dot column between each character. Reading a character from the CB and character-to-dot pattern translation takes place during the last character dot column, or blank column, time. The first character line entry to the Character Processing subroutine appears to the software as if a last cha,r- The dot pattern look-up table occupies two pages, or approximately 512 bytes of Program Memory. A printable ASCII character is tested for its dot pattern location page and the offset address, from zero, on that page. Both the page test and page offset calculations use two's complement arithmetic, with a jump on carry or not carry causing the appropriate branching. Once the pattern page and address are determined the indirect addressing and data move instructions are used to read , and output the data to the print head solenoids. Flow'chart 9 details the Character-to-Dots Translation subroutine . In the case of R-to-L printing, although the translation operation is the same, the character is printed in reverse. This requires that the character dot pattern address be incremented by five, before printing begins, so that the first dot column data output is the last dot column data of the character. The dot pattern look-up table address is then decremented rather that incremented, as in L-to-R printing, for the balance of the character. Translation still takes place during the last character dot column, the blank column, and the blank column follows the character matrix. Only one control code, a Carriage Return (CR), is encountered by the character translation subroutine. Linefeed (LF) characters are stripped off by the CB Fill subroutine. If a CR code is detected the software tests for a mid-line exit condition; less than half the line printed exits the stepper motor drive subroutine and HOMEs the print head assembly before printing the next line. If the test fails, more than half the line has been printed, the CR is replaced by a 20H (Space character) and printing continues for the balance of the line; the space characters padding the CB are printed. 6-963 230795-001 inter AP-161 I INlnt,LIZE DECELERATION REGISTERS OUTPUT NEXT STEP SIGNAL LOAO" STAAT TIMER DECREMENT STORED TIME CONSTANT DATA MEMORY ADDRESS SETUP NEXT STEP STEP SEQUENCE DONE RESTART SEQUENCE I IN t <~---"-:~'M-'-OU-'--~~ I' ~ DECELERATION DONE "> 1' STORE lAST STEP AODRESS r I RETURN 1 Flow Chart No. 10. Decelerate Carriage Stepper Motor Flow Chart No.9. Translate Character-to-Dots As mentioned above, the character dots are printed and the print .head trigger is fired when the PTS signal is detected and verified and the carriage stepper motor is At Speed. When the character to print test fails the CB Buffer size count equals zero, the Carriage Stepper Motor Drive subroutine exit flags are set, and the flow passes to the Deceleration and Delay subroutines and programs returns to the main program flow. 9. Decelerate CarrIage Stepper Motor The transition from the Carriage Stepper Motor Drive subroutine to the Deceleration subroutine outputs the next step signal in sequence, and then initializes the Deceleration subroutine registers; Stored Time Constants Data Memory buffer end address and size. The Stored Time Constant Buffer is a LIFO for deceleration of the carriage stepper motor. The buffer size is used as the step count. When the step count decrements to zero, the step signal output is terminated, and the last step sequence number is stored in the carriage stepper motor Next Step pseudo register. The last step sequence number is recalled, during initialization of the next carriage stepper motor drive, as the basis of the next step data signal to be output. See Flow Chart 10. When the carriage stepper motor is decelerated, Failsafe protection and PTS monitoring are not necessary. The Deceleration subroutine acts as its OWIl failsafe mechanism. Should the stepper motor hang-up, the subroutine would exit and deselect the motor in sufficient time to protect the motor from burnout. Since neither Failsafe nor print head solenoid firing take place during deceleration, PTS is not needed. PT is replaced by the Stored Time Constant values in Data Memory. The Deceleration subroutine determines the next step signal to output, loads the Timer with the Stored Time Constant, starts the UPI-42 Timer, and loops until time out. The subroutine loops to output the next step until all of the Stored Time Constants have been used. The program returns to the Carriage Stepper Motor Drive subroutine and the motor is deselected following the Delay subroutine execution. The Delay subroutine is called to stablize the stepper motor before it is deselected. During the DELAY subroutine, the IBF interrupt is enabled and characters are processed. A paper feed is forced following the carriage stepper motor being deselected. 10. Paper Feed Stepper Motor Drive The paper feed stepper motor subroutine outputs a predefined number of step signals to advance the paper, in one line increments, for the required number of lines. The number of step signals per line increment is a function of the defined number of lines per inch, given the distance the paper moves in one step. Figure 16 lists three step (or pulse) count and line spacing configura- 6-964 230795-001 inter AP-161 tions, as well as the distance the paper moves in one step. Standard 6 lines per inch spacing has been implemented in this Application Note (Appendix B details how variable line spacing could be implemented). Flowchart II illustrates the Paper Feed subroutine. If the Formfeed flag has been set in the Character Buffer Fill subroutine, the software calculates the number of lines needed for a top of next page paper feed. The resulting line count is loaded in the Line Count Register. The Paper Feed subroutine loops on the line count until done and then returns to the main program body. Once the Paper Feed subroutine is complete, the software loops to test the End of File (EOF) Flag (see Flow Chart I). If EOF is set, the print head assembly is moved to the HOME position, the program again enters the External Status Switch Test subroutine, and begins polling the external status switches. If EOF is not set, the program directly calls the External Status Switch Check subroutine, and the program repeats for the next line. CONCLUSION Although the full speed, 12 MHz, of the UPI-42 was used, the actual speed required is approximately 8-9 MHz. 1400 bytes of the available 2K bytes of Program Memory were used; 500 bytes for the 95 character ASCII code dot pattern look-up table, 900 bytes for operational software. This means that the UPI-42 has excess processing power and memory space for implementing the additional functions such as those listed below and discussed in Appendix B. Special Characters or Symbols Lower Case Descenders Inline Control Codes Different Character Formats Variable Line Spacing Flow Chart No. 11. Paper Feed Stepper Motor Drive The number of lines the paper is to be moved is called the "Line Count." The Line Count defaults to one unless the Formfeed flag is set, or the total number of lines previously moved equals a full page. The default total lines per page for this application is 66. When the total number of lines moved equals 66, the paper is moved to the top of the next page. The Top-of-Page is set at power-on or reset. The software developed for this Application Note was not fully optimized and could be further packed by combining functions. This would require creating another status register, which could also serve to implement some of the features listed above. Since the full 16 byte stack is not used for subroutine nesting, there are 6-8 bytes of Program Stack Data Memory that could be used for this purpose. In several places, extra code was added for clarity of the Application Note. For example, each status byte flag is set with a separate instruction, using a equate label, rather than setting several flags simultaneously at the same point in the code. This Application Note has demonstrated that the UPI42 is easily capable of independently controlling a complex peripheral device requiring real time event monitoring. The moderate size of the program required to implement this application attests to the effectiveness of the UPI-42 for peripheral control. 6-965 230795-001 AP-161 APPENDIX A. SOFTWARE LISTING 1 SMOD42 TITLE('UPI 42 APP NOTE'li 2 .MACROFILE NOSYMBOLS NOGEN DEBUG 3 = = = = 4 'INCLUDE(:Fl:ANECD.OV1) 5 PG 6 7 * **** ** *** ** ** ** **** * ***** *** ** ******* Complex Peripheral Control With the UPI-42 8 9 Intel Corporation 10 11 = 12 3065 Bowers Avenue Santa Clara, Ca. 95051 = 15 Written By 13 14 16 17 18 19 Christopher Scott * * * * * * * * * * * * * * * * * * *"* * * * * * * * = 20 21 *' * ** ******* Notes and Comments 22 23 24 23 26 27 , 28 29 , 30 31 32 Th~'e Note comp~i.e Assembly Language files codeJ the full Application sau~c. 1. ANECD. OVl App Note E Tc 0,. t < Tc StO,.Ct: JB3 FailST ,test t < Tc Mov Mov Jmp = '0,. 'ailsafe time switch store Time Constant in use .. iGet time constant currently in use iMemorize/Store the time - indirect addr A.TConRO @TSt,.RO.A ADPRet J Tc = store Time Constant + FailSafe Time Elapsed rsee Accel/Cnst Speed/Decel WaveFormJ equation is: Trd - FailSafe Time = Tx => Trd + CplCFailSafe Time) = T, Tx + Tcnst = T Store/Memorize T t , , FaiIST: Mov Add Add A.@TSt,.RO A.IIFTCp 1 Mov ANL A.GStR20 A,IIClrFSC get the stored time 2'5 cpl add Add: Time stored + Time constant currently in use Mov @TStrRO,A Memorize/Store the time Reset the Status bit for Store time test A,TConRO get tho status byte reset Failsafe/constant time flag assumes entry via constant time 6-977 230795-001 AP-161 0234 AA 0235 C9 0236 83 933 Mov 934 ADPRet: Dec 935 ADExit: Ret 936 PG 938 * * * * * * * * * * * * * * * * * * * * * * *' * * * * * * * * * 940 B925 BCOA FB E3 023D 023F 0240 0241 0242 0243 0244 B820 40 3C Fl 62 55 19 0245 FA 0246 F252 Carriage 5tepper Motor Deceleration j CB FB 524E 445A BB03 445A 0252 0253 0254 0256 0258 lB FB 5258 445A BBOO 961 962 963 964 965 966 967 968 025C 025E 025F 0261 0263 0264 B820 40 1663 445F 3C EC41 0266 0268 0269 026A 026C 026E B821 FB AO 8478 B490 83 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 DRZ~oP: 110v TSt~RO. tlSMBEnd ,Load the Stp~ Mt~ Buffe~ End Add~ Mov CntR40,#DSBfSz iLoad the Buffer Size MOV A,PhzR30 iget phase index address MovP3 A,@A iget phase from indexed address patch together the CR last and LF next phase bits Mov TmpROQ,#LastPh iload Last Phz psuedo reg to Temp Reg ORL A,@TmpROO ipatch together CR existing & new LF MOVD ,OUTPUT BITS MOV P4.A Ai@TStrRO MOV T,A STRT T Inc TStrRO test for forward Mov A.GStR20 JB7 DclF2 iget time from indexed data memory j load timer ,START TIMER istep the Memorized time addr index reg reverse phase start indirect index to load 'sto~e stat byte Set up fOT"'next phase bit output before entering timing loops Dec PhzR30 idecrement the phase addT" MOV A.PhzR30 ;Get the phz data addr JB2 DRZ~oP ,CHK FOR COUNT BIT ROLLOVER JMP DNxtPh PhzR30.tlRStCRP ,ZERO CR SM PHASE REGISTER 110V Jmp DclR2 fOT'ward: Set up for next phase bit output before entering timing loops Inc PhzR30 j increment the phase addr MOV A.PhzR30 iGet the phz data addr ,CHKFOR COUNT BIT ROLLOVER JB2 DZroPh DNx tPh iskip adr index reset JMP DZ~oPh : MOV PhzR30.tlFStCRP ,ZERO CR SM PHASE REGISTER DNx tPh: i5et up for next phase shift Dc lR2: A,PhzR30 ;get phase index address MOV MovP3 A,@A iget phase from indexed address patch together the CR last and LF next phase bits Mov TmpROO, #LastPh i load Last Phz psuedo reg to Temp Reg A,@TmpROO ipatch together CR existing & new LF ORL TLoopD: JTF NxtPD2 ,JMP ON TIME OUT TO NEXT PH JMP TLoopD ,LOOP UNTIL TIME OUT NxtPD2: MOVD P4.A ,OUTPUT BITS CntR40.St~tTD ,Exit Test DJNZ Dc lF2: Set·Storeage of next phase data in psuedo addT'o This insures next phase is sequence correct for stpr mtr drive direction Mov TmpROO,#CPSAdr iget Phz Storeage Addr psuedo reg MOV A,PhzR30 iget Phz data Mav @TmpROO,A ;store CR Next phase index 'addr' DlyLng DMExit: Call Call DeS1SM RET SetRN: 996 PG 997 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 998 0300 SetUp the Deceleration registers reverse: 969 ; 025A FB 025B E3 * * * * * * * * * * * * * * * * * * * * * * * * * * *~* * * * * 941 942 Dec 15M: 943 944 945 946 947 948 949 950 951 952 St~tTD: 953 954 955 956 957 958 959 960 0248 0249 024A 024C 024E 0250 TSt~RO 937 939 0237 0239 023B 023C istore the status byte istep the AID time data store addr GStR20.A 999 1000 1001 1002 1003 1004 1005 1006 1007 , 1008 1009 , 1010 1011 5tepper Motor Phase 5hift Definitions All program procedures call this data. * * * * * * * * * * * * * * ** * * * * * * * * * * * * * * * * * * * * * ORG 300H DEFINE PHASE ADDRESSES: THE PHA5E'DATA IS ENCODED TO THE ADDRE5S CALLED DURING THE 5TPR,MTR ENERGIZE SEQUENCE CORRESPONDING TO THE NEXT PHASE OF THE,SEQUENCE REQUIRED. CARRAGE MOTOR ENCODING: FORWARD REVERSE 6-978 LEFT-to-RIGHT RIGHT-to-LEFT 230795-001 AP-161 0300 01 0301 03 0302 02 0303 00 0308 0308 0309 030A 0305 04 OC 08 00 Reverse direction ENCODING is reverse direction 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 DB DB DB DB 030F 4400 2668 326A 0215 FA 4340 AA 05 FA D23A FI 03F3 C626 6437 FA F22B 0329 6432 ORG 308H DB DB DB DB LFMFPl LFMFP2 LFMFP3 LFMFP4 1034 PG 1035 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Accel/Decel I Character Handling Test 1037 * * * 1038 1039 1040 1041 1042 1043 ADPTst: 1044 1045 1046 1047 1048 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 031F 0320 0322 0324 0326 0327 CRMFPl CRMFP2 CRMFP3 CRMFP4 LF MOTOR PHASE ENCODE & DECODE: FORWARD (CLOCKWISE) Forward direction ENCODING: *TEST * * >* * Is* *CR *Stpr * * *Mtr* *At *Speed * * *??* * * * * * * * * * * * * * * * * * Yes - SetUp do Character Processing No - Calculate / Store the Acceleration Phase Shift Time (11) Mov JB5 A,GStR20 PHFSet Jmp ADMmTS iget the status byte ,test if Stpr Mtr At Speed Jmp to Prnt Head Fire Setup ielse Call Accel/Decel Memory Time StoTe ** * * * * * * * * * * * * * * * ** * * * * * ** * * * * * ** ** * * * 1049 0311 0313 0315 0317 0318 031A 0318 031C 0310 same bytes accessed in * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 1036 030C FA 0300 5211 t~e Process Characters for Printing * * * * * ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Character dot matrix - normal char d Dot Column b = Blank Column b d d (Char 000 000 0 0 I 0 0 I 0 1 0 0 I 0 , , PHFSet: JNTO JEI JE6 Mov ORL Mov SinkSt: SEL Mov JE6 d d d Matrix) 0 b 1 d 0 d I d 0 d I d Ret,..n NPRet SinkSt A,GStR20 A,#SnkSet GStR20,A RBI A,ChStRI PageCk if R=O not read~ to print-exit if -Do Not Print stat bit set - EXIT if bit previously set-skip setting it ;get the status 'byte ;set Prnt Ready Sink bit isave the status byte i J j ;get char status register addl' ; test Char Init Done, 1 = Print Dot o ;. Get Char PG 1078 1079 Call for Individual charactel' pl'ocessing: mid line test if CR/(LF) 1080 1081 GetChr: 1082 test for CR/(LF) if it is the test position in the line 1083 CRChCk: Mov A.@CAdrRI iget ChaT'Bctel' 1084 A,IICRCpl ADD ,test for Carriage Retul'n JZ 1085 CrLnCk ' i f CR go service it Jmp 1086 AsciCI 'if not CR Insert Space Char 1087 CRLnCk: Mov A.ChStRI iget char status l'egister addr 1088 JE7 HHLn j test Chr Stat Byte Returned 1089 if bit 7 1 then Print L-to-R 1090 Jmp SpFill j if R-to-L print skip exit upon CR detect 1091 ---~----------~------------~------------------------------------------- = 6-979 230795-001 inter 0328 FD 032C 0309 032E F632 0330 648A 0332 97 0333 2320 0335 6438 0337 FI 0338 7498 033A 033B 0330 033F 0341 FA 8241 F4EB 6443 D4FO AP-161 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1'104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 HlfLn: SpFill: LnPad: I , 0343 .EB61 0345 0346 0348 0349 0348 0340 034F FA 53BF AA ED 58 53FD 53FE AA 0350 0351 0352 0354 0355 0356 C5 FA 53FE AA 05 6468 0358 FA 0359 F25E 035B 035C 035E 035F 19 6468 C9 6468 0361 FA 0362 F267 0364 CC 0365 6468 0367 IC j Mov Call A, @CAdrRl GCharl insert a space char ; get character ., call the char lookup/trns table fetch th e char dot column data lpage test for balance of char iget the status byte A.ChStRI JB5 FxJmpl ifix Jmp over page boundries Call ChrPg2 IAseii char 50 - 7F Hex Jmp MtxTst i Jump to Matrix Test Call ChrPgI iAscii cha~ 20 - 4F Hex Moy FxJmpl: fall th~u to p~int matrix and en count tests PG test the Char dot column print matrix count and Char buffer count MtxTst: itest for dot calor blank i.tatus byte in A upon entry here iget the status byte iset Cha~ lnit NotDane stat Flag ;store the status byte idec char cnt-Jmp if Not Last Char J if 0 reset stat bit Not CB Full Line ; reset CB Reg Init Flag - do Init iSBve the status byte DJNZ CDtCRI.PrntDt Moy ANL Moy DJNZ ANL ANL Moy A.ChStRl A.IIClntND ChStRl. A CCntRl,NotLCh A.#NCBFln A.#ClICBR ChStRI.A SEL Moy ANL Moy SEL Jmp RBO A.GStR20 A,IINotRdy GStR20.A RBI iget Gen Status register addr ;clesr the ready bit ;store the General Status ~yte Ret~n , EXit Test for L-to-R (forward) or R-to-L (reve~se) p~inting (see GCha~l ASCII char code translation procedure) J -------------------------------------------------------------------------- NotLCh: Mov JB7 StpCh I: Inc Jmp StpCh2: Dec Jmp , ,A contains LR/RL bit properly set iget char status register. addr 'test Chr stat Byte Returned if bit 7 = 1 then Print L-to-R J Increment char data memory ad dr. A,ChStRl StpCh2 CAdrRl Retrn CAdrRl Retrn ;Oecrement char data-memory addr, fall thru to Get Char Re-Entry Exit point for same char: (before returning step the matrix) -------------------------------------------------------------------------Test for L-to-R (forward) Dr R-to-L (reverse) printing (see GCharl ASCII char code translation procedure) PrntDt: PrnDi r: Moy 1160 J87 1161 1162 StpCDI: Dec 1163 Jmp 1164 1165 StpCD2: INC 1166 1167 1168 1169 Jclear carry flag A,ttSpace Chlsrt ---------------------------------------------------------------- PageCk: 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 C Clr Moy Jmp I char inserted Jmp over get char _____________________________________________ M _ _ _ _ _ _ _ _ - - - - - - - - - - - - - - - - Asc iel: ChIsrt: j if L-to-R printing exit the line if less than 1/2 line p~inted Mev AfCCntRl i load char cnt reg w/chal' bu~r size ADD A.#HlfCpl iadd the 2'5 cpI of 1/2 thr buf size , if CB)1/2 full set CR/LF stat bit for pad JC LnPad , If CB<1/2 set buffer full stat bit Jmp MdLnEx J mid-line exit iget char status byte itest ChI' Stat Byte Returned , if bit 7 = 1 then Print L-to-R ireverse step char dot col index addr if R-to-L print iskip over L-to-R print addr inc I forward step char dot col index addr if L-to-R print , EXIT A.ChStRl StpCD2 CDotRl Retrn CDotRI PG 6-980 230795-001 AP-161 0368 C5 0369 83 036A D5 036B FA 036C F27C 036E 036F 0370 0372 C5 FA 53BF 83 0373 D27C 0375 0377 0378 037A 037C 037E 037F 0381 0382 0383 0384 0386 0387 0388 0389 038A 038B 038D 038F 0390 0391 0392 0394 0396 0397 4340 AA B807 6488 E888 FA 53BF AA C5 FA 53FE AA 83 C5 83 FA 53FD 53FE AA C5 FA 4302 53BF AA 83 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 0398 AE 0399 039B 039D 039F 03AO 03EO F69F 64C9 97 FE 03AI 0380 03A3 F6AE 03A5 03A6 03A8 03A9 03AA 03AC FA 4320 AA FE 03EO 64B8 I -------------------------------------------------------------------Character PT'int SetUp Ex i t Procedures -------------------------------------------------------------------Clean Standard Exit -------------------------------------------------------------------Retrn: NPRet: SEL Ret RBO i Do Not Print ex i t: RBI SEL A,ChStRI Mov SkpNPI JB7 EXIT - return wi Reg Bank 0 Reset set Stpr Mtr drive routine count loop ; get th e status byte ; test print direction Revel'"se SEL RBO , get the status byte A,GStR20 Mov ; reset the print ready bit- skips PHFire call A,IIClrSnk ANL Ret Forward ; test for first PHFSet entry reg init SkpNPI JB6 Initialize register variables upon first entl'Y end of count clears char to print bit in status byte ; set Char Reg Init Done stat bit A,IIChIntD ORL ChStRI,A ; save the status byte Mov , load CR stpr mtr count during NoPrnt TmpR10,1I07H Mov Jmp NPExit TmpRIO, NPExit SkpNPI: DJNZ , get th e status byte A,ChStRl Mov A,IICIntND ; reset - char init not done ANL ; save the status byte Mov ChStRI,A RBO SEL A,GStR20 ; get Gen status register addr Mov A,tlNotRdy ;clear th e ready bit ANL GStR20,A ; store the General Status Byte Mov NSetEx: Ret NPExit: SEL RBO Ret Mid-Line Exit -------------------------------------------------------------------MdLnEx: EXIT Mov ANL ANL Mov SEL Mov ORL ANL Mov Ret if CR and not :> 1/2 line done during L-to-R print i get the status byte A, ChStR I ; if 0 reset stat bit Not CB Full Line A,IINCBFln A,IIClICBR i reset CB Reg Init Flag - do ·Init j save ChStRI, A the status byte RBO A,GStR20 i get the RBO status byte A,ttDoNotP ; set the Do Not Print FlagCfor RAccel) A,tlClrSnk ; reset the print ready bit-exit FAccel GStR20,A j save th e status byte PG 1222 1223 Character Dot Generator Math 1224 Look-up Table Page Vectoring 1225 Print Head Firing 1226 1227 StrCRI, A 1228 GCHARI: MOV i STORE THE CHAR 1229 1230 screen for printable char [char +(cpl 20 Hex + I = EO Hex)] 1231 A,1I0EOH ADD 1232 PrntCh JC CntlCh j Jmp to control char lookup table 1233 Jmp C ;clear carry flag 1234 PrntCh: Clr 1235 A,StrCRl Mov iget the char again 1236 1237 screen for char page (char +(cpl 50 Hex + 1 = BO Hex») '1238 if carry char on page 2 else page 1 1239 ADD A,1I080H 1240 JC Page2 1241 1242 Page Character -- ASCII 20 Hex thru 4F Hex 1243 CorT'ect offset foT' lookup table page 1244 {(char + EO Hex)*5 = Page 1 index addr} 1245 A,ChStRI 1246 Pagel: Mov get the status byte 1247 A,IIChOnPI set the page rentry flag bit OrL 1248 ChStRI, A store the status byte Mov 1249 Mov A,StrCRI get the char agian 1250 A,IIOEOH ADD set page 1 relative 00 offset 1251 Jmp Multi5 Jump to address math function 1252 6-981 230795-001 "n+_I® -111'e' 03AE 03AF 03BO 03B2 03B3 0384 0386 97 FA 53DF AA FE 0380 64B8 03B8 0389 038A 03B8 03BC AE E7 E7 6E AC 03BD FA 038E F2C4 03CO FC 03Cl 0304 03C3 AC 03C4 03C5 03C7 03C8 FA 4340 AA 83 03C9 83 AP-161 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 Page2: 03CE 03DO 03D2 03D4 03D5 03D7 03D8 03D9 8B06 64D8 2340 3A 23CO 3A C5 83 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1314 BC04 B822 2308 AO 0407 BEOI 0409 841B Jclear carry flag A,ChStRI A,IIChOnP2 ChStRl, A A,StrCRI A,1I0BOH Multi5 ;get the status byte ,set the page rentry flag bit ;store the status byte iget the char sgian ,set page 2 relative 00 offset 'fall thru to address math function c:hal"acteT' _page StrCR1, A Dffs~t dot pattern index address lstore the zero offset char ,MULTIPLY CHR 8Y 5 TO FIND THE ADDRESS ,ADD 1 TO COMPLETE 5X ,SAVE THE ADDRESS A A A,StrCRI CDotRl, A , Mov .iB7 A,ChStRI LRPrn MOV ADD A,CDotRI A,IIRLPShf MOV CDatRl, A j get char status byte ,test Chr Stat Byte Returned H bit 7 1 then Print L-toR iget the char index addr ,add char offset - start at end ,of chaT', print it R-to-L ,SAVE THE ADDRESS = Set the status byte far ChaT'acter SetUp done A, ChStRlMov A,IIChIntD ORL ChStRl, A Mav Ret 1290 I test for non printable 1291 CntlCh: Ret 1292 1313 0400 0402 0404 0406 C Test for L-to-R (forward) or R-to-L (reverse) printing (see GCharl ASCII char -code translation procedul'e) , LRPrn: 'get the status byte i5et 1st char col test bit = 0 istore the status byte ireturn w/status byte in A cha~acte~s goes here * * * Print * * * *Head * *Fire * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Entry point for print head solenoid firing - test 'faT status byte faT dot/blank column position PHFire: SEL RBI Mav A,CDtCRI ;set the chr dot column cnt i if chaT cnt not 0 - Fire Head Sol . .iNZ Fire i if Chr Dot Cnt 0, reset the CDtCRl,IINDtCCt SetCnt: Mov char dot column count .imp Retrnl ;skip PH Fire A,IIPTrgLa ,get the Prnt Head Trigger byte Fire: MOV P2,A OUTL ,FIRE PRINT HEAD MOV A,!lPTrgHi 'get the Prnt Head Trigger byte P2,A OUTL .FIRE PRINT HEAD Retrnl: SEL RBO ,EXIT - return wI Reg Bank 0 Reset Ret 1312 0400 Clr Mov AnL Mov Mov ADD .imp Compute MULTI 5: r10v RL RL ADD MOV 1293 ; 1294 03CA D5 03CB FB 03CC 96D2 Page 2 Character -- ASCII 20 Hex thru 4F Hex Correct offset for lookup table page two's complement of ASCII chr code LookUp Table page base char of 50H plus char * 5 {(char + BO Hex)*5 = Page 2 index addr) , J PG * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * PaperFeed Stpr Mtr Drive 1315 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 1316ORG 400H 1317 1318 Init psuedo registeT with' LF inderect add,. staTt - subseq,uent 1319 exchanges of the psueda Tegister will yield correct value 1320 CntR40,IIILFCNT ,INIT PHASE COUNT REG 1321 InitLF: MOV Mav TmpROO,IILPSAdr 'get Phz Inderect Addr psueda reg 1322 MOV A,#StLFF 'get LF starting addr 1323 Mav @TmpROO,A ;stoTe LF phase index addr start 1324 in psuedo register 1325 Mav LnCtRO,#LineCt iset line count reg faT 1 In 1326 I enables exit following LF SM init 1327 ~mp LfDrv1 ; Jump over line/form feed amd variable 1328 line spaCing tests & setups 1329 1330 LineFeed / Fo~mFeed Drive 1331 6-982 * 230795-001 AP-161 0408 BCIB 0400 040E 0410 0412 0414 0415 0416 0418 FA 5214 BEOI 8418 FE 37 0301 0342 041A AE 041B 0410 041E 041F 0421 B821 FO E3 B820 AO 0422 0424 0425 0426 8822 FO AB 8098 0428 2306 042A 3D 042B FB 042C E3 0420 8820 042F 40 0430 3C 0431 FO 0432 62 0433 55 0434 0435 0436 0438 043A IB FB 523A 843C BB08 043C F8 0430 E3 043E B820 0440 40 0441 1645 0443 8441 0445 3C 0446 EC31 0448 BCIB 044A EE31 044C FA 0440 53FB 044F AA 0450 8822 1332 1333 1334 load step count constant for standard line spacing 1335 1336 test for various line/inch spacing would go here 1337 (and removal of constant setup below) 1338 MOV CntR40, #LPI8pB j init cnt reg for standard line feed 1339 1340 LineFeed/FormFeed Test A, GStR20 ;"get the status byte 1341 LfOriv: t10v 1342 JB2 FmFd ; if linefeed Jmp to cnt load 1343 LnCtLd: Mov LnCtRO,#LineCt ;5et line count reg for 1 line Jmp LfOrvl ; Jmp to Start of Drive 1344 1345 FmFd: Mov A,LnCtRO ;get the line count 1346 Cpl A ;2'5 cpl Line Count 1347 Add A,IIOI iAdd 2'5 cpI 'for Paging Add A,IIPgLnCt 1348 PgLnCt - LnCt = n Lines to move 1349 PgLnCt+CcplCLnCt) = n lines to move 1350 Mav LnCtRO,A j set the line count for FF 1351 1352 for stablization of unused stpr mtr during CR stpr mtr drive, 1353 store the unused stpr mtr current phase bits 1354 TmpROO,#CPSAdr iget the CR phz stareage addr 1355 LFDrv1: Mav Mav A,@TmpROO iget the byute stared there 1356 1357 MovP3 A,@A 'get the phz data byte Mev TmpROO,#LastPh i load Last PhI psuedo reg to Temp Reg 1358 Mov @TmpROQ,A istere Last Phase bits - inderect 1359 exchange/store the phase register index addresses 1360 Mav .TmpROQ,#LPSAdr iget Phz Inderect Addr psuedo reg 1361 Mov A,@TmpROO iget LF last phase index addr 1362 Mov PhzR30,A jplace last LF phase index addr in Phz Reg 1363 MOV TConRO,#LFTMRI ,Load time constant Reg 1364 1365 1366 Select the Stpr Mtr ,GET CR SM SELECT BITS 1367 MOV A,IISLF ,SELECT SM [SCRBOJ MOVO P5,A 1368 1369 1370 1371 LineFeed / FormFeed Drive Loop 1372 MOV A,PhzR30 iget the phz reg indirect addr index 1373 A,@A j do indirect get of phz bits 1374 MovP3 1375 patch together the CR last and LF next phase bits 1376 TmpROO.#LastPh j Ibad Last PhI psuedo reg to Temp Reg Mov 1377 A,@TmpROO ipatch together CR existing & new LF ORL 1378 start timer and step mator P4,A ,OUTPUT BITS 1379 MOVO 1380 1381 StrtLF: , get time constant from reg A.TConRO 1382 STRLFT: MOV T,A j load 1383 MOV the timer ,START TIMER 1384 STRT T setup the next phase to output 1385 , STEP PHASE 08 ADDRESS 1386 INC PhzR30 A,PhzR30 iget th e phase index address 1387 MOV ZROPHL ; test phase 1388 J82 1389 JMP NXTPHL PhzR30,IISTLFF 1390 ZROPHL: MOV ; re-init phase register 1391 1392 NXTPHL: MOV A,PhzR30 jget the phI reg indirect addr index 1393 A,@A i do indirect get of phz bits MovP3 1394 patch together the CR last and LF next phase bits 1395 Mov TmpROO,#LastPh 'load Last Phz psuedo reg to Temp Reg 1396 ORL A.@TmpROQ ipatch together CR existing & new LF 1397 1398 TLoopL: JTF NXPHLF i Jmp on time out to output nxt phz 1399 JMP TLOOPL i loop until timer times out 1400 P4,A 1401 NXPHLF: MOVO ,step motor - OUTPUT BITS 1402 OJNZ CntR40,StrLFT itest for end of phase count for line 1403 iprep for next line 1404 1405 test for various line/inch spacing would go here MOV CntR4Q, #LPIBp8 i init cnt reg for standard line feed 1406 O~NZ LnCtRO.StrtLF itest for end of line count 1407 1408 A,GStR20 ,Get the status byte 1409 Mov A,#LineFd ireset for line feed ANL 1410 1411 GStR20,A ,save the status byte Mov 1412 1413 , ~store the phase register index addresses 1414 Set LineFeed Stpr Mtr Next Phase index address 1415 S@tLRN: Mov TmpROO,IILPSAdr 'get Phz Storage Addr psuedo reg 6-983 230795-001 AP-161 0452 0453 0454 0456 FB AO B478 B490 0458 83 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 ByPasl: 1427 1430 0500 0500 0501 0502 0504 0505 0507 0509 05 FA 53F7 AA B823 B020 C5 050A 050B 0500 050E FA 53FO AA 83 050F 0510 0512 0513 0515 0516 0518 0519 051B 0510 051E 0520 0521 C5 230F 3E 23FF 39 23CO 3A 8A03 BAOO 05 BAOO C5 83 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 j 0522 0523 0525 0526 FA 4302 AA 362A 0528 3402 052A 3422 052C B474 052E 83 052F B87F 0531 B950 0533 BOOO Check if Char Buffer contains full line (80 char or nChar & CR) exit otherwise continue to read in characters Mov ,JBl Call Ret A.GStR20 ByPa.l CBFck 'get the stat byte , i f Do Not Print Bit Set - EXIT * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Minor Software Subroutines * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * * * ORG 500H System initialization subroutines Oefalt: reset/set EOF status fl~g bit = 0 SEL RBI Mov A.ChStRI ;get the char status byte ANL' A•• ClrEOF 'clear the EOF flag bit Mov ChStRI.A i.tore the char status byte Mov TmpRIO.8PTAscS iget the Ascii code tmp store addr Mov @TmpR10,.Ascii SEL RBO ;load th. tmp stor reg w/eseii start reset/set Ok-to-Print status flag bit = 0 Mov A.GStR20 iget the status byte ANL A•• OkPrnt ireset print flag - Ok Print Mov GStR20.A isave the status byte RET InitAI: AllOH: , --------------------------------------------------------------CLEAR all outputs SEL RBO MOV A•• OFH ,FORCE PORT HI - R/ OF 555 MOVD P6.A MOV A•• OFFH ,TURN ALL PRNT SOL's OFF OUTL Pl.A MOV A•• PTRGHI iprint head fire tirgger inactive OUTL P2.A ORL P2 •• 03 ,set comm hdsk to ACK hi/Busy hi Mov GStR20 •• 00H iclear the status registers SEL RBI Mov ChStRl •• 00H SEL RBO RET ; RETURN TO INIT. ROUTINE PG 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 iget the phase index add~ess istore LF Next phase index addr A.PhzR30 @TmpROO.A OlyLng OeSISM PG 1428 1429 Mov Mov Call Call , * * * Home * * *Carriage * * * * */ *Print * * Head * * *Assembly * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *** * *** * * * * * ** * * * CRHome: Mov ORL Mov ,JTO RtoL: A.GStR20 A•• OoNotP GStR20.A RtoL Call Call FAccel RAccel Call Ret DlyVLg 'get the status byte j set the do' not print flag I save the status bVte itest for position of PH assembl~ drive accordingly ;drive CR Stpr Mtr 'find the logical left home CR pOSition ldelay a long time before continuing * * * *Clear * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Data Memory * * * * ~ * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** * At PowerUp or Reset, following CR & LF Stpr Mtr Init, this procedure clears data memory above RBO, Stack and RBt. ClrDM: MOV RO •• DMTop ;GET.BUFFER START LOCATION CHEXI MOV Rl ••0MSIZE ClrDM1: MOV @RO •• OOH ; ZERO MEMORY LOCATION 6-984 230795-001 AP-161 0535 C8 0536 E933 0538 83 1497 1498 1499 1500 DEC DJNZ RET 053D 053E 053F 0540 0541 0543 0545 0547 0549 054A FF Al C9 IF 0382 9647 BF20 ED3D C5 83 054B 054D 054F 0550 0552 0554 0555 0556 0557 0558 0559 055A 0553 055C 055E 0560 BC04 2308 3D BDCO BBOO FB E3 3C FD 62 55 lB FB 5260 A462 BBOO 0562 0563 0564 0566 0568 0569 FB E3 1669 A464 3C EC57 056B 056D 056E 056F 0571 0573 B821 FB AO B478 B490 83 1502 * * * 1503 1504 * * * 1505 1506 PrnTst: 1507 TEST 1508 1509 1510 1511 CTInt: 1512 1513 ChTst: 1514 1515 1516 1517 1518 1519 0578 B880 057A A47E *Character * * * * Print * * * *TEST * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * load the char buffer with successive increments of the ascii code start. test for end of ascii printable chars and reinit the char stream loaded. Mev Mev Mev Mev DEC INC ADD JNZ 1520 Mev 1521 ChrTGo: DJNZ 1522 SEL 1523 RET 1524 CAdrRl.41FCBfSt CCntRl.41ChBfSz A,opnr71 @CAdrRl.A CAdrRl opnr71 A,ttPAsEnd ChrTGo OpnR71. "Ascii CCntRl.ChTst RBO j load char reg withal' bufr strt ; load char cnt reg wIthal' burr size ,Test char buffer fill with ASCII Char Code 1get the ascii char I load data memory wlChar iDecrement dat memory location ; Increment Ascii char number itest for ascii code end • if not end Jmp over code restart i dec buffer, loop if not zero[endJ ,ELSE RETURN TO INIT ROUTINE 1525 PG 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 * * * *CR *Stpr * * Mtr * * *Power * * *On * Initialization * * * * * * * *and* * * * * * * * * * * * * * * * * *This * *routine * * * * drives * * * *the* *CR * or* LF * * stpr * * mtr * * *for* *four * * phase * * * * * * * 1564 0574 B87F 0576 A47E idee buffer, loop if not zero[end] ,RETURN TO INIT ROUTINE PG 1501 0539 B97F 053B BD50 RO Rl.ClrDMl shifts for initialization. ,POWER ON INIT STPR MTR MOV CntR40.41PhCntl i load phase cnt reg for INIT ,GET CR SM SELECT ,BITS MOV A.41SCR80 ,SELECT SM [SCR80] MOVD P5.A TConRO.41IntTm2 ;Load time constant Reg MOV MOV PhzR30.41FStCRP • zero 8M phase reg - forward A.PhzR30 .get phase index register byte MOV A,;M MovP3 'load indexed phase shif~ byte MOVD P4.A ,OUTPUT BITS STRTTR: MOV A.TConRO ,GET TIMER CONSTANT T.A MOV STRT ,START TIMER T INC PhzR30 ;step phase index register MOV A.PhzR30 ,CHECK THE PHASE COUNT REG ZroRg2 JJl2 JMP Nx tPhR ZroRg2: r10V PhzR30.41FStCRP i zero 8M phase reg - forward NxtPhR: MOV A.PhzR30 iget phase index register byte MovP3 Ad!A J load indexed phase shift byte TLoopR: JTF NXPHRI ,JMP ON TIME OUT TO NEXT PH JMP TLoopR ,LOOP UNTIL TIME OUT MOVD P4.A ,OUTPUT Jl ITS NXPHR 1: DJNZ CntR40.STRTTR INITCR: , store the last phase register index addresses TmpROO,#CPSAdr ;get Phz Storage Addr psuedo reg Mov Mov A,PhzR30 ,place last CR phase index addr in Phz Reg @TmpROO.A store CR last phase index addr Mov DlyLng Call DeSISM Call RET PG 1565 Time" Delay Subroutines 1566 1567 , ---------------------------------------------------------------1568 1569 Very Long 1570 DlyVLg: MOV TmpROO.417FH ,LOAD DELAY COUNT IN REG, 1571 Jmp DlyST 1572 1573 Long 1574 DlyLng: MOV TmpROO.41DlyCL ,LOAD DELAY COUNT IN REG, 1575 Jmp DlyST 1576 6-985 230795-001 inter 057C B830 057E 23CC 0580 62 0581 55 0582 1680 0584 05 0585 FA 0586 928A 0588 058A 058B 0580 058F 1469 C5 A482 E880 83 0590 230E 0592 3D 0593 83 AP-161 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 =1607 =1608 ; Not So Long - Sho~t DlySht: MOV TmpROO.~DlyCS ',LOAD DELAY COUNT IN REG. DlyST: NxtTLd: Start Delay A. ~Dl yTim MOV MOV T.A STRT T DlyLop: JTF , LOOP DlyTO Char buffer fi 11 during time loop: REI SEL A.ChStRI ;get the character stat reg b~te Mov SkpCI test for normal char input JB4 or skip if char prnt test ;service the char buffer fill Call IBFSrv SEL REO, DlyLOP JMP TmpROO.NxtTLd idee delay count & test for exit DJNZ RET SkpCI: DlyTO: Stpr Mtr Deselect Stepper Motor DeSelect Routine ,DESELECT LF/CR SM DESLSM: ,GET LF/CR SM DE-SELECT BITS SMERDR: MOV A.ISMOFF ,DE-SELECT CR SM MOVD P5.A RET $INCLUDE(:Fl:CHRTBL.OV1) * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Character Dot Generator Look-up Table Page 1 =1609 =1610 =1611 =1612 * * * * * * * * * * * * * * * * * * * * * * * * * * ** * * * * * * * Character Table Page 1, contains =1613 0600 ,GET MAX TIMER DELAY ,LOAD TIMER ,START TIMER =1614 =1615 , =1616 =1617 =1618 =1619 =1620 =1621 =1622 =1623 20H ----------------------------------------> 4FH " (sp)!"I$%8<'()*+.-. 10123456789:J<=>?@ABCDEFGHIJKLM " DRG 600H =1624 Page 1 =1625 =1626 =1627 =1676 =1677 =1678 =1679 =1680 =1681 =1682 =1683 =1684 =1685 =1686 =1687 =1688 =1689 =1690 =1691 =1692 =1693 =1694 =1695 =1696 =1697 =1698 =1699 =1700 =1701 =1702 =1703 =1704 =1705 <<< Character Dot Pattern Fetch actual assembled character table code not listed $NoList $List Listing below is for reference only, actual code is not listed at assembly time. J --------------------------------------------------------------------asc20: 7FH, 7FH, 7FH, 7FH, 7FH , SPACE DB 7FH, 7FH, 20H~ 7FH, 7FH asc21 : j! DB 85C22: 7FH, 7FH, 78H, 7FH. 78H DB J" asc23: ,I 6BH. OOH, 6BH, DOH, 6BH DB ,$ a5c24: 5BH, 55H, OOH, 55H, 6DH DB 85C25: 5CH, 6CH, 77H, lBH, lDH ,% DB asc26: 19H, 26H, 26H, 59H. 2FH ,I!c DB a5c27: 7FH, 7FH. 7CH, 7FH, 7FH DB ( J a5c28: 63H, 5DH, 3EH, 7FH, 7FH DB ) 851:29: 7FH, 7FH. 3EH, 5DH, 63H DB asc2A: 5DH, 6BH. OOH, 6EH, 5DH DE ,* ,+ 77H, 77H, 41H, 77H, 77H asc2B: DB 7FH, 3FH. 4FH, 7FH, 7FH asc2C: DE 77H. 77H. 77H. 77H. 77H asc2D: DB J asc2E: 7FH, lFH. lFH, 7FH, 7FH DE , I J asc2F: 5FH, 6FH, 77H. 7BH. 7DH DE 41H, 2EH, 36H. 3AH. 41H J asc30: ,0 DE ,1 7FH, 3DH, OOH, 3FH, 7FH asc31 : DB ,2 asc32: DE 3DH, lEH, 2EH, 36H. 39H 5DH, 3EH, 36H, 36H. 49H DB asc33: J3 ,4 asc34: DB 67H. 6BH, 6DH, OOH, 6FH 58H, 3AH, 3AH, 3AH, 46H J asc35: ,5 DB 43H, 35H, 36H, 36H, 4EH J asc36: ,6 DE asc37: ,7 DB 7EH. OEH, 76H, 7AH, 7CH J asc38: 49H, 36H, 36H, 36H, 49H ,8 DB , , ,. ,,. 6-986 230795-001 inter AP-161 =1706 asc39: DB =1707 asc3A: DB =1708 asc3B: DB =1709 asc3C: DB =1710 asc3D: DB =1711 asc'3E: DB =1712 asc3F: DB =1713 asc40: DB =1714 asc41 : DB =1715 asc42: DB =1716 asc43: DB =1717 asc44: DB =1718 asc45: DB =1719 asc46: DB =1720 asc47: DB =1721 asc48: DB =1722 asc49: DB =1723 asc4A: DB =1724 I asc4B: DB =1723 asc4C: DB =1726 asc4D: DB =1727 asc4E: DB =1728 asc4F: DB =1729 asc4E: DB =1730 asc4F: DB =1731 =1732 End Page 1 =1733 =1734 39H. 7FH. 7FH. 77H. 6BH. 7FH. 79H. 41H. 03H. OOH. 41H. OOH. OOH. OOH. 41H. OOH. 7FH. 5FH. OOH. OOH. OOH. OaaH, 55H. OOH. 41H. 36H. 36H. 56H. 61H 7FH. 6BH. 7FH. 7FH 3FH. 4BH. 7FH. 7FH 6BH. 5DH. 3EH. 7FH 6BH. 6BH. 6BH. 6BH 3EH. 5DH. 6BH. 77H 7EH. 26H. 7AH. 7DH 3EH. 22H. 36H. 71H 6DH. 6EH. 6DH. 03H 36H. 36H. 36H. 49H 3EH. 3EH. 3EH. 5DH 3EH. 3EH. 5DH. 63H 36H. 36H. 36H. 36H 76H. 76H. 76H. 76H 3EH. 3EH. 2EH. ODH 77H. 77H. 77H. OOH 3EH. OOH. 3EH. 7FH 3FH. 3FH. 3FH. 40H 77H. 6BH. 5DH, 3EH 3FH. 3FH. 3FH. 3FH 7DH. 73H. 7DH. OOH OdfH. OefH, Of7H. OaaH OdfH. OefH. Of7H. 55H 7BH. 77H. 6FH. OOH 3EH. 3EH. 3EH. 41H 19 ; : ;; I( ;= I> ;1 I@ IA IB IC 10 IE IF IG ,H II 'v IK IL ,M J test ; test ,N ,0 --------------------------------------------------------------------Character Dot Pattern Fetch =1735 06FO FC 06Fl A3 06F2 4380 06F4 39 06F5 83 --------------------------------------------------------------------Character Dot Pattern Fetch =1736 =1737 =1738 ChrPgl: =1739 =1740 =1741 =1742 =1743 =1744 =1745 =1746 =1747 =1748 =1749 =1750 =1751 =1752 =1753 MOV MOVP this bit fix necessary to "not underline each character this saves fixing each bit in the look up table ORL OutL END Page 1 =1767 Character Dot Pattern Fetch PAGE 2 -- Character Dot Generator Look-Up Table Character Table Page 2, contains =1756 0700 ;char bit fix ioutput the dot pattern iexit with byte in acc A.tl80H Pl. A RET =1754 =1755 =1757 =1758 =1759 =1760 =1761 =1762 =1763 =1764 =1765 =1766 ;'get char index address offset iget column dot patern byte A.CDotRl A.@A 50H ------------------------------------------> 7EH " NOPGRSTUVWXYZ[\lA_C?)abcdefghiJklmnopqrstuvwxyz{I}· ORG Page 2 700H Character Dot Pattern Fetch =1768 «< Actual assembled character table code not listed »> =1769 =1770 SNoLIST =1818 SList Listing belo~ is for reference only, actual code is not listed =1819 =1820 at assembly time. =1821 =1822 P asc50 DB OOH. 76H. 76H. 76H. 79H =1823 G =1824 41H. 3EH. 2EH. 5EH. 21H asc51 DB 56H. R =1825 asc52 OOH. 76H. 66H. 39H DB 5 59H. 36H. 36H. 36H. 4DH =1826 asc53 DB T 7EH. 7EH. OOH. 7EH. 7EH =1827 asc54 DB U =1828 asc55 DB 40H. 3FH. 3FH. 3FH. 40H V =1829 asc56 DB 60H. 5FH. 3FH. 5FH. 60H OOH. 5FH. 67H. 5FH. OOH W =1830 asc57 DB X lCH. 6BH. 77H. 6BH. lCH =1831 asc58 DB Y 7CH. 7BH. 07H. 7BH. 7CH asc59 =1832 DB 6-987 230795-001 AP-161 =1833 =1834 =1835 =1836 =1837 =1838 =1839 =1840 =1841 =1842 =1843 =1844 =1845 =1846 =1847 , =1848 =1849 =1850 =1851 =1852 =1853 =1854 =1855 =1856 =1857 =1858 =1859 =1860 =1861 =1862 =1863 =1864 =1865 =1866 =1867 =1868 =1869 =1870 =1871 =1872 IEH. 2EH. 36H. 3AH. 3CH OOH. 3EH. 3EH. 3EH. 7FH 7DH. 7BH. 77H. 6FH. 5FH 7FH. 3EH. 3EH. 3EH. OOH 6FH. 77H. 7BH. 77H. 6FH 3FH. 3FH. 3FH. 3FH. 3FH 7DH. 7BH. 77H. OFFH. OFFH ODFH. OABH. OABH. OABH. 087H 080H. OB7H. OB7H. OB7H. OCFH OC7H. OBBH. OBBH. OBBH. OBBH OCFH. OB7H. OB7H. OB7H. 080H OC7H. OABH. OABH. OABH. OB7H OF7H. 081H. OF6H. OFEH. OFDH OF7H. OABH. OABH. OABH. OC3H 080H. OF7H. OFBH. OFBH. 087H OFFH. OBFH. 08BH. OBFH. OFFH ODFH. OBFH. OBBH. OC2H. OFFH OFFH. 080H. OEFH. OD7H. OBBH OFFH. OBEH. 080H. OBFH. OFFH 087H. OFBH. OE7H. OFBH. 087H 083H. OF7H. OFBH. OFBH. 087H OC7H. OBBH. OBBH. OBBH. OC7H 084H. OEBH. OEBH. OEBH. OF7H OF7H. OEBH. OEBH. OEBH. 084H OFFH. 083H. OF7H. OFBH. OFBH OB7H. OABH. OABH. OABH; ODBH OFBH. OCIH. OBBH. ODFH. OFFH OC3H. OBFH. OBFH. OBFH. OC3H OE3H. ODFH. OBFH. ODFH. OE3H OC3H. OBFH. OCFH. OBFH. OC3H OBBH. OC7H. OEFH. OC7H. OBBH OFFH. OB3H. OAFH. OAFH. OC3H OBBH. 09BH. OABH. OB3H. OBBH 07FH. 0'77H. 049H. 03EH. 03EH OFFH. OFFH. 088H. OFFH. OFFH 03EH. 03EH. 009H. 077H. 07FH 067H. 07BH. 067H. 05FH. 067H DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB DB· DB DB DB DB DB DB DB DB DB DII DB DB DB DB DB 8sc5A: asc5B: asc5C: ase 50: asc5E: ase SF: a5e60: Bsc61 : a5c62: a5c63: a5c64: a5c65: 85C66: 85C67: a.c68: asc:69: asc6A: asc6B: Bsebe: asc6D: BsebE: asc6F: 85C70: Bsc71 : 85C72: 85C73: a5c74: 85C75: 85c76: asc77: a5c78: 85C79: asc7A: ASC7B: ASC7C: ASC7D: ASC7E: , Z ,[ ,\ , ] ,A ,\ , , , , . , , , , ; a b c d f 9 h i , J , k ,1 , m ,n ,, °P . , q ,'" , t , u . 'v , ,x , Y , z , ,I , , { } ~ -------------------------------------------------------------Chal'act~l' Dot Patt~l'n F~tch -------------------------------------------------------------- 07EB FC 07EC A3 07ED 4380 07EF 39 07FO 83 -1873 =1874 =1875 Ch"Pg2: =1876 =1877 =1878 =1879 =1880 ·=1881 =1882 =1883 1884 1885 1886 1887 lSSS 1889 1890 1891 ASSEMBLY COMPLETE. MOV MOVP iget char index add~ess offset Jget co'lumn dot patern byte A.CDotRI A.@A this bit fix necessary to not underline each character this saves fixing each bit in the look up table ORL OutL RET ichar bit fix ,output the dot patte"n A.lI80H PI. A iexit with byte in ace * * * * * * * * * * * * * * ** ** * * ** * * * * * * ** * ** ** ** * Program End * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * END NO ERRORS 6-988 230795-001 inter AP-161 APPENDIX B. SOFTWARE PRINTER ENHANCEMENTS This section describes several software enhancements which could be implemented as additions to the software developed for this Application Note. Space is available for most of the items described. Approximately 5 bytes of Data Memory would be required to implement most of the features. Two bytes would be used for status flags, and two bytes for temporary data or count storage. It is possible to use less than five bytes, but this would require the duplicate use of some flags, or other Data Memory storage, which will significantly complicate the software coding and debug tasks. Special Characters or Symbols Dot matrix printing lends itself well to the creation of custom characters and symbols. There are two aspects to implementing special .characters. First, a character look-up table, and second, additional software for dec oding and processing the special characters or symbols. Special characters might be scientific notation, mathematical symbols, unique language characters, or block and line graphics characters. The character look-up table could be an additional page of Program Memory dedicated to the special characters, or replace part, or all, of the existing lookup tables. If an additional look-up table is used, a third page test would be needed at the beginning of the Character Translation subroutine. There is fundamentillly no difference between the processing of special characters and standard ASCII printable characters. If the characters require the same 5 x 7 dot matrix, the balance of the software would remain the same. If, however, the special characters require a different matrix, or the manipUlation of the matrix, the software becomes more complex. In general, the major software modification required to implement special characters is the size of the dot matrix printed or the dot matrix configuration used. In the case of scientific characters, it would often be necessary to shift the 5 x 7 matrix pattern within the available 9 x 9 matrix. Block orline graphics characters, on-the-other-hand, would require using the entire 9 x 9 print head matrix and printing during normally blank dot columns. This would require suspending the blank column blanking mechanism implemented in this Application Note. This would be the most complex aspect of implementing special characters. It would possibly change the number of required instructions, and thus the timing between PTS detection and print head solenoid trigger firing. This could cause the dot colunms to be misaligned within a printed line and between lines. In the case of a matrix change, two approaches are possible: dynamically changing the matrix, in line, as standard ASCII characters are being printed, or isolating the special characters to a separate processing flow where special characters are handled as a unique and complete line of characters only. A discussion of in line matrix changes for special characters is beyond the scope of this Appendix. It is sufficient to say that the changes would require the conditions setting the EOLN flag, character count, and dot column count software be modified during character processing and printing. Lower Case Descenders The general principle of implementing lower case descenders is to shift the 5 x 7 character dot matrix within the available 9 x 9 print head solenoid matrix. Implementing lower case descenders requires two software modifications and the creation of status flag for the purpose. First, the detection of characters needing descenders and setting a dedicated status flag during the character code to dot pattern translation subroutine. Second, the character dot column iJata output to the print head solenoids must be shifted for each dot column of the character. At the end of the character, the flag would be reset. Inline Control Codes Inline control codes are two to three character sequences, which indicate special hardware conditions or software flow control and branching. The first character indicates that the control code sequence is beginning and is typically an ASCII Escape character (ESC), I BH. Termination of the inline code sequence would be indicated by a default number of code sequence characters. This would decrease the buffer size available for characters. Full 80 character line buffering would require loading the Character Buffer with a received character as a character is removed from it and processed. The Inline Control Code test would be performed in two places: in the Character Buffer Fill subroutine and in the Character Processing (translation) subroutine. The test would be performed in the same manner that a Carriage Return (CR) character code test is implemented. Examples are horizontal tabs and expanded or condensed character, fonts. In the case of horizontal tabs, 20H (Space Character) would have to be placed in the Character Buffer for inline processing during character processing and printing. Unless fixed position tabs are used, a minimum of a nibble of Data Memory would be required to maintain a "spaees-to-tab" count. Fixed tab positions could be set via another inline control code, by default of the printer software, or through the use of external hardware switch settings. The control code method of setting the tab positions is the most desireable, but the most complex to implement. Different Character Formats Figure Bl illustrates three different character fonts; standard, condensed, and enlarged or expanded'characters. As the the figure illustrates, condensed and 6-989 230795-00t AP-161 enlarged characters are variations in either the number of dots and/ or the space used to print them. Th us, each character is a variation of the stepper motor and/ or print head solenoid trigger timings. Figure B2 illustrates the timings required to implement the additional character printing. In addition to the three character fonts shown, it is possible to print each in bold face by printing each dot twice per dot column position. This would require little software modification, but would require a status flag. Again, care must be used to ensure that the delay in retriggering th-.,solenoids is precisely the same for each type of event. Without this precise timing the dot column alignment will not be accurate. The software modifications needed to implement enlarged or condensed characters is essentially the same. The carriage and print head solenoid firing software flow is the same, but the timing for each changes. For condensed characters, the step Time Constant is doubled to approximately 4.08 ms, and the solenoids are fired four times within each step time. The step rate actually becomes a multiple of the solenoid firing time, and a counter incrementing once for each solenoid firing would be needed. At the count offour, the carriage stepper motor is stepped and the counter reset. In the case of condensed characters, PTS does not play the same roll as in standard or enlarged character printing. PTS is not used to indicate the optimum print head solenoid firing time. Solenoid firing is purely a time function for condensed characters. PTS would only be used for Failsafe protection. Enlarged characters would require the solenoids be fired twice per dot column data, in two sequential dot columns, at the same rate as standard characters. The character dot column data and dot column count would not be incremented at each output but at every other output. A flag could be used for this purpose. When printing either condensed or enlarged characters, the maximum character count would have to compensate for the increased or decreased characters per line count. When printing enlarged characters, the maxi- mum characters per line would be 40. The Character Buffer could hold two complete lines of characters. But, condensed characters presents a quite different situation. The available character per line increases to 132, well beyond the 80 character Character Buffer size. The solution is to re-initialize the Character Buffer Size Count register count during condensed character processing. This will effectively inhibit the carriage stepper motor drive EOLN detection. Two status flags would be required; one for standard or enlarged characters, and the second for condensed characters. A third status flag would be required to implement bold face printing. Activating one of the alternate character fonts could be either through the use of external status switches or through inline control code sequences, as detailed above. Note, that if the alternate character fonts are implemented in such a way that format changing is to occur dynamically during any single line being printed, the same control code problems described above also apply. In addition, the effect on the timing and dot column alignment must also be investigated. Variable Line Spacing Variable line spacing is another feature which could be implemented either through the use of external status switches or inline control codes. The line spacing is a function of the number of steps the stepper motor rotates for a given line. Figure 15, Paper Feed Stepper Motor Predetermined Time Constants, in the Background section above, lists the Time Constants required for three different line spacings; 6, 8, and 10 lines per inch. At the beginning of the Paper Feed Stepper Motor Drive subroutine, the default line step count is loaded. The software required is a conditional load for the line spacing, indicated by a status flag set in the External Status Switch Check subroutine or the Character Buffer Fill subroutine. Implementing the three different line spacings would require two additional status flags. 6-990 230795-001 AP-161 APPENDIX C. PRINTER MECHANISM DRIVE CIRCUIT SOLENOID 1 ~~--~--~~~4 PRINT PULSE 1 500 ± 20115 PRINT PULSE 9 I SOLENOID 9 24V~10% .......r--;::::::i;::::::;---'-1:=:;--,-- 5V~5% C4 TRIGGER PULSE 200115 OR LESS RESET PULSE Recommended Solenoid Drive Circuit PARTS NO. TYPE IC1-IC10 SN7406 TI IC11 (.JA555 Fairchild Toshiba MAKER D1-D9 DIODE S5277B 01-09 TRANSISTOR 2SD986 NEC 010 011 R1-R9 TRANSISTOR 2SA1015 Toshiba TRANSISTOR 2SD633 Toshiba RESISTOR 1.2kn \4 R10 RESISTOR 22n \4 R11 RESISTOR 580n 2 R12 RESISTOR 15kn \4 Carbon fil= 1.2kn \4 R13 RESISTOR VR1 VARIABLE RESISTOR C1 CAPACITOR 20kn \4 1(.JF 100V C2 CAPACITOR 0.01(.JF C3 CAPACITOR 0.001(.JF C4 CAPACITOR 10(.JF 16V C5 CAPACITOR 0.1(.JF fil= ZD1 ZENOR DIODE HZ24 . Hitachi ZD2 ZENOR DIODE HZ5C1 Hitachi 6-991 230795-001 AP-161 Recommended Carriage Motor Drive Circuit HOLD SIGNAL DRIVE SIGNAL A 5V±5%~----~-----+---t------r---'-----~--~----~~-, R6 R9 R8 PHASE A (RED) 24V±10% r-----INCASE OF Tc=4.16ms (CONDENSED CHARACTER PRINTING), V=14±20% (GREEN) (GREEN) 0 (YELLOW) @ -.., I B (WHITE) PULSE MOTOR II ~------------------------------------------ PARTS NO. TYPE MAKER QTY R1 Resistor 1kn±10% v. 1 R2-R5 Resistor 220n±10% 4 R6 Resistor v. 10kn±10% v. R7 Resistor 470n±10% 3 1 R8 Resistor 130n±10% 7 1 R9 Resistor 330n±10%'3 01 Transistor 28C1815 Toshiba 02-05 Transistor 28D526-Y Toshiba 06 Transistor 288669 Matsushita 1 01-04 Diode 18954 NEC 4 6-992 1 1 1 4 230795-001 AP-161 Recommended Paper Feed Motor Drive Circuit HOLD SIGNAL DRIVE SIGNAL ---+-......---1---.---+-_----11---. 5Vo:5% - - -..... R9 R8 PHASE A (RED) (GREEN) r-- C (BLUE) I B (WHITE) I I I I I I I I I I I I I lI _____________________________ PARTS NO. TYPE R1 R2-R5 Resistor 1kO±10% V. Resistor 2200±10% V. R6 Resistor 10kO±'10% V. R7 Resistor 4700±10% 3 R8 Resistor 1300±10% 7 R9 Resistor 3300±10% 3 (GREEN) 0 (YELLOW) y~~!~~~T2!_ MAKER 01 Transistor 28C1815 Toshiba 02-05 Transistor 28D526-Y Toshiba 06 Transistor 28B669. Matsushita D1-D4 Diode 18954 NEC 6-993 --.., __ _ QTY 1 4 1 1 1 1 1 4 1 4 230795-001 AP-161 9 x 3.3K Hl ~ H2 ~ H3 ~ H4 ~ H5 ~ H6 H7 - - 02 H4 H5 ~ l:i±:::t 06 J'o --C: -....QZ.. ...J. ·06 ~ H9 ~ ,-.Q2.. LW 6 TO 3.3K 2W 680 o 'f 2 T .1 R .5 1.2K 1.2K r"'"' 2W 620 24 J . T 1000p e -.1 CRD 1 ~ 1205W~ ~i 015 ~I 1.2Kr"'"' 016 ~I O.O~II 017 RY ~'''i SCA 120SW r"""' ~ CRC ~ -- ~5a~\'Li 1;,'6KI~ CRB l 1.2K.J:'"""": 1.2K CRA ~' 013 12K,t I ~ 014 2W 620 S LF 15K Dl0 012 140 FD_ t 1.2K~ 32 LF C_ ~ 1 0.1" 1.2K.J::::::::' 2W 820 FB_ 20K VTH D15 V, all 80_ LF A_ 152057K 555 r""'"' CR A CR D S OL L2r'cmovCc 100 O.D1" CR C H 9 (L) *~~16V 5550 CR B_ H H ~ GN~ HEAD TRIGGER H6 .vt. ..::. ~ H8 FP H3 ~ ~ ~ H2 ~ ~ ~ Hl (U) ~ ~ LFA LFB LFC !..N.. ----~ 1 LFD SLF GP 6-9.94 230795-001 APPLICATION NOTES AP-90 May 1980 6-995 231314-001 APPLICATIONS INTRODUCTION The microcomputer system designer requiring a low-cost, non-volatile storage medium has a difficult choice. His options have been either relatively expensive, as with floppy discs and bubble memories, or non-transportable, like battery backed-up RAMs. The full-sized digital cassette option was open but many times it too was too expensive for the application. Filling this void of low-cost storage is the recently developed digital mini-cassette. These mini-cassettes are similar to, but not compatible with, diCtation cassettes. The mini-cassette transports are inexpensive (well under $100 in qmmtity), small (less than 25 cu. in.), low-power (one watt), and their storage capacity is a respectable 200K bytes of unformatted data on a 100-foot tape. These characteristics make the mini-cassette perfect for applications ranging from remote datalogging to program storage for hobbyist systems. The only problem associated with mini-cassette drives is controlling them. While these drives are relatively easy to interface to a microcomputer system, via a parallel I/O port, they can quickly overburden a CPU if other concurrent or critical real-time I/O is required. The cleanest and probably the least expensive solution in terms of development cost is to use a dedicated single-chip controller. However, a quick search through the literature turns up no controllers compatible with these new transports. What to do? Enter the UPI-41A family of Universal Peripheral Interfaces. The UPI-41A family is a group of two userprogrammable slave microcomputers plus a companion I/O expander. The 8741A is the "flag-chip" of the line. It is a complete microcomputer with 1024 bytes of EPROM program memory, 64 bytes of RAM data memory, 16 individually programmable I/O lines, an 8-bit event counter and timer, and a complete slave peripheral interface with two interrupts and Direct Memory Access (DMA) control. The 8041A is the masked ROM, pin compatible version of the 8741A. Figure 2 shows a block diagram common to both parts. The 8243 I/O port expander completes the family. Each 8243 provides 16 programmable I/O lines. Using the UPI concept, the designer can develop a custom peripheral control processor for his particular I/O problem. The designer simply develops his peripheral control algorithm using the UPI-41A assembly language and programs the EPROM of Figure 1. Comparison of Mini-Cassette and Floppy Disk Transports and Media. 6-996 231314-001 APPLICATIONS PERIPHERAL BUS SVSTEMBUS Figure 2. 8741A/8041A Block Diagram the 8741A. Voila! He has a single-chip dedicated controller. Testing may be accomplished using either an ICE-41A or the Single-step mode of the 8741A. UPI-41A peripheral interfaces are being used to control printers, keyboards, displays, custom serial interfaces, and data encryption units. Of course, the UPI family is perfect for developing a dedicated controller for digital mini-cassette transports. To illustrate this application for the UPI family let's consider the job of controlling the Braemar CM-600 Mini-Dek®. THE CM-600 MINI-DEK* The Braemar CM-600 is representative of digital mini-cassette transports. It is a single-head, singlemotor transport whiah operates entirely from a single 5-volt power supply. Its power requirements, including the motor, are 200ma for read or write and 700ma for rewind. Tapes speeds are 3 inches per second (IPS) during .read or write, 5 IPS fast forward, and 15 IPS rewind. With these speeds and a maximum recording density of 800 bits per inch (BPI), the maximum data rate is 2400 bits per second (BAUD). The data capacity using both sides of a 100-foot tape is 200K bytes. On top of this, the transport occupies only 22.5 cubic inches (3 I x3 I x2.5"). All I/O for the CM-600 is TTL-compatible and can be divided into three groups: motor control, data control, and cassette status. The motor group controls are GO/STOP, FAST/SLOW, and FORWARD/ REVERSE. The data controls are READ/ WRITE, DATA IN, and DATA OUT. The remaining group of outputs give the transport's status: CLEAR LEADER, CASSETTE PRESENCE, FILE PROTECT, and SIDE SENSOR. These signals, shown schematically in figure 3 and table 1, give the pin definition of the CM-600 16-pin I/O connector. RECORDING FORMAT The CM-600 does not provide either encoding or decoding of the recorded data; that task is left for the peripheral interface. A multitude of encoding techniques from which the user may choose are available. In this single-chip dedicated controller application, a "self-clocking" phase encoding scheme similar to that used in floppy discs was chosen. This scheme specifies that alogic "0" is a bit cell with no transition; a cell with a transition is a logic "1." 6-997 231314-001 APPLICATIONS Table 1. CM·600· I/O Pin Definition Pin 1 2 1/0 - 3 4 0 I 0 - 5 6 I 0 7 8 9 10 11 12 - 13 14 0 0 15 I - I I 16 Function Index pin-not used Signal ground Cassette side (O-side B, I-side A) Data input (O-space, I-mark) Cassette presence (O-cassette, I-no cassette) Read/Write (O-read, I-write) File protect (O-tab present, I-tab removed) +5v motor power Power ground Chassis ground Direction (O-forward, I-rewind) Speed (O-fast, I-slow) Data output (O-space, I-mark) Clear leader (O-clear leader, I-off clear leader) Motion (O-go, I-stop) +5v logic power INPUTS BLOCK DIAGRAM +5V MOTOR POWER----+.. 5V LOGIC POWER---+TAPE DIRECTION (I WDIREW)+TAPE MOTION (STOP/GO)--+ TAPE SPEED (FAST/SLOW)--.. SELECT READ/WRITE--'-' DATA INPUT POWER GROUND II SIGNAL GROUND CHASSIS GROUND~ BRAEMAR eM-SOO'" OIGITAl Figure 4. Modified Phase Encoding of Character 3A Hex (AAH), and the character immediately preceeding the last SYNC is the checksum. The checksum is capable of catching 2 bit errors. The number of data characters within a block is limited to 64K bytes. Blocks are separated by an I nter-Record Gap (IRG). The IRG is of such a length that the transport can stop and start within an IRG, as illustrated in the data block timing, figure 5. Braemar specifies a maximum start or stop time of 150ms for the transport, thus the controller uses 450ms for the IRG. This gives plenty of margin for controlling the transport and also for detecting IRGs while skipping blocks . OUTPUTS ....... CASSETTE SIDE =: ~lk~::T~~EpCRTESENCE MINI CASSETTE ~ CLEAR LEADER TRANSPORT ....... DATA OUTPUT • THE UPI.41 ATM CONTROLLER Figure 3. Braemar CM·600· Block Diagram Figure 4 illustrates the encoding of the character 3AH assuming the previous data ended with the data line high. (The least significant bit is sent. first.) Notice that there is always a "clocking" transition at the beginning of each cell. Decoding is simply a matter of triggering on this "clocking" transition, waiting 3/4 of a bit cell time, and determining whether a mid-cell transition has occurred. Cells with no mid-cell transitions are data O's; cells with transitions are data l's. This encoding technique has all the benefits of Manchester en codingwith the added advantage that the encoded data may be "decoded by eyeball:" long cells are always O's, short cells are always l's. Besides the encoding scheme, the data format is also up to the user. This controller uses a variable byte length, checksum protected block format. Every block starts and ends with· a· SYNC character The goal of the UPI software design for this application was ,to make the UPI-41A microcomputer into an intelligent cassette control processor. The host processor (8086, 8088, 8085A, etc.) simply issues a high-level command such as READ-a-block or WRITE-a-block. The 8741A accepts the command, performs the requested operation, and returns to the host system a result code telling the outcome of the operation, ego Good-Completion, Sync Error, etc. Table 2 shows the command and result code repertoire. The 8741A completely manages all the data transfers for reading and writing. As an example, consider the WRITE-a-block command. When this command is issued, the UPI-41A expects a 16-bit number from the host telling how many data bytes to write (up to 64K bytes per block). Once this number is supplied in the form of two bytes, the host is free to perform other tasks; a bit in the UPI's STATUS register or an interrupt output will notify the host when a data transfer is required. The 8741A then checks the transport's status to be sure that a cassette is present and not file protected. If either is false, a result code is 6-998 231314-001 APPLICATIONS r-1_.-----BLOCKWRITEOPERATlON----o·.,1 . I r--450MS-"\ SYNC I DATA II I CHECKSUM I SYNC I I SYNC I DATA r--450MS~1 'STOP TRANSPORT 'START TRANSPORT Figure 5. IRG/Block Timing Diagram (not to scale) an IRG, stops the drive, and returns the appropriate Data-Underrun result code. Table 2. Controller Command/Result Code Set Command Result Read (OlH) Good-Completion (OOH) Buffer Overrun Error (4IH) Bad Synchl Error (42H) Bad Synch2 Error (43H) Checksum Error (44H) Command Error (45H) End of Tape Error (46H) Good-Completion (OOH) Good-Completion (OOH) End of Tape Error (47H) Beginning of Tape Error (48H) Good-Completion (OOH) Buffer Underrun Error (8IH) Command Error (82H) End of Tape Error (83H) Rewind (04H) Skip (03H) Write (02H) The READ-a-block command also provides error checking. Once this command is issued by the host, the controller checks for cassette presence. If present, it starts the transport. The data output from the transport is then examined and decoded continuously. If the first character is not a SYNC, that's an error and the controller returns a BadFirst-SYNC result code (42H) after advancing to the next IRG. If the SYNC is good, the succeeding characters are read into an on-chip 30 character circular buffer. This continues until an IRG is encountered. When this occurs, the transport is stopped. The controller then tests that the last character. If it is a SYNC, the controller then compares the accumulated internal checksum to the block's checksum, the second to the last character of the block. If they match, a Good-Completion result code (OOH) is returned to the host. If either test is bad, the appropriate error result code is returned. The READ command also checks for the End-of-Tape (EaT) clear leader and returns the appropriate error result code if it is found before the read operation is complete. returned to the host; otherwise the transport is started. After the peripheral controller checks to make sure that the tape is off the clear leader and past the hole in the tape, it writes a 450ms IRG, a SYNC character, the block of data, the checksum,. and the final SYNC character. (The tape has a clear leader at both ends and a small hole 6 inches from the end of each leader.) The data transfers from the host to the UPI -41A slave microcomputer are double buffered. The controller requests only the desired number of data bytes by keeping track of the count internally. If nothing unusual happened, such as finding clear leader while writing, it returns a Good-Completion result code to the host. If clear leader was encountered, the transport is stopped immediately and an . End-of-Tape result code is returned to the host. Another possible error would be if the host is late in supplying data. If this occurs, the controller writes The 30 character circular buffer allows the host up to 30 character times of response time before the host must collect the data. All data transfers take place thru the UPI-41A Data Bl.!$ Buffer Output register (DBBOUT). The controller continually monitors the status of this register and moves characters from the circular buffer to the register whenever it is empty. The SKIP-n-blocks command allows the host to skip the transport forward or backward up to 127 blocks. Once the command is issued, the controller expects one data byte specifying the number of 6-999 231314-001 APPLICATIONS blocks to skip. The most significant bit of this byte selects the direction of the skip (O=forward, l=reverse). SKIP is a dual-speed operation in the forward direction. If the number of blocks to skip is greater than 8, the controller uses fast-forward (5 IPS) until it is within 8 blocks of the desired location. Once within 8 blocks, the controller switches to the normal read speed (3 IPS) to allow accurate placement of the tape. The reverse skip uses only the rewind speed (15 IPS). Like the READ and WRITE commands, SKIP also checks for EOT and beginning-of-tape (BOT) depending upon the tape's direction. An error result code is returned if either is encountered before the number of blocks skipped is complete. directly to the I/O ports of the UPI controller. If the two are separated (Le. on different PC cards), it is recommended that TTL buffers be provided.) The only external circuitry needed is an LED driver for the DRIVE ACTIVE status indicator. The 8741A-to-host interface is equally straightforward. It has a standard asynchronous peripheral interface: 8 data lines (D o-D 7), read (RD), write (WR), register select (AO), and chip select (CS). Thus it connects directly to an 8086, 8088, 8085A, 8080, or 8048 bus structure. Two interrupt outputs are provided for data transfer requests if the particular system is interrupt-driven. DMA transfer capability is also available. The clock input can be driven from a crystal directly or with the system clock (6MHz max). The UPI-41A clock may be asynchronous with respect to other clocks within the system. The REWIND command simply rewinds the tape to the BOT clear leader. The ABORT command allows the termination of any operation in progress, except a REWIND. All commands, including ABORT, always leave the tape positioned on an IRG. This application was developed on an Intel iSBC 80/30 single board computer. The iSBC 80/30 is controlled by an 8085A microprocessor, contains 16K bytes of dual-ported dynamic RAM and up to 8K bytes of either EPROM or ROM. Its I/O complement consists of an 8255A Programmable Parallel Interface, an 8251A Programmable Communica- THE HARDWARE INTERFACE There's hardly any hardware design effort required for the controller and transport interface in figure 6. Since the CM-600 is TTL compatible, it connects 1 eLoe~ 874'A 8041A XTAL' ~l .,,,, ~ eM-6OO vee vee SS L MOTOR POWER lOGIC POWER ~ !ill DATA OUT TEST1 WI! P24 p" PI1 P12 P13 P14 p" p" P25 P20 AD 00-07 OBF fI!F RESET EA VSS DIRECTION MOTION SPEED READ/WRITE CLEAR LEADER FILE PROTECT PRESENCE DATA IN r ~~":.~~~~~ ~,-L~"'''~ P21 DRIVE ACTIVE Figure 6. Controller/Transport System Schematic 6-1000 231314-001 I APPLICATIONS tions Interface, an 8253 Programmable Interval Timer, and an 8259A Programmable Interrupt Controller. The iSBC 80/30 is especially convenient for UPI development since it contains an uncommitted socket dedicated to either an 8041A or 8741A, complete with buffering for its I/O ports. The iSBC 80/30 to 8741A interface is reflected in figure 8. (Optionally, an iSBC 569 Digital Controller board could be used. The iSBC 569 board contains three uncommitted UPI sockets with an interface similar to that in figure 8.) Looking at the host-to-controller interface, the host sees the 8741A as three registers in the host's I/O address space: the data register, the command register, and the status register. The decoding of these registers is shown in figure 7. All data and commands for the controller are written into the Data Bus Buffer Input register (DBBIN). The state of the register select input, AO, determines whether a command or data is written. (Writes with AO set to 1 are commands by convention.) All data and results from the controller are read by the host from the Data Bus Buffer Output register (DBBOUT). Cs R5 WR 0 0 0 0 I 0 0 I I x I I 0 0 X AO Register a DBBOUT I STATUS The Status register contains flags which give the host the status of various operations within the controller. Its format is given in figure 8. The Input Buffer Full (IBF) and Output Buffer Full (OBF) flags show the Status of the DBBIN and DBBOUT registers respectively. IBF indicates when the' DBBIN register contains data written by the host. The host may write to DBBIN only when IBF is O.. Likewise, the host may read DBBOUT only when OBF is set to a 1. These bits are handled automatically by the UPI-41A internal hardware. FLAG 0 (F 0) and FLAG 1 (F 1) are general purpose flags used internally by the controller which have no meaning externally. The remaining four bits are user-definable. For this application they are DRIVE ACTIVE, FILE PROTECT, CASSETTE PRESENCE, and BUSY flags. The FILE PROTECT and CASSETTE PRESENCE flags reflect the state of the corresponding I/O lines from the transport. DRIVE ACTIVE is set whenever the transport motor is on and the controller is performing an operation. The BUSY flag indicates whether the contents of the DBBOUT register is dataor a result code. The BUSY flag is set whenever a command is issued by the host and accepted by the controller. As long as BUSY is set, any character found in DBBOUT is a result code. Thus whenever the host finds OBF set, it should test the BUSY flag to determine whether the character is data or a result code. a DBBIN (DATA) I DBBIN (COMMAND) X NONE Figure 7. 8741A/8041A Interface Register Decoding STATUS OBF-OUTPUT BUFFER FULL ISf-INPUT BUFFER FULL FO-FLAG a L -_ _ _ F1-FLAG 1 l~~§~~~~DRIVE FilE PROTECT ACTIVE CASSETTE PRESENCE BUSY Figure 8. Status Register Bit Definition Notice the OBF and IBF are available as interrupt outputs to the host processor, figure 6. These outputs are self-clearing, that is, OBF is set automatically upon the controller loading DBBOUT and cleared automatically by the host reading DBBOUT. Likewise IBF is cleared to a 0 by the host writing into DB BIN: set to a 1 when the controller reads DBBIN into the accumulator. The flow charts of figure 9 show the flow of sample host software assuming a polling software interface between the host and the controller. The WRITE command requires two additional count bytes which form the 16-bit byte count. These extra bytes are "handshaked" into the controller using the IBF flag in the STATUS register. Once these bytes are written, the host writes data in response to IBF being cleared. This continues until the host finds OBF set indicating that the operation is complete and reads the result code from DBBOUT. No testing of BUSY is needed since only the result code appears in the DB BOUT register. . The READ command does require that BUSY be tested. Once the READ command is written into the 6-1001 231314-001 APPLICATIONS controller, the host must test BUSY whenever OBF is set to determine whether the contents of DBBOUT is data from the tape or the result code. THE CONTf:lOLLER SOFTWARE The UPI-41A software to control the cassette can be divided up into various commands such as WRITE, READ and ABORT. In a previous version of this application note (May 1980), software was described that implemented these commands. This code however did not adequately compensate for speed variations of the motor during record and playback nor for data distortion caused by the magnetic media. Since then, new code has been written to include these effects. This revised software is now available through the INTEL User's Library, INSITE. For more information on this software or INSITE, contact your local INTEL Sales Office. 6-1002 231314-001 June 1985 Applications Using the 8042 UPI™ Microcontroller 1. The 8042 in the IBM PC/AT 2. Using the 8042 vs. using microcontrollers 3. Custom serial protocol with the 8042 Joe Froelich ©Intel Corporation, 1985 Order Number: 231600-001 6-1003 8042 UPI™ MICROCONTROLLER APPLICATION #1 THE 8042 UPI™ MICROCONTROLLER IN THE IBM PC/AT The following example is an important application of UP Is but there are many more. It is truly a universal device that can be customized to all those "non-standard" peripheral control problems. Applications are limited only by imagination. Think UPIs for non-standard peripherals!! IBM PC/AT (BEFORE) ... ... IBM PC/AT (AFTER) KEYBOARD KEYBOARD NEW FUNCTIONS THE FUTURE IS THE KEY The 8042 also brings new functions to the PC/AT: Modifications and upgrades are easy because of the 8042's programmable flexibility and power: • • • • • • • Keyboard lockup security (front panel key) CRT type input to the system Diagnostics/ self testing of keyboard interface Parity check and retry PC and PCIAT keyboard interchangeability Reset CPU to compatible mode Address wrap-around" protect in compatible mode • • • Change keyboard scan codes (in 8042 ROM) Increase functionality of keyboard interface through software andlor unused 110 lines on 8042 Control other PC/ AT functions with these 1/0 lines Summary In short, IBM used the 8042 since it: • • • • Offloads housekeeping details from the CPU Facilitates modular system design Offers a customized peripheral Provides a clean, efficient upgrade path These benefits can apply to many of your applications also. 6-1004 8042 UPI™ MICROCONTROLLER APPLICATION #2 USING THE 8042 VS. USI~G MICROCONTROLLERS PROBLEM WHY THE SWITCH What do you do when you're making SBX and VME modules for a voice digitizing board and you need: After studying the four requirements for this module, it is easy to see why they switched. The first two (AI D interface and 12 MHz) were met by both solutions. However, it is clear the second alternative is much better on board space and on overall cost. There are fewer chips, so they could avoid a multi-layer board and thus save a lot in total cost. Actual chip costs are 'within 10% of each other (a typical microcontroller like a Z8 or 6801 plus 2 latches compared to an 8042), and they do the same thing. I) 2) 3) 4) an interface to an AI D Converter with 12 MHz operation, an absolute minimum chip count, and very low cost (for the PC market). A leading vendor was faced with exactly this problem. Here is what they started with, and the bottom figure shows how they improved things with the 8042 UPI'· microcontroller. SOLUTION BEFORE .. . SYSTEM WHAT'S THE DIFFERENCE People tend to think of microcontrollers whenever there is a "non-standard" device to control. CRTs, disk drives and DRAMs all have dedicated controllers, but printers, front panels, displays and keyboards don't, because they are all "non-standard" devices. Microcontrollers can be customized to these applications. The problem is when the device is a "slave" or a peripheral, regular microcontrollers need the extra circuitry shown previously. That's why we invented U PIs. They are simply microcontrollers with the slave interface built in. They are, therefore, more efficient to use in peripheral,-type configurations. UPI SLAVE INTERFACE MICROPHONE AFTER .. . SYSTEM MICROCONTROLLER UPls may be misunderstood because of the funny name. They shouldn't ,be. It's really simple. When faced with non-standard device control, think microcontrollers. MICROPHONE If it's a master-only configuration, think regular microcontrollers. If it's a slavel peripheral configuration, think IJ Pls. The 8042 integrates two latches and the microcontroller into a single-chip solution. 6-1005 inter 8042 UPI™ MICROCONTROLLER APPLICATION #3 CUSTOM SERIAL PROTOCOL WITH THE 8042 UPI™ MICROCONTROLLER BACKGROUND The 8042 UPI Microcontroller, because of its programmability is being used everywhere, and here is another example. A leading board vendor was designing a communications concentrator board. They wanted a way to: I) 2) 3) 4) interface 8 serial channels to a minicomputer bus operate these at 4800 baud use one board provide a custom serial protocol that - communicated commands and data packets - assembled the data packets - provided handshaking signals - checked for framing, timing, parity, noise, modem and synchronization errors - provided self-test diagnostics THE 8042 SOLUTION There certainly wasn't an "off-the-shelf" chip that would satisfy the above requirements, and using the main CPU would have caused tremendous system performance ·degradation. They needed all of these features to offer a competitive product, so they looked to the 8042 UPI Microcontroller. Since the speed requirements were not too great (4800 baud), they could implement the protocol in software. The 8042's programmability gave them all the flexibility needed to incorporate the formatting, handshaking and error checking desired. Moreover, the on-chip slave interface made communication with the minicomputer's bus a snap. SUMMARY In short, the 8042 allowed this company to implement a custom serial communication protocol that in turn allowed them to offer a customized, competitive interface board to their customers. ,Don't some of your applications need customized interfaces? 6-1006 in1er • ICE™ -42 8042 IN-CIRCUIT EMULATOR Precise, full-speed, real-time emulation Load, drive, timing characteristics Full-speed program RAM Parallel ports Data Bus • User-specified breakpoints • Execution trace User-specified qualifier registers Conditional trigger Symbolic groupings and display Instruction and frame modes • • Full symbolic debugging • Single-line assembly and disassembly for program instruction changes • Macro commands·and conditional block constructs for automated debugging sessions • HELP facility: ICETM-42 command syntax reference at the console • User confidence test of ICETM-42 hardware Emulation timer The ICe M -42 module resides in the Intellec Microcomputer Development System and interfaces to any user-designed 8042 or 8041 A system through a cable terminating in an 8042 emulator microprocessor and a pin-compatible plug. The emulator processor, together with 2K bytes of user program RAM located in the ICE-42 buffer box, replaces the 8042 device in the user system while maintaining the 8042 electrical and timing characteristics. Powerfullntellec debugging functions are thus extended into the user system. USing the ICE-42 module, the designer can emulate the system's 8042 chip in real-time or single-step mode. BreakpOints allow the user to stop emulation on user-specified conditions, and a trace qualifier feature allows the conditional collection of 1000 frames of trace data. USing the single-line 8042 assembler the user may alter program memory using the 8042 assembler mnemonics and symbolic references, without leaving the emulator environment. Frequently used command sequences can be combined into compound commands and identified as macros with userdefined names. ©INTEL CORPORATION. 1983 6-1007 MAY 1983 ORDER NUMBER: 210818-002 inter ICE™ -42 IN-CIRCUIT EMULATOR 8042 microcomputer. Thus, the ICE-42 module provides the ability to debug a prototype or production system at any stage in its development without introducing extraneous hardware or software test tools. FUNCTIONAL DESCRIPTION Integrated Hardware and Software Development Symbolic Debugging The ICE-42 emulator allows. hardware and software development to proceed interactively. This approach is more effective than the traditional . method of independent hardware and software development followed by system integration. With the ICE:42 module, prototype hardware can be added to the system a~ it is designed. Software and hardware integration occurs while the product is being developed. Figure 1 shows the ICE-42 emulator connected to a user prototype. The ICE-42 emulator assists four stages of development: SOFTWARE DEBUGGING This emulator operates without being connected to the user's system before any of the user's hardware is available. In this stage ICE-42 debugging capabilities can be used in conjunction with the Intellec text editor and 8042 macroassembler to facilitate program development. The ICE-42 emulator permits the user to define and to use symbolic, rather than absolute, references to pr·ogram and data memory addresses . Thus, there is no need to recall or look up the addresses of key locations in the program, or to . become involved with machine code. When a symbol is used formemory reference in an ICE-42 emulator command, the emulator supplies the corresponding location as stored in the ICE-42 emulator symbol ta.ble. This table can be loaded with the symbol table produced by the assembler during application program assembly. The user obtains the symbol table during software preparation simply by using the "DEBUG" switch in the 8042 macroassembler. Furthermore, the user interactively modifies the emulator symbol table by adding new symbols or changing or deleting old ones. This feature provides great flexibility in debugging and minimizes the need to work with hexadecimal values. Through symbolic references in' combination with other features of the emulator, the user can easily: HARDWARE DEVELOPMENT The ICE-42 module's precise emulation characteristics and full-speed program RAM make it a valuable tool for debugging hardware. SYSTEM INTEGRATION Integration of software and hardware begins when any functional element of the user system hardware is connected to the 8042 socket. As each section of the user's hardware is completed, it is added to the prototype. Thus, each section of the hardware and software is "system" tested in real-time operation as it becomes available. SYSTEM TEST When ·the user's prototype is complete, it is tested with the final version of the user system software. The ICE-42 module is then used for real-time emulation of the 8042 chip to debug the system as a completed unit. The final product verification test may be 'performed using the 8742 EPROM version of the • Interpret the results of emulation activity collected during trace. • Disassemble program memory to mnemonics, or assemble mnemonic instructions to executable code. • Reference labels or addresses defined in user program. Ii Automated Debugging and Testing MACRO COMMAND A macro is a set of commands given a name. A group of commands executed frequently can be defined as a macro. The user executes the group of commands by typing a colon followed by the macro name. Up to ten parameters may be passed to the macro. Macro commands can be defined at the beginning of a debug session and then used throughout the whole session. One or more macro definitions can be saved on diskette for later use. The Intellec text editor may be used to edit the macro file. The macro definitions are easy to include in any later emulation session. 6-1008 210818-002 intel' ICETM_42 IN-CIRCUIT EMULATOR The power of the development system can applied to manufacturing testing as well development by writing test sequences macros. The macros are stored on diskettes use during system test. be as as for Table 1 Major Emulation Commands Command GO Begins real-time emulation and optionally specifies break conditions. BRO, BR1, BR Sets or displays either or both Breakpoint Registers used for stopping real-time emulation. STEP Performs single-step emulation: QRO, QR1 Specifies match conditions for qualified trace . TR Specifies or displays trace-data collection conditions and optionally sets Qualifier Register (QRO, QR1). Synchronization Line Commands Sets and displays status of synchronization line outputs or latched inputs. Used to allow real-time emulation or trace to start and stop synchronously with external events. COMPOUND COMMAND Compound commands provide conditional execution of commands (IF command) and execution of commands repeatedly until certain conditions are met (COUNT, REPEAT commands). Compound commands may be nested any number of times, and may be used in macro commands. Example; "DEFINE .1 =0 "COUNT 100H .*IF .1 AND 1 THEN .. "CBYTE.I=.I ..*END .* .1-.1 + 1 .*END ; Define symbol.1 to 0 ; Repeat the following commands 1OOH times. ; Check If .1 is odd ; Fill the memory at location .1 to value .1 ; Increment.1 by 1. ; Command executes upon carriage-return after END (The asterisks are system prompts; the dots indicate the nesting level of compound commands.) Operating Modes The ICE-42 software is an Intellec RAM-based program that provides easy-to-use commands for initiating emulation, defining breakpoints, controlling trace data collection, and displaying and controlling system parameters. ICE-42 commands are configured with a broad range of modifiers that provide maximum flexibility in describing the operation to be performed. EMULATION The ICE-42 module can emulate the operation of prototype 8042 system, at real-time speed (up to 12M Hz) or in single steps. Emulation commands to the ICE-42 module control the process of setting up, running, and halting an emulation of the user's 8042-based system. Breakpoints and tracepoints enable the ICE-42 emulator to halt emulation and provide a detailed trace of execution in any part of the user's program. A summary of the emulation commands is shown in Table 1. Description Breakpoints The ICE-42 hardware includes two breakpOint registers that allow halting of emulation when specified conditions are met. The emulator continuously compares the values stored in the breakpoint registers with the status of specified address, opcode, operand, or port values, and halts emulation when this comparison is satisfied. When an instruction initiates a break, that instruction is executed completely before the break takes place. The ICE-42 emulator then regains control of the console and enters the interrogation mode. With the breakpoint feature, the user can request an emulation break when the program: 6-1009 • Executes an instruction at a specific address or within a range of addresses. 210616-002 inter ICE™ -42 IN-CIRCUIT EMULATOR tionally or unconditionally. Two unique trace qualifier registers, specified in the same way as breakpoint registers, govern conditional trace activity. The qualifiers can be used to condition trace data collection to take place as follows: • Executes a particular opcode. • Receives a specific signal on a port pin. • Fetches a particular operand from the user program memory. • Fetches an operand from a specific address in program memory. • Under all conditions (forever), • Only while the trace qualifier is satisfied. • For the frames or instructions preceding the time when a trace qualifier is first satisfied (pre-trigger trace), Trace and Tracepoints Tracing is used with real-time and single-step emulation to record diagnostic information in the trace buffer as a program is executed. The infor. malion collected includes opcodes executed, port values, and memory addresses. The ICE-42 emulator collects 1000 frames of trace data. • For the frames or instructions after a trace qualifier is first satisfied (post-triggered trace) . Table 2 shows an example of trace display. If desired this information can be displayed as assembler instruction mnemonics for analysis during interrogation or Single-step mode. The trace-collection facility may be set to run condi- INTERROGATION AND UTILITY Interrogation and utility commands give convenient access to detailed information about the Table 2 Trace Display (Instruction Mode) FRAME 0000: 0004: 0008: 0012: 0014: 0016: 0018: 0022: 0026: .LOOP 0030: 0032: 0034: 0036: 0038: ·LOOP 0042: 0044: 0046: 0048: 0050: .LOOP 0054: 0056: 0058: 0060: 0062: '0066: Pl P2 TO T1 100H 2355 102H 39 lO3H 3A lO4H 22 lO5H 37 106H 02 lO7H BA03 109H . B840 lOSH B91Hl LOC OBJ MOV OUTL OUTL IN CPL OUT MOV MOV MOV INSTRUCTION A,#55H Pl,A P2,A A,DBB A DBB,A R2,#03H RO,#.TABLEO Rl,#.TABLEl FFH FFH 55H 55H 55H 55H 55H 55H 55H FFH FFH FFH 55H 55H 55H 55H 55H 55H 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 loDH 10EH 10FH 110H l11H Fo Al 18 19 EAoD MOV MOV INC INC DJNZ A,@Ro @Rl,A Ro Rl R2, .LOOP 55H 55H 55H 55H 55H 55H 55H 55H 55H 55H 0 0 0 0 0 0 0 0 0 0 lODH 10EH 10FH 110H l11H FO Al 18 19 EAOD MOV MOV INC INC DJNZ A ,@RO @Rl,A RO Rl R2, .LOOP 55H 55H 55H 55H 55H 55H 55H 55H 55H 55H 0 0 0 0 0 0 0 0 0 0 lODH loEH 10FH 110H l11H 113H FO Al 18 19 EAOD 00 NOV NOV INC INC DJNZ NOP A,@RO @Rl,A RO Rl R2, .LOOP 55H 55H 55H 55H 55H 55H 55H 55H 55H 55H 55H 55H 0 0 0 0 0 0 0 0 0 0 0 0 6-1010 DBYIN 66H 66H 66H 66H YOUT YSTS TOVF DFH DFH DFH DF.H 66H 66H 66H 66H 99H 99H 99H 99H 66H 99H 66H 66H 99H 99H 66H 99H 66H 66H 99H 99H 66H 99H 66H 66H 99H 99H 02H o2H o2H o2H o2H DOH DOH 01H 01H 0 0 0 0 0 0 0 0 0 olH olH olH olH 01H 0 0 0 0 0 01H 01H olH 01H 01H 0 0 0 0 0 olH 01H 01H 01H 01H 01H 0 0 0 0 0 0 210818-002 ICETM_42 IN-CIRCUIT EMULATOR user program and the state of the 8042 that is useful in debugging hardware and software. Changes can be made in memory and in the 8042 registers, flags, and port values. Commands are also provided for various utility operations such as loading and saving program files, defining symbols, displaying trace data, controlling system synchronization and returning control to ISIS-II. A summary of the basic interrogation and utility commands is shown in Table 3. Two additional time-saving emulator features are discussed below. Single-Line Assembler/Disassembler The single-line assembler/disassembler (ASM and DASM commands) permits the designer to examine and alter program memory using assembly language mnemonics, without leaving the emulator environment or requiring timeconsuming program reassembly. When assembling new mnemonic instructions into program memory, previously defined symbolic references (from the original program assembly, or subsequently defined during the emulation session) Table 3 Major Interrogation and Utility Commands Command Description HELP Displays help messages for ICE-42 emulator command-entry assistance. LOAD Loads user object program (8042 code) into user-program memory, and user symbols into ICE-42 emulator symbol table. SAVE Saves ICE-42 emulator symbol table and/or user object program in ISIS-II hexadecimal file. LIST Copies all emulator console input and output to ISIS-II file. EXIT Terminates ICE-42 emulator operation. DEFINE Defines ICE-42 emulator symbol or macro. REMOVE Removes ICE-42 emulator symbol or macro. ASM Assembles mnemonic instructions into user-program memory. DASM Disassembles and displays user-program memory contents. Change/Display Commands Change or display value of symbolic reference in ICE-42 emulator symbol table, contents of key-word references (including registers, I/O ports, and status flags), or memory references. EVALUATE Evaluates expression and displays resulting value. MACRO Displays ICE-42 macro or macros. INTERRUPT Displays contents for the Data Bus and timer interrupt registers. SECONDS Displays contents of emulation timer, in microseconds. Trace Commands Position trace buffer pOinter and select format for trace display. PRINT Displays trace data pOinted to by trace buffer pointer. MODE Sets or displays the emulation mode, 8041 A or 8042. 6-1011 210818-002 ICE™ -42 IN-CIRCUIT EMULATOR Table 4 HELP Command *HELP Help is available for the following items. Type HELP followed by the item name. The help items cannot be abbreviated. (For more information, type HELP HELP, or HELP INfO. ) Emulation: Trace Collection: Mi sc: TR QR QRO QR1 SY1 BASE GO GR SYO BR BROBR1 DISABLE STEP Trace Display: ENABLE TRACE MOVE PRINT ERROR < identi fier> OLDEST,NEWEST EVALUATE < instruction> HELP < maske d#cons ta nt > Change! Display! Define! Remove: INFO REMOVE CBYTE < numer i c $c ons tant > SYMBOL DBYTE DASM LIST REGISTER RESET ASM LOAD MODE SECONDS WRITE' SAVE DEFINE STACK SUFFIX SY SYMBOLIC Macro: Compound < trace $re ference > DEFINE DIR Commands: < unl i mi ted$matc h$cond > DISABLE ENABLE COUNT INCLUDE PUT IF REPEAT < MACRO$INVOC ATION > * * *HELP IF IF - The conditional command allows conditional execution of one or more commands based on the values of boolean condi tions. IF '.THEN : :=' @ ;;=' @ 'ORIF <;.cr> : :=An ICE-42 command· @ 'ELSE END The s are evaluated in order as 16-bit unsigned ,integers. If one is reached whose value has low-order bit 1 (TRUE), all commands in the following that are then executed and all commands in the other s and in the < false$list> are skipped. I f ,all s have value with loworder bit 0 ( FA LS E ) , the naIl com man d sin all < t rue $1 is t > s are ski pp e d and, i f ELSE is present, all commands in the are executed. (EX: IF .LOOP=5 THEN STEP ELSE GO END) * * * * *EXIT 6-1012 210818-002 inter ICETM_42 IN-CIRCUIT EMULATOR may be used in the instruction operand field. The emulator supplies the absolute address or data values as stored in the emulator symbol table. These features eliminate user time spent translating to and from machine code and searching for absolute addresses, with a corresponding reduction in transcription errors. HELP The HELP file allows display of ICE-42 command syntax information at the Intellec console. By typing "HELP", a listing of all items for which help messages are available is displayed. Typing "HELP < Item>" then displays relevant information about the item requested, including typical usage examples. Table 4 shows some sample HELP messages. speed, timing characteristics, load and drive values, and crystal operation. However, the emulator may draw more power from the user system than a'standard 8042 family device. Additional emulator processor pins provide signals such as internal address, data, clock, and control lines to the emulator buffer box. These signals let static RAM in the buffer box substitute for on-chip program ROM or EPROM. The emulator chip also gives the ICE module "back-door" access to internal chip operation, allowing the emulator to break and trace execution without interfering with the values on the user-system pins. EMULATION ACCURACY The speed and interface demands of a highperformance single-chip microcomputer require extremely accurate emulation, including fullspeed, real-time operation with the full function of the microcomputer. The ICE-42 module achieves accurate emulation with an 8042 emulator chip, a special configuration of the 8042 microcomputer family, as its emulation processor. Each of the 40 pins on the user plug is connected directly to the corresponding 8042 pin on the emulator chip. Thus the user system sees the emulator as an 8042 microcomputer at the 8042 socket. The resulting characteristics provide extremely accurate emulation of the 8042 including. Figure 1 A Typical 8042 Development Configuration. The hOst system is an Inteliec Series IV. The ICE-42 module is connected to a user prototype system. SPECIFICATIONS • Crystal power accessory ICETM-42 Operating Requirements • Operating instructions manuals • Diskette-based ICE-42 software (single and double density) Inteliec Model 800, Series Ii, Series iii, or Series IV Microcomputer Development SYstem (64K RAM required) Emulation Clock System console (Model 800 only) Inteliec Diskette Operating (Version 3.4 or later). System: ISIS Equipment Supplied User's system clock (up to 12MHz) or ICE-42 crystal power accessory (12 MHz) Environmental Characteristics • Printed circuit boards (2) Operating Temperature - 0° to 40°C • Emulation buffer box, Intellec interface cables, and user-interface cable with 8042 emulation processor Operating Humidity - Up to 95% relative humidity without condensation. 6-1013 . 210818-002 ICE™ -42 IN-CIRCUIT EMULATOR Physical Characteristics Electrical Characteristics Printed Circuit Boards DC Power Requirements (from Intellec® system) Width: 12.00 in. (30.48 em) Height: 6.75 in. (17.15 em) Depth: 0.50 in. (1.27 em) Vcc = Icc = V DD = IDD = Vss = Iss = Buffer Box Width: 8.00 in. (20.32 em) Length: 12.00 in. (30.48 em) Depth: 1.75 in. (4.44 em) Weight: 4.0 lb. (1.81 kg) +5V, ± 5% 13.2A max; 11.0A typical +12V, ±5% 0.1 A max; 0.05A typical -10V, ±5% 0.05A max; 0.01 A typical User plug characteristics at 8042 socket Same as 8042 or 8742 except that the user system sees an added load of 25 pF capacitance and 50ILA leakage from the ICE-42 emulator user plug at ports 1,2, TO, and T1. ORDERING INFORMATION Part Number Description ICE-42 8042 M icrocontroller In-Circuit Emulator, cable assembly and interactive diskette software 6-1014 210818-002 MCS@-48 DISKETTE·BASED SOFTWARE SUPPORT PACKAGE • Extends Intellec microcomputer development system to support MCS-48 development • MCS-48 assembler provides conditional assembly and macro capability • Takes advantage of powerful ISIS-II file h'andling and storage capabilities • Provides assembler output in standard Intel hex format The MCS-48 assembler translates symbolic 8048 assembly language instructions into the appropriate machine operation codes, and provides both conditional and macroassembler programming. Output may be loaded either to an ICE-49 module for debugging or into the iUP Universal PROM Programmer for 8748 PROM programming. The MCS-48 assembler operates under the ISIS-II operating system on Intel Development systems. ©INTEL CORPORATION, 1983. MAY 1983 6-1015 Order Number: 231323-001 intJ MCS·48 Table 1. Sample MCS·48 Diskette·Based FUNCTIONAL DESCRIPTION The MCS-48 assembler translates symbolic 8048 assembly language instructions Into the appropriate machine operation codes. The ability to refer to program addresses with symbolic names eliminates the errors of hand translation and makes it easier to modify programs when adding or deleting instructions. Conditional assembly permits the programmer to specify which portions of the master source document should be included or deleted in variations on a basic system design, such as the code required to handle optional external devices. Macro capability allows the programmer use of a single label to define a routine. The MCS-48 assembler will assemble the code required by the reserved routine whenever the macro label Is Inserted in the text. Output from the assembler Is in standard Intel hex format. It may be either loaded directly to an In-circuit emulator (ICE-49) module for integrated hardware/software debugging, or loaded into the iUP Universal PROM Programmer for 8748 PROM programming. A sample assembly listing is shown in Table 1. PAGEl 151$·118048 MACROASSEMBLER. VI ,0 LOC SOURCE STATEMENT OBJ :DECIMAL ADDITION ROUTINE, ADO BCD NUMBER .. 5 a , "" 0001 7 INIT 9 " " 00'"" 00' 0002 ;AT LOCATION 'SETA' TO BCD NUMBER AT 'ALPHA' WITH .RESULT IN "ALPHA: LENGTH OF NUMBER IS 'COUNT' DIGIT :PAIRS IASSUME BOTH BETA ANO Alf'HA ARE SAME LENGTH ;o\NO HAVE EveN NUMBER OF DIGITS OR MSO 150 IF AUGNO,AOONO,CNT RO.• AUGNO Rl, 'AOONO R2.ICNT 13 Alf'HA EOU '4 15 16 17 8ETA COUNT EOU EOU ORG INIT 30 ," '00" 0100 self lS+ MQV 0102 0104 8928 BAJ2 19+LI 20+ MOV Mav ALPHA, BETA. COUNT RO .• ALPHA Rl .• BeTA R2.• COUNT 0106 91 21 elR C A, REPEAT ALTER UTILtTY GROUP DISPLAY PRINT QUEUE HELP MAP BLANKCHECK OVERLAY TYPE INITIALIZE WORKFILES BUFFER GROUP SUBSTITUTE LOAD DATA VERIFY .. CONTROLS EXECUTION OF THE iPPS SOFTWARE. Exits the iPPS software and returns control to the ISIS operating system. Terminates the current command. Repeats the previous command. Edits and re-executes the previous command. DISPLAYS USER INFORMATION AND STATUS AND SETS DEFAULT VALUES. Displays PROM, buffer, or file data on the console. Prints PROM, buffer, or file data on the local printer. Prints PROM, buffer, or file data on the network spooled printer. Displays user assistance information. Displays buffer structure and status. Checks for unprogrammed PROMs. Checks whether non-blank PROMs can be programmed. Selects the PROM type. Initializes the default number base and file type. Specifies the drive device for temporary work files. EDITS, MODIFIES, AND VERIFIES DATA IN THE BUFFER. Examines and modifies buffer data. Loads a section of the buffer with a constant. Verifies data in the PROM with buffer data. ~ FORMATTING GROUP FORMAT REARRANGES DATA FROM THE PROM, BUFFER, OR FILE. Formats and interleaves buffer, PROM, or file data. COPY GROUP COPY (file to PROM) COPY (PROM to file) COPY (buffer to PROM) COpy (PROM to buffer) COPY (buffer to file) COpy (file to buffer) COPY (file to URAM) COPY (URAM to file) COPY (buffer to URAM) COpy (URAM to buffer) COPIES DATA FROM ONE DEVICE TO ANOTHER. Programs the PROM with data in a file on disk. Saves PROM data in a file on disk. Programs the PROM with data from the buffer. Loads the buffer with data in the PROM. Saves the contents of the buffer in a file on disk. Loads the buffer from a file on disk. Loads file data into the iUP RAM (iUP-201 A model only). Saves iUP URAM data in a file on disk (iUP-201 A model only). Loads the buffer into the iUP URAM (iUP-201 A model only). Loads iUP URAM data into the buffer (iUP-201 A model only). SECURITY GROUP LOCKS SELECTED DEVICES TO PREVENT UNAUTHORIZED ACCESS. Locks the PROM from unauthorized access. KEYLOCK 6-1020 Order Number: 210319-003 iUP 200A/iUP 201 A System Expansion Off-line commands are entered using the off-line command keys summarized in Table 2.- The iUP-200A universal programmer can be easily upgraded (by the user) to an iUP-201 A universal programmer for off-line operation. The upgrade kit (jUP-PAK-A) is available from Intel or yourlocallntel distributor. Off-line System In addition to the hardware components included as part of the iUP-200A, the iUP-201 A contains a 24-character alphanumeric display, full hexadecimal 12-function keypad, and 32K bytes of iUP RAM. Figure 3 illustrates the iUP-201 A keyboard and display. The iUP-201 A universal programmer has all the on-line features of the iUP-200A universal programmer plus off-line editing, PROM duplication, program verification, and locking of PROM memory independent of the host system. The iUP-201A universal programmer also accepts Intel hexadecimal programs developed on non-Intel development systems. Just a few keystrokes download the program into the iUP RAM for editing and loading into a PROM. The two logical devices accessible during offline operation are the PROM device and the iUP RAM. A typical operation is copying the data from a PROM (or ROM) into the iUP RAM, modifying this data in iUP RAM, and programming the modified data back into a PROM device. The address range of the iUP RAM is automatically determined by the universal programmer when PROM type selection is made. Figure 4 shows the off-line system data flow. I frup READY Ii. ss 000000 COMMAND ADDRESS I DATA _________ ~~---------_--------~~--L-~ --~-- .-~-----------,.----,--.-- ~ D· , T ; E R I © POWER 0157 Figure 3 iUP-201 A Keyboard and Display 6-1021 Order Number: 210319-003 iUP 200A/iUP 201 A Table 2 Off-Line Command Keys Summary Function Key : ~ ON : .LlNE .. . . .... . , : : DEVICE : SELECT p ~ B : [!] ROM TO : :~~~. B E N T E :· B :· B Selects the PROM type when using a personality module able to program multiple PROM devices. Verifies the contents of the installed PROM device with the contents of the iUP RAM. The universal programmer display indicates the address and the XOR of any mismatches. Performs (I device blank check and then programs the target PROM with data from the iUP RAM. If the blank check fails, pressing PROG again performs an overlay check to verify that non-blank PROMs can be programmed. Loads the iUP RAM with the data from the PROM device installed in the personality module. Terminates the current off-line function, clears a user entry, or restores the display after an error. Transfers information from the universal programmer display (addresses, data, or baud rate) into the iUP RAM. " [!]:. ·: SHIFT .: ADDR 0 ~ ............. ~ ........... . ---·: SHIFT Selects either on-line or off-line operation. When on-line, all other function keys are disabled. [!]: : DATA Selects an address field for display. . 1 Selects a data field for keypad editing and entry. : ~ ............. . FILL 2 Loads a contiguous section of iUP RAM locations with a constant. ;.......... .. · . ·: SHIFT : LOAD Downloads Intel hexadecimal data from any development system which has an RS-232C port. ,~ ........... . Bm · ffi B i ..... ,....... ·: SHIFT ~ ............. . 3 :: ........... . ~---- SrI] Locks a PROM from unauthorized access. 6-1022 Order Number: 21 0319~003 iUP 200A/iUP 201 A UNIVERSAL PROGRAMMER (lUP·201 A) PERSONALITY MODULE PROM DEVICE(S) I , / ' UNIVERSAL PROGRAMMER FIRMWARE ~ (MANUAL FRONT ' - PANEL CONTROL) . / I- -----1 I--- IUp·201 A URAM RS·232 INTERFACE HOST SYSTEM (OPTIONAL) 0027 Figure 4 Off· Line System Data Flow SYSTEM DIAGNOSTICS PERSONALITY MODULES Both the iUp·200A and iUP-201A universal programmers include self-contained system diagnostics that verify system operation and aid the user in fault isolation. Diagnostics are performed on the power supply, CPU internal firmware ROM, internal RAM, timer, the iUP-201A keyboard, and the iUP RAM. In addition, tests are made on any personality module installed in the programmer the first time the module is accessed. The personality module tests include the power select circuitry and up to 4K of module firmware. Straight-forward messages are provided on the development system display in on-line mode and on the iUP-201 A display in off-line mode. A personality module is the interface between the iUP-200A/iUP-201A universal programmer (or an iPDS system) and a selected PROM (or ROM). Personality modules contain all the hardware and firmware for reading and programming a family of Intel devices. Each personality module is a single molded unit inserted into the front panel of the universal programmer. No additional adapters or sockets are needed. Table 3 lists the available personality modules. Each personal'ity module connects to the universal programmer through a 41-pin connector. Module firmware is uploaded into the iUP RAM and executed by the internal 8085A processor. Table 3 iUP Personality Modules Personality Module PROM Type iUP-Fast 27/K iUP-F27/128 iUP-F87151 A EPROM E 2/EPROM Microcontroller iUP-F87/44A Peripheral PROMs and ROMs Supported 2764,2764A,27128,27256 2716,2732,2732A,2764,27128,2815,2816 8748, 8748H, 8048, 8749H, 8048H, 8049, 8049H, 8050H,8751,8751H,8051 8741A,8041A,8742,8042,8744H,8044AH,8755A 6-1023 Order Number: 210319-003 inter iUP 200A/iUP 201 A The personality module firmware contains routines necessary to read and program a family of PROMs. In addition, the personality module sends specific information about the selected PROM to the universal programmer to help perform PROM device integrity checks. LEOs on each personality module indicate operational status. On some personality modules a column of LEOs indicate which PROM device type the user has selected. On .some personality modules an LEO below the socket indicates which socket is to be used. A red indicator light tells the user when power is Qeing supplied to the selected device. Figure 5 shOwS the personality mod ules ~supported on the universal programmer. In addition to the testing done by the iUP system self-tests, each personality module contains diagnostic firmware that performs selected PROM tests and indicates status. These tests are performed in both on-line and off-line modes. The PROM installation test verifies that the device is installed in the module correctly and that the ZIF socket is closed. The PROM blank check determines whether a device is blank. The universal programmer automatically determines whether the blank state is all zeros or all ones. The overlay check (performed when a PROM is not blank) determines which bits are programmed, compares those bits against the program to be loaded, and allows programming to continue if they match. As with the system self-tests, straight-forward messages are provided. The user can invoke all of the PROM device integrity checks except the installation test (which occurs automatically any time an operation is selected). Figure 6 illustrates a typical testing sequence. - :--, \~ ., ..... ". ' ' " Figure 5 Personality Modules 6-1024 Order Number: 210319-003 iUP 200A/iUP 201 A PERFORM BLANK CHECK NO YES PERFORM OVERLAY CHECK PROGRAM A LOCATION PERFORM VERIFY DISPLAY MESSAGE Figure 6 PROM Testing Sequence 6-1025 Order Number: 210319-003 iUP 200A/iUP 201 A iUP·200A/iUP·201 A SPECIFICATIONS Control Processor Intel 8085A microprocessor 6.144 MHz clock rate Memory RAM - 4.3 bytes static ROM - 12K bytes EPROM 164861 - iPPS PROM Programming Software User's Guide. 164853 - iPPS PROM Programming SoftwareliUP-200A1201A Universal Programmer Pocket Reference. PERSONALITY MODULE SPECIFICA TIONS Memory Interfaces EPROM - up to 4K bytes Keyboard - 16-character hexadecimal and 12function keypad (iUP-201 A model only) Display 24-character alphanumeric (iUP-201A model only) Physical Characteristics Software Monitor - system controller in pre-programmed EPROM iPPS -Intel PROM programming software on supplied diskette Physical Characteristics Depth Width ~ Height Weight - 15 inches (38.1 cm) 15 inches (38.1 cm) 6 inches (15.2 cm) 15 pounds (6.9 kg) Electrical Characteristics Selectable 100, 120, 200, or 240 Vac ± 10%; 50-60 Hz Maximum power consumption - 80 watts Environmental Characteristics Reading temperature - 10°C to 40°C Programming temperature - 25°C ± 5° Operating humidity - 10% to 85% relative humidity Width - 5.5 inches (1.4 cm) Height - 1.6 inches (4.1 cm) Depth - 7.0 inches (17.8 cm) Weight - 1 pound (.45 kg) Electrical Characteristics Maximum power consumption (module) - 7.5 watts Maximum power consumption (device) - 2.5 watts Maximum power consumption (total from iUP) 10watts Environmental Characteristics Reading temperature - 10°C to 40°C Programming temperature - 25°C ± 5° Operating humidity - 10% to 85% relative humidity Reference Material Appropriate personality module user's guide: 164376 162848 Reference Material 164855 164852 - 164853 iUP-200A1201A Universal Programmer User's Guide. iUP-Fast 271K Personality User's Guide. IUP-F271128 Personality User's Guide. iUP-F8 7151 A Personality User's Guide. iUP-F87144A Personality User's Guide. Module Module Module Module ORDERING INFORMATION Part number Description iUP-200A Intel on-line universal programmer iUP-Fast 27/K* EPROM personality module iUP-201A Intelon-line/off-line universal programmer iUP-F27/128 EPROM and E2PROM personality module 6-1026 Order Number: 210319-003 iUP 200A/iUP 201 A iUP-F87151 A Microcontrolier personality module iUP-F87/44A Peripheral personality module iUP-200/201 U 1 Upgrade Kit Upgrades an iUP-200/201 universal programmer to an iUP-200Al201 A universal programmer iUP-PAK-A Upgrade Kit Upgrades an iUP-200A universal programmer to an iUP-201 A universal programmer 'The iUP-Fast 27/K personality module can be used only with an iUP-200A/201 A universal programmer or an iUP-200 liUP-201 universal programmer upgraded to an A with the iUP-200/201 U1 upgrade kit. If used in an iPDS, this personality module requires version 1.4 or later of the iPPS-iPDS software. All iPDS-140 units shipped after June 1984 will contain this software. 6-1027 Order Number: 210319-003 Video Display inter 8275H PROGRAMMABLE CRT CONTROLLER • Programmable Screen and Character Format • MCS-51®, MCS-85®, iAPX 86, and iAPX 88 Compatible • 6 Independent Visual Field Attributes • Dual Row Buffers • 11 Visual Character Attributes (Graphic Capability) • Programmable DMA Burst Mode • Cursor Control (4 Types) • Single + 5V Supply • Light Pen Detection and Registers • High Performance HMOS-II The Intel CHARACTER -----I--;~\-~~:::::j:==F~f"") GENERATOR, ~~,~ 03r SHIFT REGISTER 8275 HORIZ. LEFT HALF LAl VIDEO LAO PIPELINE VSP lTEN HalT Figure 22. Typical Character Attribute Logic 7-12 210464-002 8275H Table 2. Character Attributes Character attributes were designed to produce the following graphics: CHARACTER ATTRIBUTE CODE "CCCC" 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 ~Ol I 1110 1111 Above Underl ine Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underl ine Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underl ine Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline LA1 , : I 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ! 0 0 0 I OUTPUTS VSP LAo 1 0 0 1 0 0 0 0 .1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 1 0 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 SYMBOL LTEN 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 1 0 I L Bottom Left Corner ..--J Bottom Right Corner -r- Top Intersect -1 Right Intersect r- Left Intersect ~ Bottom Intersect --- Horizontal Line I + 1 0 0 Top Left Corner Top Right Corner I 0 0 0 0 DESCRIPTION Vertical Line Crossed Li nes 0 0 0 Not Recommended * 0 0 Special Codes Undefined Illegal I I I Illegal Undefined I Iund~fined 'Character Attribute Code 1011 is not recommended for normal operation. Since none of the attribute outputs are active, the character Generator will not be disabled, and an indeterminate character will be generated. Illegal Character Attribute Codes 1101, 1110, and 1111 are illegal. Blinking is active when B = 1. Highlight is active when H = 1. 7-13 210464-002 8275H Special Codes Four special codes are available to help reduce memory, software, or DMA overhead. character following the code up to, and including, the character which precedes the next field attribute code, or up to the end of the frame. The field attributes are reset during the vertical retrace interval. Special Control Character MSB 1 1 1 o 1 S S There are six field attributes: LSB Blink - Characters following the code are caused 1. 0 S S ~ SPECIAL CONTROL CODE to blink by activating the Video Suppression out· put (VSP). The blink frequency is equal to the screen refresh frequency divided by 32. FUNCTION 2. Highlight - 3. Reverse Video - Characters following the code are caused to appear with reverse video by activating the Reverse Video output (RVV). The End of Row Code (00) activates VSP and holds it to the end of the line. 4. The End of Row·Stop DMA Code (01) causes the DMA Control Logic to stop DMA for the rest of the row when it is written into the Row Buffer. It affects the display in the sa(l1e way as the End of Row Code (00). Underline - Characters following the code are caused to be underlined by activating the Light Enable output (L TEN). 5,6. General Purpose - There are two additional 8275 0 0 0 1 0 Characters following the code are caused to be highlighted by activating the High· light output (HGLT). End of Row End of Row·Stop DMA End of Screen End of Screen·Stop DMA outputs which act as general purpose, independ· ently programmable field attributes. GPA(J..1 are active high outputs. The E~d of Screen Code (10) activates VSP and holds it to the end of the frame. Field Attribute Code The End of Screen·Stop DMA Code (11) causes the DMA Control Logic to stop DMA for the rest of the frame when it is written into the Row Buffer. It affects the display in the same way as the End of Screen Code (10). MSB 'U RI TG G If the Stop DMA feature is not used, all characters after an End of Row .character are ignored, except for the End of Screen character, which operates normally. All characters after an End of Screen character are ignored. 1 Field Attributes i L- HIGHLIGHT L·---BLINK GENERAL PURPOSE L._ _ _ _ _ _ REVERSE VIDEO ' - - - - - - - - UNDERLINE H B R U GG Note: If a Stop DMA character is not the last character in a burst or row, DMA is not stopped until after the next character is read. In this situation, a dummy character must be placed in memory after the Stop OMA character. The field attributes are control codes which affect the visual characteristics for a field of characters, starting at the LSB 1 0 = 1 FOR HIGHLIGHTING = 1 FOR BLINKING = 1 FOR REVERSE VIDEO = 1 FOR UNDERLINE = GPA1, GPAO "More than one attribute can be enabled at the same time. If the blinking and reverse video attributes are enabled simultaneously, only the reversed characters will blink. 7-14 210464-002 8275H The 8275H can be programmed to provide visible or invisible field attribute characters. Each row buffer has a corresponding FIFO. These FIFOs are 16 characters by 7 bits in size. If the 8275H is programmed in the visible field attribute mode. all field attributes will occupy a position on the screen. They will appear as blanks caused by activation of the Video Suppression output (VSP). The chosen visual attributes are activated after this blanked character. When a field attribute is placed in the row buffer during DMA, the buffer input controller recognizes it and places the next character in the proper FIFO. ABC D E F G H I NOPORSTUV J When a field attribute is placed in the Buffer Output Controller during display, it causes the controller to immediately put a character from the FIFO on the Character Code outputs (CCo-6i. The chosen Visual Attributes are also activated. Since the FIFO is 16 characters long, no more than 16 field attribute characters may be used per line in this mode. If more are used, a bit in the status word is set and the first characters in the FIFO are written over and lost. K L M Note: Since the FIFO is 7 bits wide, the MSB of any characters put in it are stripped off. Therefore. a Visual Attribute or Special Code must not immediately follow a field attribute code. If this situation does occur, the Visual Attribute or Special 1 2 3 4 5 Code will be treated as a normal display character. 6 7 8 9 Figure 23. Example of the Visible Field Attribute Mode (Underline Attribute) If the 8275H is programmed in the invisible field attribute mode. the 8275H FIFO is activated. ABC D E F G H I J NOPORSTUV K L M ceLK 1 234 5 6 7 8 9 DATA 080_7 BUS CCO_6 BUFFER Figure 25. Example of the Invisible Field Attribute Mode (Underline Attribute) LCO_3 RD READ! WRITE! WRAO-- CO~~~OL W LOGIC LAO_l HATe vAle HLGT RVV LTEN VSP Field and Character Attribute Interaction GPAO_l Character Attribute Symbols are affected by the Reverse Video (RVV) and General Purpose (GPAO_l) field attri· butes. They are not affected by Underline, Blink or Highlight field attributes; however, these characteristics can be programmed individually for Character Attribute Symbols. LPEN Figure 24. Block Diagram Showing FIFO Activation 7-15 210464-002 8275H Cursor Timing . Device Programming The cursor location is determined by a cursor row register and a character position register which are loaded by command to the controller. The cursor can be programmed to appear on the display as: 1. 2. 3. 4. The 8275H has two programming registers, the Command Register (CREG) and the Parameter Register (PREG). Italso has a Status Register (SREG). The Command Register can only be written into and the Status Registers can only be read from. They are addressed as follows: a blinking underline a blinking reverse video block a non·blinking underline a non·blinking reverse video block AO The cursor blinking frequency is equal to the screen refresh frequency divided by 16. If a non-blinking reverse video cursor appears in a nonblinking reverse video field, the cursor will appear as a normal video block. OPERATION REGISTER 0 Read PREG 0 Write PREG 1 Read SREG 1 Write CREG The 8275H expects to receive a command and a sequence of oto 4 parameters, depending on the command. lithe proper If a non-blinking underline cursor appears in a non-blinking underline field, the cursor will not be visible. number of parameter bytes are not received before another command is given, a status flag is set, indicating an improper command. Light Pen Detection A light pen consists of a micro switch and a tiny light sensor. When the light pen is pressed against the CRT screen, the micro switch enables the light sensor. When the raster sweep reaches the light sensor, it triggers the light pen output. INSTRUCTION SET The 8275H instruction set consists of 8 commands. COMMAND If the output of the light pen is presented to the 8275H LPEN input, the row and character position coordinates are stored in a pair of registers. These registers can be read on command. A bit in the status word is set, indicating that the light pen signal was detected. The LPEN input must be a 0 to 1 transition for proper operation. Reset Start Display Stop Display Read Light Pen Note: Due to internal and external delays, the character position coordinate will be off by at least three character positions. NO. OF PARAMETER BYTES 4 o o Load Cursor 2 2 Enable Interrupt Disable Interrupt o o Preset Counters o In addition, the status of the 8275H (SREG) can be read by the CPU at any time. This has to be corrected in software. 7-16 210464-002 8275H 1. Reset Command: Parameter - UUUU DATA BUS OPERATION AO Command -- .- DESCRIPTION Write 1 Write a Write a Screen Camp Byte 2 Write a Screen Camp a Screen Camp Byte 4 Parameters Write Reset Command Screen Camp Byte 1 MSB LSB U U U U a a a a a 0 a a 0 5 H H H H H a a V V R R R R R R U U U M F C C Z Z Z Z H H 0 Byte 3 U L L L 0 1 2 0 16 Parameter L LLLL L L L Number of Lines per CharaCter Row NO. OF LINES/ROW 000 a a a 0 000 As parameters are written, the screen composition is defined. S LINE NUMBER OF UNDERLINE L Action - After the reset command IS written, DMA reo quests stop, 8275 interrupts are disabled, and the VSP output is used to blank the screen. HRTC and VRTC can· tinue to run. HRTC and VRTC timing are random on power·up. Parameter - S 0 0 0 0 Underline Placement Spaced Rows 16 FUNCTIONS o Normal Rows Spaced Rows Parameter - M M Parameter - HHHHHHH Horizontal Characters/Row H H H H H H H o Mode 0 (Non·Offsetl NO. OF CHARACTERS PER ROW a a a a a a a a a a a a a 1 a a a a a a 2 3 Line Counter Mode LINE COUNTER MODE Mode 1 (Offset by 1 Countl Parameter - F F Field Attribute Mode FIELD ATTRIBUTE MODE o Non-Transparent a a 1 1 1 1 a a a a a 1 V 80 Undefined 1 Undefined Parameter - VV V Transparent Parameter - CC C C o a a o Vertical Retrace Row Count 1 Cursor Format CURSOR FORMAT Blinking reverse video block Blinking underline Nonblinking reverse video block Nonblinking underling NO. OF ROW COUNTS PER VRTC a a o 2 3 4 a Parameter - ZZZZ Z Parameter - RRRRRR R R R R R R o a o 0 a 0 0 0 Vertical Rows/Frame NO. OF ROWS/FRAME Z Z Z a 0 a a a 0 0 0 0 0 Horizontal Retrace Count NO. OF CHARACTER COUNTS PER HATC 4 6 a a a a 0 000 32 64 "Note: uuuu MSB determines blan'king of top and bottom lines (1 = blanked, = not blanked!. a 7-17 210464-002 8275H 5. Load Cursor Position: 2. Start Display Command: DATA BUS iOPERATION Ao Write Command 1 1 DESCRIPTION MSB Start 0 isplay 0 0 DATA BUS LSB 1 S S S B B OPERATION AO 0 0 0 0 0 0 LSB 0 0 0 0 1 Load Cursor 1 Parameters Write Write 0 0 Char. Number Row Number {Char. Position in Rowl (Row Numbed BURST SPACE CODE 0 0 Write 0 0 Action - The 8275H is conditioned to place the next two parameter bytes into the cursor position registers. Status flags not affected. NO. OF CHARACTER CLOCKS BETWEEN DMA REQUESTS S S S MSB Command No parameters SSS DESCRIPTION 0 1 15 23 31 39 47 55 0 0 0 0 1 0 6. Enable Interrupt Command: DATA BUS Command 10PERATION AO OESCRIPTION MSB I Enable Interrupt 1 Write 1 0 LSB 1 0 0 0 0 0 No parameters BB B B 0 0 BURST COUNT CODE Action - The interrupt enable status flag is set and inter· rupts are enabled. NO. OF DMA CYCLES PER BURST 0 4 8 0 7. Disable Interrupt Command: Action - 8275 interrupts are enabled, DMA requests begin, video is enabled, Interrupt Enable and Video Enable status fl ags are set. DATA BUS I OPERATION AO Command! 3. Stop Display Command: Write 1 DESCRIPTION Disable Interrupt LSB MSB 1 , 0 0 0 0 0 0 No parameters - . DATA BUS iOPERATION AO Command I Write 1 DESCRIPTION Stop Display MSB 0 1 LSB 0 0 0 0 0 Action - Interrupts are disabled and the interrupt enable status flag is reset. 0 No parameters Action - Disables video, interrupts remain enabled, H RTC and VRTC continue to run, Video Enable status flag is reset, and the "Start Display" command must be given to re·enable the display. 8. Preset Counters Command: OPERATION AO DATA BUS OPERATION AO Command Parameters DESCRIPTION MSB 1 , Command LSB Write 1 Read Light Pen 0 Read 0 0 Char. Number Row Number (Char. Position in {Row Numbed Read DATA BUS I 4. Read Light Pen Command 0 0 0 0 I Write 1 DESCRIPTION MSB Preset Counters 1 1 LSB 1 0 0 0 0 0 No parameters 0 Row~ Action - The internal timing counters are preset, corre· sponding to a screen display position at the top left corner. Two character clocks are required for this operation. The counters will remain in this state until any other command is given. Action - The 8275H is conditioned to supply tile contents of the light pen position registers in the next two read cycles of the parameter register. Status flags are not affected. This command is useful for system debug and synchronization of clustered CRT displays on a single CPU. After this command. two additional clock cycles are required before the first character of the first row is put out. Noto: Software correction of light pen position is required. 7-18 210464-002 8275H Status Flags IC - (Improper Command) This flag is set when a command parameter string is too long or too short. The flag is automatically reset after a ~tatus read. DATA BUS MSB LSB OlE IR LP ICVE DU FO Command IE - (Interrupt Enable) Set or reset by command. It enables vertical retrace interrupt. It is auto· matically set by a "Start Display" command and reset with the "Reset" command. VE - (Video Enable) This flag indicates that video operation of the CRT is enabled. This flag is set on a "Start Display" command, and reset on a "Stop Display" or "Reset" command. IR - (Interrupt Request) This flag is set at the begin· ning of display of the last row of the. frame if the interrupt enable flag is set. It is reset after a status read operation. DU - LP - This flag is set when the light pen input (LPEN) is activated and the light pen registers have been loaded. This flag is automatically reset after a status read. (DMA Underrun) This flag is set whenever a data under run occurs during DMA transfers. Upon detection of DU, the DMA operation is stopped and the screen is blanked until after the vertical retrace interval. This flag is reset after a status read. FO - (FIFO Overrun) This flag is set whenever the FIFO is overrun. It is reset on a status read. 7-19 210464-002 8275H ABSOLUTE MAXIMUM RATINGS· 'NOTlCE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Ambient Temperature Under Bias . . . . . . . . . o°c to 70°C Storage Temperature . . . . . . . . . . . . . . -65°C to +150°C Voltage On Any Pin With Respect to Ground . . . . . . . . . . . . -0.5V to +7V Power Dissipation . . . . . . . . . . . . . . . . . . . . . . . 1 Watt D.C. CHARACTERISTICS Symbol (TA = occ to 70oe, Vee = SV ±S%) Parameter Min, Max. Units Input Low Voltage -0.5 0.8 V VIH Input High Voltage 2.0 Vee+0.5V V VOL Output Low Voltage VOH Output High Voltage IlL Input Load Current ±10 IOFL Output Float Leakage Icc Vee Supply Current VIL CAPACITANCE Symbol (TA 0.45 2.4 V V Test Conditions IOL = 2.2 mA IOH = -400 /lA /lA VIN = Vee to OV ±10 /lA VOUT 160 mA = Vee to O.4SV = 25°C, Vee = GND = OV) Parameter Min. Max. Units CIN Input Capacitance 10 pF fc=lMHz CliO I/O Capacitance 20 pF Unmeasured pins returned to Vss. A.C. CHARACTERISTICS (TA Test Conditions = ooe to 70°C, Vee = S.OV ±5%, GND = OV) Bus Parameters READ CYCLE Symbol tAR Parameter Address Stable Before READ tRA Address Hold Time for READ tRR READ Pulse Width tRO Data Delay from READ tOF READ to Data Floating Max. Min. a a 250 200 100 Units ns ns Test Conditions ns ns CL ns CL 150 pF 1S0 pF WRITE CYCLE Symbol tAW tWA tww tow two Parameter Address Stable Before WR ITE Address Hold Time for WR ITE WR ITE Pulse Width Data Setup Time for WR ITE Data Hold Time for WR.lTE Max, Min. a a Units Test Conditions ns ns 250 150 ns ns ns a 7-20 210464-002 intel 8275H A.C. CHARACTERISTICS (Continued) CLOCK TIMING 8275 Symbol ~ameter Min. 8275·2 Max. Min. Max. Test Conditions Units ~- tCLK Clock Period 480 320 tKH Clock High 240 120 ns tKL Clock Low 160 120 ns Clock Rise 5 30 5 30 ns Clock Fall 5 30 5 30 ns tKR - tKF ----- _._----- ns -- ~----- -- OTHER TIMING A.C. TESTING LOAD CIRCUIT A.C. TESTING INPUT, OUTPUT WAVEFORM INPUT OUTPUT ,4 2.0 > $ - O.B 2.0 DEVICE UNDER TEST ~ --... TEST POINTS .. 0,6 0.45 ~c -= CL INCLUOES JIG 7-21 CAPACI~ANCE 210464-002 8275H WAVEFORMS TYPICAL DOT LEVEL TIMING EXT DOT eLK CCLK-lL._ _ _ _ _ _--' CCO_6 SECOND CHARACTER CODe FIRST CHARACTER CODe \ ir-AOMACCESS- CHARACTER GENERATOR OUTPUT _ _ _ _ _ _ _ _....J FIRST '-_ _ _ _ _ _CHARACTER _ _ _ _ _ _ _J CHARACTER '-_ _ SECOND ___ _ _ _ __ ATTRIBUTES & CONTROLS VIDEO /FAOM SHIFT REGISTER} ATTRIBUTES 81 CONTROLS {FADM FIRST CHARACTER SECOND CHARACTER ATTRIBUTES & CONTROLS FOR FIRST CHAR. ATTRIBUTES 81 CONTAOLS FOR 2ND CHAR. SYNCHRONIZER) ·ceLK IS A MULTIPLE OF THE DOT CLOCK AND AN INPUT TO THE 8275. LINE TIMING CCO_6 HATe ~________~~__-....JA X PRESENT LINE COUNT NEXT LINE COUNT VIDEO CONTROLS AND ATTRIBUTES· -LAO_l. VSP, l TEN, HGL T, RVV, GPAo_ 1 7-22 210464-002 8275H WAVEFORMS (Continued) ROW TIMING ---'l __ _ ---i I~'HR HRTe LCO_3 J~:~:~i~ ____ - - - " PROGRAMMABLE FROM 1 TO 16 LINES ,.- - /1'____PR_'_SE_N_T_R_OW_ _ _----\, \-:j_ _ _ _ ---"~ FRAME TIMING -----\ }-----INTERNAL ROW COUNTER INTERRUPT TIMING AO RD Ir--______ ------'1 I-'RI-I \- IRa 7-23 210464-002 8275H WAVEFORMS (Continued) DMATIMING ORO .-I LPEN-,.1J-----WRITE TIMING READ TIMING INVALID INVALID CLOCK TIMING CCLK 'KF 7-24 210464-002 8276H SMALL SYSTEM CRT CONTROLLER • Dual Row Buffers • Programmable Screen and Character Format • 6 Independent Visual Field Attributes • Cursor Control (4 Types) • MCS-51®, MCS-85®, iAPX 86, and iAPX 88 Compatible • Single +5V Supply • 40-Pin Package • 3 MHz Clock with 8276-2 • High Performance HMOS-II The Intel 8276H Small System CRT Controller is a single chip device intended to interface CRT raster scan displays with Intel microcomputers in minimum device-count systems. Its primary function is to refresh the display by buffering character information from main memory and keeping track of the display position of the screen. The flexibility designed into the 8276H will allow simple interface to almost any raster scan CRT display. It can be used with the 8051 Single Chip Microcomputer for a minimum IC count design. It is manufactured on Intel's advanced HMOS-II process. CCLK LC3 Vee LC2 NC LC, NC LCD BRDY 090 "7 as CC o- s HATe BRDY---.-, LCO-3 WR- c~~':'1'ik LOGIC CIP- HRTe VRTC RASTER TIMING AND VIDEO CONTROL HLGT RVV LTEN VSP GPA O- Figure 1. Block Diagram 1 vsp GPA, VRTe GPAo iiij HLGT WR INT HC eCLK DBo READI LTEN RW ec. DB, ec, DB2 ec, DB3 eC3 DB, eC2 DB, CC, DB. eco DBr cs GND CIP Figure 2. Pin Configuration i;,";;IC~rporation Assumes No ResponsibHty for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No OthtU Circuit Patent Licenses Bfa Implied < INTEL CORPORATION. 1984 ORDER NUMBER: 210668-002 7-25 8276H Table 1. Pin Descriptions Pin No. Type I Symbol a 1 2 3 4 LC3 LC2 LC1 LC o BRDY a 5 I I 6 BS I HRTC I I I 91 Vee 140 I I j·SV power supply. NC 139 I I No connection. NC 138 I i No connection. a LTEN 37 RVV 36 a Reverse video. Output signal used to activate the CRT circuitry to reverse the video Signal. This output is active at the cursor position if a reverse video block cursor is programmed or at the positions specified by the field attribute codes. VSP 35 a Video suppression. Output signal used to blank the.video signal to the CRT. This output is active: Light enable. Output signal used to enable the video signal to the CRT. This output is active at the programmed underline cursor position, and at positions specified by attribute codes. Buffer ready. Output signal Indicating that a Row Buffer is ready for loading of character data. Horizontal retrace. Output Signal which is active during the programmed horizontal retrace interval. During this period the VSP output is high and the LTEN output is low. a FlO 1 Input signal enabli ng WR for character data into the Row Buffers. a 8 Name and Function / I ~!Ier select. I 7 VRTC Name and Function Line count. Output from the line counter which is used to address the character generator for the line positions on the screen. - during the horizontal and vertical retrace intervals. Vertical retrace. Output signal which is active during the programmed vertical retrace interval. During this period the VSP output is high and the LTEN output is low. I Read input. A control signal to read registers. . I 10 1 NC DBa DB1 DB2 DB3 DB4 DB5 DB6 DB? I 1 1111 1 12 13 14 15 16 17 18 19 1/0 Write input. A control signal to write commands into the control registers or write data into the row buffers. No connection. GPA1 GPAo 1 Bidirectional data bus. Three-state lines. The outputs are enabled during a read of the C or P ports. I ~~ I I HLGT 20 a 1 INT when an end 01 row or end of screen code is detected. - when a Row Buffer underrun occurs. a I 1 a I Interrupt output. CCLK Ground. CC 6 CC 5 CC 4 CC 3 CC2 CCi cCo 1 131 I 30 I 1 1 29 28 27 26 25 24 23 I Chip select. Enables RD of status or I 21 WR of command or parameters. I I I 7-26 Character clock (from dot/timing logic). ticn in the character generator. /22/ C/F' Highlight. Output signal used to intensify the display at particular positions on the screen as specified by the field attribute codes. Character codes. Output from the row buffers used for character selec- 0 CS ORDER NUMBER: 210668·002 - General purpose attribute codes.Outputs which are enabled by the general purpose field attribute codes. 32 1 Ground at the top and bottom lines of rows if underline is programmed to be number 8 or greater. - at regular intervals (1/16 frame frequency for cursor. 1/32 frame frequency for attributes)-to create blinking displays as specified by cursor or field attribute programming. 1 WR - Port address. A high input on this pin selects the "c" port or command registersand a low inputselects the "P" port or parameter registers. 8276H Character Counter FUNCTIONAL DESCRIPTION The Character Counter is a programmable counter that is used to determine the number of characters to be displayed per row and the length of the horizontal retrace interval. It is driven by the CCLK (Character Clock) input, which should be derived from the external dot clock. Data Bus Buffer This 3-state, bidirectional, 8-bit buffer is used to interface the 8276H to the system Data Bus. This functional block accepts inputs from the System Control Bus and generates control signals for overall device operation. It contains the Command, Parameter, and Status Registers that store the various control formats for the device functional definition. C/P OPERATION Line Counter The Line Counter is a programmable counter that is used to determine the number of horizontal lines (Raster Scans) per character row. Its outputs are used to address the external character generator. REGISTER 0 Read RESERVED 0 Write PARAMETER 1 Read STATUS 1 Write COMMAND Row Counter The Row Counter is a programmable counter that is used to determine the number of character rows to be displayed per frame and length of the vertical retrace interval. RD (READ) A "low" on this input informs the 8276H that the CPU is reading status information from the 8276H. Raster Timing and Video Controls WR(WRITE) A "low" on this input informs the 8276H that the CPU is writing data or control words to the 8276H. The Raster Timing circuitry controls the timing of the HRTC (Horizontal Retrace) and VRTC (Vertical Retrace) outputs. The Video Control circuitry controls the generation of HGL T (Highlight), RVV (Reverse Video), LTEN (Light Enable), VSP (Video Suppress), and GPAO~1 (General Purpose Attribute) outputs. CS (CHIP SELECT) A "low" on this input selects the8276H for RD orWRof Commands, Status, and Parameters. BRDY (BUFFER READY) A "high" on this output indicates that the 8276H is ready to receive character data. Row Buffers BS (BUFFER SELECT) A "Iow" on this input enables WR of character data to the 8276H row buffers. The Row Buffers are two 80-character buffers. They are filled from the microcomputer system memory with the character codes to be displayed. While one row buffer is displaying a row of characters, the other is being filled with the next row of characters. INT (INTERRUPT) A "high" on this output informs the CPU that the 8276H needs interrupt service. C/F' RD WR CS BS 0 0 1 0 1 1 1 1 0 1 0 0 1 0 0 0 0 1 1 1 1 0 X X X X 1 1 0 1 1 X X X 1 Buffer Input/Output Controllers Reserved Write 8276H Parameter Read 8276H Status Write 8276H Command Write 8276H Row Buffer High Impedance High Impedance The Buffer Input/Output Controllers decode the characters being placed in the row buffers. If the character is a field attribute or special code, they control the appropriate action. (Example: A "Highlight" field attribute will cause the Buffer Output Controller to activate the HGL T output.) 7-27 OAi:>ER NUMBER: 210668-002 8276H SYSTEM ,OPERATION The 8276H uses BRDY to request character data to fill the row buffer. that is not being used for display, The 8276H is programmable to a large number of different display formats, It provides raster timing, display row buffering, visual attribute decoding and cursor timing. The 8276H displays character rows one scan line at a time. The number of scan lines per character row, the underline position, and blanking of top and bottom lines are programmable, (See Programming Section.) It is designed to interface with standard character generators for dot matrix decoding. Dot level timing must be provided by external circuitry. The 8276H provides special Control Codes which can be used to minimize overhead. It also provides Visual Attribute Codes to cause special action on the'screen without the use of the character generator. (See Visual Attributes Section.) General Systems Operational Description Display characters are retrieved from memory and displayed on a row-by-row basis. The 8276H has two row buffers. While one row buffer is being used for display, the other is being filled with the next row of characters to be displayed, The number of display characters per row and the number of character rows per frame are software programmable, providing easy interface to most CRT displays. (See Programming Section.) INT The 8276H can generate a cursor. Cursor location and format are programmable. (See Programming Section.) LC o BRDY 8088 MICRO- The 8276H also controls raster timing, This is done by generating Horizontal' Retrace (HRTC) and Vertical Retrace (VRTC) Signals. The timing of these signals is also programmable, VIDEO SIGNAL J CHARACTER ceo ss PROCESSOR 1J cs l 6 8278H II "" ?- 8253·5 COUNTERI TIMER (ROM OR RAM) J. HIGH SPEED HORIZONTAL SYNC DOT TO CRT TIMING CRT CONTROLLER LOGIC ~ 8205 DECODER GENERATOR ~ClK AND VERTICAL SYNC INTERFACE INTENSITY , VIDEO CONTROLS Jr .. r- -.:' !'::. SYSTEM BUS . r- PROGRAM 8251A USART DISPLAV MEMORY tSERIA~ '4 r- ~ :::: 82SSA·5 KEYBOARD CONTROLLER 11 COMMUNICATIONS CHANNEL KEYBOARD I STA TUS Figure 3. CRT System Block Diagram 7-28 AFN-00224B intel 8276H 1st Character 2nd Character 3rd Character . .'. ..... 4th Character 5th Character 6th Character 7th Character --.--.--.--.--.-------- .... " ' First Line of a Character Row --------------.-----------i. --.----------------------. I. '. ,. 'I.. I. .' '." '.' 1st Charactp.r 2nd Character c...:[' • • • • LLI i.,' ; J, 1., ::.l.::'d-:-!.'I •• i"I':. 3rd Character 4th Character 5th Character 6th Character 7th Character I~ ii, i • • • • 12UCJU • • • [.: UU.IJU'J. U i l)~ U [-_jU.~] u.u r jU.:J I J.LJOU8 [1 ••••• , '.~_,!.l~·'-"ill Second Line of a Character Row 1 st Character 2nd Character ·1'-' ',.' i ,,·: • • • •.Dt • 'm ;.' •• n "" 3rd Character . I •••• 4th Character 5th Character HI,) J • • • • l ~ , " Thiru LlIle of <1 :., Character Row 6th Character i~-' • • • l-JI '.i • " '.' 7th Character ]~.[H.~iJ.U ~ i: J:.:.,; " --------.--.------.---1 st Character 2nd Character 3rd Character 4th Character 5th Character 6th Character 7th Character Seventh Line of a Character Row Figure 4. Display Of A Character Row Display Row Buffering Before the start of a frame, the 8276H uses BRDY and BS to fill one row buffer with characters, When the first horizontal sweep is started, character codes are output to the character generator from the row buffer just filled, Simultaneously, the other row buffer is filled with the next row of characters. After all the lines of the character row are scanned, the buffers are swapped and the same procedure is followed for the next row. D9 0 ·· 7 ceo· 6 This process is repeated until all of the character rows are displayed. Row Buffering allows the CPU access to the display memory at all times except during Buffer Loading (about 25%). This compares favorably to alternative approaches which restrict CPU access to the display memory to occur only during horizontal and vertical retrace intervals (80% of the bus time is used to refresh the display,) Figure 5. First Row Buffer Filled 7-29 ORDER NUMBER: 210668-002 intel· 8276H 123456789 . . . . . . . . . , . . . . 80 2 3 4 5 6 7 8 9 080 _ 7 64 Figure 8. Screen Format The 8276H can also be programmed to blank alternate rows. In this mode, the first row is displayed, the second blanked, the third displayed, etc. Display data is not requested for the blanked rows. Figure 6. Second Row Buffer Filled, First Row Displayed 123456789 . . . . . . . . . . . . . . . 80 2 3 4 5 64 08 0 __ 7 CC O-6 Figure 9. Blank Alternate Rows Mode ROW FORMAT The 8276H is designed to hold the line count stable while outputting the appropriate character codes during each horizontal sweep. The line count is incremented during horizontal retrace and the whole row of character codes are output again during the next sweep. This is continued until the entire character row is displayed. Figure 7. First Row Buffer Filled With Third Row, Second Row Displayed The number of lines (horizontal sweeps) per character row is programmable from 1 to 16. Display Format The output of the line counter can be programmed to be in one of two modes. SCREEN FORMAT The 8276H ca(l be programmed to generate from 1 to 80 characters per row, and from 1 to 64 rows per frame. ORDER NUMBER: 210668·002 In mode 0, the output of the line counter is the same as the line number. 7-30 8276H If the line number of the underline is greater than 7 (line number MSB = 1), then the top and bottom lines will be blanked. In mode 1, the line counter is offset by one from the line number. Note: In mode 1, while the first line (line number 0) is being displayed. the fast count is output by the line counter (see examples). Line Number o : J ~l U LJ LJ [] U Cl lJ LJ :.! '1 L.; • fJ rJ Li U I! !..J • • U [") LJ LJ[:.UIJL1BUU 4 5 6 '.1 8 9 10 1 ~J • !~ ,--; ~ I lJ lJ .. • :.J LJ Ll [[ ;.1 • ••••••• II 12 13 14 15 ~J :J _ ,J 11 ~! U U J U 1-] ;J u 0 Ii • [1 LJ U IJ rJ Ll lJ I-I II [J [1 • IJ I] [.: I i Mode 0 Mode 1 iJI1IJ.rJ.11IJ I1 o 1I • n 1111 0000 0001 0010 001 I 0100 010 I 0110 0111 1000 1001 1010 101 1 1 100 1 101 1110 11 • [l r:J [I • [1 [1 ••••••• !! il • r.J I: 0000 0001 001 a 0011 0100 0 10 1 0110 • U 1 001 [J 10 1 a 1011 U L-J U LJ i l l 100 [-I [j II II LJ II :1 U 1 101 1 1 10 1111 4 5 6 9 10 2 3 I U [I L.l .J U ~l lJ lJ i.1 II • [, • U lJ • [J U [I • I"': L. [! • Ii • 4 • 5 6 Ii ••••• [I [I • i I [I r I • [' 7 IJ • 11 [I LJ • Ij lULl I' lJ [J 1.1 [] 8 9 ,.I [] II [! (] • • • IJ • 11 !1 II :-] II r1 I I II [J ~ • • • • [1 11 ',J • [] • [! • r 1. • • • ~J !I .J Top and Bottom Li nes are B I an ked Figure 12. Underline in Line Number 10 If the line number of the underline is less than or equal to 7 (line number MSB = 0), then the top and bottom lines will not be blanked. Figure 10. Example of a 16-Line Format o 101 1 0000 0001 0010 001 1 0100 0101 0110 01 1 I 1000 1001 1010 IJ l J Li Line Number 000 a 000 1 0010 001 1 0100 0101 0110 0111 1000 1 00 1 '010 1 01 1 o I LJ L; Mode 1 IJ 1 000 li Mode 0 Line [J II Number Counter [J [Jri~UD'lULl :I Line Counter Line [] • Line Caunter Counter .CJOOClrlB00111 • Line Line Line Counter Counter Mode 0 Mode 1 Line Number 0000 0001 0010 001 1 0100 0101 0110 01 1 1 1000 1001 100 I o 0000 0001 0010 001 1 0100 0101 0110 011 1 1000 [-J [J • 2 II • U 3 4 5 6 IJ • Ll IJ ••••• lJ • ]. [] :1 • [] • [-J LJ 11 [J • (I [I [-I • • • • • • • •• II line Counter Line Counter Mode a Mode 1 0000 0001 0010 001 1 0100 0101 a 110 0 11 1 01 I 1 0000 0001 0010 a0 I I 0100 0101 01 10 Top and Bottom lines are not Blanked Figure 11. Example of a 10-Line Format Figure 13. Underline in Line Number 7 Mode 0 is useful for character generators that leave address zero blank and start at address 1. Mode 1 is useful for character generators which start at address zero. If the linenumber of the underline isgreater than the maximum number of lines, the underline will not appear. Underline placement is also programmable (from line number 0 to 15). This is independent of the line counter mode. Blanking is accomplished by the VSP (Video Suppression) signal. Underline is accomplished by the LTEN (Light Enable) signal. 7-31 ORDER ~UMBEA: 210668·002 8276H The line counter is driven by the character counter. It is used to generate the line address outputs (LC O- 3 ) for the character generator. After it counts all of the lines in a character row (programmable from 1 to 16), it increments the row counter, and starts over again. (See Character Format Section for detailed description of Line Counter functions.) DOT FORMAT Dot width and character width are dependent upon the external timing and control circuitry. Dot level timing circuitry should be designed to accept the parallel output of the character generator and shift it out serially at the rate required by the CRT display. The row counter is an internal counter driven by the line counter. It controls the functions of the row buffers and counts the number of character rows displayed. . ONE CHARACTER ROW r ~ HATC~VU- VIDEO lCO'3~~ Figure 14. Typical Dot Level Block Diagram Dot width is a function of dot clock frequency. INTERNAL ROW COUNTER Character width is a function of the character generator width. PRESENT ROW NEXT ROW • PROGRAMMABLE 1 TO 16 LINE COUNTS Horizontal character spacing is a function of the shift register length. Figure 16. Row Timing Nole: Video control and timing signals must be synchronized with the video signal due to the character generator access delay. After the row counter counts all of the rows in a frame (programmable from 1 to 64), it starts counting out the vertical retrace interval (programmable from 1 to 4). Raster Timing The character counter is driven by the character clock input (CCLK). It counts out the characters being displayed (programmable from 1 to 80). It then causes the line counter to increment, and it starts counting out the horizontal retrace interval (programmable from 2 to 32). This process is constantly repeated. CClK HRTe . ONE FRAME .. · L VATC~~~ • .. I .. T PROGRAMMABLE , TO 64 ROW COUNTS PROGRAMMABLE 1 TO 4 ROW COUNTS Figure 17. Frame Timing \----11 The Video Suppression Output (VSP) is active during horizontal and vertical retrace intervals. PROGRAMMABLE 1 TO 80 CCLKS NEXT leo 3 _ _ _'_AE_S_EN_T_Ll_N_E"_O_UN_'_ _--1 LINE COUNT Dot level timing circuitry must synchronize these outputs with the video signal to the CRT Display. Figure 15. Line Timing ORDER NUMBElt 210668-002 7-32 infel' 8276H Interrupt Timing Special Codes The 8276H can be programmed to generate an interrupt request at the end of each frame. If the 8276H interrupt enable flag is set, an interrupt request will occur at the beginning of the last display row. Four special codes are available to help reduce bus usage. SPECIAL CONTROL CHARACTER M5B L5B 1111 0055 ~ INTERNAL~ ROW SPECIAL CONTROL CODE COUNTER LAST F'RST DISPLAY RETRACE ROW ROW VRTC 5 5 o 0 1 End of Row End of Row-Stop Buffer Loading o End of Screen End of Screen-Stop Buffer Loading o ~\---.:r--J 'NT FUNCTION The End of Row Code (00) activates VSP and holds it to the end of the line. Figure 18. Beginning of Interrupt The End of Row-Stop Buffer Loading (BRDY) Code (01) causes the Buffer Loading Control Logic to stop buffer loading for the rest of the row upon being written into the Row Buffer. It affects the display in the same way as the End of Row Code (00). INT will go inactive after the status register is read. The End of Screen Code (10) activates VSP and holds it to the end of the frame. 'NT } The End of Screen-Stop Buffer Loading (BRDY) Code (11) causes the Row Buffer Control Logic to stop buffer loading for the rest of the frame upon being writt~n. It affects the display in the same way as the End of Screen Code (10). RD~~rFigure 19, End of Interrupt A reset command will also cause INT to go inactive, but this is not recommended during normal service .. If the Stop Buffer Loading feature is not used, all characte'rs after an End of Row character are ignored, except for the End of Screen character, which operates normally. All characters after an End of Screen character are ignored. Note: Upon power-up, the 8276H Interrupt Enable Flag may be set. As a result, the user's cold start routine should write a reset command to the 8276H before system interrupts are enabled. Note: If a Stop Buffer Loading is not the last character in a row, Buffer Loading is not stopped until after the next character is read. In this situation, a dummy character must be placed in memory after the Stop Buffer Loading character. VISUAL ATTRIBUTES AND SPECIAL CODES Field Attributes The field attributes are control codes which affect the visual characteristics for a field of characters, starting at the character following the code up to, and including, the character which precedes the next field attribute code, or up to the end of the frame. The field attributes are reset during the vertical retrace interval. The characters processed by the 8276H are 8-bit quantities. The character code outputs provide the character generator with 7 bits of address. The Most Significant Bit is the extra bit and it is used to determine if it is a normal display character (MSB =0), or if it is a Field Attribute or Special Code (MSB = 1). 7-33 ORDER NUMBER: 210668~002 inter 8276H H = 1 FOR HIGHLIGHTING B = 1 FOR BLINKING R = 1 FOR REVERSE VIDEO U = 1 FOR UNDERLINE GG = GPA 1 , GPAo ;rhe 8276H can be programmed to provide visible field attribute characters; all field attribute codes will occupy a position'on the screen, These codes will appear as blanks caused by activation of the Video Suppression output (VSP). The chosen visual attributes are activated after this blanked character. Note: More than one attribute can be enabled at the same time. If the blinking and reverse video attributes are enabled simultaneously, only the reversed characters will blink. There are six field attributes: 1. Blink-Characters following the code are caused to blink by activating the Video Suppression output (VSP). The blink frequency is equal to the screen refresh frequency divided by 32. Cursor Timing The cursor location is determined by a cursor row register and a character position register which are loaded by command to the controller. The cursor can be programmed to appear on the display as: 2. Highlight-Characters following the code are caused to be highlighted by activating the Highlight output (HGLT). 1. a blinking underline 2. a blinking reverse video block 3. a non-blinking underline 4. a non-blinking reverse video block 3. Reverse Video-Characters following the code are caused to appear with reverse video by activating the Reverse Video output (RVV). 4. Underline-Characters following the code are caused to be underlined by activating the Light Enable output (LTEN). The cursor blinking frequency is equal to the screen refresh frequency divided by 16. 5,6. General Purpose-There are two additional 8276H outputs which act as general purpose, independently programmable field attributes. GPA0-1 are active high outputs. If a non-blinking reverse video cursor appears in a non-blinking reverse video field, the cursor will appear as a normal video block. If a non-blinking underline cursor appears in a nonblinking underline field, the cursor will not be visible. ABC D E F GHI J KLM NOPORSTUV Device Programming 1 234 5 The 8276H has two programming registers, the Command Register and the Parameter Register. It also has a Status 'Register. The Command Register can only be written into and the Status Register can only be read from. They are addressed as follows: 6 7 8 9 Figure 20. Example of a Visible Field Attribute (Underline Attribute) FIELD ATTRIBUTE CODE MSB 1 0 LSB U R G G B H II TILl---- HIGHLIGHT L_~~~~~~~~~~~ ~i~RAL PURPOSE . . REVERSE VIDEO ' - - - - - - - - - - - UNDERLINE ORDER NUMBER: 210668-002 7-34 cip OPERATION REGISTER 0 Read Reserved () Write Parameter 1 Read Status 1 Write Command The 8276H expects to receive a command and a sequence of 0 to 4 parameters: depending on the command. If the proper number of parameter bytes are not received before another command is given, a status flag is set, indicating an improper command. 8276H Parameter-VV Vertical Retrace Row Count Instruction Set V V The 8276H instruction set consists of 7 cOmmands. COMMAND o o 0 1 2 3 4 1 1 0 1 1 NO. OF PARAMETER BYTES Reset Start Display Stop Display Load Cursor Enable Interrupt Disable Interrupt Preset Counters NO. OF ROWCOUNTS PERVRTC 4 o o Parameter-RRRRRR Vertical Rows/Frame 2 o o o R R R R R R In addition, the status of the 8276H can be read by the CPU at any time. 1. RESET COMMAND NO. OF ROWS/FRAME o o 0 0 0 0 0 0 0 001 00001 0 1 2 3 111111 64 DATA BUS MSB LSB OPERATION C/P DESCRIPTION Write 1 Reset Command 00000000 Write 0 Screen Camp SHHHHHHH Command Write 0 Write 0 Write 0 Parameters Byte 1 Parameter-UUUU Underline Placement VVAARRRR U U U U LINE NUMBER OF UNDERLINE Screen Camp Byte 3 UUUULLLL Screen Camp Byte 4 M 1 CCZZZZ 0 0 0 0 0 0 0 1 0 0 1 0 1 2 3 1 1 16 Screen Camp Byte 2 Action-After the reset command is written, BRDY goes inactive, 8276H interrupts are disabled, and the VSP output is used to blank the screen. HRTC and VRTC continue to run. HRTC and VRTC timing are random on power-up. As parameters are written, the screen composition is defined. Parameter-LLLL Number of Lines per Character Row L L L L o Parameter-S Spaced Rows S o FUNCTIONS NO. OF LINES/ROW 000 000 1 001 0 2 3 1 1 16 1 Normal Rows Spaced Rows Parameter-HHHHHHH Horizontal Characters/Row H H H H H H H o o 0 0 0 0 0 0 0 0 0 0 0 1 00000 1 0 Parameter-M Line Counter Mode NO. OF CHARACTERS PER ROW M 1 o 2 3 1 LINE COUNTER MODE Mode 0 (Non-Offset) Mode 1 (Offset by 1 Count) Parameter-CC Cursor Format 0 0 1 1 1 1 0 1 0 0 0 0 1 1 1 1 1 1 80 Undefined C C o o 0 1 1 0 1 1 Undefined 7-35 CURSOR FORMAT Blinking reverse video block Blinking underline Non-blinking reverse video block Non-blinking underline ORDER NUMBER: 210888-002 intel' 8276H Parameter-ZZZZ Horizontal Retrace Count 6, DISABLE INTERRUPT COMMAND NO, OF CHARACTER COUNTS PER HRTC zzzz Command o 0 0 0 000 1 001 0 6 1 1 32 2 4 Action-Interrupts are disabled and the interrupt enable status flag is reset. 7. PRESET COUNTERS COMMAND Note: uuuu MSB determines blanking of top and bottom lines (1 = blanked, 0 = not blanked). DATA BUS LS~ MSB 11100000 2. START DISPLAY COMMAND Action-The internal timing counters are preset, corresponding to a screen display position at the top left corner. Two character clocks are required for this operation. The counters wi" remain in this state until any other command is given. Actlon-8276H interrupts are enabled, BRDY goes active, video is enabled, Interrupt Enable and Video Enable status flags are set. This command is useful for system debug and synchronization of clustered CRT displays on a single CPU. After this command, two additional clock cycles are required before the first character of the first row is putout. 3. STOP DISPLAY COMMAND Status Flags DATA 8US Msa LSB DATA BUS Msa 01000000 Command Action-Disables video, interrupts remain enabled, HRTC and VRTC continue to run, Video Enable status flag is reset, and the "Start Display" command must be given to reenable the display. IE - (Interrupt Enable) Set or reset by command. It enables vertical retrace interrupt. It is automatica"y set by a "Start Display" command and reset with the "Reset" command. IR - (Interrupt Request) This flag is set at the beginning of display of the last row of the frame if the interrupt enable flag is set. It is reset after a status read operation. IC - (Improper Command) This flag is set when a command parameter string is too long or too short. The flag is automatically reset after a status read. VE - (Video Enable) This flag indicates that video operation of the CRT is enabled. This flag is set on a "Start Display" command, and reset on a "Stop Display" or "Reset" command. 4, LOAD CURSOR POSITION DATA BUS C/P DESCRIPTION MSB LSB Command Write Load Cursor 1 0 0 0 0 0 0 0 Parameters Write Write Char. NlJmber Row Number (Char. Position in Row) (Row Number) OPERATION Action-The 8276H is conditioned to place the next two parameter bytes into the cursor position registers. Status flag not affected. 5. ENABLE INTERRUPT COMMAND Actlon-The inter.rupt enable flag is set and interrupts are enabled. OROER NUMBER: 21_002 7-36 LSB o IE IA X Ie VE BU X I BU - (Buffer Underrun) This flag is set whenever a Row Buffer is not filled with character data in time for a buffer swap required by the display. Upon activation of this bit, buffer loading ceases, and the screen is blanked until after the vertical retrace interval. intel 8276H ABSOLUTE MAXIMUM RATINGS* Ambient Temperature Under Bias .... ooe to 70 c e Storage Temperature .......... -65°e to +150 o e Voltage On Any Pin With Respect to Ground ........ -O.5V to -t-7V Power Dissipation ....................... 1 Watt D.C. CHARACTERISTICS = OCC to 70 C; Vce = 5V 0:5%) C MIN_ MAX_ UNITS Vil Input Low Voltage --0.5 0.8 V VIH Input High Voltage 2.0 Vee + 0.5V V VOL Output Low Voltage VOH Output High Voltage III Input Load Current 2:10 IOFl i Output Float Leakage :0:10 f.lA lee Vee Supply Current 160 mA SYMBOL I (TA 'NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. PARAMETER - r------ 0.45 2.4 V IOl = 2.2 mA V IOH = --400 f.lA VIN = Vce to OV f.lA ~ CAPACITANCE I = 25'C; I VOUT = Vee to O.45V Vee ~ GND = OV) MAX_ UNITS CIN Iinput CapaCitance 10 pF fe = 1 MHz CliO 11/0 CapaCitance 20 pF Unmeasured pins returned to VSS. [SYMBOL I I (TA TEST CONDITIONS PARAMETER MIN_ TEST CONDITIONS A_C_ TESTING LOAD CIRCUIT DEVICE UNDER TEST !fcc -::- C L INCLUDES JIG CAPACITANCE 7-37 ORDER NUMBER: 210668-002 intel 8276H A.C. CHARACTERISTICS (TA = O°C to 70°C; VCC = 5,OV ±5%; GND = OV) Bus Parameters READ CYCLE Parameter Symbol tAR Address Stable Before READ' tRA Address Hold Time for READ tAA READ Pulse Width Max. Min. Units 0 ns 0 ns 250 ns tAD Data Delay from .READ 200 ns tOF READ to Data Floating 100 ns Max. Units Test Conditions CL = lS0pF WRITE CYCLE Parameter Symbol tAw Address Stable Before WRITE Min. 0 ns 0 ns tWA Address Hold Time for WRITE tww WRITE Pulse Width 250 ns tDW Data Setup Time for WRITE 150 ns two Data Hold Time for WRITE 0 ns Test Conditions CLOCK TIMING 8276H Symbol Parameter Min. 8276·2 Max. Min. Max. Units tCLK Clock Period 480 320 ns tKH Clock High 240 120 ns tKL Clock Low 160 120 tKR Clock Rise 5 30 5 30 ns tKF Clock Fall 5 30 5 30 ns Max. Units Test Conditions ns OTHER TIMING 8276H Symbol Parameter Min. Max. 8276-2 Min. Test Conditi~ms tcc Character Code Output Delay 150 150 ns CL = 50 pF tHR Horizontal Retrace Output Delay 200 150 ns CL = 50 pF tLC Line Count Output Delay 400 250 ns CL = 50 pF tAT Control/Attribute Output Delay 275 250 ns CL = 50 pF tVR Vertical Retrace Output Delay 275 250 ns CL = 50 pF tRI INTJ from RD! 250 250 ns CL =50 pF tWQ BRDY! from WRT 250 250 ns CL = 50 pF tRQ BRDYJ from WRJ 200 200 ns CL = 50 pF tLR BSJ toWRJ 0 tRL WRI to BST 0 ORDER NUMBER: 210668·002 .. 7-38 0 ns 0 ns 8276H WAVEFORMS Typical Dot Level Timing EXT DOT elK CCLK4l '--------' CCO_6 FIRST CHARACTER CODE SECOND CHARACTER CODE ROM ACCESS --'X CHARACTER _ _ _ _ _ _ _ _ GENERATOR OUTPUT ATTRIBUTES & CONTROLS -V -A ATTRIBUTES & CONTROLS FOR FIRST CHAR SHIFT REGISTER SETUP X FIRST CHARACTER ' -_ _ _ _ _ _ _ _ _ _ _ _- ' SECOND CHARACTER '-_ _ _ _ _ _ _ _ __ X V-- I.._ _ _ _ _ _ _ _ _ _ _ _ _ _~ ~ VIDEO {FROM SHIFT REGISTERI SECOND CHARACTER FIRST CHARACTER ATTRIBUTES & CONTROLS (FROM A TTA IBUTES 8. CONTROLS FOR FIRST CHAR. ATTRIBUTES & CONTROLS FOR 2ND CHAR. SYNCIIRONIZEA) *CCLK IS A MULTIPLE OF THE DOT CLOCK AND AN INPUT TO THE 8276. Line Timing eeLK \J\J\J\J\JV CCO_6 .. PROGRAMMAblE FROM 1 TO 80 CHARACTERS tHR PROGRAMMABLE FROM 2 TO 32 ceLKS ~- 'HR HRTe \ ' - - - - - - - - - " , " , - - , _--.II 'Le ----------~\rl----------~ r----- --'X LCo 3 _ _ _ _ _ PR_E_SE_N_T_L_'N_E_C_O_UN_T_ _ _-', "r'_ _ _ _ _ _ _ _ _ _ _ _ _ ANaATTe~~~~~~~ NEXT LINE COUNT =x=x------.. ::\-I______>C VSP, l TEN, HGL T, RVV. GPAO_1 7-39 ORDER NUMBER: 210668-002 8276H Row Timing CCLK HATe LCO_3 INTERNAL - - - - ' \ ...- - - - - - - - - - - \ \-....,..----,"""'\ ROW COUNTER _ _ _- ' 1'------------\ \-____.....J Frame Timing CCLK ~ INTERNAL ROW COUNTER . AST RETRACE ROW VRle Interrupt Timing \ CCLK cc 0-6 LAST RETRACE CHARACTER X \ cs""'\ I FIRST RETRACE CHARACTER -------~~ ~------- FIRST LINE COUNT lCO_3 C/PJ RO \ \'---- HATe INT INTERNAL ROW COUNTER INT t~ LAST DISPLAY ROW --------f-j________ ----+--'1t''" ORDER NUMBER: 210668-002 7-40 AFN-Q02248 8276H Timing for Buffer Loading CCLK ~'Kot BRDY --.r----------. Write Timing Read Timing 85, Cli', CS CfP. INVALID CS ==x- E= VALID I =.jtAR~ - _tRA - ! i'RR------, RO-~ _ _ _--.'ow INVALID OBO-7 -1 I-' R0 'wo 1 I y - OBO_7 INVALID Clock Timing Input and Output Waveforms for A.C. Tests '.4 J"O> TESTPOINTS <"0X== CCLK 0.45 O.B O.B tKF" FOR AND AND O.BV 7-41 A.C. TESTING. INPUTS ARE DRIVEN AT 2.4V FOR A LOGIC ", .. OA5V FOR A LOGIC 0 'TIMING MEASUREMENTS FOR INPUT OUTPUT SIGNALS ARE MADE AT 2.0V FOR A LOGIC "' , AND FOR A LOGIC o· ORDER NUMRER: 210668·002 APPLICATION NOTE AP-62 November 1979 © 207780-001 In1el Corporation, 1979 7-42 APPLICATIONS 1. INTRODUCTION The purpose of this application note is to provide the reader with the design concepts and factual tools needed to integrate Intel peripherals and microprocessors into a low cost raster scan CRT terminal. A previously published application note, AP-32, presented one possible solution to the CRT design question. This application note expands upon the theme established in AP-32 and demonstrates how to design a functional CR T terminal while keeping the parts count to a minimum. ---,,-_S~:-::,=_==::-:::~~__ -----~~:::::=-~~~'- - For convenience, this application note is divided into seven general sections: I. 2. 3. 4. 5. 6. 7. Introduction CRT Basics 8275 Description Design Background Circuit Description Software Description Appendix '- '- '"'- '-~ RETRACE LINES - - - DISPLAYED LINES Figure 2-1. Raster Scan of zig-zag lines on the screen (Fig. 2.1). Two simultaneously operating independent circuits control the vertical and horizontal movement of the beam. There is no question that microprocessors and LSI peripherals have had a significant role in the evolution of CRT terminals. Microprocessors have allowed design engineers to incorporate an abundance of sophisticated features into terminals that were previously mere slaves to a larger processor. To complement microprocessors, LSI peripherals have reduced component count in many support areas. A typical LSI peripheral easily replaces between 30 and 70 SSI and MSI packages, and offers features and flexibility that are usually not available in most hardware designs. In addition to replacing a whole circuit board of random logic, LSI circuits also reduce the cost and increase the reliability of design. Fewer interconnects increases mechanical reliability and fewer parts decreases the power consumption and hence, the overall reliability of the design. The reduction of components also yields a circuit that is easier to debug during the actual manufacturing phase of a product. As the electron beam moves across the face of the CRT, a third circuit controls the current flowing in the beam. By varying the current in the electron beam the image on the CRT can be made to be as bright or as dark as the user desires. This allows any desired pattern to be displayed. When the beam reaches the end of a line, it is brought back to the beginning of the next line at a rate that is much faster than was used to generate the line. This action is referred to as "retrace". During the retrace period the electron beam is usually shut off so that it doesn't appear on the screen. 2. CRT BASICS As the electron beam is moving across the screen horizontally, it is also moving downward. Because of this, each successive line starts slightly below the previous line. When the beam finally reaches the bottom right hand corner of the screen, it retraces vertically back to the top left hand corner. The time it takes for the beam to move from the top of the screen to the bottom and back again to the top is usually referred to as a "frame". In the United States, commercial television broadcast use 15,750 Hz as the horizontal sweep frequency (63.5 microseconds per horizontal line) and 60 Hz as the vertical sweep frequency or "frame" (16.67 milliseconds per vertical frame). The raster scan display gets its name from the fact that the image displayed on the CRT is built up by generating a series of lines (raster) across the face of the CRT. Usually, the beam starts in the upper left hand corner of the display and simultaneously moves left to right and top to bottom to put a series Although, the 60 Hz vertical frame and the 15,750 Hz horizontal line are the standards used by commercial broadcasts, they are by no means the only frequency at which CRT's can operate. In fact, many CRT displays use a horizontal scan that is around 18 KHz to 22 KHz and some even exceed 30 KHz. As the Until the era of advanced LSI circuitry, a typical CRT terminal consisted of 80 to 200 or more SSI and MSI packages. The first microprocessors and peripherals dropped this component count to between 30 and 50 pac.kages. This application note describes a CRT terminal that uses 20 packages. 7-43 207780-001 APPLICATIONS horizontal frequency increases. the number of horizontallines per frame increases. Hence, the resolution on the vertical axis increases. This increased resolution is needed on high density graphic displays and on special text editing terminals that display many lines of text on the CRT. Although many CRT's operate at non-standard horizontal frequencies. very few operate at vertical frequencies other than 60 Hz. If a vertical frequency other than 60 Hz is chosen, any external or internal magnetic or electrical variations at 60 Hz will modulate the electron beam and the image on the screen will be unstable. Since. in the United States. the power line frequency happens to be 60 Hz. there is a good chance for 60 Hz interference to exist. Transformers can cause 60 'Hz magnetic fields and power supply ripple can cause 60 Hz electrical variations. To overcome this, special shielding and power supply regulation must be employed. In this design, we will assume a standard frame rate of 60 Hz and a standard line rate of 15,750 Hz. By dividing the 63.5 microsecond horizontal line rate into the 16.67 millisecond vertica'l rate. it is found that there are 262.5 horizontal lines per vertical frame. At first, the half line mav seem a bit odd. but actually it allows the resolution·on the CRT to be effectively doubled. This is done by inserting a second set of horizontal lines between the first set (interlacing). In an interlaced system the line sets are not generated simultaneously. In a 60 Hz system. first all of the even-numbered lines are scanned: O. 2. 4, ... 524. Then all the odd-numbered lines: 1,3.5, ... 525. Each set of lines usually contains different data (Fig. 2.2). -----------..: --- -------------.. ----- ----------. ----.-------- ---..... _--- ------- -------,-.... -. - - - EVEN FIELD --ODDFIELD RETRACE LINES NOT SHOWN Figure 2-2. Interlaced Scan Although interlacing provides greater resolution, it also has some distinct disadvantages. First of all. the circuitry needed to generate the extra half horizontal line per frame is quite complex when compared to a noninterlaced design. which requires an integer number of horizontal lines per frame. Next, the overall vertical refresh rate is half that of a noninterlaced display. As a result, flicker may result when the CRT uses high speed phosphors. To keep things as simple as possible. this design uses the noninterlaced approach. The first thing any CRT controller must do is generate pulses that define the horizontal line timing and the vertical frame timing. This is usually done by dividing a crystal reference source by some appropriate numbers. On most raster scan CRT's the horizontal frequency is very forgiving and can vary by around 500 Hz or so and produce no ill effects. This means that the CRT itself can track a horizontal frequency between 15250 Hz and 16250 Hz. or in other words. there can be 256 to 270 horizontal lines per vertical frame. But. as mentioned earlier, the vertical frequency should be 60 Hz to insure stability. The characters that arc viewed on the screen are formed bv a series of dots that are shifted out of the controllc~ while the electron beam moves across the face of the CRT. The circuits that create this timing are referred to as the dot clock and character clock. The character clock is equal to the dot clock divided by the number of dots used to form a character along the horizontal axis and the dot clock is calculated by the following equation: DOT CLOCK (Hz) ::; ( N + R ) * D * L * F where N is the number of displayed characters per row. R is the number of retrace character time increments. D is the number of dots per character. L is the number of horizontal lines per frame and F is the frame rate in Hz. In this design N ::: 80. R ::: 2P, D ::: 7, L ::: 270, and F ::: 60 Hz. If the numbers are plugged in. the dot clock is found to be 11.34 MHz. The retrace number, R, may vary from system to system because it is used to establish the margins on the left and right hand sides of the CRT. In this particular design R ::: 20 was empirically found it be optimum. The number of dots per character may vary depending on the character generator used and the number of dot clocks the designer wants to place between characters. This design uses a 5 X 7 dot matrix and allows 2 dot clock periods between characters (see Fig. 2.3); since 5 + 2 equals 7, we find that D ::: 7. 7-44 207780-001 APPLICATIONS are interrelated and that to guarantee proper operation on a standard raster scan CRT, L should be between 256 and 270. If L does not lie within these bounds the horizontal circuits of the CRT may not be able to lock onto the driving signal and the image will roll horizontally. The chosen L of 270 yields a horizontal frequency of 16,200 KHz on a 60 Hz frame and this number is within the 500 Hz tolerance mentioned earlier. The V number is chosen to match the CRT in much the same manner as the R number mentioned earlier. When the electron beam reaches the bottom right corner of the screen it must retrace vertically to the top left corner. This retrace action requires time, usually between 900-1200 microseconds. To allow for this, enough horizontal sync times must be inserted during vertical retrace. Twenty horizontal sync times at 61.5 microseconds yi(!ld a total of 1234.5 microseconds, which is enough time to allow the beam to return to the top of the screen. The number of lines per frame can be determined by the following equation: L=(H*Z)+V where, H is the number of horizontal lines per character, Z is the number of character lines per frame and V is the number of horizontal lines during vertical retrace. In this design, a 5 X 7 dot matri; is to be placed on a 7 X 10 field, so H =10. Also, 25 lines are to be displayed, so Z = 25. As mentioned before, V = 20. When the numbers are plugged into the equation, L is found to be equal to 270 lines per frame. The choices of Hand Z largely relate to system design preference. As H increases, the character size along the vertical axis increases. Z is simply the number of lines of characters that are displayed and this, of course, is entirely a system design option. The designer should be cautioned that these numbers BLOCK DIAGRAM CHARACTER COUNTER OB0-7 CCLK ceO·6 PIN CONFIGURATION LC3 Vcc LC, LAO LC, LA, LCO LiEN DRa RW DAE"i< vsp HRTe GPAl VRTe GPAO 1!15 WR HLGT IRa DRa _ _ _- - , LPEN LCO·3 DACK IRa LAO·1 HRTe VRTe . CCLK DBa CCa DB, CCs DB, CC, DB3 CC3 DB, CC, RW LiEN DBS CC, vsp DBa CCo GPA!)'l DB, Os GND A, HLGT ....,...____..,.....----of lPEN Figure 3-1. 8275 Block Diagram/Pin Configuration 7-45 207780-001 APPLICATIONS 3. 8275 DESCRIPTION A block diagram and pin configuration of the 8275 are shown in Fig. 3.1. The following is a description of the general capabilities of the 8275. 3.1 CRT DISPLAY REFRESHING The 8275. having been programmed by the designer to a specific screen format, generates a series of DMA request signals, resulting in the transfer of a row of characters· from display memory to the 8275's row buffers. The 8275 presents the character codes to an external character generator ROM by using outputs CCO-CC6: External dot timing logic is then used to transfer the parallel output data from the character generator RO M serially to the video input of the CRT. The character rows are displayed on the CRT one line at a time. Line courit outputs LCO-LC3 are applied to the character generator ROM to perform the line selection function. The display process is illustrated in Figure 3.2. The entire process is repeated for each display row. At the beginning of the last displayed row, the 8275 issues an interrupt by setting the IRQ output line. The 8275 interrupt output will normally be connected to the interrupt input of the system central processor. The interrupt causes the CPU to execute an interrupt service subroutine. The service subroutine typically re-initializes DMA controller parameters for the next display refresh cycle, polls the system keyboard controller, and! or executes other appropriate func-, tions. A block diagram of a CR T system implemented with the 8275 CRT Controller is provided in Figure 3.3. Proper CRT refreshing requires that certain 8275 parameters be programmed prior to the beginning of display operation. The 8275 has two types of programming registers, the Command Registers (CREG) and the Parameter Registers (PREG). It also has a Status Register (SREG). The Command Registers may only be written to and the Status Registers may only be read. The 8275 expects to receive a command followed by a sequence offrom 0 to 4 parameters, depending on the command. The 8275 instruction set consist of the eight commands shown in Figure 3.4. To establish the format of the display, the 8275 provides a number of user programmable display format parameters. Display fbrmats having from I to 80 characters per row, I to 64 rows per screen, and I to 16 horizontal lines per row are available. Inaddition to transferring characters from memory 5th 2nd 4th 6th 7th 1st 3rd Character Character Character Character Character Character Character ..-"-....-"-..---..--..-"-....-"-....-"-.. 00 •••• 000.0000.00 • • • • • 000000000 • • • • 0000 • • • 000.000.0 . First Line of a Character Row 1st Character 2nd Character 3rd Character 4th Character 5th Character 6th Character 7th Character ..-"-....-"-....-"-....-"-....-"-....-"-....-"-.. 00 •••• 000.0000.00 • • • • • 000000000 • • • • 0000 • • • 000.000.0 o.oooo.oo •• oooaoo.ooooooooooooo.oooaooaooo.ooaoooao Second Line of a Character Row 1st Character 2nd Character 3rd Character 4th Character 5th Character 6th Character 7th Character ..-"-....-"-....-"-....-"-....-"-....-"-....--.;...... 00 •••• 000.0000.00 • • • • • 000000000 • • • • 0000 • • • 000.000.0 o.oooo.oo •• ooo.oo.ooooooooooooo.ooo.oo.ooo.oo.oooao o.oooo.oo.oooo.oo.oooooooooooooaooo.oo.oooaooaooo.o Third line of a Character Row 1st Character 2nd Character 3rd Character 4th Character 5th Character 6th Chara'cter 7th Character ~..-"-....-"-....-"-....-"-....-"-.. 00 •••• 000.0000.00 • • • • • 000000000 • • • • 0000 • • • 000.000.0 o.oooowoo •• ooo.oo.ooooooooooooo.ooo.oo.ooo.oo.ooo.o o.oooo.oo.o.oo.oo.oooooooooooooaoooaoo.ooo.oo.ooo.o 0.0000.00.0000.00 • • • • 0000000000 • • • • 000.000.00.0.0.0 o.oooo.oo.oowoaoo.ooooooooooooo.o.oooo.ooo.oo.o.o.o o.ooooaooaooo •• oo.ooooooooooooo.oo.ooo.ooo.oo.o.o.o 00 •••• 000.0000.00 • • • • • 000000000.000.000 • • • 0000.0.00 Seventh line of a Character Row Figure 3-2. 8275 Row Display 207780-001 7-46 APPLICATIONS TRANSFER DECODE LOGIC HACK t5ACK VIDEO SIGNAL LCO-3 ORO HOLD BOSSA MICRO· PROCESSOR CHARACTER GENERATOR ROM CCO-6 8275 HIGH SPEED OaT TIMING CRT CONTROLLER LOGIC AND INTERFACE CCLK HORIZONTAL SYNC TO CRT VERTICAL SYNC INTENSITY VIDEO CONTROLS 7 7 J1 SYSTEM BUS "" :0- "'" "" ""' 8253-5 COUNTER/ TIMER :0- 7 8251 USART PROGRAM! 8255A-5 DISPLAY KEYBOARD CONTROLLER MEMORY t~ LJ KEYBOARD COMMUNICATIONS CHANNEL I STATUS I Figure 3-3. CRT System Block Diagram to the CRT screen, the 8275 features cursor position control. The cursor position may be programmed, via X and Y cursor position registers, to any character position on the display. The user may select from four cursor formats. Blinking or nonblinking underline and reverse video block cursors are available. COMMAND 3.2 CRT TIMING The 8275 provides two timing outputs, HRTC and VRTC, which are utilized in synchronizing CRT horizontal and vertical oscillators to the 8275 refresh cycle. In addition, whenever HRTC or VRTC is active, a third timing output, VSP (Video Suppress) is true, providing a blinking signal to the dot timing logic. The dot timing logic will normally inhibit the video output to the CRT during the time when video suppress signal is true. An additional timing output, L TEN (Light Enable) is used to provide the ability to force the video output high regardless of the state of VSP. This feature is used by the 8275 to place a cursor on the screen and to control attribute functions. Attributes will be considered in the next section. The HLGT (Highlight) output allows an attribute function to increase the CRT beam intensity to a level greater than normal. The fifth timing signal, RVV (Reverse Video) will, when enabled, cause the system video output to be inverted. NO. OF PARAMETER BYTES NOTES RESET 4 Display format pa· rameters required START DISPLAY 0 DMA operation pa· rameters included in command STOP DISPLAY 0 READ LIGHT PEN 2 LOAD CURSOR 2 ENABLE INTERRUPT 0 DISABLE INTERRUPT 0 PRESET COUNTERS 0 Cursor X,Y posi· tion parameters reo quired Clears all internal counters Figure 3-4. 8275'5 Instruction Set 7-47 207780-001 APPLICATIONS Character attributes were designed to produce the following graphics: CHARACTER ATTRIBUTE CODE "CCCC" 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 Above Underline Underline Below Underline jAbove Underlihe Underline Below Underline Above Underline Underline Below Underline Above Underl ine Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underl ine Above Underl ine Underline Below Underl ine Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline Above Underline Underline Below Underline LA, 0 1 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 a a 0 a 0 a 0 0 a OUTPUTS VSP LAo 1 0 0 1 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 1 0 1 1 1 0 0 1 1 0 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 1 1 1 1 0 1 LTEN 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 a L .-J 0 a a 0 1 a a a a a a a 1 1 1 0 0 0 Top Left Corner Bottom Left Corner Bottom Right Corner -----r- Top Intersect ---1 Right Intersect ~ --- a a 0 0 DESCRIPTION Top Right Corner I 0 0 1 0 0 0 I 1-,----- - L a a a a a SYMBOL I + Left I nterseet Bottom Intersect Horizontal Line Vertical Line Crossed Lines Not Recommended' Special Codes Undefined Illegal J Und~fined Illegal I I Undefined , Illegal I 'Character Attribute Code 1011 is not recommended for normal operation. Since none of the attribute outputs are active, the character Generator will not be disabled, and an indeterminate character will be generated. Character Attribute Codes 1101, 1110, and 1111 are illegal. Blinking is active when B = 1. Highlight is active when H = 1. Figure 3-5. Character Attributes 7-48 207780-001 APPLICATIONS ABC D E F G H I J K L M NOPORSTUV ABC D E F G H I J K L M 1 234 5 1 234 567 B 9 NOPORSTUV 6 7 B 9 EXAMPLE OF THE VISIBLE FIELD ATTRIBUTE MODE (UNDERLINE ATTRIBUTE) EXAMPLE OF THE INVISIBLE FIELD ATTRIBUTE MODE (UNDERLINE ATTRIBUTE) Figure 3-6. Field Attribute Examples 3.3 SPECIAL FUNCTIONS 2. Highlight - Characters following the code are caused to be highlighted by activating the Highlight output (HGL T). VISUAL ATTRIBUTES-Visual attributes are special codes which, when retrieved from display memory by the 8275, affect the visual characteristics of a character position or field of characters. Two types of visual attributes exist, character attributes and field attributes. 3. Reverse Video - Characters following the code are caused to appear in reverse video format by activating the Reverse Video output (RVV). 4. Underline - Characters following the code are caused to be underlined by activating the Light Enable output (L TEN). Character Attribute Codes: Character attribute codes can be used to generate graphics symbols without the use of a character generator. This is accomplished by selectively activating the Line Attribute outputs (LAO-LA I), the Video Suppression output (VSP), and the Light Enable output (L TEN). The dot timing logic uses these signals to generate the proper symbols. Character attributes can be programmed to blink or be highlighted individually. Blinking is accomplished with the Video Suppression output (VSP). Blink frequency is equal to the screen refresh frequency divided by 32. Highlighting is accomplished by activating the Highlight output (HGL T). Character attributes were designed to produce the graphic symbols shown in Figure 3.5. 5. General Purpose - There are two additional 8275 outputs which act as general purpose, independently programmable field attributes. These attributes may be used to select colors or perform other desired control functions. The 8275 can be programmed to provide visible or invisible field attribute characters as shown in Figure 3.6. If the 8275 is programmed in the visible field attribute mode, all field attributes will occupy a position on the screen. They will appear as blanks caused by activation of the Video Suppression output (VSP). The chosen visual attributes are activated after this blanked character. If the 8275 is programmed in the invisible field attribute mode, the 8275 row buffer FIFOs are activated. The FIFOs effectively lengthen the row buffers by 16 characters, making room for up to 16 field attribute characters per display row. The FIFOs are 126 characters by 7 bits in size. When a field attribute is placed in the row buffer during DMA, the buffer input controller recognizes it and places the next character in the proper FIFO. When a field attribute is placed in the buffer output controller during display, it causes the controller to immediately put a character from the FIFO on the Character Code outputs (CCO-6). The chosen attributes are also. activated. Field Attribute Codes: The field attributes are control codes which affect the visual characteristics for a field of characters, starting at the character following the field attribute code up to, and including, the character which precedes the next field attribute code, or up to the end of the frame. There are six field attributes: I. Blink - Characters following the code are caused to blink by activating the Video Suppression output (VSP). The blink frequency is equal to the screen refresh frequency divided by 32. 207780-001 7-49 APPLICATIONS LIGHT PEN DETECTION - A light pen consists fundamentally of a switch and light sensor. When the light pen is pressed against the CRT screen, the switch enables the light sensor. When the raster sweep coincides with the light sensor position on the display, the light pen output is input and the row and character position coordinates are stored in two 8275 internal registers. These registers can be read by the microprocessor. Decision 2 is. fairly obvious; if a circuit can be designed so that loading on the data and address lines is kept to a minimum, both the data and address buffers can be eliminated. This easily saves three to eight packages and reduces the power consumption of the design. Both decisions 3 and 4 require a basic understanding of current CRT design concepts. In any CRT design, extreme time conflicts are created because all essential elements require access to the bus. The CPU needs to access the memory to control the system and to handle the incoming characters, but, at the same time, the CRT controller needs to access the memory to keep the raster scan display refreshed. To resolve this conflict two common techniques are employed, page buffering and line buffering. SPECIAL CODES - Four special codes may be used to help reduce memory, software, or DMA overhead. These codes are placed in character positions in display memory. I. End Of Row Code - Activates VSP. VSP remain's active until the end of the line is reached. While VSP is active, the screen is blanked. In the page buffering approach the entire screen memory is isolated from the rest of the system. This isolation is usually accomplished with three-state buffers or two line to ope line multiplexers. Of course, whenever a character needs to be manipulated the CPU must gain access to the buffered memory and, again, possible contention between the CPU and the CRT controller results. This contention is usually resolved in one oftwo ways, (I) the CPU is always given priority, or; (2) the CPU is allowed to access the buffered memory only during horizontal and vertical retrace times. 2. End Of Row-Stop DMA Code - Causes the DMA Control Logic to stop DMA for the rest of the row when it is written into the row buffer. It affects the display in the same way as the End of Row Code. 3. End Of Screen Code - Activates VSP. VSP remains active until the end of the frame is reached. 4. End Of Screen-Stop DMA Code - Causes the DMA Control Logic to stop DMA for the rest of the frame when it is written into the row buffer. It affects the display in the same way as the End of Screen Code. Approach I is the easiest to implement from a hardware point of view, but if the CPU always has priority the display may temporarily blink or "flicker" while the CPU accesses the display memory. This, of course, occurs because when the CPU accesses the display memory the CRT controller is not able to retrieve a character, so the display must be blanked during this time. Aesethically, this "flickering" is not desirable, so approach 2 is often used. The second approach eliminates the display flickering encountered in the previously mentioned technique, but additional hardware is required. Usually the vertical and horizontal blank signals are gated with the buffered memory select lines and this line is used to control the CPU's ready line. So, if the CPU wants to use the buffered memory, its ready line is asserted until horizontal or vertical retrace times. This, of course, will impact the CPU's overall through put. PROGRAMMABLE DMA BURST CONTROLThe 8275 can be programmed to request single-byte DMA transfers of DMA burst transfers of 2,4, or 8 characters per burst. The interval between bursts is also programmable. This allows the user to tailor the DMA overhead to fit the system needs. 4. DESIGN BACKGROUND 4.1 DESIGN PHILOSOPHY Since the cost of any CRT system is somewhat proportional to parts count, arriving at a minimum part count solution without sacrificing performance has been the motivating force throughout this design effort. To successfully design a CRT terminal and keep the parts count to a minimum, a few things became immediately apparent. I. 2. 3. 4. An 8085 should be used. Address and data buffering should be eliminated. Multi-port memory should be eliminated. DMA should be eliminated. Both page buffered approaches require a significant amount of additional hardware and for the most part are not well 'suited for a minimum parts count type of terminal. This guides us to the line buffered approach. This approach eliminates the separate buffered memory for the display, but, at the same time, introduces a few new problems that must be solved. Decision I is obvious, the 8085's on-board clock generator, bus controller and vectored interrupts greatly reduce the overall part count considerably. 7-50 207780-001 APPLICATIONS In the line buffered approach both the CPU and the CRT controller share the same memory. Every time the CRT controller needs a new character or line of data, normal processing activity is halted and the CRT controller accesses memory and displays the data. Just how the CRT controller needs to acquire the display data greatly affects the performance of the overall system. Whether the CRT controller needs to gain access to the main memory to acquire a single character or a complete line of data depends on the presence or absence of a separate line or row buffer. VIDEO OUT ·OPTIONAL PAGE BUFFERING TECHNIQUE 1'----_..VIDEO OUT If no row buffer is present the CRT controller must go to the main memory to fetch every character. This of course, is not a very efficient approach because the processor will be forced to relinquish the bus 70% to 80% of the time. So much processor inactivity greatly affects the overall system performance. In fact terminals that use this approa..:h are typically limited to around 1200 to 2400 baud on their serial communication channels. This low baud rate is in general not acceptable, hence this approach was not chosen. LINE BUFFERING TECHNIQUE Figure 4-1. Line Buffering Technique ClOD'tVCLES ~E!) ~TRTEi::m SO!.lf.'CE F'~lJ 10 10 I" Ie 10 F'USH f'U:·4 t'USl! H l:a H, r'R~' 5P 4 ~CH!j ·16 6 Lf~i..D ~JIi 4C~ 11 4 12 13 H IS Ie 17 18 19 20 21 22 23 24 pelp FPC 10 4 4 4 7/Hl 4 4 7/10 ifJ 16 7 4 Ii 10 18 4 10 C':j~lCH CI.:rn[' A, llCUH /'I'll 1'J 4 10 10 0 SPHL 7 4 DP,r, ~;nlG SF'Hl LX] XCHG TOTRL CLOa: C'IClES '" H·lf Ef· HIlt dE IF 5i=:1l~ AS H ; IF I)OT lEfr"~ ,PU1 LO~ 0r,,'[R WA ;;1£ IF sr~';E liS l j JF ~iCIT 4.2 USING THE 8275 WITHOUT DMA Until now the process of filling the row buffer has only been alluded to. In reality, a DMA technique is usually used. This approach was demonstrated in AP-32 where an 8257 DMA controller was mated to an 8275 CRT controller. In order to minimize component count, this design eliminates the DMA controller and its associated circuitry while replacing them with a special interrupt-driven transfer. LHNi:: ·LGH[, H rill{'l L ~ITH i P~T [ito: cu::'mn .GO r:ASl~ ~:'r'iE lGP OF SC ~ a~ liEr~(irS AC':,PESS JSET mm-:PUFr l'1:iSK PSU EI RET = t'0C The 8275 CRT controller is ideal for implementing the row buffer approach because the row buffer is contained on the device itself. In fact, the 8275 contains two 80-byte row buffers. The presence of two row buffers allow one buffer to be filled while the other buffer is displaying the data. This dual row buffer approach enhances CPU performance even further. ;f,[;[·51tlCK ;PUT S'IFr.1< !II H Hi;[! L O~ JIJ2 l:<.l SH!.D 23 )0 D\.Ia~i1 110\/ JNZ 31 J2 3J 34 iZ!:J't", H A:lli L ; f'~IT SWT F"O!IHEr: HI H filII) L .HIT ::'H~J~ !II D I-~'[' E ;(·'T FOHfiEr: iPVi ('.i~~~!;1 LIi;, IIHO SF' ;SST l1i:::.I:'i)"; ;SEl Sf-i:C1Fil, T"AnS~ER BIT iC")'W 1-'1).'....5 ,GO 8:':CV '10 r;O:;iiR H. LXI 16 27 KPn:: 28 ; S,c{/[ A F.~I) FlR'JS ; S~;','[ H Iil:S- l i ;:.F~',,!£ D F,j;:i I: ;5£iurn sm 2S If a separate row buffer is employed the CRT controller only has to access the memory once for each displayed character per line. This forces the processor to relinquish the bus only about 20% to 35% of the time and a full 4800 to 9600 baud can be achieved. Figure 4.1 illustrates these different techniq ues. U~I)F:ST j G[r, 0 n!l(J E jGD H f,liC. l iCiET 11 HI;;:' FLfj':iS ; E)lr::8l~ IHTEFPUrrS j GO E:';C~ The only real concern with using the 8275 in an interrupt-driven transfer mode is speed. Eighty characters must be loaded into the 8275 every 617 microseconds and the processor must also have time to perform all the other tasks that are required. To minimize the overhead associated with loading the characters into the 8275 a special technique was employed. This technique involves setting a special CASE) WIn; A G.144 MHZ CRYSTAL TOTAL TIME TO FILL ROW BUFFER otl 8275 = 650 * .?:'S = 211 25 mr.rOSEC0~1[IS Figure 4-2. Routine To Load 8275'5 Row Buffers 7-51 207780-001 APPLICATIONS transfer bit and executing a string of POP instructions. The string of POP instructions is used to rapidly move the data from the memory into the 8275. Figure 4.2 shows the basic software structure. In this design the 8085's SOD line was used as the special transfer bit. In order to perform the transfer properly this special bit must do two things: (I) turn processor reads into DACK plus WR for the 8275 and (2) mask processor fetch cycles from the 8275, so that a fetch cycle does. not write into the 8275. Conventional logic could have been used to implement this special function, but in this design a small bipolar programmable read only memory was used. Figure 4.3 shows a basic version of the hardware. Ad Wi :::0- TRANSFER BIT Ce BIPOLAR PROM 8275 DACK AO 8275 Ad A1 8275 Wr A2 8275 Cs A12 A3 M1 (FETCH CYCLE) A4 Figure 4-3. Simplified Version of Hardware Decoder At first, it may seem strange that we are supplying a DACK when no DMA controller exist in the system. But the reader should be aware that all Intel peripheral devices that have DMA lines actually use DACK as a chip select for the data. So, when you want to write a command or read status you assert CS and WR or RD,but when you want to read or write data you assert DACK and RD or WR. The peripheral device doesn't "know" if a DMA controller is in the circuit or not. In passing, it should be mentioned that DACK and CS should not be asserted on the same device at the same time, since this combination yields an undefined result. This . POP technique actually compares quite favorably in terms of time to the DMA technique. One POP instruction transfers two bytes of data to the 8275 and takes 10 CPU clock cycles to execute, for a net transfer rate of one byte every five clock cycles. The DMA controller takes four clock cycles to transfer one byte but, some time is lost in synchronization. So the difference between the two techniques is one clock cycle per byte maximum. If we compare the overall speed of the 8085 to the speed of the 8080 used in AP-32, we find that at 3 MHz we can transfer one byte every 1.67 microseconds using the 8085 and POP technique vs. 2 microseconds per byte for the 2 MHz 8080 using DMA. 5. CIRCUIT DESCRIPTION 5.1 SCOPE OF THE PROJECT A fully functional, microprocessor-based CRT terminal was designed and constructed using the 8275 CRT controller and the 8085 as the controlling element. The terminal had many of the functions found in existing commercial low-cost terminals and more sophisticated features could easily be added with a modest amount of additional software. In order to minimize component count LSI devices were used whenever possible and software was used to replace hardware. 5.2 SYSTEM TARGET SPECIFICATIONS The design specifications for the CR T terminal were as follows: Display Format • 80 characters per display row • 25 display rows Character Format • 5 X 7 dot matrix character contained within a 7 X 10 matrix • First and seventh columns blanked • Ninth line cursor position • Blinking underline cursor Special Characters Recognized • Control characters • Line feed • Carriage Return • Backspace • Form feed Escape Sequences Recognized • ESC, A, Cursor up • ESC, B, Cursor down • ESC, C, Cursor right • ESC, D, Cursor left • ESC, E, Clear screen • ESC, H, Home cursor • ESC, J, Erase to the end of the screen • ESC, K, Erase the current line Characters Displayed • 96 ASCII alphanumeric characters • Special control characters 7-52 207780-001 APPLICATIONS CHARACTER GENERATOR ROM CRT TERMINAL SERIAL INPUT LINE Figure 5-1. CRT Terminal Block Diagram Characters Transmitted • 96 ASCII alphanumeric characters • ASCII control characters Program Memory • 2K bytes of 2716 EPROM Display/ B/ifler/ Stack Memory • 2K bytes 2114 static memory (4 packages) Worst case bus loading: Data Bus: Data Rate • 9600 BAUD using 3MHz 8085 8275 8255A-5 8253-5 8253-5 8251A 2x 2114 2716 8212 20pf 20pf 20pf 20pf 20pf 10pf 12pf 12pf 114pf max Only As - A15 are important since Ao - A7 are latched by the 8212 CRT Monitor • Ball Bros TV-12, 12MHz B.W. Address Bus: 4x 2114 2716 Keyboard • Any standard un-encoded ASCII keyboard 20pf 6pf 26pf max Screen Rej;'esh Rate This loading assures that all components will be compatible with a 3M Hz 8085 and that no wait states will be required • 60 Hz 5.3 HARDWARE DISCRIPTION A block diagram of the CRT terminal is shown in Figure 5. I. The diagram shows only the essential system features. A detailed schematic of the CR Tis contained in the Appendix. The terminal was constructed on a simple 6" by 6" wire wrap board. Because of the minimum bus loading no buffering of any kind was needed (see Figure 5.2). mitted, decodes the incoming characters and determines where the character is to be placed on the screen. Clearly, the processor is quite busy. The "heart" of the CRT terminal is microprocessor. The 8085 initializes all the system, loads the CRT controller, keyboard, .assembles the characters to A standard list of LSI peripheral devices surround the 8085. The 825 I A is used as the serial communication link, the 8255A-5 is used to scan the keyboard and read the system variables through a set of Figure 5-2. Bus Loading the 8085 devices in scans the be trans7-53 2077S0-001 APPLICATIONS switches, and the 8253 is used as a baud rate generator and as a "horizontal pulse extender" for the 8275. The 8275 is used as the CRT controller in the system, and a 2716 is used as the character generator. To handle the high speed portion of the terminal the 8275 is surrounded by a small handful of TTL. The program memory is contained in one 2716 EPROM and the data and screen memory use four 2114-type RAMs. process continues until the last line of the row is transferred to the dot timing logic. The dot timing logic latches the output of the character generator ROM into a parallel in, serial out synchronous shift register. This shift register is clocked at the dot clock rate (11.34 MHz) and its output constitutes the video input to the CRT. . -______~C~HA~RC~LO~C~K________, All devices in this system are memory mapped. A bipolar PROM is used to decode all of the addresses for the RAM, ROM, 8275, and 8253. As mentioned earlier, the bipolar prom also turns READs into DACK's and WR's for the 8275. The 8255 and 8253 are decoded by a simple address line chip select method. The total package count for the system is 20. not including the serial line drivers. If this same terminal were designed using the MCS-85 family of integrated circuits, additional part savings could have been realized. The four 2114's could have been replaced by two 8185's and the 8255 and the 2716 program PROM could have been replaced by one 8755. Additionally. since both the 8185 'and the 2716 have address latches no 8212 would be needed. so the total parts count could be reduced by three or four packages. lCO-LC2 t=~===j AO - A2 2708 CHARACTER GENERATOR VERT DR I ____________ J Table 5-1 RANGE PARAMETER 900 J,lsec nominal Vertical Blanking Time (VRTC) 300 J,lsec .;; PW .;; 1.4 ms Vertical Drive Pulsewidth As discussed earlier, a special POP technique was used to rapidly move the contents of the display RAM into the 8275's row buffers. The characters are then synchronously transferred to the character code outputs CCO-CC6, connected to the character generator address lines A3-A9 (Figure 5.3). Line count outputs LCO-LC2 from the 8275 are applied to the character generator address lines\AO-A2. The 8275 displays character rows one line at a time. The line count outputs are used to determine which ,line bf the character selected by A3-A8 will be displayed. F allowing the transfer of the first line to the dot timing logic. the line count is incremented and the second line of the character row is selected. This I Figure 5-3 Character Generator/Dot Timing Logic Block Diagram 5.4 SYSTEM OPERATION The 8085 CPU initializes each peripheral to the appropiate mode of operation following system reset. After initialization, the 8085 continually polls the 8251 A to see if a character has been sent to the terminal. When a character has been received, the 8085 decodes the character and. takes appropriate action. While the 8085 is executing the above "foreground" programs, it is being interrupted once every 617 microseconds by the 8275. This "background" program is used to load the row buffers on the 8275. The 8085 is also interrupted once every frame time, or 16.67 ms, to read the keyboard and the status of the 8275. HOAIZ DR ROM Horizontal Blanking Time (HRTC) 11 J,lsec nominal Horizontal Drive Pulsewidth Horizontal Repetition Rate 25 J,lsec .;; PW .;; 30 J,lsec 15,750 ±500 pps 5.5 SYSTEM TIMING Before any specific timing can be calculated it is necessary to determine what constraints the chosen CRT places on the overall timing. The requirements for the Ball Bros. TV -12 monitor are shown in Table. 5.1. The data from Table 5.1, the 8275 specifications, and the system target specifications are all that is needed to calculate the system's timing. LlNE1_ •••• " - -- UNDERLINE .'.. • POSITrON_ • LINE 10 - _ 0 • • • • • • • • • • • • • • • • • c' ( •• ( o •• , --. .. ••••••••••••••••••••• -.-.- -..-- CHARACTER 1 CHARACTER 2 CHARACTER 3 Figure 5-4. Row Format 7-54 207780-001 APPLICATIONS First, let's select and "match" a few numbers. From our target specifications, we see that each character is displayed on a 7 X 10 field, and is formed by a 5 X 7 dot matrix (Figure 5.4). The 8275 allows the vertical retrace time to be only an integer multiple of CHARACTER COUNTER STATE r-r,g:g;;;~~~~-617ns H the horizontal character line. This means that the total number of horizontal lines in a frame equals 10 times the number of character Jines plus the vertical retrace time, which is programmed to be either I, 2, 3, or 4 character lines. Twenty-five display lines ------1 OOT_ ,~;~:. iii' CHARAC~~~ CLOCK ----'i-7---~~----'iJ---.:,1111 III 1..-;-1 OC1:~I------------~' ~------------~ aD r7------------~~--- CHARACTER II I 1-10 15t.dMAX CLOC~i7~ 1il1/-------i-ii--....J I____-;-~I I ... I 6275 CHARACTER OUTPUT SECOND CHARACTER FIRST CHARACTER THIRD CHARACTER (CCO·CC6) SHIFT REGISTER OUTPUT (74166) FIRST CHARACTER VIDEO QUT SECOND CHARACTER VIDEO OUT +V VIDEO OUT , - - - - - - - - , CRT HORIZONTAL DRIVE MONITOR VERTICAL DRIVE Figure 5-5. Dot Timing Logic 7-55 207780-001 APPLICATIONS require 250 horizontal lines. So, if we wish to have a horizontal frequency in the neighborhood of 15,750 Hz we must choose either one or two character lines for vertical retrace. To allow for a little more margin at the top and bottom of the screen, two character .lines were chosen for vertical retrace. This choice yields a net 250 + 20 = 270 horizontal lines per frame. So, assuming a 60 Hz frame: be allowed for horizontal retrace. Unfortunately, this number depends almost entirely on the monitor used. Usually, this number lies somewhere,between 15 and 30 percent of the total horizontal line time, which in this case is 1/16,200 Hz or 61.73 microseconds. Since in most designs a fixed number of characters can be displayed on a horizontal line, it is often useful to express retrace as a given number of character times. In this design, 80 characters can be displayed on a horizontal line and it was empirically found that allowing 20 horizontal character times for retrace gave the best results. So, in reality, there are 100 character times in every given horizontal line, 80 are used to display characters and 20 are used to allow for retrace. It should be noted that iftoo many character times are used for retrace, less time will be left to display the characters and the display will not "fill out" the screen. Conversely, if not enough character times are allowed for retrace, the display may ~'run off' the screen. One hundred character times per complete horizontal line means that each character requires 61.73 microseconds /100 character times =617.3 nanoseconds. If we mUltiply the 20 horizontal retrace times by the 60 Hz * 270 = 16,200 Hz (horizontal frequency) This value falls within our target specification of 15,750 Hz with a 500 Hz variation and also assures timing compatibility with the Ball monitor since, 20 horizontal sync times yield a vertical retract time of: 61.7 microseconds X 20 horizontal sync times = I. 2345 milliseconds This number meets the nominal VRTC and vertical drive pulse width time for the Ball monitor. A horizontal frequency of 16,200 Hz implies a ljl6,200 =61.73 microsecond period. It is now known that the terminal is using 250 horizontal lines to display data and 20 horizontal lines to allow for vertical retrace and that the horizontal frequency is 16,200 Hz. The next thing that needs to be determined is how much time must I. . . . . . 1 LATCH CHARI 1 "'," 1 "'," 1. . . . . . 1 ":6' ~ . I , HRTe (82751 CHAR CODe 182751 LINe COUNT 182751 SHIFT--I--+-t--f--t---t-+--+--t---t--+--t-t--t--t-H 1.---j' LOAD LOAD REGISTER LO,O,"O VIDEO OUTPUT 'T ' '"'1" 'I--j.---.t--i--~I- : I Figure 5·6. CRT System Timing 7-56 207780-001 APPLICATIONS 617.3 nanoseconds needed for each character, we find 617.3 nanoseconds * 20 retrace times = 12.345 microseconds This value falls short of the 25 to 30 microseconds required by the horizontal drive of the Ball monitor. To correct for this, an 8253 was programmed in the one-shot mode and was used to extend the horizontal drive pulsewidth. SWITCHED CHANGED Now that the 617.3 nanosecond character clock period is known, the dot clock is easy to calculate. Since each character is formed by placing 7 dots along the horizontal. DOT CLOCK PERIOD =617.3 ns (CHARACTER CLK PERIOD)! 7 DOTS DOT CLOCK PERIOD =88.183 nanoseconds DOT CLOCK FREQUENCY = I!PERIOD = 11.34 MHz Figures 5.5 and 5.6 illustrate the basic dot timing and the CRT system timing, respectively. 6. SYSTEM SOFTWARE 6.1 SOFTWARE OVERVIEW As mentioned earlier the software is structured on a "foreground-background" basis. Two interruptdriven routines, FRAME and POPDAT (Fig. 6.1) request service every 16.67 milliseconds and 617 microseconds respectively, frame is used to check the baud rate switches, update the system pointers and decode and assemble the keyboard characters. POPDAT is used to move data from the memory into the 8275's row buffer rapidly. EXIT The foreground routine first examines the line-local switch to see whether to accept data from the USART or the keyboard. If the terminal is in the local mode, action will be taken on any data that is entered through the keyboard and the USART will be ignored on both output and input. If the terminal is in the line mode data entered through the keyboard will be transmitted by the USART and action will be taken on any data read out of the USART. When data has been entered in the terminal the software first determines if the character received· was an escape, line feed, form feed, carriage return, back space, or simply a printable character. If an escape was received the terminal assumes the next received character will be a recognizable escape sequence character. If it isn't no operation is performed. EXIT After the character is decoded, the processor jumps to the routine to perform the required task. Figure 6.2 is a flow chart of the basic software operations; the program is listed in Appendix 6.8. Figure 6-1. Frame and Popdat Interrupt Routines 7-57 207780-001 ·APPLICATIONS ROW 1 ROW2 ROW3 ROW4 ROW5 ROW6 ROW7 ROW8 ROW9 ROW 10 ROW 11 ROW 12 ROW 13 ROW 14 ROW 15 ROW 16 ROW 17 ROW 18 ROW 19 ROW 20 ROW 21 ROW 22 ROW 23 ROW 24 ROW 25 LINE Figure 6-2. Basic Terminal Software 1st Column 2nd Column .......... 80th Column 0800H 0850H 08AOH 08FOH 0940H 0990H 09EOH OA30H OA80H OAOOH OB20H OB70H OBCOH OC10H OC60H OCBOH OOOOH 0050H OOAOH OOFOH OE40H OE90H OEEOH OF30H OF80H 0801 H ............. 084FH 0851H ............. 089FH 08A 1 H ............ 08EFH 08F1 H ............. 093FH 0941H ............. 098FH 0991 H ............. 090FH 09E1 H ............ OA2FH OA31H ........... OA7FH OA81H ........... OACFH OA01 H ........... OB1 FH OB21 H ........... OB6FH OB71 H ........... OBBFH OBC1 H ........... OCOFH OC11H ........... OC5FH OC61 H ........... OCAFH OCB1 H ........... OCFFH 0001H ........... 004FH 0051H ........... 009FH OOA1H ........... OOEFH OOF1 H ............ OE3FH OE41H .............OE8FH OE91 H ............ OEOFH OEE1 H ............ OF2FH OF31 H ............. OF7FH OF81 H ............ OFCFH Figure 6-3. Screen Display After Initialization 6.2 SYSTEM MEMORY ORGANIZATION Subroutines CALCU (Calculate) and ADX (ADd X axis) use these three variables to calculate an absolute memory address. The subroutine CALCU is used whenever a location in the screen memory must be altered. The display memory organization is shown in Figure 6.3. The display begins at location 0800H in memory and ends at location OFCFH. The 48 bytes of RAM from location OFDOH to OFFFHare used as system stack and temporary system storage. 2K bytes of PROM located at OOOOH through 07FFH contain the systems program. 6.4 SOFTWARE TIMING One important question that must be asked about the terminal software is, "How fast does it run". This is important because if the terminal is running at 9600 baud, it must be able to handle each received character in 1.04 milliseconds. Figure 6.5 is a flowchart of the subroutine execution times. It should be pointed out that all of the times listed are "worst case" execution times. This means that all routines assume they must do the maximum amount of data manipulation. For instance, the PUT routine assumes that the character is being placed in the last column and that a line feed must follow the placing of the character on the screen. 6.3 MEMORY POINTERS AND SCROLLING To calculate the location of a character on the screen, three variables must be defined. Two of these variables are the X and Y position of the cursor (CURSX, CURSY). In addition, the memory address defining the top line of the display must be known, since scrolling on the 8275 is accomplished simply by changing the pointer that loads the 8275's row buffers from memory .. So, if it is desired to scroll the display up or down all that must be changed is one 16-bit memory pointer. This pointer is entered into the system by the variable TOPAD (TOP Address) and always defines the top line of the display. Figure 6.4 details screen operation during scrolling. How fast do the routines need to execute in order to assure operation at 9600 baud? Since POPDAT interrupts occur every 617 microseconds, it is possible to receive two complete interrupt requests in every character time (1042 microseconds) at 9600 7-58 207780-001 APPLICATIONS ROW 1 ROW 2 ROW3 ROW4 ROW5 ROW6 ROW7 ROW8 ROW9 ROW 10 ROW 11 ROW 12 ROW 13 ROW 14 ROW 15 ROW 16 ROW 17 ROW 18 ROW 19 ROW 20 ROW 21 ROW 22 ROW 23 ROW 24 ROW 25 0800H 0850H 08AOH 08FOH 0940H 0990H 09EOH OA30H OA80H OADOH OB20H OB70H OBCOH OC10H OC60H OCBOH ODOOH OD50H ODAOH ODFOH OE40H OE90H OEEOH OF30H OF80H ROW2 ROW3 ROW4 ROW5 ROW6 ROW7 ROW8 ROW9 ROW 10 ROW 11 ROW 12 ROW 13 ROW 14 ROW 15 ROW 16 ROW 17 ROW 18 ROW 19 ROW 20 ROW 21 ROW 22 ROW 23 ROW 24 ROW 25 ROW 1 0801 H ............. 084FH 0851 H ............. 089FH 08A1H ............ 08EFH 08F1 H ............. 093FH 0941H ............. 098FH 0991 H ............. 090FH 09E1 H ............ OA2FH OA31H ........... OA7FH OA81H ........... OACFH OAD1H ........... OB1FH OB21H ........... OB6FH OB71H ........... OBBFH OBC1 H ........... OCOFH OC11H ........... OC5FH OC61H ........... OCAFH OCB1H ........... OCFFH OD01H ........... OD4FH OD51H ........... OD9FH ODA1H ........... ODEFH ODF1H ............ OE3FH OE41H ............. OE8FH OE91H ............ OEDFH OEE1H ............ OF2FH OF31 H ............. OF7FH OF81 H ............ OFCFH 0850H 08AOH 08FOH 0940H 0990H 09EOH OA30H OA80H OADOH OB20H OB70H OBCOH OC10H OC60H OCBOH ODOOH OD50H ODAOH ODFOH OE40H OE90H OEEOH OF30H OF80H 0800H After 1 Scroll After Initialization ROW3 ROW4 ROW5 ROW6 ROW7 ROW8 ROW9 ROW 10 ROW 11 ROW 12 ROW 13 ROW 14 ROW 15 ROW 16 ROW 17 ROW 18 ROW 19 ROW 20 ROW 21 ROW 22 ROW 23 ROW 24 ROW 25 ROW 1 ROW 2 08AOH 08FOH 0940H 0990H 09EOH OA30H OA80H OADOH OB20H OB70H OBCOH OC10H OC60H OCBOH ODOOH OD50H ODAOH ODFOH OE40H OE90H OEEOH OF30H OF80H 0800H 0850H 0851H ............. 089FH 08A1H ............ 08EFH 08F1 H ............. 093FH 0941H ............. 098FH 0991 H ............. 090FH 09E1 H ............ OA2FH OA31H ........... OA7FH OA81H ........... OACFH OAD1 H ........... OB1 FH OB21 H ........... OB6FH OB71H ........... OBBFH OBC1 H ........... OCOFH OC11H ........... OC5FH OC61H ........... OCAFH OCB1H ........... OCFFH OD01H ........... OD4FH 0051 H ........... OD9FH ODA1H ........... ODEFH ODF1 H ............ OE3FH OE41H ............. OE8FH OE91H ............ OEDFH OEE1H ............ OF2FH OF31 H ............. OF7FH OF81H ............ OFCFH 0801 H ............. 084FH 08A1H ............ 08EFH 08F1 H ............. 093FH 0941 H ............. 098FH 0991H ............. 090FH 09E1H ............ OA2FH OA31H ........... OA7FH OA81H ........... OACFH OAD1 H ........... OB1 FH OB21 H ........... OB6FH OB71H ........... OBBFH OBC1 H ........... OCOFH OC11H ........... OC5FH OC61H ........... OCAFH OCB1 H ........... OCFFH OD01H ........... OD4FH 0051 H ........... OD9FH ODA 1 H ........... ODEFH ODF1H ............ OE3FH OE41 H ............. OE8FH OE91H ............ OEDFH OEE1H ............ OF2FH OF31H ............. OF7FH OF81H ............ OFCFH 0801 H ............. 084FH 0851H ............. 089FH ROW4 ROW 5 ROW6 ROW7 ROW8 ROW9 ROW 10 ROW 11 ROW 12 ROW 13 ROW 14 ROW 15 ROW 16 ROW 17 ROW 18 ROW 19 ROW 20 ROW 21 ROW 22 ROW 23 ROW 24 ROW 25 ROW 1 ROW 2 ROW3 08FOH 0940H 0990H 09EOH OA30H OA80H OADOH OB20H OB70H OBCOH OC10H OC60H OCBOH ODOOH OD50H ODAOH ODFOH OE40H OE90H OEEOH OF30H OF80H 0800H 0850H 08AOH 08F1 H ............. 093FH 0941 H ............. 098FH 0991H ............. 090FH 09E1H ............ OA2FH OA31H ........... OA7FH OA81H ........... OACFH OAD1H ........... OB1FH OB21 H ........... OB6FH OB71H ........... OBBFH OBC1H ........... OCOFH OC11H ........... OC5FH OC61H ........... OCAFH OCB1 H ........... OCFFH OD01H ........... OD4FH OD51H ........... OD9FH ODA1H ........... ODEFH ODF1H ............ OE3FH OE41H ............. OE8FH OE91H ............ OEDFH OEE1H ............ OF2FH OF31H ............. OF7FH OF81H ............ OFCFH 0801H ............. 084FH 0851H ............. 089FH 08A1H ............ 08EFH After 3 Scrolls After 2 Scrolls Figure 6-4. Screen Memory During Scrolling 7-59 207780-001 APPLICATIONS By adding up the times for any loop, it is clear that all routines meet this speed requirement, with the exception of ESC J. This means that if the terminal is operating at 9600 baud, at least one character time must be inserted after an ESC J sequence. baud. Each POPDA T interrupt executes in 211 microseconds maximum. This means that each routine must execute in: 1042 - 2 * 211 =620 microseconds ( START) I INITIALIZE 21'1.25~s NO P011 53~s I CHREC iii i i Tr r i i i esc A esc B esc C esc 0 esc E esc H esc J esc K LF CR 78.7~s 324~s 107~s 119~s 316~s 105~s 862~s 310~s 306~s 42~s OUT 456 Figure 6-5. Timing Flowchart 7-60 207780·001 APPLICATIONS 8212 IC2 "8 II "'I "'2 "'3 IC5 ""01, DlI RESET fs! 7 A£ "SA4 A3A2 A1 A() AS AgAlOOEDO 01 02 03 °405 0607 CE 2322 1 0' 1011 1314 1516 1 I 2 3 4 51'1'1' I1 2D , A,' IT 1 J8 " AD2~1~4----~-+-+--r-r-+----------------------------------~_+4---~~+-~~~--+_+--- AD3f'~5------~-+--r-r-+---------------------------------~-+~----~+-~--r+--+-+--- AD4~1~'--------~--r-r-+----------------------------------~_+4----------~~+--+_+--- 8085 AD5pl~'----------~~r-+---------------------------------~_+4-------~~~+-_f_+--- AD,pl~'------------~~+---------------------------------~-+~--------__~+-_f-+--- ADI~I~'----------------__--------------------------------~_+4-----------~+--+_+--- A8 21 IC1 A9 22 AIO~2~3--------------~------------------------------------~4-------------+-_f_+---'"p2~'--------------~-'------------------------------------~----________+-_f-+---- L~~!l ~ ~~SlD AJ2~ ___--~----~~~--------~------------------------+-------------t--+-r--- -= 8275~ 21 22 ADlf'~3--~~-+-+--r-r-+---------------------------------~-+~~~~+-~~+--+-+--- ijj:,., IRQ ~cs J9 ADD 30 ALE 6.1:~~~X, :~S:~~ ~ ORO 8275 -------.! r- 2716 01, ~ 10~ r-- 10 17 DiS ICC 10 7474 .--- , , "" 15 "'5 ""DO, eLA MD ST8 4 '13P2~'~~----------~-+-+----------------------------------~------------+-_f-+---RESET OUT RST '5 RST 5_5 A14 p2,-'~~----------+_+-+----------------------------------~------------+--+_+---- 'IS p2~8~~----------+_+-+----------------------------------4-------------+--+_+---AD 32 ,~:D3:1 S~D ~WA 31 '~;;04 Ie 4 7400 7400 IC4 7400 IC 4 __ r"iA4;--'A;D~e~s-AA:l1,..--______________J I . A2 r-------------------' A3r--------------------" ,-....r--'-A ADDRESS DECODE PROM Ce 2716 r---------------------------------------------------------------~~~ UK ___f_+_VV~ CS 2114 HIGH UK CS 2114 lOW 4,7K r-----------------------------------------------------~~----~8275WR r---------------~----------------~~8275DACK r----------------+--------------------------------------+-.---~CS8255 r----------------+-.--------------~~8275CS L_~~~~~-~----------------j_ITI_r_~,---------~8275RD L':~ __ v--l 4_7K""",,.. '----__4"'.7"'KVll'v-lT +5 ~., Appendix 7.1 CRT TERMINAL SCHEMATICS 7-61 207780-001 APPLICATIONS IC6 CS IC7 -C 2114 A7 AS AS A4 Aa A2 AlAn As AgIO I lO ziOalO 4WE 2114 AT AS AS A4 A3 AZ A,An AS AgIO,IOz10aI04WE 171 23 '1716r 161 51413 1211 0 23 '17 65 161 51' 13121t 0 171 CS I 11 1 1 ICg IC8 Lecs Lc CS 2114 AT AS AS A4 A3 A AlAn As AgIO,IDZI03104WE 171 23 , '16 5161 51' 1312, 0 2114 AT A6 AS A4 Aa AZA,AO As AgIO,IOZI03104WE 1712' 3 'l'I6r 161514 1312\ 0 11 1 1 - - '------ ~1 len 7404 7404 2728 12'56 , B B' 65' 321 °0,°,°2°3°4°5 06 07 DoD,DzDaD4DsD6D721 ---'-'! ----.1!! UK ?B 4.7K +5 ~ AlIBI 8253 IC 20 ~RO 8251A IC1' 10 WR GATE o 1l.--PG 2 Ie 14 no ~SERIAl OUT DUTO flL--PG 2 IC 11 GAUZ 9 ClKO ...........-- PG 2 Ie 10 12 iiii RIO TO RESET OUT.--! RESET 8085 23 LJ= Wii 11 CSO- --..!.? c/o CS~ '0 191 9 DUll 17 U ClK2 J..-- SERIAL IN TiC RiC t ." TO ClK OUT ON 8085 TOIC10 8085 ClK 7 2 7-62 207780-001 APPLICATIONS Au SHEET 1 A1 SHEET 1 DO SHEET 1 01 SHEET 1 02 SHEET 1 03 SHEET 1 04 SHEET 1 o5 SHEET 1 o6 SHEET 1 o7 SHEET 1 Ro SHEET 1 WR SHEET 1 27 28 29 30 31 32 33 34 07 06 05 04 03 02 01 00 Wii 36 VCC iiii 5 ~ ~C :=::~ :=::~ -. 14 PCO AO 15 PCI AI 16 PC2 IC17 17 PC3 8255A-5 6 9 TO 05 IC 3 8 3S P80 TO RESET OUT 808S 18 RLO PSI 19 P82 20 13 PC4 12 PCS 1-0' __':: RLI RL2 21 P83 22 ' P B 10 PC7 4 23 PBS 24 VCC -1!! P86 2S P87 PAO PAl PA2 PA3 PA4 PAS PA6 PA7 II PC6 ~~ '* ES BAUD RATE SENSE SWITCHES AND LINE-LOCAL SWITCH RL3 RL4 RLS RL6 ~ 4+ 3+ 2+ 1+ 40+ l 3 * 37+ , SLO SL I SL2 SL3 SL4 SLS SL6 SL7 KEYBOARD RETURN LINES RL7 1 ?' 10 K!l Vcc KEYBOARD SCAN LINES Appendix 7.1 CRT TERMINAL SCHEMATICS 7-63 207780-001 APPLICATIONS 11.34 MHz XTAL 10pF UI I 330n +5 330n (4) 7404 "::" 7404 DOTOSC 7410 DOT CLOCK IC 10 7474 10 11 ClK PAESET _12 TO IC3 07 TO IC3 03 TO IC3 06 TO IC3 04 19 18 17 16 15 14 13 12 21 07 06 05 04 03 02 01 DO 29 AD CC6 28 CC5 AD CC 4 27 CC 3 26 WA CC2 25 22 CS 8275 IC 13 oACK TO ICI AST 6.5 5 OAO TO ICI AST 5.5 31 lAO IC15 22 A9 DO 9 14 23 A8 01 10 12 I A7 II CCI 24 4 A4 02 II 03 13 14 04 05 15 CCo 23 5 A3 06 16 07 17 2 A6 3 A5 l2 2 A2 II 3 AI lO 4 AD 2716 7 IC 16 ClK 15 lOAD 10 74166 TO CClK 8275 TO ClK 0 8253 PG 1 2 A OH 13 TO GATE 0 8253 PG 1 HATC 7 +5 VATC B TO Ilio PIN 5 lTEN 37 30 CClK 1K VSP 35 VERTICAL DRIVE IC13 +5 1K VIDEO OUT +5 7410 OUTO 8253 PG 1 74175 IC14 1K 7404 CRT TERMINAL (5) (6) HORIZONTAL DRIVE IC 11 7-64 207780-001 APPLICATIONS action is taken. By operating the keyboard scan in this manner an automatic debounce time of 16.67 milliseconds is provided. Appendix 7.2 KEYBOARD INTERFACE The keyboard used in this design was a simple unencoded ASCII keyboard. In order to keep the cost to a minimum a simple scan matrix technique was implemented by using two ports of an 8255 parallel 110 device. Figure 7.2A shows the actual physical layout of the keyboard and Figure 7.2B shows how the individual keys were encoded. On Figure 7.2B the scan lines are the numbers on the bottom of each key position and the return lines are the numbers at the top of each key position. The shift, control, and caps lock key were brought in through separate lines of port C of the 8255. Figure 7.3 shows the basic keyboard matrix. When the system is initialized the contents of the eight keyboard RAM locations are set to zero. Once every frame, which is 16.67 milliseconds the contents of the keyboard ram is read and then rewritten with the contents of the current switch matrix. If a nonzero value of one of the keyboard RAM locations is found to be the same as the corresponding current switch matrix, a valid key push is registered and In order to guarantee that two scan lines could not be shorted together if two or more keys are pushed simultaneously, isolation diodes could be added as shown in Figure 7.4. / SPACE BAR Figure 7-2A. Keyboard Layout TOP NUMBER = RETURN LINE BOTTOM NUMBER = SCAN LINE Figure 7-28. Keyboard Encoding 7-65 207780-001 APPLICATIONS Appendix 7.3 ESCAPE/CONTROL/DISPLAY CHARACTER SUMMARY BIT 000 0000 NUL 0001 SOH p OLE A DC2 ETX t DC3 T 0 0100 EOT DC4 E 0101· ENQ 0110 ACK F : :: ;: :: :: 1000 : 1001 HT U NAK SYN : TB VT . 1101 1111 FS SO A Q A Q " 2 B R B R # 3 C S C S $ 4 0 T D T % 5 E U E U & 6 F V F V 7 G W G W 8 H X H X 9 I Y I y. : J Z J Z ; K [ K < L \ L = M 1 M > N /\ N ? 0 - 0 ) Z . + / - GS A RS 0 Sl I ( EM N 1110 ! us - / : NOTE: 011 10 100 1 110 111 P f -- + A B C 0 CLR E HOME H EOS I EL J " " :; p w KJII FF ::::::: : @ 'y L 1100 v CAN I ::::,t:,~f.!':::':::':::~ SUB 1011 q, 010 X :::,:::::::,:::::::::::::,:::::: 1010 s 100 10 1 110 111 SP Q. R STX 0011 0111 lOCI B 0010 010 011 001 @ ESCAPE. SEQUENCE DISPLAYABLE CHARACTER CONTROL CHARACTERS , Shaded blocks "' functions terminal will re,act to. Others can be generated but are illnored up on receIpt. 7-66 207780-001 APPLICATIONS SCAN LINES o 2 8 9 3 4 o 5 7 6 \ as +5 BREAK 10K 10K 10K 10K 10K 10K 10K 10K Figure 7-3. Keyboard Matrix Appendix 7.4 PROM DECODING SCAN LINES As stated earlier, all of the logic necessary to convert the 8275 into a non-DMA type of device was performed by a single small bipolar prom: Besides turning certain processor READS into DACKS and WRITES for the 8275, this 32 by 8 prom decoded addresses for the system ram, rom, as well as for the 8255 parallel I/O port. Any bipolar prom that has a by eight configuration could function in this application. This particular device was chosen simply because it is the only "by eight" prom available in a 16 pin package. The connection of the prom is shown in detail in Figure 7.5 and its truth table is shown in Figure 7.6. Note that when a fetch cycle (M I) is not being performed, the state of the SOD line is the only thing that determines if memory reads will be written into the 8275's row buffers. This is done by pulling both DACK and WRITE low on the 8275. Also note that all of the outputs of the bipolar prom MUST BE PULLED HIGH by a resistor. This prevents any unwanted assertions when the prom is disabled. 10k --------~~~------~--~----~~5V RETURN LINES 10k ----------r-~------_r--~----~VVV5V Figure 7-4. Isolating Scan Lines With Diodes 7-67 207780-001 APPLICATIONS Appendix 7.5 CHARACTER GENERATOR ENABLE As previously mentioned, the character generator used in this terminal is a 2716 or 2758 EPROM. A I K by 8 device is sufficient since a 128 character 5 by 7 dot matrix only requires 8K of memory. Any "standard" or custom character generator could have been used. CE2716 SOD (8085) CE 2114 0800H·OBFFH Al0 CE2114 (8085) OCOOH·OFFFH All Wi 8275 (8085) A12 The three low-order line count outputs (LCO-LC2) from the 8275 are connected to the three low-order address lines of the character generator and the seven character generator outputs (CCO-CC6) are connected to A3-A9 of the character generator. The output from the character generator is loaded into a shift register and the serial output from the shift register is the video output of the terminal. DACK 8275 (8085) cs Ml (8085) 8255 cs N ow, let's assume that the letter "E" is to be displayed. The ASCII code for "E" is 45H. So, 45H is presented to address lines A2-A9 of the character generator. The scan lines will now count each line from zero to seven to "form" the character as shown in Fig. 7.7. This same procedure is used to form all 128 possible characters. 8275 VCC VCC GND GND iffi 8275 Figure 7-5. Bipolar Prom (825123) COnnection i '" < 4: o"c :;x: ~ A4 A3 A2 A1 AO o o o o o o o o o o o o o o o o 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 O' 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 It should be obvious that "custom" character fonts could be made just by changing the bit patterns in the character generator PROM. For reference, Appendix 7.6 contains a HEX dump of the character generator used in this terminal. 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 07 06 05 04 03 02 01 DO 1 1 1 1 1 1 1 1 1 1 o o 1 1 1 1 1 1 1 1 1 1 1 1 1 1 o o 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 a 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 a i 1 1 1 1 1 1 1 1 1 1 1 1 1 0 1 0 1 0 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 0 1 0 1 0 1 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 45H = 01000101 Address to Prom = 01000101 SL2 SL 1 SLO = 228H - 22FH Depending on state of Scan lines. Character generator output Rom Address 228H 229H 22AH 22BH 22CH 22DH 22EH 22FH a 1 1 1 1 1 1 1 1 1 1 1 1 Rom Hex Output 0 3E Bit Output* 1 2 3 4 5 6 7 02 02 OE 02 02 3E 00 Bits 0, 6 and 7 are not used. • note bit output is backward from convention. Figure 7-6. Truth Table Bipolar Prom Figure 7-7. Character Generation 7-68 207780-001 APPLICATIONS Appendix 7.6 HEX DUMP OF CHARACTER GENERATOR 7-69 207780-001 APPLICATIONS Appendix 7.7 COMPOSITE VIDEO In this design, it was assumed that the monitor required a separate horizontal drive, vertical drive, and video input. However, many monitors require a composite video signal. The schematic shown in Figure 7.8 illustrates how to generate a composite video signal from the output of the 8275. HRTC VRTC 2.2K The dual one-shots are used to provide a small delay and the proper horizontal and vertical pulse to the composite video monitor. The delay introduced in the vertical and horizontal timing is used to "center" the display. VR I and VR2 control the amount of delay. IC3 is used to mix the vertical and horizontal retrace and Q1 along with the R 1, R2, and R3 mix the video and the retrace signal and provide the proper DC levels. 7486 VIDEO )-----Wlr--' COMPOSITE VIDEO OUT . Figure 7-8. Composite Video Appendix 7.8 SOFTWARE LISTINGS ISIS-II 8083/8385 MACRO ASSEMBLER, Lac: CBJ X1~8 SEQ SOURCE STATEMENr MACROFlLE 2 :NO rw. 8275 SOF1WARE ALL I/O IS IoIEMOOY MAPPED 3 :SYSTEM RO'! 1l00I'JH TO 1'J7FFH . 4 :SYSTEM RA/.I 1'J811llllH TO I'JFFFH 5 :8275 WRITE 1I'JIIllllH TO 13FFH 6 :8275 READ 141'J0H TO 17FFH 7 :8255 READ/WRITE 1801lH TO IFFF 8 :8253 ENABLED BY A14 9 L8251 EN~qLED BY A15 II'J PORTA 1:000 1811l3H :8255 PORT A ADDRESS 11 PORTB EOO 1801H :8255 PORT B ADrnESS 12 PORTC EOO 1802H :8255 PORT C ADDRESS 13 CNWD55 EOO :8255 CONTROL PORT ADDRESS 18rBH 14 usn" EQU I'JMlllllH :8251 FLAGS 15 USTD EOO M000H :8251 DATA . If) CN'f0 EOO f)QJIl0H :8253 COlJlll·rER 0 17 CNTI EQU 6001H :8253 COlJlllTER 1 18 CN'f2 :8253 COlJlllTER 2 EOO 6002H 19 CN'II'! EQU 6033H :8253 iIIODE WORD 20 CRTS :8275 CONTROL ADDRESS EQU .1001H 21 CRTM EQU 131lllH :8275 MODE ADDRESS :8275 INTERRUPT CLEAR 22 INT75 EOO 141l1H 23 TPDIS EQU 1l800H :TOP OF DISPLAY ~~ EQU 3F8QJH 24 BTDIS :BOrl'O'l OF DISPLAY ~101 EQU 3FD(JH :FIRST BYTE AFTER DISPLAY 25 LAST 26 CURBOf EOO 18H :BOrl'O'l Y CURSOR 27 LNGfH EOO 01l50H :LENGrH OF ONE LINE 28 STPTR :LOCATION OF STACK POINTER EOO 0FE0H 29 ; START PROGRAIoI 31'J 31 : ALL VARIABLES ARE INITIALIZED BEFORE ANVrHING ELSE 32 33 bI 'DISABLE IN'rERRUPTS Sp,STPTR 34 LXI ; LOAD STACK POINTER 35 LXI :LOAD H&L WI'rH TOP OF DISPLAY ~~IS SHLD 36 :SET 'rap = TOP OF DISPLAY SHLD ClRAD :STORE THE CURRENT ADrnESS 37 38 MVI A,0IlH ;ZERO A STA 39 CURSY :ZERO CURSOR Y POIN'rER 40 STA CURSX ;ZERO CURSOR X POI~rER 41 s'rA KBCHR :ZERO KBD CHARACTER 42 STA USCHR :ZERO USART CHAR BUFFER STA KEYIJfIN :ZERO KEY OOIIN 43 1 $1'10005 1803 1801 18~2 1803 M01 A0~3 6003 61'l01 6032 6~03 1001 1003 1401 0800 0F80 0FD0 0018 0050 I'JFE0 1'J001'J 001'J1 1'J1'J04 3307 1'J30A I'JIIlIlD 1'J1'J0F 1'J1'J12 31'J15 1'J1'J18 1'J31B F3 3H:00F 210038 22E33F 22E80F 3E30 32ElI'JF 32E2I'JF 32EBI'JF 32E73F 32EMF 7-70 207780-001 APPLICATIONS 001E 32ED0F 0021 32EE0F 0024 C3980~ 002C 002C C35701 0034 0034 0035 0036 0037 003A 003B 003C "'03F 0040 0042 F5 E5 D5 210000 39 EB 2AE80F F9 3EC0 3'" 0043 0044 0045 0046 0047 E1 E1 E1 E1 E1 0~48 E1 0049 E1 004A E1 004B E1 "'~4C E1 004D E1 004E E1 004F E1 0"'50 E1 0051 E1 0052 E1 0053 E1 0054 E1 0055 E1 0056 E1 0057 E1 0058 E1 0~59 E1 00SA E1 "'~5B E1 005C E1 0115D E1 005E E1 015F E1, 01161'l E1 0061 E1 0062 E1 0063 E1 0064 E1 0065 E1 0066 E1 0067 E1 0068 E1 01169 E1 00SA E1 006B 0F 006C 30 006D 210000 0070 39 0071 EB 0072 F9 0073 21D00F 0076 EB 0077 7A 0078 BC 0079 C2840a ~~~g.~~ 007E 0081 0084 0087 0089 C28400 2100~8 22E80F 3E18 30 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 fi1 POPDAT: 62 63 64 65 66 67 58 69 70 71 72 73 74+ 75+ 76+ 77+ 78+ 79+ 80+ 81+ 82+ 83+ 84+ 85+ 86+ 87+ 88+ 89+ 90+ 91+ 92+ 93+ 94+ 95+ 9fi+ 97+ 93+ 99+ 100+ 101+ 102+ 103+ 104+ 105+ 106+ 107+ 108+ 109+ 110+ 111+ 112+ 113+ 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 KPTK: 130 131 STA STA JMP KEYOK ESCP LPK8D ;ZERO KEYOK ;ZERO ESCAPE ;JU'IP AND SET EVER'l1'HING UP ;THIS JU~P VECTOR 15 LOCATED AT THE Rs'r 5.5 LOCATION ·OF THE 8085. IT 15 USED 'ro READ 'rnE 8275 STATUS AND ;READ THE KEYBG\RD. THIS ROUrlNE 15 EXECUfED ONCE EVERY ; 11;.667 i'lILLISECONCG. ; mG 0~2CH JMP FAA'lE ;THIS ROU'rlNE 15 LOCATED AT THE RST 6.5 LOCATION OF THE ;8085 AND IS USED TO LOAD THE o\TA TO BE DISPLAYED INTO ;THE 8275. THIS ROUrINE IS EXECUfED ONCE EVERY 617 MICRCEECONCG. 6RG PUSH PUSH PUSH ~f, XCIIG LHLD SPHL I>1VI SIM 34H P5W H D ;SAVE A .a.ND FLAGS ;SAVE HAND L ;SAVE D AND E ;ZERO H AND L ; pu'r STACK POIN'rER IN H AND L ;pu'r STACK IN D AND E ;GET POINTER ;pur CURRE1'l1' LINE INTO SP ;SET MASK FOR S1M ~p00fHlH CUMO A,OC0H ~5r (L~1V2) ENIl'I POP Pop Pop Pop POP POP pop POP POP Pop POP POP PoP POP POP POP POP POP POP POP POP POP POP POP POP POP POP POP Pop POP Pop Pop Pop Pop Pop POP PoP POP Pop POP RRC SIM LXI DAD XCIIG SPHL LXI -XCIIG MOV CMP JNZ MOV JNZ CI>\P LXI SHill MIll H H H H H H H Ii Ii Ii H H H H H H H H H H H H H H H H H H H H H H H H H H H H Ii H ;SET UP A ;GO BACK TO NCRlI\AL MODE ;ZERO HL ;ADD STACK ;PUT STACK IN H AND L ; RESTORE STACK ;pu'r BaITO~ DISPLAY IN HAND L ·SWAP RElJISTERS ; pu'r HIGH OHDER IN A ;SEE IF SAME AS H • IF NOT LEAVE ; pu'r W!I ORDER IN A ;SEE IF SA'IE AS L ; IF NOT LEAVE ;LOAD Ii AND L I'IITH 'rap OF SCREEN rIIEMCRY ;pu'r BACK CURREN'r ADDRESS ;SET I>!ASK ;ou'rPUTMASK H,0000H SP H,LAST ~,D KPTK A,E L KPTK H,TPDIS CLRAD A,18H SIM 7-71 207780-001 APPLICATIONS 1'J1'J8A 01l8B 038C 1'J380 1ll08E 01 El F1 FB C9 1ll1ll8F 3E18 1ll1l91 311 1ll1l92 C1 1ll1'J93 Dl . 1ll1l94 El 11395 F1 1l1l9'i FB 1l097C9 111398 32EFIlF 1l1l9B 32FIlllF 1'J1l9E 32F1IlF 1l1lA1 1'J1lA4 1l1lA7 1l1lA9 IllIlM 00AB IllIlAC IlW' 1l0BIl IlIlBl 211ll1l38 IllDl'Jl'lF 36211 23 7C B8 C2A7~11 70 B9 C2A7~11 IlllB4 3E8B 111186 32"318 Ill"B9 "0BC "38E "oc" IllOC2 3OC3 I'JOC5 211ll1AI'J 3681'1 360" 364" Illlll 36EA 361'15 IlOC7 IllOC9 IllOCC IllOCE "1'101 1'11'103 1ll"06 IlllllD9 3E32 32"363 3E32 3211360 3E"3 32"1ll6I'J CDDeIllIll C3F903 "IlDe 3A1'J218 Illlll0F E61lF 1ll3E1 32ECIlF "IlE4 1'J7 0"E5 21C51'15 IlllllE8 161l1ll "0EA SF ""EB 19 lll"Ee 11"361'1 01llEF 3EB6 1ll3F1 12 IllllF2 IB IlllllF37E IlllllF4 12 IlllllF5 23 01llF6 7E "IllF7 12 33F8 C9 132 I?OP 0 ·GET 0 AND E 133 POI? ;GE'T HAND L H 134 POI? I?SW ·GET A I'.ND FLI'.GS EI ;'ruRN ON IN'rERRU?l'S 135 RET 136 ;GO BJICK 137 ;'THIS IS THE EXIT ROU'fINE FeR THI': FAAME IN'TERRUPT 138 139 141ll BYPASS: ~VI A,18H ;SET MASK SI"I ;Ol1TPUT THE MASK 141 142 POP 8 ·GE'T B AND C ;GEO 0 A.ND E 143 POP 0 POP ;GET H AND L 144 H PS,o/ ;GET A AND FLACO 145 POP 141'; EI ; ENABLE IN'l'ERRUPr5 147 RET ;GO BACK 148 149 ;THIS CLEARS 'rHE AREA OF AA'I THA'r IS USED ;FOR KEYB~RD nEBOUNCE. 1511 151 152 LPKBD: §TA ;ZERO SHIFT COOfROL SHCON S'TA RETLIN ;ZERO RE'ruHN LINE 153 154 S'TA SCNLIN ;ZEHO SCAN LINE 155 156 ;THIS ROl1fINE CLEARS THE ENTIRE SCREEN BY PlJrTING ;SPACE CODES (2I'1H) IN EVERY LOCATION ON THE SCREEN. 157 158 ; PU'f TOI? OF SCREEN IN HL LxI H,'IPDIS 159 ; PU'f BOM'O'l IN BC 161'1 a, LAST LXI 161 LOOPF: MVI M,2I'1H • !?U'r SPACE IN '''' 1fi2 INX ; INCREMEN'r POIN'TER H 1fi3 !'1OV A,H ;GE'r H CI",P 164 8 ;SEE IF ~'1E AS B 165 JNZ LOOI?F ;IF NOT [DOP AG!\IIII 16'; ,'1OV A,L ;GET L 167 CM!? C ;SEE IF ~'1E AS C 168 JNZ LOOPF ; IF NOT LOOP AGAIIII 169 17ilJ ;8255 INITIALIZATION 171 ,:WI 172 A,8BH ;MOVE 8255 CONIROL WOOD IN'ro A 173 STA CNWD55 ; I?u'r COOfROL WOOD IN'ro 8255 174 175 ; 8251 INITIALIZATION 17fi 177 LXI H USTF ·GE'r 8251 FLI'.G AOIRESS 178 MVI "I:83H ; OlJ"',"I'i S'roHE 'ro 8251 179 MVI M,0IlH ;RESET 8251 100 I."IVI M,4I'1H ;RESET 8251 181 NO!? ·WAIT . 182 MYI M,0EAH ;LOAD 8251 MODE WOOD 183 MVI ;LOAD 8251 CO'otMANf) WOOD "I,"5H 184 185 ;8253 INI'rIALIZATION 185 187 AvI ·CONTROL WOOD FOO 8253 ~N~~H 188 S'TA ;I?u'r CONTROL WOOD IN'ra 8253 189 MVI A,32H ;ISB 8253 19I'J STA CN'rlll ;pu'r IT IN 8235 191 A,0IlH MVI ;MSB 8253 192 STA Cm'0 ;I?u'r IT IN 8253 193 STBAUD CALL ;GO 00 BAUD RATE 194 J'II? IN75 ;GO 00 8275 195 196 ;THIS ROU'fINE REAOO THE BAUD RATE S',;ITCHES FRO>! PORT C 197 ;OF THE 8255 AND LOOKS UI? THE NlM8ERSNEEOEO TO LOAD 198 ;THE 8253 'TO !?ROVIDE THE !?ROI?ER BAUD RATE. 199 21ll1l S1BAUD: PORTC ;READ BAUD RATE S',;ITCHES 201 ANI ;STRII? OFF 4 MSB'S "FH 21'12 STA BAUD ;SAVE IT RLC ;MOVE BITS OVER ONE !?LACE 2"3 21114 LXI H,BDLK ;GET BAUD RATE LOOK UI? TABLl'.: 21'15 MVI ;ZERO D O,"IlH 206 MOV ·p\J'r A IN E ~,A 207 DAD ;GET OFFSET LXI O,CN'I'M ;I?OIN'r DE TO 8253 2"8 MVI ;GE'r CONTROL WOOD ~,"B6H . 2"9 STAX 21O ;s'rollE IN 8253 DCX D 211 ;POIN'r AT #2 COUIIITER MOV 212 ·GET ISB BAUD RATE S,M STAX 213 ;Pl1T IT IN 8253 INX H 214 ;I?OIN'r AT MSB BAUD RATE A,M MOV 215 ;GET MSB BAUD RA'rE D STAX 216 ;I?UT IT IN 8253 RET 217 ;GO 8ACK 218 LIl\ 7-72 207780-001 APPLICATIONS 00F9 00FC 00FE 00FF 0101 0103 0105 0107 0108 019B 0111JD 210110 3600 2B 364F 3658 3689 3600 23 CllB811J3 36E0 3623 1IJ10F 3E18 0111 30 0112 FB 0113 20 0114 E680 0116 C22101 0119 3A01A0 011C E602 011E C2SC01 0121 3AEA0F 0124 E680 0126 C23191 0129 3E00 012B 32ED0F 012E C31301 0131 3AEDBF 0134 4F 0135 3AmQJF 0138 89 0139 CAl301 013C 32EDClJF 013F 32E711JF 0142 20 ClJ143 E680 0145 CA4B01 0148 C34E02 014B 3A01A0 014E E601 0150 CMB01 0153 3AE70F 0156 3200A0 0159 C30F01 01SC 3A00A0 015F E67F 0161 32E70F 0164 C34E02 0167 0168 0169 016A 016B F5 E5 D5 C5 3A0114 016E 2AE3I1JF 0171 22E80F 0174 0177 0179 017A 017D 017E 3A0218 E611JF 47 3Aa::0F B8 C4OC00 0181 0184 0186 0189 018C 3AEA0F E640 C2C201 CD8F01 C38F00 219 220 221 IN75: 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 SETUP: 238 239 ~a~ ~a~ ;8275 INITIALIZATION LxI MVI OCX MVI MVI MVI MVI INX CALL MYI MVI H,CRTS M ,00H H LOC~ M,0E0H M,23H ;'rHIS ROUrINE REAli; BarH THe KEYBOo\RD AND 'rHE USART ;AND TAKES PROPER ACTION DePENDING ON HOW THE LINE-LOCAL ;SWITCH IS SET AVI A,18H ;SET MASK 'LOo\D MASK i ENABLE IN'rERRUPl'S SIM EI : READ THE lSART kIM 244 ANI 245 JNZ 246 Lll". 247 ANI 248 JNZ 249 KEYINP: Lll". 250 ANI 251 JNZ 252 MVI STA 253 RXRDY: ~~~ KEYS: 256 257 258 259 260 261 262 ~~~ 265 266 TRANS: 267 268 269 270 271 272 OK7: 273 274 275 ~~~ 278 279 280 FRAME: 281 282 283 284 ~~~ ~3~ ~ ~~~ £LA KlSCHR C RXRDY KElt'OK USCHR JMP Lll". ANI JZ LOr\ STA JMP CHRa:: lS'lF 01H 'lRI\.NS lSCHR USTD SETUP ANI STA JMP 07FH lSCHR CHRa:: LOr\ !~J.PK~~ iSAVE A IN C 'GET KEYBOo\RO CHARAC'I'ER i IS IT THE SAME AS KElt'OK ;IF SAME LOOP AGAIN ; IF NOT SAVE IT 'SAVE rr iGET LINE LOCAL ~ !~~~ 1~\INE iTIME TO 00 SCJ'o1E WORK ;GET USART FLAGS 'READY TO TRANSMIT? ; LOOP IF NOT READY 'GET CHARACTER ipu'r IN UST\RT • LEAVE ;READ USART 'STRIP j~SB pu'r IT IN M~ORY ; LEAVE USTD i hHIS ROUTINE CHECKS THE BAUD RATE S'I/ITCHES, RElSE'm THE ;SCREEN POIN'I'ERS A.tIID REAOO AND LOOKS UP THE KEYBOo\RD. • PuSH PSW ;SAVE A AND FLACE PUSH H ;SAVE H AND L PUSH D ;SAVE D AND E PUSH B 'SAVE B AND C Lll". INT75 ;READ 8275 TO CLEAR INl'ERRUP'r ~SET LHLD UP THE POIN'1'ERS TO~ SHLD 294 leA ANI 297 298 299 300 301 302 303 304 305 306 CMP B CNZ STBAUD • ; READ KEYBo\RO • f.o\ KEYlHI ANI 40H JNZ KYOOWN CALL RIllOV LI)I\ ANI MOV LI)I\ MOV ANI ORA JZ LDA ANI ,'lOV MOV ANI OM JZ MOV I'IVI LXI DAD I'IOV '1OV LI)I\ ANI JZ MOV STA MVI STA JMP ~~~ON ;POIN'f HL AT KEYBOI\RD RN1 ;GET CQlITffiOL AND SHIFT ;SAVE IN I..,EMORY ;SET UP A . ;OUTPJT A ;SAVE A IN B ; READ KEYBQ\RD ;INVERT A ;SET THE FLAm ; LEAVE IF KEY IS JXJ.oIN ;GET SCAN LINE BACK ;ROTATE IT OVER ONE ;00 IT AGAIN ;ZERO A ;SAVE KEY OONN ; LEAVE ;POINT AT RETURN LINE ;PJT A BlICK ;SAVE RE'NRN LINE IN ,..,EMORY ;POIN'f H AT SCAN LINE ;SAVE SCAN LINE IN MEt'lORY ;SET A ;SAVE KEY OONN ; LEAVE ;ZERO fIl ; RES E'f KEY DCJ.oiN ; LEAVE ;GET SCAN LINE ; PU'f SCA"I LINE IN A ;OUTPJT SCAN LINE TO PORT A ;POIN'f AT RE'NRi'J LINE ;GET RETURN LIi'JES ; ARE TljEy 'fHE S,a,'1E? ·INVERT A ;SET FLAm ; IF DIFFffiENf Kgy H,a,s CHANGED ;GE'f KEY OONN ;HAS THIS BEEN OONE BEFORE? ;LE:AVE IF IT HAS ;GE'f RETURN LINE ;GET READY TO ZERO B ;ZERO B ;ROfATE A ;00 IT AGAIi'J ;POIN'f H AT SCAN LINES ;GE'f SCAN LINES ;GE'r READY TO LOOP ; START C COUi'J'fING ;ROTATE A ;JU''1P TO LOOP ;GE'r RE'ruRN LINES ·MOVE OVER ONCE ;MOVE OVER 'IWICE ;MOVE OVER THREE TIMES lOR SCAN AND RETURN LINES ;SAVE A Ii'J B ;GE'r SHIFT CONTROL ; IS CONTROL SET ;SAVE A IN C ;GE'r SHIFT CONTROL ;SAVE A IN D ; sm I P COIlf1'ROL ;SET BIT ; IF SET LEAVE ; READ IT AGAII'J ;smIP SHIFT ·SAVE A ;GET SHIFT CONTROL ;smIP CONTROL ; ARE THEY 'fHE SA.'1E? ;IF SE'f LEAVE ; PU'f TARGET IN E ·ZERO D ;GET LOOKUP TABLE ;GET OFFSET ;GE'f CHARACTER ; PUT CHARACTER IN B ;GET PORTC ;S"rnIP BIT ·CAPS LOCK ;GET A BlICK ;SAVE CHARACTER ;SET A ;SAVE KEY OONN ; LEAVE I'I,A A,0FEH PORTA !i:s~TB A SAVKEY A,B LOOPK A,00H KEYIJIlN Ii i'l,A H i'l,B ~f~ A,0f'lH KEYIJIlN BYPASS H,SCNLIN %~TA H PORTS M A KI(CHIIIG Kgl(lJllN fIllH BYPASS PORTB B,fIlFFH B UP Ii AM C;0FFH C UPI A,B C ~~TC 4f1JH ~~ON D,A 4f1lH C CNTIJIlN PORTC 2f1JH C,A A,D 2f1JH C SHIlNN E,B o flJlIlH H;K':lLKIJP D A,M ~~TC If1lH CAPLOC ~~HR ~f~ BYPASS ; IF THE CAP LOCK BurTON IS PUSHED THIS ROUTINE SEES IF ;THE CHARACTER IS BE'IWEEN 61H AND 7AH AND IF IT IS THIS 7-74 207780-001 APPLICATIONS 022E 0221." 0231 0234 0236 0239 023B 023E 0240 0241 0243 0244 0247 0249 024A 024B 024E 0251 0253 0256 !lJ259 !lJ25B 025E 0260 0263 0265 0268 026A !lJ26D !lJ26F 0272 0273 !lJ275 0278 0278 027D "280 0283 0285 0288 028A 028D 0281." 0292 0294 0297 0299 029C 029E 02A1 02A3 02A6 02A8 02AB 02AE 02B1 02B3 !lJ2B6 02B7 02BA 02BD 02C0 1!2C1 !lJ2C3 1!2C6 02C9 02CC 78 FE60 0A2302 FE76 022302 D620 C32302 3E80 B0 E6BF 47 C31102 3E40 80 47 C31102 3AEE0F ~'E80 CA7B!lJ2 3AE70F FE0A CAF6!lJ3 FEOC CACM3 FE0D CMD!lJ3 FE!lJ8 CA6E03 FE1B CAA503 B7 C6E!lJ Ci\7704 C30F!lJ1 3E01l 32EE0F 3AE7~F FE42 CME02 I."E45 CACF02 FE4A CAD502 FE4B CA27fl3 ~'E41 CA3303 FE43 CA451l3 FE44 CA6E03 FE48 CA9703 C30F!lJl 3AE10F FE18 CAflF01 3C 32E10F Cl)3B~3 CD\5~4 7E FEf0 C2I!F!H 22E50~' CD15~4 C3~f01 395 396 397 398 399 CAPLOC: 400 401 402 403 404 405 406 407 408 409 410 CN'fMN: 411 412 413 414 415 SHMN: 416 417 418 419 420 421 422 423 CHKEC: 424 425 426 427 428 429 43!lJ 431 432 433 434 435 436 437 438 439 44!lJ 441 442 443 444 445 446 ESSQ: 447 448 449 450 451 452 453 454 455 456 457 458 459 46!lJ 4~1 4~2 41i3 464 465 456 467 4Fi8 459 DOliN: 470 471 472 473 474 475 476 477 478 479 480 481 482 ;ROUfINE ASSUMES THAT THE CHARACTER IS WIlER CASE ASCII ;AND SUBrnACTS 2'lH, WHICH CONVERTS THE CHARACTER TO ;UPPER CASE ASCII ; MOV CPI JC CPI JNC SUI JMP A,B 60H STKEY 7BH STKEY 20H STKEY ;GET A BACK ;HOIl BIG IS IT? ;LEAVE IF IT'S roo SI'IALL ;IS l'f 'fOO BIG ;LEAVE IF TOO BIG 'AQJUST A ;S'IDRE THE KEY ;'fHE ROUfINES SHlJ.oIN AND CNTMN SET BIT Ii AND 7 RESPECTIVLY ;IN THE ACC. 1.wr ORA ANI MOV JMP MVI ORA MOV JMP A,8IlH B 0BFH ;SET BIT 7 IN A lOR ;.lITH CHARACTER ;MAKE SURE SHIFT IS NOT SET ; pu'r IT BACK IN B ;GO BACK ;SET BIT 6 IN A lOR WITH CHARAC'rER ; PU'f IT BACK IN B ;GO BACK ~~ A,40H B B A SCR ;'fHIS ROllfINE CHECKS FCR ESCAPE CHARACTERS, LF, CR, ; FF, AND BACK SPACE loA ESCP ; ESCAPE SET? CPI 8~H ;SEE IF IT IS JZ ;LEAVE IF IT IS ESS~ LOA USC ;GE'f CHARAC'rER CPI 0AH ;LINE FEED JZ LNFD ;e) TO LINE FEED CPI OCH ;FClRi'l FEED JZ FMFD ;GO 'fO FCRM FEED CPI 000 JZ CGRT A CR CPI 0BH ;BACK SPACE JZ LEFT ;00 A BI'CK SPACE CPI lBH ; ESCAPE JZ ESKAP ;00 AN ESCAPE ORA A ; CLEAR CARRY ADI 0E0t! ;SEE IF CHARAC'rER IS PRINTABLE JC CffiPUT ;11." PRINTABLE DO IT JMP SETUP ;GO BACK AND READ USART AGAIN ; ;THIS ROUfINE RESETS THE ESCAPE LOCATION AND DECODES ;THE CHAHACTE:RS FOLWIIING AN ESCAPE. THE COMMA.NI:6 ARE ;COMPATABLE WITH INTELS CREDIT 'TEXT EDITOR ;~ f.m STA LD\ CPI JZ CPI JZ CPI JZ CPI JZ CPI JZ CPI JZ CPI JZ CPI JZ JMP ~~gH ;ZERO A ;RESET ESCP ;GET CHARAC'I'ER USCHR 42H IDNN 45H CLEAR 4AH CLRST 4BH CLRLIN 41H UPCUR 43H RIGH'f 44H LEFT 4!3H HOME SETUP !~~ CURSOR IDNN ;CLEAR SCREEN CHAR!\C'fER ;CLEAR THE SCREEN ;CLEAR REST OF SCRE~ ;GO CLEAR THE REST OF THE SCREEN ;CLEAR LINE CHARACTER 'GO CLEAR A LINE ;CURSOR UP CHARACTER ·MOVE CURSOR UP ;CURSCR RIGItT CHARAC'rER ;MOVE CURSOR TO 'rHE RIGH'T ;CURSCR LEFT CH.ARACTER ;MOVE CURSOH TO 'fHE ~'T ; HO'IE CURSOR CHARACTEH ;HCJ>IE THE CURSOH ; LEAVE " ;THIS ROurINE MOVES THE CURSOR IDNN ONE CHARACTER LINE LOA CPI JZ INR S'fA CALL CALL MOV CPI JNZ SHLD CALL J"IP CURSi' CURBor SE'l'UP A CURSi' LOCUR CMCU ;PU'f CURSOR Y IN ,A ;SEE IF ON BO'rro1 OF SCREEN ;LEAVE IF ON BO'rTOM ;INCREMENr Y CURSOR ;S.AVE !\E'N CURSOR ;LOAD THE CURSOR ;CMCULATE ADr:RESS ;GE'f FIRST LOCATION OF THE LINE ;SE!;; IF CLEAR SCREEN CHARACTER ;LEAVE IF IT IS Nor ;SAVE BEGINNING OF THE LINE ;CLEAR '!'HE LINE ; LEAVE ~~~H SETUP LOC80 CLLINE SETUP 7-75 207780-001 APPLICATIONS 02CF ClE403 02D2 C30F01 02D5 02D8 02DB 02DE 02E:l 02E:2 02E:5 02E:6 02E:7 02E8 02E:9 02EC 02E:F 02F0 02F1 02F2 02F5 02F6 02F7 02FA 02FD 0300 0302 0305 0306 0307 030A 030C 030D 030F 0312 0313 0314 0315 0316 0318 031B , 031E: 0321 0324 CIl".504 COCD04 01204F 3AE20F B8 CAE:C02 3C 23 71 B8 C2E502 0lD00F 23 78 BC C2FOO2 79 BD C2FD02 210038 3AE:10F FE18 CMF01 3C 47 115030 31;F0 78 FE18 CA0F01 3C 19 47 7C FE:0F C20M3 7D FEOO C20A03 210008 C3AA03 0327 032A 032D 0330 CIl".504 22E50F CD1504 C30F01 0333 0336 0338 033B 033C 033F 0342 3AE10F FE00 CAC!JF01 3D 32E10F cre803 C30F01 0345 0348 034A 034D 0350 0352 0355 0356 0359 035B ri135E 0361 0364 0365 0368 "36B 3AE20F FE4F C26403 3AE10F FE18 CA5903 3C 32E10r' 3E00 32E2"F COO803 C30F01 3C 32E:20F CDB803 C30F01 031C 483 484 485 CLE:AR: 486 487 488 489 490 491 CLRST: 492 493 494 495 495 497 LLp: 498 499 500 501 502 OVRl: 503 504 505 506 507 5"8 5<19 510 511 CONCL: 512 513 514 515 516 517 CLOOp: 518 519 520 521 522 523 524 525 521; 527 528 529 530 531 532 533 534 535 CLRLIN: 536 537 538 539 540 541 542 UPCUR: 543 544 545 546 547 548 549 550 551 552 RIGH'r: 553 554 555 556 557 558 559 560 GDl8: 561 562 563 51;4 NTOVER: 565 565 567 568 569 ;THIS ROl1rINE: CLE:ARS 'rHE: SCRE:E:N. CALL JMp CrsCR SIIT'UP ;GO CLE:AR THE: SCRE:E:N ;GO BACK ~THIS ROl/rINE: CLEARS ALL LINES BE:NE:ATH 'rHE: LOCATION ; OF THE: CURSOR. tALL CALL LXI LIl". CMp JZ INR INX 'IOV CMp JNZ LXI INX MOV CMp JNZ l'lOV CMp JNZ LXI LIl". CpI JZ INR MOV LXI MVI ,'\OV CpI JZ INR DAD MOV MOV CpI JNZ I'IOV CPI JNZ LXI J!1p CALCU ADX BcJF20H C SX B OVRI A H ,'I,C B LLp 'CALCULATE: ADLRE:SS ;ADD X POSITION ;ptJ'r SPACE AND LAST X IN B AND C 'GE:'r X crnsCR iSEE IF AT E:ND OF LINE: ;LE:AVE IF X IS AT E:ND OF LINE: ;MOVE A OVER ONE X POSITION ; INCR~E:N'f "'IEI~CRY POIN'rE:R ; pu'r A SPACE IN ME}~ORY ;SEE: IF A = 4FH ; IF Nar WOP AGAIN • pu'r LAST LINE IN BC ;pOINT HL TO LAST LINE: 'GE:T B iSA"'IE: AS H? ;LE:AVE IF Nor 'GE:T C iSAME AS L? ; LE:AVE IF No'r ;GE:T TOP OF DISPLAY 'GE:T Y CURSOR i IS l'r ON 'rHE BOrro'>! ;LE:AVE IIi' IT IS ;MOVE Ir oo.oJN ONE: LINE: ;S.AVE CURSCR IN B FOR LATE:R ;pu'r LENGrH OF ONE: LINE IN D ; PUT E:OO INI'IE}'ICRY ;GET CURSOR Y ; ARE: WE CN 'rHE 80l'TQ>\ ;LE:AVE IF WE: ARE: • MOVE CUR SCR !X1tIN ONE ;GE:T NE:X'r LINE ;SAVE A ·pu'r H IN A ;CO"'1pARE: 'fa HIGH LAST ;[EAVE IF IT IS Nor ,pu'r L IN A IcO'lpARE 'fa IDtI LAST 'LEAVE IF IT IS NO'r ;pu'r 'rOP DISPLAY IN H ,AND L ;LOOp AGAIN ~,LAST ~,B CONeL t,C CONeL ~6;rs~IS CURBor SE:TUp A B,A D,lNGrH M,0F0H A,B CURBor SETUP A D B,A ~F~ CWOI' ~D~H CWOI' HL6bDIS C I' ;'rHIS ROU'fINE CLEARS 'rHE LINE: THE: CURSOR IS ON. bALL SHLD CALL JMp CALCU LOC80 CLLINE SIIT'UP ;CALCULATE ADCRE:SS ;STORE: H .AND L TO CLE:AR LINE ;CLEAR THE LINE ;GO BACK hHIS ROl1fINE MOVES THE: CURSOR UP ONE: LINE. tIl". CpI JZ OCR STA CALL JMp CUHSY 00H SETUP A CURSY Locrn SETUP ;GE:T Y CURSOR 'IS IT ZE:RO ;IF IT IS LEAVE ;MOVE crnSOR UP -SAVE I£W CURSOR : LOAD THE CURSOR ;LE:AV!P INR STA CALL JMP CURSX 4FH !llroVER CURSY CURBor GD18 A CURSY A,""'H CURSX LOCrn SE:TUP A CURSX LOCrn SE:TUP -GE'r X CURSOR ;IS IT ALL THE: WAY OVER? ;IF Nar JUMP AROUND -GE:T Y CURSOR :SEE:IF ON BO'IrO"'I ; IF WE ARE: JU:'''P ;INCH~E:NT Y CURSOR ;SAVE IT ;ZERO A • ZERO X CURSCR ;LDAD THE: CURSOR ; LE:AVE ; I NCRE}>!E:N'r X CURSCR ;SAVE Ir ;LOAD THE CURSOR ; LE:AVE ;THIS ROUrINE: MOVES THE: CURSOH LE:FT ONE CHARACTER POSl'rION 7-76 207780-001 APPLICATIONS 036E 0371 0373 0376 0379 037B 037E 037F 0382 0384 0387 0381'1 038D 038E 0391 0394 3AE20F FE00 C28D03 3AEl0F FE00 CAIlF0l 3D 32E10F 3E4F 32E20F COO803 C30F01 3D 32E20F COO803 C30F01 0397 0399 039C 039F 031'.2 3E00 32E20F 32E10F CDB8{B C30F01 031'15 3E80 031'.7 32EE0F 03M C30F01 03AD 03AF 03B2 03B5 3E00 32E21lF COO803 C31lF01 03B8 03BA i!J3BD 03C0 03C3 03C6 03C9 3E80 320111l 3AE20F 320010 3AEI0F 320010 C9 03CA 03CD 03D0 03D3 03D6 03D8 0300 030E 03El 03E4 03E6 03E8 03E9 03EC 03EF 03F0 03F1 03F2 03F5 ClE403 210008 22E50F CDl504 3E00 32E20F 32E10F C00803 C30F01 3EF0 %18 04 210008 115000 77 19 05 C2EF03 C9 03F6 CDFC03 03F9 C3I!JFI!Jl 03FC 1!J3FF 0401 0404 0405 3ABI0F FEl8 CA5304 3C 321;a0F 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 59lil 591 592 593 594 595 596 597 599 599 600 6tH 602 603 604 605 606 607 6(!8 609 f;10 611 612 613 614 615 616 LEFT: NOVER: CUR.SX 0"'H IDVI':R CURSY 00H SETUP A CUil.SY A{j4FH C RSX LOClfR SETUP A CURSX LOCLR SETUP ;G ET X CURSffi ; IS I'r ALL THE WAY OVER ;IF NOT JW1P AROUND ;GET CURSOR Y ·IS IT ZERO? : IF IT IS JUMP ;MOVE CURSOR Y UP ·SAVE rr iGET LAST X LOCATION ;SAVI': rr ; LOAD THE CURSOR ; ADJUST X CURSffi ;SAVE CURSOR X ;LOAD THE CURSOR ; LEAVE ;THIS RourINE HaolES THE CURSOR. HCl'IE: Avr STA STA CALL JMP A,00H CURSX CURSY LDCUR SETUP ;ZERO A ·ZERO X CURSffi ; ZERO Y CURSOR ; LOAD THE CURSOR ; LEAve ;THIS ROU'rINE SETS THE ESCAPE BIT ESKAP: ~vr s'rA JMP ~~gH ;LOAD A WITH ESCAPE BI'r ;SET ESCAPE LOCATION ;GO BACK AND READ US,ART SETUP ;'rHIS RWrINE DOES A CR CGR'r: hvr STA CALL JMP A,0IlH CURSX LOCLR SETUP ;ZERO ,A ; ZERO CURSOR X ;LOAD CURSOR INTO 8275 ;POLL USAR'r AGAIN ;THIS ROurINE [J)AlE THE CURSOR LOCUR: hvr STA LI)\ STA L!}lI. STA RET 6D 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 fi41 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 L!}lI. CPI JNZ LI)\ CPI JZ OCR STA MVI STA CALL JMP OCR STA CALL JMP A,8IlH CRTS CURSX CR'IM CURSY CR'JM ;PU'r 80H INTO A ;LOAD CURSOR INTO 8275 ;GE'r CURSOR X ; PU'f IT IN 827<; ;GET CURSOR Y ; PU'f IT IN 827<; ; THIS ROV-fINE DOES A FffiM FEED FMFD: CALL LXI SHLD CALL CISCR ~TPDIS 80 CLUNE STA STA CALL JMP CURSY LDCLR SETUP MVI ;CALL CLEAR SCREEN ;PU'f TOP DISPLAY IN HL ; PUT I'r IN [])cB0 ;CLEAR TOP LINE ;ZERO A ; ZERO CURSOR X ;ZERO CURSOR Y ;LOAD THE CURSOR ; BJ\CK TO USART ~~~~ hHIS ROlJrINE CLEARS THE SCREEN BY WRITING END OF ROIl ;CHARACTERS INTO 'fHE FIRS'f [J)CATION OF ALL LINES 00 ;THE SCREEN. CISCR: LOADX: ~vr MVI INR LXI LXI MOV DAD OCR JNZ RET A,0F0H B,CURBOf 8 H,TPDIS D,UlGTH ,ti,A ;PU'f EOO CHARACTER IN A ;LOAD B WITH I~AX Y ;GO 'ro MAX PLUS ONE ;LOAD' H AND L WITH 'fOP OF R""'1 ;MOVE 50H = 800 INTO D AND E ;MOVE EOl< IN'fO MEl'IOOY ;CIJ!I.N3E POINTER BY 80D ;colJ'll'r THE [j)QpS ;CONTINUE IF NOT ZERO ;GO BACK B LOADX ;'fHIS ROU'fINE DOES A'LINE FEED LNFD: UlFDl: tALL JMP ~LINE ~ CPI JZ INR STA LNFDl SETUP ;CALL ROurINE ;POLL FLAGS FEED CURSY CURBOT ;Gt';'r Y LOCATION OF CURSOO ;SEE IF AT B01'I'()II OF SCREEN ;IF WE ARE, LEAVE ;INCREl'IENT A ; SAVI': !lEW CURSOR ONBor A CURSY 7-77 207780-001 APPLICATIONS 0408 040B 0411E: 0411 0414 0415 0416 0419 041C 041D 041E 0421 0422 0423 0424 0427 0428 0429 042A 042B 042C 042D 042E 04211' 0430 0431 0432 0433 0434 0435 0436 0437 0438 0439 1114311. 11I43B 11I43C 11I43D 11I43E: 043F 0440 111441 0442 111443 111444 0445 111446 111447 111448 0449 11144A 044B 11I44C 044D 11I44E: 1114411' 045111 111451 111452 0453 0456 0459 11145C 0450 0460 111461 04fi2 111465 0466 0467 11146A 046D CJl1'\504 22E:50F CDl5\!4 COO8"'3 C9 F3 2AE:53F 11531111 19 E:B 210300 39 EB F9 212020 E5 E5 E5 E5 E:5 E5 E5 E5 E5 E:5 E5 E5 E5 E:5 E5 E5 E:5 E5 E5 E5 E:5 E:5 E:5 E:5 E5 E5 E5 E5 E5 E5 E:5 E:5 E5 E:5 E5 E:5 E:5 E:5 E5 E:5 EB F9 FB C9 2AE30F 22E50F 11511100 19 IHD00F 7C B8 C26D04 7D 89 C26D04 211111111118 22E:30F 658 659 660 661 662 663 664 665 666 667 668 CLLINE: 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684+ 685+ 686+ 687+ 688+ 689+ 690+ 691+ 692+ 693+ 694+ 695+ 6%+ 697+ fi9B+ 699+ 703+ 71H+ 702+ 71113+ 71114+ 7115+ 706+ 707+ 708+ 709+ 710+ 711+ 712+ 713+ 714+ 715+ 716+ 717+ 718+ 719+ 720+ 721+ 722+ 723+ 724 725 726 727 728 729 73111 731 732 ONBO'f: 733 734 735 736 737 738 739 740 741 742 743 744 ARND: CALL SHW CALL CALL RET CALCU LOC80 CLLINE: LOCUR ·CALCULATE ADll S B ;LE:AVE IF NOr SA"'E ;GE:T L ;SA"IE AS C ;LEAVE IF Nor SAlliE ;LOAD HL WITH 'rop OF DISPLAY ;SAVE IlEW TOP ADrRESS B ARND A,L C ARND ~o~K8IS 7-78 207780-001 APPLICATIONS 13470 CD1534 0473 COO803 0476 C9 0477 047A 0478 0470 0480 0483 0486 0489 048C 0480 0490 0491 13493 0496 13499 1349C 1349F 134A2 CI}\504 7E FEF0 22E53F CC1534 2AE50F CDCD04 3AE70F 77 3AE20F 3C FE 50 C29C134 134A5 134A8 34AB 134AC I:l4AE 1:l4AF 34813 3481 13482 13483 3484 3485 3488 3489 1:l48A 13480 1:l48E 1:l48F 34C2 04C3 1:l4C6 04C7 04C8 34CB el4CC 210504 3AElI:lF 37 1:l603 4F 139 7E 4F 23 7E 47 211l0F8 09 Eo 2AE30F 19 EB 21331"0 19 DAC804 EB C9 213e1F8 19 C9 1:l4CD 0400 0402 3403 3404 3AE2I:lF 0600 4F 09 C9 C~C133 C3AD03 32E213F CDB803 C313F131 3300 3405 0301 0407 0002 0409 13 ell:l 3 1:l4DB 0004 0400 0305 0401" 0008 5008 A338 F01:l8 4039 9009 745 CALL CLLINE ;CLEAR LINE 746 CALL LDCUR ;LOAD THE CURSOR 747 RET 748 749 l THIS ROlJ'rrNE PUTS A CHARAC'l'ER ON THE SCREEN AND 750 ; INCR&lEN'l'S THE X CURS / LINE '!'ABLE IN'rO C 785 INX H ;CHANGE MEMCRY roINTER 786 MOV A,M ;pu'r HIGH LINE TABLE INTO A 787 MOV B,A ; PUT HIGH LINE TABLE INTO B 788 LXI H,0FRflI:lH ;'lWCG CO'lPLEMENT SCREEN LOCATION 789 DAD B ;SUBTRACT OFFSE'f XCrK; 791:l ;SAVE HL IN DE: 791 LHW 'roPAD 'GET TOP ADffiESS IN H AND L 792 DAD 0 ;GET DISPLACED ADffiESS 793 XCHG ;SAVE IT IN 0 794 LXI H,0F030H ;'lWCG COMPLEI'IE~r SCREEN LOCATION I}\D 795 0 ;SEE IF ~E ARE OFF THE SCREEN 796 JC FIX ; I I" 'lIE ARE FIX IT XCrK; 797 ;GET DISPLAC:ED ADffiESS BACK 798 RET ;GO BACK 799 FIX: LXI H,0F83flH ;SCREEN 80UNlRV 333 DAD 0 ;AmUST SCREEN 8e11 RET ;GO 8ACK 802 803 hHIS ROurINE ADOS 'fHE X CURS 1) ~F~H ~U~SX 7-79 207780-001 APPLICATIONS 0006 04El E009 0007 04E3 300A 0008 04E5 800A 0009 04E7DIlM 0~0A o E9 200B 000B 04EB 700B 01lOC 04ED C00B 0000 04EF 000E 04Fl 000F 04F3 0010 04F5 0011 04F7 01H2 04F9 0013 I'l4FB 0014 "'4FD 0"'15 "'4FF "'016 0501 0017 4"''''E 832+ 833+ 834+ 835+ 836+ 837+ 838+ 839+ 841l+ 841+ 842+ 843+ 844+ 845+ 846+ 847+ 848+ 849+ 850+ 851+ 852+ 853+ 854+ 855+ 85'1+ 857+ 858+ 859+ 850+ 8'11+ 90"'E 863+ 100C 600C B00C 0000 5000 MilD FI'lI'lD E00E 05e)3 300F 0018 0505 800F 0019 0507 0508 0509 05"'A 050B 050C 38 39 30 20 3D SC 050E 050F 0510 0511 0512 0513 0514 0515 0516 0517 0518 0519 051A 051B 051C 0510 051E 051F 0520 0521 0522 0523 0524 0525 0526 0527 0528 0529 052A 052B 052C 0520 052E 00 75 69 6F 7lcl 58 SC 0A 7F 6A 68 6C 3B 27 00 00 37 50 2C 2E 2F 00 00 00 00 00 61 7A 78 63 76 62 6E 0500 "'8 8152+ 8154+ 8r,5+ 866+ 8'17+ 868+ 869+ 870+ 871 872 873 874 875 876 877 878 879 KYLKUP: LINNU~ SET iLINNU~+ll OW TPD S+ (LNGfH LINNU~) LlNNW1 ssr iLINNll!~+l1 OW TPD S+(LNGfHIrLINNU'1) LINNll~ SET iLINNllM+ll OW TPD S+g;NGl'H LINNU'1) LINNUj'l SET iLl lJM+l~ OW TPD S+ (LNGl'H LINIIIU>I) LlNNU>I SBT iLINNU'1+1~ OW TPD S+g;NGfH LINNU~) LINNUM SET iLl ll!>I+1l OW TPD S~NGl'H LINNU>I) LINNUM SBT iL U.'1+ll OW TPD S+~LNGTH LINNU~) LINNUM SET iLl ll!>I+l1 OW 'fPD S+ (LNGl'H LINNU>I) LINNU'1 SET iLINIIIU'1+11 OW TPD S+g;NGfHIrLIN"lU'1) LINNlJ'oI SET iLl ll!>I+l1 OW 'fPD S+ (LNGl'HIrLINIIIU>I) LIN"lU'1 SET iL1NNU'1+ll DN TPD S+(LNGl'H LINIIIlJ'oI) LINIIIU'1 SET iLINNll!>I+ll . OW 'fPD S+(LNGfH LINIIIU'1) LINNur'l SE'r iL1NNU"I+l1 OW 'fPD S+ (LNGfH LINNlJ'1) LINNUM SET iLINIIIll!>I+ll OW TPD S+(LNGfH LINNU"I) LINNU"I SET lLINNU"I+11 OW TPD S+(LNGl'H LINNU"I) LINNUM SET lLINNlJM+l1 OW TPD S+~Gl'H LINNU'1' LlNNUM SET iLl ,U"I+1) OW TID S+g;NGfH*LlNNU'1' LINNUM SET iLl u>I+1l OW TPD S+(LNGfH LINNU"I' LINNUM SET·iLlNNlJM+11 DW TPD S+JLNGrH LINNU~) LINNU'1 SET (LI NU'1+1) ~ KEYl3Q1\RD LOOKUP 'rABLE ;THIS TABLE CONTAINS ALL THE ASCII CHARACTERS ·'rHAT ARE TRANSMITTED BY THE 'rERMINAL ;THE CHARACTERS ARE ORGANIZED SO 'rHAT BITS 0,1 AND 2 ;ARE THE SCA"l LINES, BITS 3 4 AND 5 ARE 'fBE RETURN LINES ; BIT 6 IS SHIFT AND BIT 7 I 8 CONl'ROL . be 38H,39H 88'" DB 30H,2DH ;0 AND - 881 DB 3DH,SCH ;= AND \ ; BS AND BREAK ;8 AND 9 882 DB 08H,00H 883 DB 75H,69H ; LrNlER CASE U AND I 884 DB 6FH,70H ; LONER CASE 0 AND P 885 DB SBH,SCH ; [ AND \ 886 DB MH,7FH ;LF AND DELETE 887 DB GAH,6BH ;LOIIER CASE J AND K 888 DB GCH,3BH ; LrNlER CASE L AND 889 DB 27H,00H ;' AND NO'rHING 890 DB 0DH,37H ;CR AND 7 891 DB 6DH,2CH ; LOIIER CASE M AND COIolMA 892 DB 2EH,2FH ;PERIOD A"lO StASH 893 DB 00H,00H ;BLANK AND NO'rHING 894 DB 00H,00H ;NOTHING AND NO'rHING 895 DB 00H,61H ;NOTHING AND LONER CASE A 895 DB 7AH,78H ;LOIIER CASE Z AND X 897 DB 53H,71iH ;LOIIER CASE C A~ V 898 08 62H,6EH ; LONER CASE B AND N 7-80 207780-001 APPLICATIONS 052F 79 0530 00 0531 00 0532 20 0533 64 0534 66 0535 67 0536 68 0537 00 0538 71 0539 77 1i153A 73 1i153B 65 053C 72 1i153D 74 1i153E IiIIiI 053F IB 1i1540 31 1i1541 32 0542 33 1i1543 34 0544 35 0545 36 1i1546 00 1i1547 2A 1i1548 28 0549 29 054A 5F 054B 2B 1i154C IiIIiI 0540 08 054E 1i10 1i154F 55 0550 49 0551 4F 0552 50 1i1553 50 0554 1i10 0555 0A 0556 7F 1i1557 4A 0558 4B 0559 4C 055/\ 3A 055B 22 055C 00 0550 00 055E 26 1i155F 40 0560 3C 1i1561 3E 0562 3F 1i1563 00 0564 00 0565 1i10 0566 0" 0567 00 1i1568 41 1i1569 5A 056A 58 056B 43 056C 56 0560 42 056E 4E 1i156P 59 0570 01i1 0571 01i1 0572 21i1 0573 44 1i1574 46 0575 47 1i1576 48 1i1577 lilril 0578 51 1i1579 57 1i157A 53 057B 45 1i157C 52 0570 54 1i157E 01i1 1i157F lB 1i1580 21 1i1581 40 1i1582 23 0583 24 0584 25 0585 5E 899 DB 79H,00H 900 DB 0~H,2~H ;NOrHING AND SPACE 9~1 DB 64H,61jH ; LOdER CASE 0 AND F ; LOdER CASE Y AND NOTHING 902 DB 67H,68H ;LONER CASE G AND H 9~3 DB "0H,71H ;'rAB AlIID LOdER CASE Q 904 DB 77H,73H ; LOdER CASE WANDS 905 DB 55H,72H ; LOdER CASE E: AND R 91i16 DB 74H,1iI0H ; LOdER CASE 'r AND NamING 907 DB IBH,31H ; ESCAPE AND 1 908 DB 32H,33H 2 AND 3 909 DB 34H,35H ; 4 AND 5 911i1 DB 35H,00H ; 6 AND NOTHING 911 DB 2AH,28H ;* AND ) 912 DB 29H,5FH ; ( AND - 913 DB 2BH,00H ;+ AND NOTHING 914 DB 08H,0?lH ;BS Al"D BREAK 915 DB 55H,49H ;U AND I 916 DB 4FH,50H ;0 AND P 917 DB 5DH,00H ;1 918 DB 0AH,7PH ;LP AND DE:LETE 919 DB 4AH,4BH ;J AND K 920 DB 4CH,3AH ;L AND: AND NO CHARACTER 921 DB 22H,01ilH ;" AND NO CHARACTER 922 DB 0DH,26H ;CR .-'1..1110 & 923 DB 4DH,3CH ;M AND 924 DB 3E:H,3FH ;> AND? 925 DB 00H,00H ;BLANK AND NOTHING 926 DB 1il0H,1il0H ;NOTHING AND NO'l'HING 927 DB 00H,41H ;NOTHING AND A 928 DB SAH,58H ;Z AND X 929 DB 43H,56H ;C AND V 930 DB 42H,4E:H ;B AND N 931 DB 59H,00H ;Y AND NOTHING 932 DB 00H,20H ;NO CHARACTER AND SPACE 933 DB 44H,46H ;0 AND F 934 DB 47H,48H ;G AND H 935 DB 01lH,51H ;'rAB AND Q 936 DB 57H,53H ;W AND S 937 DB 45H,52H ;E AND R 938 DB 54H,1iI0H ; 'r AND NO CONNECTION 939 DB IBH,21H ;ESCAPE AND 940 DB 40H,23H ;@ AND ~ 941 DB 24H,25H ;$ AND % 942 DB 5EH,00H ;~ AND NO CONNEc'rION 7-81 < AFN.()l:J04A APPLI CATIONS 0586 00 0587 00 0588 00 1/1589 00 1/158A 1/10 058B 00 058C 1/11/1 0580 00 058E 00 058F 15 0590 09 0591 I/IF 0592 10 1/1593 I!B 1!594 oc 0595 0A 0596 7F 0597 0A 0598 0B 0599 OC 059A 00 059B 00 059C 00 0590 00 059E 00 059F 00 051\0 00 0SAl 00 051\2 00 05A3 00 051\4 00 05A5 00 051\6 00 0SA7 lA 0SA8 18 0SA9 03 05I\A 16 05AB 02 0SAC 0E 051\0 19 0SAE 00 0SAP 00 0580 20 05B1 04 0582 06 05B3 07 05B4 08 05B5 00 0585 11 0587 17 0588 13 0589 06 058A 12 0588 14 058C 00 05BO 1B 05BE 10 05BF IE 0SC0 1C 0SC1 14 0SC2 IF 0SC3 00 0SC4 1!0 0SC5 00 0SC6 05 0SC7 69 0SC8 1!3 05C980 0SCA 02 05ce 40 05CC 01 05C0 AI! 0SCE 00 05C1l' 50 0500 00 0501 28 1!502 00 0503 14 050400 0505 I!A 0506 01! 943 944 945 946 bB 00H,00H :NOTHING 947 DB 00H,00H : NOTHING 948 DB 00H,00H ;NOTHING 949 DB 1/10H,00H :NOTHING 951/1 DB 15H,09H :CONTROL U AND I 951 DB I!FH,10H :CONl'ROL 0 AND P 952 DB 0BH,OCH :COm'ROL [ AND \ 953 DB 0AH,7FH ;LF AND DELETE 954 DB 0AH,0BH ;CONl'ROL J AND K ;CONl'ROL L AND NO'rHING ~ THIS IS WIfERE 'rIfE CONl'ROL CHARACTERS ARE LOOKED UP 955 DB OCH,00H 956 DB I!I!H,1!0H ;NOTHING 957 DB 0DH,0mi ;CR AND NOTHING 958 DB 0DH,00H ;CONTROL ", AND COMMA 959 DB 00H,00H ;NOTHING 960 DB I!;:H,00H ; NOTHING 961 DB 00H,1l0H ;NOTHING AND NO'rHING 962 DB lAH,18H ;CONTROL Z AND X 963 DB 03H,HiH ;C01ll1'ROL C AND V 964 DB 02H,0EH ;CONI'ROL B AND N 965 DB 19H,00H ;CO!lTl'ROL Y AND NOTHING 955 DB 00H,21!H ;NOTHING AND SPACE 967 DB 04H,01iH ;CciNl'ROL 0 AND F %8 DB 07H,08H ;C01ll1'ROL G AND H 969 DB 00H,llH :NOTHING AND CONl'ROL Q 970 DB 17H,13H ;CONI'ROL WANDS 971 DB 06H,12H ;CONTROL E 972 DB 14H,0mi :CONI'ROL W AND NO'fHING .~ R 973 DB 1BH,lOH ;ESCAPE AND HO'-1E(CREDIT) 974 DB 1EH,lCH ;CURSOO UP AND rooJN(CREDIT) 975 DB 14H,lFH ;CURSOO RIGHT AND LEFT(CREDIT) 976 DB 01lH,00H ;NOTHING 977 978 979 980 BOCK: !l3 00H,05H,69H,03H ;75 AND 110 BAUD 981 DB 80H,02H,40H,01H ; 150 AND 31!0 BAUD 982 DB 0A0H,00H ;600 BAUD 983 DB 50H,00H ;1200 BAUD 984 DB 28H,01!H ;2400 BAUD 985 DB 14H,01!H ;481!0 BAUD 986 DB 0AH,0I!H ;9600 BAUD ~l.DOK UP 'fABLE FOO 8253 BAUD RATE GENERATOR 7-82 207780-001 APPLICATIONS 987 988 989 991'1 991 992 993 994 995 996 997 998 999 11'11'111 11'11'11 111112 101'13 11'104 11'11'15 ;DATA AREA CURSY: CUfl.SX: 'rOPAD: LOC80: USCHR: CURAD: KEYlM'N: KBCHR: BAUD: KEYOK: ESCP: SHeON: RE:rLIN: SCNLIN: 6RG C6 C6 C6 C6 C6 C6 OS C6 C6 C6 C6 C6 C6 C6 END I'IFEIH 1 1 2 2 1 2 1 1 1 1 1 1 1 1 PUBLIC SYMBOLS EXTERNAL SY:'1BOLS USER SYMBOLS ADX A 04CD CAPLOC A 022E ClRLIN A 0327 CNIM A 6~03 CUfl.SX A 0FE2 FMFD A 03CA KEYlM'N A 0FEA KYLKUP A 05217 LNFD A 03F6 LPKBD A 01198 POPDAT A 111134 RXlIDY A 1!I13 S'mAlID A I'Imx; UPI A I'IIE9 ARND CGRT CLRST A A A CN'tID55 A CURS'l A FRAME A KEYINP A LAST A LNFDI A NOVER A PORTA A SAVKEY A STKEY A UPCUR. A ASSEMBLY COI'lPLE'rE, NO 0460 1'131'.0 1'1205 181!J3 elFEl 1'1167 1'1121 I!JFD0 03FC 1'1380 IB2I:;' 01AP 1'1223 1'1333 BAUD CHREC C['SCR CONCL A A A A IXMN A GDIB A KE'lOK A LOCUR A LNGTH A NTCNER A POR'ffi A SCNLIN A STPrR A USCHR A elFEC 024E 1'13E4 1'12FD 1'12AE 0359 I'IFED 1'136g 01'151'1 0364 BDLK CHRPUT CN'rf! CR'IM ESCP HO'IE KEYS LEFT LOADX OKI PORTC SCR TOPAD U5TD 18~1 0FF1 0FE0 0FE7 A 05C5 A A A A A A A A A A A A A 0477 <;0011 1000 t'lFEE 0397 1'1131 036E el3EF 1!J49C 18\12 0211 I'IFE3 Ml00 BTDIS CLEAR CNT1 CRTS ESKAP IN75 KPTK LINNUI'I LOC80 OK7 RDKB SITUP TPDIS US'W A IIF80 ,1\ 02CF A <;1101 A 1001 A el3A5 A 00F9 A 0084 A 0019 A 0FE5 A t'l15C A 018F A el10F A I'IR~0 A MHll BYPASS CLLINE CNT2 CUR.l\!) ESSQ INT7, KYCHNG LIN'rAB LOOPF ONBOT RE'rLIN SHCON TRANS A A A A A 008F 0415 <;002 0FE8 el27B A 141n A 016A A A A A A 0405 00.1\7 0453 elFFI'I elFEF A 014B ERROI~ 7-83 207780,-001 intJ ARTICLE REPRINT AR·178 September 1983 Reprinted with permission from Electronic Design', Vol.29, No.9; copyright Hayden Publishing Co., Inc., 1981 @lnte'Corpor.toon,1981. ORDER NUMBER: 210507-001 7-84 Fewer parts make a microprocessor-based, CRT controller cost-effective, and interrupt-driven software cuts overhead on the system's Cpu. Low-cost CRT control does more with less The multitude of components and the CPU OI'erhead long associated with cathode-ray-tuhe ('ontrollers are rapidly becom ing conspicuous h:, their absence. In particular, an intelligent terminal based on Intel's iAPX 88/10 (80881 microprocessor and 8276 small-system CRT c.ontroller eliminates all but 22 of the nearly 40 chips requim\ by other CRT controllers (even those with microprocessors and integrated peripherals). It also cuts overhead on the processor to less than 25'Jf, so that the 88/10 is free to implement such intelligent terminal functions as local data processing. The iAPX 88/10 implementation supplies characters directly to the 8276 by means of interrupt-driven software, eliminating the need for a direct-memor~' access (DMA) controller. The design interfaces directly with standard CRT monitors, contactclosure keyboards, and RS-232C serial-communication links (asynchronous or bisynchronous). to provide a complete stand-alone operator interface. Although the primary design goal-implementing a low-cost CRT terminal-has excluded some useful CRT features, these are easily made available through additional external hardware. For example, composite video is added with two TIL packages, a transistor, and some resistors and capacitors. Another simple option involves the two general-purpose attribute outputs on the 8276 and lets users select anyone of four colors on a color monitor. tions. Three manual switches on the PC board select the haud rate, and one of the 825:3's three independent programmahlp interval timers generates the 8251A's baud-rate clock under software control. The three PC-hoard swit('hes arC' monitored by the iAPX 88/10 to determ ine the desired baud rate. When the CPU detects a change in the switch positions, thl' 82ii3 is loaded with the appropriate count for the new haud rate. An 8255A provides three 8-bit parallel 110 ports. Two 110 ports contribute kC~'board scanning, and the Basic system configuration and architecture 1. Intelligent termlnats, built with Intel's IAPX 88/10 (8088) microprocessor and new 8276 small-system CRT controller, take this basic configuration to reduce parts count and minimize overhead on the system CPU. Central to the 22-chip CRT controller design is an iAPX 88/10 8-bit microprocessor operating at 5 MHz and supported by two 8185 l-kbit x 8 static RAMs and a 2716 control software PROM (Fig. 1). An 8251A programmable communication interface provides synchronous or asynchronous serial communica- sync Vert«J" VIdeo HOrizontal _sync (lrom8253) Thom •• Ro •• I, Applications Mgr- Peripheral Components Intel Corp. 3065 Bowers Ave., Santa Clara, CA 95051 7-85 Electronic Design. April 30, 1981 210507-001 To CRT Low~CRT third port senses option-switch settings and the vertical-retrace signal from the 8276 (for CRT synchronization upon reset). The CRT dot and character timing is generated by an 8284A clock generator. Another 8253 timer provides the appropriate horizontal-retrace timing for the CRT monitor. In its programmable one-shot mode, this timer generates a 32-lLs horizontal-retrace pulse for the CRT monitor (Ball Brothers TV-12). A simple user-initiated change in the software will modify this delay time to suit different CRT monitors. The third and last timer in· the 8253 is available for any user-defined need. A 2716 EPROM on the controller board serves as a user-programmable character generator. A shift register transforms the data from the character EPROM into a serial-bit stream to illuminate dots on the CRT screen. The 2716 character generator helps to create special symbols and characters for word processing, industrial-control applications, or foreign-language displays. The controller hardware is divided into processor and support, serial and parallel IIO, and CRT-control sections. The proceRsor and sl.!pport section consists of an iAPX 88/10 microprocessor, which is supported by two 8185 1-kbit x 8 static-RAM devices, and another 2716 EPROM (containing 2 kbytes of control firmware). The iAPX 88/10 uses a 15-MHz crystal (with an 8284A) to operate at a 5-MHz clock rate. The 8185 memories attach directly to the iAPX 88/10 multiplexed bus. An 8282 latches eight address lines (Ao-A,) from the multiplexed bus for 2716-program memory access (Fig. 2). The serial and parallel I/O section of the terminal includes the 8255A programmable peripheral interface, and the CRT section contains the 8276 CRT controller and support circuits. All of the controller's I/O operations are memory mapped (see table). Memory map of controller I/O operations Acldre. . Selected 00000 - 00003 00004 - 00029 00030 • 007FF 01000 • 01001 01900 12000 • 12001 14000 • 14003 18000 • 18003 FF800 • FFFFF device RAM RAM RAM 8276 8276 8251A 8253 8255A 2715 ...nee ii COmm.... Interrupt v.ect(H' Stack, local varlabllla Display buffer 8278 commancflwlatut. 8276 row buff... Serial channel Baud-rata timer Keyboard, switch.. Program storage ~---F----,,"'I.;-i 8 ADDR e·•s t-T 8088 ADDAIDAT~ ,I->'~------+----+". If ALE/----...r 2. The processor and support seclion olthe intelligent terminal's hardware contains two 8185 RAMs attached directly to the iAPX 88110 multiplexed bus. An 8282 latches eIght addre·ss lines (Ao·A,) Irom the multiplexea bus lor 2716. program memory access. C8o·., How the controller board communicates The CRT-controller board communicates to computer systems and other CRT units through a serial interface. Both RS-232C and TTL-compatible interfaces are available at the J 1 connector. The unit's standard software supports eight data-transmission rates: 9600, 4800, 2400, 1200, 600, 300, 150, and 110 baud. These rates are switch-selectable on the PC board. Since the baud-rate clock is generated by an 8253, baud rates may be easily modified in software. Keyboard scanning is supported through the A and Bports of a 8255A programmable peripheral interface. Therefore, low-cost .unencoded keyboards can be used. The eight scan lines (port B) and eight return lines (port A) support a 64-contact closurekey matrix. The three switches attached to port C permit baud-rate selection. Four general-purpose Mev CPU C8T !NT control Ro ClP 3, Here are the majorlunctlonal blocks olthe 8276 programmable CRT controller. This devIce permIts software speCification 01 most CRT ·screen lormatcharacterlstlcs (cursor position, characters/row, rows/lrame). Etectronlc De.19n • April 30, 1981 210507-001 7-86 inputs on port C permit the software to sense depression of the caps-lock key, the control key, and the shift key, as well as the position of the line/local switch. The last input on port C senses the status. of the vertical retrace (VRTC) output of the 8276, so that the controller can synchronize with the CRT display on power up or after a hardware reset. All keyboard I/O connects to the terminal board by means of a 40-pin header on its edge. All seven option-switch inputs are also brought to the connector, so that option switches may be installed on the keyboard if desired. Software spec Illes Ihe screen formal The CRT display is controlled by the 8276 programmable CRT controller (Fig. 3). With this device, most CRT screen-format characteristics-such as the cursor position, the number of characters per row, and the numher of rows per frame-can be specified through software. The 8276 handles all displa:-' timing including retrace time delays. In the current design, 2000 characters are displayed on the CRT screen (25 rows of 80 characters). Each character is formed as a5 x 7-dot matrix within a larger 7 x 10 matrix (Fig. 4). Other screen formats (e.g., 16 rows of 64 characters) can be easily implemented with a few software changes and no hardware changes. The 8276 contains two 80-character row buffers (see "Row Buffers Reduce System Overhead"). While one buffer displays the current character line on the screen, the 8276 fills the other row buffer from memory. This data transfer begins when the 8276 issues a data request (by means of the BRDY pin), causing an interrupt to the CPU. In response to this interrupt, the CPU activates the RAM's CS and RD inputs, while simultaneously activating the 8276 BS and WR inputs (Fig. 5). Through this technique, a single bus cycle suffices to transfer each byte from the RAM into the CRT row buffer. After the row buffer is filled, the CPU exits the interrupt-service routine. But the 8276 can do more than simply paint characters on a CRT screen. Its end-of-row-stop buffer-loading code allows the control software to blank individual display lines. Also, the end-of-thescreen-stop huffer-loading code initiates an erase to the end of the screen. The 8276 supports software selection of visiblefield "attributes" that can blink. underline, or highlight (intensif:-') characters on the screen and can reverse the video-character fields (black letters on a white background). Two general-purpose attribute outputs are provided to control the user-defined display capabilities. Hardware provides Ihree supporl functions The 8276 is supported by three hardware functions: a dot/character-clock oscillator, an EPROM character generator, and a character-shift register (Fig. 6). The dot/character-clock oscillator consists of an 8284A operating at 11.34 MHz and providing an 88.2-ns dot clock. A 74LS163 divill('s this clock b:; 7 to generate a 1.62-MHz (617-ns) character clock. Line number 0 0 0 0 0 0 0 0 0 0 0 0 o 0 0 0 • 0 0 0 0 0 0 0 0 ••o • • • •• • • • •• • o • 0 0 o • 0 0 0 0 0 0 0 0 [J 0 0 0 [J 0 0 0 o 0 0 0 0 o B088 RD 0 0 0 WR 8276 4. The dot-matrix character lont used In the low-cost CRT controller creates a 5 X 7 character In a 7 X 10 matrix (example shown is an upper-case A). Top and bottom lines are blanked lor character separation, and the remaining line Is reserved lor cursor/underline display. cs RD 8185 5. Row-buller loading lor the 8276 begins when a single 8088 string Instruction moves data bytes Irom the 8185 RAM to the 8276 row buller. The 8088 CPU "thinks" Ills loading the AX register. 7-87 Etectronlc Dellgn • April 30, 1981 210507-001 Low-cost CRT The 8276 is programmed to display one raster line every 61.7 Ils-a complete character line every 617 IlS (ten raster lines). The 8276 is also programmed to refresh the screen every 16.7 ms (60 Hz). Each character row consists of ten raster lines. Seven lines display the 5 X 7-character matrix, two lines are blanked for row spacing, and one line displays the cursor and underline. The 8276 uses the line count (LCo-LC 3 ) outputs to indicate the current raster line during the display of each character. These outputs, combined with the character-code outputs (CCo-CC G), are sent to the 2716, which generates the dot pattern for display. This dot pattern is loaded into the shift register and is serially clocked for display by the 1l.34-MHz dot clock. During the vertical-retrace interval, the row buffer for the first line of the next frame is loaded by the iAPX 88/10. When the frame starts, the 8276 outputs the first character on its CCO-CC G pins; the LC outputs are all zero. Exactly 617 ns later, the next character code is emitted by the 8276. This process continues every 617 ns until all 80 characters have been output. Then the 8276 generates a horizontalretrace pulse, which is converted to the appropriate pulse width for the CRT monitor by the 8253. At the end of the first raster line, the 8276 increments the LC outputs. The next nine raster lines are similar to the first-the 8276 outputs the same 80 character codes on the CCO-CC G pins for each of the raster lines, and the LC outputs are incremented after each raster line. While the ten raster lines are being displayed, the 8276 is also filling the next row buffer. After the tenth raster line is completed, the 8276 resets the LC count and outputs character codes for the second row on the CC O-CC 6 pins. As this row is displayed, the first row buffer is filled with information for the third row. The 8276 alternates row buffers until all 25 rows are displayed. At this time, the verticalretrace signal is activated, and the scanning process is repeated for the next frame. During display, the 8276 automatically activates the video-suppress pin (vsP) andlor light-enable out[Juts ILTE~I, as appropriate. to control retrace blanking. genprate the cursor, or underline characters. Software is split between two priorities The software for the CRT controller is divided into high and low-priority sections. The high-priority "foreground" software is activated each time the 8276 requests (through the iAPX 88/10 NMI interrupt) that an 80-character row buffer be filled. The 8276 row buffer is filled by performing 80 sequential memory reads. As each read is performed, the vsp LTEN From 8276 HATe Horizontal out VATe Vertical out 6. CRT control logic supports the 8276. Three hardware functions are'lnvolved: a doticharacter clock OSCillator, an EPROM char8ctergenerator, and a character-shift register. Electronic D•• lgn • April 30, 1981 210507-001 7-88 Low-cost CRT Row buffers reduce system overhead If no row buffer is present, the CRT controller must go to main memory to fetch every character during every dot scan line. Thus, the central processing unit is forced to relinquish the system bus 90 to 95o/c of the time. That CPU inactivity (overhead) greatly degrades total system performance and efficiency. CRT terminals using this approach are typically limited to between 1200 and 2400 baud on their serial-communications channels. However, with the 8276's row-buffered architecture, the CRT controller need only access the main memory once for each diHplayed character row. This approach reduces system bus overhead for CRT refreshing to 25':1: (maximum). The CPU is then free to perform other local-processing functions, for instance, processing data at 9600 baud on a serial-communications channel. PUSHF PUSH SI PUSH CX MOV ADD CLD MOv REP LaDS CMP JNZ MOv KTPK MOv POP POP POPF SI,CURAD SI,OFFSET save registers used by subroutine point to current line auto increment CX,40 WDPTR SI, LAST KTPK SI,TOPDIS CURAD,SI CX SI move 40 words check for end of screen jump if not at end end-set to top restore 7. A screen-refresh routine illustrates how the IAPX 88/10 load-string (LODS) instruction fills an 8276 row buffer. The 15 lines take 167 ~s and are run every ten CRT lines (every 617 ~s), XOR MOV MOV CMP JL CMP JG AX,AX BX, ESCTBL AL, USCHR AL, 41 H SETUP AL,48H SETUP XLAT JMP clear AX load table, pointer read character check for 41 H not valid check for 48H not valid translate to routine address (AX) B. This routine checks the keyboard character to see lilt Is a valid escape-sequence command (41 H through 4BH), "the character Is valid, a translate table lumps to a service routine, With the powerlullAPX BB/l0 translate InstrUction, the service routine takes lust 7 ~s, Elselronle Dsolgn • April 30, 1981 210507-001 hardware automatically sends a write (over bufferselect and write pins) to the 8276. The simultaneous memory-read and 8276-write commands transfer characters from the 8185 RAM to the 8276 in a single memory cycle-without a direct-memor~'-access (DMA) con troller, The 80 reads are under the control of the CPU load string (LODS) instruction, which handles 40 word loads with iAPX 88/10 code (Fig. 7). The complete refresh sequence for one line requires approximately 167 /lS. As a result, processor overhead for refresh operations is approximate I>, 27%. Foreground software also involves keyboard scanning that is performed only at the end of each display frame (after 25 rows or 16.7 ms). If a key depression is noted during one of these scans, the information is stored for further background processing. An iAPX 88/10 routine checks the character to determine whether it is a valid escape-character command (Fig. 81. In this procedure, the iAPX 88/lO's translate instruction (XLAT) takes care of table lookup. The low-priority software section handles "background" processing. It monitors the 8251A serial I/O port and provides processing for characters entered via the keyboard or with the serial interface. Background software executes continuously except when interrupted for the higher-priority foreground processing. Cumbersome scrolling technique avoided· A refresh-buffer memory stores all 2000 characters that can be displayed on the CRT screen. The foreground software transfers one row (of 80 characters) at a time to the 8276. Two pointers are employed during normal operation. Under the control of foreground processing software, the current-row pointer contains the address of the next row to be displayed. This pointer must always be correct, so that a row can be transferred to the 8276 when requested. The buffer pointer contains the address of the next CRT buffer location to be written into (from either the keyboard or the serial port). Controlled by the background software, the buffer pointer indicates the cursor's actual location. The simplest refresh-buffer organization associates the first memory address with the upper left position on the CRT screen. All other characters are stored sequentially (Fig. 9). But this method makes CRT screen scrolling difficult. Scrolling requires that each display line be moved up one row. The top line of the CRT is lost, the bottom line is blanked, and the cursor is placed at the beginning of the bottom line. With this fixed sequential organization, all characters in the refresh buffer must be moved forward 7-89 Low --<......._ _ _---' CBIN HSYNC 'IIEXT SYNC .." AD-1S ORa DAci( COMMAND PROCESSOR CO~~:~~:OM ...." "0.13 aND 0---0---- 2KWCU< 0--- +5V Oa.5 oa.. Figure 2. Pin Configuration Figure 1. Block Diagram Intel Corporation Assumed No Responsibility for the Use 01 Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied. Information contained herein supersedes previously published specifications on these devices from Inlel. ©Intel Corporation, 1985 7-91 January 1985 Orqer Number: 210655-003 82720 Table 1. Pin Description Symbol 2XWCLK Pin No. Name and Description Type 1 I Clock Input Horizontal Sync: Output used to initiate the horizontal retrace of the CRT display. Display Bus Input: Read strobe output used to read display memory data into the GDC. DBIN 2 HSYNC 3 0 0 V/EXT SYNC 4 1/0 BLANK 5 RAS (ALE) 6 0 0 DRO 7 0 DACK 8 I RD 9 I Read: Input used to strobe GDC Data into the microprocessor. WR 10 I Write: Input used to strobe microprocessor data into the GDC. Vertical Sync: Output used to initiate the vertical retrace of the CRT display. In slave mode, this pin is an input used to synchronize the GDC with the master raster timing device. Blank: Output used to suppress the video signal. Row Address Strobe (Address Latch Enable): Output used to start the control timing chain when used with dynamic RAMs. When used with static RAMs, this signal is used to demultiplex the display addressldata bus. DMA Request: Output used to request a DMA transfer from a DMA controller (8237) or 110 processor (8089). DMA Acknowledge: Input used to acknowledge a DMA transfer from a DMA controller or 1/0 processor. AO 11 I Register Address: Input used to select between commands and data read or written. DBO 12 1/0 Bidirectional Microprocessor Data Bus Line: Input enabled by WR. Output enabled by RD. DBI DB2 DB3 DB4 DB5 DB6 DB7 13 14 15 16 17 18 19 GND 20 Vee 40 A1? 39 0 Graphics Mode: Display Address Bit 17 Output Character Mode: Cursor and Line Counter Bit 4 Output Mixed Mode: Cursor and Image Mode Flag A,6 38 0 Graphics Mode: Display Address Bit 16 Output Character Mode: Line Counter Bit 3 Output Mixed Mode: Attribute Blink and Line Counter Reset AD,s AD'4 AD,3 AD,2 AD" ADm ADs ADs AD? AD6 ADs AD4 AD3 AD2 AD, ADo 37' 36 35 1/0 Graphics Mode: Display AddresslData Bits 13-15 Character Mode: Line Counter Bits 0-2 Output Mixed Mode: Display AddresslData Bits 13-15 34 33 32 31 30 29 28 27 26 25 24 23 22 1/0 Display AddresslData Bits 0-12 21 I LPEN , Ground. + 5V Power Supply Light Pen Detect Input 7-92 210655-003 82720 FUNCTIONAL DESCRIPTION (Continued) Zoom and Pan Controller Microprocessor Bus Interface The contents of the FIFO are interpreted by the command processor. The command bytes are decoded, and the succeeding parameters are distributed to their proper destinations within the GOG. The bus interface has priority over the command processor when both access the FIFO simultaneously. Based on the programmable zoom display factor and the display area parameters in the parameter RAM, the zoom and pan controller determines when to advance to the next memory address for display refresh and when to go on to the next display area. A horizontal zoom is produced by slowing down the display refresh rate while maintaining the video sync rates. Vertical zoom is accomplished by repeatedly accessing each line a number of times equal to the horizontal repeat. Once the line count for a display area is exhausted, the controller accesses the starting address and line count of the next display area from the parameter RAM. The system microprocessor, by modifying a display area starting address, allows panning in any direction, independent of the other display areas. DMA Control Drawing Processor The OMA Gontrol circuitry in the GOG coordinates data transfers when using an external OMA controller. The OMA Request and Acknowledge handshake lines interface with an 8257 or 8237 OMA controller or 8089 1/0 processor, so that display data can be moved between the microprocessor memory and the display memory. The drawing processor contains the logic necessary to calculate the addresses and positions of the pixels of the various graphics figures. Given a starting point and the appropriate drawing parameters, the drawing processor needs no further assistance to complete the figure drawing. Parameter RAM Display Memory Controller The 16-byte RAM stores parameters that are used repetitively during the display and drawing processes. In character mode, the RAM holds the partitioned display area parameters. In graphics mode, the RAM also holds the drawing pattern and graphics character. The display memory controller's tasks are numerous. Its primary purpose is to multiplex the address and data information in and out of the display memory. It also contains the 16-bit logic units used to modify the display memory contents during RMW cycles, the character mode line counter, and the refresh counter for dynamic RAMs. The memory controller apportions the video field time between the various types of cycles. Gontrol of the GOG by the system microprocessor is achieved through an 8-bit bidirectional interface. The status register is readable at any time. Access to the FIFO buffer is coordinated through flags in the status register. Command Processor Video Sync Generator Based on the clock input, the sync logic generates the raster timing signals for almost any interlaced, non-interlaced, or "repeat field" interlaced video format. The generator is programmed during the idle period following a reset. In video sync slave mode, it coordinates timing between the GOG and another video source. Light Pen Debouncer Only if tworising edges on the light pen input occur at the same pOint during successive video fields are the pulses accepted as a valid light pen detection. A status bit indicates to the system microprocessor that the light pen register contains a valid address. Memory Timing Generator The memory timing circuitry provides two memory cycle types: a two-clock period refresh cycle and the read-modify-write (RMW) cycle which takes four clock periods. The memory control signals needed to drive the display memory devices are easily generated from the GOG's RAS(ALE) and OBIN outputs. . System Operation The GOG is designed to work with Intel microprocessors to implement high-performance computer graphics systems. System efficiency is maximized through partitioning and a pipelined architecture. At the lowest level, the GOG generates the basic video 7-93 210655-003 intel· 82720 many cost/performance tradeoffs for both display and drawing are realizable. raster timing, including sync and blanking signals. Partitioned areas. on the screen and zooming are also accomplished at this level. At the next level, video display memory is modified during the figure drawing operations and data moves. Third, display memory address are calculated pixel by pixel as drawing progresses. Outside the GDC at the next level, preliminary calculations are done to prepare drawing parameters. At the fifth level, the picture must be represented as a list of graphics figures drawable by the GDC. Finally, this representation must be manipulated, stored and communicated. The GDC takes care of the high-speed and repetitive tasks required to implement graphics systems. The video memory can be partitioned into 4 banks, each 1024 x 1024 bits. By selecting all 4 memory banks during display, 4 bits/pixel can be provided by a single 82720. Each bank of video memory contributes 1 bit to each pixel. This configuration can support color monitors, again with a maximum dot shift rate,of 44 or 88 MHz. Higher performance may be achieved by using multiple 82720s. Multiple 82720s can be used to support mutliple display windows, increased drawing speed, or increased bits per pixel. For display windows, each. 82720 controls one window of the display. For increased drawing speed, multiple 82720s are operated in parallel. For increased bits/pixel, each 82720 contributes a portion of the number of bits necessary for a pixel. GENERAL OVERVIEW In order to minimize system bus loading, the 82720 uses a private video memory for storage of the video image. Up to 512K bytes of video memory can be directly supported. For example, this is sufficient capacity to store a 2048 x 2048 pixel x 1 bit image. Images can be generated on the screen by: CHARACTER DISPLAY CONFIGURATION Although the 82720 is intended primarily for rasterscan graphics, it can be used as a character display controller. The 82720 can support up to 8K by 13 bits of private video memory in this configuration (1 character = 13 bits). This is sufficient memory to store 4 screens of data containing 25 rows by 80 characters. The 82720 can display up to 256 characters per row. Smooth vertical scrolling of each of 4 independent display partitions is also supported. -Drawing Commands -Program-Controlled Transfers -DMA Transfers from System Memory The 82720 can be configured to support a wide variety of graphics applications. It can support: -High Dot Rates -Color Planes -Horizontal Split Screen -Character-oriented Displays -Multiplexed Graphic and Character Display MIXED DISPLAY CONFIGURATION The GDC can support a mixed display system for both graphic and character information. This capability allows the display screen to be partitioned between graphic and character data. It is possible to switch between one graphic display window and one character display window with raster line resolution. A maximum of 256K bytes of video memory is supported in this mode: half is for graphic data, half is for character data. In graphic mode, a one megapixel image can be stored and displayed. In character mode, 64K, 16-bit characters can be stored. GRAPHIC DISPLAY CONFIGURATIONS The 82720 provides the flexibility to handle a wide variety of graphic applications. This flexibility results from having its own private video memory for storage of the graphics image. The organization of this memory determines the performance, the number of bits/pixel and the size of the display. Several different video memory organizations are examined in the following paragraphs. In the simplest 82720 system, the memory can store up to a 2048 2048 x 1 bit image. It can display a 1024 x 1024 x 1 bit section of the image at a maximum dot rate of 44 MHz, or 88 MHz in wide mode. In this configuration, only 1 bit/pixel is used. x DETAILED OPERATIONAL DESCRIPTION The GDC can be used in one of three basic modes -Graphics Mode, Character Mode and Mixed Mode. This section of the data sheet describes the following for each mode: 1. 2. 3. 4. By partitioning the memory into multiple banks, color, gray scale and higher bandwidth displays can be supported. By adding various amounts of external logic, 7-94 Memory organization Display timing Special Display functions Drawing and writing 210655-003 82720 Graphics Mode Memory Organization Graphics Mode Special Display Functions: The Display Memory is organized into 16-bit words (32-bit words in wide mode). Since the display memory can be larger than the CRT display itself, two width parameters must be specified: display memory width and display width. The Display width (in words) is selected by a parameter of the Reset command. The Display memory width (in words) is selected by a parameter of the Pitch command. The height of the Display memory can be larger than the display itself. The height of the Display is selected by a parameter of the Reset command. The GDC can directly address up to 4Mbits (O.5Mbytes) of display RAM in graphics mode. WINDOWING The GDC's Graphics Mode Display can be divided into two windows on the screen, upper and lower. The windows are defined by parameters written into the GDC's parameter RAM. Each window is specified by a starting address and a window length in lines. If the second windciw is not used, the first window parameters should be specified to be the same as the active display length. ZOOMING A parameter of the GDC's zoom command allows zooming by effectively increasing the size of the dots on the screen. This is accomplished vertically by repeating the same display line. The number of times it is repeated is determined by the display zoom factor parameter. Horizontally, zoom is accomplished by extending each display word cycle and displaying fewer words per line, according to the zoom factor. It is the responsibility of the microprocessor controlling the GDC to provide the shift register clock circuitry with the zoom factor required to slow down the shift registers to the appropriate speed. The frequency of the 2XWCLK should not be changed. The zoom factor must be set to a known state upon initialization. Graphics Mode Display Timing All raster blanking and display timings of the GDC are a function of the input clock frequency. Sixteen or 32 bits of data are read from the RAM and loaded into a shift register in each two clock period display cycle. The Address and Data busses of the GDC are multiplexed. In the first part of the cycle, the address of the word to be read is latched into an external demultiplexer. In the second part of the cycle the data is read from the RAM and loaded into the shift register. Since all 16 (32) bits of data are to be displayed, the dot clock is 8 x (16 x) the GDC clock or.16 x (32 x) the Read cycle rate. PANNING Panning is accomplished by changing the starting address of the display window. In this way, panning is possible in any direction, vertically on a line by line basis and horizontally on a word by word basis. Parameters of the Reset or Sync command determine the horizontal and vertical front porch, sync pulse, and back porch timings. Horizontal parameters are specified as multiples of the display cycle time, and vertical parameters as a multiple of the line time. Graphics Mode Drawing and Writing Another Reset command parameter selects interlaced or non-interlaced mode. A bit in the parameter RAM can define Wide Display Mode. In this mode, while data is being sent to the screen, the display address counter is incremented by two rather than one. This allows the display memory to be configured to deliver 32 bits from each display read cycle. The GDC can draw solid or patterned lines, arcs, circles, rectangles, slanted rectangles, characters, slanted characters, filled rectangles. Direct access to the bit map is also provided via the DMA Commands and the Read or Write data commands. MEMORY MODIFICATION All drawing and writing functions take place at the location in the display RAM specified by the cursor. The cursor is not displayed in Graphics Mode. The cursor location is modified by the execution of drawing, reading or writing commands. The cursor will move to the bit following the last bit accessed. The V Sync command specifies whether the V Sync Pin is an input or an output. If the V Sync Pin is an output, the GDC generates the raster timing for the display and other CRT controllers can be synchronized to it. If the V Sync pin is an input, the GDC can be synchronized to any external vertical Sync signal. 7-95 210655-003 82720 READING AND DRAWING COMMANDS After the modification mode has been set and the parameter RAM has been loaded, the final drawing parameters are loaded via the figure specify (FIGS) command. The first parameter specifies the direction in which drawing will occur and the figure type to be drawn. This parameter is followed by one to five more parameters depending on the type of character to be drawn. Each bit is drawn by executing a Read-Modify-Write cycle on the display RAM. These RlMrN cycles normally require four 2XWCLK cycles to execute. If the display zoom factor is greater than two, each R/MrN cycle will, be extended to the width of a display cycle. Write Data (WDAT), Read Data (RDAT), DMA write (DMAW) and DMA read (DMAR) commands can be used to examine or modify one to 16 bits in each word during each R/M/W cycle. All other graphics drawing commands modify one bit per R/M/W cycle. The direction parameter specifies one of eight octants in which the drawing or reading will occur. The effect of drawing direction on the various figure types is shown in Figure 9. An internal 16-bit Mask register determines which bites) in the accessed word are to be modified. A one in the Mask register allows the corresponding bit in the display RAM to be modified by the R/MrN cycle. A zero in the Mask register prevents the GDC from modifying the corresponding bit in the display RAM. RDAT, WDAT, DMAR, and DMAW Operations move through the Display memory as shown in the "DMA" Column. The mask must be set by the Mask Command prior to issuing the WDAT or DMAW command. The Mask register, is automatically set by the CURS command and manipulated by the graphics commands. The other parameters required to set up figure reading or drawing are shown in Figure 3. The display RAM bits can, be modified in one of four ways. They can be set to 1, reset to 0, complemented or replaced by a pattern. DRAWI~G TYPE DC D D2 INITIAL VALUE' LINE When replace by a pattern mode is selected, lines, arcs and rectangles will be drawn using the 16-bit pattern in parameter RAM bytes 8 and 9. Idll ARC" rsln 411 RECTANGLE In set, reset, or complement mode,. parameter RAM bytes 8 and 9 act as another level of masking for line arc and rectangle drawing. As each 16-bit segment of the line or arc is drawn, it is checked against the pattern in the parameter RAM. If the pattern RAM bit is a one, the display RAM bit will be set, reset, or complemented per the proper modes. If the pattern RAM bit is a zero, the display RAM bit won't be modified. DM -1 -1 21dDI - Idll 2(ldDI - Idll) 21dDI r-1 2(,-1) -1 rsln 91 A-I B-1 -1 A-I AREA FILL B-1 A A GRAPHIC CHARACTER'" B-1 A A WRITE DATA W- 1 DMAW D-l C-l DMAR D-l C-2 READ DATA Dl (C-2)12f W 'INITIAL VALUES FOR THE VARIOUS PARAMETERS ARE LOADED WHEN THE FIGS COMMAND BYTE IS PROCESSED, "CIRCLES ARE DRAWN WITH 8 ARCS, EACH OF WHICH SPAN 45', SO THAT SIN ~ = 1/../2 AND SIN, = 0, "'GRAPHIC CHARACTERS ARE A SPECIAL CASE OF BIT,MAP AREA FILLING IN WHICH B AND A ,,8. IF A = 8 THERE IS NO NEED TO LOAD bAND D2. . . WHERE: - 1 = ALL ONES VALUE. ALL NUMBERS ARE SHOWN IN BASE 10 FOR CONVENIENCE, THE GDC ACCEPTS BASE 2 NUMBERS (2. COMPLEMENT NOTATION WHERE APPROPRIATE), . - = NO PARAMETER BYTES SENT TO GDC FOR THIS PARAMETER, dl= THE'LARGER OF dx OR "y, dD = THE SMALLER OF dx OR I>.y, ,= RADIUS OF CURVATURE, IN PIXELS. ~ = ANGLE FROM MAJOR AXIS TO END OF THE ARC,. ,,45', ,= ANGLE FROM MAJOR AXIS TO START OF THE ARC, f/ "45', I = ROUND UP TO THE NEXT HIGHER INTEGER. I = ROUND DOWN TO THE NEXT LOWER INTEGER, A= NUMBER OF PIXELS IN THE INITIALLY SPECIFIED DIRECTION. B = NUMBER OF PIXELS IN THE DIRECTION AT RIGHT ANGLES TO THE INITIALLY SPECIFIED DIRECTION. W = NUMBER OF WORDS TO BE ACCESSED. C = NUMBER OF BYTES TO BE TRANSFERRED IN THE INITIALLY SPECIFIED DIRECTION, (TWO BYTES PER WORD IF WORD TRANSFER MODE IS SELECTED,) D = NUMBER DF WORDS TO BE ACCESSED IN THE DIRECTION AT RIGHT ANGLES TO THE INITIALLY SPECIFIED DIRECTION. DC = DRAWING COUNT PARAMETER WHICH IS ONE LESS THAN THE NUMBER OF RMW CYCLES TO BE EXECUTED, DM = DOTS MASKED FROM DRAWING DURING ARC DRAWING, t = NEEDED ONLY FOR WORD READS. When replace by pattern mode is selected, the graphics character and fill commands will cause the 8 x 8 pattern in parameter RAM bytes 8 to 15 to be written directly into the display RAM in the appropriate locations. In set, reset, or complement mode, th'e 8 x 8 pattern in parameter RAM bytes 8 to 15 act as a mask pattern for graphics character or fill commands. If the appropriate parameter RAM bit is set, the display RAM bit will be modified. If the parameter RAM bit is zero, the display RAM bit will not be modified. These modes are selected by issuing a WDAT command without , parameters before issuing graphics commands. The pattern in the parameter RAM has no effect on WDAT, RDAT, DMAW, or DMAR operations. Figure 3. Drawing Parameter Details 7-96 210655·00~ intel· 82720 After the parameters have been set, line, arc, circle, rectangle or slanted rectangle drawing operations are initiated by the Figure Draw (FIGD) command. Character, slanted character, area fill and slanted area fill drawing operations are initiated by the Graphics Character Draw (GCHRD) command. DMA transfers are initiated by the DMA Read or Write (DMAR or DMAW) commands. Data Read Operations are initiated by the Read Data (RDAT) Command. Data Write Operations are initiated by writing a parameter after the WDAT command. Character Mode Display Timing In character mode, the display timing works as it does in graphics mode. In addition, the Address 17 output becomes cursor output. The characteristics of the cursor are defined by parameters of the cursor and Character Characteristics (CCHAR) command. One bit allows the cursor output to be enabled or disabled. The height of the cursor is programmable by selecting the top and bottom line between which the cursor will appear. The blink rate is also programmable. The parameter selects the number of frame times that the cursor will be inactive and active, resulting in a 50% duty cycle cursor blinking at 2 x the period specified by the parameter. The area fill operation steps and repeats the 8 x 8 graphics character pattern draw operation to fill a rectangular area. If the size of the rectangle is not an integral number of 8 x 8 pixels, the GDC will automatically truncate the pattern at the edges furthest from the starting point. The cursor output pin also provides the line counter bit 4 signal, which is valid 10 clocks after the trailing edge of HSYNC. The Graphics Character Drawing capability can be modified by the Graphics Character Write Zoom Factor (GCHR) parameter of the zoom command. The zoom write factor may be set from 1 to 16 (by using from 0 to 15 in the parameter). Each dot will be repeated in memory horizontally and vertically (adjusted for drawing direction) the number of times specified by the zoom factor. Character Mode Special Display Functions WINDOWING The GDC's Character Mode display can be partitioned into one to four windows on the screen. The windows are defined by parameters written into the GDC's Parameter RAM. Each window is specified by a starting address and a window length in lines. The WDAT command can be used to rapidly fill large areas in memory with the same value. The mask is set to all 1's, and the least significant bit of the WDAT parameter replaces all bits of each word written. If windowing is not required, the first window length should be specified to be the same as the active display length. Character Mode Memory Organization ZOOMING AND PANNING In character mode, zooming and pan handling commands function the same way as in Graphics Mode. In character mode, the Display memory is organized into up to 8K characters of up to 13 bits each. Wide mode is also available for characters of up to 26 bits. Character Mode Drawing and Writing The display memory can be larger than the display itself. The display width (in characters) is a parameter of the reset command. The display memory width (in characters) is a parameter of the Pitch Command. The height of the display (in lines) is a parameter of the Reset Command. The display memory height is determined by dividing the number of display memory words by the pitch. The GDC can read or write characters of up to 13 bits into or out of the Display RAM. All reading and writing functions take place at the display RAM location specified by the cursor. The cursor location can be read by issuing the CURD command. The cursor can be moved anywhere within the display memory by the CURS command. The cursor location is also modified by the execution of character read or write commands. In character mode, the display works almost exactly as it does in graphics mode. The differences lie in the fact that data read from the display RAM is used to drive a character generator as well as attribute logic if desired. In Character mode, address bits 13-16 become line counter outputs used to select the proper line of the character generator, and the address 17 output becomes the cursor and line counter MSB output. Each character is written or read via a Read/Modify/Write cycle. The mask register contents determine which bit(s) in the character are modified. The mask register can be used to change character codes without modifying attribute bits or vice-versa. The Replace with pattern, Set, Reset and Complement 7-97 210655-003 82720 modes work exactly as they do in graphics mode, with the exception that the parameter RAM Pattern is not used. The pattern used is a parameter of tile WDAT command. active high line counter reset signal which is valid 10 clocks after the trailing edge of HSYNC. During the active display line time, A16 provides blink timing for external attribute Circuitry. This signal blinks at 1/2 the blink rate of the cursor with a 75% on, 25% off duty cycle. A17 provides a signal which selects between graphics or character display, which is also valid 10 clocks after the trailing edge of HSYNC. During the active display time, A17 provides the cursor signal. The cursor timing and characteristics are defined in exactly the same way as in pure character mode. The Figure Specify (FIGS) command must be set to Character Display mode, as well as specify the direction the cursor will be moved by read or write data commands. In character mode, the FIGD and GCHRDcommands are not used. Mixed Mode Special Display Functions Mixed Mode Memory Organization WINDOWING The GDC supports two display windows in mixed mode. They can independently be programmed into either graphics or character mode determined by the state of two bits in the parameter RAM. The window location in display memory and size are also determined by parameters in the parameter RAM. In mixed mode, the display memory is organized into . two banks of up to 64K words of 16 bits each (32 bits in wide mode). The display height and width are programmable by the same Reset or Sync command parameters as in the graphics and character modes. The display memory width (in words) is a parameter of the Pitch Command and the height of the display memory is determined by dividing the number of display memory words by the pitch. ZOOMING AND PANNING In mixed mode, zooming and panning commands function the same as in graphics and character mode. An image mode signal is used to switch the external circuitry between graphics and character modes in two display windows. Mixed Mode Drawing and Writing In a graphics window, the GDC works as it does in pure graphics mode, but on a smaller total memory space (64K words vs 512K words). In mixed mode, the GDC can write or draw in exactly the same ways as in both graphics and character modes. In addition, the FIGS command has a parameter GO (Graphics Drawing Flag) which sets the image mode signal to select the proper RAM bank. In a character window, the GDC works as it does in pure character mode,. but the line counter must be implemented externally. The counter is clocked by the horizontal sync pulse and reset by a signal supplied by the GDC. DEVICE PROGRAMMING The GDC occupies two addresses on the system microprocessor bus through which the GDC's status register and FIFO are accessed. Commands and parameters are written into the GDC FIFO and are differentiated by address bit AO. The status register or the FIFO can be read as selected by the address line. In mixed mode, the GDC provides both a cursor and· an attribute blink timing signal. Mixed Mode Display Timing READ STATUS REGISTER AO In mixed mode, each word in a graphic area is accessed twice in succession. The AW parameter of the Reset or Sync command should be set to twice its normal value, and the video shift register load Signal must be suppressed during the extra access cycle. 0 I I I I I I I I FIFO READ 1 In addition, A16 becomes a Multiplexed Attribute and Clear Line Counter signal and A17 becomes a multiplexed cursor and image mode signal. A16 provides an I I I I I I WRITE PARAMETER INTO FIFO I I I I I I I I I I COMMAND INTO FIFO I I I II I I I I I I I Figure 4. GDC Microprocessor Bus Interface Registers 7-98 210655-003 82720 SR-6: Horizontal Blanking Active: A 1 value for this flag signifies that horizontal retrace blanking is currently underway. Commands to the GOC take the form of a command byte followed by a series of parameter bytes as needed for specifying the details of the command. The command processor decodes the commands, unpacks the parameters, loads them into the appropriate registers within the GOC and initiates the required operations. SR-5: Vertical Sync: Vertical retrace sync occurs while this flag is a 1. The vertical sync flag coordinates display format modifying commands to the blanked interval surrounding vertical sync. This eliminates display disturbances. The commands available in the GOC can be organized into five categories as described in figure 5. SR-4: DMA Execute: This bit is a 1 during OMA data transfers. VIDEO CONTROL COMMANDS 1. RESET: RESETS THE GDC TO ITS IDLE STATE. 2. SYNC: SPECIFIES THE VIDEO DISPLAY FORMAT. 3. VSYNC: SELECTS MASTER OR SLAVE VIDEO SYNCHRONIZATION MODE 4. CCHAR: SPECIFIES THE CURSOR AND CHARACTER ROW HEIGHTS. DISPLAY CONTROL COMMANDS 1. START: ENDS IDLE MODE AND UNBLANKS THE DISPLAY. 2. BCTRL: CONTROLS THE BLANKING AND UNBLANKING OF THE DISPLAY. 3. ZOOM: SPECIFIES ZOOM FACTORS FOR THE DISPLAY AND GRAPHICS CHARACTERS WRITING. 4. CURS: SETS THE POSITION OF THE CURSOR IN DISPLAY MEMORY. 5. PRAM: DEFINES STARTING ADDRESSES AND LENGTHS OF THE DISPLAY AREAS AND SPECIFIES THE EIGHT BYTES FOR THE GRAPHICS CHARACTER. 6. PITCH: SPECIFIES THE WIDTH OF THE X DIMENSION OF DISPLAY MEMORY. DRAWING CONTROL COMMANDS 1. WDAT: WRITES DATA WORDS OR BYTES INTO DISPLAY MEMORY. 2. MASK: SETS THE MASK REGISTER CONTENTS. 3. FIGS: SPECIFIES THE PARAMETERS FOR THE DRAWING PROCESSOR. 4. FIGD: DRAWS THE FIGURE AS SPECIFIED ABOVE. 5. GCHRD: DRAWS THE GRAPHICS CHARACTER INTO DISPLAY SR-3: Drawing in Progress: While the GOC is drawing a graphics figure, this status bit is a 1. SR-2: FIFO Empty: This bit and the FIFO Full flag coordinate system microprocessor accesses with the GOC FIFO. When it is 1, the Empty flag ensures that all the commands and parameters previously sent to the GOC have been processed. SR-1: FIFO Full: A 1 at this flag indicates a full FIFO in the GOC. A 0 ensures that there is room for at least one byte. This flag needs to be checked before each write into the GOC. SR·O: Data Ready: When this flag is a 1, it indicates that a byte is available to be read by the system microprocessor. This bit must be tested before each read operation. It drops to a 0 while the data is transferred from the FIFO into the microprocessor interface data register. MEMORY. DATA READ COMMANDS 1. RDAT: READS DATA WORDS OR BYTES FROM DISPLAY MEMORY. 2. CURD: READS THE CURSOR POSITION. 3. LPRD: READS THE LIGHT PEN ADDRESS. DMA CONTROL COMMANDS 1. DMAR: REQUESTS A DMA READ TRANSFER. 2. DMAW: REQUESTS A DMA WRITE TRANSFER. Figure 5. GDC Command Summary FIFO Operation & Command Protocol The first-in, first-out buffer (FIFO) in the GOC handles the command dialogue with the system microprocessor. This flow of information uses a halfduplex technique, in which the single 16-location FIFO is used for both directions of data movement, one direction at a time. The FIFO's direction is controlled by the system microprocessor through the GOC's command set. The microprocessor coordinates these transfers by checking the appropriate status register bits. t ~~~~~DY 111 r 1 ~FIFOEMPTY L _ _ _ _ _ DRAWING IN PROGRESS DMAEXECUTE VERTICAL SYNC ACTIVE . ~~:~~A~E~~c':K ACTIVE Figure 6. Status Register (SR) The command protocol used by the GOC requires the differentiation of the first byte of a command sequence from the succeeding bytes. This first byte contains the operation code and the remaining bytes carry parameters. Writing into the GOC causes the FIFO to store a flag value alongside the data byte to signify whether the byte was written into the command or the parameter address. The command processor in the GOC tests this bit as it interprets the entries in the FIFO. Status Register Flags SR-7: Light Pen Detect: When this bit is set to 1, the light pen address (LAD) register contains a deglitched value that the system microprocessor may read. This flag is reset after the 3-byte LAD is moved into the FIFO in response to the light pen read command. 7-99 210655-003 82720 The receipt of a command byte by the command processor marks the end of any previous operation. The number of parameter bytes supplied with a command is cut short by the receipt of the next command byte. A read operation from the GDC to the microprocessor can be terminated at any time by the next command. The FIFO changes direction under the control of the system microprocessor. Commands written into the GDC always put the FIFO into write mode if it wasn't in it already. If it was in read mode, any read data in the FIFO at the time of the turnaround is lost. Commands which require a GDC response, such as RDAT, CURD and LPRD, put the FIFO into read mode after the command is interpreted by the GDC's command processor. Any commands and parameters behind the read-evoking command are discarded when the FIFO direction is reversed. Read-Modify-Write Cycle Data transfers between the GDC and the display memory are accomplished using a read-modify-write (RMW) memory cycle. The four clock period timing of the RMW cycle is used to: 1) output the address, 2) read data from the memory, 3) modify the data, and 4) write the modified data back into the initially selected memory address. This type of memory cycle is used for all interactions with display memory including DMA transfers, except. for the two clock period display and RAM refresh cycles. The operations performed during the modify portion of the RMW cycle merit additional explanation. The circuitry in the GDC uses three main elements: the Pattern register, the Mask register, and the 16-bit Logic unit. The Pattern register holds the data pattern to be moved into memory. It is loaded by the WDAT command or, during drawing, from the parameter RAM. The Mask register contents determine which bits of the read data will be modified. Based on the contents of these registers, the Logic unit performs the selected operations of REPLACE, COMPLEMENT, SET, or CLEAR on the data read from display memory. The Pattern register contents are ANDed with the Mask register contents to enable the actual modification of thememory read data, on a bit-by-bit basis. For graphics drawing, one bit at a time from the Pattern register is combined with the Mask. When ANDed with the bit set to a 1 in the Mask register, the proper single pixel is modified by the Logic Unit. For the next pixel in the figure, the next bit in the Pattern register is selected and the Mask register bit is moved to identify the pixel's location within the word. The Execution word address pointer register, EAD, is also adjusted as required to address the word containing the next pixel. In character mode, all of the bits in the Pattern register are used in parallel to form the respective bits of the modify data word. Since the bits of the character code word are used in parallel, unlike the one-bit-ata-time graphics drawing process, this facility allows any or all of the bits in a memory word to be modified in one RMW memory cycle. The Mask register must be loaded with 1s in the positions where modification is to be permitted. The Mask register can be loaded in either of two ways. In graphics mode, the CURS command contains a four-bit dAD field to specify the dot address. The command processor converts this parameter into the one-of-16 format used in the Mask register for figure drawing. A full 16 bits can be loaded into the Mask register using the MASK command. In addition to the character mode use mentioned above, the 16-bit MASK load is convenient in graphics mode when all of the pixels of a word are to be set to the same value. ' The Logic unit combines the data read from display memory, the Pattern register, and the Mask register to generate the data'to be written back into display memory. Anyone of four operations can be selected: REPLACE, COMPLEMENT, CLEAR or SET. In each case, if the respective Mask bit is 0, that particular bit of the read data is returned to memory unmodified. If the Mask bit is 1, the modification is enabled. With the REPLACE operation, the modify data simply takes the place of the read data for modification enabled bits. For the other three operations, a 0 in the modify data allows the read data bit to be returned to memory. A 1 value causes the specified operation to be performed in the bit positions with set Mask bits. Figure Drawing The GDC draws graphics figures at the rate of one pixel per read-modify-write (RMW) display memory cycle. These cycles take four clock periods to complete. At a clock frequency of 5 MHz, this is equal to 800 ns. During the RMW cycle the GDC simultaneously calculates the address and position of the next pixel to be drawn. The graphics figure drawing process depends on the display memory addressing structure. Groups of 16 horizontally adjacent pixels form the 16-bit words 7-100 210655-003 82720 which are handled by the GDG. Display memory is organized as a linearly addressed space of these words. Addressing of individual pixels is handled by the GDG's internal RMW logic. Figure 8 summarizes these operations for each direction. During the drawing process, the GDG finds the next pixel of the figure which is one of the eight nearest neighbors of the last pixel drawn. The GDG assigns each of these eight directions a number from 0 to 7, starting with straight down and proceeding counterclockwise. Whole word drawing is useful for filling areas in memory with a single value. By setting the Mask register to all 1s with the MASK command, both the LSB and MSB of the dAD will always be 1, so that the EAD value will be incremented or decremented for each cycle regardless of direction. One RMW cycle will be able to affect all 16 bits of the word for any drawing type. One bit in the Pattern register is used per RMW cycle to write all the bits of the word to the same value. The next Pattern bit is used for the word, etc. DIR ADDRESS OPERATION(S) EAD=EAD+P else EAD = EAD + P If dAD.MSB = 1 then EAD = EAD + 1 dAD - RR (dAD) dAD = LR(dAD) else If dAD.MSB = 1 then EAD = EAD + 1 dAD - RR (dAD) dAD = LR(dAD) else EAD = EAD -P If dAD.MSB = 1 then EAD = EAD + 1 dAD - RR (dAD) dAD = LR(dAD) 4 Figure 7. Drawing Directions Figure drawing requires the proper manipulation of the address and the pixel bit position according to the drawing direction to determine the next pixel of the figure. To move to the word above or below the current one, it is necessary to subtract or add the number of words per line in display memory. This parameter is called the pitch. To move to the word to either side, the Execute word address cLirsor, EAD, must be incremented or decremented as the dot address pointer bit reaches the LSB or the MSB of the Mask register. To move to a pixel within the same word, it is necessary to rotate the dot address pointer register to the right or left. EAD = EAD - P else EAD = EAD - P If dAD.LSB = 1 then EAD = EAD - 1 dAD = RR(dAD) else If dAD.LSB = 1 then EAD = EAD - 1 dAD = RR(dAD) 7 else EAD = EAD + P If dAD.LSB = 1 then EAD = EAD - 1 dAD = RR(dAD) WHERE P = CAD = dAD = LSB = MSB = dAD - LR (dAD) dAD - LR (dAD) dAD - LR (dAD) PITCH, LR = LEFT ROTATE, RR = RIGHT ROTATE CURSOR ADDRESS DOT ADDRESS LEAST SIGNIFICANT BIT MOST SIGNIFICANT BIT Figure 8. Address Calculation Details 7-101 210655-003 intel' 82720 For the various figures, the effect of the initial direction upon the resulting drawing is shown in figure 9. arc as drawing proceeds. An arc may be up to 45 degrees in length. OMA transfers are done on word boundaries only, and follow the arrows indicated in the table to find successive word addresses. The slanted paths for OMA transfers indicate the GOC changing both the X and Y components of the word address when moving to the next word. It does not follow a 45 degree diagonal path by pixels. Note that during line drawing, the angle of the line may be anywhere within the shaded octant defined by the OIR value. Arc drawing starts in the direction initially specified by the OIR value and veers into an Dir 000 001 010 011 100 101 110 111 Line ~~ ~.-,:,:- ~ , ~ ,..I' , I I A ~ I , , I I , , ~ r:~~,. 'V~ .e,~~,) A Y ~ .f ' " I I ~ r: , , , I I " , •~ 0 N\l 0 ~ Ii / 0 ~ <> ~ Character Slant Char Rectangle Arc ~~'~J ~ ~ 1 j •~ DMA ~. 0 m 0 ~ 0 -- - .~ ~ I F ~ f <> -# Figure 9. Effect of the Direction Parameter 7-102 210655-003 82720 Drawing Parameters memory as many times as desired without reloading the parameter RAM. In preparation for graphics figure drawing, the GDC's Drawing Processor needs the figure type, direction and drawing parameters, the starting pixel address, and the pattern from the microprocessor. Once these are in place within the GDC, the Figure Draw command, FIGD, initiates the drawing operation. From that point on, the system microprocessor is not involved in the drawing process. The GDC Drawing Processor coordinates the RMW circuitry and address registers to draw the specified figure pixel by pixel. - Once the parameter RAM has been loaded with up to eight graphics character bytes by the appropriate PRAM command, the GCHRD command can be used to draw the bytes into display memory starting at the cursor. The zoom magnification factor for writing, set by the zoom command, controls the size of the character written into the display memory in integer multiples of 1 through 16. The bit values in the PRAM are repeated horizontally and vertically the number of times specified by the zoom factor. The algorithms used by the processor for figure drawing are designed to optimize its drawing speed. To this end, the specific details about the figure to be drawn are reduced by the microprocessor to a form conducive to high-speed address calculations within the GDC. In this way the repetitive, pixel-by-pixel calculations can be done quickly, thereby minimizing the overall figure drawing time. Figure 3 summarizes the parameters. Graphics Character Drawing Graphics characters can be drawn into display memory pixel-by-pixel. The up to 8-by-8 character is loaded into the GDC's parameter RAM by the system microprocessor. Consequently, there are no limitations on the character set used. By varying the drawing parameters and drawing direction, numerous drawing options are available. In area fill applications, a character can be written into display 7-103 The movement of these PRAM bytes to the display memory is controlled by the parameters of the FIGS command. Based on the specified height and width of the area to be drawn, the parameter RAM is scanned to fill the required area. For an 8-by-8 graphics character, the first pixel drawn uses the LSB of RA-15, the second pixel uses bit 1 of RA-15, and so on, until the MSB of RA-15 is reached. The GDC jumps to the corresponding bit in RA-14 to continue the drawing. The progression then advances toward the LSB of RA-14. This snaking sequence is continued for the other 6 PRAM bytes. This progression matches the sequence of display memory addresses calculated by the drawing processor as shown in figure 9. If the area is narrower than 8 pixels wide, the snaking will advance to the next PRAM byte before the MSB is reached. If the area is less than 8 lines high, fewer bytes in the parameter RAM will be scanned. If the area is larger than 8 by 8, the GDC will repeat the contents of the parameter RAM in two dimensions. 210655-003 intel' 82720 Parameter RAM Contents The parameters stored in the parameter RAM, PRAM, are available for the GDC to refer to repeatedly during figure drawing and rasterscanning. In each mode of operation the values in the PRAM are interpreted by the GDC in a predetermined fashion. The host microprocessor must load the appropriate parameters into the proper PRAM locations. PRAM loading command allows the host to write into any location of the PRAM and transfer as many bytes as desired. In this way any stored parameter byte or bytes may be changed without influencing the other bytes. The PRAM stores two types of information. For specifying the details of the display area partitions, blocks of four bytes are used. The four parameters stored in each block include the starting address in display memory of each display area, and its length. In addition, there are two mode bits for each area which specify whether the area is a bit-mapped graphics area or a coded character area, and whether a normal or wide display cycle is to be used for that area. The other use for the PRAM contents is to supply the pattern for figure drawing when in a bit-mapped graphics a'rea or mode. In these situations, PRAM bytes 8 through 16 are reserved for this patterning information. For line, arc, and rectangle drawing (linear figures) locations 8 and 9 are loaded into the Pattern register to allow the GDC to draw dotted, dashed, etc. lines. For area ,filling and graphics bitmapped character drawing locations 8 through 15 are referenced for the pattern or character to be drawn. Details of the bit assignments are shown on the following pages for the various modes of operation. 7-104 210655-003 82720 RA.0 1 S_I____SA_Dl_---~ L . SADI H I..l' ~~__~__~~~~I__~I__~__~ DISPLAY PARTITION AREA 1 STARTING ADDRESS WITH LOW AND HIGH :~DN~~~S~~CEFIELDS(WORD LENGTH OF DISPLAY PARTITION 1 (LINE COUNn WITH LOW AND HIGH SIGNIFICANCE FIELDS. THE IMAGE BIT AFFECTS THE OPERATION OF THE DISPLAY ADDRESS COUNTER IN CHARACTER MODE. IF '------------- ~~E~~NACGREE~IJ~~ ~~~N~TAFTER EACH READ CYCLE. IF THE IMAGE BIT IS SET, IT WILL INCREMENT BY ONE AFTER EVERY TWO READ CYCLES. A WIDE DISPLAY CYCLE WIDTH OF TWO WORDS PER MEMORY CYCLE IS SELECTED FOR THIS DISPLAY '--------------- ~~~MpI~~:J~~~~n~~~T~R IS THEN INCREMENTED BY 2 FOR EACH DISPLAY SCAN CYCLE. OTHER MEMORY CYCLE TYPES ARE NOT INFLUENCED. RA-4 SAD2 L DISPLAY PARTITION 2 STARTING - - ADDRESS AND LENGTH DISPLAY PARTITION 3 STARTING ADDRESS AND LENGTH RA-B 9 10 11 RA-12 DISPLAY PARTITION 4 STARTING ADDRESS AND LENGTH 13 14 '-__________________.__J 15 Figure 10. Parameter RAM Contents-Character Mode 7-105 210655·003 82720 RA·O ~~ ~ ~S_A~~_I_"~ ~ ~~I~ __ 2 LI_ _ __ __ __ DISPLAY PARTITION AREA 1 STARTING ADDRESS WITH LOYol MIDDLE, AND HIGH SIGNIFICANCE· FIELDS (WORD ADDRESS). ~_L_E~~I_"~ ~ ~ ~S_A.~_I_H~ __ __ __ LENGTH OF DISPLAY PARTITION AREA 1 WITH LOW AND HIGH SIGNIFICANCE FIELDS (LINE COUNT) IN MIXED MODE, A 1 INDICATES AN IMAGE OR GRAPHICS AREA, AND A 0 INDICATES A CHARACTER AREA. IN GRAPHICS MODE THIS BIT MUST BE O. WIDE DISPLAY CYCLE MODE BIT RA-4 SAD2 l ~ -1 DISPLAY PARTITION AREA 2 STARTING ADDRESS AND LENGTH WITH IMAGE IDENTIFY BIT AS IN AREA 1. SAD2 H ..L 6 7 i LE~2l_1 WD211M I I o I o -1 ISA~2M L~2H -1 -1 } RA-l0 GCHR 6 11 GCHR 5 12 GCHR 4 13 GCHR3 14 GCHR 2 PATTERN OF 16 BITS USED FOR FIGURE DRAWING TO PERFORM DOTTED, DASHED, ETC. LINES GRAPHICS CHARACTER BYTES TO BE MOVED INTO DISPLAY MEMORY WITH GRAPHICS CHARACTER DRAWING 15 Figure 11. Parameter RAM Contents-Graphics and Mixed Graphics and Character Modes 7-106 210655·003 82720 RESET: SYNC: VSYNC: 0 0 1 I 0 0 10 0 0 11 0 11 o1 0 0 WDAT: DE MASK: M FIGS: I I 1 I 1 CCHAR: FIGD: START: GCHRD: BCTRL: I 0 0 ZOOM: RDAT: DE 1 0 MOD I 1 1 TYPE 10 1 I CURD: 0 LPRD: 0 1 CURS: o1 PRAM: oI 0 11 1 I 0 PITCH: SA I 0 1 I I MOD I 0 0 I DMAR: , 11 1 1 TYPE DMAW: 1 1 TYPE , 11 1 MOD, MOD I Figure 12. Command Bytes Summary VIDEO CONTROL COMMANDS RESET: I 0 ! 0 ! 0 ! 0 ! 0 I 0 I 0 ! 0 I BLANK THE DISPLAY, ENTER IDLE MODE, AND INITIALIZE WITHIN THE GDC: -FIFO -COMMAND PROCESSOR -INTERNAL COUNTERS Figure 13. Reset Command RESET COMMAND This command can be executed at any time and does not modify any of the parameters already loaded into the GOC. 7-107 If followed by parameter bytes, this command also sets the sync generator parameters as described below. Idle mode is exited with the STARTcommand. 210655-003 82720 _ 0 0lcl P1 FIIIDIGIS AW P2 VS, P3 \ P4 P5 P6 I I I I ~ I ~ 0 01 0 OJ I I 0 O. HORIZONTAL SYNC WIDTH.-1 VERTICAL SYNC WIDTH, LOW BITS I V~H j.-- HBP _ VFP 4--4--- AL, I MODE CONTROL BITS. SEE FIGURE 15. ACTIVE DISPLAY WORDS PER LINE -2. MUST BE EVEN NUMBER WITH BIT ~ HS HFP I I P7 P8 _ VBP I I ~ I I AL IH j.-- VERTICAL SYNC WIDTH, HIGH BITS HORIZONTAL FRONT PORCH WIDTH -1. HORIZONTAL BACK PORCH WIDTH -1. VERTICAL FRONT PORCH WIDTH ACTIVE DISPLAY LINES PER VIDEO FIELD, LOW BITS ACTIVE DISPLAY LINES PER VIDEO FIELD, HIGH BITS VERTICAL BACK PORCH WIDTH Figure 14. Optional Reset Parameters In graphics mode, a word is a group of 16 pixels. In character mode, a word is one character code and its attributes, if any. The number of active words per line must be an even number from 2 to 256. HORIZONTAL BACK PORCH CONSTRAINTS 1. In general: HBP ;0:3 words 2. If interlaced display mode is used, or the IMAGE or WIDE mode bits change within one video field: HBP2 5 words An ali-zero parameter value selects a count equal to MODE CONTROL BITS (FIGURE 15) 2n where n = number of bits in the parameter field for vertical parameters. Ali horizontal widths are counted in display words. Ali vertical intervals are counted in lines. Repeat Field Framing: Interlaced Framing: Sync Parameter Constraints HORIZONTAL FRONT PORCH CONSTRAINTS 1. In general: HFP ;0:2 words 2. If DMA is used, or the display zoom factor is greater than one in interlaced display mode: HFP ;0:3 words 3. If the GDC is used in slave mode: HFP ;0:4 words 4. If the light pen input is used: HFP ;0:6 words HORIZONTAL Sync CONSTRAINTS 1. If dynamic RAM refresh is used: HS ;0:2 words 2. If interlaced display mode is used: HS ;0:5 words Noninterlaced Framing: 2 Field Sequence with Y2 line offset between otherwise identical fields. 2 Field Sequence with Y2 line offset. Each field displays alternate lines. 1 field brings ali of the information to the screen. Total scanned lines in interlace mode is odd. The sum of VFP + VS + VBP + AL should equal one less than the desired odd number of lines. Dynamic RAM refresh is important when high display zoom factors orDMA are used in such a way that not ali of the rows in the RAMs are regularly accessed during display raster generation and for otherwise inactive display memory. Access to display memory can be limited to retrace blanking intervals only, so that no disruptions of the image are seen on the screen. 7-108 210655-003 82720 DISPLAY MODE CG 0 0 MIXED GRAPHICS & CHARACTER 0 1 GRAPHICS MODE 1 0 CHARACTER MODE 1 1 INVAliD VIDEO FRAMING I S o 0 NONINTERLACED 0 1 INVALID 1 0 INTERLACED REPEAT FIELD FOR CHARACTER DISPLAYS 1 1 INTERLACED D DYNAMIC RAM REFRESH CYCLES ENABLE 0 NO REFRESH-STATIC RAM 1 REFRESH-DYNAMIC RAM DRAWING TIME WINDOW F 0 DRAWING DURING ACTIVE DISPLAY TIME AND RETRACE BLANKING 1 DRAWING ONLY DURING RETRACE BLANKING Figure 15. Mode Control Bits SYNC, 10,0 10 10 l ' 1 1 1 1 1 0 L THE DISPLAY IS ENABLED BY A 1, AND BLANKED BY A O. MODE CONTROL BITS. SEe FIGURE 15. P1 P2 t--L-'--~!::,-'--'--L.:..j ACTIVE DISPLAY WORDS PER LINE -2. MUST BE EVEN NUMBER WITH BIT 0 ;;:;; O. P3 L....J.-.J-....L.....l.-J.....L-r-'-...J L-L-I.-....."'-..L......l...VS.JI_"...Jr----- VERTICAL SYNC WIDTH. HIGH BITS HORIZONTAL FRONT PORCH WIDTH -1. HORIZONTAL BACK PORCH WIDTH -1. VERTICAL FRONT POACH WIDTH ACTIVE DISPLAY LINES PER VIDEO FIELD, LOW BITS '-'-'--\:-..L......l......J...A...J~L-"...Jr----- ~~T~Vilf~SPLAY LINES PER VIDEO FIELD, ' - - - - - - - VERTICAL BACK PORCH WIDTH Figure 16. Sync Command 7-109 210655-003 infel' 82720 SYNC Format Specify Command must be 4 or more display cycles wide. This is equivalent to eight or more clock cycles. This gives the slave GOCs time to initialize their internal video sync generators to the proper point in the video field to match the incoming vertical sync pulse (VSYNC). This resetting of the generator occurs just after the end of the incoming VSYNC pulse, during the HFP interval. Enough time during HFP is required to allow the slave GOC to complete the operation before the start of the HSYNC interval. This command loads parameters into the sync generator. The various parameter fields and bits are identical to those at the RESET command. The GOC , is not reset nor does it enter idle mode. Vertical Sync Mode Command When using two or more GOCs to contribute to one image, one GOC is defined as the master sync generator, and the others operate as its slaves. The VSYNC pins of all GOCs are connected together. Once the GOCs are initialized and set up as Master and Slaves, they must be given time to synchronize. It is a good idea to watch the VSYNC status bit of the Master GOC and wait until after one or more VSYNC pulses have been generated before the display process is started. The START command will begin the active display of data and will end the video synchronization process, so be sure there has been at least one VSYNC pulse generated for the Slaves to synchronize to. Slave Mode Operation A few considerations should be observed when synchronizing two or more GOCs to generate overlayed video via the VSYNC INPUT/OUTPUT pin. As mentioned above, the Horizontal Front Porch (HFP) VSYNC: ~ 0110111M , , , , I I L-- I O-ACCEPT EXTERNAL VERTICAL SYNC-SLAVE MODE l-GENERATE & OUTPUT VERTICAL SYNC-MASTER MODE Figure 17. Vertical Sync Mode Command CCHAR: Pl I loci 0, 1, 0 0 I 0 i P2 I Br L t P3 ! I Isci ~ CBOT I I i 0, 1 "0 , 1 , 1 I LR I r-I- CTOP I I BRu I I I I- LINES PER CHARACTER ROW - 1 DISPLAY CURSOR IF 1 ~g~SOR TOP LINE NUMBER IN THE O-BLINKING CURSOR l-STEADY CURSOR BLINK RATE. LOWER BITS BLINK RATE, UPPER BITS CURSOR BOTTOM LINE NUMBER IN THE ROW Figure 18. Cursor & Character Characteristics Command 7-110 210655-003 82720 Cursor and Character Characteristics Command Parameter RAM Load Command From the starting address, SA, any number of bytes may be loaded into the parameter RAM at incrementing addresses, up to location 15. The sequence of parameter bytes is terminated by the next command byte entered into the FIFO. The parameter RAM stores 16 bytes of information in predefined locations which differ for graphics and character modes. See the parameter RAM discussion for bit assignments. In graphics mode, LR should be set to o. For interlaced displays in graphics mode, SR should be set to 3. The blink rate parameter controls both the cursor and attribute blink rates. The cursor blink-an-time = blink-olf-time = 2 x SR (video frames). The attribute blink rate is always 112 the cursor rate but with a 3/.1 on-1/4 off duty cycle. DISPLAY CONTROL COMMANDS Zoom Factors Specify Command Pitch Specification Command Zoom magnification factors of 1 through 16 are available using codes 0 through 15, respectively. This value is used during drawing by the drawing processor to find the word directly above or below the current word, and during display to find the start of the next line. Cursor Position Specify Command The Pitch parameter (width of display memory) is set by two different commands. In addition to the PITCH command, the RESET (or SYNC) command also sets the pitch value. The "active words per line" parameter, which specifies the width of the raster-scan display, also sets the Pitch of the display memory. In situations in which these two values are equal there is no need to execute a PITCH command. In character mode, the third parameter byte is not needed. The cursor is displayed for the word time in which the display scan address (DAD) equals the cursor address. In graphics mode, the cursor word address specifies the word containing the starting pixel of the drawing; the dot address value specifies the pixel within that word. START DISPLAY & END IDLE MODE START: I0 ! 1 I 1 ! 0 ! 1 0 , 1, 1 ! I DISPLAY BLANKING CONTROL BCTRL: I 0 I 0 I 0 I 0 I 1 I 1 I 0 IDL THE DISPLAY IS ENABLED BY A 1, AND BLANKED BY A O. ZOOM FACTORS SPECIFY 200M: P1 I I 0 I 1, 0 ! I Dr I ~-- a, 0 I ! 1 ! 1 ! 0 I GCr R I I I-- ~~~~:C'T~TRo~~~rNgR~I~J~~ - - - - - - DISPLAY ZOOM FACTOR MINUS 1 CURSOR POSITION SPECIFY CURS: P1 P2 P3 0,1 , 0 I 0 I 1 , 0 , 0I1 I EAD L ::::==1;:::;1=1~r1~;::::::I;: :;1:;::;:;::rEAD diD I T I 0 I 0 I E~Dj... - EXECUTE WORD ADDRESS, LOW BYTE EXECUTE WORD ADDRESS, MIDDLE BYTE (GRAPHICS MODE ONLY) ~ WORD ADDRESS, TOP BITS ' - - - - - - - - - DOT ADDRESS WITHIN THE WORD Figure 19. Display Control Commands 7-111 210655-003 82720 PRAM: I0 ! 1 ! 1 ! 1 I SA i<-----STARTING ADDRESS IN PARAMETER RAM P, '-. I I =======~. 1 - 1 TO 16 BYTES TO BE LOADED INTO THE PARAMETER RAM STARTING AT THE RAM ADDRESS SPECIFIED BY SA ,- Pn Figure 20. Parameter RAM Load Command PITCH: P1 I0 , I 1 I ! 0I0 I 0I1 I1 I1 I r I I I I I I-- NUMBER OF WORD ADDRESSES IN DISPLAY MEMORY IN THE HORIZONTAL DIRECTION Figure 21. Pitch Specification Command WRITE DATA INTO DISPLAY MEMORY WDAT: I 0 0 1 I TYPE I I 0 I MOD t~___ RMW MEMORY CYCLE LOGICAL OPERATION: o o _ REPLACE WITH PATTERN _ COMPLEMENT _ RESET TO ZERO _SETT01 1 1 ' - - - - - - - - - DATA TRANSFER TYPE 1o 0 ~~~~~~~WORD' LOWOF THEN O ' LOW BYTE THE HIGH WORDBYTE 1 1" 1 • o P1 HIGH BYTE OF THE WORD INVALID I. . ...--. ... .L.....I___....._W.l.0_RD_L'-O_R I I ...BI..YT_E-'I......r._ I I _ WORD LOW DATA BYTE OR SINGLE BYTE DATA VALUE ---aI- ~~~DDl~:~~~R P21L--.........._ .....WO...II..RD_"...II_.......... ONLY: Figure 22. Write Data Command DRAWING CONTROL COMMANDS Write Data Command Upon receiving a set of parameters (two bytes for a word transfer, one for a byte transfer). one RMW cycle into Video Memory is done at the address pointed toby the cursor EAO. The EAD pointer is ,advanced to the next word, according to the previously specified direction. More parameters can then be accepted. For byte writes, the unspecified byte is treated as all zeros during the RMW memory cycle. In graphics bit-map situations, only the LSB of the WDAT parameter bytes is used as the pattern in the RMW operations. Therefore it is possible to have only an all ones or all zeros pattern. In coded character applications all the bits of the WDAT parameters are used to establish the drawing pattern. The WDAT command operates differently from the other commands which initiate RMW cycle activity. It requires parameters to set up the Pattern register while the other commands use the stored values in thp ,)arameter RAM. Like all of these commands, ,the 7-112 210655-003 82720 WDAT command must be preceded by a FIGS command and its parameters. Only the first three parameters need be given following the FIGS opcode, to set up the type of drawing, the DIR direction, and the DC value. The DC parameter + 1 will be the number of RMW cycles done by the GDC with the first set of WDAT parameters. Additional sets of WDAT parameters will see a DC value of 0 which will cause only one RMW cycle to be executed. Figure 23_ Mask Register Load Command FIGS: I0 I 1 0I 0 I 1 I I P1lsLl R l A jGcl L j 1 I DIRi l 1t =10 ~~ ; D:LD~H : I J- 0I 0 L ; DRAWING DIRECTION BASE FIGURE TYPE SELECT BITS: LINE (VECTOR) GRAPHICS CHARACTER ARC/CIRCLE RECTANGLE SLANTED GRAPHICS CHARACTER DC DRAWING PARAMETER GRAPHICS DRAWING FLAG FOR USE IN MIXED GRAPHICS AND CHARACTER MODE ::10;01 : :10;0 i :L ; D:L ~M O~M ~ 0 DRAWING PARAMETER : ; ~ 02 DRAWING PARAMETER ; ; iM: ; ~D1 DRAWING PARAMETER ::10; 0i P1°1 P11 : 0;0i ; : 1Lo D; ~ OM DRAWING PARAMETER D:"O~M; : VALID FIGURE TYPE SELECT COMBINATIONS .aL R A .!it. !. 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 1 0 ~ CHARACTER DISPLAY MODE DRAWING, INDIVIDUAL DOT DRAWING, DMA, WDAT, AND RDAT STRAIGHT LINE DRAWING GRAPHICS CHARACTER DRAWING AND AREA FILLING WITH GRAPHICS CHARACTER PATTERN [""-'''' : COMBINATIONS ASSURE CORRECT DRAWING OPERATION ARC AND CIRCLE DRAWING RECTANGLE DRAWING SLANTED GRAPHICS CHARACTER DRAWING AND SLANTED AREA FILLING Figure 24. Figure Drawing Parameters Specify Command 7-113 210655-003 82720 FIGD: 10 ,1 , 1 ! 0 ! 1 ! 1 10 ! pixel pointed to by the cursor, EAD, and the dot address, dAD. I 0 Graphics Char. Draw and Area Fill Start Command Figure 25. Figure Draw Start Command GCHRD: I 0 I 1 , 1 , 0 ,1 ! 0 , 0 ! 0 Based on parameters loaded with the FIGS command, this command initiates the drawing of the graphics character or area filling pattern stored in Parameter RAM. Drawing begins at the address in display memory pointed to by the EAD and dAD values. I Figure 26. Graphics Character Draw and Area Filling Start Command DATA READ COMMANDS Mask Register Load Command Read Data Command This command sets the value of the 16-bit Mask register of the figure drawing processor. The Mask register controls which bits can be modified in the display memory during a read-modify-write cycle. Using the DIR and DC parameters of the FIGS command to establish direction and transfer count, multiple RMW cycles can be executed without specification ofthe cursor address after the initial load (DC = number of words or bytes). The Mask register is loaded both by the MASK command and the third parameter byte of the CURS command. The MASK command accepts two parameter bytes to load a 16-bit val ue into the MASK register. All 16 bits can be individually one or zero, under program control. The CURS command on the other hand, puts a "1 of 16" pattern into the Mask register based on the value of the Dot Address value, dAD. If normal single-pixel-at-a-time graphics figure drawing is desired, there is no need to do a MASK command at all since the CURS command will set up the proper pattern to address the proper pixels as drawing progresses. For coded character DMA, and screen setting and clearing operations using the WDAT command, the MASK command should be' used after the CURS command if its third parameter byte has been output. The Mask register should be set to all ones for any "word-at-a-time" operation. As this instruction begins to execute, the FIFO buffer direction is reversed so that the data read from display memory can pass to the microprocessor. Any commands or parameters in the FIFO at this time will be lost. A command byte sent to the GDC will immediately reverse the buffer direction back to write mode, and all RDAT information not yet read from the FIFO will be lost. MOD should be set to 00. Cursor Address Read Command The Execute Address, EAD, points to the display memory word containing the pixel to be addressed. The Dot Address, dAD, within the word is represented as a 1-of-16 code. Figure Draw Start Command Light Pen Address Read Command On execution of this instruction, the GDC loads the parameters from the parameter RAM into the drawing processor and starts the drawing process at the . The light pen address, LAD, corresponds to the display word address, DAD, at which the light pen input signal is detected and deglitched. RDAT: 11 I 0 I 1 I I rTyeE o 1 1 o 0 1 MCj>D 1 DATA TRANSFER TYPE 0 _ WORD, LOW THEN HIGH BYTE 0 _ LOW BYTE OF THE WORD ONLY 1 _ HIGH BYTE OF THE WORD ONLY 1-INVALID Figure 27. Read Data from Display Memory Command 7-114 210655-003 82720 CURD: 11 ! 1 , 1 ! 0 ,0 1 0 ! 0 ! 0 I lPRD: THE FOLLOWING BYTES ARE RETURNED BY THE GOG: I, ! 1 ! Q ! 0 ! 0 ! 0 , 0 ! 0 I THE FOLLOWING BYTES ARE RETURNED BY THE Goe: JA7, ,t , L~DL, ,AD I~ LIGHT PEN ADDRESS, LOW BYTE ~IA:':7::::':LA:,0:":,~=,:A8~J.- LIGHT PEN AODRESS. MIDQLE BYTe Ix DOT ADDRESS (dADI. LOW BYTE I X I X I X !X IX I LAPH 1..- LIGHT PEN ADDRESS, HIGH BITS x = Undefined DOT ADDRESS (dAD). HIGH ByrE x = Undefined Figure 28. Cursor Address Read Command Figure 29. Light Pen Address Read Command DMA READ REQUEST DMAR: 11 0 1 1TYPE 11 1 MOD 1 ~I------ o DATA TRANSFER TYPE: 0 ~.o------ WORD, LOW THEN HIGH BYTE O~.. o------LOW BYTE OF THE WORD 1 ~..o - - - - - - HIGH BYTE OF THE WORD 1 ~..t-----INVALID DMA WRITE REQUEST DMAW: 1 0 0 1 1 TYPE 11 1 MOD 1 .-b-o RMW MEMORY LOGICAL OPERATION: 0 _ REPLACE WITH PATTERN 1 _ COMPLEMENT 0 _ RESET TO ZERO 1_SETTOONE 1 « - - - - - - DATA TRANSFER TYPE: 0----- WORD, LOW THEN HIGH BYTE 0 ...0----- LOW BYTE OF THE WORD 0 ... 1 • HIGH BYTE OF THE WORD 1 ....o------INVALID Figure 30. DMA Control Commands 7-115 210655-003 82720 ABSOLUTE MAXIMUM RATINGS* 'COMMENT: Exposing the device to stresses above those listed in Absolute Maximum Ratings could cause permanent damage. The device is not meant to be operated under conditions outside the limits described in the operational sections of this specification. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Ambient Temperature Under Bias .......... O"C to 70"C Storage Temperature .................. -65'C to 150"C Voltage on any Pin with Respect to Ground ............................ -0.5V to + 7V Power Dissipation ............................ 1.5 Watt DC CHARACTERISTICS TA = O"C to 70" C; Vee = 5V ± 10%; GND =OV Limits Symbol Parameter Max. Min. Vil Input Low Voltage VIH Input High Voltage Except DACK VOL Output Low Voltage VOH Output High Voltage 102 I/O Pin Leakage Current 0.8 V V 0.45 V ±10 /LA VSS+0.45,,;;VI ,,;; Vee ±10 /LA VSS ,,;;VI ,,;;Vee 0.6 V 2.4 III Input Pin Leakage Current Vel Clock Input Low Voltage -0.5 VeH Clock Input High Voltage 3.5 Icc Vee Supply Current VIH1 Input High Voltage DACK Only V 2.4 Conditions Vee + 0.5 -0.5 2.2 Unit 10l = 2.2 mA 10H = -400/LA VCC + 0.5 V 270 mA Typical = 150 mA Vee + 0.5 V Typical = 150 mA CAPACITANCE (2) TA = 25'C; vee = GND = OV Limits Symbol Parameter Unit Min. Conditions Max. CIN Input Capacitance 10 pF CIO I/O Capacitance 20 pF Ic = 1 MHz COUT Output Capacitance 20 pF V = 0 Co Clock Input Capacitance 20 pF (1) Suggest pull up resistor to reduce noise sensitivity on DACK only. (2) Sample tested initially. 7-116 210655-003 intel' 82720 A.C. CHARACTERISTICS (TA = O'C = OV, to +70'C, vss vcc = +5V ±10%) DATA BUS READ CYCLE 82720 Symbol 82720·1 82720·2 Parameter Units Min. Max. Min. Max. Min. Max. TAR Ao setup to RD I 0 0 0 TRA Ao hold aHer RD I 0 0 0 ns TRR RD Pulse Width TRD+20 TRD+20 TRD+20 ns TRD RDI to Data Out Delay TDF RD I to Data Float Delay TRV RD Recovery Time 120 120 0 4 Tcv ns 80 100 0 4 Tcv Test Conditions 0 70 ns 90 ns CL=50pF ns 4 Tcv DATA BUS WRITE CYCLE 82720 Symbol 82720·1 82720·2 Parameter Units Min. Max. Min. Max. Min, Max, TAW Ao Setup to WR I 0 0 0 ns TWA Ao Hold after WR I 0 0 10 ns Tww WR Pulse Width 120 100 90 ns T DW Data Setup to WR I 100 80 70 ns TWD Data Hold after WR I TRV WR Recovery Time Test Conditions 10 10 10 ns 4 Tcv 4 Tcv 4 Tcv ns DISPLAY MEMORY TIMING 82720 Symbol 82720-1 82720-2 Parameter Units Min. Max, Min. Max. Test Conditions Min. Max. TCA AddresslData Delay from 2XWCLK I 30 160 30 130 30 110 ns CL=50pF TAC AddresslData H91d Time 30 160 30 130 30 110 ns CL=50pF TDC Input Data Setup to 2XWCLK I 0 TCD Input Data Hold Time TIE TIE 2XWCLKI to DBIN 30 120 30 90 30 80 ns CL=50pF TCAH 2XWCLK I to ALE I 30 125 30 100 30 90 ns CL=50pF 0 ns 0 TIE ns TIE TAL ALE Low Time Tcv+30 Tcv+30 Tcv+ 3O ns TAH ALE High Time TCH-20 T CH -20 TCH -20 ns Tco Video Signal Delay from 2XWCLK I TLLAX Address Valid Hold Time After ALE! 30 30 30 ns T AVAL Address Valid Hold Time Before ALEJ 20 10 5 ns 150 7-117 120 100 ns 210655-003 intel· 82720 A.C. CHARACTERISTICS (Continued) OTHER TIMING 82720 Symbol 82720·1 82720·2 . Parameter Units Min. Tpc LPEN or VSYNC Input Setup to 2XWCLK I Tpp LPEN or VSYNC Input Pulse Width Max. Min. Max. Min. Test Conditions Max. 30 20 t5 ns Tcy TCY TCY ns CLOCK TIMING 82720 Symbol 82720·1 82720·2 Parameter Units Min. Max. Min. Max. Min. Max. TCY Clock Period 250 2000 200 2000 t80 2000 TCH Clock High Time t05 90 70 ns TCl Clock Low Time t05 80 70 ns Test Conditions ns TR Rise Time 20 20 20 ns TF Fall Time 20 20 20 ns DMA TIMING 82720 Symbol 82720·1 82720·2 Parameter Units Min. Max. Min. Max. Min. Max. TACC DACK Setup to RD I or WR I 0 0 0 ns TCAC DACK Hold from RD I or WR I 0 0 0 ns TRR' RD Pulse Width TAD' RD I to Data Out Delay TRD' +20 TAD' +20 1.5 TCY +120 TKO 2XWCLK I to DREO Delay TROAK DREO Setup to DACK I TAKRO DACK I to DREOI Delay TAKH DACK High Time TAK1 DACK Cycle Time, Word Mode 4 TCY TAK2 DACK Cycle Time, Byte Mode 5 TCY 150 0 TCy+150 ns CL=50pF ns CL=50pF +70 100 0 ns TCy+100 TCY+ 120 TCY 7-118 1.5 TCY 120 0 TCY ns TRD' +20 1.5 TCY +80 Test Conditions ns TCY ns 4 TCY 4 TCY ns 5 TCY 5 TCY ns CL=50pF 210655-003 82720 A.C. TEST CONDITIONS Input Pulse Levels (except 2XWCLKj ........................................................... 0.45V Input Pulse Levels (2XWCLK). . . . . . . . . . . . . . . . . . . . . . . . . ............................ O.3V Timing Measurement Reference Levels (except 2XWCLK) ............................................ O.BV Timing Measurement Reference Levels (2XWCLK) ................................................. O.6V to to to to 2.4V 3.9V 2.0V 3.5V WAVEFORMS QATA .BUS TIMING READ CYCLE TRR TAR-II l_TRA \ "'-TRD~ DATA BUS (OUTPUT) ...c~ ~- -....- T OF----+- DATAVALlD_ "- ./ TRV WRITE CYCLE DATA BUS DATA DATA (INPUT) _ _ _M""A..;.;If...:C"'H;;.;.AN"'G;;;;;E:...-_ _-' 1<_ _ _ _ _ _- - " ' -_ _ _..;;M;;;.A::..If..:.CH;.;;A,;;.N:..;:G"'E_ _ __ 7-119 210655-003 82720 WAVEFORMS (Continued) DMATIMING READ 2XWCLK DREQ fool.o------TAKRa-----., ....- - - - - - - - i-----TRRt----.J DB~7-------------~---------~1 \ - - - - - - - - - - TAK1 , TAK2 --------+1 WRITE 2xWCLK DREQ ~ ''""'--1-------------- TCAC--' 7-120 210655-003 82720 WAVEFORMS (Continued) DISPLAY MEMORY TIMING· READ/MODIFY/WRITE CYCLE S2 S1 53 S4 2xWCLK TCA ADo-15 A16,A17 --+---<1 ~ VALID VALID OUTPUT ADDRESS OUTPUT DATA VALID I----------TAL----------I~I ALE 7-121 210655-003 82720 WAVEFORMS (Continued) DISPLAY MEMORY TIMING (Continued) READ CYCLE 51 52 2xWCLK ADo-AD" --+--<1 A16,A17 ALE TCO H5YNC m~i LCo-3 g~~IMAGE Af,IllARRICI:C ~ __ ---------~ ---------~ OTHER TIMING 2xWCLK LPEN WYNC---------- CLOCK TIMING 2xWCLK 7-122 210655-003 inter 82720 WAVEFORMS (Continued) DISPLAY AND RMW CYCLES (1X ZOOM) ~ Display RMW Cycle Cycle Display or RMW Cycle 91-1- 2xWCLK: ALE: DBIN: ADO·15 A16.17: HSVNC: BLANK: YlEXT SYNC: 7-123 ~10655-003 82720 WAVEFORMS (Continued) DISPLAY AND RMW CYCLES (2X ZOOM) Zoomed Display Cycle Zoomed Display Cycle RMW Cycle Display or RMW Cycle $1 2xWCLK: ALE: DmN: _1----------------------_i----------------------_i----------~ ADO·15: ____~----_i-------- --Jr<0!l;"~,,";r,B"~',,:!..;)_--------+-G:O":li"~"'B"~',:! ...:>---------+-G:o"~'.";r'B"~',,:!..;)_-_C::'"E."'!:!'::!".D~:!o!E!"'E."'!:!'~••::x!o!:!"'E."!2"!!:"::!"!!">- A16117::j~::::::::::::::::::::::::~x:::::::::::::::::::::::~:x::::::::::::::::::::::::~c::::::: Blank: ZOOMED DISPLAY OPERATION WITH RMW CYCLE (3X ZOOM) Zoomed Display Cycle Display or RMW Cycle $1 2xWCLK: ALE: DmN: -t-------------------------------------t----------~ ADO·15: ____~--------------~--_1--------- _+~0!E!"'E."!2"!!:"::!..E">_---------------H:2:0"~":!I"'B"~',E,,,:>_-_C~:!:E!!:H~0!E!"'E'"::l"!E!,,·:::r-----_+_€O":!!"::!"':!";';"::!"!}'''' A16,17::4:X::::::::::::::::::::::::::::::::::::::~C:::::::::::::::::::::::::::::::::::::~C::::::: Blank: ~~-------------------~'--------------------r=::::= 210655-003 7-124. 82720 WAVEFORMS (Continued) VIDEO SYNC SIGNALS TIMING I' 1H 2xWClD: ~ ____ ~ __ HBlANK: J ----"'-- __ J HSYNC: ------------------~I ADO-15: J , ____ lCO-': ADO-15: LCO-4: Row: Row: VSYNC: -J'~ __ _J~ ______ ~ \ ____ J~ ____ ~ ----v---v----~----_.Ir_ ___ ___ ____ ~ ~ ~ !\ ::::x I--~~ ___ ~= ______ =~:_-:_-_-_~=~=:~ _-:_-_~~==~~_-_-- _-- _-_~ -Jt.:xx-)(J()(X ___________________________ :x:x::xx __ :x:x:: J ~-- -)'---- -___ "'-- ___ -._ ---iI-- -v--- ---A y-- ______ - - - - - - -__ - -_ -____ - - - -_____ - - - - -_ -_-____ - -- ~ ::::x::::---:x:: _ __ ~ ______________________________________________ J ~ VBLANK: 1 ../\.fV ___ ./"\/"\.. __ ./"\.. =*===*==x:::::::::x::::=x-------:::: ===:::x: , '--________ I ~/r------------------------------ -r----------------------------------------------~I I t-1·---------------1V(Fle,dl----------------J INTERLACED VIDEO TIMING HBLANK: VBlANK: VSYNC; (Interlace) JL __ ..JLJL __ JUL __ JLJL __ JL __ JL __ JUL __ -1U"L_ I 1 I 1 , I 1 1 1-__ ...r--- -,---- ---,---- --L. __ S- -- -,--,-- - - --,-,--I I I I 1 I 1 I : I ! II I LI , , I I I Odd Fleld---;------!.If-------Even Fle,dl----:----_ I ' L--- I VSYNC: (No Intel1ace) I __________~I 7-125 210655-003 82720 WAVEFORMS (Continued) VIDEO HORIZONTAL SYNC GENERATOR PARAMETERS 1~'----------------------lH----------------------~ I ~ HBLANK:~ I __________________________ I I ~r-- + ________________.J-_ I HSYNc: _ _....:I~_....IIlL._ _ _ I I I ---1 I I I =-r: ~HBP-+.I--AW----,-----{ VIDEO VERTICAL SYNC GENERATOR PARAMETERS 1----------1V-----------( I I VBLANK: _ _---:~_ _.... I I I I I I , I VSYNC:--I"I~---=-_-----------_:_-____!Il I I I L I I I I I, I I I 'I , iVFPr' r--VBP-i-----------AL-----------1-l ! I iVBP-l -Ivsf-CURSOR-IMAGE BIT FLAG 2xWCLK -l !-TCY .Jl.IUU1 H::::::_-H[;:.t-"==P= b ~ A17 Invalid Image 7-126 210655-003 82720 VIDEO FIELD TIMING --n_____---iiiHS;:.;Y.;.:NC:;.,O~u"tP:::ut'------__!;L_ BLANK Output Vertical SYNC Lines -!- - -- Vertical Back Porch Blanked Lines Horizontal SYNCPulse Horinzontal Front PorchBlanking VSYNC Output Active Display Lines Horizontal Back Porch Blanking """ ~ Vertical Front Porch Blanked Lines ~~-------------~~- DRAWING INTERVALS ~ Drawing Interval ~ Additional Drawing Interval When ~ In Flash Mode .m _ Dynamic RAM Refresh if Enabled, Otherwise Addltlonal Drawing Interval DMA REQUEST INTERVALS !=;:::=========t- OMA Request Interval Additional DMA Request Intervals When in Flash Mode 7-127 210655-003 ARTICLE REPRINT AR-255 By managing tasks like graphics generation and CRT refreshing, a dedicated VLSI display controller simplifies the design of intelligent graphics work stations. DedicatedVLSI chip lightens graphics display design load The role of graphics is becoming increasingly important for unscrambling the communications traffic between people and computers. Thanks to microprocessors and dedicated control lCs, designing high-reliability graphics work stations is now easier and less expensive than in the days of smallscale integration and expensive discrete-circuit CRT technology. Microprocessors simplify workstation design by transferring some graphics control tasks from hardware to software. However, a dedicated VLSl controller such as the 82720-with an on-board graphics processor-can push another step forward toward fast and economical design of high-quality intelligent graphics systems. A typical application for the controller is a graphics work station aimed at high-end business and low-end engineering systems. Since such a station usually fits on the top of a desk, all of the electronics must be contained within a single Gary DePalma, Field Applications Engineer Mark Olson, Product Marketing Engineer Roger Jollis, Design Engineer Intel Corp. 2625 Walsh Ave., Santa Clara, Calif. 95051 printed-circuit board. This type of system requires a resolution of about 512 by 512 pixels and is frequently called on to display three-dimensional objects in various .perspectives. To minimize the distortion of rotating objects, horizontal and vertical pixels should be equally spaced. A typical display (500 vertices) must be drawn on the screen in less than 1 second to provide satisfactory interaction with the operator. The display may consist of lines, arcs, filled areas, and colorsseven colors are acceptable (see "A Look into Graphics Fundamentals"). Serial link interlaces station An intelligent work station usually interfaces with a mainframe host via a serial communications link, a keyboard, and a serial link with an optional graphics tablet: Thistype of graphics input/output subsystem is diagrammed in Fig. 1. Two 51/4-in. floppy disks can satisfy the mass-storage needs of the system. Disk formatting must be compatible with the requirements of an IBM personal computer. Moreover, general-purpose software written for from ELECTRONIC DESIGN· January 20, 1983 Copyrighl1983 Hayden Publishing Co.. Inc. 7-128 Order Number: 231310-001 Computer Graphics: Graphics display controller this computer must also be able to run on the work station. Two of the most basic functions of a graphics system are generating and refreshing images on the CRT screen. Information pertaining to the images is stored in the bit-map memory, where monochrome pixels are represented by single bits and color pixels by groups of bits. Lines and arcs defined in normalized screen coordinates must be converted into images of the physical object. In a bit-mapped raster graphics system, lines described by a transformed display list are reduced to a series of dots and placed in the image memory. The selection of the dots that will be activated is achieved through a scanning conversion algorithm, which must create lines that appear very smooth, start and end as expected, and look symmetrical no matter in which direction they are drawn. The algorithm is repeated thousands of times to draw a single picture and thus must operate as quickly as possible. At the same time, the image in memory must be repainted on the screen 30 times/s for Universal peripheral interface (UPI-42) and slave processor Multiprotocol serial controller (8274) Microprocessor (iAPX 186) Serial 110 Floppy-disk controller (8272A) (a) DeyiceIndependent Transformation processing ---1I Devlcedependent I I I CRT control CAT, (b) 1. A graphics 1/0 subsystem for an intelligent work station consists of input peripherals (a keyboard and tablet), a serial communications link, and mass storage (lioppy disks). Intelligence is provided by the microprocessor and the peripheral and memory controllers (a). The three basic tasks performed-ItO, transformation processing, and CRT control-all require data in the form of display lists stored in a data base (b). 7-129 231310-001 interlaced frames and 60 times/s for noninterlaced frames. Simple tasks, they nevertheless demand a high memory bandwidth. Unlike other system control tasks, generating graphics figures requires both bit-manipulation and mathematics capabilities. Integer addition and multiplication operations calculate the coordinates of points on Ii line or a circle. But since pixels generally are neither complete words nor bytes, logical operations must be performed on the bits within the word that contains the selected pixel. The inner loop of a so-called Bresenham linedrawing algorithm requires two or three addition operations, two comparisons or tests, and the masking of the correct value into the word for each pixel. Algorithms for drawing circles or filling areas are even more complex. In the inner loop of a filling algorithm, for example, the old word must be read from the bit map to determine whether some, all, or none of the pixels are within the area to be filled. If they are, the algorithm tests whether the pixels must be modified and then returns the word to the 2. The 82720 graphics display controller separates the .tasks 01 graphics generation and CRT refreshing from other system tasks. That permits much greater system bandwidth, leading to graphics work stations that not only draw sharp pictures, but also oller color. 3. Three mamory planes are implamented in the interlace batween the bit map and the graphics display controller. Three primary colors-red, green, and blue-ara" provided, with the controller's upper address bits responsible for selecting the memory planes during read/modify/write cycles. 7-130 23131()'{)()1 computer Graphics: Graphics display controller bit map. Because such algorithms are heavily exercised, they must execute at extremely high speeds to avoid an adverse impact on the system's overall efficiency. Memory bandwidth is the most precious commodity in a graphics system. In this application, screen refreshing requires that 750,000 bits be read 60 times/s, equating to a bandwidth of almost 6 Mbytes/s. The picture refreshing, therefore, has the highest-priority access to memory because any missed readings show up as noise in the picture, a situation that sometimes occurs with simple systems possessing a single-microprocessor, singlememory scheme. In the latter type of design, one processor handles all functions except refreshing, which is imple- men ted by a discrete counter arrangement or a simple CRT controller chip. Nevertheless, the refresh memory bandwidth always slows down the microprocessor. That loss of speed can be eliminated simply by separating the processor's memory system from the bit map, a process that effectively doubles system memory bandwidth. The 82720 graphics display controller can provide the means of separating graphics generation and CRT refreshing from the other tasks and also perform the two tasks quickly and concurrently with the others. Residing between the microprocessor and the bit-map memory and video logic, the controller refreshes the CRT like other CRT controllers, converts high-level commands into images by placing the proper data into the correct bit A look into graphics fundamentals The graphics data found in graphics display lists typically describes objects in the real-world Cartesian coordinate system conforming to the axes X, Y, and Z (see the figure). Graphics data does not take the form of one bit for every point on a line; rather it represents higher-level forms such as the end points of a line and WALL: OBJECT MOVE TO [X, Y, Z) DRAW LINE TO 11<2, Y2, Z2) DRAW LINE TO IX:!, Y3, Z3) DRAW LINE TO 1X4, Y.,Z4) DRAW LINE TO lXI, Vl,ZI) END WALL ROOF: OBJECT HOUSE: OBJECT WALLATIT1) WALLAT[T2) WALLAT[T3) WALLAT(T.) ROOF AT ITs) WINDOW AT ITs) WINDOW AT IT7) DOORAT(Ta) END HOUSE the starting, ending, and center points of an arc. The coordinate· system handles physical measurement units such as inches, feet, or meters, which 'are typically represented in a computer by 16- or 32-bit integers or by floating-point formats. Ultimately, complex graphics structures are stored in a data base in a hierarchical form consisting of lists of X, Y, and Z , coordinates. The first step in designing a CRT s~bsystem involves se!eetingthe resolution and scanning rates. All conventional raster-scanning monitors have a display area 7-131 that is wider than it is high in the ratio of 4 to 3 (called the aspect ratio). For pixels to be square-equally spaced in both the X and the Y direction-the number of horizontal pixels must be 4/3 the number of vertical pixels. This is expressed as 4H-3V, where H and V represent the number of horizontal and vertical pixels respectively. Resolution depends on the total quantity of pixels, which must be a power of two. If it is not, the number of pixels must be rounded to the next highest power of two, in which case some bits will be wasted. Furthermore, the number of horizontal pixels must be organized as an even number of I6-bit words. To prevent wasted bits, the number of vertical and horizontal pixels are chosen as large as possible without exceeding a power of two. For the display in question, 512H by 512V = 218 = 262,144 pixels. A screen format of 576H by 432V normally meets all requirements. The total number of pixels is then 248,832, and the ratio of horizontal to vertical pixels (576/432) is correct. Furthermore, the number of horizontal pixels makes exactly 3616-bit words. After figuring the aspect ratio, the format of the bit-map memory is the next item to be considered. The screen contains about 250,000 pixels, each of which can be either black or one of seven colors. These eight', shades.canberepresented by three bits/pixel (2s = 8)" meaning that the bit-map memory must handle about. 750,000 bits. The organization of the memory, however, must be determined according to the various tradeoffs. The el\tire memory must be accessed 60 times/s since; that is the rate at which the image must be painted to ' prevent flickering. That equates to a refresh rate of 16.7 ms; As a l"\)le of thumb, the monitor displays informatjon75<)bllfthe time and is blanked fllr retracing operatioll~,25%of the tjm~. Thus the wholemelXlory. must be read and .8e,nt to the CRT during a 12.5"ms interval (16;7 X 0.75), whichconstitutes~he active! 231310-001 map, and interfaces easily and simply with propri-etary microprocessors. The 82720 accepts high-level commands (such as DRAW LINE, DRAW ARC, and FILL RECTANGLE) and executes them at much faster speeds than generalpurpose microprocessors, primarily because it is a dedicated graphics hardware processor. Burst drawing rates as high as 1 pixel every 800 ns can be achieved. Screen refreshing is handled directly by the controller. The displayed portion of the bit-map memory can be configured to allow the display to be scrolled through memory in any direction. The horizontal and sync periods both are fully programmable, as is the position of the sync pulse in the blanking interval. Furtherinore, the controller can be programmed to refresh low-cost dynamic RAMs. In the design being considered, the 82720 offloads the microprocessor from low-level graphics tasks, as shown in Fig. 2. For the bit-map interface, the memory is implemented as three planes, each 16 kwords by 16 bits, with each plane driving red, green, or blue (Fig. 3). The upper address bits-Al6 and A l7 -select the memory. planes during read/modify/write cycles but are ignored during screen refreshing cycles. The graphics display controller generates' the Row Address Strobe (RAS) signal for the dynamic RAMs, but the remaining timing signals must be supplied by external devices. These signals are produced by a state-machine timing generator consisting of a 4-bit counter and two flip-flops. The state machine synchronizes itself with RAS after pOrtiOh ot'afrarile. • . . . .,•., '•.' ".' . '." Dispja; Jistsandcommands pass fro~ I/O sub- " : _To,il!~ttheseXllquirements, it is helpful to break the. .syg'teril to a unitthilt executes the transformatiort tasks.' !:lit inapin~ three planes of 432 by 576 bits. While the.· Tr.ansformations are primarily mathematie~operscreen is being refre~hed, data is read from .the same ations performed on the display units: Depimdhig on the : aqdress 'ip each of the three planes and sent serially to commarid, this module edits display lists,organizes ; tile screen. The memories can then be arranged as three them for display on the screen, or edits the digplay,list _16-kword-by-16-bit arrays, requiring a memory cycle data base. By editing a display list, objects in the phys< ',time of 800.ns ~rid conSequently permitting the use of ical coordinate system. can be created,destroyed" •relatively,slow,low~cost 16-kbitdynamic RAM chiPs.. moved, or changed. Transforming a displaylist intO a> . When .drswinggraphics figures,memory can be form compatible with the display is necessary, as the ., treated as asjngle large plane divided into three primadata. base can have an unU~ited real~world !:.oordinilte ry, colQrs: l'ed,~een; and blue. Thus the low-order system in three dimensions,but the CRT screen islim~ ... ;memolj'ieowd representthecoior red;thelniddle-order lted to .only twodimensioDs.' ..., ...,..' ; memory, green; and the high-order memorY; blue. Each Transfotmatilin tasks place ahea~ .bur4eIH~n a.lli.i~, prImary cOlor requires the setting of just 1 bit/pixel: croprocessor. For instance., in a tyPicaltrarislormatillD, How~ver; a secondary color-cyan,yellow, or a matrixmuitiplication is performed Cor every pOint on ifD!lgent\{,",:n(!Ces!\itates setting 2 bits/pixeL '!'herefore, an object's display list. .Jrt.three (iimensioil~1 each poiht ;drifwihgjn a,sllcondary colortllkes two memory requires multiplying a 4~element 'lector bya:4-by-4 ;c~cleS/pixel.;lnd i&.slowerthan drawing primary. colors. matrix. Some otthe elel!lentsare alwayszero,butthe : If. this. creates$ystem problems, additional hardware operation still. takes 13 multiplications and 9 additi9nS. ,~rtbe use4 to draw more than onephine at a time. Atwo-dimensiorial display list requires 4 additionu'nd iHowever•. j~ the .system example,. drawing speeds are 4 multiplications; A, typical display can containhilndredsor thousands .oflines; each of which has/two end (notonly]l'let;but als~:exCeeded without relying on extra 'nardwifre . . ....... . ' points: Ther~forethespeedof matriXlIiultiplication :,.Startiri~'With .the:verticalrefresh .rate of 16.67 significantly influences systenrpeffoflDance, .. . .. . ! l)lij/traJIte,;ihe .!»isie timing can be analyzed. From the . The coordinate system suppOrted by th(ldesignexam~ i,i6.67·msfigufe;subtract the 1.25 ms. required by the pIe is thre.e-'liimensional and employs 82"bi(.integers, . 1~onitorfor itS ver~eaI blanking. That leave815.42 msThe system CPU.el!:ecute~ 32-bit inteltermatrix.multi- . plicatiolls at high speed, Inconjunctiollwiththe ~rl1~hic' i'£orscanningthe 432 litlei\ ori the active Portion of the ~4ifipjily:,Djviding15.42mBbY 432 lines gives .33.5 displllycontrol14ir; thedraWininai!k is offioade'(frillJi rifS(l~~~i;eq~.yale~~.t9ah~rizolltar sc.an rate 9£ 28:kH~: '...• theCfU, which int1irnlllaxi!lli~s the.llell.tra,l'l!~b~ ....• ; i:'V~~1 re~lIJ:greqUires, 7.l's/~ne,and the active . . time thai: can .be ··allocated for· those. ·lIiatrixlI\ulti,··i: [,JW~~(il8chlinl\i~~t7!is... suptracting :!,sfrQri1 8l?7 . plicatiotis.Waitin~ time is now muCh lower'thanin.i:On~" . . .• ~'/l.~19aY~~. :~ ........~. 'I'll,. '. J)Uri ..'.'~., .·.t.hlS ti.m~ 576 P.~xels are .-dl.s~ ventional.8fs~ms.. Howe~er, "If';~' 'systerrft~ui$.<·:; ¥~l~~o.r: ~pilCel~rioji .of ~.1I'Sl576 or 49.8~B: Th!s fl()ating-point ..;transCormatlolls; thebe8~:.high':S~:': .' . ,W.ado~.qllll:~~teo.f2Q.07 MH2;,whlC!t18.. peiforln:lirice:isacliieved With the M:ditiQnOflllilimef~\;'; the A-is.t)Je.:.~Y:llten:l's~ :,":.~ ':" ",f':: ': '. :'::~!::'::fV}::' ,;,~::., .. ' .~... ' .....,. icaleO,pr.or;> . ". ':. 7-132 :, : " . :'.,·,:'. ,:j. '.i,;:".'.,.'.',·.'::.:,:.,•.',:,•..'_.,1.'.,'.:.'.;.·.:,\,:,.,' , ': " ,". 231310-001 Computer Graphics: Graphics display controller processor can be programmed to place peripherals either in memory or in the processor's I/O space. Two gates are added to qualify the Read and Write signals. The DMA channel on the 80186 uses a second chip-select input as the Acknowledge signal, and data buffers are used to prevent bus contention at the end of a processor read cycle (Fig. 5). Without buffers, the display controller must remove its data from the multiplexed address and data lines before the processor puts out the next address. At an 8-MHz clock rate, the processor requires that peripherals and memory vacate the bus in less than 85 ns; however, the standard speed of the controller is 100 ns. A faster version, the 82720-1, can be used, but it requires faster memory chips. A more cost-effective solution is simply adding buffers, if board space permits. Serial communications to both the host and the optional tablet are handled by a multi protocol serial controller (the 8274), which takes care of the host's synchronous and the tablet's asynchronous the 82720 has been initialized. Figure 4 shows the complete schematic for each plane of the bit-map interface. The remainder of the hardware design interfaces the graphics display processor, the processor memory, and the other peripherals with the 80186 microprocessor. The task is simplified by the processor's on-board chip-selection logic and waitstate generators. Furthermore, because of the processor's highly integrated architecture, the size of the overall hardware is quite small. Joining processor and controller Connecting the graphics display controller to the microprocessor is a simple task, as the processor's Data, Read, and Write signals are completely compatible with those of the 82720. However, because the controller has no chip-selection input, the Read or Write signals must be qualified through external hardware. A number of chip-selection lines on the micro- \ Ot"c-D,~t(, D, D, ,-- AAS AAS RAM 12118) CAS CAS Write r= SS~L:::::::r; DBIN T, '- 12118) ---, - + D, Sculj>~t In!s 2X74166 In, In, r::: T Ino t I r-- - 2X74LS244 Ootc!ock Video out RAM RAM (2118 12118) _f-- We ~ D" ~ -D::-Ao-Aa A.-Po. D, t t D, D, ... I I Clock ~"~, ShifVLoad D" ShifVl.oad 4. The bit-map memory interlace contains three address planes (one 01 which is shown here) to complete the graphics system. The RAS Signal lor the RAMs is generated by the graphics disptay controller. 7-133 231310-001 Computer Graphics: Graphics display controller requirements. Interfacing is accomplished simply by connecting the buffered data bus, the latched lower-address lines, the Read and Write signals, and the chip-select. A final link brings the microprocessor's counter-timer output into the multiprotocol serial controller as a baud-rate clock. No buffering of the TTL support circuitry is necessary. Universal chip interlaces keyboard 5. The interface between the 82720 and the system microprocessor is simple to implement because all of the processor's signals are compatible with the controller. It is necessary, however, to use external gates to qualify the RD or WR signals. A universal peripheral interface chip (the UPI42) serves as the keyboard interface and is programmed to scan the keyboard and interrupt the processor only on detection of a valid debounced keystroke. Mass-storage subsystems are managed by the 8272A floppy-disk controller. An external phase-locked loop circuit generates all of the timing signals reequired to connect a 51/4-in. drive to the system. On the microprocessor side, a DMA channel provides the link to the floppy-disk controller. Thus 6. A complete graphics control system is centered around an 80186 microprocessor and the 82720 controller. Local storage is provided by 32 kbytes 01 EPROM and 16 kbytes 01 RAM. The system comprises 85 chips and is housed on a single 12-by-12-in. printed-circuit board. 7-134 231310-001 the processor has a high-speed disk interface, which loads it lightly. To complete the graphics system illustrated in Fig. 6, 32 kbytes of EPROM and 16 kbytes of RAM support the microprocessor's program and display lists. The two EPROMs (27128s) come in 28-pin packages, thereby saving board space. Hooking up the RAM chips is almost as straightforward. Since the microprocessor is a fully byteaddressable device,. it can write bytes as well as words to the RAM. The chip-select input for the low (even) address RAM must be qualified with address Ao at a logic zero, and the high (odd) address RAM must be qualified by the processor's Byte High Enable signal (BHE). The RAMs, designated 2186, have built-in controllers. Since dynamic RAMs latch addresses on the leading edge of the chip-select signal, they must be qualified with the processor's Address Latch Enable signal to ensure that selection is made only after the address is valid. Then, a RAM latches the data to be written on the leading edge of the write pulse. The microprocessor's write signal must be delayed by one-half of a clock cycle to guarantee that data is valid at the correct time. At this point, the design meets all of its performance goals. The system draws lines and circles T-1408/5K/0383/HP RM at about 120,000 bits/so That is approximately 82,000 pixels for a display consisting of even amounts of the three primary colors, as well as three secondary colors, and white. The 500 vectors of 25 pixels each can be drawn in about 0.15 s, six times faster than the I-s requirement. The worst case-drawing all lines in white-can be accomplished in about one-third of a second. These specifications are satisfied when the graphics display controller is running from a 2.5-MHz clock. Drawing is performed only during retracing and the 82720 is programmed to use three memory cycles of each horizontal retrace for memory refreshing. All of the components fit on a board measuring 12 by 12 in., so that the desktop size requirements are satisfied. The electronic components occupy about 100 in. 2 of the low-cost, double-sided printedcircui t board. 0 Bibliography: Bresenham, J.E., "Algorithm for Computer Control of a Digital Plotter," IBM System Journal, 1965,4(1) pp. 25-30. 7-135 231310-001 ARTICLE REPRINT AR-298 Graphics Chip'Makes Low-Cost, High Resolution Color Displays Possible by Mark Olson and Brad May The making of displays that are both high-resolution and low-cost is the key to producing equipment for both the automated office and the engineering workstation. Through the introduction of 16-bit ,-"Ps such as Intel's iAPX 8088, 80186 and 80286, the processing power has been made available to perform very sophisticated functions for the user while making the human interface very simple. That processing power can be unnecessarily drained, however, if the ,-"P is burdened with the entire task of graphics display. Such a burden can fill up a significant part of the processor's 110 bandwidth, slow down the refresh rate of the display, and decrease the computational power of the CPU. mented in hardware at the device level. Such a chip is Intel's 82720 Graphics Display Controller (GDC). It has features that give systems a fast drawing speed while reducing graphics display costs by 60% or more. It achieves these results by taking over the drawing and refresh functions from the CPU, by allowing the use of dynamic RAM's instead of static RAM's, and by reducing the overall parts count needed to create a complete graphics system. The implementation of the drawing task is a major feature of the GDC. Other graphics chips perform only the display refresh function, leaving the more complicated drawing function entirely to the CPU. Since the CpU is doing every pixel of the drawing function on these systems, they also require fas- ter bit map RAM than with the GDC. The GDC, on the other hand, is capable of handling the drawing function itself, drawing such objects as characters, slanted characters, points, lines, arcs, rectangles, and slanted rectangles based only upon lengths, slopes, and arc centers supplied by the CPU. The GDC's processing, moreover, takes place concurrently with the processing of the CPU. 2048 X 2048 Resolution With its 4 Megapixel addressability, one GDC can handle a monochrome display with resolution as high as 2048 x 2048, and multiple GDC's can be linked to provide even higher resolution, such as color displays at 2048 x 2048. The chances are, however, that the GDC's full power will not be used in most applications. The typical Intelligent peripheral rcs offload processing tasks from the CPU. The logical way to avoid such limitations is to dedicate a specialized processor to the handling of display function. It should be capable of accepting high-level commands to minimize the burden on the CPU, as well as optimizing the execution of such commands through raster operations impleMark Olson and Brad May are Product Marketing Engineers for Peripheral Components Operation, Intel Corp., Santa Clara, CA 95051. Operating System o 0 From Independent Software Vendor From Intel Figure I: General graphics commands are translated into the VDI interface level and then into driver device commands. Reprinted from DIGITAL DESIGN © April 1983, Morgan-Grampian Publishing Company, Boston, MA 02215 231315-001 7-136 Di91tal Design - April 1983 , Graphil:s Chip 82720 BIT MAP INTERFACE :n I 114 INTO 7 '} ADO- MUX 2 ' 74LS157 A015 82720 7/ 1 I I GREEN MEMORY BLUE MEMORY BLUE RED MEMORY r-V 4r-----v AO-AS I / 16 00-016 I -RAS LS 32 ALE 2XCLK GREEN - RED VIDEO OUT -...... -... 4~ CAS DOT CLOCK TIMING LOGIC -DBIN LOAD SHIFT BANK WRITE I 081N I SELECT 0- 0 , -'"' YO SYNC H V ~ ~ LS 139 ~ Yl ~ Y2 OY3 ... '--- lBLANK ~ -BLANK '"' ~ SYNC - ... SYNC LS 32 Figure 2: The memory is brokell up into three plalles, with each plalle feedillg Olle o[.the primary color gUlls of the CRT, product considered high resolution for office automation applications is a 512 x 512 pixel monochrome or color display, These latter restrictions are not imposed by the GDC, but rather have more to do with the cost of display monitors, the amount of RAM memory needed to support such displays, and the adequacy of such displays for most applications. It is possible to build "super graphics" boards with a GDC, such as the lK by lK pixel by 8 color plane graphics display designed by Phoenix Computer Graphics (Lafayette, LA). Such a display is capable of rendering 256 different colors on a high resolution screen. Even higher performance can be achieved through the use of multiple GDe's to support multiple display windows, increased drawing speed, or increased bits per pixel. For multiple display windows, each GDC can be used to control one window of the display. For inDigital Design - April 1983 creased drawing speed, multiple GDe's can be operated in parallel. For increased bits/pixel. each GDC can contribute a portion of' the number of bits necessary for a pixel. . Although the GDC is intended primarily for raster-scan graphics, it can also be used as a character display controller. It is capable of supporting up to four screens of data containing 25 rows by 80 columns, or one screen containing up to 100 rows by 256 characters. Office Automation Display High performance applications can stretch the usage of the GDC from low-end to high-end engineering displays, but research has shown that for office automation products, a 512 x 512 pixel display is quite acceptable, and that color is often a requirement. These requirements mesh with a major factor in display-the cost of the CRT. In 7-137 OEM quantities, for example, one could expect to find a 512 x 512 monochrome display for under $100, a 256 x 256 color display (TV quality) for about $150, a 512 x 512 color CRT in the $300 range, and a I K x I K color display in the $800-$ 1000 category. To give an example of the type of display that can be built for new office products using the GDC, consider a 512 x 512 pixel by 3 color plane combination CPU and graphics display on a single 12" by 12" board. Such a display is capable of generating 8 colors. The list of parts (Table 2) comes to about $175 for 85 Ie's taking up 104 square inches of board space. Even that parts count could be reduced by replacing the 48 16K DRAMs with 12 64K DRAMs-if a 4K x 16 bit DRAM were available. A very important note about the parts list is that the design is implemented with inexpensive 2118 dynamic RAMs. The design does 231315-001 Graphics Chip not require the faster, more expensive, and less dense static RAMs, The parts count is low enough so that the processor and graphics controller can be placed together in a single 12" by 12" board. This is important because small overall size and footpad are selling points for desktop workstations. System speed is also enhanced when the graphics controller and CPU are on the same board, because their communication need not take up bus, inter-board bandwidth or experience any additional delays. Pipelining 'fransformations More important than putting the graphics display on the same board as the CPU is the level of communication between the CPU and graphics controller. If the burden of transformation processing is left entirely to the CPU while the graphics chip is used only as a CRT controller, then the CPU must communicate one bit per pixel to update a display. With the GDC, the CPU input takes higher level forms such as the slope and length of a line, the length and center point of an arc, or the key coordinates of a rectangle. Since the average line on a screen is about 25 pixels, that means that 25 times fewer CPU bus cycles are required to draw a graphical object with the GDC. These CPU cycles (an average of 50 f.Ls each to calculate the graphical object and communicate it to the GDC) are the determining factor in drawing rate. Viewed from a larger perspective, there are four tasks that must be performed by a CPU-graphics chip .combination: (I.) The CPU must calculate the higher-level graphics operations. This is done by the CPU and it involves the processing of macro-operations such as the CORE, GKS, PMIG or other graphics protocols. These general graphics commands are translated into an intermediate level, the VOl interface level (Figure!) and then into device driver commands by software in the CPU. (2.) Then, these lower-level graphical objects such as the key parameters for lines, arcs, characters, and rectangles, must be trans- VLSI Takes Aim At Text Processing ,--------,I The concept of co-processing is not a new one. Intended as a way of offloading computationally intensive tasks from a host CPU, it has been around at Intel since the introduction of the 8087 numerics processor and the 8089 I/O machine. A more recently developed product, the 82720 Graphics Display Contreller is designed to bolster system performance by offloading graphics control chores from the CPU. The chip accepts high level commands from the CPU and, using its own drawing processor, accesses the required positions in the bit-map and handles the processing and display control functions. Building on the success of these parts come two new co-processors designed to partition system intelligence even further. The 82586 is a communications coprocessor designed to bridge the characteristics of CPU and network data rates. Its FIFO buffer and DMA facilities make it possible for a CPU to operate at the full Ethernet 10 Mbits/s transfer rate even in the face of continuous bursts of network data traffiC. Intel's most recent introduction is the 82730 text co-processor. Printers and other hard copy peripherals have supported additional text processing features such as proportional spacing and simultaneous superscript and subscript for some time. Implementing these features on the display screen has traditionally been a costly procedure. Thus, it is typically not done and screen displays often are not identical to their hard-copy printouts. Aimed to solve this designers headache, the 82730 has its own DMA capability and communicates asynchronously with the CPU via shared memory messages. It supports the generation of high quality text displays through features like proportional spacing, simultaneous superscript/subscript, dynamically reloadable fonts and user programmable field and character attributes. In addition, when coupled with the 82720 Graphics Display Controller (Figure 1) the 82730 provides flexible mixing of text and graphics simultaneously on the same display. -Wilson 231315-001 I 8E~~6 I Coprocessor L _______ _ I Data Communications Block ,-------82720 I Graphics I Processor Display Processing I IL....-_-I I Block 82730 Text Coprocessor L _______ _ ,APX 186 General Purpose Processor Memory r-;------I I I I I iAPX 286 Hi·Performance Processor Data Processing 80287 Btock Numerics Processor L _ _ _ _ _ _ _ --' Figure 1: Offioading system tasks is simplified by new V LSI devices. 7-138 'Digilal Design - April 1983 Graphics Chip DRAWING SPEED - 50 ILsec Sel up Draw 1 80186 - 50 ILsec Set up Draw 2 Set up Draw 3 Set up draw 4 (.--------------------------) (.---------._.-----------------------------------------------) (---------------------------) (.--------------------------) (25 pixels) (100 pixels) Draw1 Draw1 Bit 2 Bit 3 <---------)(---------> GDC (2.5MHz) Calculate Next bit Draw1 Draw2 Bit 25 Bit t . <--------.)<---------) Draw2 <--------->, Bit 2 •· .. ·---.. ---40 ILsec------------------------·-----) GDC RIMIW Drt Drt Bitt Bit2 Drt Drt . <--------->(---------> Bit24 Bit25 Dr2 Dr2 (.--------> .... <---------) Bitt Bit100 <------------40 j..lsec ------------------------------) -50 ILsec Set up draw 1 Other CPU Calculate R/M/WBitt Calc R/M/W Bit2 Bit25 c. __________________________ ) ( _________________ ) ( _________________ )( _________________ ) .... <_________________ ) Bitt -50 ILsec Set up draw 2 (--------------------------.> • ------------------375-500 ILsec-----------------------------------------------) Table 1: The 80186 and the GDC lVork together to accomp!t.\·" the drawlIlg fllllctlOll. formed into changes in the actual bits. This function is performed in hardware in the GDC concurrently with any level one processing done by the CPU. Other graphics controllers leave this task to the CPU to execute in software. The contrast is that, in such systems, the CPU must resolve the graphical object down to every point on a line, while with the GDC it need only designate the endpoints. (3.) With the actual bits for the bit map calculated, they must be placed in the bit map memory. This involves a read-modify-write operation that requires three CPU cycles using other methods. With the GDC these operations are not the responsibility of the CPU. The GDC pipelines its execution so that it is calculating the next bit to change while it is executing the read-modify-write cycles. (4.) Finally, the bit map memory must be dumped into the CRT. This is the refresh function performed by other graphics chips as well as the GDC. The summation is that other systems require the CPU to process steps one to three serially, leaving only step four for the graphics controller. Systems with the GDC require the CPU to process only step one, with the GDC concurrently Digital Design _ April t983 processing steps two through four. The GDC has another advantage in that during the transformation process in step three, the GDC executes the algorithms in hardware while a CPU must execute the algorithms in software. The algorithms are exactly the same in both cases. They are the Bresenam algorithms from IBM, in which the next pixel to be drawn becomes a binary decision between two pixels_ The execution of these algorithms is a crucial drawing time factor, because they are invoked many times for each updated screen_ Consider that, in the inncr loop of Bresenam's "line drawing algorithm," there are two or three additions, two comparisons or tests, and the masking of the proper value into the word for each pixel. The algorithms for drawing circles or filling areas are even more complex. In the inner loop of a fill algorithm, the old word must be read from the bit map, then tested to see if all, some, or none of the pixels are within the area to be filled. Next, it tests whether some or all of the pixels must be modified. Finally, the word must be returned to the bit map. These algorithms are heavily used and the speed with which they can be executed has a direct effect 7-139 upon the overall system efficiency. If they must be executed by a (.LP, the in~truction fetching process slows down the calculations to a drawing rate of 15-20 (.LS per pixel. With a hardware implementation of these algorithms in the GDC, the. calculations can be speeded up to achieve a drawing rate of 1600 ns (2_5 MHz version) or 800 ns (5 MHz version) per pixel. Methods Of Refresh In the fourth step, the dumping of bit map memory into the CRT, there are some differences between graphics controller chips. Motorola's MC6845 CRT controller, for example, uses a split-cycle refresh. method in which each refresh cycle is alternated with a drawing cycle in which the (.LP lIpdates the bit map. This gives the MC6845 a 50% drawing bandwidth. With the GDC there are two drawing modes. The first is a "draw anytime" mode which replaces CRT refresh cycles with drawing cycles. This is the fastest mode, but it does result in on-screen disruptions. The second mode, which does not disrupt the on-screen display, draws only during the vertical and horizontal retracing periods. This gives the GDC about a 25% 2313t5-001 Grdphil s Chip 1 1 2 1 1 1 1 80186 82720 74LS157 74LS139 74LS161 74LSll 74LSOO 1 1 9 8 3 2 1 74LS04 74LS73 74LS244 74LS166 74LS32 8286 8 MHz Crystal 1 2 2 1 1 3 1 20 MHz Clock 27128 2.186 8274 8042 Connectors 12x 12 2 Layer PC SUMMARY: 4 VLSI Controliers 80186 82720 8274 8042 Processor Graphics Serial Link Keyboard 4 VLSI Memory 27128 2186 EPROM IRAM 4816K DRAMs 2118 TOTAL: DRAM Buffers/Glue 29 Msi/sSI 85 IC'S ....... 104 Sq. Inches Parts Cost ....... About $175 Table 2: Parts list for 512 x512 X 4 Color Display. 16 MHz To Oat Clock (2.5 MHz) -"~D~ X, 2XCCLK X, WA WA r AD PCSl Al AD -;:I)Ir-, 1 80186 ADO·7 Data Buffer rm.i DTIA peS1 AO II 1 82720 DBO·7 I DACK DAEO DAOO • Asynchronous Processors • DMA Access to Bit Map .4 Buffers. 1 Glue IC Figure 3: The two chip selects are OR'd together to ber of pixels is not a power of two, it will be necessary to round up to the next power of two and waste the extra bits. The pixel arrangement which best meets this requirement is .one with a 432 x 576 pixel format. It also meets the requirement that the number of pixels horizontally be an even number of 16-bit words. With three color bits per pixel (red, blue, and green), the total display memory is then about 500 x 500 x 3, or 750k bits. It makes the most sense to break the memory up into three planes, with each plane feeding one of the primary color guns of the CRT (Figure 2). This leads to a memory arrangement of 16K x 16 x 3, using 16K dynamic RAMs with a 1K x 16 architecture. When drawing graphics figures, the memory can be treated as one large plane, split into the three primary colors. Drawing in low-order memory . could represent red, middle-order could be used for green, and highorder for blue. One advantage of this 3D memory is that drawing with a primary color requires setting only one bit per pixel. Drawing with a secondary color such as cyan, yellow;or magenta would take two GDC cycles, and creating white from all three colors would take three GDC cycles. If this were an issue, additionalhardware could be used to draw more than one plane at a time. As the results 'will show, however, the drawing speed requirements can be exceeded without any added hardware. qualify the RIW signals. Calculate The Drawing Rate drawing bandwidth. At first glance that gives the GDC a disadvantage in drawing rate, but the fact is, with its pipelining and hardware execution of· transformations, the GDC makes much more efficient use of its bandwidth. The critical timing factor is the amount of CPU participation in the drawing process, not the refresh bandwidth of the graphics controller. Another tradeoff is that, with its split-cycle architecture, the MC6845 requires RAM memory that is twice as fast as that required by the GDC in the same application. Inexpensive RAM Is Fast Enough Applying this perspective, one can begin to build the display with parts listed in Table' 2. First one notes that a square display, as indicated by the.512 x 512 pixel initial specifi, cation, is not pleasing to the eye. It is much more appealing to have an aspect ratio of about 4:3, in which the number of pixels horizontally is 4/3 the number vertically. If the resolution is such that the total num7-140 To see if the proposed design is practical, one should first calculate the drawing rate to see what the user interface will be like. Then one should check the refresh rate to make sure the design is uninterrupted and without flicker. The proof of the assumption that CPU participation is the dominating factor lies in the 50 f.l.s average time that it takes the CPU to calculate a graphical object and communicate its key parameters to the GDC. Assume that the graphical object is an average line containing 231315-001 Graphics Chip 25 pixels, and that there are about 500 vectors on the average screen display. The GDC's normal clock rate is 2.5 MHz, giving it a 400 ns period (the maximum clock rate is 5 MHz, with a 200 ns period.) It takes four GDC cycles to execute a readmodify-write on a bit (because two read cycles are required), so that the GDC's normal drawing rate is one pixel per 1600 ns. To draw the 25 pixels involved in the average line, then, would take 25 x 1600 ns, or 40 IJoS. Since this operation is done concurrently with CPU processing, the GDC will be waiting for the next graphical object by the time the CPU is ready. If the screen were filled with nothing but 25-pixel vectors, then the drawing rate would be determined by the 50 IJoS average CPU calculation and transfer cycle, averaging about 2 IJoS per pixel. If all the vectors were white (worst case), then it would take 1.5 secs of drawing time to update the white screen. Since, in the undisturbedscreen mode, drawing is only done during the 25% of the time that the screen is undergoing horizontal or vertical blanking, this would mean 6 secs between updates. In reality, however, the screen will not be filled with vectors. It will have an average of 500 vectors, and the color distribution could be presumed to be evenly distributed as one-third primary colors, onethird secondary colors, and onethird white. The 500 vectors will require the drawing of 12.5K pixels in monochrome, or 25K pixels with distributed colors. At a drawing rate of 2 IJoS per pixel, this takes 50 ms to draw. Drawing only during blanking, the screen would be updated in 200 ms. Under these conditions, it would not help to use the maximum clock rate GDC (5 MHz), but if in some applications the average vector length is 100 pixels, then the CPU calculation-and-bus cycle (50 IJos) would remain the same and the GDC's draWIng cycle (I600 ns x \00 = 160 IJos) would become a limiting factor. Using the 5 MHz GDC would cut that drawing time down to 800 ns/pixel, or 80 IJos/vector. The 500 vector average screen would then contain lOOK pixels with distributed colors and could be drawn in 80 ms. Multiplying by four because the drawing is done during blanking (25% of the time), that is 320 ms. That is a screen update in less than one-third second for a "busy" screen. Calculate The Refresh Rate These calculations are of little importance if the display flickers due to lack of refresh. This exercise is actually a demonstration of how the basic GDC clock rate was derived. Assume a non-interlaced display that must be refreshed 60 times per second. That gives a screen refresh rate of 16.67 ms, but on a typical CRT some 4.27 ms of that is blanked, leaving 12.4 ms of active display time. The dot sweep period is the 12.4 ms divided by the number of pixels (432 x 576 = 248.8K), or 49.8 ns. The inverse gives a 20.07 MHz dot clock. Since the GDC dumps 16 bits from the bit map memory into the oRCO DREO peso DACK DROl TMR OUT 0.1 - WR RD ~ RD ALE I--~ ,..-- - peS3 ADR LATCH I ( 82720 GDe PCS2 - I ARDY 80186 ,.- eP ~ e- -LeS ves MONITOR ADDRESS BUS AD sus DEN oT DATA Rf:::::=_ I 'EPA£"' 27128 ~ LOW 8K . 8 eE I-f-- r--- I E~1 ~ IRAM 2186 27128 HIGH 8K . B TeE I-- r--- I 1-- DATA BUS r---- BUFFER LOW I-f--- ,-- ,--- DBO-7 MEMORY BUS Rxe Txe IRAM 8279 2186 KEYBOARD CON- HIGH 8K . B I--- 8K . B 11J VIDEO REFRESH LOGIC 'yfLER WE TesT READyTes READY es , 8274 RDYB TXDROA SERIAL 16K· 16 10 r- BIT MAP MEMORY 16K· 16 3 PLANES es TO oMA MONITOR KEYBOARD SERIAL PORT TO HOST TO OPTIONAL TABLET Figure 4: Completed graphics system uses the 80186 and 82720 CDC. Digital Design _ April 1983 7-141 231315-001 Graphics Chip '\. D, D, OINO·DIN15 D, D" I 2118 D,N •• A~-A6 • AAS Ao·A6 VIDEO OUT 2118 -AAS 2118 2118 - • CAS WRiTE 32 P - CAS WE Dour - r- - ~ r- f-- IN1~ 2X 74166 IN, IN, IN, BSEL -DBIN DOT elK "'j ,CLOCK 32 SINPUT I t I 2X74LS244 ••• -- L D, D, SL ~ t D, D" 900173 SH 1FT LOAD Figure 5: Since the 186 is a flllly byte addressable machine, it is possible to write bytes as well as words illto the RAMs_ 16-bit shift register during each read, and since the shift register then feeds these bits out serially to the CRT, it makes sense that the GDC's read period should be 16 times the dot sweep period. That gives a GDC read period of about 800 ns. With each GDC read taking two cycles, the basic GDC clock period is then 400 ns, or 2.5 MHz. This gives a rock-solid display, and one would only want to go to the 5 MHz GDC to improve drawing rate. For those who want to examine the blanking intervals to see if the CRT is indeed "typical," the blanking can be further broken down. The vertical blanking interval is 1.25 ms, leaving 15.42 ms to scan the 432 lines on the active portion of the display. Dividing 15'.42 ms by 432 lines gives a 35.7 fLS period per line, or a horizontal sweep rate of 28 KHz. Time is also needed for horizontal retrace, in this case, 7 fLS of horizontal blanking per line. This leaves 28.7 fLS to scan the 576 231315-001 pixels on each line, resulting in the dot sweep period of 49.8 ns. Using a 20 MHz CRT helps keep the costs down, but the GDC can use CRT displays as fast as 80 MHz when higher resolution is required. Mixed Mode While it is possible to generate 8 x 8 characters and slanted characters in the graphics mode, the GDC . also offers a mixed mode memory organization to display both characters and graphics drawn from separate windows in the display memory. The advantage of this mode is that it allows characters to be manipulated as 8-bit entities instead of the 64 bits that each would require in graphics mode. Of necessity, the graphics window display memory is reduced in this mode (64K 16-bit words instead of 256K), but even the reduced maximum graphics memory is still a megapixel and quite sufficient for both office automation and engineering display purposes. 7-142 In the character window, the G DC operates as it does in the pure character mode, with the exception that the line counter must be implemented externally. In addition to the two windows used for graphics and characters in the mixed mode, two other windows can be supported. These can be designated as either character or graphics windows by a selection on the A17 line. Panning, Zooming, Light Pen As special features, the GDC allows both panning and zooming in either graphics, character, or mixed modes. The zoom is accomplished by effectively increasing the size of the dots on the screen. Vertically, this is done by repeating the same display line. The number of repeat times is determined by the display zoom parameter. Horizontally, zoom is accomplished by extending each display word cycle and displaying fewer words per line, according to the zoom factor. Digital Design _ April 1983 inter 82730 TEXT COPROCESSOR • • • • • High Quality Display for Text and Graphics Applications Provides Proportional Spacing, Simultaneous Superscript/Subscript, Soft Font Support and Bit Map Graphics High Performance Manipulation of Text/Graphics Strings Programmable Bus Interface Handles 8 or 16 Bit Data and 16 or 32 Bit Addressing; iAPX 86/88/186/188 Compatible On-Chip Processing Unit Simplifies Software Design by Executing High Level Commands and Supporting Linked List Data Structures • • • • • Extremely Flexible; Programmable Features Include Screen and Row Formats, Two Cursors, Character and Field Attributes and Smooth Scrolling Supports Multiple Windows High Resolution Display; Up to 200 Characters/Graphics Cells per Row and 2048 Scan Lines per Frame Separate Bus and Video Clocks Allow Optimization of Overall System Performance Provides a Complete LSI Solution for Display Control when Used in Conjunction with the 82731 Video Interface Controller The 82730 Text Coprocessor is a high performance VLSI solution for raster scan text and graphics displays. The 82730 works as a coprocessor and has processing capabilities specifically tailored to execute data manipulation and display tasks. It provides the designer the ability to functionally partition his system thereby offloading the system CPU and achieving maximum performance through concurrent processing. The 82730 supports the generation of high quality text displays through features like proportional spacing, simultaneous superscript/subscript, dynamically reloadable fonts and user programmable field and character attributes. It supports high quality graphics with fast manipulation and display of bit map strings. An intelligent system interface and efficient software capabilities makes 82730 based systems easy to design. BUS CONTROLS ADII-AD15 CHAR DATA CA MICROCONTROLLER UNIT DISPLAY CHARACTERISTICS REGISTERS SINT MEMORY INTERFACE UNIT DISPLAY GENERATOR CONTROL VIDEO CONTROLS _ 1 _ DISPLAY GENERATOR Figure 1. 82730 Block Diagram Intel Corporation Assumes No Responsibility for the Use of Any Circuitry Other Than Circuitry Embodied in an Intel Product. No Other Circuit Patent Licenses are Implied. AUGUST 1984 ©INTEL CORPORATION. 1984 7-143 ORDER NUMBER: 210931-004 inter 82730 BonOM TOP CA so 5. CRVV BLANK CHOLD LPEN RRVV VSYNC CSYNC CCLK 51 READY SINT IRST RESET BCLK VSS ALE RD Vss RCLK SYNCIN HSYNC LC4 LC3 LC2 LC1 WR HLDA HOLD DEN AEN UALE ~-''''''nr'''''',..,r''''''nr'n'nn " LCO PIN NO.1 MARK Figure 2. 82730 Pinout Diagram Table 1. 82730 Pin Description The 82730 is packaged in a 68 pin JEDEC Type A ceramic package. Pin Number Type Name and Function 1-8 10-17 I/O Address Data Bus; these lines output the time multiplexed address (TU, T1 states) and data (T2, T3, T4 and TW) bus. The bus is active HIGH and floats to 3-state OFF when the 82730 is not driving the bus (i.e. HOLD is not active or when HOLD is active but not acknowledged, or when RESET is active). BCLK 59 I Bus clock; provides the basic timing for the Memory Interface Unit. RD 62 0 Read strobe; indicates that the 82730 is performing a memory read cycle on the bus. RD is active low for T2, T3 and TW of any read cycle and is guaranteed to remain high in T2 until the address is removed from the bus.ADis active low and floats to 3-state OFF when 82730 is not driving the bus. RD will return high before entering the float state and will not glitch low when entering or leaving float. Symbol AD15-ADO 210931-004 7-144 82730 Table 1. 82730 Pin Description (Continued) Symbol Pin Number Type Name and Function WR 63 0 Write strobe; indicates that the data on the bus is to be written in a memory device. WR is active for T2, T3 and TW of any write cycle. It is active LOW and floats when 82730 is not driving the bus. WR will return high before entering the float state and will not glitch low when entering or leaving float. ALE 61 0 Lower Address Latch Enable; provided by the 82730 to latch the address into an external address latch such as 8282/8283 (active HIGH). Addresses are guaranteed to be valid on the trailing edge of ALE. UALE 68 0 Upper Address Latch Enable; it is similar to ALE except that it occurs in upper address output cycle (TU). AEN 67 0 Address Enable; AEN is active LOW during the entire period when 82730 is driving the bus. It can be used to unfloat the outputs of the Upper and Lower Address latches. DEN 66 0 Data enable; provided as a data bus transceiver out· put enable for transceivers liKe the 8286/8287. DEN is active LOW during each bus cycle and floats when 82730 is not driving the bus. DEN will not glitch when entering or leaving the float state. 53,54 0 Status pins; encoded to provide bus·transaction information: SO,S1 S1 SO 0 0 1 1 0 1 0 1 Bus Cycle Initiated - - - (Reserved) Memory Read Memory Write Passive (No bus cycle) These pins are directly compatible with iAPX 86,186 status outputs S1 and SO. The status pins are floated when 82730 is not driving the bus. They will not glitch when entering or leaving the 3·state condition. READY 55 I READY; Signal to inform the 82730 that the data transfer can be completed. Immediately after RESET, READY is asynchronous (internally synchronized) but can be programmed during initialization to bus synchronous. 210931-004 7-145 82730 Table 1. 82730 Pin Description (Continued) Symbol Pin Number Type Name and Function HOLD 65 0 HOLD; indicates that the 82730 wants bus access. HOLD stays active HIGH during the entire period when 82730 is driving the bus. HLDA 64 I Hold Acknowledge; indicates to 82730 that it is granted the bus access as requested. HLDA may be asynchronous to 82730 clock. If HLDA goes inactive (LOW) in the middle of an 82730 bus cycle, the 82730 will complete the current bus cycle first, then it will drop HOLD and float address and bus control outputs. CA 52 I Channel Attention; used to notify 82730 that a command in the command block is waiting to be processed. CA is latched on its falling edge. SINT 56 0 Status Interrupt; used to inform the processor that an unmasked interrupt has been generated in the 82730 status register. IRST 57 I Interrupt Reset; SINT is cleared by activating the IRST pin. RESET 58 I Reset; causes 82730 to immediately terminate its present activity and enter a dormant state. The signal must be active HIGH for at least 4 BCLK cycles and is internally synchronized to the bus clock. CCLK 27 I Character clock; input used to clock row buffer data, attribute, cursor and line count out of 8'2730. When more than one 82730 is connected in cluster mode, CCLK is used to synchronize output from both master and slave chips. A character data word will be output at every rising edge of CCLK. RCLK 25 I Reference clock; input used to generate timings for the screen layout and to define screen columns for data formatting. All raster output signals are specified relative to the rising edge of RCLK. 36-42 44-51 0 Video data bus output; the least Significant 15 bits of . the character data words are passed through the 82730 row buffer and made available on the pins DATO-DAT14. The user has the flexibility to partition the data word into character and attribute bits per his requirements. The bits that are assigned for internally generated attributes may also be available at pin DATO-DAT14. New character data will be shifted to these output pins at every rising edge of the CCLK. Together with LCO-LC4, they may be used to address the character generator or as attribute controls. DATO-DAT14 7-146 210931-004 inter 82730 Table 1. 82730 Pin Description (Continued) Symbol Pin Number Type Name and Function 35 0 Width Defeat; is used to indicate when the character is allowed to be a variable width or must be of fixed width. WDEF is LOW if the character being output is normal, but is HIGH if it is a superscript/subscript character or visible attribute (TAB or GPA). Optionally, WDEF can be held high by user command. 18-22 0 Line count outputs; used to address the character generator for the line positions in a row. The line number output is a function of the display mode and character attributes programmed by the user. CSYNC 28 0 CCLK synchronization output; used to synchronize external character clock generator to reference clock timing. This output is active (high) outside the display field. CHOLD 32 0 CCLK Inhibit output; used by external logic to inhibit CCLK generation. This output is active (low) during the tab and end-of-row function. SYNCIN 24 I Synchronization input; used to synchronize the vertical timing counters to an externally generated VSYNC signal. Used by slave mode 82730 to synchronize to a master mode 82730 and by the master 82730 to lock the frame to an external source such as the power line frequency. HSYNC 23 o (MASTER) Horizontal Sync; in master mode, it is used to generate the CRT monitor's horizontal sync signal. It is active HIGH during the programmed horizontal sync interval. In interlace slave mode it is used in conjunction with SYNCIN to indicate the start of the even field for timing counter reset. At RESET, pin is set as an output in the LOW state. WDEF LCO-LC4 I (SLAVE) VSYNC 29 0 Vertical Sync; active HIGH during the programmed vertical sync interval and used to generate the CRT monitor's vertical sync signal. BLANK 33 0 Blanking output; used to suppress the video signal to the CRT. BLANK is clocked by CCLK. CRVV 34 0 Character Reverse Video (CCLK output); used to externally invert video data output. CRVV is clocked by CCLK. RRVV 30 0 Reference Reverse Video (RCLK output); to externally invert video in the field and border area if so programmed by user. It is LOW outside the border area, RRVV is clocked by RCLK. 7-147 210931-004 82730 Table 1. 82730 Pin Description (Continued) Symbol Pin Number Type Name and Function 31 I Light Pen Input; used to latch the position of a light pen. At the rising edge of this input, the column posi· tion and the row position of the 82730 will be loaded into the LPENROW and LPENCOL locations in the Command block. LPEN Vcc 9,43 Power; + 5 volts nominal potential. Vss 26, 60 Power; ground potential. FUNCTIONAL DESCRIPTION Figure 1 shows a basic block diagram of the 82730 Text Coprocessor. The chip is divided into two main sections, the Memory Interface Unit and the Display Generator. The Memory Interface Unit controls fetching of the data and commands and handles interrupts and status. The Display Generator takes the data fetched by the Memory Interface Unit and presents it to the Video Interface logic which in turn drives the CRT monitor. Memory Interface Unit The Memory Interface Unit is divided into two sections: the Bus Interface Unit and the Microcontroller Unit. The Bus Interface Unit does the actual interfacing to the memory bus. It fetches or writes data .under the control of the Microcontroller Unit. The Microcontroller Unit is a microprogrammed controller which is designed to efficiently fetch data from memory (up to 4 Mbytes/sec), and decode and execute various control and data handling commands. The Bus Interface Unit may be configured for 8 or 16 bit bus operation. With 8 bit bus selection, the user may specify either 8 or 16 bit character data. It also handles address manipulation automatically after being loaded from the Microcontroller Unit. Display Generator The Display Generator takes the data fetched from memory plus the modes prog rammed into it at initialization and produces all the video timing and the data transfers to support the CRT monitor at the character level. The 82730 works with an external character generator and the 82731 Video Interface Controller. The d.ata is passed to the Display Generator from the Memory Interface Unit through the dual row buffers (similar in 7-148 operation to the one in the 8275 CRT controller). The row buffers allow the userto use cheaper and slower main memory for display needs, provide on-chip attribute and display function generation, and avoid the conflict of access to the display memory (that would otherwise take place) by using an ordinary DMA access mechanism. SYSTEM BUS INTERFACE The Memory Interface Unit provides communication with system processor as well as memory interactions. Communication between the processor and the 82730 is performed via messages placed in communication blocks in shared memory. The processor can issue commands by preparing message blocks and directing the 82730's attention to them by asserting a hardware channel attention. The 82730 can cause interrupts on certain conditions, if enabled by the processor by activating its System Interrupt output, with status and error reporting taking place through the communication block in memory. BUS INTERFACE UNIT: The 82730 Bus Interface Unit provides an 8086 compatible bus interface which consists of: a 16/32 bit multiplexed Address/Data Bus: ADo - AD 15 A complete set of local bus controJ...§ignRls compatible with 8086 min mode: RD, WR, ALE, DEN and READY Two status signals SO and S1, compatible with 8086 max mode so that a bus controller (8288) can be shared for Multibus® access. Local bus arbitration through HOLD/ HLDA Two .Y.Q..I2.er Address Latch controls: UALE and AEN 210931·004 82730 The BUS INTERFACE UNIT (BIU) utilizes the same Bus structure as the 80186 or basically the same bus structure as the 8086 in both Min. and Max. mode, (with the exception of RQ/GT) and it performs a bus cycle only on demand (e.g., to fetch a command from the command block, or fetch a character from display data memory). The same set ofT-states (T1, T2, T3, T4and TW) of 8086 are used to handle the time multiplexed address/data bus. However, adaptations are made to handle 32 bit addresses as explained in the following sections where specific details of the BIU operation are described. Those details not mentioned can be assumed to be the same as those of the 80186. ADDRESS BUS The 82730 can be programmed during initialization to operate on either 16 bit or32 bit (including any length between 17 and 32) physical addresses. Note that the 82730 does not use memory segmentation. The programmer must calculate physical addresses from segment and offset values to manipulate data structures. To support 32 bit physical addresses with a 16 bit physical bus, multiplexing is again used. An upper address output cycle, TU, is inserted between T4 and T1 to output the upper 16 bits of address. The upper address latch enable, UALE, is used to latch the upper addresses during TU. Figure 3 shows the configuration of a 32 bit address bus. TU occurs only when the 32 bit mode is specified and the upper address register of BIU is reloaded by MCU. This may result from: i} Initialization ii} Manipulation of display data or command pointers, for example, when a new string pointer is loaded during the execution of the END OF STRING command. iii} iv} during address calculation. UALE always stays inactive, but AEN still goes active to indicate the 82730 has control of the bus. DATA BUS The 82730 is capable of operating on either an 8 bit or a 16 bit Data bus, as programmed during initialization on the SYSBUS byte. When an 8 bit data bus is specified, the address present on AD15 to AD8 Address/Data lines is maintained for the complete bus cycle. Therefore, compatibility with 80188, 8088, 8089 and 8085 multiplexed address peripherals is maintained. Since the internal processing of the 82730 generally operates on 16 bit data quantities, two Bus fetch cycles are performed for each 16 bit data item. The first cycle fetches the low order byte, the second cycle the high order byte. These 2 fetch cycles are always executed back to back. If HLDA drops during the first cycle, the 82730will not respond until the second cycle is completed. An 8 bit data mode can be selected in an 8 bit bus system that requires only 8 bit character data be fetched. In 16 bit bus system, the 82730 requires all 16 bit quantities to start on even address boundary. Word transfer to or from odd boundary is not allowed since this type of transfer not only doubles the use of bus bandwidth but also can be easily avoided in application software. All that is required is to make sure all address pointers be an even number (AO=O). ,-l<::==:;-;=:======> AOO~15 82730 DMA address incrementing across a 64K byte segment boundary. A16-31 ClK Regaining the bus after losing itto a higher priority master. CE UALE Timing of UALE is identical to that of ALE. AEN is equivalent to the active period of 82730 driving the bus. If 16 bit address mode is programmed, TU will never occur in any bus cycle since the MIU treats all display pointers as 16 bit quantities and loading of internal upper address register is bypassed Figure 3. Address Extension up to 32 Bits 210931-004 7-149 82730 BUS CONTROLS device can preempt the HLDA from a 82730which is the current bus master. The 82730 will complete its current bus cycle, then float its output drivers and drop the HOLD request. However, the 82730 may raise the HOLD request again 2 clock cycles later if it still needs the bus to complete the interrupted burst DMA activities. The 82730 BIU provides both the 8086 MIN. Mode (Local Bus Control) and MAX. mode bus control signals simultaneously in any bus cycle. By providing a complete set of Local Bus control signals, the component count of the Local processing module is minimized. Because only two types of Bus operations, Memory Read and Memory Write, are executed in the 82730 BIU, the 8086's S2 status signal is omitted from the Max. mode controls. S2 could be set to "1" during any 82730 Bus cycle. AEN can be used to produce S2 since it stays active whenever 82730 is driving the bus. The status signals become valid at the middle of the cycle before T1 which could be either T4 or TU. BHE is not provided o.n the 82730 because, the 82730 only writes words to even address boundaries and bytes to the upper byte position. For these writes BHE is always high. A pUIi 'Nsistor or a three-state buffer controlled by E. can provide this signal. . K DMA BURST AND SPACE Some system configurations using the 82730 would be adversely affected by the long burst data transfers which the Memory Interface Unit (MIU) may occasionally desire. Since the 82730 will normally be configured as one of the higher priority bus masters, burst lengths must be limited for these systems. For this reason, the length of a burst transfer and the number of memory cycles between burst transfers are both programmable via the mode registers: 15 14' 8 7 6 0 MPTR - BRSTLEN - BRSTSPAC BRSTLEN- Burst Length.Determines the numberof contiguous word-fetch cycles which may be requested. Programmable from 1 to 127. Note that in an 8 bit bus, 16 bit data system, the burst counter only increments once for the 2 bus cycles required to complete a word fetch. (Note: burst length = 0 is not defined and should not be programmed with a non-zero burst space) DT/R is also not provided on the 82730 because its function can be replaced with S1, latched by ALE. After RESET is applied, READY is set to be an asynchronous input An on-board synchronization circuit provides reliable operation for any type of system. During initialization, READY may be programmed to be bus synchronous. For those systems that can meet the set-up time specifications, this mode provides more efficient bus utilization. BRSTSPAC - Burst Space. Determines a minimum number of bus clocks to occur between burst accesses. Programmable from 0-511 in increments offour. Zero space selects an infinite burst length . . LOCAL BUS ARBITRATION A DMA burst could be terminated before the programmed burst length is reached in the following circumstances: The 82730 BIU is designed to function as a bus master in a multimaster Local bus environment using the HOLD/HLDA protocol for Bus arbitration. In the Self Contained Arbitration scheme, one processor and one 82730 share access to the local bus. The 82730 raises its HOLD request whenever it needs bus access. After HLDA is granted from the processor, the 82730 will not start driving the bus until2 clock cycles later. This latency allows sufficient time for the 8086 or 80186 processor to get off the bus. When 82730 completes its bus accesses, it will first float its output drivers before dropping the hold request i) The MIU does not need any more bus accesses, for example, when the row buffer is filled. ii) A datastream command is encountered and the MIU must execute the command first before it resumes data accessing. iii) The bus is taken away by a higher priority device in multi-master bus configuration. In these cases, the burst counter is cleared. The BIU must complete a full burst before it waits through the SPACE cycles. DMA Burst/Space will be set to zero space until the completion of the first MODESET command. In a Local bus configuration with three or more bus masters, a higher priority DMA Peripheral 7-150 210931-004 82730 INITIALIZATION OF BIU Control Bus Upon activation of the RESET input, the 82730 BIU will stop all operations in progress and deactivate all outputs. It will stay in this quiescent state until memory access is requested by the MCU after MCU receives its fi rst channel attention after RESET The following table shows the state of all MIU outputs during and after reset. The 82730 implements both 8086 minimum and maximum mode bus control structures. This was done to maximize compatibility with the 80186 which has the same structure. This allows the 82730 to be run locally (minimum mode) with a 8085,8086, 8088, 80188, or 80186. The 80186/188 and 82730 can run together at 8MHz because of clock duty cycle considerations. The 82730 can only communicate to an 80286 via a system bus (such as MULTI BUS), bus interface, or dual-port RAM. Table 2. 82730 Bus During and After Reset Signals AD15-0 RD, WR, DEN SO, S1 ALE,UALE AEN HOLD SINT Condition Three-state Driven to '1' then three-state Driven to '1' then three-state Low High Low Low INITIALIZATION SEQUENCE The first CA (Channel Attention) after Reset causes an Initialization Sequence to be executed. The system processor must set up the appropriate initialization information in memory and set the BUSY flag in the Intermediate Block to a nonzero value prior to issuing this CA. 82730 COMPATIBILITY ISSUES 82730 Bus Clock Compatibility The 82730 uses the 50% duty cycle output of the iAPX-186 at 8 MHz or that generated by a clock generator such as the 82285. A different duty cycle clock may be used at lower frequencies, so the 82730 is also useable with the iAPX-86, 88 family. 82730 Bus Interface Compatibility The bus interface compatibility between the 82730 and another bus master has four main issues: data bus width, addressability, control bus structure and local bus mastership arbitration. Data Bus Data Bus width compatibility with all 85/86 family processors (8085, 8086, 8088, 80188, 80186, and 80286) is being supported by the 8/16 data bit programmability already discussed. This allows interfacing to the above processors either directly or through a Multibus-like interface. Address Bus The 82730 uses real 32-bit addresses. The user's software must calculate real addresses; this general addressing scheme allows the 82730 to be used with any microprocessor. 7-151 Initially, 32-bit addressing and 8-bit data bus width are assumed until the corresponding information is fetched during the initialization. First the SYSBUS byte is fetched from memory location FFFF FFF6. (When the address bus is less than 32 bits wide, the higher order bits are unused.) The format for SYSBUS byte is shown in Figure 4 and is the same as that used for 8089. The data bus width is specified by the least significant bit w, with w=Q indicating an 8-bit· bus and w= 1 signifying a 16-bit bus. A 32-bit real address pointer is then fetched from memory locations FFFF FFFC through FFFF FFFF, with lower bytes of the pointer residing in lower addresses. This pointer is used as an Intermediate Block Pointer (IBP). The Intermediate Block Pointer (IBP) is incremented by two and is used to locate the Command Block Pointer (CBP). Four bytes are fetched irrespective of whether a 16-bit or 32-bit addressing option is used. The System Configuration byte (SCB) isthen fetched from location (IBP+ 6). The least significant bit, (U of the SCB) specifies 16 or 32-bit addressing option, with U=O indicating 16 bit addressing and U=1 specifying 32-bit addressing. The SCB also contains information about cluster operation. Since up to four 82730's can be connected in a cluster with their respective data interleaved in memory, cluster information is needed for the data access task. The SCB specifies Cluster Number (CL NO), which is the number of 82730's connected in a cluster and Cluster Position (CL POS) which is the position 210931-004 inter 82730 of this particular82730 within the cluster. CL NO = 0,1,2 or3 indicates a cluster containing 1,2,3 or 4 82730's respectively. Similarly, CL POS = 0, 1,2 or 3 indicates 1st, 2nd, 3rd or 4th position respect: ively. Each 82730 adds an offset equal to 2 • CLPOS to the SPTR fetched from memory and increments the pointer by 2 • (CL NO + 1). The ~ 7 0 7 SRDY programming of CL NO and CL POS is independent. No checking is done for CL POS greater than CL NO on the 82730. Note that at least one 82730, in a cluster (even if it is a cluster of one), must be assigned as cluster position zero (CL POS =0) for Virtual Display mode to work properly. 0 0 0 6 DTW16 0 0 0 0 W Data Bus Width 0 1 8-Bit 16-Bit 5 MIS 4 CL 3 POS 2 CL W SYSBUS Byte 0 U NO SCB Byte SRDY READY MODE DTW16 Display Data Mode 0 1 Asynchronous Synchronous 0 1 8-bit data 16-bit data MIS Mode CLPOS Position in Cluster 0 1 Slave Master 00 01 10 11 1st 2nd 3rd 4th CLNO. No. of 82730's In Cluster 00 01 10 11 1 2 3 4 U AD DR BUS WIDTH 0 1 16-bit 32-bit Figure 4. SYSBUS and SCB Encoding 7-152 210931-004 82730 The SCB also contains an Mis bit which specifies a master or slave mode. The MIS bit is stored int~rnally for use by the Display Generator .LDG). MIS = 1 indicates a master mode and MIS = 0 specifies a slave mode. The format for the System Configuration Byte (SCB) is shown in Figure 4. Following these actions, the BUSY flag in the Intermediate Block at address I BP is cleared and a normal Channel Attention sequence is then executed. The last two bits in the SCB are DTW16 and SRDY. DTW16 specifies whether the display data in 8 bit bus mode (W=O) is 8 or 16 bit. If a 16 bit system is specified (W=1) then DTW16 is ignored and forced internally to a "one". SRDY specifies whether the clock synchronization circuit for the READY pin is internal (SRDY=O) or external (SRDY=1). The Initialization Control Blocks in memory are illustrated in Fig. 5a. How these fit into the control structure of the 82730 is shown in Figure 5b. Channel Attention Sequence When the processor activates CA, an internal latch in 82730 is set on the falling edge of CA input and this latch is sampled by the MCU. The first CA activation after reset causes the 82730 to execute an initialization sequence. Any subsequent activation will cause the MCU to start processing the command block byfetching a channel command. If a display is in progress, the MCU will sample CA at each end of frame, otherwise it will sample CA every cycle until it is found active. When CA is found active, the MCU will fetch the command byte from "COMMAND" location in the command block execute the command and clear the BUSY flag ~pon completion. The internal CA latch is also cleared by the MCU. An invalid command code has the effect of NOP and the BUSY flag is cleared. It will also cause the Reserv"ed Channel Command (RCC) status bit to be set. o INTERMEDIATE 8 7 IBP UPPER BLOCK POINTER IBP LOWER FFFF FFFC (RESERVED)SYSBUS FFFF FFF6 15 (RESERVED) SCB INTERMEDIATE BLOCK CBP UPPER CBP LOWER (RESERVED) BUSY FFFF FFFE IBP + 6 IBP + 4 IBP + 2 IBP COMMAND BLOCK COMMAND BUSY CBP LOW SYSTEM MEMORY Figure Sa. Initialization Control Blocks 7-153 210931-004 l INITIALIZATION BLOCK ADDRESS FFFF6: I DATA STRINGS DISPLAY STRING POINTER 1 DATA ~\""'UMMAr.lU DLU ..... " I SYSTEM BUS WIDTH /----- STRING POINTER LIST § V 15 . . 8 7 6 5 0 STRING POINTER 2 ~ ....... BUSY COMMAND LIST SWITCH END OF ROW AUTO LINE FEED MAX OMA COUNT INTERMEDIATE BLOCK POINTER lOW LIST BASE 0 LOWER INTERMEDIATE B LOCK POINTER HIGH LIST BASE 0 UPPER rJ ~ LIST BASE 1 LOWER ~ DATA LIST BASE 1 UPPER COMMAND BLOCK POINTER LOWER COMMAND BLOCK POINTER HIGHER INTERMEDIATE BLOCK END OF STRING STATUS 01 CONFIGU RATION BYTE """ COMMANDBL'OCK POINTER LOW COMMANOBLIOCK POINTER HIGH Q END OF STRING ~ INTERRUPT MASK LIGHT PEN ROW DATA LIGHT PEN COLUMN CURSOR 1 ROW CURSOR 1 COLUMN CURSOR 2 ROW CURSOR 2 COLUMN (X) N ..... INTERRUPT GENERATION CODe END OF ROW END OF STRING MODE POINTER LOWER MODE POINTER UPPER STATUS ROW POINTER LOWER STATUS ROW POINTER UPPER TO MODE BLOCK ~ '@ 2$ IfiiiI IP ~ '" ~ ~ :w ~ ~ Figure 5b. Control Structure of the 82730 ~ 82730 82730 TEST FEATURES The 82730 has built in Self-Test features that provide testability at the component or at the board level. These features include the test commands and the output pin force capability and are described below. Output Pin Force Capability A capability to force logic states (high, low, high impedance) on all output pins is provided in the 82730 Text Co-Processor. This is accomplished by providing a stimulus on pins LCO-LC2 during chip reset. This feature is used for dc parametric tests on the output pins. The state of pins LCO-LC2 is monitored during chip reset. The state of these pins is latched internally on the falling edge of chip reset. If no external inputs are applied during reset, the state observed will be all 1's and no action will be taken by the 82730. If any external inputs are applied to pins LCO-2 during reset, the resulting action will depend upon the state latched on the falling edge of reset. The 82730 maintains pins LCO-LC2 in high impedance state for the duration of chip reset to avoid contention with external inputs. Also internal pull-ups ensure that a state of all 1's will be detected if no external inputs are applied. The actions corresponding to each of the observed states of pins LCO-LC2 are summarized in Fig.6a. LC2 0 State of Pins LCO-LC2 During Chip Reset LC1 X 0 0 Stand-Alone Self Test The built-in Self Test capability of the 82730 can be invoked in a stand-alone mode by applyi ng an external stimulus through pins LCO-LC2 during chip reset. This is the same mechanism as the one used for forcing logic states on output pins. Fig.6a. If pin LC2 is pulled low during chip reset, the 82730 executes a built-in self test. Upon completion of the self-test, a 16-bit signature, generated internally as the test result, is output via pins WDEF, DAT14-DATO. The completion is signalled by providing a logic "0" output on pin LC3 as a completion flag. The signature will remain on the output pins until the next chip reset. The 82730 will enter an idle state awaiting chip reset and will not respond to any external inputs until a reset signal is applied. During the process of presenting the signature onto WDEF, DAT14-DATO, the signature will also appear briefly on the AD bus in the form of a bus cycle with two 8-bit accesses to addresses, AAAAH, AAABH. However, this phenomenon is only incidental. Pins WDEF, DAT14-DATO should be used for observing the signature. The stand-alone self test includes the testing of internal address pointer registers. These registers are not tested when the self test is invoked by issuing a "Self Test" command. (See under Channel Commands below). Therefore, the signature generated during stand-alone self test will be different from that generated by the "Self Test" command. Action LCO X 0 1 0 Invoke Stand-Alone Self Test Force all Outputs to High Impedence State Force all Outputs to Logic High State Force all Outputs to Logic Low State NOP Figure 6a. Output Pin Forcing and Stand-Alone Self Test Invocation 7-155 210931-004 82730 82730 CHANNEL COMMANDS Table 3. Channel Commands COMMAND START DISPLAY 0000 0001 01 H 2 START VIRTUAL DISPLAY 0000 0010 02 H 3 STOP DISPLAY 0000 0011 03 H 4 MODE SET 0000 0100 04 H 5 LOAD CBP 0000 0101 05 H 6 LOAD INTMASK 0000 0110 06 H 7 LPEN ENABLE 0000 0111 07 H 08 H 8 READ STATUS 0000 1000 9 LD CUR POS 0000 1001 09 H 0 SELF TEST 0000 1010 OA H 1 TEST ROW BUFFER 0000 1011 DB f;i 2 NOP 0000 0000 00 H 3 (RESERVED) From: 0000 To: 1111 1100 1111 DC H FF H The system processor issues channel commands to 82730 via the Command Block. The processor first checks if the BUSY flag in the command block has been cleared. It should wait for the BUSY flag to be cleared before proceeding with the issuing of a command. When the BUSYflag is cleared, the processor places a command byte in the "COMMAND" location in command block, sets the BUSY flag to a non-zero value and asserts Channel Attention (CA), by activating the CA input to 82730. A Channel Attention should not be issued, if the BUSY flag has not been cleared. START DISPLAY 0000 OPCODE 1 0001 CMD Byte LlSTSWITCH, Auto Linefeed, Max DMA Count and Cursor Position values are fetched from the Command Block and stored internally after this command is received. The BUSY flag. is cleared and the normal display process is activated. The MCU fetches strings of data from the memory, using the parameters LlSTSWITCH, LBASEO and LBASE1. The data fetched is interpreted as data- stream commands or character data to be displayed by the Display Generator. The MCU loads the data into one of the two Row Buffers in the CRT controller, while the Display Generator displays the data from the other buffer, the buffers being swapped at the end ofthe row. Any datastream commands encountered during data fetch are immediately executed. The display process is continued until it is deactivated by a STOP DISPL.AY command or a Reset. Other channel commands can be issued while a display is in progress and they will be executed when CA is found active at one of the periodic samplings at each end of frame. The DIP (Display in Progress) status bit is set and the VDIP (Virtual Display in Progress) is cleared upon receiving a START DISPLAY command. Both bits are reset upon receiving a STOP DISPLAY command or a Reset. It is necessary to load in proper mode information through a MODESET command before activating the display. Following Reset, START DISPLAY command will not be executed, i.e., will result in a NOP until a MODESET command has been issued. 7-156 210931·004 82730 START VIRTUAL DISPLAY START VIRTUAL DISPLAY command will not activate a display and results in a NOP until a MODESET command is issued after a Reset. text coprocessor are required to remain unchanged over most of normal operation. No provision is made to prevent MODESET from changing these parameters and it is left to the designer to insure that they are not changed. The modes provide horizontal and vertical mode display parameters, interlace information, DMA burst and spacing specifications, cursor characteristics as well as attribute enables and bitselects. Typically, this would be the first command issued after initialization. The Mode Block provides all the parameters needed for a complete initialization of the 82730 for display. Thus a single Modeset command can fully initialize the chip. Note that until the first Modeset command is sent, certain functions such as VSYNC and HSYNC are not enabled. It is necessary to set up proper mode information, before activating a display. Therefore, a display activating commands should not be issued unless proper mode information has been loaded through a MODESET command. START DISPLAY and START VIRTUAL DISPLAY commands will result in a NOP if a MODESET command has not been issued since the most recent Reset. STOP DISPLAY LOAD CBP 0000 0010 CMD Byte LlSTSWITCH, Auto Linefeed, Max DMA Count and Cursor Positions are fetched from the Command Block and stored internally upon receiving this command. The BUSY flag is cleared and the Virtual Screen display process is activated. The operation of Vi rtual Screen display process is similar to that of a regular display process, except for following a different data access mechanism. The parameters LlSTSWITCH, LBASEO and LBASE1 in the command block represent ACCESS SWITCH, ACCESS BAS EO and ACCESS BASE1 respectively, in virtual screen display. The VDIP (Virtual Display in Progress) status bit is set and the DI P status bit is cleared upon receiving a START VIRTUAL DISP command: Both DIP and VDIP are reset upon receiving a STOP DISPLAY command or a Reset. 0000 0011 CMD Byte 0000 The display process is deactivated upon receiving this command. The DIP and VDIP status bit are reset and the BUSY flag is cleared. MODESET 0100 CMD Byte The address pointer"NEW CBP" contained in the command block is fetched and stored in the CBP register in the text coprocessor, replacing the old CBP. This effectively moves the command block in the memory. The Command byte from the new Command Block is fetched and the specified channel command is executed. The BUSY flag in the new Command Block is cleared upon completion. This command blanks the display. HSYNC and VSYNC are not affected. 0000 0101 CMD Byte LOAD INTMASK The Mode Pointer contained in command block location (CBP + 30) is used to access the Mode Block and the modes are fetched sequentially and loaded into the corresponding internal registers in 82730. LlSTSWITCH, Auto Linefeed, Max DMA Count and Cursor Positions are fetched from the Command Block and stored internally upon completion and the BUSY flag is cleared. The organization of mode words in the mode block and the parameters supplied by them are shown below (See Figure 10). Some of these parameters which are critical to the operation of a 0000 0110 CMD Byte The interrupt mask contained in location "INT MASK" in the command block is fetched and stored internally in the CRT controller. When a particular mask bit is set, the interrupt is disabled for a status bit inthe corresponding bit position. An interrupt is generated by the text coprocessor by activating the SINT pin, if a status bit is 1 and the corresponding bit in the interrupt mask is O. The BUSY flag is cleared upon completion. 7-157 210931-004 inter 82730 Interrupts can be enabled for the following status bits. 7 ROC: RCC: FOE: EOF: DBOR: LPU: OUR: 6 RDC 5 RCC 4 FDE 3 EOF 2 DBOR I· - 1000 CMD Byte 0000 8 VDIP 7 DIP 6 RDC 0111 CMD Byte The Light Pen detection process is enabled to search for a rising edge on the LPEN pin. The BUSY flag is then cleared. If the display process is active and a rising edge is detected on the LPEN input, the corresponding row and column position on the screen is stored internally. At the next end of frame, the LPEN position is written to locations "LPENROW" and "LPENCOL" in the command block and the LPU (Light Pen Update) status bit is set. If the display process is not active, this command has no immediate effect. However, the LPEN detection process remains enabled and will take effect if a display is activated subsequently. 1001 CMD Byte Thedisplay row and column positions of cursors 1 & 2 as set in locations "CUR1 ROW," CUR1 COL;' "CUR2 ROW" and "CUR2 COL" in the command block are loaded into internal registers in the CRT controller. Also LlSTSWITCH Auto Linefeed and Max DMA Count are loaded from the Command Block and the BUSY flag is 5 RCC LPEN ENABLE 0000 BIT STATUS WORD LD CUR POS The internal status register is written to"STATUS" location in the command block. The status register is then cleared, however DIP and VDIP status bits are not cleared. LlSTSWITCH. Auto Linefeed, Max DMA Count and Cursor Positions are fetched from the Command Block and stored internally. The BUSY flag is then cleared. STATUS WORD 15-9 a DUR Reserved Datastream Command Encountered Reserved Channel Command Executed Frame Data Error (Fetching characters past physical End of Frame) End of "n" frames (Logical end of nth frame) Data Buffer Overrun (Row Buffer filled completely without encountering END OF ROW command) Light Pen Update Data Underrun (Buffer swap initiated before finishing Row Buf loading) READ STATUS 0000 1 LPU 4 FDE 3 EOF 2 DBOR a LPU DUR cleared. This command is used to change the cursors only. Note that the cursor positions are also updated with the execution of other channel commands. The cursor characteristics for display are defi ned by the mode. During the display process, a cursor will be displayed accordingly at the position specified above. . TEST COMMANDS The test commands for the 82730 are issued in the same manner as the normal channel commands. However, the parameters used by test commands are different from those used by the channel commands in normal operation. Therefore, a Test Block which is similar in format to the Command Block is defined. Switching between Command Block and Test Block is accomplished using the "Load CBP" command. The Test Block differs only in the parameter locations associated 7-158 210931-004 82730 with the command. The locations for New CPB, command byte and busy flag are the same for both Command Block and Test Block. The "Test Result" location in Test Block corresponds to the "Status" location in Command Block. The test commands can be executed, following chip reset, only until the first Modeset command is issued. Once a Modeset command has been executed following chip reset, any subsequent test commands will not be executed and will result in a NOP. "Row Buffer Test" Command 0000 CMD Byte 0010 CMD Byte The Load Pointer in Test Block is fetched. It points to the system memory area storing the test pattern to be used for testing the on-chip RAM (i.e. - the Row Buffers). The Store Pointer, which points to memory area where the data read back from the RAM will be written, is also fetched from Test Block. Successive words are fetched from memory and written to the Row Buffer, until it is completely filled. Note that three extra words beyond the maximum Row Buffer capacity will be fetched. If N = Max Row Buffer capacity, (N+3) words will be fetched from memory. The extra words fetched will be ignored. The Row Buffer contents are then read back and are written to successive locations in memory area pointed to by the Store Pointer. The test is then repeated on the second Row Buffer. Note that the (N+4)th word in the pattern stored in memory constitutes the first word written to the second Row Buffer. The data storage for the Row Buffer test patterns is illustrated in Figure 6c. "Self Test" Command 0000 1011 A built-in Self test is performed using an internal test pattern. The signature generated during the test is written to the Test Result location (TBP+18) in the Test Block. The Busy Flag in the Test Block is then cleared. The Self Test command must be immediately preceded by a chip reset in order to ensure a consistent signature. The Test Block format for issuing the Self Test command is shown in Figure 6b. BIT 15 8 o 7 COMMAND BUSY TEST BLOCK POINTER (TBP) PARAMETER TBP+2 LOCATIONS TBP+4 NOT USED TBP+6 FOR SELF TEST TBP+8 TBP+1Q COMMAND TBP+12 NEW CBP LOWER TBP+14 NEW CBP UPPER TBP+16 TEST RESULT TBP+18 Figure 6b. Test Block Format for "Self Test" Command (For both 16-bit and 32-bit addressing modes) 7-159 210931-004 82730 Internally, the Row Buffers are 17-bits wide, while the data path is 16-bits wide. During the writing of data to Row Buffers, a complement of bit 15 is written to bit 16 of the Row Buffer in order to test all 17 bits. During the read back, two data words are stored in system memory for each location in the Row Buffer. The first word will consist of bits 0-15 read from the Row Buffer, while the second word will consist of bits 0-14 and bit 16 from the Row Buffer. Thus a total of 4*N words will be stored back in system memory as a result of the Row Buffer Test (2*N for each Row Buffer). LOAD POINTER········ A signature is generated during the test and is written to Test Result location in Test Block upon completion. The BUSY flag in the Test Block is then cleared. The Test Block format for issuing the Row Buffer Test command is illustrated in Figures 6d.1 and 6d.2. Note that the locations for Load Pointer and Store Pointer parameters are different for 16-bit and 32~bit ~ddressing modes. WORD 1 WORD2 WORD3 n WORDS TEST PATTERN FOR ROW BUFFER 1 WORD n WORD n+3 WORD n+4 WORD n+5 n WORDS TEST PATTERN FOR ROW BUFFER 2 WORD 2n+2 WORD 2n+3 n WORD 2n+6 =MAX ROW BUFFER CAPACITY Figure 6c. Data Storage for Row Buffer Test Command 7-160 210931-004 82730 BIT . 15 8 o 7 COMMAND BUSY TEST BLOCK POINTER (TBP) (RESERVED) TBP+2 LOAD POINTER LOWER TBP+4 LOAD POINTER UPPER TBP+6 STORE POINTER LOWER TBP+8 STORE POINTER UPPER TBP+10 (RESERVED) TBP+12 NEW CBP LOWER TBP+14 NEW CBP UPPER TBP+16 TEST RESULT TBP+18 Figure 6d.1 Test Block Format for "Row Buffer Test" Command (32-bit addressing mode) 15 8 BIT 0 7 BUSY COMMAND TEST BLOCK POINTER (TBP) TBP+2 (RESERVED) (RESERVED) TBP+4 LOAD POINTER TBP+6 (RESERVED) TBP+8 STORE POINTER TBP+10 (RESERVED) TBP+12 NEW CBP LOWER TBP+14 NEW CBP UPPER TBP+16 TEST RESULT TBP+18 Figure 6d.2 Test Block Format for "Row Buffer Test" Command (16-bit addressing mode) NOP 0000 0000 CMD Byte LlSTSWITCH, Auto Linefeed, Max DMA Count, and Cursor Positions are fetched from the command block and stored internally as in all other channel commands. TheBusyflag is then cleared. 7-161 210931-004 82730 82730 DATASTREAM COMMANDS Datastream Commands Datastream Commands are commands embedded in the data fetched from memory by the data access task. These commands are differentiated from character data by the command bit. The most significant bit (MSB) of each data word is designated as the command bit. If the com mand bit is "1 ", the lower 15 bits of the data word are interpreted as a datastream command, while if the command bit is "0" the lower 15 bits (or 7 bits if DTW16=0) are interpreted as character data. Datastream Command Operation During the data access task, the Micro Controller Unit (MCU) examines the command bit of each data word fetched. If the command bit is 1, it executes the datastream command specified in the data word. Otherwise, it stores the lower 15 bits of the data word in the Row Buffer as character data. This process is repeated for each data word fetched. Datastream commands can be used for changing Row Characteristics on a row by row basis, for carrying out editing functions and for formatting data into rows and frames. These commands are executed by the MCU immediately after they are encountered. As a convenience for the user, the set of all possible command codes starting with "11" in the two most significant bits has been designated as NOP commands. The user can use these command codes for any desired purpose. All other command codes which are not presently defined, are reserved for future expansion and should not be used by the user. The currently undefined codes cause the RDC (Reserved Datastream Command) status bit to be set and also generate an interrupt, if enabled. Reserved command codes should not be used. Datastream Command List Table 4. 82730 Datastream Commands COMMAND CODE OP CODE COMMAND 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 OP CODE , ENDROW EOF END OF STRING & END OF ROW FULROWDESCRPT SL SCROLL STRT SL SCROLL END TAB TO n LD MAX DMA COUNT ENDSTRG SKIP n REPEAT n SUB SUP n RPT SUB SUP n SET GEN PUR ATTRIB SET FIELD ATTRIB INIT NEXT PROCESS (Command process command) (RESERVED) NOP 7-162 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 10XX 11XX XXXX XXXX 1110 1111 PARAMETERS XXXX XXXX XXXX XXXX XXXX XXXX lin" XXX SCR LINE XXX END LINE lin" COUNT XXXX XXXX lin" lin" "n" "n" GPAOP XXXX XXXX XXXX XXXX XXXX XXXX XXXX XXX X 80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F 90-BF CO-FF 210931-004 82730 The preceding commands are recognized as valid datastream commands. The corresponding command codes are also indicated. It should be noted that the most significant bit of the command bit is always 1, in order for the word to be interpreted as command. The "Init Next Process" command can be issued only through a command process in Virtual Screen Display. It is included in this list because its operation is analogous to a datastream command in a virtual screen access environment. Also, in virtual screen display certain datastream commands are interpreted differently, depending upon whether they are encountered in a process datastream or as command process commands. When a command is ignored (becomes a NO-OP) in a virtual display, any parameters that are associated with it are also ignored. The command process command operation is discussed separately. The operation of all other datastream commands is described below. ENDROW 15 ·1 14 000 8 0000 7 xxxx xxxx a This command signifies that no more characters will be loaded in the Row Buffer for this row and an End of Row indicator is stored accordingly. When the row currently being loaded is displayed, the Display Generator (DG) will blank the screen from the end of row character position until the physical end of row. The Micro Controller Unit (MCU) stops fetching data and waits for DG to swap the Row Buffers. The data access task is resumed following the buffer swap. If a physical end of frame is reached while the MCU is waiting for a buffer swap the MCU ceases to wait and executes an EOF (End of Frame) command. In virtual display, this command is interpreted as a VEOR (Virtual End of Row) if encountered in a virtual process datastream. VEOR ENDROW command in a virtual process datastream is interpreted' as VEOR (Virtual End of Row) and it terminates a virtual row. The current LPTR is stored in the process header addressed by the "Process Addr" register. The Max Count register is also stored in the Max DMA Count location in the process header. Similarly, the Field Attribute Mask is also stored in the header. In 7-163 addition, in auto linefeed mode (ALF = 1) other parameters characterizing the process state are also saved in the header. The "Process Addr" register is loaded with the address of the header of the next process fetched from the Access table. The "Access Tab Addr" register is post-incremented by two if a 16-bit addressing option is used and by four if 32-bit addressing is used. The data access task is then resumed for the next process. EOF 15 14 000 8 0001 7 xxxx xxxx a This command (End of Frame) signifies that no more characters will be loaded in the Row Buffers for this frame. The Micro Controller Unit (MCU) stops fetching data words and waits for the physical end of frame. If a virtual display is in progress, this command is interpreted as VEOS (Virtual End of Frame), if encountered in a virtual process datastream. The Display Generator (DG) swaps the row buffers at the end of the current display row and starts displaying the row containing the EOF command. When the character preceding the EOF command is displayed, the DG blanks the screen until the physical end of frame. The MCU fetches the Status Row data then waits until its display is completed. It then performs the actions described below. If LPEN has been enabled and a rising edge on the LPEN input has been detected, the LPENROW and LPENCOL positions in the command block are updated and the LPU status bit is set. If a Channel Attention has occurred, i.e., if CA has been activated, the command byte is fetched from command block and the specified channel command is executed. If the command issued is a "Stop Display" command, the MCU will terminate the display process and wait for the next channel attention. Otherwise, the MCU resumes the data access task by reinitializing pointers for the new frame and continues to fill the Row Buffers. VEOF EOF command in a virtual process datastream is interpreted as VEOF (Virtual End of Frame). 'It provides for reinitialization of LPTR using LlSTSWITCH, LBASEO and LBASE1 for each process, analogous to the automatic reinitialization of LPTR at each end of frame in a Normal Display. 210931-004 82730 lPTR forthe current process is reinitialized using LlSTSWITCH, LBASEO and LBASE1 contained in the process h.eader. The End of Display (EOD) bit in the header is set to 1. The current process is terminated as in a VEOR and the next process in Access Table is accessed. EOl 15 1 14 000 8 0010 7 XXXX o XXXX The EOl (End of Line) command has a combined effect of NXTROW and NXTSTRG commands. All the actions performed in a END OF ROW command are carried out. In addition a END OF STRING command is executed before resuming the data access task. Thus, following the end of row, the data access is continued with the next data string. In virtual process datastream, this command has the combined effect of VEOR and END OF STRING. 15 14 13 12 Lines per row Normal Start/Stop Superscript Start/Stop Subscript Start/Stop Cursor 1 Start/Stop Cursor 2 Start/Stop Underline Line Selects FUlROWDESCRPT 15 1 14 000 o 7 8 0011 n The next "n" words fetched from memory are loaded into the Row Characteristics holding registers. "n" is specified by the lower order byte of the command word and should be between 0 and 7. The parameters loaded by this command will be used to define the row characteristics at the time the row currently being loaded is displayed. The data words defining these characteristics which follow the FULROWDESCRPT command must be ordered and organized in memory in a specifc format. The format for FULROWDESCRPT parameters is shown below in Figure 6e starting with' "Lines Per Row" as the first parameter loaded. This command will be ignored if encountered in a virtual process datastream. The MSB of all the parameters must be zero for proper operation in virtual display. Upper Byte 11 10 9 8 RVV BLK DBL W ROW ROW HGT DEF NRMSTRT SUPSTRT SUBSTRT CUR1STRT CUR2 STRT UL2 LINE SEL lower Byte 7 6 5 4 3 2 1 0 LPR NRMSTOP SUPSTOP SUBSTOP CUR1STOP CUR2STOP Ul1 LINE SEL RVV ROW, when this bit is set the CRVV pin will be inverted for the next full row. BLK ROW, when this bit is set the row will be blanked (BLANK high). DBLHGT, when the double height bit is set, all character are displayed with twice the scan lines per row. WDEF, when the width defeat bit is set, the WDEF pin is activated for the entire row. The following can be programmed from 0 to 31 yielding a range of 1 to 32 lines. LPR specifies number of lines per row. NRMSTRT, SUPSTRT, SUBSTRT specify" line numbers in a display row which mark the start of normal, superscript and subscript characters respectively. NRMSTOP, SUPSTOP, SUBSTOP specify line numbers in a row where normal, super script and subscript characters .end respectively. CUR1 STRT, CUR2 STRT specify the starting line numbers in a row for cursor 1 and cursor 2 respectively. ULlNE1 SEL, ULlNE2 SEL specify the line numbers in a row where underline 2 will appear respectively. All FULROWDESCRPT parameters affect the row in which they are programmed and stay in effect until changed by another FULROWDESCRPT command. Figure 6e. Format for FULROWDESCRPT 7-164 210931-004 82730 SL SCROLL STRT 15 14 000 8 7 5 xxx 0100 4 displayed, the screen is blanked until the RCLK count specified by the command ("n") is reached. After reaching the specified count, display is resumed by displaying the character following the TAB command. 0 SCR LINE The Slow Scan register in 82C3 is loaded with the scroll line specified by the five least significant bits of the command word. When the row currently being loaded is displayed, the line countfor that row will start with the value specified by the Slow Scan register. A "Margin" (MGN) parameter, loaded by MODESET, specifies the number of blank lines plus one to be added at the top of the slow scroll field on the screen. This ensures the availability of sufficient DMA time for fetching the next row, when only a small number of scan lines are displayed in the top row of slow scroll window. This command is used for starting a slow scroll. (Note: MGN = 0 results in no margin buffer lines) This command will be ignored if encountered in a virtual process datastream or if a SL SCROLL END command is encountered later on the same row. SL SCROLL END 15 14 000 8 0101 7 5 xxx 4 0 END LINE The scroll location in row characteristics holding registers is loaded with the number of lines specified by the five least significant bits of the command word. This number specifies the number of lines to be displayed when the row currently being loaded is displayed. This is used instead of the regular LPR (Lines Per Row) characteristics, for this particular row. This command is used in the last row of a slow scroll for termi nating a slow scroll. The Margin (MGN) parameter, loaded by MODESET, is used in the same way as in slow scroll start except that the specified number of blank lines are inserted at the bottom of the slow' scroll in this case. This command will be ignored if encountered in a virtual process datastream or if followed by a SL SCROLL STRT on the same row. TAB TO n 15 14 000 If the RCLK count specified by the Tab command has already occurred before beginning the blanking for Tab, the display will be blanked until the end of the row. This command is ignored, if encountered in a virtual display process datastream. LD MAX DMA COUNT 15 14 000 8 0111 o 7 MAX COUNT The Max Count register in 82730 is loaded with the Max DMA Count specified by the lower byte of the command word. The DMA Counter is also reinitialized with the Max Count value in the Command Block after all channel commands. MAX DMA Count is programmable in the range of 1 to 256 (MAX COUNT value 0 equals 256). However, counts greater than the row buffer capacity will cause row buffer overruns if the data strings depend on MAX DMA to terminate the fetching. The DMA counter is decremented for each data word as the Row Buffer is being loaded. Datastream~commands and words supplying parameters for datastream commands as in FULROWDESCRPT, are not counted. Superscript/Subscript characters are counted in pairs, i.e., a pair of characters causes only one count. In virtual screen display, every time a new process is accessed, the DMA counter is initialized with the Max DM.A Count contained in the process header. This value is also stored in a Max Counter register. At virtual end of row (VEOR) the Max Count register is written to the process header. The "LD Max DMA Count" command is ignored if encountered in a virtual process datastream. ENDSTRG 8 0110 o 7 15 1 "n" The lower byte of the command word specifies the column (RCLK count) after SYNCSTRT at which a Tab should occur. At display time, after the character preceding the Tab command is 7-165 14 000 8 1000 7 XXXX o XXXX The SPTR register in the 82730 is loaded with a new String Pointer (SPTR) value fetched from the memory location indexed by the List Pointer (LPTR), which is stored in the LPTR register. The 210931-004 82730 LPTR register is incremented by two if a 16-bit addressing option is used and by four if 32-blt addressing is used. When more than one 82730 Is connected in a cluster, each of them adds an offset, determined by its position in the cluster, to the pointer fetched from memory, before storing it in its SPTR register. This command directs the data access tothe next data string in the list of strings indexed by LPTR. The operation of this command is identical for a Virtual or Normal Display. In virtual display, the next data string within the current display process is accessed. SKIPn 15 14 000 8 o 7 to 255. If n equal to 0 is specified no repetitions will occur, and the word following the Repeat n command will be ignored. This character will eventually be displayed n times. The DMA counter is also made to count n times. In non-auto linefeed mode (ALF= 0), reaching Max DMA Count before the n repetitions are completed will result in a termination of the Repeat n command. This command will also be terminated if the Row Buffer gets filled completely before the n repetitions are completed. It should be noted that the data word immediately following the Repeat n command is treated .as character data, irrespective of the value of its command bit. n 1001 SUP/SUB n The next "n" data words fetched from memory are ignored. "n" is specified by the lower byte of the command word and is programmable from 0 to 255. If n equal to 0 is specified, no words are skipped. Any datastream commands encountered in the data fetch are not counted towards these n words. Also parameters following the datastream command as in FUlROWDESCRPTare not counted. All embedded datastream commands are executed with the following exceptions. If a Tab To N data stream command is encountered during the execution of a Skip N command, the Tab command will result in a Nap, i.e. a Tab embedded in the data to be skipped will be ignored. If an EOl (End Of Line) data stream command is encountered during the execution of a Skip N command, it will be executed with the following effect. In non-auto line feed mode, (AlF = 0) the EOl command has the combined effect of End Of Rowand End Of String commands. In auto line feed mode, (AlF = 1) the EOl command has the effect of an End Of String command only. If the data words skipped include any superscriptsubscript characters, they are skipped in pairs and a pair of characters is counted as only one count in "n". If another skip command is encountered its value of "n" is added to the present skip count and skipping continues. REPEAT n 15 14 000 8 1010 o 7 n The next data word (byte, if DTW16=0) fetched from memory is stored in the Row Buffer "n" times, where "n" is specified by the lower byte of the command word. "n" is programmable from 0 7-166 15 14 000 8 o 7 n 1011 The next "n" pairs of data words (bytes, if DTW16 = 0) fetched from memory are treated as superscripts or subscript characters. "n" is specified by the lower byte of the command word. These n pairs are assumed to be ordered with the superscript preceding the subscript. No datastream commands are permitted in the 2n words following this command. Allofthese words are interpreted as superscript-subscript pairs. The DMA counter is made to count only once for each pair of characters .. In non-auto linefeed mode (AlF=O), reaching the Max DMA Count will result in a termination of this command. If n equal to zero is specified, no action will result. RPT SUB/SUP n 15 14 000 8 1100 o 7 n The operation of this command is similar to that of the "Repeat n" com mand except that the pai r of characters following the "RPT SUB/SUP n" command is repeated n times. "n" is specified by the lower byte of the command word and is programmable from 0 to 255. If n equal to zero is specified, no repetitions will occur, ·and the two data words following the "RPT Sub/Sup n" command will be ignored. The two data words (bytes, if DTW16=0) immediately following the command word are interpreted as a superscript-subscript pair and are repeated. The DMA counter is made to count only once for each repetition of the Pllir. In non-auto linefeed mode (ALF=O), reaching Max DMA Count prior to completion of n repetitions will cause a termination of this command. ORDER NUMBER: 210931-004 inter 82730 SET GEN PUR ATTRIB 15 14 000 Datastream Command Conventions o 7 8 1101 The reaching of Max DMA Count, encountering of terminating commands such as ENDROW, EOF, etc. and occurrences of these while executing a "skip n" command give rise to various possible combinations of events. The behaviour of 82730 under these circumstances is described below: GPAOPERAND This command provides control over the output pins assigned to General Purpose Attributes, GPA1 through GPA4. 7 6 5 GPA GPA4 GPA4 GPA3 OPERAND DATA EN DATA ENCODING GPAx DATA 4 3 2 GPA3 EN GPA2 DATA GPA2 EN FUNCTION ROW BUFFER DATA ROW BUFFER DATA GPA DATA 0 GPA DATA = 1 EN 0 0 1 1 The GPA in the Process Header is updated each time a SET GPA command is executed. Thus the GPA state in the header is updated to reflect any changes caused by the "Set Gen Pur Attrib" command. The GPA command occupies a character space on the screen. Consequently, a GPA command is counted as a character towards MAX DMA count. However, a GPA command nested in a Skip N or a TAB to N command is skipped, i.e., it has no effect. i) When Max DMA Count is reached, it has the effect of a VEOR command if a Virtual Display is in progress or a ENDROW command if a Normal Display is in progress. It also causes an automatic end of string i.e., the effect of a NXTSTRG command in non-auto linefeed mode (ALF = 0). .'i) In non-auto linefeed mode, "Repeat n", "Sub/Sup n" and Rpt Sub/Sup n" commands are terminated upon reaching a max DMA count, even if "n" is not reached. iii) "Skip n" command is terminated if EOF command is encountered. It is also terminated upon encountering a ENDROW command in non-auto linefeed mode (ALF = 0). iv) "Repeat n" "Sub/Sup n" and "RPT Sub/ Sup n" commands can be nested within a "Skip n" command. If superscript-subscript characters are skipped, each pair of characters counts as one skipped character. If the above commands are encountered during a "skip n" and if the specified count (n) in these commands is not reached by the end of execution of the "skip n" command, the execution of the nested command is continued beyond the termination of "skip n" command until the remaining portion of the count specified in the nested com mand is completed. The encoding of the operand, specifying GPA operation, is sholNn below. SET FIELD ATTRIB 14 000 o 8 1110 7 XXXX o XXXX FIELD ATTRIBUTE MASK The word following this command is fetched. This word is used as a Field Attribute Mask in storing all subsequent display data words in row buffer. The bits in the data words fetched from memory corresponding to the bit positions containing a "1" in Field Attribute Mask are all set to 1 before storing the data word in row buffer. The Field Attribute Mask is used on all display data words fetched from memory. The mask register will contain all O's upon reset and is cleared at the beginning of each frame. NOP 15 1 14 1XX 8 XXXX 7 XXXX GPA1 EN GPAx 0 1 0 1 15 0 GPA1 DATA 0 XXXX --------------------------- No action is taken. The data access task is resumed by fetching the next data word. 7-167 ORDER NUMBER: 210931-004 inter 82730 VIRTUAL SCREEN MODE Command Process Commands In Virtual Screen Display, 82730 accesses display processes and command processes through the Access table. The command processes enable the 1/0 Driver process to direct 82730 to execute certain data stream commands by inserting an appropriate command process address in the Access table. This capability enables the preservation of uniformity and consistency of operation between normal and virtual environments, by assigning different interpretations to the command according to the access environment. It is especially useful for termination and initialization commands. The operation of command process commands is ~nalogous to that of data stream commands except for a different access environment. Command Process Command List The commands allowed in command processes can be divided into two subsets. The first subset consists of commands that can be issued only through a command process, while the second one consists of normal datastream commands that can also be issued through a command process. The command code for a datastream command issued through a command process is the same as that for the normal datastream command embedded in the data. However, certain datastream commands are interpreted dif(erently when they are issued through a command process as opposed to embedding in the datastream of a virtual display process. The most significant bit (MSB) of the command word must be a "1". In the datastream, this bit distinguishes acommand word from character data. In the process environment, this bit distinguishes a command process from a display process. The commands permitted in command processes are listed below. No other com mands will be recognized if encountered in a command process and will result in a NOP. All undefined command codes apart from those designated as NOP are reserved and should not be used. Encountering an illegal command code causes the RDC (Reserved Datastream Command) status bit to be set and will generate an interrupt, if enabled. Table 5. Command Process Command List' COMMAND INTERPRETATION IN VIRTUAL PROCESS DATASTREAM COMMAND CODE OP CODE OP CODE PARAMETERS Command Process Only Command: NOP 1 INIT NEXT PROCESS 1000 1111 XXXX XXXX 8F Command Process or Datastream Commands: 2 ENDROW VEOR 3 EOF VEOR 4 EOL VEOR + NXTSTRG 5 FULROWDESCRPT NOP 6 SL SCROLL STRT NOP 7 SL SCROLL END NOP 8 TAB TO n NOP 9 LD MAX DMA COUNT NOP 10 (RESERVED) RESERVED 11 NOP NOP 1000 1000 1000 1000 1000 1000 1000 1000 10XX 11XX 1000 0001 0010 0011 0100 0101 0110 0111 XXXX XXXX XXXX XXXX XXXX XXX X XXXX XXXX 80 81 82 83 84 85 86 87 90-BF CO-FF "n" "SCR LINE" "END LINE" "n" "COUNT" XXXX XXXX XXXX XXXX XXX XXX 210931-004 7-168 82730 INIT NEXT PROCESS 15 1 14 000 8 o 7 1111 XXXX XXXX This command can be used only in a command process to initiate a virtual display "window". Upon receiving this command, the command process is terminated and the next process in Access Table is accessed by fetching the new process address. However, the LPTR register is 15 0 14 ---- 1 1 RPT SIS 1 SIS l' The process header format is shown in Figure 7. Also the End of Display Bit (EOD) in the header is reset. The data access task for a virtual display is then resumed, with this value of LPTR. LOCATION PROCESS ADDR PROC ADDR + 2 MAX DMA COUNT PROC ADDR + 4 LBASEO LOWER PROC ADDR + 6 PROe ADDR + 8 LBASEO UPPER LBASE 1 LOWER PROC ADDR + 10 LBASE1 UPPER PROe ADDR + 12 GPA PROe ADDR + 14 FIELD ATTRIBUTE MASK PROC ADDR + 16 PROC ADDR + 18 LPTR LOWER LPTR UPPER PROC AD DR + 20 SPTR LOWER PROC AD DR + 22 SPTR UPPER PROC ADDR + 24 8 ---------- LS: LlSTSWITCH ALF: AUTO LINE FEED SAVE AREA 13 not directly loaded from the LPTR location in the process header. Instead, LlSTSWITCH in the process header is examined and LPTR is initialized with the value LBASE 0 or LBASE 1 depending upon whether LlSTSWITCH is 0 or 1 respectively. Both LBASEO and LBASE1 are contained in the header. RPT 7 6 EOD LSALF 0 ---- -- REPT COUNT REPT CHAR REPT CHAR 2 15 14 8 7 PROC ADDR + 26 PROC ADDR + 28 PROC ADDR + 30 o COMMAND PROCESS ADDR C/D Figure 7. Process Header for Display and Command Process 7-169 210931-004 82730 ENDROW 15 14 000 TAB TO n 8 0000 a 7 XXXX 15 XXXX The actions performed by a ENDROW datastream command in a Normal Display are carried out. The next process in Access Table is accessed and the data access task is resumed, after the next Row Buffer swap 14 000 15 1 EOl 14 000 a 7 XXXX 8 0010 XXXX This command is identical to ENDROW command in Virtual Display in Command Process environment. ENDSTRG, which is strictly a data operation within a display process is meaningless in the command process environment. FULROWDESCRPT 15 14 000 8 0111 a 7 MAX COUNT The Max Count register on 82730 is loaded with the value specified by the lower byte of the command word. The DMA counter is also initialized with this Max Count Value. The next process in the Access Table is accessed. However, the Max DMA Count value in the process header is not used for initializing the DMA counter. Instead, the DMA counter as initialized by the LD Max DMA Count command is used for this process. The virtual display data access task is then resumed normally. When the process is terminated, the new Max Count value is written to the process header. Thus the Max Count value in the header is updated as a result of this command. NOP a 7 8 0011 14 000. XXXX The actions performed by an EOF (End of Frame) data stream command in a Normal Display are carried out. 15 "n" LD MAX DMA COUNT a 7 XXXX 8 0001 a 7 8 0110 The effect of this command process command is identical to that of the TAB TO n datastream command. The TAB can be used to establish the left edge of a virtual display "window". 'EOF 15 14 000 15 "n" 14 1XX 8 XXXX 7 XXXX a XXXX The actions performed by the FULROWDESCRPT datastream command are carried out. The data access task is resumed by accessing the next process in the Access Table. No action is taken. Data access task is resumed by fetching the next process address from Access Table. SL SCROLL STRT ERROR AND STATUS HANDLING 15 1 14 000 8 0100 7 xxx 5 4 a Error Conditions "SCR LINE" The same actions as the SL SCROLL STRT datastream command. The data access is resumed with the next process in Access Table. SL SCROLL END 15 14 000 8 0101 7 xxx 5 4 a "END LINE" The actions performed by a SL SCROLL END datastream command, in a Normal display, are carried out. The data access task is resumed with the next process in Access Table. Since the MCU and DG function asynchronously with respect to each other, different relative timings in MCU and DG operation are possible, some of which result in error conditions. The lack of appropriate termination commands for row or frame data in the datastream also gives rise to certain error conditions. These types of situations occurring in display process operation are described. below. In normal operation, DG initiates a buffer swap at the physical end of a display row. If the MCU has not finished loading its row buffer by that time, a "Data Underrun" occurs. This results in 7-170 ~10931-004 82730 blanking of the screen until physical end of frame by DG and execution of an EOF (End of Frame) command by MCU. Data underrun also occurs when the first row of the frame has not finished loading by the start of the character field. The entire frame will be blanked in this case. Virtual Display In Progress Display I n Progress Reserved Channel Command Reserved Datastream Command Frame Data Error VDIP: DIP: RCC: RDC: FDE: OUR: If a physical end of frame is reached prior to encountering an EOF datastream command, a "Frame Data Error" occurs, which results in the execution of an EOF command by MCU. (Note that this does not disrupt the visible display action, and may not constitute an error for certain data structures. The error indication is included as a flag where knowledge of this condition is desired.) Similarly, when the MCU fills up a row buffer completely, without encountering a ENDROW command, the "Data Buffer Overrun" flag is set. All of the above conditions result in the setting of an appropriate status bit and generation of an interrupt if the corresponding interrupt has been enabled. 15 9 (RESERVED) 8 VDIP 7 DIP 6 ROC 5 RCC Data Under Run This status bit is set by Display Generator if the Microcontroller Unit (MCU) has not finished loading its Row Buffer when the DG initiates a buffer swap at the physical end of a display row. This condition is defined as data underrun and causes the MCU to execute an EOF command and the DG to blank the screen until the physical end of frame. LPU: Light Pen Update This status bit is set by the MCU after updating the LPENROWand LPENCOL locations in command block. The detection of LPEN input is enabled by the LPEN ENABLE channel com- 4 FOE 3 EOF o 2 DBOR LPU OUR Status and Interrupt Handling A status word is maintained in an internal register by 82730 and it is written to the "STATUS" location in command block when the "Read Status" channel command is executed. The processor can th us read status information by issuing this command. the processor can also enable interrupts for certain status bits by specifying an interrupt mask which is loaded in 82730 as a result of a "Load Int Mask" channel command. This establishes a communication mechanism between 82730 and the processor for error and status reporting. Status Word The format for the status word is shown below. The function of each of the status bits is described below. The status bits get set under the conditions described above. I nterrupts can be enabled for all status bits except DIP and VDIP bits. The interrupt status bits are cleared at the beginning of each new display field. DIP and VDIP bits are cleared only after receiving a "STOP DISPLAY" command or a Reset. EOF: DBOR: LPU: DUR: End of Frame End of Row Light Pen Update Data Under Run mand. The detection of a rising edge on the LPEN input causes the current row and column position to be stored internally. The MCU updates the LPEN ROWand LPEN COL locations in command block at the next end of frame and sets the LPU status bit. Further updates of these command block locations are inhibited until another LPEN ENABLE command is issued. DBOR: Data Buffer Over Run This status bit is set when the MCU tries to fill a row buffer beyond its capacity. The MCU will stop fetch i ngcharacters after this point and the display is blanked following the completion of the row currently being displayed. All status bits are cleared by a Reset. 7-171 210931-004 82730 EOF: Interrupt Processing End of Frame This bit is set by the DG at the physical end of the nth frame, where 'n' is specified by the MODESET parameter FRAME INTERRUPT COUNT. This provides the means for timing frame related events such as slow scrolls. FDE: Frame Data Error This status bit is set by the DG at the physical end of frame if no EOS datastream command has been encountered until then. This also results in the execution of the EOS command by the MCU. RCC: Reserved Channel Command This bit is set by the MCU upon encountering an illegal datastream or command process command. This can be used to trap software errors during program development. RDC: Reserved Datastream Command This bit is set by the MCU upon encountering an illegal datastream or command process command. This can be used to trap software errors during program development. DIP: Display In Progress This bit is set by the MCU immediately after receiving a "Start Display" channel command. It remains set as long as the display process is active and is reset upon receiving a "Start Virtual Display" or "Stop Display" command or a Reset. Interrupts cannot be enabled for this status bit. VDIP: Virtual Display In Progress This bit is set by the MCU immediately after receiving a "Start Virtual Display" channel command and is reset upon receiving a "Start Display" or "Stop Display" command or a Reset. This bit remains active as long as the virtual display process is active. Interrupts cannot be enabled for this status bit. The system processor can enable interrupts on any of the status bits, with the exception of DI P and VDIP bits, by specifying an interrupt mask. A "1" in a bit position in the interrupt mask disables (masks out) interrupts on the status bit located in the corresponding bit position in the status word. The format for Interrupt Mask is shown below. The Int Mask can be loaded into 82730 from the INTMASK location in command block by a "Load Int Mask" channel command. If the interrupt is enabled for a particular status bit by programming a "0" in the corresponding bit position in I NTMASK and if the status bit gets set during the course of the display, an interrupt will be generated by 82730 at the next end of frame. At the end of frame, the 82730 will first perform the tasks of updating LPEN position (if required) and servicing the Channel Attention (if CA was activated). Then the status word in the internal register will be written to the INT GENERATION CODE location in the Command Block and the SINT output will be activated. The SINT pin is not deactivated until an interrupt reset signal is received at the I RST pin. 82730 continues to perform its normal display task after activating the SINT pin. If no interrupt reset is received until the next end of frame then any new interrupts that might have been generated at that end of frame will be lost. Therefore, it is essential for the system processor to issue an interrupt reset within a frame time after an interrupt is generated. When the display is not activated, the only interrupt that can occur is the Reserved Channel Command interrupt. Upon receiving an invalid channel command, 82730 will write the status word to I NT Generation Code location in the Command Bl.ock and activate SINT output, if that interrupt is enabled. The processor can use the interrupt capability to get status information from 82730. A possible interrupt service routine for the system processor is shown in flow chart form in Figure 9. 7-172 210931-004 inter 15 82730 7 6 4 3 2 FOE EOF DBOR LPU (RESERVED) INT INT INT INT MASK MASK MASK MASK INT MASK = 0 Enables the corresponding interrupt. INT MASK = 1 Masks or disables the corresponding interrupt. ROC INT MASK 5 RCC INT MASK 0 OUR INT MASK Figure 8. Interrupt Mask INTERRUPT READ STATUS FROM "INT GENERATION CODE" LOCATION IN CMD BLOCK PERFORM APPROPRIATE SERVICE TASKS ISSUE INT RESET (IRST) SIGNAL TO 82730 END Figure 9. Interrupt Service Routine For System Processor 7-173 210931-004 82730 82730 VIDEO INTERFACE The Mode Pointer in the Command Block points to a parameter block containing the Mode information required for the display. The organization of the mode words in the Mode Block is shown below. n ,".M M.", . ., " " ~ COMM"" ...." 15 DMA 14 13 - 12 11 10 9 7 8 6 - BLINK CONTROL LOCATION MPTR MPTR =2 HFLDSTP MPTR=4 HBRDSTP MPTR=6 - - - - - - - - - - - - SUPSTRT SUBSTRT CUR1STRT CUR2STRT - U2 LINESEL - - - - - - - - - - - - - - - - - - - - - NRMSTRT VERTICAL MODES 0 HFLDSTRT - (FULROWDESCRPn 1 HBRDSTRT - - - - - - - - - - - - - - - ROW RW BLK,I DBL I W ROW HGT DEF - 2 HSYNCSTP - CHAR ROW CHARACTERISTICS 3 BURST SPACE - LINE LENGTH HORIZONTAL MODES 4 5 -I BURST LENGTH MPTR=8 SCROLL MARGIN LPR MPTR= 10 NRMSTP MPTR= 12 SUPSTP MPTR = 14 SUBSTP MPTR = 16 CUR1STP MPTR = 18 CUR2STP MPTR= 20 U1 LINE SEL MPTR= 22 FIELD ATTRIBUTE MASK MPTR= 24 - FRAME LENGTH MPTR =26 - VSYNCSTP MPTR=28 VFLDSTRT MPTR= 30 VFLDSTP MPTR=32 - (RESERVED) MPTR =34 (RESERVED) MPTR= 36 - DUTYCYC CURSOR BLINK - DUTYCYC CHAR BLINK REVERSE VIDEO BLINKING CHAR ABS LINE COUNT INVISIBLE CHAR ATTRIBUTE BIT SELECTS - - - - FRAME INT COUNT - - - UNDERLINE 2 MPTR=36 CR2 BE CR1 MPTR =40 BE CR2 CR1 CR2 RW RW OE CR1 MPTR=42 OE BUE CR2 ILEJRFEJ B POL CD CR1 CD UNDERLINE 1 MPTR=44 Figure 10. Mode Block Organization 210931-004 7-174 82730 CAM ARRAYS Three Content Addressable Memory arrays are used for generating ti ming parameters to control the video display: the HORIZ MODE CAM, the VERT MODE CAM andthe CHAR ROW CAM. The user has the flexibility to define his own timing parameters by loading them into the CAM arrays via the M I U. All of these parameters can be modified at the end of every frame. All the parameters in the CHAR ROW CAM, except MARGIN, are changeable on a row by row basis. Each of the three CAM arrays is described separately below: Timing Sources RCLK and CCLK inputs are provided by the external video logic to the 82730. The RCLK is used to increment the HORIZ COL CNTR and hence generates all horizontal timing parameters. CCLK is used to clock the character and attribute data output from the 82730 to the external display dot logic. Data changes on the positive going edge of RCLK or CCLK. After reset of the 82730, the CAM arrays are in undetermined states. The CAM arrays are set upon the execution by the MIU of the MODESET command. The HORIZ and VERT MODE CAM contents are especially critical since they are used to generate timing control signals to the external video logic. Without the generation of the timing signals, no display process can take place. Hence, START DISPLAY command cannot be executed before the first MODESET command after the device reset. The START DISPLAY command will be ignored if it precedes the MODESET command. The row buffers also contain unknown information after power up and reset. In executing the START DISPLAY command, the MIU would first load the two row buffers with the first two rows of character data to be displayed. Upon completion of loading of both buffers, it will signal the DG to begin the display process. In this way, only ~alid character data will be output to the external video logic. Initialization Timing Parameters Upon activation of the RESET input, the 82730 display generator will stop all operations in progress and deactivate all outputs. It will stay in this quiscent state until the MI U executes the MODESET command. The following table shows the states of all the Display Generator outputs during and after RESET. Pin Name DATO-14 WDEF LCO-4 BLANK CSYNC CHOLD HSYNC VSYNC CRVV RRVV Condition Low Low High Low High High Low Low Low Low The timing parameters read from the MODESET Block and stored in the VERT MODE GAM and HORIZ MODE CAM are used to control the video display and they can be best illustrated in· the Map of Timing Parameters shown below. All of these timings have to be defined after power up and reset and can be changed on a frame by frame basis during display. 7-175 210931-004 82730 ~ ~ 1' ~ "~ r--.L----------------L-L--+-IHSYNCSTRTI BORDER \ '/'''---'-'''\1- - - - - , - - - - = : : : - - - - - - - - , / AI; ..-/ HBRDSTRT BO'OEA ' l/ ~ ~ ~~ n' !;~ !!:+.. BORDER HBROSTP ' - -_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _.J.-.LINELEN Figure 11. Timing Parameters Row Timing Parameters (e) HBDRSTP - Horizontal Border Stop. The RCLK count on a scan line where the border ends. The border terminates at the leading edge of the programmed RCLK period. (f) HFLDSTRT - Horizontal Field Start. The RCLK count on a scan line where the character display field begins. If the row buffer is ready to be displayed, the CSYN pin will be deactivated at this point. This field begins at the leading edge of the programmed RCLK period. (g) HFLDSTP - Horizontal Field Stop. The RCLK count on a line where the character display field stops. When this timing point is reached, CSYN will be activated. This field ends at the leading edge of the programmed RCLK period. The row timing parameters are stored in HORIZ MODE CAM and are programmable from 0 to 255 RCLK times. These parameters are: (a) HSYNCSTRT - Horizontal Sync Start. The RCLK count on each scan line where HSYNC pin is activated. This parameter is not programmable. The RCLK period that follows the rising HSYNC edge is defined as column zero. It is used as the reference for all other horizontal timing parameters. (b) HSYNCSTP - Horizontal Sync Stop. The RCLK count on each scan line where the HSYNC pin is deactivated. The falling edge of HSYNC occurs at the leading edge of the programmed RCLK period. (c) LlNELEN - Line Length. This parameter defines the total number of RCLK's in each scan line including display time, border and horizontal retrace time. There are LlNELEN + 1 RCLK periods per horizontal line scan. (d) HBDRSTRT - Horizontal border start. The RCLK count on a scan line where the border begins. The border begins at the leading edge of the programmed RCLK period. 7-176 There is also one pseudo parameter, SYNCDLY. It is fixed at one half LlNELEN and is used as the start and end timing for VSYNC in odd frames in interlaced displays. VSYNC starts at HSYNCSTRT in even frames for interlaced displays and all frames for non-interlaced displays. 210931-004 82730 There are certain restrictions in the programming of HFLDSTRT and HFLDSTP and those restrictions are best illustrated below. There has to be at least 4 RCLKS in between HFLDSTRT and HFLDSTP of the same scan line and 15 RCLKS in between HFLDSTP of one line and HFLDSTRT of Ii: c ....I La.. J: -- I- a: 11. I- l- m the next. The minimum delay of 15 RCLKS is for the charging of the pipeline from the row buffer to the character data output DATO-DAT14 as well as the setting of the correct value for the scan line output LCO-LC4. m 4 c RCLKS MIN ....I La.. J: I~ 11. I- l- 15 RCLKS MIN ~I· m m c C ....I ....I J: J: La.. La.. ~I I J. I. LINE 1 J LINE 2 Figure 12. Horizontal Timing Restrictions Frame Timing Parameters Frame timing parameters are stored in the VERT MODE CAM and are programmable from 0-2047 scan lines. These parameters are: (a) VSYNCSTRT - Vertical Sync Start. The line count where the VSYNC is activated. This occurs at the end of a field automatically. This parameter is not programmable. The rising edge of VSYNC occurs with the rising edge of HSYNC for all non-interlace fields and for odd fields in the interlace mode. (b) VSYNCSTP - Vertical Sync Stop. The line count at which the VSYNC pin is normally deactivated. VSYNC changes at the rising edge of HSYNC normally. However it occurs at SYNCDLY at the beginning of odd fields of an interlaced display. (c) FRAMELEN - Frame Length. This parameter defines the total number of scan lines per frame. It is used to reset the FRAME LINE CNTR. In an interlaced display, FRAMELEN must be an even number. If an odd number is programmed, one additional line will occur automatically. 7-177 There will be FRAMELEN + 1 scan lines per frame. (Note that interlace mode contains two fields per frame). (d) VFLDSTRT - Vertical Field Start. Programs the scan line count where the character display field begins. (e) VFLDSTP - Vertical Field Stop. Programs the scan line count where the regular character display field ends. VFLDSTP times the beginning of the Status .Row. The chan nel attention seq uences, i nterru pt handling, row buffer swap and intialization for the next frame are started after the display of the Status Row is completed. See * below. (Character Field Boundrydefinition: The starting or ending event is defined to occur at HFLDSTP on the scan line following the programmed value. Thus the visible character field effectively begins two scan lines below the programmed start value and ends one scan line below the programmed stop value.) 210931-004 82730 Status Row The Vertical Frame Timing Parameters have no border controls, unlike the Horizontal Row Timing Parameters. The top and bottom borders can be replaced with regular display rows that are videoreversed and contain no data. The top border is easily timed from VFLDSTRT. The bottom border is more difficult without help from the Vertical Timing generators. If there were no help, the user would have to keep track of the number of scan lines used in each row to know when to stop regular display and create the bottom border. This would also preclude his ending his regular display with an EOF command before the border. The 82730 provides this help with the Status Row feature. The display of the Status row is timed from VFLDSTP and allows the user to display a row in a fixed position at the bottom of the screen that is independent of the regular data and any display errors (display ended by an EOF command or the DURN, DBOR, or FDE errors). (There is one dependency on the regular display data: the row format. The last FULROWDESCRPT (FRD) set in the regular data will be used on the Status Row unless a new command is issued for the row. It is recommended that the user include a new FRD command in the Status Row data to eliminate this dependency). Status Rowdisplay starts SCROLL MARGIN plus one scan line after VFLDSTP. This margin is provided to insure enough DMA time if the regular display runs up to VFLDSTP. The user can create a bottom border or any end-of-display row that he chooses. A display status or system status line, or special programmable key function definition line can be implemented with this feature. CHARACTER ATTRIBUTES The 15 bits of the character word can be partitioned into character address and attribute bits. Some common attributes may be individu'ally defined and enabled or disabled by fields in the attribute parameter registers. Each attribute has two means of being enabled. The enable bits defined below are set during the MODESET channel command and are used as a global enable. The user does not have to enable the provided attributes. He may free more data bits for his own use this way. The second enable bit is contained in each character loaded to the row buffer to enable the attribute ona character by character basis. They are individually described in detail in the following sections. 7-178 Reverse Video When a character with the reverse video attribute is displayed, the CRVV pin will be inverted during the time the character is being displayed. The reverse video affects the entire height of the row forthat character space. For superscript/subscript pairs, the reverse video effect is controlled by superscript until SUBSTRT when the subscript attribute bit takes control. The parameter for this attribute is: RVBS - Reverse Video Bit Select. This parameter selects one of the 15 bits of a character data word. Values 0 through 14 select the corresponding bit. Value 15 disables the Reverse Video attribute. Blinking Character When a character with the blinking character attribute is displayed, the BLANK pin will be activated and deactivated during the character display time according to programmable rate and duty cycle. The parameters for this attribute are: (a) BCBS - Blinking Character Bit Select. Selects one of the 15 bits of a character data word as the blinking character attribute control. As with Reverse Video above, the value of the select determines the controlling bit or disables the attribute. (b) CHAR BLNK FREQ - Selects one of the 32 blinking frequencies available for the blinking character and blinking underline. The character blink rate is calculated as below: Frame Refresh Rate Blink Rate = 4 x CHAR BLNK FREQ (c) CHAR DUTY CYCLE - A 2-bit register to select 4 duty cycles available for blinking character and blinking underline. The selection logic is defined to be as follows: 00=100% always on 11= 75% on 10= 50% on 01= 25% on Underline #1 When a character with underline is displayed, the BLANK Pin will be activated and the CRVV pin will be inverted during the time the scan line specified 210931-004 82730 by the underline select register is displayed. The parameters used to define underline #1 are: (a) ULS1 - Underline Line Select 1. It determines which scan line of a character row will be used for the underline #1. This parameter is modifiable on a row by row basis by the FULROWDESCRPT command. (b) ULBS1 - Underline Bit Select 1. This parameter can only be changed by MODESET. It selects one of the 15 bits of a character data word as the underline #1 attribute control. Again, a value of 15 in the select field disables this attribute. Underline #2 (Blinking) Underline #2 can be made to blink. When its blinking feature is deactivated, its visual effect is exactly the same as underline #1. When it is enabled to blink, its blink rate and blinking duty cycle are the same as those defined for blinking character. The parameters used to define this attribute are: (a) UL2SEL - Underline Line Select 2. This parameter determines which scan line of a character will be the 2nd underline. It is changeable on a row by row basis by the FULROWDESCRPT command. The next two parameters can only be modified by the MODESET Command. (b) (c) ULBS2 - Underline Bit Select 2. Selects one of the 15 bits of a character data word or GPA 1 as the second underline attribute control. A bit select value of 15 disables the second underline. BUE- Blinking Underline Enable. Activation of this bit will cause the second underline attribute to start blinking. Absolute Line Cntr Attribute This character attribute allows the display of special graphic characters, or may be used to upshift normal characters to implement displays with overlapping superscript and subscript fields. When a character with this character attribute enabled is being displayed, its LCO-LC4 pins will reflect the output from the CHAR ROW LNE CNTR which counts the absolute line count of a row. The activation of this attribute overrides the line count mode of both normal and subscript! superscript characters. The parameter used to select the attribute is: ABS LINE BIT SEL. This four bit register selects one of the 15 bits of a character data word as the absolute line counter output attribute control. Select value 15 disables the ABS Line attribute. Cursor Generation The cursor characteristic parameters are changeable on a frame by frame basis by MODESET. (a) CUR FREQ - Cursor frequency. Selects the blinking frequency for both cursors. The selection logic is similar to CHAR BLNK FREQ (b) CUR DUTY CYCLE - Cursor duty cycle. Selects the blinking duty cycle for both cursors. Its selection logic is similar to CHAR DUTY CYCLE. (c) CR1 RVV ~ Cursor 1 Reverse Video Enable selects a reverse video type cursor as opposed to a solid (blanking) cursor. (d) CR1 BE - Cursor 1 Blink Enable changes the cursor 1 block or underline to a blinking block or underline. Enabling this bit also causes DAT 14 pin to "blink" as well, if the CR10E bit is set. (e) CR10E - Cursor 1 Output Enable reconfigures the DAT 14 pin to indicate when cursor 1 is active. CR20E enabled directs the cursor 2 signal to DAT 13 pin in a similar fashion. (f) CR1 CD - Cursor 1 Light Pen Cursor Detect directs the CCLK cursor #1 position to be translated to its nearest equivalent RCLK pOSition through the LPEN facility. Invisible A character with this attribute will occupy its character position on the screen but will not be displayed (i.e. BLANKwil1 be active). This attribute does not affect the Reverse Video attribute if they are programmed together. The parameter that is used to implement this attributes: I BS - Invisible Bit Select. Selects one of the 15 bits of a character data word as the invisible attribute control. Value 15 disables the invisible attribute. An identical set of parameters (c) through (f) is available for the generation of CURSOR 2. The two cursors share the same FREQ and DUTY CYCLE parameters. 210931-004 7-179 inter 82730 ABSOLUTE MAXIMUM RATINGS· 'NOTICE: Stresses above those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. Ambient Temperature under Bias .... O·C to 70·C Storage Temperature. . . . . . .. - 65·C to + 150·C Voltage on Any Pin with Respect to Ground . . . . . . . . . .. - 1.0V to + 7V Power Dissipation ................... 3 Watts D.C. CHARACTERISTICS TA Symbol =O·C to 70·C, Vcc =5V ± 10% Parameter Vil Input Low Voltage VIH Input High Voltage VOL Output Low Voltage VOH Output High Voltage Icc Power Supply Current Min. -0.5 2.0 Max. Units +0.8 Volts Vee +0.5 Volts 0.45 Volts IOl =2 mA (1) Volts IOH = -400/LA 2.4 III Input Leakage Current ILO Output Leakage Current IlCl LCO, LC1, LC2 Input Low Current -125 VSLI Bus Clock Input Low Voltage -0.5 VSHI Bus Clock Input High Voltage 2.0 VCLI Character Clock Input Low Voltage VCH1 Character Clock Input High Voltage 2.2 VRLI Reference Clock Input Low Voltage -0.5 VRH1 Reference Clock Input High Voltage 2.2 Test Conditions 400 mA @TA=O·C 10 /LA VIN =O-Vee ±10 /LA Vour = 0.45 - Vee -4';('1 /1 A 0.8 Volts Vee + 1.0 Volts 0.8 Volts Vee +0.5 Volts 0.8 Volts Vee +0.5 Volts -0.5 I VIN = 0 Volts, Reset = "1" (2) NOTE: 1. IOl =2.6 rnA on the 51 and SO pi ns. 2. Measured after at least 5 BCLK cycles after RESET = High A.C. CHARACTERISTICS TA =: Q·C to 70·C, Vce = 5V ± 10%. All timings in nanoseconds. CL =50 pF. 82730 Bus Interface Input Timing Requirements Symbol Parameter Min. Max. Units 2500 ns TCLCL BCLK Cycle Period 125 TCLCH BCLK Low Time 52 TCHCL BCLK High Time 52 TCH1CH2 BCLK Rise Time TCL1CL2 BCLK Fall Time TDVCL Data in Set-Up Time 20 7-180 Test Conditions ns ns 30 ns 0.45V - 2.4V (1) 30 ns 2.4V - 0.45V (1) ns ORDER NUMBER: 210931-004 82730 A.C. CHARACTERISTICS (Continued) 82730 Bus Interface Input Timing Requirements (Continued) Parameter Symbol Min. Max. Units TCLDX Data in Hold Time 5 TARYHCH Async. READY Active Set·Up Time 35 ns TSRYHCL Sync. READY Active Set·Up Time 20 ns TRYLCL READY Inactive Set·Up Time 10 ns TCLRYX READY Hold Time 20 ns TCTVCL HLDA, RESET Set·Up Time 35 ns TCLCTX HLDA, RESET Hold Time 10 ns TCAVCAX CA Pulse Width 100 ns TRIVRIX IRST Width 100 ns TRLLCH LC x Input Hold Time 5TCLCL ns ns Test Conditions (2) 82730 Bus Interface Output Timing Response Symbol Parameter Min. Max. Units Test Conditions 55 TCLAV Address Valid Delay TCLAX Address Hold Time 0 ns TAVAL Address Valid to ALE/UALE Inactive TCLCH - 30 ns TLLAX Address Hold to ALE Inactive TCHCL- to TCLAZ Address Float Delay TAZRL Address Float to RD Active TLHLL ALE/UALE Width TCLLH ALE/UALE Active Delay 0 1--- 0 TCLAX ns ns 45 ns TCLCH -10 ns 45 ns TCHLL ALE/UALE Inactive Delay 0 45 ns TCVCTV Control Active Delay (DEN,WR,AEN) 0 70 ns TCVCTXW Control Inactive Delay (WR,AEN) 0 80 ns TCVCTXD TCLDOV Control Inactive Delay (DEN) 5 80 ns Data Out Valid Delay 0 50 TCLDOX Data Out Hold Time 0 ns TWHDX Data Out Hold Time After WR TCLCL-60 ns TCLHV Hold Output Delay TRLRH RD Width 0 85 RD Active Delay TCLRH RD Inactive Delay TRHAV RD Inactive to Next Address Active ns ---- ns 0 95 ns 5 70 ns TCLCL-40 .- ns 2TCLCL-50 TCLRL -- ns 0 -- ns NOTE: 2. Applies only to test mode invocation. 7-181 210931-004 82730 A.C. CHARACTERISTICS (Continued) 82730 Bus Interface Output Timing Response (Continued) Parameter Symbol TCLSIN SINT Valid Delay TRIHSIL RINT Active to SINT Inactive Min. Max. 0 Units Test Conditions 70 ns 250 ns TCHSV Status Active Delay 0 75 ns TCLSH Status Inactive Delay 0 70 ns TWLWH WRWidth TFLHL Bus Float to HOLD Inactive 2TCLCL-40 ns 0 ns 82730 Display Generator Input Timing Requirements Parameter Symbol Min. Max. Units 2500 ns TRCHRCH RCLK Cycle Period 100 TRCHRCL RCLK High Time 40 TRCLRCH RCLK Low Time 40 TRRCK RCLK Rise Time TFRCK RCLK Fall Time TCCHCCH CCLK Cycle Period ns ns 100 30 ns 0.45V-2.4V (1) '30 ns 2.4V-0.45V(1) None ns TCCHCCL CCLK High Time 30 ns TCCLCCH CCLK Low Time 40 ns TRCCK CCLK Rise Time TFCCK CCLK Fall Time TVCVCR HSYNC,SYNCIN Set-Up Time 30 ns TCRVCX HSYNC. SYNCIN Hold Time 10 ns TLPVCF LPEN Set-Up Time 30 ns TCFLPX LPEN Hold Time 10 ns 30 30 TRCHCCH CCLK/RCLK Skew During CSYNC Test Conditions -10 10 ns 0.45V -2.4V (1) ns 2.4V -0.45V (1) ns 82730 Display Generator Output Timing Response Symbol Parameter Min. Max. Units Test Conditions 60 TCCHDV Data, Line Count and Attribute and Output Valid Delay from the Delay from the Rising Edge of CCLK TCCHDX Data, Line Count and Attribute and Output Hold Time 5 ns CL =100pF ns C L = 100 pF TRCHCV Delay of Outputs CSYNC, VSYNC, HSYNC or RRVV from the Rising Edge of RCLK . 70 ns CL = 100 pF TCCHCL CCLK Rising to CHOLD Low 75 ns CL =50pF TRCLCH RCLK Falling to CHOLD High 60 ns CL =50 pF NOTE: 1. Clock maximum rise and fall times are for functionality only. AC timings are not tested at this condition. 2. Applies only to test mode invocation. 7-182 ORDER NUMBER: 210931-004 82730 WAVEFORMS BUS TIMING DIAGRAM BCLK TU T4 T2 T1 T3 11 T4 -,r~ \.......J- , n r~-, r---I~~rl.-l -I _ - : . { TCVCTV - r t SO,51 - 1+ TCHLL I TLHLL ~ UALE f- 1+ TLHLL- ~h f- TCLLHALE TI TCLLH- l- TCLAV-- t=_ -- I r- UJ a: -' TCr LL r ~. AIS-AO T DEN - a: ~ I I f A31-A16 -- I- TCLRL- .t.TCLA~ ·-~CLAV--1 W t: f- I AD15-ADO f~ AIS-Ao r DATAIN { TCVCTV j - - TCLD?V _f~ '1= ---l -- ;"-i-p -ITRHAV -TfLRH --JCVCTXD DATA OUT -- TCVCTV AIS-Ao ...... TCLDO x WR I TCVCTV .... I 1 -- t ~ I I I - .J\... TCLDX- I--I-TAZRL !-TDVCL- RD I l t i- I--.TCLAZ, I- c . I CONTROL RESET I , ( i ~reN} L- o 2EJ '"""z -I c: ;: III '"<5"" "'~ b ...o I\) "@ "" c '" ...8 CD LC X • Iiiiil tTRLLCH _\J--- F ~ ~ ~ 2EJ ~ WAVEFORMS (Continued) l DISPLAY GENERATOR INTERFACE TiMING RCLK CSYNC RRW HSYNC (VSYNC) -..j ~ CX> TRCHCCH (J1 CCLK -Ir TCC~CCHh hi 1-in 1Hl n HCCL K TF 011 II:. r-\ r-\ .... ~ DATO-DAT14 LCO-LC4 BLANK CRVV WDEF CHOLD I' :j 1-- TRCLCH "\§) ~ Iiiiil IP = ~ = ~ ~ ~ ~ " inter 82730 WAVEFORMS (Continued) DISPLAY GENERATOR INTERFACE TIMING RCLK HSYNC, SYNC IN TCRVCX TVCVCR LPEN TCFLPX TRCHCCH TLPVCF CCLK A.C. TESTING INPUT, OUTPUT WAVEFORM A.C. TESTING LOAD CIRCUIT INPUT OUTPUT '.'=X 2.0 0., > TEST POINTS 0.8 < 2.Q 0.8 x= DEVICE UNDER TEST ~c, A C f[511NG INPUTS ARE DRIVEN AT ? 4V H)~ A lOGIC I AND 0 ..\..,v ~ IIR A LUGIC (l TIMING MEASURE Mf NTS ARf MA.DE AT ? 0\1 ~OR A UJGll \ AND (\ RV FuR A lOGIC 0 C, INCLUOES JIG CAPACITANCE 7-186 ORDER NUMBER: 210931-004 inter APPLICATION NOTE AP-259 November 1985 The 82786 CHMOS Graphics Coprocessor Architectural Overview Order Number: 122711-001 7-187 PREFACE 82786 FEATURES AND PERFORMANCE The 82786 is a powerful, yet flexible component which will be a candidate as a standard for microcomputer graphics applications including personal computers, engineering workstations, terminals, and laser printers. Its advanced software interface contrasts sharply with existing products by making applications and systems level programming efficient and straight-forward. Its performance and high-integration make it a costeffective component while improving the performance of nearly any design. The following list is a summary of the 82786's capabilities (assuming 10 MHz system clock and 25 MHz video clock): Windows: Practically unlimited support Up to 1024 displayable simutaneColors: ously with support for 4 external color palettes Lines, Polylines, 2.5 Million pixels per second Polygons: Circles, Arcs: 2.0 Million pixels per second Supported via horizontal line Fills: command (30 Million bits per second) Bit Block Transfer: 24 Million bits per second Bit-map Memory: Up to 4 MBytes· of directly accessed DRAM Resolution: Up to 200 MHz monitors supported; this is equivalent to configurations such as 640 x 480 x 8 or 1024 x 1024 x 2 @ 60 Hz (non-interlaced); up to 4096 x 4096 x I or 2048 x 1536 x 8 with video . DRAMs. I to 64 times vertical and horizontal Character Drawing: 25 thousand per second with colors, path, and rotation attributes Character Fonts: Unlimited number from bit-map or system memory 16 x 16 maximum hardward size; Character Size: unlimited with bit-block transfer Scroll, Pan: Instantaneous in any direction with no external logic Zoom: The performance of the 82786 is of little value without applications and system-level software to use it. Cus- tomers can write their own software following the suggestions of the 82786 Software Interface Applications Note or the appropriate third-party vendors' software packages. Intel has evaluated several major products and presently recommends Microsoft. Windows™, Digital Research GEMTM, Novagraphics Nova CGI and GKSTM, and Graphic Software Systems CGI and GKSTM, Window Manager™, and GKSTM. These packages appear to be easily adapted to 82786-based systems, are likely to emerge as de facto industry standards, and would permit a wide array of applications to run with little or no modification on 82786-based products. For more information on these products, please contact these vendors directly: Digital Research, Inc. P. O. Box DRI Monterey, CA 93942 (408) 649-3896 Graphic Software Systems P. O. Box 673 Wilsonville, OR 97070 (503) 682-1606 Microsoft Co'rporation Bo'x 97200 Bellevue, WA 98009 (206).828-8080 Novagraphics International Corporation 1015 ,Bee Cave Woods Austin, TX 78746 (512) 327-9300 The 82786 was designed to permit compatibility with de facto hardware standards. Use of the 82786 with appropriate Intel microprocessors permits the design of systems which can emulate the family of IBMTM personal computer products. The 82786's support of the IBM Color Graphics Adapter-compatible bit-map eases the task of running existing applications software on new video hardware. For details please refer to the 82786 PC Compatibility Applications Note. Additional documentation available for the 82786 includes the Data Sheet, the User Manual and Application Notes. For all questions, clarifications, or requests for additional documentation please contact your local Intel sales office or authorized distributor. 7-188 AP-259 CHAPTER 1 INTRODUCTION 1.1 OVERVIEW This document provides the reader with an introduction to the architecture and key features of the Intel 82786 Graphics Coprocessor from Intel. The 82786 serves such applications as graphics terminals and work stations, personal computers, printers, and other products requiring the capability to create, store, and output bit-map graphics. The 82786 works with all Intel microprocessors, and is a high-performance replacement for sub-systems and boards which have traditionally used discrete components and/or software for graphics functions. The 82786 requires minimal support circuitry for most system configurations, and thus reduces the cost and board space requirements of many applications. The 82786 is based on Intel's advanced CHMOS process. The advanced performance and ease-of-use of the 82786 make it a candidate for an industry standard for applications in microcomputer graphics markets. Some of the leading features of the 82786 are: • Fast polygon and line drawing a Hardware windows • High speed character drawing • Interface designed for device independent software standards ~ Virtual Device Interface - Graphics Kernal System -NAPLPS • Advanced DRAM controller for graphics memory up to 4 Mbytes • Fast bit-block copies between system and bit-map memories • Supports up to 200 MHz CRTs or higher • Up to 1024 simultaneous colors per frame • Programmable video timing • 88 pin leaded chip carrier and pin grid array • Provides support for rapid filling with patterns • IBM Personal Computer Color Graphics Adaptercompatible bit-map • International character support • Advanced CHMOS technology • Integral video DRAM support 1.2 ARCHITECTURAL MODEL The 82786 architecture fits with traditional computer graphics models. A typical subdivision of the tasks is: • Graphics task partitioned into: Drawing (line, polygons, characters, block image copies) Windowing (concurrent windows on the screen) Refresh (CRT timing, video data output) • Typical integrated solutions to these functions have been: First generation IC: 6845, 8275 - refresh Second generation LSI: 82720 - drawing + refresh Third generation VLSI: 82786 - drawing + windowing + refresh The 82786 is a co-processor with two separate on-chip processing units, the graphics processor and display processor, which operate concurrently with the system CPU. Instructions to the display and graphics processors are placed in memory by the CPU. Registers on the 82786 are dedicated to pointing to the starting addresses of the first memory blocks of instructions controlling the on-chip processors, and each memory block points to subsequent blocks in a linked-list architecture. Access by the CPU to these registers may be 1/0- or memory-mapped, and portions of memory may be shared between the 82786 and the CPU. • High Integration • Third-party software support 7-189 intJ AP·259 1.3 BIT MAPS AND WINDOWS The 82786 concepts of "bit maps" and "windows" are based upon definitions from the ANSI work on windows. The 82786 can create and maintain multiple sets of graphics 'images in memory. These sets of images in memory are called "bit maps". 82786 can combine subsets of these bit-maps into a viewable, multi-region display screen. Each of these separate areas on the screen are called "windows". Most graphics systems today use software to generate a bit-map representation of the full contents of the display called a "frame buffer". The 82786 uses a highlevel window descriptor list and specialized hardware . to generate the screen contents using portions from separate bit maps of memory (Figure 1-1). This permits the display to be instantaneously altered, eliminating the time required to update a similar frame buffer image using software alone. ' BIT MAP 2 MEMORY BIT MAP 1 (D [DiI1J BIT MAP 3 ABeD EFGH IJKL MNOP QRST UVWX YZ WINDOWS DISPLAY Figure 1-1. Bit Maps and Windows 7-190 122711-1 inter AP-259 1.4 FUNCTIONAL OVERVIEW The 82786 performs many functions within a single integrated circuit. Figure 1-2 identifies a block diagram of the component and explanations of each function module. 62766 r - - - - - I r - - - - - ., VIDEO INTERFACE p~~~~I~gR I I p~6~~~6R I 1----'-----., L _____ .JL _____ .J I r - - - - - - -: ..::::..:::: ...::: .. ::...:::: __1 BUS INTERFACE i DRAM iI UNIT (BIU) CONTROLLER L ______ ..!: _ _ _ _ _ IU I 122711-2 Figure 1-2.82786 Block Diagram The major functions of each block are: • Graphics Processor (GP): - draws lines, circles, polygons, and other primitives - draws characters - executes block image manipulation instructions • Display Processor (DP): - manages windows including zoom - provides cursor - refreshes screen (up to 200 MHz dot rate) - loads shift register of video DRAMs - controls up to 4 Mbytes of interleaved graphics memory including page-, static • DRAM Controller: column-, and fast page-mode DRAMs (interleaved or non-interleaved banks) - allows the CPU to access the graphics memory and the 82786 to access the system • BIU: memory 7-191 Intel AP-259 CHAPTER 2 GRAPHICS PROCESSOR 2.1 OVERVIEW The graphics processor creates and updates all of the graphics and text in each of the bit maps within graphics memory. It is responsible for all of the geometric drawing, character drawing and image movement within and between the bit maps. Some features of the graphics processor are: ' • permits bit maps to begin at any word in system or graphics memory; only one bit map is active for GP drawing at one time although many bit maps may reside in memory simultaneously. ' • permits bit maps to be any size (up to 32K x 32K pixels) and use 2, 4, 16, or 256 colors (i.e. I, 2, 4, or 8 bits per pixel); • draws geometric shapes with attributes such as texture and color, into bit maps; • draws characters with attributes such as color, path, rotation, and proportional spacing using userdefined fonts into bit maps; • combines one rectangular portion of an image with another area, within the same bit map or into another bit map. (BIT Block Transfer or Bit-Bit); • all drawing allows logical operations between source and destination (for example Exclusive-Or of the Complement of Source with Destination); • all drawing can be clipped to a rectangular region; • supports picking, a mechanism for advanced user interfaces which allows the issuing commands via the selection of "graphic menus" (called icons) ,by manipulating pointing devices. The Graphics Processor fetches its instructions directly from a linked list in memory which is created and updated by the CPU. The initial address of the list is contained in a dedicated register in the 82786 and the addresses of subsequent instructions are pointed to by the contents of previous instructions. Each instruction contains a bit which indicates to the graphics processor that it should stop (if set) and await new instructions. ' More detail on the command format is given in section 2.8 "Graphics Processor Command List Format." 2.2 BIT MAPS All graphics and text creation is written into bit maps. Bit maps are rectangular drawing area composed of bits of pixel-oriented memory. The bit maps may be up to 32,000 pixels in each direction and contain from one to eight bits of color or gray scale information. Bit maps may be started on any even address in the 4 Mbyte space and the number of bit maps in memory is unlimited (except by the amount of memory available). The variable bits per pixel feature permits the use of several bits per pixel for multicolor graphics while using only a single bit per pixel for efficient text memory. 2.3 GRAPHICS PROCESSOR INSTRUCTION SET The graphics processor instruction set is divided into five classes: 1. Non-Drawing Commands 2. Drawing Control Commands 3. Geometric Commands 4. Bit Block, Transfer (BIT-BLT) Commands 5. Character Block Transfer (CHA-BLT) Commands 2.3.1 Non-Drawing Commands The first class of commands are used to control the method in which the commands are fetched. Also included in this list are commands to load and dump 82786 internal registers. These commands are: • NOP - No Operation • LINK - Link To Next Command (Unconditional Jump) • ENTELMACRO - Enter Macro ,(Subroutine Call) • EXIT~ACRO - Exit Macro (Subroutine Return) • INT~GEN - Generate Interrupt • DUMP_REG - Dump Internal Register • LOAD.-REG - Load Internal Register 2.3.2 Drawing Control Commands The graphics processor works in only one bit map and with one set of attributes at a time. The graphics processor maintains an imaginary cursor, GCPP (Graphics' Current Position Pointer), which points to a particular position (x, y coordinates) within' the bit map from which all relative coordinates are calculated. The GCPP is updated at the end of each drawing command. 7-192 AP·259 The following commands are used to define the current bit map and attributes and set the Current Position Pointer: • DEFJIT~AP - Define Bit Map • DEF_CLIP~ECT - Define Clip Rectangle (see 2.4) • DEF_COLORS - Define Colors • DEF_TEXTURE - Define Texture • DEFJOGICAL_OP - Define Logical Operation (see 2.6) • DEF_CHAR-SET - Define Character Set • DEF_CHAR-ORIENT - Define Character Orientation • DEF_CHAR-SPACE - Define Inter Character Spacing • ABS_MOV - Absolute Move GCPP • REL_MOV - Relative Move GCPP • ENTER-PICK - Enter Pick Mode • EXIT_PICK - Exit Pick Mode 2.3.3 Geometric Commands These commands allow the 82786 to draw points, lines, and arcs in a variety of ways: • • • • • • • • • POINT - Draw Point INCR-POINT - Draw Incremental Points CIRCLE - Draw Circle LINE - Draw Line RECT - Draw Rectangle POLYLINE - Draw Polyline POLYGON - Draw Polygon ARC - Draw Arc SCANJINES - Draw Series of Horizontal Lines memory address of the source origin and source bit map size is specified. Bit-Bits between bit maps can only use bit maps with the same number of bits per pixel. 2.3.5 Character Command This command allows character fonts stored in memory in pixel form to be drawn into the bit map by an application using character codes such as ASCII: • CHAR - Draw Character String The CHAR command dermes transparency/opaqueness for a character string, the pointer for the character string, and the number of character in the string. The pixel contents of the character to be drawn maybe located anywhere in the memory space of the 82786 and accessed with either an 8- or 16-bit reference to the specific character. The string range specifies the 8- or 16-bit references for each'character to be drawn. Sec-' tion 2.7 discusses the use of character fonts. Standard character fonts can be flexibly drawn because path and rotation are defined with a DEF_CHARORIENT command and inter-character spacing is defined with a DEF_CHAR-SPACE command. This permits the variable spacing of text, direction of text, and rotation of characters to be specified by the application without making alteration of the font necessary. Simple one-bit per pixel character font definitions can be used in color applications because foreground and background colors are specified by the DEF_COLOR command and the necessary bits are written for each pixel during the drawing process. 2.4 DRAWING ATTRIBUTES 2.3.4 Bit Block Transfer (Bit-Bit) Commands These commands allow rectangular image pieces to be combined from piece of bit-map memory to another. The graphics processor automatically inserts the new data in the correct order in the destination so that each line of pixels remains consecutive for both existing and new data. • BITJLT - Bit Block Transfer within bit map • BITJLT_M - Bit Block Transfer between bit maps The command specifies the origin of the source rectangle as well as the height and width. The destination origin is the GCPP coordinates. For Bit-Bits between bit maps, the destination is the active bit map and the A drawing operation refers to the act of modifying pixels within a bit map during the execution of the GP commands. All drawing that the GP performs (including lines, arcs, characters and Bit-Bits) is subject (with exceptions noted) to six attributes which should be defined before any drawing commands are executed. The attributes are: 1. Pixel Plane Mask; 2. Logical Operation; 3. Clipping Rectangle; 4. Foreground and Background color (not applicable to Bit-Bit); 5. Transparent or Opaque mode (not applicable to BitBit); 6. Pattern mask of 16 bits (not applicable to Bit-Bit or characters). The pixel plane mask is helpful in restricting the graphics primitives to update a subset of the bits per pixel. 7-193 inter AP-259 This permits one set of drawings to exist in one or more colors and allow other text or graphics information to reside in different color bits of the same bit map. Raster operations can be used to .combine existing pixel information in the bit map with the new pixel information generated as a result of the new drawing operation, such as displaying only the overlapping regions of two shapes. The clipping rectangle limits the effects of drawing operations to a subset of the bit map. Foreground and background colors set the two colors drawn by all drawing operations (if both are needed). The transparent mode draws only the foreground color into the bit map (for dotted lines or characters) and leaves the pixels between the dots or characters unchanged. The opaque mode draws the foreground color and fills in the background color between the dots or characters. The pattern defined in the mask cause a logical operation with drawing commands and permit dotted and dashed lines, arcs, and other shapes. DEF_ PATTERN sets transparent! opaque for drawing operations other than character, which is defined in CHAR. 2.5 CLIPPING The clipping rectangle is used to prevent drawing outside a specified rectangular region. The clipping rectangle can be any rectangle within a bit map or the entire bit map. Pixels are not drawn beyond the limits of the clipping rectangle and characters which would be partially clipped are not drawn at all. In a special mode, "pick mode," the clipping rectangle is used to perform a different function. The clipping rectangle may be controlled by software to support the selection of objects on the display with a pointing device. When in pick mode the drawing commands are executed but pixels are not updated in memory. Instead, a flag is set in a register if any of the pixels generated by the command lie within the clipping rectangle. In this way it is easy to set the clipping rectangle to correspond to the location of a graphics pointing device (such as a mouse) and re-process the graphics command list to find which drawing command corresponds to the selected area. 2.6 LOGICAL OPERATION The logical operation is an attribute that applies to all subsequent pixel update operations (line, arc, character, Bit-BIt etc.). It is an operation which can logically combine the contents of separate bit-map locations to produce new bit-map patterns. All sixteen binary functions are permitted between both the source and destination. • AND • OR • EXCLUSIVE-OR Six of the combinations provided are special: • REPLACE destination with source • REPLACE destination with complement of source • SET all destination bits to 0 • SET all destination bits to I • REPLACE destination with complement of destination • REPLACE destination with destination (NOP) 2.7 CHARACTER FONTS The Graphics Processor supports an unlimited number of character fonts, that can reside anywhere in the 4 Megabyte address space. The character string to be written can be defined either as a string of bytes or as a string of words depending upon the type of font used. The active font type and upper and lower memory addresses of the font to be used are set via the DEF_ CHAR_SET command. Each character in the character font has an independently programmable size of up to 16 by 16 pixels, allowing individual characters to have different sizes for proportional spacing. Each character resides in a block containing n + I words of memory where n is the pixel height of the character. The first word contains fourteen bits to define the height and width of the character. The remaining two bits specify if the following character should be an overstrike or if the character exceeds sixteen pixels in either dimension to cause a software trap. Overstriking is useful for efficient implementation of underline and accents, and prevents updating the GCCP after the character is drawn. For larger characters than 16 by 16, the trap bit in the font can cause an interrupt to the CPU so that software can specially process that character such as a Bit-Bit. The perception of larger characters than 16 by 16 can also be created by dividing characters into subsets such as quadrants, and executing multiple character drawing commands. Software use of the DEF_CHA~ SPACE command supports negative inter-character spacing to permit kerning, such as for italic fonts. The byte or word strings used as parameters for the CHAR command are used in conjunction with the 22bit pointer defined in a register by the DEF_CHA~ SET command. Use of 16-bit, or word-mode, characters causes an add between the 22-bit pointer and the 16-bit reference value to access the starting address of the specific character. Because maximum character block size is seventeen words of data, approximately four thousand -characters may be contained in one 16bit font (worst case). Supplementary software in the form of a look-up table can be used to access as many as 65,000 characters in a single font. Bit-Bit can move characters of unlimited size. 7-194 inter AP-259 WORD MODE 16 BIT CHARACTER FONT CHARACTER STRING FONT POINTER BYTE MODE 8 BIT CHARACTER FONT -CHARACTER BITMAP CHARACTER STRING -OFFsET__ __ T~LE FONT POINTER 122711-3 Figure 2-1. Word and Byte Mode Use of byte·mode permits eight bit references to charac· ters. This is important to permit existing software using ASCII and EBCDIC to be converted to 82786·based systems. 256 words of the font are reserved for a look· up table. Adding the 8·bit string parameter to the font pointer determines the word for the specific character within this table. The word is then added to the pointer to locate the character information in the font. Byte· mode permits only 256 characters in each 8·bit font. Figure 2·1 shows a description of word and byte mode. cation needs to change bit·map contents or support some special function such as picking. The general for· mat of an instruction is shown in Figure 2-2. 15141312111009 OB 07 06 05 04 03 02 01 OPCODE PARAMETER 1 PARAMETER 2 I P.ARAMETER N Figure 2-2. Instruction Format 2.8 GRAPHICS PROCESSOR COMMAND LIST FORMAT The graphics processor executes a sequence of instruc· tions resident in memory and runs only when an appli· 7·195 00 GECLbit inter AP-259 Each opcode resides in the high byte of the word with a GECL (Graphics End of Command List) bit in the least significant bit of the low byte and followed by a varying number of parameters in consecutive words. The graphics processor tests the GECL of each instruction and sends the graphics processor into Poll Mode when set to "1" for any opcode. Poll mode haIts the graphics processor until a LINK command and upper- and lower-memory values for a link address are loaded into three reserved registers. The graphics processor then begins executing a new linked-list of instructions starting at the specified address when the GECL bit with the LINK instruction in the register is reset to O. An example of a graphics command block using linkedlists is shown in Figure 2-3. EXTERNAL MEMORY CONTROL REGISTER LINK 0 LINK ADDRESS LOWER LINK ADDRESS UPPER I GECL OPCODE 1 0 PARAMETER 1 OPCODE 2 0 PARAMETER 1 PARAMETER 2 PARAMETER 3 OPCODE 3 0 POINTER ENTER MACRO OPCODE 7 0 OPCODE 8 0 - PARAMETER 1 PARAMETER 2 STOP OPCODE 9 0 OPCODE 10 1 GRAPHICS SUBROUTINE OPCODE4 0 OPCODE 5 0 OPCODE 6 0 - PARAMETER 1 , PARAMETER 2 EXIT MACRO PARAMETER 1 PARAMETER 2 (LINK) 122711-4 Figure 2-3. Graphics Processor Command Block 7-196 inter AP-259 CHAPTER 3 DISPLAY PROCESSOR 3.1 OVERVIEW 3.2 WINDOWS The display processor has five main functions in generating the display contents for output: 1. To retrieve the memory contents of selected bit maps and output corresponding pixels into separate regions on the display screen (windows); 2. To permit selected portions of bit maps to be magnified on the display (zooming) horizontally and/or vertically via pixel replication; 3. To provide a "pointing symbol" (cursor); 4. To generate control and video data signals to the display hardware; 5. Load the shift registers of video DRAMs. Windows are the portions of bit maps which are output by the display processor. Up to 16 window segments or tiles can be displayed on the same scan line of the CRT, while there may be as many windows vertically as the number of scan lines. Control of the display processor is programmed via onchip registers. Content of the display is dynamically altered by the application (or system software) without causing unacceptable display blinking. Using memorymapped CPU alteration of parameters, the DP will load the register set with the new parameters during vertical retrace. By altering the registers to point to a new display list, the change of display lists can occur between refresh cycles. STRIP 1 TILE 1.1 STRIP 2 TILE 2.1 STRIP 3 TILE 3.1 STRIP 4 TILE 4.1 STRIP 5 TILE 5.1 - The 82786 treats the screen as divided into horizontal strips (Figure 3-1) of arbitrary width, where the horizontal format of window tiles across the strip remains constant for the whole strip. This divides the region into rectilinear areas, which are easy to manage. By combining strips, overlapping windows can easily be obtained. Windows may essentially be arbitrarily shaped (circular, irregular, etc.) because a new strip may be defined every display line, similar to the format shown in Figure 3-2. TILE 2.2 TILE 2.3 TILE 3.2 TILE 3.3 I TILE 4.2 - TILE 3.4 TILE 4.3 122711-5 Figure 3-1. Sample Display Implementation of Two Overlapping Windows 7-197 inter AP-259 STRIP STRIP STRIP 3 STRIP 4 STRIP 5 STRIP 6 STRIP 7 STRIP 8 STRIP 9 STRIP 10 STRIP 11 STRIP 12 STRIP 13 STRIP 14 STRIP 15 ROUND WINDOW USING ONLY THIRTY STRIPS: USE OF 200 OR MORE STRIPS WOULD SIGNIFICANTLY REDUCE" JAGGIES." STRIP 16 STRIP 17 STRIP 18 STRIP 19 STRIP 20 STRIP 21 STRIP 22 STRIP 23 STRIP 24 STRIP 25 STRIP 26 STRIP 27 STRIP 28 STRIP 29 STRIP 30 122711-6 Figure 3-2. Sample Display of Irregular Window The information needed for the display processor is contained in strip descriptor tables, each made up of a header and one or more tile descriptors. The header contains: • the number of lines in the strip; • the number of tiles in the strip; • upper and lower addresses of the next strip descriptor Each tile descriptors (which are consecutive in memo· ry) contains: 1. the width of the bit map from which the window is being retrieved (in words); 2. the start address of the bit-map data to be displayed (word in memory and first bit location); 3. the number of words to fetch for the tile; 4. the first and last bit locations of the bit-map data to be displayed; 5. the number of bits per pixel; 6. four bits to indicate border presence for top, bottom, left, and right edges (I indicates show border, o indicates show bit-map for those pixels); 7. window status information which can be used to select color palettes or other attributes (2 bits); 8. two bits to indicate bit-map configuration is byte rather than word·oriented with byte order switched and if bit-map is non·linear (for PC compatibility); 9. bit to indicate if window is to. be zoomed by pixel replication of the bit-map data; 10. bit to indicate if tile if field background data. A one-pixel border can be displayed on any or all sides of each viewport tile. This border color is defined in an 8-bit register and is the same user-definable color for all windows. Borders may be turned on or off for individual tiles. 7-198 intJ AP-259 In the absence of windows, the field background color is displayed. This single color is definable by the user in an 8-bit register. The use of background on the display minimizes system bandwidth because data is only fetched for windows and not for background, and thus saves bit-map memory. The display processor provides padding bits when bit maps to be displayed have fewer bits/pixel than the hardware display, with no performance decrease. This allows windows of various bits/pixel to be shown simultaneously on the same display. The user programs the desired 8-bit color patterns into three registers, one serving to map each of 1-, 2-, and 4-bits per pixel information into full colors on the display. All video output from the 82786 can be defined to begin and end at any pixel (except when in accelerated mode using external shift logic). This includes the positioning of every window and the cursor. define the pattern, which is then padded with the cursor color register. Support for a blinking cursor is provided with a register for CURSOR_ON which can be toggled by the CPU as often as necessary to cause an appropriate blink rate. MUltiple cursors can be simulated by drawing them in software, especially using bit-bit. 3.4 ZOOM The display processor allows selected windows to be zoomed (using pixel replication) up to 64 times horizontally and vertically (independently, in steps of one). The setting of the zoom bit in the tile descriptor table causes replication of the pixels in memory according to horizontal and vertical scaling factors contained in registers. 3.5 VIDEO INTERFACE The display processor instruction list is controlled by the CPU. The double-word location of the first strip descriptor block is located in a register. The locations of subsequent strip descriptor tables are based upon a linked-list architecture and are provided in the preceding descriptor table. This descriptor linked-list needs only to be updated by the CPU when the window arrangement on the screen changes. New strips and segments are easily inserted into the display list by simply modifying the linked-list pointers of the preceding strips, or segments. Eight parallel video data output lines provide video output which may be used as eight bits pixel on the CRT, or externally shifted to boost maximum display resolution. The dot rate output is controlled by an independent video clock which may be up to 25 MHz. Horizontal signals are programmable from I to 4096 cycles of the video clock and vertical sync signals from I to 4096 scan lines. Use of eight external video data pins allow up to 256 different colors to be directly displayed. Other CRT control lines provided by the display processor are VSYNC, HSYNC, BLANK. The use of redundant lists is possible because the description of a typical display is memory-efficient and requires only about 1,000 bytes. This would permit the CPU to alter the contents of one list while the second is being used to control display processor. When the creation of the new list is complete, the registers pointing to the first strip descriptor table may be switched to the locations for the new list during vertical retrace. This permits the application to alter the display list without causing temporary swimming or blinking of the display. Several 82786s can be used together for higher performance graphics. For multiple 82786 Systems, one 82786 acts as a master generating VSYNC and HSYNC, and the other 82786s act as slaves using the master synch signals for timing through the use of their own VSYNC and HSYNC as inputs. Each 82786 has its own bit-map memory with separate graphics processor lists to form a bit-plane architecture, but use the same display list. The BLANK signal is not used by slave 82786s. 3.3 CURSOR The display processor supports a single hardware cursor which may be up to 16 x 16 pixels. This cursor may be positioned by the user anywhere on the screen. The cursor may be defined to be transparent or opaque, and may be either a block cursor or a cross-hair cursor one pixel across stretching the width and height of the screen. The color of the cursor is user-definable, as is the block cursor's pattern. Eight bits of register memory define the color and sixteen 16-bit words of register External color palettes are supported, and, by use of the two window status lines, the application may select one of four color combinations for any window. This supports a maximum of 1024 simultaneous colors per frame. The palette may be programmed by latching the default video data when the BLANK pin is high. The display processor can support non-interlaced, and interlaced-synch displays. Selection of the interlacing, control to support external shifting of the video data, default video data contents, and slave/master status for each 82786 are controlled via dedicated registers. The 82786 may be synchronized to an external source ("Gen-Locking"). 7-199 inter AP-259 CHAPTER 4 82786 SYSTEMS 3. High-performance workstation for processing-intensive, high-resolution applications in engineering (Figure 4-3). 4.1 TYPICAL SYSTEM CONFIGURATIONS The 82786 can be used in many different configurations, each providing cost and performance appropriate for different applications and markets. 4.2 DRAM CONTROL The DRAM controlJer on the 82786 supports an array of up to 32 memory chips without extra logic and up to a 4 megabyte address space. DRAMs supported have densities ranging from 8K to I megabit and organiza- Three typical applications in which the 82786 could be used are: 1. Low-priced personal computer (Figure 4-1); 2. Multi-tasking office workstation (Figure 4-2); MEMORY I 80186 f-- I 82786 .-( MONITOR ) 122711-7 Figure 4,1. Low End Personal Computer SYSTEM MEMORY ( 80286 MONITOR) 122711-8 Figure 4-2. Desktop PC/Graphics Terminal SYSTEM MEMORY 80286/80386 122711-9 Figure 4·3. High End Workstation 7-200 inter AP-259 tions of xl, x4, or x8. The bandwidth of the memory system can be increased by interleaving memories and/ or using the Ripplemode TM or static-column mode supported by Intel CHMOS DRAMs. Both inter-leaving and Ripplemode TM are completely handled on chip and require no extra external circuits. Use of static-column DRAMs requires one 74X373 latch per bank. Interleaving refers to the use of multiple DRAM banks with one set of memories receiving new CAS signals while the other outputs data. Table 4-1 shows memory burst-bandwidth for the different configurations at 10 MHz. DRAM refresh is done automatically by the DRAM controller. The memory array can be accessed both by 82786 internal processors (GP, DP) and by external masters (CPUs) through the BID. The 82786 DRAM controller can be used to control system memory within its 4 megabyte address space, provided the target application -can accept the decreased bandwidth of system memory. The portions of the address space dedicated to graphics and system memory are configured at initialization in the DRAM_CONTROL_REGISTER. Graphics memory is assumed to start at OH and continue up to the configuration limit. Memory addresses above this are used for system memory. 4.3 BUS INTERFACE The Bus Interface Unit of the 82786 is designed to support all 8-, 16-, and 32-bit microprocessors from Intel, with optimization for the 80286. This permits the 82786 to run synchronously with the 80286, increasing throughput by eliminating wait states. A special 8-bit mode allows 82786 to also work with 8-bit data bus microprocessors. The 80386 itself makes interfacing to the 82786 possible. Interfacing to Intel CPUs is detailed in the Hardware Configurations Applications Note. The bus interface allows slave access by the CPU to the graphics memory controlled through the 82786 DRAM controller. This allows the CPU to update the graphics processor instruction list and the display processor descriptor lists in the graphics memory where maximum throughput can be supported. Low-end systems could use only a single memory shared by both the 82786 and CPU and use the 82786 DRAM controller for this memory. For performance reasons, many systems will have at least two sections of memory: the 82786 graphics memory (using the on-chip DRAM controller) and the system memory. In this configuration, the 82786 can execute bus cycles on the system bus so the 82786 can access the CPUs own memory. This master mode is designed in accordance with the 80286 definitions. This configuration allows the best of both worlds, the system and graphics memories are split for performance reasons, but the split is transparent to the software for flexibility. Character fonts and graphic objects may be retrieved from disk and placed in system memory locations reserved for access by the 82786 using a virtual mode 80286 or 80386 configuration with appropriate system software. Table 4·1. 82786 DRAM Bandwidths Page mode DRAM Ripplemode DRAM Non Interleaving DRAM banks 10 Megabyte/sec (diagnostics or 640 x 480 x 2) 20 Megabyte/sec (640 x 480 x 4 or 1K x 1K x 1 noninterlaced) Interleaving DRAM banks 20 Megabyte/sec (640 x 480 x 4 or 1Kx1KX1 noninterlaced) 40 Megabyte/sec (2K x 2K x 1 interlaced: 1K x 2K x 1. 1K x 1K x 2. 800 x 600 x 4. 640 x 480 x 8 noninterlaced) 7-201 AP-259 CHAPTER 5 PACKAGE AND PIN DESCRIPTION 5.1 OVERVIEW The 82786 is an eighty-eight pin component due to the large number of functions integrated within the device. It is available in both pin grid array and leaded chip carrier versions. The pinout of a pin grid array is shown in Figure 5-1 and a description of the pins is shown in Table 5-1. 0 0 Vss DRA1 0 0 0 0 VDATQ DRAO 0 DRA3 0 DRA2 0 DRA5 0 DRA4 0 DRA7 0 DRA6 0 DRA9 0 DRAB 0 Vee 0 0 0 0 0 0 0 0 0 RAS2# RASO# CASO# WEH# BENO# 0 VOAT4 VDAT3 0 0 0 0 0 0 BLANK 0 0 AO A2 0 0 A3 0 A5 0 0 0 0 0 03 0 0 0 0 0 MIO 0 A7 AB A10 0 0 0 Vss A9 A11 0 A12 0 A14 0 A16 0 A1B 0 A20 0 ClK 0 0 0 0 0 0 A13 A15 A17 Vee A19 A21 0 INTR 0 RESET 0 MEN 05 0 0 A6 07 04 CSIt 0 09 0 ROY# A4 0 0 01 0 Ai 0 0 06 VSYNC HSYNC 0 013 011 DB VClK VDAT7 0 Vss 012 010 VDAT6 VOAT5 0 0 014 0 VOAT2 VDAT1 0 0 RAS1# CAS1# WEl# BEN1# 015 0 HREQ 02 00 0 RO# 0 WRit 0 BHEIt 0 0 0 SEN HlDA Vss 122711.,.10 Figure 5·1. PGA Pinout 7-202 AP-259 Table 5·1. 82786 Pin Names and Descriptions Symbol A21-0 Type Description 1/0 ADDRESS LINES FOR THE LOCAL BUS: Normally inputs for Slave Mode accesses of the 82786 supported DRAM array or internal memory or 1/0 mapped registers. Driven by the 82786, when it is the Local Bus Master. D15-0 1/0 DATA BUS: For the 82786 DRAM array and the Local Bus. BHE# 1/0 BUS HIGH ENABLE: An input of the 82786 Slave Interface: driven LOW by the 82786 when it is Local Bus Master. Determines asynchronous vs. synchronous operation for RD#, WR# and HLDA inputs at the falling (trailing) edge of RESET. A HIGH state selects synchronous operation. RD# 1/0 READ STROBE: An input of the 82786 Slave Interface: driven by the 82786 when it is Local Bus Master. Asynchronous vs. synchronous input determined by state of BHE# pin at falling RESET. WR# 1/0 WRITE STROBE: An input of the 82786 Slave Interface: driven by the 82786 when it is Local Bus Master. Asynchronous vs. synchronous input determined by state of BHE# pin at falling RESET. Mia 1/0 MEMORY 11/0 INDICATION: An input of the 82786 Slave Interface: driven HIGH by the 82786 when it is the Local Bus Master. Selects 286 Status or Command Mode vs. 8086/186 Status Mode of the 82786 Slave Interface at the falling (trailing) edge of RESET. A LOW state selects the 286 Status or Command Mode. CS# I CHIP SELECT: Slave Interface input qualifying the access. MEN a MASTER ENABLE: Driven HIGH when the 82786 is in control of the Local Bus, (i.e. HLDA received in response to a 82786 HREQ). Used to steer the data path and select source of bus cycle status commands. SEN a SLAVE ENABLE: Driven HIGH when 82786 is executing a Slave bus cycle for an external master on the Local Bus. Used to enable the data path and as a READY indication to the Local Bus Master. READY# I SYNCHRONOUS INPUT: To the 82786 when executing Local Bus cycles. Identical to 80286 timing. HREQ a HOLD REQUEST: Driven HIGH by the 82786 when an access is being made to the Local Bus by the Display or Graphics Processors. Remains HIGH until the 82786 no longer needs the Local Bus. HLDA I HOLD ACKNOWLEDGE: Input in response to a HREQ output. Asynchronous vs. synchronous input determined by state of BHE# pin at falling RESET. INTR a INTERRUPT: The logical OR of a Graphics Processor and Display Processor interrupt. Cleared with an access to the BIU Interrupt Register. CASO# a COLUMN ADDRESS STROBE 0: Drives the CAS inputs of the even word DRAM bank if interleaved: identical to CAS1 # if non-interleaved DRAM. Capable of driving 16 DRAM CAS inputs. CAS1# a COLUMN ADDRESS STROBE 1: Drives the CAS inputs of the odd word DRAM bank if interleaved; identical toCASO# if non-interleaved DRAM. Capable of driving 16 DRAM CAS inputs. RAS2-0# a ROW ADDRESS STROBE: Drives the RAS input pins of up to 16 DRAMs. Drives the first three rows of both banks of DRAM. DRA91 RAS3# a MULTIPLEXED MOST SIGNIFICANT DRAM ADDRESS LINE AND RAS3#: Support of 1Mb DRAMs requires DRAg. When 1Mb DRAMs are used, four rows of DRAMs cannot be supported (RAS3 # unnecessary) due to 82786 addressing limit of 4 Mbytes being exceeded. WEL# a WRITE ENABLE LOW BYTE: Active LOW strobe to the lower order byte of DRAM. WEH# a WRITE ENABLE HIGH BYTE: Active LOW strobe to the higher order byte of DRAM. 7-203 intJ AP-259 Table 5·1. 82786 Pin Names and Descriptions (Continued) Symbol Type Description DRA8-0 0 MUTIPLEXED DRAM ADDRESS: DRAM row and column address are multiplexed on these lines. Capable of driving 32 DRAMs without buffers. BEN1-0# 0 BANK ENABLE 1 AND 0: Enables the output of the DRAM array on to the 82786 data bus (015-0). BEN 1 # controls Bank 1. BENO # controls BankO. I/O OUTPUT USED TO BLANK THE DISPLAY AT PARTICULAR POSITIONS ON THE SCREEN: May also be configured as inputs to allow the 82786 to be synchronized with external sources. BLANK VDATA7-0 0 VIDEO DATA OUTPUT. VClK I VIDEO CLOCK INPUT: used to drive the display section of the 82786. Its maximum frequency is 25 MHz. HSYNC/ WSTO I/O HORIZONTAL SYNC: Window status may be multiplexed on this pin. Can also be configured as input to allow the 82786 to be synchronized with external sources. Even as input, window status still output when BLANK is low. VSYNC/ WST1 I/O VERTICAL SYNC: Window status can be multiplexed on this pin. Can also be configured as input to allow the 82786 to be synchronized with external sources. Even as input, window status still output when BLANK is low. RESET I RESET INPUT: internallysynchronized. Halts all activity on the 82786 and brings it to defined state. The leading edge of RESET synchronizes the clock to PH 1. The trailing edge latches the state of BH E # and M 10 to establish the type of Slave Interface. It also latches RD# and WR# to set certain test modes. ClK I DOUBLE FREQUENCY CLOCK OUTPUT: Clock input to which pin timings are referenced. 50% duty cycle. Vss,Vcc 4 Vss AND 2 Vee PINS. 7-204 E D 'M~W"~~"",OO"'~'G."~~~~"~'" Ie §Igo '"'~~ -~"'" COMPONENTS SPECIAL • Capacitors • Precision resistors • Shielding materials • Selecting electrolytics • Power MOSFETs for switchers Design AR-305 The first chip dedicated to text manipulation, the 82730 operates as a coprocessor to a host CPU and executes many high-level commands that reduce the software needed for processing text. Text coprocessor brings quality to CRT displays The quality of text in raster-scanning CRT displays has always been a tradeoff against the complexity, performance, and cost of the associated video system. By allocating many 'of the complex display functions to firmware, a dedicated text coprocessor chip, the first of its kind, replaces printed-circuit boards that contain more than 100 ICs while increasing sys~ tem performance by relieving many of the host processor's text manipulation tasks. The chip thus makes possible the high quality and high performance sought, without the need to compromise because of high design complexity and high cost of text-processing hardware. Though its speed makes the 82730 text coprocessor beneficial on its own, its utility can be enhanced considerably when working with the 82731 video interface controller. Together they provide proportional spacing, simultaneous subscript and superscript displays, dual cursors, dynamically reloadable character fonts, and user-programmable field and character attributes. By adding still anAnand Balaram, Product Marketing Engineer Andrew Volk, Project Manager Intel Corp. 3065 .Bowers Ave., Santa Clara, Calif. 95051 Reprinted from ELECTRONIC DESIGN- February 17, 1983 other chip, the 82720 graphics . display controller, the device can display high-resolution graphics and text at the same time. Housed in a 68-pin package, the 82730 text coprocessor combines a direct memory access channel and a processor bus interface that permit it to fetch its own instructions and data from the host system's memory, independent of and in parallel with the host CPU. The two processors communicate through messages-commands, parameters, and status words-which are placed in a communication block inside a shared memory. The host issues commands by preparing messages, storing them in the communication block, and directing the coprocessor's attention to them by activating a Channel Attention signal, which is implemented in hardware, In return, the coprocessor sets a flag in the shared memory that notifies the host when it has executed the command. The 29 high-level commands built into the 82730 breakdown into two groups: channel commands, which work at the system level to start and stop the display and to communicate status and similar information, and data-stream commands, which are incorporated directly into the display-data strings to govern the DMA process and control row 7-206 Copyright t983 Hayden Publishing Co., Inc. OROER NUMBER: 210932 Text coprocessor characteristics, character attributes, and so on. The 82730 resides on a local system bus with the host microprocessor, such as the 80186 CPU, and therefore provides the same address, data, and control signals as the main processor. By handling several of the tasks typically done by the host processor-like DMA control and display formatting-it leaves the host free for other tasks. For example, when the coprocessor is configured to share the CPU bus, a portion of the host microprocessor bus bandwidth must be devoted to the DMA process that refreshes the CRT. However, the 82730's high-speed intelligent DMA controller (operating at a maximum data rate of 4 Mbytes/s) helps minimize the time spent executing the refresh operation, while simultaneously handling the formatting of the display data. A different approach involves a dual-ported memory architecture, which places the memory between the CPU and the coprocessor. That completely frees the processor bus of the refresh activity, allowing the host more time to execute other tasks. It has become a more cost-effective method, as some dynamic memory controllers now contain dual-ported arbitration logic on chip. Inside the chip The basic architecture of the coprocessor is divided into two main parts: a memory interface and a display generator section (Fig. 1). The memory interface lets the coprocessor and the system pro- cessor communicate via the shared memory. The display generator, in turn, responds to the data provided by the memory interface and carries out the display operations. The memory interface actually comprises two smaller subsections, a bus interface unit and a microcontroller unit. The bus interface provides an intelligent connection from the 82730 to the host processor bus and also buffers the data transfer requests from the microcontroller. Upon initialization, the bus interface can be programmed for 8or 16-bit data and 16- or 32-bit addresses. Furthermore, the host interface can be configured for 8- or 16-bit-wide data buses, making the coprocessor compatible with 8- or 16-bit host processors, like the 8088/80188 and the 8086/80186. Running at 8 MHz maximum in 16-bit systems, the 82730 handles the maximum DMA rate of 4 Mbytes/s. The microcontroller unit stores the microinstructions for the 82730's high-level operations. The microcontroller's internal processor manages the memory transfers, interprets the commands embedded in the data stream, and executes those commands by sending data to the appropriate control registers or display data buffers. To optimize the transfer of data between the system and the CRT interface, the coprocessor uses three clocksone for the host interface, the other two for video data. The memory interface section runs from the bus clock, the CRT interface operates from a reference and a character clock. Microcontroller unit 1. Divided into two main sections-a memory interface unit and a display generator-the 82730 text coprocessor can operate at optimum speed since each section can function independently at a different clock speed. 7-207 210932 Although the coprocessor packs a considerable amount of processing power on a single NMOS chip, it cannot handle the high video dot rate needed to deliver high character counts to the CRT display. For that, it needs the 82731 video interface controller, which gains its high speed and drive capability from bipolar technology. In addition, the combination of the 82730 and 82731 succeeds in reducing the video interface to just a few latches and a software character generator residing in RAM or ROM (Fig. 2). Inside the 82731 are the reference- and characterclock generators, a video shift register, and all attribute logic (Fig. 3). Housed in a 40-pin package, the circuit offers TTL-compatible inputs and outputs except for the video output, which is ECLcompatible and provides a dot-shift clock rate of 50 MHz maximum on characters up to 16 dots wide. The circuit proportionally spaces characters by accepting the width sent from the character generator and sending an appropriate character-clock output whose period determines the variable width of the character to be displayed. The video interface controller can employ an inexpensive, low-frequency crystal and internally multiply that frequency to generate the highfrequency dot clock. It also supports control functions such' as screen reverse video, synchronized character field, and tabbing operations. The dot clock drives the internal video shift register, the character clock controls the unloading of data from the row buffers in the 82730, and the reference clock establishes the raster and screen formats. The reference clock also supplies the basic timing for the horizontal sync, blanking, border, and active display time. The corresponding vertical attributes-except border-are driven by thehorizontal line time. All seven of these screen parameters are programmable by the system designer with the 82730. System interlaces are simple As a coprocessor, the 82730 has the same buscontrol signals as an 80186 host processor and thus can share the system-bus controllers, drivers, and latches. The host processor and the 82730 arbitrate for control of the local bus through the Hold and Hold Acknowledge lines (HLD/HLDA). The Channel Attention (CA) and System Interrupt (SINT) control lines complete the wired interface. With this configuration, the 82730 has access to all the memory that the 80186 CPU has available. Anytime the CPU wants to send a message to the 82730, it writes the command and busy flag into the 82730 command block and then pulses the coprocessor's CA input to inform it that a message is waiting. The 82730 then raises the HOLD output and waits for access to the bus. When the CPU relinquishes the bus, it raises the HLDA input of ' the 82730. Once the 82730 becomes active, it transmits the command block address that was stored in its 2. A typical system built around the 82730 and the 82731 video interlace controller requires very lew additional les to mate with a host proca..or like the 80188. Only the sy.tem bus drivers, soma latches, and a character generator are 'needed. 7-208 210932 ',: Text coprocessor registers during initialization. That address, in conjunction with the appropriate memory control signals-including read or write strobes, lower or upper address latch enables, upper address output, or data enable output-will either read the command block or write to it. All these signals are coordinated by the bus clock. Whenever the 82730 must send status information to the host CPU, it gains control of the bus and places the data into the status location in the command block. The bus is then released and the coprocessor notifies the CPU through the SINT signal. When the coprocessor is using a dual-ported memory to communicate with the 82730, the HOLD and HLDA signals are not employed. Instead, the 82730 accesses the dual-ported memory directly rather than acquiring the bus from the CPU. When the display process is activated, the coprocessor uses its built-in DMA capability to fetch display data from the memory. The data consists of character data mixed with data-stream commands; embedded data-stream commands provide the fle~ ibility to manipulate data on the fly. Soft fonts loaded The 82730 also permits soft fonts to be automatically loaded into RAM-based character generators. Addresses and data stored in the system memory are then loaded into the row buffers of the coprocessor. During blanked rows (generally during the vertical retrace), address information is loaded into a latch and data is written to the character generator. 'fhe 82730's dual row buffers help reduce the bandwidth and access time requirements for the system memory. The data stored in one buffer is being used to display a row on the screen while the second buffer is being loaded, by the microcontroller, with the next display row from the system memory. Up to 200 characters can be stored and displayed by each row buffer. Furthermore, since the display generator section operates asynchronously with the microcontroller unit, each can operate at optimal speed. Processing is synchronized by internal flags and, shared internal storage, and data that will be displayed is exchanged through the row buffers. The coprocessor's display generator handles the data that defines the timing and the operation of the CRT interface. That data, which is stored in the display characteristics registers of the chip, controls every aspect of the display-from the screen's format to the blink rates of the characters and cursors. All the parameters that define the initial display characteristics can be set by one command-MODEST -thus reducing the time and 3. The 82731 video interface controller is manufactured with bipolar technology, enabling it to handle video dot rates of 50 MHz and higher, which are needed by high-charactercount displays. The controller serializes the parallel character out puis from the coprocessor and adds the desired attributes to each character. effort required to establish a screen format. Beneath the simplicity of the hardware shown in Fig. 2 are the high-level instructions-channel commands-and the data-stream commands. When combined with a table-driven linked-list data structure, they ease software development. Central to the software is the command block, through which all channel commands are transferred between the coprocessor and the host. This block is located within the shared memory, and its exact position is set during the 82730's initialization routine (Fig. 3a). Once established, it contains all the information needed to start the display-data fetch; to communicate status, interrupt, and cursor position information; and to give the location of the mode block, which contains all the parameters for setting up the display. The START DISPLAY channel command begins the sequence (Fig. 3b). Since the display data is set up within linked lists, the coprocessor can rapidly change any of the lists without shifting huge amounts of data. The display fetch starts with the value of the list-switch bit which selects one of two list-base pointers in the command block. The pointer points to its string pointer list; the pointers in that list direct the on-chip DMA to the data strings containing the desired display data and data-stream commands. The programmer can modify one pointer list while 7-209 210932 displaying .from the other, and can also switch screens merely by changing the list-switch bit, thus eliminating time-critical data manipulations. Two data-stream commands-End of String (EOS) and End of Row (EOR)-are key to the linked list and DMA activities. Strings are a logical concept: they contain blocks of contiguous data stored anywhere in memory. In contrast, rows are a physical concept and represent a block of characters that make up a physical row on the screen. Many strings can exist in a display row, or many rows in a string. (Only the extra DMA overhead of fetching the new string pointer sets a practical limit on the number of strings in each row.) The actions of the two. commands are indepen. dent. End of String tells the 82730 to get the next string pointer from the list, and from there, the next data string. End of Row suspends the DMA until the row buffers are swapped at the end of the current row. The DMA then takes over, into the new row buffer. String manipulation tasters high speed Strings are commonly the next level of text organization above single characters. With the 82730, a string can be as small as a character or it can be a word, row, sentence, paragraph, or a page of characters. These high-level entities can be moved merely by manipulating a small string pointer table (Fig. 5).. The heart of the algorithm for word wraparound, a common feature in text processors, can easily be accommodated by a single command such as the String Compare command of the 80186. Word wraparound is then achieved by scanning the data (not moving it) and manipulating a few pointers. Earlier system designs would have required a multiple-instruction software loop that scanned and moved every individual character. An extension of the linked list allows programmers to set up several independent data windows on the CRT screen in a virtual screen mode. That feature is especially helpful if a user wants both a menu window and one or more work-space windows. Such a scheme saves a lot of time for the end user-eliminating the back-and-forth movement between menus and working text. To set this up, several data structures, each with its own command block, can be accessed in a table-driven sequence to put data in a given window on the screen (Fig. 6). The string list and data strings are the same for regular or virtual modes; only the structure of their command blocks differs. Thus, each virtual window can be an independent software entity in the system, and the 82730 can present these independent data bases simultaneously. 4. Both the host CPU and the coprocessor go through an initialization sequence when Ihe compuler sY81em i8 r88el (a). The coproce8sor Ihen looks tor a START DISPLAY command so Ihal il can load Ihe various dala slrings tram Ihe syslem memory inlo Ihe display generalor. seclion, attach attrlbules, and display Ihe dala on Ihe CRT (b). 7-210 210932 Text coprocessor Multiple 82730s can also be used in a single system. Up to four devices can be clustered in a single system, with one serving as a system master and the others as slaves. The data for this cluster can be interleaved, permitting the cluster to work from one data base to get more characters per screen or more bits per character. Also, in the slave mode, the 82730's video outputs can be synchronized to an external video signal, giving the system such capabilities as mixed text and graphics, broadcast subtitling (text overlay), and overlays for video recording. Attributes enhance display quality The designers of the 82730 have given it the ability to highlight various areas of an on-screen document through the use of character and field attributes. In the 16-bit data word, for example, only the most significant bit is committed; it serves as the command or data designator. If set to 1, the word is a data-stream command, with the remaining 15 bits becoming one of the predefined instructions. However, if the MSB is 0, the other bits are at the discretion of the designer, who. may choose which and how many are needed for charac- ter codes, attributes, or user-defined functions. The 82730's six predefined attributes-reverse video, invisible, blinking character, two underlines, . and a special graphics character-can be programmed to respond to any of the 15 bits, or they can be completely disabled. In addition, they can be set character by character or through a fieldattribute mask. All can be attached to any character. The blinking clJaracter can be programmed for a wide range of duty cycles and blink rates. The two underlines can be independently positioned anywhere in the row height, and the position can be changed from row to row. Thus the underline can be doubled or serve as a strike-through line, a fraction line, or an overbar. One of the underlines can also be programmed to blink at the same rate as a blinking character. The graphics character is relatively important, since it permits character information to be displayed to the full height of the row. It causes the chip's line-counter output to count from zero at the top of the display row continuously through to the bottom of the row. When used with special characters, this attribute allows business forms and graphs to be easily constructed. S~ring List pointer 1 ' String 5. If a character or word must be inserted near the beginning of a screen of text, only the list pointers must be changed to add the item. In older systems, all the characters following the insertion ~r deletion were shilled in the memory to revise the display. 7-211 210932 Text coprocessor Another capability of the 82730 is subscript and superscript characters, done by manipulating the line-counter outputs. The SUB SUP N data-~tream command declares which and how many pairs of characters will be displayed simultaneously as subscripts and superscripts. Proportionally spaced displays could cause some subscript and superscript characters to have different widths and thus disrupt the vertical alignment of a character pair. A special output of the 82730 called Width Defeat prevents that misalignment by causing the 82731 video interface controller to enforce a predefined width-programmed upon system initialization-during the display of subscript and superscript characters. The proportional spacing is performed by the reference and the character clock. Used to shift out the character and attribute data, the character clock operates during the display field. Its frequency can vary character by character, up to a rate of 10 MHz, to set the width of the character currently being displayed. The video interface controller takes the character width information that has been supplied by the character generator and produces a variable width character clock that supports the proportional spacing. This approach also greatly reduces system complexity and cost compared with previous designs. Screen and row formals are flexible The reference clock signal in a system that contains the 82730 and 82731 chips is a constantfrequency clock that forms the time base to generate the horizontal scan lines and vertical frame periods. One scan line can last for 256 reference clock periods, and one frame can contain up to 2048 scan lines. Within these periods, the respective synchronization pulses and the border and charact~r fields can be set anywhere within that range. All these timing relationships, including the scan and frame periods, can be changed on a frame-byframe basis to suit changing applications. The screen format is flexible all the way down to the row level. For instance, the height of a row (up to 32 scan lines) and the vertical position of the characters within that row can be changed from row to row by a single data-stream command called FULROWDESCRPT. In addition, the command lets the programmer set the starting and ending scan lines within the row for the normal, subscript, and superscript character fields and the two cursors. The same data-stream command that defines the row characteristics can also be used to blank the row, display it as reverse video, double its height (for up to 64 scan lines per row), or eliminate the proportional spacing. Graphics, too, can be handled by the 82730, although flexibility and resolution are not as high as with the 82720 graphics display processor. Business applications typically need graphics that are no more complex than two- or three-dimensional charts or business forms. These formats can be stored as special characters in a standard font set for the character generator. Even more complex graphics can be handled through the use of mosaic graphic celis, which can be stored in RAM to permit alterations. Of course, as in most systems using floppy-disk systems for main storage, the desired fonts or graphics forms can be saved on the disks and downloaded as needed for the display. There are many applications that also require a simple graphic display along with text-signature verification on banking terminals and generalpurpose credit verification, for example.o 6. The virtual window capability of the 82730 lets the user arrange independent areas in the system memory that can be displayed simultaneousl! on the CRT monitor. 7-212 210932 ARTICLE REPRINT AR-297 PROCESSING VLSI Coprocessor Delivers High Quality Displays Many microprocessor-based systems today use VLSI technology in processing and memory components. However, designers of subsystems have, up until now, not been able to incorporate this technology into their products because of the lack of available ICs. When, in 1981, NEC introduced the 7220 graphics display controller, users found that they could bolster system performance by off-loading graphics control chores from the system CPU. Second-sourced by Intel as the 82720, the chip uses its own drawing processor to access the required positions in the bitmap and handles both processing and display functions. Now, Intel is poised to introduce a text coprocessor, the 82730, which is specifically tailored to execute. data manipulation and display tasks. Lucio Lanza of Intel explains, "In an intelligent terminal or workstation, the CPU spends a lot of its time manipulating both graphics and text. We have identified these areas in terms of CPU use and we have distributed these blocks so that the CPU is not overburdened.» Coprocessors fall into two cate- gories based on their architecture and operation. One type expands the microprocessor's own architecture by adding additional hardware and instructions. This type of tightly coupled coprocessor can be thought of as a transparent expansion of the microprocessor's architecture and works in sychronization with the CPU. Intel's first such coprocessor, the 8087, was designed Bus controls for numerics processing and increased the microprocessor's math performance as much as 100 times. The second type of coprocessor independently fetches its own data and sends instructions in parallel to the microprocessor. It therefore allows the microprocessor to process the tasks it handles best and delegate to the coprocessor the task it is best equipped to handle. In this cate- ADO·AD15 Char data Video controls I Memory interface Unit ..--1 ~ Display generator Andrew Wilson Technical Editor FIGURE 1: Block diagram of the 82730. Reprinted from ELECTRONIC IMAGING © April 1983, Morgan·Grampian Publishing Company, Boston, MA 02215 50 Order Number: 231307-001 7-213 Electronic Imaging 0 April 1 SB3 gory are 110 channel coprocessors and others that deal with communi· cations and text processing tasks. "The 82720 is not yet at this lev· el," Lanza said, "since it does not have the capability of going to mem· ory and extracting its own instruc· tion and executing it-it needs something to spoon feed it." Coprocessors of the second cate· gory do not monitor the CPU in· struction stream. Instead, they are linked to the CPU via messages pre· pared and stored in shared memory. The CPU will prepare data and high level directives and then place them in memory. Upon completion of this control block, the CPU will alert the coprocessor by signaling it through a common channel attention line. From that point on, the coprocessor works on its own, fetching required data and instructions and· then ex· ecuting those instructions. It is not synchronized with the CPU but works asynchronously and independently. When the coproces· sor completes its task, it informs the CPU by signaling on the CPU's in· terrupt line. The rationale for designing a co· processor with one or the other ar· chitectures depends on the applica· tion requirement. Tightly coupling the coprocessor with the CPU gives the advantage of a short coprocessor preparation time but has the draw· back of consuming the CPU's bus bandwidth. In the case of numeric process· ing, the speed of executing the float· ing point algorithm is of paramount importance. Reducing the prepara· tion time of the coprocessor task is the key because of the number of microseconds it takes to execute the task. Rapid algorithmic execution requires tight coupling. In the appli· cation of the 110 related coprocessor, the task execution time is much longer and the requirement for bus time can be much higher. And, for 110 operations the preparation time is not critical. A shared memory 52 FIGURE 2: Building block approach. coupling is preferred for those types of applications because it provides greater flexibility in the design of the bus structure. Text coprocessing "In the design of the 82730," said Lanza, "we have tried to eliminate all the known differences between what is visible on the screen and what is obtained on the printed page. In word processing systems to· 'day, even the length of a row on the CRT is sometimes not the same as the length seen in print. Clearly, when you are editing text this be· comes a major problem." The 82730 supports the genera· tion of text displays through features which include proportional spacing, simultaneous superscript/subscript, dynamically reloadable fonts and user programmable field and charac· ter attributes. Editing capabilities are further enhanced by features such as split screen, virtual win· dows, smooth scrolling and table· driven linked lists. Figure 1 shows a block diagram of the 82730. The chip is divided into two main sections-the mem· ory interface unit and the display generator. The memory interface unit provides the communication between the 82730 and the system processor, while the display gener· ator acts on the display data and car· ries out the display operation. , Communication between the 82730 and the CPU takes place through messages placed in commu· nication blocks in shared memory. The processor issues channel com· 7-214 mands by preparing these message blocks and directing the 82730's at· tention to them by activating a hard· ware channel attention signal (CA). The memory interface unit fetches and executes these commands. When the display process is activat· ed, the 82730 repeatedly fetches dis· play data and embedded datastream commands from memory utilizing its built·in DMA capability, ex· ecutes any datastream commands as encountered on the fly, and loads the row buffers with the display data. After executing these· commands, . the 82730 dears a busy flag in mem· ory, to inform the host CPU that it is ready for the next command. The memory interface unit is di· vided into two sections-the bus unit and the microcontroller unit. The bus interface unit provides the electrical interface to the system bus and the timing signals required for the microcontroller Unit oper· ations, making these operations transparent, to the microcontroller unit. The 82730 can be programmed during initialization to provide 8 or 16 bit data, and 16 or 32 bit addressing. The microcontroller unit contains the microinstruction store and the associated circuitry required for the execution of all channel and data· stream commands. It uses the bus interface unit in carrying out its memory access tasks such as loading the row buffers with display data. The interaction between the mi· crocontroller unit and the display generator takes place through shared internal storage. The microcon· 231307·001 Electronic Imaging 0 April 1983 "The device provides the ability to independently maximize the performance of the CPU." troller unit fetches data from memory and writes it in the internal storage, while the display generator reads from the internal storage and carries out the display operation. The microcontroller unit and display generator operate asynchronously with respect to each other. Synchronization is accomplished through communication via internal flags and display timing signals generated by the display generator. The internal shared storage consists of row buffers which store the display data and internal registers which store display. parameters. There are two row buffers each capable of storing up to 200 characters. The data in one row buffer is used by the display generator to display one complete character row on the screen, while the microcontoller unit is loading the second row buffer with display data fetched from memory. At the end of the row being displayed, the buffers are swapped and the microcontroller unit and display generator resume their tasks. The display characteristics registers contain all the information used to control every aspect of display characteristics from screen size to blink rates. A major portion of this register set is the three content addressable memory (CAM) arrays that allow flexible timing control for row and screen characteristics. The user has the power to set the parameters for the entire screen by invoking a single high-Ievel'command. By separating the video interface clocks from the bus interface clock, the 82730 provides the designer with the ability to independently maximize the performance of the CPU and video sections of the system. The video interface consists of two independent clocks: the Reference Clock (RCLK) and the Character Clock (CCLK). While the RCLK controls the raster timing and defines the screen layout, the CCLK independently shifts character and attribute information out of 54 the 82730, which allows proportional spacing to be achieved. Combining text and graphics A major requirement in the design of engineering workstations is the simultaneous display of both text and graphics. In terms of graphics requirements, the designer of such systems needs a drawing processor for fast geometric primitives, a math processor for fast transformations and a general purpose processor for access to the graphics database. For text, string processing is needed for manipulation of text primitives and database processing is needed for access to the document files. The solution to this problem can be solved by using both the 720 graphics coprocessor and the 730 text coprocessor (Figure 2). Both coprocessors work with Intel's new 82586 communications coprocessor. This works in conjunction with a CPU and the appropriate software to provide local area network (LAN) control capabilities. Message data to be placed on the network by a microprocessor-based work station is stored in shared memory in transmit blocks. Pointers (starting address information) to these blocks are stored along with processing instructions in other shared memory blocks. Status information and overall directives are stored in system control blocks which serve as the mailbox between the CPU and the 82586. When alerted by a channel attention signal, the 82586 will perform a host of tasks involved in accessing data to be transmitted from its location in memory, framing the message packets containing the data and seeing to the transmission on the network medium. In addition, the 82586 receives and buffers incoming data which it then stores in shared memory for the CPU to collect. It is the CPU's job to allocate the blocks of memory for the LAN coprocessor to store the received packet data~ ,. 7-215 231307-001 Electronic Imaging 0 April 1983 ARTICLE REPRINT AR-296 September 1983 "Repn!1te:d by permission of PC World from Volume 1, Issue 5, published at 555 De Haro Street, San FrancIsco, CA94107." "Subscription rates $24/yr. PC World Circulation Department, PO Box 6700, Bergenfield, NJ 07621 7-216 Order Number 230810-001 Something exciting is going on. But like most significant events, it is not happening quickly. Spurred on by developments in integrated circuit technology, a new generation ofpersonal computers is taking shape, and the IBM PC and its clones are at theforefront. As IBM PC users, it's sometimes hard to remember that the inanimate metal boxes in front of us are susceptible to evolution. But occasionally a product is introduced that forces the complete redesign of our personal computers. Integrated circuits (lCs), the devices that bring intelligence to our machines, have reached a new level of technological achievement, and now the computers that use them must advance as well. Strange as it seems, these small silicon chips are setting the guidelines for the next generation of personal computers. THE CHIP MAKERS Now that personal computers have caught on, the semiconductor manufacturers who make ICs are eyeing the swelling market for personal computer ICs. Dozens of newly developed semiconductor chips are being aimed at the personal computer market. These chips range from hard disk controllers that speed access time to linear predictive coding processors for speech recognition. With these new ICs driving personal computer design, we'll soon see machines we once only reasoned would exist: diskless computers running a wide array of software loaded over telephone lines; computers that display text exactly as it will be printed, with justified margins, superscripts and subscripts, and bold and italic typefaces on screen; and systems with greater, more accessible graphics. As computer design is simplified by these advanced ICs, product differentiation will become greater. This portends the death of those PC clones capable only of basic spreadsheet and word processing operations. Instead, to survive in the increasingly cost-competitive, standardized personal computer market, small-system manufacturers will tailor their products for niche markets. BIG BLUE Intel Corporation, located in Northern California's renowned Silicon Valley, is one of the largest and most innovative chip manufacturers in the industry. IBM has been committed to Intel products for years; the PC is built around Intel's 8088 microprocessor and, as recently as late 1982, IBM invested $225 million in a minority share of Intel stock. A commitment this size is a good indicator of IBM's faith in Intel products. IBM's good faith and multimillion-dollar investment is guaranteed by Intel's long-standing promise that software written for the 8088 will run on all its future processors. By taking a close look at the Intel ICs, we can gain valuable insight into the capabilities of the IBM PCs that will be built around them. The design philosophy of Intel's IC family differs radically from that of competitors Motorola, 7-217 National Semiconductor, and Zilog. Diverse chip designs mean that the system designs of the IBM PC and its competitors, such as Apple's Lisa (based on the Motorola 6800 microprocessor), will also be radically different. THE MICROPROCESSORS Of the many Intel chips being produced, some will have a greater impact on the computer industry than others. In the vanguard will be the new microprocessors. Design of the PC was shaped by IBM's surprising selection ofthe 8088. This choice caught most industry observers off guard since IBM, also the world's largest semiconductor manufacturer, had traditionally used its own designs for computer logic. Once Big Blue settled on the 8088, Intel's design philosophy was firmly implanted in the PC-from the 8088's segmented memory scheme to its 16-bit registers and 8-bit bus. Like the 8088, each of the four microprocessors Intel is now readying for production could dramatically influence the design and performance of tomorrow's PCs. The 80186. The recipe for putting an entire central processing unit (CPU) board on one chip is easy. Take an; 8086 (the 16-bit bus big brother of the 8088), speed it up, and then add most of the support chips essential to making the 8086 run in a personal computer. Reduce the size with the help of computer-aided design until all the chips fit onto one sliver of silicon, and voila. you have the 80186 (186), an entire motherboard on a chip. While firming up plans for full-scale production of the 186, Intel is currently providing samples of the chip to computer manufacturers, including MAD Computer and Durango Systems. The rewards for using this newest chip are many: manufacturing costs are cut since a single IC is less expensive to buy than a boardful of them; physical CPU size is reduced, opening the way to shrink overall computer size or to put more power in the same box; and development time is cut for computer designers, which means considerable savings for system makers. The 80188. If the 186 is too rich for your taste, the 80188 (188) may be more suitable. As with the 186; the 188 's core CPU and support chips are melded on a single IC; like the 8088, however, the 188 has an 8-bit interface to the outside world (the 186 has a 16-bit interface). The 188 decreases costs by allowing computer manufacturers to use less expensive 8-bit peripherals. Although the 186 has received more publicity so far, the 188, aimed squarely at the massive 8-bit computer market, is expected to be used in greater numbers, at least in the short term. The 80286. Powerful multiuser systems will benefit the most from the 80286 (286), possibly the most powerful microprocesor commercially available to date. Squeezing 150,000 transistors on a chip, the 286's designers have integrated a pair of HMOS-III (Intel's own proprietary process technology) 8086s and numerous other very large scale integration (V LSI) components. The resultant chip is two to three times faster than the Motorola 68000 even though both chips can address about the same amount of 230810-001 memory. The 286 has very high speed (1.5 million instructions per second, five to six times faster than the 8086), about 16 megabytes worth of addressable physical memory, the ability to address a virtual memory of I gigabyte per task (equal to the capacity of 100 IBM XT Winchester drives), and the ability. to provide several layers of muiltiuser security on chip. Since the 188 is ideal for low-priced portable computers, it ceates the ironic probability that a PC-compatible portable may soon by available that will run the IBM PC's full line of software and run it faster than the full-sized PC. SOFTWARE ON SILICON One chip ready to plug into the next generation of personal computers is the 80150 (150) CPj M software-in-silicon operating system. A complete CPj M-86 operating system is stored in ROM on this chip, along with drivers forinput and output devices. The 80386. Not yet built, the 80386 (386) is promised for 1984, but the release date may slide to 1985. If the 286 is vastly more powerful than the 8088 or 8086, then the 386 's potential is staggering. Complementary metallic oxide semiconductor(CMOS) process technology, which lowers power consumption, is being used to build this 32-bit chip. Intel, Motorola, and National Semiconductor are already jockeying for position in what will be an intense competition for the 32-bit market. Motorola is claiming that its 68020 will be the first widely available 32-bit microprocessor when it is introduced later this year, although NCR has already scooped the industry with its 32-bit chip. Hewlett-Packard, not to be outdone, has put 450,000 transistors on a single proprietary 32-bit microprocessor, which is used in the $20,000 to $30,000 HP 9000 work station. Use of a 150 CPj M chip will eliminate the traditional booting up procedure of loading an operating system disk and reading its contents into operating RAM. Instead, the user will simply turn on the computer and press a CPj M86 button. Again and more importantly, this chip lowers overall computer production costs since a disk drive and attendant control circuits are replaced by a solitary chip. Another chip, similar to the 150, has Intel's proprietary RMX operating system in silicon. This little-known RMX chip is also suitable for present and future IBM PCs. Many people question the wisdom of putting software in silicon. "Software should be soft," says Bill Gates, chairman of the board at Microsoft. He points out that operating systems are constantly updated; for instance, Microsoft will soon offer a revised version of MS-DOS that supports networking. Such updates can't readily be added to a hardware production line and certainly won't help the ROM chips already in users' computers. How will these processors impact the personal computers that use them? The most obvious effect will be faster performance. Even the budget model 188 boasts two to five times the instruction and execution speed of the 8088 in today's PC. A 286 is about twice again as fast as the 188, and next year's data-gobbling 386 will have more speed than anyone can immediately use. Ir--_ _ _ _ _ _ _ _~ I 8088 Or I CLOCK 8086 PROGRAM MEMORY DATA MEMORY I I . L-__~IN~T~ER~R~U~PT~S~C~~~u~s----------~~~ 8384A CLOCK DRIVER ROY I I I INTERRUPT STATUS I 80150 CLOCK '-------'---I J~'"'''' ACKNOWLEDGE BAUD RATE DELAY riMER TIMER SYSTEM TIMER IAPX 86/50. 88/50 BLOCK DIAGRAM OF INTEL'S 80150 CP/M ON A CHIP WITH THE 8088 OR 8086 MICROPROCESSPR 7-218 230810-001 Still, Intel argues that its choice of CP/ M makes the ISO practical. "We picked CP/ M because it is a mature operating system," Says Intel's product marketng engineer for software on silicon, Carl Buck. "We'd have more difficulty with a less developed product." The many versions of MS-DOS helped eliminate that operating system from consideration. Yet according to Digital Research President John Rowley, Intel left some room on ·the ISO chip to add to CP/M in the future. Also, use of the 150 CP/M chip doesn't preclude the use of other operating systems. PC-DOS could still be loaded into a system and run, making use ofthe ISO's input/ output drivers. PORTABLES Having software on silicon opens the way for very powerful diskless portable computers. The minimum configuration for a 188-based unit with the ISO CP/ M operating system could include one or two BASIC applications programs in ROM, providing spreadsheet and word processing power in a unit the size of a keyboard with a small flip-up screen. Intel Product Marketing Engineer Tony Zingale suggests we may soon see truly usable portables selling for around $500. More ambitious and expensive portables could accept applications software over telephone lines, loading them into a variety of media. Several memory technologies will compete for room in portable computers, including magnetic bubble memories, already being used in the Grid and Teleram computers. Commercially available.bubbles have 4 megabit capacity, while 10- to 16-megabit bubbles are projected for the near future. Japan's NEC reported a major breakthrough that within 5 years will allow bubbles to store I gigabit of data. Of course, 8 of those bits are needed to store I byte of data. Vying with bubbles in some applications and complementing them in others are electronically programmable read-only memories, or EPROMs. Like ROM, EPROMs are nonvolatile chips. Unlike ROM, EPROMs can be reprogrammed. Intel now offers 256K EPROMs, and it is anticipated that other companies will offer 256K EPROMs before the year's end. GRAPHICS The space created on the motherboard by the 186 and friends will enable computer designers to add more graphics capability to their systems. Like the 150 there are co-processor chips ready for the task. A pair of Intel ICs, the 82720 (720) graphics display controller and the 82730 (730) text co-processor, are touted as providing vastly enhanced and simplified displays. With the 730, text can be displayed on the computer screen as it will be printed out. Italics can be mixed with straight text, and superscripts and subscripts are shown without the annoying and often misleading arrows common in today's software. Editing can be speeded up by the 730's support for split screens, multiple windows, dual cursors, smooth scrolling, and table-driven linked lists. Displays of up to 200 characters per row and 128 lines per screen can be supported, and unique character sets, such as Arabic or Japanese, can be built. Even more capability can be added though the 720, an IC that works with or without the 730. Introduced in September 1982, the 720, a joint effort between Intel and NEC, is said to be integral to graphics plans for NEC's 8086-based Advanced Personal Computer. One application in which the 720 and 730 will shine is opening windows on-screen. Most computer users are familiar with the ability of Apple's Lisa to link spreadsheets, graphics, and word processing through mUltiple displays, or windows, on one screen. Lisa uses memoryhungry software and dedicated hardware. Apple's initial release uses I full megabyte of RAM, and Lisa will soon be offered with 4M of internal memory in addition to a mandatory 5M hard disk. For comparison, the IBM PC, limited by the range of the 8088, can address I M tops. VisiCorp's Visi/ ON promises Lisa-like graphics and program-linking capabilities for the IBM PC, with lower memory demands and no dedicated hardware other than a mouse. Although Visa/ ON supposedly runs faster with an 8087 math co-processor, VisiCorp will not comment on whether its software will make use of the 720 or the 730. BIT-MAPPED GRAPHICS Both Lisa and Visa/ ON use bit-mapping, a process that the 720 and the 730 are said to simplify. In plain words, to create an image on-screen, the electron gun that illuminates the screen must be positioned and then turned on and off. Data to do this is stored in RAM as a bit-map memory corresponding to positions of pixels lit on the screen. For one-level monochrome displays, I memory bit describes each pixel; for color and levels of grey, several bits must be used to describe each pixel. Creating images is a lengthy chain of simple operations. In a system that uses the 8088 alone, the microprocessor is heavily burdened and the software runs slowly. Using complementary chips to take up part of the processing chore will speed up the process considerably. This is where the 720 and the 730 come in By doing tasks such as looking up and manipUlating a library of commonly used figures, quickly accessing the bit-map memory, and rewriting the bit map, both chips speed text and graphics operations. FLAT VS. SEGMENTED MEMORY Use of the 720 and the 730 demonstrates Intel's design philosophy and how this philosophy impacts the IBM PC. Computers such as Lisa that are based on the Motorola 68000 have a flat memory, while computers based on the 8088 or 8086 use segmented memory. According to Intel, 7-219 230810-001 segmented memory (see "How the PC thinks," PC World. Vol. I, No. I) works better for text and graphics manipulation than its flat counterpart. Ordinarily in processing any string of characters, changing a single letter in a string of text means repositioning every character in a document. But since segmentation uses pointers to locate data in memory, only the pointers locating the beginning and the end of a passage of text have to be changed. Similarly, pointers in memory can be used to position bit-map data corresponding to mUltiple windows on-screen, eliminating the need to recalculate and manipulate the entire bit map. Segmented vs. flat memory has become somewhat of a religious issue in the semiconductor industry. Intel and Motorola also differ on how much burden to put on the CPU. Motorola's 68000 is faster than the 8088 and the 8086 and can address more memory than either of those chips or the 188 or the 186. But the 186 and the 286 are substantially faster than the 68000. Also, the 286's ability to address 16M opens the way to using large memory segments, strengthening Intel's case for segmented memory. In many 68000-based high-end systems the computer designers have decided to use a co-processor, either bit slice, or in one case, an 8086, to do graphics. Many people are skeptical of Intel's graphics approach, but Intel maintains that its approach will allow computer designers greater flexibility. In an ultimate system, mUltiple 720s and 730s could be combined to handle interactive windows under the direction of a 286 processor, while more complex imagery (beyond the practical ability of bitmapping) could be managed by an 80287 math coprocessor, the next generation cousin of the 8087. The creation of three-dimensional graphics that can be rotated on screen foradvanced computer-aided designand manufacturing systems, for instance, is best handled by Vector Graphics rather than bit-mapping. 7-220 SOFTWARE DEMANDS Yet there is more to computer design than hardware. Software must be written to take advantage of the new IC's promise. In the case of the 286, no operating system yet exists that can take full advantage of its operating capabilities. Plug-ins currently on the market that add the 286 to the IBM PC provide little more than a faster 8086. Only new opera ting software will use the new chips to their fullest potential. One solution on the horizon is a 286 version of XENIX due to be introduced mid-1983. XENIX, a multiuser operating system with a visual shell similar to MS-DOS, is a takeoff on Bell Labs' UNIX operating system. A licensing agreement among Intel, Bell Labs, and Microsoft, the author of XENIX and MS-DOS, is reported being negotiated. Negotiations between Intel and Digital Research to provide a CPI M variant for the 286 have been underway for some time but have reportedly stagnated. For lower-end systems Microsoft is said to be upgrading MS-DOS to accommodate networking. This advance comes at the right time, as the 188 and 186 open up sockets that could be used for local area network chips such as the programmable Ethernet chip from Intel. As long as software and hardware keep growing rapidly together, PC users will be offered a continuing stream of improved computers and ever more capable plug-in boards. The variety seems endless and next year's crop exciting. 230810-001 Eraseable/Programmable Logic Devices 8 5C121 1200 GATE CHMOS H-SERIES ERASABLE PROGRAMMABLE LOGIC DEVICE • High Performance LSI Semi-Custom Logic Replacement for Gate Arrays and Conventional Fixed Logic • EPROM Technology Based. UV Erasable • Advanced Architecture Features Including Programmable Output Polarity (Active High/Low), Register By-Pass and Reset Controls • Programmable Macrocell and I/O Architecture; up to 36 Inputs or 24 Outputs, 28 Macrocells Including 4 Burled Registers • Programmable Clock System for Input Latches and Output Registers • Product-Term Sharing and Local Bus Architecture for Optimized Array Performance • All Inputs are Latchable with a Programmable Latch Feature • Compatible with LS TTL and 74HC CMOS Logic • High Speed tpD (Max) 50 ns Operating Frequency (Max) 15 MHz • Register Pre-Load and Erasable Array for 100% Generic Testability • Low Power; 15 mW Typical Standby Dissipation • Typical Usable Gate Count of 1200 2-lnput NAND Gates • Programmable "Security Bit" allows total protection of proprietary designs • Available In a 40-Lead Window Cerdlp Package (See Packaging Spec, Order #231369) The Intel 5C121 H-EPLD (H-series Erasable Programmable Logic Device) is an LSI logic circuit that is user customizable through programming, This device can be used to replace gate arrays, multiple programmable logic arrays and LS TIL and 74HC CMOS SSI and MSI logiC devices, The logic capacity of the 5C121 is typically equal to 1200 two-input NAND gates, The 5C121 H-EPLD uses CHMOS· EPROM (floating gate) cells as logic control elements instead of fuses, Use of Intel's advanced CHMOS II-E EPROM process technology enables greater logic densities to be achieved with superior speed and power performance. The EPROM technology also enables these devices to be 100% factory tested by the programming and the erasure of all the EPROM logic control elements in the device. The architecture of the 5C121 is based on the 'Sum of Products' PLA (Programmable LogiC Array) structure with a programmable AND array feeding into a fixed OR array. Flexibility in accommodating logical functions without the overhead of unnecessary product terms or speed penalties of programmable OR structures is achieved through the provision of a range of OR gate widths as well as through product term sharing. The use of a segmented PLA structure with local and global connectivity allows for further improvements in performance. The 5C121 also contains innovative architectural features that provide extensive Input/Output flexibility. ·CHMOS is a patented process of Intel Corporation. RECOMMENDED OPERATING CONDITIONS Symbol Parameter Min Max Units VCC VI Supply Voltage 4.75 5.25 INPUT Voltage 0 VCC V Vo OUTPUT Voltage 0 TA Operating Temperature Vcc 70 V ·C tR INPUT rise Time 500 ns tF INPUTfall Time 500 ns 0 Pin Configuration elK1 V '"111 I 1/0, a ',2 7 1/°2 I/O, I/0.. I/O~ I/O. I/0, 14 I/O, 15 I/Oi 1/°10 1/°11 1/012 290098-1 ILLUSTRATIONS COURTESY OF ALTERA CORPORATION. Intel Corporation assumes no responsibility for the use of any circuitry other than circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. September 1985 @) Intel Corporation, 1985 8" 1 Order Number: 290098-001 inter 5C121 ARCHITECTURE DESCRIPTION MACROCELL 1/0 ARCHITECTURE The 5C121 H-EPLD has 12 dedicated inputs as well as 24 Input/Output pins. All inputs to the circuit (both dedicated and lID inputs) may be latched using transparent 7475 type latches. In addition to these 36 input latches, 28 D type registers are also provided. The Input/Output architecture of the 5C121 macrocell (see Figure 1) can be programmed using both static and dynamic controls. The static controls remain fixed after the device is programmed whereas the dynamic controls may change state as a result of the signals applied to the device. The internal architecture of the 5C121 H-EPLD is based on 28 macrocells. Each macrocell (see Figure 1) contains a PLA structure (programmable AND array product terms connected to an OR gate) and an lID architecture control block (with a D flip flop) that can be programmed to create many different output logic structures. This powerful lID architecture can be configured to support both active-high, activelow, 3-state, open drain and bi-directional data ports all on a 4-bit wide basis. They can also act as inputs on a nibble wide basis with optional input latching. The static controls set the inversion logic (i), register by-pass (ii) and input feedback multiplexers (iii). In the latter two cases these controls operate on four macrocells as a bank. The buried-state registers have simpler controls which determine if the feedback is to be registered or combinational. The inversion control logic, marked (i) in Figure 1, is achieved by programming the EPROM control bit connected to the same XOR gate as the output from the PLA structure. ProgramlT'i'lg or erasure of this EPROM element toggles the OR gate output of the PLA between active-high and active-low. The inversion control operates on an individual macrocell basis. Macrocells in each half of the circuit are grouped . together for lID architecture programming. Each bank of four macrocells can be further programmed on an individual macrocell basis to generate active high or active low outputs of the logic function from the PLA. The register by-pass control, marked (ii) in Figure 1 allows the PLA output to either flow through the D flip flop as a registered output or by-pass the flip flop and be a combinational output. The primary logic array of the 5C121 is segmented into two symmetrical halves that communicate via global bus signals. The main array contains some 15104 programmable elements representing 236 product terms (AND gates) each containing 64 input signals. The dynamic controls consist of a programmable input latch-enable as well as reset and output enable product terms. The latch-enable function is common throughout the 5C121 and once chosen this function will latch all the inputs. This function is programmed by the clock control block but may also be driven by input signals applied to pin 1 (see clock modes-Table 1). The macrocells share a common programmable clock system (described in a later section) that controls clocking of all registers and input latches. The device contains 8 modes of clock operation that allow logic transition to take place on either rising or falling edges of the clock signals. The reset and output-enable controls are logically controlled by single product terms (the logic AND of programmed variables in the array). These terms have control over banks of four macrocells. The circuit further contains four macrocells whose outputs are not tied to any lID pin but feedback into the array to create buried state-functions. The feedback path may be either the registered or combinational result of the PLA output. The use of the buried state macrocells provides maximum equivalent logic density without demanding higher pin-count packages that consume valuable board space. The output-enable control may be used to generate architecture types that include bi-directional, 3-state, open drain or input only structures. 8-2 intJ 5C121 . I/O ARCHITECTURE BLOCK EPROM CONTROL BIT 290098-2 Figure 1. 5C121 Macrocelll/O Architecture The global busses (Input bus & Global feedback from A-3 & B-3 macrocells & buried registers) are made up of 48 conductors that span the entire chip. These 48 conductors carry the TRUE and COMPLEMENT of the twelve primary inputs (pins 2 through 7 and 33 through 38), signals from 4 Buried Registers as well as the global outputs of 8 macrocells in groups A-3 and B-3. INTERNAL BUS STRUCTURE The two identical halves of the 5C121 communicate via a series of busses. The local bus structure that is used for communication within each half of the chip contains 16 conductors that carry the TRUE and' COMPLEMENT of 8 local macrocells. In the block diagram (Figure 2) of the 5C121 the local macrocells are B-1 and B-2 on one half and A-1 and A-2 on the other half. 8-3 inter 5C121 A-1 MACROCELLS WODE @@@ Cklor IYCl(2 Ill: elK cw ill! rYe", elK1 elK1 1 coo 1 elK1 elK1 ru2 ctKi ill2 CiJ('i ClK2 elK' CLK2 [=[RAS£D P",PROGRAIIIWtO elK IlE B-1 MACROCELLS 290098-3 Figure 2. 5C121 Block Diagram 8-4 inter A-2 MACROCELLS 5C121 A-3 MACRO CELLS 290098-4 Figure 2. 5C121 Block Diagram (Continued) 8-5 inter 5C121 LOCAL BUS GLOBAL BUS INPUT BUS In this illustration a small group of 4 product-terms is shared by groups containing 8 product-terms each. This feature is most useful in counter applications where common terms exist in the functions. DETAILED CIRCUIT REPRESENTATION -0- = 64 INPUT AND GATE (ONE PRODUCT TERM) 290098-5 Figure 3. Shared Product-Term Circuits 8-6 intJ 5C121 is adjacent to their macrocell (see Figure 4) so that they may produce a logical AND of any of the variables (or their complements) that are present on the busses. SHARED PRODUCT TERMS Macrocells 9 & 10,11 & 12, 17 & 18 and 19 & 20 (in groups A-3 and 8-3-the macrocells with global feedback) have the facility to share a total of 16 additional product terms. This sharing takes place between pairs of adjacent macrocells. This capability enables, for example, macrocells 9 and 10 to expand to 16 and 8 effective product terms respectively, and for macrocells 11 and 12 both to expand to 12 effective product terms. Figure 3 shows this sharing technique in detail. This facility is primarily of use in state machine and counter applications where common product terms are frequently required among output functions. All macrocells have the ability to return data to the local or the global bus. Feedback data may originate from the output of the macrocell or from the 110 pin. Feedback to the global bus communicates throughout the part. Macrocells that feedback to the local bus communicate only to their half of the 5C121. Connections to and from the signal busses are made with EPROM switches that provide the reprogrammable logic capability of the circuit. Macrocells in groups A-3 and 8-3 and the buried registers all have global bus connections while macrocells in groups A-1, A-2 and 8-1, 8-2 have only local bus connections (see 810ck Diagram, Figure 2). Advanced features of the Intel Programmable Logic Development System will, if desired, automatically select an appropriate macro cell to meet both the logic requirements and the connection to an appropriate signal bus to achieve the interconnection to other macrocells. MACROCELL-BUS INTERFACE As discussed earlier, the macrocells within the 5C121 are interconnected to other macrocells and inputs to the device via three internal data busses. The product terms span the entire bus structure (local feedback, global feedback and input buses) that At each intersecting point in the logic array there exists an EPROM-type programmable connection. Initia/ly, a/l connections are complete. This means that both the true and complement of a/l inputs are connected to each product-term. Connections are opened during the programming process. Therefore any product term can be connected to the true or complement of any input. When both the true and complement connections of any input are left intact, a logical false results on the output of the AND gate. If both the true and complement conn9ctions of any input are programmed open. then a logical "don't care" results for that input. If a/l inputs for a product term are programmed open, then a logical true results on the output of the AND gate. EPROM@ CELL II CONNECTION 64 INPUT AND GATE "-... EPROM CELL ARCHITECTURE SWITCH FEEDBACK SIGNALS LOCAL BUS GLOBAL BUS INPUT BUS 290098-6 Figure 4. Macrocell·Bus Interface 8-7 inter 5C121 a minimum of fifteen (15) Wsecl cm 2 . The erasure time with this dosage is approximately 15 to 20 minutes using an ultraviolet lamp with a 12,000 p.W/cm 2 power rating. The 5C121 should be placed within one inch of the lamp tubes during erasure. The maximum integrated dose the 5C121 can be exposed to without damage is 7258 Wsec/cm 2 (1 week @ 12,000 p. W I cm 2). Exposure to high intensity UV light for longer periods may cause permanent damage. CLOCK MODE CONTROL The 5C121 contains two internal clock data paths that drive the input latches (transparent 7475 type) and the output registers. These clocks may be programmed into one of 8 operating modes (see clock mode Table 1). Figure 1 shows a typical macro cell which is driven by the master clock signal ClK and the ·input latch-enable signal I LEo The master clock signal is input via pin 1. If programmed modes 4, 5, 6 & 7 are chosen, a second clock signal is required which is input via pin 38 (see Figure 5). Table 1 shows the operation of each clock programming mode. FUNCTIONAL TESTING Since the logical operation of the 5C121 is controlled by EPROM elements, the device is completely factory tested. Each programmable EPROM bit controlling the internal logic including the buried state registers are tested using application-independent test program patterns and erased before shipment to customers. If modes 0, 1, 4, 5, 6 or 7 are chosen (Le. latching of the inputs is required), all inputs, both dedicated and liD, are latched with the same IlE signal. Data applied to the inputs when ClK1 is low (high) is latched when ClK1 goes high· (low) and will stay latched as long as ClK1 stays high (low). levels shown in parenthesis are for modes 1, 5 & 7 and levels shown outside parenthesis are for modes 0, 4 & 6. To enable functional evaluation of counter and state-machine applications, the 5C121 contains register pre-load circuitry. This can be activated by interrupting the normal clocked sequence and applying Vpp on pin 2 to engage the pre-load state. Under these conditions the flip flops in the 5C121 can be set to any logical condition and then return to normal operation. This process simplifies the input sequences necessary to evaluate the counter and state machine operations. Care is required when using any of the clock modes 4, 5, 6 or 7, that require two input clock Signals to ensure that timing hazards are not created. ERASURE CHARACTERISTICS The erasure characteristics of the 5C121 are such that erasure begins to occur upon exposure to light with wavelengths shorter than approximately 4000A. It should be noted that sunlight and certain types of fluore~cent lamps have wavelengths in the 30004000A. Data shows that constant exposure to room level fluorescent lighting could erase the typical 5C121 in approximately three years, while it would take approximately one week to cause erasure when exposed to direct sunlight. If the 5C121 is to be exposed to these types of lighting conditions for extended periods of time, conductive opaque labels should be placed over the window to prevent unintentional erasure. DESIGN RECOMMENDATIONS For proper operation it is recommended that input and output pins be constrained to the range GND < (VIN or VOUT) < Vee. Unused inputs should be tied to an appropriate logic level (e.g. either Vee or GND) to minimize device power consumption. When utilizing a macrocell with an liD pin connection as a buried macrocell (Le. just using the macrocell for feedback purposes to other macrocells), its liD pin is a 'reserved pin'. (The Intel Programmable logic Development System will label the pin 'RESERVED' in the utilization report that it generates.) Such an liD pin will actually be an output pin and should not be grounded. It should be left unconnected such that it can go high or low depending on the state of the macrocell's output. The recommended erasure procedure for the 5C121 is exposure to shortwave ultraviolet light which has the wavelength bf 2537A. The integrated dose (Le., UV intensity x exposure time) for erasure should be In normal operation VeelVpp (pin 40) should be connected directly to Vee (pin 39). 8-8 intJ 5C121 Table 1. Clock Programming (Key: L Programmed Mode Input Signals . Are Latched When: = Latched; T CLK1 (Pin 1) 1 CLK1 (Pin 1) 2 Inputs Not Latched CLK1 (Pin 1) 3 Inputs Not Latched CLK1 (Pin 1) 4 CLK1 (Pin 1) 5 CLK1 (Pin 1) 6 CLK1 (Pin 1) 7 CLK1 (Pin 1) --v...1""- --v...1""- --v- Transparent) Output Registers Change State When: 0 ...1""- = L T CLK1 (Pin 1) T L CLK1 (Pin 1) L T CLK2 (Pin 38) T L CLK2 (Pin 38) L T CLK2 (Pin 38) T L CLK2 (Pin 38) Clock Configuration 1 Clock '-- 1 Clock f 1 Clock '- 1 Clock f 2 Clocks ''- 2 Clock 2 Clocks f .£ CLOCK SIGNALS TO 'A' HALF OF CIRCUIT 2 Clocks = ClK REGISTER CLOCK IlE = INPUT lATCH ENABLE IlE ClK ....- - - - - - , ClK IlE "CLOCK CONTROL lOGIC" ClK (PIN 1) 13 14 15 r-;;ClK2 OPTIONAL SECOND '(~IN 38) CLOCK INPUT I 290098-7 Figure 5. Programmable Clock Control System 8-9 intJ 5C121 • Notice: Stresses above those listed under ''Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability. ABSOLUTE MAXIMUM RATINGS* Min Max Units Vcc Symbol Supply Voltage(l) Parameter -2.0 7.0 V Vpp Programming Supply Voltage(l) -2.0 13.5 V VI DC Input Voltage(l )(2) -0.5 VCC+ 0.5 ICC DC VCC Current(4) V 100 mA 'c 'c Tstg Storage Temperature -65 + 150 Tamb Ambient Temperature(3) -10 +85 NOTES: 1. Voltages with respect to ground. 2. Minimum DC input is -0.3V. During transitions, the inputs may undershoot to - 0.2V for periods less than 20 ns under no load conditions. 3. Under bias. 4. With outputs tristated. D.C. CHARACTERISTICS TA Symbol = 0' to 70°C VCC = 50V + - 5% Parameter Conditions Min Typ Max Unit VIH HIGH Level Input Voltage 2.0 Vcc+ 0.3 V VIL LOW Level Input Voltage -0.3 0.8 V VOH HIGH Level Output Voltage 10 = -4.0 mA DC VOL LOW Level Output Voltage 10 = 4.0 mA DC 2.4 V 0.45 V II Input Leakage Current VI = Vcc or GND ±10.0 p.A loz 3-State Output Off-State Current Vo = Vcc or GND ±10.0 p.A Vcc Supply Current (Standby) (Note 6) VI = VCC or GND 10 = 0 CMOS Inputs 3 mA TTL Inputs 30 Vcc Supply Current (Active) No Load f=10MHz ICCl ICC2 los '. Output Short Circuit Current CMOS Inputs 50 TTL Inputs 100 (Note 5) mA 130 rnA NOTE: 5. Output shorted for no more than 1 sec. and no more than one output shorted at a time. lOS is sampled but not 100% tested. 6. Chip automatically goes into standby mode if logic transitions do not occur. (Approximately 50 ns after last transition.) A.C. TESTING LOAD CIRCUIT A.C. TESTING INPUT, OUTPUT WAVEFORM 5V 855!l 2.4 ==><2.0:::>TEST POINTS<::2.0)C 0.45 O.B O.B 341!l 290098-9 DEVICE INPUT RISE AND FALL TIMES < 6nS 290098-8 A.C. Testing: Inputs are Driven at 2.4V for a Logic "1" and O.4SV for a Logic "0". Timing Measurements are made at 2.0V for a Logic "1" and 0.8V for a Logic "0". CL = 30 pF CL Includes Jig Capaci1ance 8-10 inter 5C121 A.C. CHARACTERISTICS TA = 0° to 70 e, Vcc = 5.0V -+ 5% 0 Symbol Device Parameter Conditions 5C121-50 5C121-65 5C121-90 Min Min Min Max Max Unit Max tpo Non-Registered Input or 1/0 Input to Non-Registered Output tpzx Non-Registered Input or 1/0 Input to Output Enable tpxz Non-Registered Input or 1/0 Input to Output Disable tsu Non-Registered Input or 1/0 Input to Output Register Setup 37 47 62 ns tH Non-Registered Input or 1/0 Input to Output Register Hold 0 0 0 ns tCH Clock High Time 20 25 30 ns tCl Clock Low Time 20 25 30 tCOl Clock to Output Delay 28 33 38 ns tpl Minimum Clock Period (Register Output Feedback to Register Input-Internal Path) 50 55 75 ns Cl Cl fl Maximum Frequency (1 Itpl) tp2 Minimum Clock Period (tsu f2 Maximum Frequency (1 ItP2) = 30pF = 30pF 50 65 90 ns 50 65 90 ns 50 65 90 ns 20.0 + tC01) 13.3 18.2 80 65 15.0 ns MHz 100 12.5 10.0 ns MHz tRST Asynchronous Reset Time 50 65 90 ns tC02 Registered Feedback Through PLA to output. Relative to External Clock. 70 75 100 ns tlLs Set Up Time for Latching Inputs 0 0 0 tlLH Hold Time for Latching Inputs 15 20 25 tclC2 Minimum Clock 1 to Clock 2 Delay tllOFS Input Latch to D-FF Setup Time tOFllS D-FF to Input Latch Setup Time tp3 Minimum Period for a 2-Clock System (TC1C2 f3 Maximum Frequency (1 Itp3) 40 Mode 0,1 ns 65 50 40 50 65 25 30 35 65 ns 85 ns ns ns 100 ns + tC01) 15.0 12.0 10.0 MHz SWITCHING WAVEFORMS INPUT OR I/O INPUT nwlot REGISTER TO OUTPUT CO~BINATIONAL OUTPUT FRO.. REGISTER VIA FEEOBACK TO COIrolBIH.ATIONAL OUTPUT COMBINATIONA.L OR REGISTERED OUTPUT tRST I-- ----------~~W--~A~S~~C~HR~ON~O~US~LY----~ If\ RESET OUTPUT )I( HIGH IMPEDANCE 3-STATE HIGH IMPEDANCE 3-STATE 290098-10 NOTES: tR & tF = 6 ns tCl & tCH measured at 0.3V & 2.7V. All other timing at 1.3V. VALID OUTPUT 290098-11 NOTE: Above waveforms shown for clock modes 2 or 3 (tsu & tH are as in modes 2 & 3; no ILE signal is used). 8-11 inter 5C121 CLOCK MODES SWITCHING WAVEFORMS 2-t:LOCK SYSTEMS: MODES 4 THROUGH 7 CLK1 PIN 1 CONTROLS THE INPUT LATCH CLOCK CLK2 PIN 38 CONTROLS THE D-FF CLOCK. 1-t:LOCK SYSTEM: MODES 0 AND 1 I "FlLS I r-'ILDFSClK' (P'H') ~ tIL:j, 'HPUTS OR I/O IHPUTS_ )I( REGISTERED OUTPUT ClK'(PlH').,~: ~ ~"lj )I( - _______ teo,.!: ,--te'C2 X I---- 'PO-====1 '1I tco~.1::.. ClK2 (PlH3B) _ _of-___ )I( COloiBINATIONAL i-------.PXZ~ COMBINATIONAL OR REGISTERED OUTPUT ------1----1-____ 'HPUTS OR I/O 'HPUTS ~ X r---' ~ I--- 'PIX _+----- )1(,---+----I-- 'PO-==1. --+--=--'\1,""---+----+-___ -+_____ REGISTERED --of--';';"--'\I OUWUT _ _of-___~I'"-_ _ ==k:: CO"BIHATlOHAl OUWUT _ _ 290098-12 COWBINATlONAL OR REGISTERED OUTPUT INVERT CLK1 FOR MODE 0 ...J,"'I\..._ _ -'PIX=C 290098-14 INVERT CLK1 FOR MODES 5 & 7 INVERT CLK2 FOR MODES 4 & 5 1-CLOCK SYSTEM: MODES 2 AND 3 r 'Cll1\'-____ teH r-----I ClK' (PlH') \ .t .CS~H-= --"")I(.Jr---k'"'Jr------1'''''·,'-_______ IHPUTS OR I/o IHPUTS _ _..11''-_ _ REGISTERED OUTPUT - -te021_---_ rEEOBACK OUTPUT I/O INPUTS _ _ _ __ INPUTS OR CO~BIHATIOHAl OUTPUT CO~BIHATIOHAl 'CO'.I:. ------f-;..~Wlr------ ------f--"'r''\.-----~ f ·PO t -_::::::::::1:'P:XI...J~ • 'PIX 1: OR REGISTERED OUTPUT 290098-13 INVERT CLK1 FOR MODE 2 8-12 inter 5C121 The iPLDS has interfaces to popular schematic capture packages (Dash series from Futurenet and PC CAPS from PCAD) to enable designs to be entered using schematics. However, hand-drawn schematics can be entered just as easily using the Logic Builder, interactive netlist entry program included in iPLDS. The other design entry formats supported are Boolean equation entry and State Machine design entry. Intel Programmable Logic Development System (iPLDS) The iPLDS provides all the tools needed to design with Intel H-Series EPLDs or compatible devices. It contains comprehensive third generation software that supports four different design entry methods, minimizes logic, does automatic pin assignments and produces the best design fit for the EPLD selected. It is user friendly with guided menus, on-line Help messages and soft key inputs. The iPLDS is compatible with IBM PC, PC XT or PC AT and other equivalent machines with the following configuration: In addition, the iPLDS contains programmer hardware in the form of an expansion card for the PC with programming software to enable the user to program EPLDs, read and verify programmed devices and also to graphically edit programming files. The software generates industry standard JEDEC object code output files which can be downloaded to other programmers as well. The iPLDS includes 5C121 H-series EPLD samples. (1) Dual floppy disk drive or hard disk drive (2) MS-DOS Operating System Version 2.0 or later release (3) 384K Memory (4) Intel device programming card and unit (supplied with iPLDS). Detailed information on the Intel Programmable Logic Development System is contained in a separate Intel data sheet on this product. 8-13 =0 r- c en z _. ef -t m r- "U ::rJ 0 G) ::rJ l> s:::: s:::: l> m rm r- 0 G) ~ .j>. II 1t=:2lI~r .ur02ncCO'P I 0 I -~ I~ < m U1 ...... n I\) r- 0 "U s:::: m PIN UST FIlE I I z ~ {§1 en © s:::: = ~ I~< u:V -t m ~ ~ ffiiiI '1iil © 290098-19 I 2$ ~ ~ ~ = © ~ SC060 600 GATE CHMOS H-SERIES ERASABLE PROGRAMMABLE LOGIC DEVICE Performance LSI Semicustom • High Logic Replacement for TTL and 74HC SSI and MSI Logic EPROM ":echnology Based. • CHMOS UV Erasable 16 Macrocells with Programmable 1/0 • Architecture; up to 20 Inputs (4 Dedicated, 16 1/0) or 16 Outputs High Speed tpd (max) 35 ns. • Operating Frequency (max) 33.3 MHz Low Power; 10 W Typical Standby • Dissipation High Performance Upgrade for • Commonly Used 24 Pin PLDs JJ- Programmable Clock System with Two • Synchronous Clocks as well as Asynchronous Clocking Option on All Registers Registers. Can be • Programmable Configured as 0, T, SR or JK Types Programmable 'Security Bit' Allows • Total Protection of Proprietary Designs Register Pre-Load and Erasable Array • for 100% Generic Testability Footprint 24-Pin 0.3" Cerdip • Small Package (See Packaging Spec., Order #231369) The Intel SC060 H-EPLD (H-Series Erasable Programmable Logic Device) is an LSI logic circuit that is user customizable through programming. The SC060 is ideally suited for replacing TIL and 74HC type SSI and MSI logic devices as well as conventional 20 and 24 pin programmable logic devices.. This device is socket compatible with most 24 pin programmable logic devices and has the additional benefits of low power and increased flexibility. The logic capacity of the SC060 is typically equal to 600 two-input NAND gates. The SC060 H-ELPD uses CHMOS EPROM (floating gate) cells as logic control elements instead of fuses. Use of Intel's advanced CHMOS II-E EPROM process technology enables greater logic densities to be achieved with superior speed and power performance_ The EPROM technology also enables these devices to be 100% factory tested by the programming and the erasure of all the EPROM logic control elements in the device. The architecture of the SC060 is based on the 'Sum of Products' PLA (Programmable Logic Array) structure with a programmable AND array feeding into a fixed OR array. The SC060 has unique architectural features that allow programming of all 16 registers to D, T, SR or JK configurations without sacrificing product terms. These registers can be either clocked asynchronously or in banks with two synchronous clocks. ClK! vee INPUT INPUT I/O I/O I/O I/O I/o I/o I/O I/O I/O I/O I/O I/O I/O I/o I/O I/O INPUT INPUT CLK2 GND 290104-1 Pin Configuration Intel Corporation assumes no responsibility for the use of any circuitry other than Circuitry embodied in an Intel product. No other circuit patent licenses are implied. Information contained herein supersedes previously published specifications on these devices from Intel. November 1985 @ Intel Corporation, 1985 8-15 Order Number: 290104-001
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.6 Linearized : No Create Date : 2016:06:27 16:23:29-08:00 Modify Date : 2016:06:27 18:14:02-07:00 XMP Toolkit : Adobe XMP Core 4.2.1-c041 52.342996, 2008/05/07-21:37:19 Metadata Date : 2016:06:27 18:14:02-07:00 Producer : Adobe Acrobat 9.0 Paper Capture Plug-in Format : application/pdf Document ID : uuid:6b511f50-243b-0f48-9cba-64c96e1aba57 Instance ID : uuid:a7746c47-57b5-3340-94ca-07b7c6ba3361 Page Layout : SinglePage Page Mode : UseNone Page Count : 1283EXIF Metadata provided by EXIF.tools