230 Computer
Total Page:16
File Type:pdf, Size:1020Kb
230 BBGICDEYoBu . - ' | :-l! . \L H..;I 1' _ I -. .'..-4-! '."-"'u _ 1- I-_I_,u——‘-M . ' 3. -"-..*-"" I "c. -' :- || ..— I '. '- ' ' . I .'‘ COMPUTER by Steve fi con/{Iii Ciarcia A Note about this book and its freefree availability oonlinenline Readers are encouraged to download this book of desidesigngn guidelines and application notes from Steve CiarciaCiarcia,, founder and editorial director of Circuit Cellar magazinemagazine.. Although the original title first appeared in 1981, prepre-dating-dating Circuit Cellar “the”the magazine,” II still get a number of purchase requests each year from electronics enthusiasts. Some are just interested in StevSteve’se’s brand of designing and ability to overcome obstacles, while others still find themselves tweaking projects that use parts described in Steve’s projects. Please note: The original work was only available as a hard copy. Thanks to Andrew Lynch and Bill Bradford for their work in creating the PDF and getting permission from copyright holder Steve Ciarcia to releaserelease it. Scanning done by Bill Bradford. You will be pleased to know that the same style of embedded computing articles can be found each month through Circuit Cellar magazine. Please visit www.circuitcellar.com to learn about this monthly resource for professional designers and electronics enthusiasts alike. Please enjoy “”BuildBuild Your Own Z80280 ComputerComputer”” as a great blast from the past. ItItss style is the foundation on which Circuit Cellar magazine was built and continues to grow. I llookook forward to seeing you become a part of the ongoing Circuit Cellar success story. Sincerely, Sean Donnelly, PublisherPublisher— – Circuit Cellar [email protected]@circuitcel|ar.com CIRCUIT CELLAIFI'llE MALLAZINE FUR L'UMI’U'I'ER Al-‘l’LiCA'I'lUNb Build YourOwn ZSO Computer Design Guidelines and Application Notes ; g Steve Ciarcia i BYTE Books/A McGraw-Hill Publication/ 70 Main S-t/Peterborough New Hampshire 03458 p Build Your Own Z80 Computer Copyright © 1981 by Steve Ciarcia. All rights reserved. Printed in the United States of America. No part of this book may be reproduced, stored in a retrieval system, or transmitted, in any form, or by any means, electronic, mechanical, photocopy- ing, recording, or otherwise, without the prior written permission of the author. The author of the circuits and programs provided with this book has carefully re- viewed them to ensure their performance in accordance with the specifications described in this book. Neither the author nor BYTE Publications Inc., however, make any warranties concerning the circuits or programs and assume no respon- sibility or liability of any kind for errors in the circuits or programs, or for the con- sequences of any such errors. The circuits and programs are the sole property of the author and have been registered with the United States Copyright Office. The author would like to acknowledge that portions of this book have been re- printed by permission of the manufacturers. The instruction codes in Chapter 3 and Z80 CPU technical information have been reprinted by permission of Zilog, Inc. Chapter 9 is based on an application note reprinted by permission of SMC Microsystems Corporation. Library of Congress Cataloging in Publication Data Ciarcia, Steve. Build your own Z80 computer. Includes index. k 1. Electronic digital computers--Amateurs’ manuals. 2. Zilog Model Z-80 (Computer) 1. Title. TK9969.C52 621.3819'582 81-4335 ISBN 0-07-010962-1 AACRZ Text set in Paladium by BYTE Publications Edited by Bruce Roberts and Nicholas Bedworth Design and Production Supervision by Ellen Klempner Production by Mike Lonsky Cover Photo by Charley Freiberg Copy Edited by Rich Friedman and Peg Clement Figure and Table Illustrations “ by Tech Art Associates Printed and bound using 45# Bookmark by Kingsport Press, Kingsport, Tennessee Build Your Own 280 Computer To my wife Joyce, Steve Sunderland, and Judy and Lloyd Kishinsky Introduction A few years ago, when microprocessors were first introduced, computer enthusiasts and electrical engineers were one and the same. Those of us who lived only to solder kluge after kluge basked in our glory. Now, however, the prices of completely assem- bled and packaged systems have plummeted. Today anyone with an interest, almost regardless of technical capabilities, can own and operate a computer. Buying a com- puter is now similar to purchasing a television set and the ranks of computer en- thusiasts have swelled accordingly. With any popular movement, the available literature reflects the concerns of a ma- jority of the followers. And, consistent with the popularization of computer science, the technical emphasis on computer bookshelves has shifted away from hardware design. Other than introductory texts called, say, How Logic Gates Work, most com- puter books either treat microcomputer hardware simplistically or attempt to be ”catch-all” cookbooks, sometimes omitting tasty ingredients. Often, the only alter- natives are engineering texts and trade journals, tedious reading at best. For a number of years, I have been writing a column for BYTE magazine, and reader response has shown that there still exists a great deal of interest in hardware design and do-it-yourself projects. At the same time, I've been painfully aware of the lack of materials for such people. Most queries come from technical or high school students who have read all the descriptions and studied the block diagrams, but who crave prac- tical answers and system examples. Unfortunately, there are very few books I can sug- gest. Build Your Own Z80 Computer is a book written for technically minded individuals who are interested in knowing what is inside a microcomputer. It is for persons who, already possessing a basic understanding of electronics, want to build rather than pur- chase a computer. It is not an introductory electronics handbook that starts by describ- ing logic gates nor on the other hand is it a text written only for engineering students. While serving to educate the curious, the objective of this book is to present a practical, step-by-step analysis of digital computer architecture, and the construction details of a complete and functional microcomputer. The computer to be constructed is called a Z80 Applications Processor—ZAP com- puter for short. It is based on the industry standard Zilog 280 microprocessor chip. This chip was chosen on the basis of its availability and low cost, as were the other components for ZAP. To further help the homebrew enthusiast, and for those ex- perimenters who prefer to start a book at the back, I have listed in Appendix A a com- pany that supplies parts and programmed EPROMs (erasable-programmable read-only memory). I have structured the book as a logical sequence of construction milestones in- terspersed by practical discussions on the theory of operation. My purpose is twofold: to help a potential builder gain confidence, and to make the material more palatable through concrete examples. Though this is basically a construction manual, considerable effort is given to the “why’s” and ”how’s" of computer design. The reader is exposed to various subjects, in- cluding: the internal architectures of selected microprocessors, memory mapping, input/output interfacing, power supplies, peripheral communication, and program- ming. All discussions try to make the reader aware of each individual component's ef- fect on the total system. Even though I have documented the specific details of the ZAP computer, it is my intention (and the premise of the book) that the reader will be able to configure a custom computer. ZAP is an experimental tool that can be expanded to meet a variety of applications. vii , Wm“: ZAP is constructed as a series of subsystems that can be checked and exercised in- dependently. The first item to be built is the power supply. This is a good way to test ability and provide immediate positive reinforcement from successful construction. The three-voltage supply is both overvoltage and overtemperature protected and has adequate current for an expanded ZAP system. Next, the reader learns why the 280 was chosen for ZAP and the architectural con- siderations that affect component selection on the other subsystems. A full chapter is devoted to the Z80 chip. Each control signal is explained in detail and each instruction is carefully documented. The hardware construction proceeds in stages with intermediate testing in order to ensure success. The basic elements of the computer are assembled first and then checked out. The reader selects which peripherals are to be added. The book contains sections on the construction of a hexadecimal display, keyboard, EPROM program- mer, RS-232C serial interface, cassette mass storage system, and fully functional CRT terminal. In addition, a chapter addresses interfacing the ZAP to analog signals. I pro- vide specific circuits that can convert ZAP into a digital speech synthesizer or a data ac- quisition system and data logger. A special 1 K (1024 bytes) software monitor coordinates the activities of the basic computer system and the peripherals. Software is explained through flow diagrams and annotated listings. With this monitor as an integral component, ZAP can function as a computer terminal, a dedicated controller, or a software development system. Build Your Own Z80 Computer is a book for hardware people. It cuts through the theoretical presentations on microcomputers and presents a real ”How-to” analysis suitable for the reader with some electronics experience or for the novice who can call someone for supervision. From the power supply to the central processor, this book is written for people who want to understand what they build. Steve Ciarcia May 1981 viii TABLE OF CONTENTS Introduction Chapter 1 Power Supply ................................... 1 Chapter 2 Central Processor Basics ......................... 21 Chapter 3 The Z80 Microprocessor ......................... 27 Chapter 4 Build Your Own Computer - Start With the Basics . 91 Chapter 5 The Basic Peripherals ..........................