← Interface Projects for the Apple II 1982

Interface Projects for the Apple II 1982

From the originals

13 scans

Machine-transcribed text and image descriptions. Check the linked original for uncertain words or fine print.

These are transcribed pages from the documents, not the full publications. Open the original for the remaining pages.

Image 1

RICHARD C. HALLGREN interface projects for the apple II $12.95 A SPECTRUM BOOK

A black book cover with the author name in blue outlined capitals above a white rule, a large white bold title, and a striped pink and blue field of repeated outlined 'INTERFACE' lettering across the middle, with a Spectrum Book logo at the bottom right.

Reading notes: The small text near the bottom right logo appears partially obscured by the logo graphic; the '2' or similar mark beside it is unclear.

Printed product names
Apple II
Printed prices
$12.95
Languages
English
PDF page 1

RICHARD C. HALLGREN interface projects for the apple II INTERFACE INTERFACE INTERFACE (repeated background text) $12.95 A SPECTRUM BOOK

A book cover with a black background, the author name in outlined blue capitals and a large white bold title at top, and a lower band of repeated outlined word 'INTERFACE' in magenta and blue columns with a Spectrum Book logo at bottom right.

Reading notes: Background 'INTERFACE' text is repeated decoratively and partially cut off at edges; transcript reflects only the repeated word pattern. Spectrum Book logo at bottom right is a graphic mark, not transcribed as text.

Printed product names
Apple II
Printed prices
$12.95
Languages
English
PDF page 2

INTERFACE PROJECTS FOR THE APPLE II

RICHARD C. HALLGREN INTERFACE PROJECTS FOR THE APPLE II ta\ a SfECtillll sua1 Prentice-Hall, Inc., Englewood Cliffs, New Jersey 07632

Reading notes: Transcript intentionally left empty per instructions; exact text is preserved separately. The publisher line is garbled in the supplied copy ("ta\ a SfECtillll sua1") and may represent a partially legible or mis-OCR'd imprint. Headline selection is inferred from the title block and was not verified against the image layout. Visual layout description is inferred from the supplied text and not confirmed against visible artwork.

Printed product names
Apple II
Languages
English
PDF page 3

Library of Congress Cataloging in Publication Data Hallgren. Richard C. Interface projects for the Apple D. "A Spectrum Book." Includes index. 1. Computer interfaces. 2. Apple ll (Computer) [Title. TK7887.5.H34 621.3819'592 82-3748 ISBN 0-13-469395-7 AACR2 ISBN 0-13-469387-6 (pbk.) This Spectrum Book is available to business and organizations at a special discount when ordered in large quantities. For infonnation, contact Prentice-Hall, Inc., General Publishing Division, Special Sales, Englewood Cliffs, N.J. 07632. © 1982 by Prentice-Hall, Inc., Englewood Cliffs, New Jersey 07632. All rights reserved. No part of this book may be reproduced in any form or by any means without permission in writing from the publisher. A SPECTRUM BOOK. Printed in the United States of America. 10 9 8 7 6 5 4 3 2 1 Editorial/production supervision by Kimberly Mazur Manufacturing buyer: Barbara A. Frick ISBN 0-13-469395-7 ISBN 0-13-469387-6 iPBK.} Prentice-Hall International, Inc., London Prentice-Hall of Australia Pty. Limited, Sydney Prentice-Hall Canada Inc., Toronto Prentice-Hall of India Private Limited, New Delhi Prentice-Hall of Japan, Inc., Tokyo Prentice-Hall of Southeast Asia Pte. Ltd., Singapore Whitehall Books Limited, Wellington, New Zealand

Reading notes: Source reads 'Apple ll' in cataloging data, likely OCR error for 'Apple II'; 'infonnation' likely OCR error for 'information'

Printed dates
1982 · 82-3748
Languages
English
PDF page 4

1 2 3 4 5 6 7 8 CONTENTS INTRODUCTION 1 REVIEW OF DATA TRANSFER FORMATS 3 SAMPLING THE EXTERNAL WORLD 21 DIGITAL TO ANALOG CONVERSION 70 UTILIZATION OF THE APPLE TWO IN SERIAL APPLICATIONS 78 BIOFEEDBACK 101 CONTROLLING A VIDEO PLAYBACK DEVICE 117 DATA ANALYSIS OF SAMPLED SIGNALS 141 APPENDIX A: CONSTRUCTION TECHNIQUES 152 APPENDIX B: OPERATIONAL AMPLIFIER THEORY 158 APPENDIX C: POWER SUPPLIES 168 INDEX 171

Printed product names
Apple Two
Languages
English
PDF page 5

Richard C. Hallgren, Ph.D., is an assistant professor at Michigan State University. He has written numerous articles and books, including INTERFACE PROJECTS FOR THE TRS-80, published by Prentice-Hall.

Languages
English
PDF page 6

INTRODUCTION The rapid expansion of the electronics industry and their ability to mass produce reliable, large-scale integrated circuits has led to the reality of scientific calculators and multifunction digital watches for under $20 and "personal computers" starting from $200. In 1971 the Intel Corporation had the honor of initiating this revolution by introducing the first commercially available micro- processor. While the performance of this device was limited by its relatively slow central processing unit and its use of a 4-bit data bus, its acceptance was so dramatic that within a two-year period the cost of a single unit had dropped from $200 to under $20. Today, it is a rare individual who does not have a microprocessor (if not a personal computer) of some type in his or her home. As I have talked to owners of personal computers, it has become apparent that there is a certain group of individuals who 1

Reading notes: Price '$20' appears in the source as '$ 20' with spacing; spacing normalized to exact printed form uncertain. Source text appears to be an excerpt that ends mid-sentence at 'a certain group of individuals who'.

Printed prices
$20 · $200
Printed dates
1971
Languages
English
PDF page 7

2 Introduction would like to use their machines as extensively as is possible, both at home and at their place of employment. This inevitably results in the need for interface circuitry to allow the computer to be connected to external devices allowing users to monitor and con- trol their environment. On the basis of the response of readers to several articles that I have written, I have come to the conclusion that there is a great need for a book that covers not only the theory behind interfacing a computer to external devices but also gives a broad selection of interface circuits that can be built and expected to work. What I have attempted to do is to provide you, the reader, with a number if examples of interface circuits ranging from the very simple to the somewhat complicated. I have included soft- ware for each circuit and can assure you that both the hardware and the software have not only been tested together but have been used in some practical area of application. The result is a docu- ment that explains the theory behind computer interfacing and gives you the choice of either building the circuit as is or modify- ing it to meet your specific needs. The hardware for these projects was designed and the components selected so that construction and check-out would be a straightforward matter. The circuits have been chosen to offer something of interest and application to a broad range of individuals: the hobbyist, the experimenter, the manager of a manufacturing plant, and the engineer or scientist in a research facility. The intent being to enable people to more fully use the computational and control capabilities of their personal computer in a practical and interesting way. The book assumes that readers have a fairly good under- standing of the commands in Applesoft BASIC, and have written some of their own programs. Since some of the supporting soft- ware will be using 6502 machine code, the reader is encouraged to become familiar with the 6502 instruction set. Programing exam- ples using both Applesoft and 6502 machine language have been provided throughout the book. While construction of the circuits is straightforward, it should be understood that a certain amount of experience, and a certain level of expertise is expected. Pre- vious construction of a commercial kit would probably qualify most individuals. So, with all this in mind, let's get started with the job of connecting your Apple II to the outside world.

Reading notes: Primary heading not visible in supplied copy; headline set to null. Some words are hyphenated or spaced irregularly (e.g., 'Programing', 'num-ber' splits) and may reflect OCR artifacts.

Printed product names
Apple II · Applesoft BASIC · 6502
Languages
English
PDF page 8

BASIC INTERFACE CONCEPTS REVIEW OF DATA TRANSFER FORMATS

BASIC INTERFACE CONCEPTS REVIEW OF DATA TRANSFER FORMATS Before we get into actual circuit designs , we need to spend some time reviewing basic interface concepts. Even experienced circuit designers should read this section to become familiar with ter- minology that will be used. We can define an input/output (JJO) port as a collection of electronic circuits, under the control of the computer, which routes data to and from an external peripheral device. The key words in this definition are data and external. The route by which the data flow to or from the external device is called the port. A line printer is an example of an external device; the computer sends characters to be printed to the printer and, in some cases, the printer sends control signals back to the computer. The pur- 3

Reading notes: Possible OCR spacing or hyphenation artifacts in the body text (for example 'ter-minology' and 'pur-pose' split across lines)

Languages
English
PDF page 9

4 Review of Data Transfer Formats pose of these signals is to regulate the flow of the data. This interaction is called handshaking. Ports can be constructed so that data are handled in either a serial or a parallel format (Figure 2 .1). Parallel transfer of data involves the mass transfer, ata given point in time, of several bits of data, where the number of bits transferred is usually equal to the word size of the computer. For the Apple II this is equal to 8 bits. In general, the number of bits transferred at one time will be equal to the size of the data bus. For example, if we were working with a Z8000, which has a 16-bit data bus, a parallel transfer would involve 16 bits. When high rates of data transfer are desired, such as data transfer between a computer and a floppy disk, the transfer is usually handled with a parallel format. Computers handle parallel communication rela- FIGURE 2. 1 Comparison of parallel and serial format. The clock impulse is used to signal the external device that the signals are stable. For both examples, the data word being trans- mitted is binary 10011001. DB7 (MSB) DB6 DBS DB4 DB3 DB2 DBl DBO (LSB) CLOCK OlJfPUI' CLOCK

Reading notes: Running text fragments begin and end mid-sentence, so reading order across the page may be incomplete. Some characters in the figure caption (e.g., 'DBl', 'OlJfPUI'') appear garbled.

Languages
English
PDF page 10

Review of Data Transfer Formats 5 tively easily and, even though multiconductor cables are re- quired, the total expense is not great because the distance between devices is usually quite short. Serial transfer of data involves transmitting individual bits of data, one bit at a time. Microcomputers do not normally com- municate in a serial format, so there is usually not a single ma~ chine language command that facilitates this type of operation. Therefore, we need to add either a software subroutine or a new piece of hardware to accomplish a serial transfer of data. Such an addition results in increased system expense, but gives the capa- bility of transferring data over increased distances at relatively high data rates. The Electronics Industry Association (EIA) RS- 232C electrical specification for serial transfer of data is the stan- dard for industrial applications. This specification defines the following voltage levels: A logic level 1 is called a mark and is considered to be any voltage level more negative than - 3 volts. A logic level O is called a space and is considered to be any voltage level more positive than+ 3 volts. In general, designers use+ 12 and -12 volt levels for the logic O and logic 1 states. In addition to specifying voltage levels, the EIA also defines the standard RS- 232C connector to be a 25-pin, D subminiature type (commonly referred as a DB-25). The pin assignments and their functions are listed in Table 2.1. Before we look at specific examples, we should take a look at the architecture of the 6502 to determine how we can communi- cate in an orderly manner with several peripheral devices that may be connected to the same data bus and to the same address bus. The Apple II computer uses a 6502 type microprocessor to perform the logical, mathematical, and decision-making opera- tions necessary for high-speed operation of the computer. This microprocessor is an 8-bit device which combines the bus struc- ture of the 6501 microprocessor (16-bit address bus, 8-bit bidirec- tional data bus, and two interrupts) with an instruction set that includes over 150 different commands. The bidirectional data bus is used to transfer information both to and from the central proc- essing unit. The 16-bit address bus has the capability of uniquely defining 65,536 addressable locations. The 6502 generates several control signals which are used both internally and externally to supervise and manage the flow of information. Since data can only flow in one direction at a time, and since the data are usually

Reading notes: Running header 'Review of Data Transfer Formats' and page number '5' may not be body copy. Hyphenation breaks in the source (e.g., 'multiconductor', 'microcomputers') are rejoined only by inference.

Printed product names
Apple II · 6502 · 6501 · DB-25 · RS-232C
Languages
English
PDF page 11

6 TABLE 2.1 EIA standards for 08-25 connector pin assignments when used for com- munication between RS-232C systems. Pin 1 PGND - Protective Ground This is chassis or equipment ground. It may also be tied to simal lll'Ound. Pin 2 TD - Transmit Data This is the serial data from the tenninal to the remote receiving equipment. When no data is being sent it is in a marking _LU condition. Pin 3 RD - Receive Data This is the serial data from the remote equipment which is transmitted _to_ the · ..._ Pin 4 RrS - Request to Send Controls the direction of data transmission. In full- duplex operation an "on" sets transmit mode and an "off'' sets non-transmit mode. In half-duplex operation an "on" inhibits the receive mode and an "off'' enables it. Pin S crs - Clear to Send Signal from the moden to the terminal indicating ability to transmit data. AA "on" is "Ready'' and an "off'' is "not read_y." Pin 6 OOR - Data Set Ready Signal from the modem to the tenninal. AA "on" condition indicates that the modem is ready. Pm 7 SGID - Sima! Ground -P-m -a- CD - Carrier Detect An "on" indicates reception of a carrier from the remote data set_;_ "off'' indicates no carrier is bei11&_ received. Pin 20 JJI'R - Data Terminal ReaOf "On" connects the comnu.mication equipment to the commu- nications channel; "off'' disconnects the conmunications ~uiJmtent from the comnunications channel. Pm 22 RI - ~ -truricator AA "on" mdicates that a ringing signal is being received on the cOlllllUDlications channel. directed to a specific device or memory location, these control lines provide an essential coordinating function. Figure 2.2 shows the pin configuration for the 6502. The 6502 belongs to the one-address architectural class of microproc- essors; that is, all memory-related instructions refer to a single memory location. The direction of all data transfers is controlled by the READIWRITE* (R/W*) line. When this line goes low, all data transfers will occur in the direction from the processor to memory. When it goes high, all data transfers will occur in the direction from memory to the processor. The timing of all data transfers is controlled by the system clock. The clock system used by the 6502 is referred to as two-phase; it is most easily thought of as two nonoverlapping square waves. When the microprocessor is reading a data byte from memory, the address of the desired memory location is placed on the address bus during the phase one clock pulse. Information stored in that particular memory location is strobed onto the data bus and into the accumulator

Reading notes: Several OCR-damaged words in the RS-232C pin table (e.g., 'simal lll'Ound', 'DOR', 'OOR') Scrambled reading order in the pin 20/22 entries and the 'Pm 7' line Abrupt transition from the pin table to the 6502 microprocessor text

Languages
English