Home

Build Your Own MC68HC11 Computer Trainer

image

Contents

1. Ce ne 27 07 D5 28 zi cso 29 E 30 24 nso PIA1 A000 CS2 D2 31 SS E DI 32 Ke RW DO 33 RESET DO RESET CA2 39 cap cpo 19 cB2 9 This is the PIA Peripheral Interface Adapter chip Since we are using the MC68HC11 in expanded mode I O ports B and C are unavailable for our use The MC6821 will give us two bi directional 8 bit I O ports to work with U9 MAX232CPE d DCD KR 8 RxD 3 Do SEE guia lt 13 s Ps Catt ois 1 1a HE tou DN 3 Gy co ST tour 2 6 x V VK C13 Ly C16 1ouF DN 10uF 10 This is the RS 232 circuit The MAX232 provides the interface between the serial port on the MC68HC11 and the DB 9 connector This buffer chip is required because RS 232 requires relatively hi voltages about 12 V Additionally e MAX232 has a charge pump circuit which uses four capacitors to generate 10 VDC from the 5V supply This way the whole computer can run from a single 5V supply Additionally the computer requires a 5 VDC 0 3 A power supply For this project you can either purchase one or build a simple one from scratch Keep in mind that this design isn t inscribed in stone Feel free to modify the computer in any way you see fit You can learn a great deal by customizing the computer 6 Yerem Build Your Own MC68HC1 1 Computer Trainer Building the Computer 3 1 Before you
2. Wire the 4 7kQ Resistor Pack These connect Wire the Reset Circuit Use a resistor in the 4 7kQ resistor pack for the 8 pull up resistor A bead of solder on each pin of the push button will mechanically secure it to the board Be careful not to burn any of the wires 9 Wire the Crystal Connections This includes wiring Y1 R2 C11 and C12 to the MC68HC11 20 Yerem Build Your Own MC68HC1 1 Computer Trainer 10 Wire the J4 jumper Cut off a 3x1 section of the header connector Unbend the right angle pins so that they are straight This will give us some extra long pins to wire wrap to 11 Wire the MAX232 Wire the capacitors to the MAX232 and wire the MAX232 to the micro Drill and Cut the Holes for the DB 9 Connector Since the row of five pins on the connector aren t aligned with the perfboard we need to cut a slot for them Also drill out the two mounting holes 13 Mount and Wire the DB 9 Connector Connect the DCD DSR CTS and DTR lines together Also prewire the TxD RxD and GND lines with some wire of an appropriate length Now thread the three loose wires through the perfboard screw the DB 9 connector to the perfboard and wire the connector to the MAX232 21 14 Prepare the Wireless Breadboard Cut off two small rectangles of the foam backing of the wireless breadboard behind the top and bottom power strips Four metal strips should be exposed two on the top and two on the b
3. 1 15 28 27C64 14 1 o PALI6L8 e 74HC373 o 74HC245 9 MAX232 GND 5V HEADER 204 35 404 45 50 CA2 CA1 PPA7 PPA6 PPA5 PPA4 PPA3 PPA2 PPA1 PPAO cB2 CB1 PPB7 PPB6 PPB5 PPB4 PPB3 PPB2 PPBI PPBO R W RESET XIRQ IRQ Al AO 50 45 40 35 30 25 20
4. Bus A0 A15 U6 27C64 250 U5 PAL16L8 12 A15 1 19 BOOT era De os Au ET web SPARE U1 U3 A13 3 VOP77 WRIO 1 os A10 1 vo 4 MC68HC11A1P 74HC373 Be At al vop DE MODACLIR pB7 9 A1 AD7 an soli A7 a a AT 5 opto Paz M t pac EO ADE U valo A D2 a ge DESCH ell PIAT 1 Ai ADS 14 15 A5 12 13 EXTRA PBS 6D eg o1 A vol 4 IZ A ADA 13 12 Au IRQ PB4 5D 50 oo A of see pag SAN ADS H qo AS Ad pao 14 AD2 J ago A K 74 VRH 22 15 AS ADI 4 5 A 8 VRH KO 320 205 A 1 I VRL PBO AS ADO Sip ig AQ A Vee Er F PE3 AN3 S PE2 19 pe gt AN2 BOOT E000 A ee 18 pE1 AN1 A J4 PEO E PEO ANO AFW PDS 47 EM U7 PDS SS e PD4 46 ppaisck 27C64 250 PD3 45 PD3 MOSI PC7 De 18 07 A12 PD2 MISO PC6 Ds 1708 A11 PD1 TxD PC5 Da ro 08 A10 PDO RxD xI E Da 15 OF A PA7 ros D2 130 A PA7 PAV OC1 PC A3 Dra 02 A7
5. PA6 OC2 0C1 PCI A2 miet A PAS OC3 OC1 PCO B1 AI DO DO oo A Ad PA4 0C4 OC1 ARO 245 PA3 0C5 0C1 U4 Vee A3 PA2 IC1 1 A2 PA1 IC2 Vee z7 VPP A PAO IC3 RP SPARE C000 4 7 ka arhat S RESET P UTO U8 RESET MN13811 Q HM62256 LP15 XTAL EXTAL 1 2 D7 19 z Vee 1 07 A14 30 Raima q Se sp voe A13 3 eur 3 Been E 2 105 A12 Si Se 8y Da 9 D Y1 8 0 MHz E 123 pa 15 04 Al H g A10 E 3 1 03 S aye s o 5 Botiom spor 7 gt c11 1 cra a Tij 01 a E 22pF 22pF Woo Mi 1 210 MC68HC11A1P AS IN MC68B21 Ad 74HC373 74HC245 aa PALT6L8 12 C64 250 pl SE AQ HM6264 LP15 MAX232CPE RW RAM 0000 U9 U2 MAX232CPE DCD MC68B21 DSR PD1 10 7 TxD 2 Dr Ve T 1 De cso RS1 PDO 9 8 mol a pe D4 RSO Ge os2 p22 PIA1 A000 11 14 25 E Sp D2 E FFW 12 13 e U ad RESET lt Do RESET EE CA2 39 oaz cool CR 1 4 40 18 ci Sal ca cet DE c14 E C1 V Cet c15 C2 v Input Output Bus PB7 PB6 PB5 PB4 PB3 PB2 PB1 PBO 5 VDC O H D Vcc II c1 3302 c2 ee C9 1oour 7 L our T gt opr LED1 Leon AZ sng jonuog 37 Appendix 4 Wire Wrapping Labels 25 48 MC68HC11A1P 24 1 21 40 MC68B21 20 1 15 28 HM62256 14 4 15 28 27C64 14
6. a good job in this case e Don t ruin your eyes Use a magnifying glass and good lighting when you work Wire wrapping can be a juggling act at times but you will get used to it and come across many tricks and shortcuts as you progress Wiring the Board Now it s time to do some wiring While you are wiring the computer you will have to refer to the schematic diagram in Appendix 3 The schematic diagram depicts all of the connections that must be made It will be helpful to mark the connections on the schematic with a red pencil as you wire them Before wiring cut the leads of the discrete components to be 1 2 inch long Wire the Bypass Capacitors Wire a 0 1uF tantalum bypass capacitor to the power connections of all nine chips The power connections for each chip are listed in the table on the schematic diagram The bypass capacitors will help filter switching transients from the power lines Since the tantalum capacitors are polarized be sure to wire the plus lead to the Vcc connection and the other lead to ground When you spin the wire around each lead be extra careful not to twist and break the lead off Also the connection to the capacitor won t be as good as the connection to the chip since the leads on the capacitor are round with no edges for the wire to grip on to When were done with the whole computer and see it working we can solder the capacitor connections for extra 18 Yerem Build Your Own MC68HC1 1 Computer T
7. prompt similar to the one below Try hitting the Return key on your personal computer BUFFALO 3 4 ext Bit User Fast Friendly Aid to Logical Operation If nothing happened then e Is the DB 9 connector wired properly e Do you see a data transmission every time you hit the Reset switch You can check for this by placing an oscilloscope on the transmit pins 10 and 7 of the MAX232 and pin 43 of the MC68HC11 e Did you plug in the right ROM BUFFALO e Are you connected to the correct serial port on your personal computer e Do you have a good connection between the two computers 5 Tum off the computer and plug the Test ROM into the Extra ROM socket Turn the computer back on and perform another smoke test Now from BUFFALO type go C000 ENTER Are the LEDs blinking To stop the program press the Reset button Now try disassembling the test program Type asm C000 ENTER Hit ENTER to advance to the next line To exit the disassembler type Cont rol A 6 Turn off the computer and plug in the HM62256 Turn the computer on and perform the smoke test as usual Using the BUFFALO Block Fill command try to write to locations in the RAM Type bf 7000 7100 AA ENTER Now type md 7000 ENTER Were you successful writing to the RAM Also try running the test program Is it still working 26 Yerem Build Your Own MC68HC1 1 Computer Trainer 7 Tum off the computer and pl
8. space and select the bus into distinct address and data busses appropriate memory chip Its inputs are Multiplexing the address and data bus the address lines as well as the E and saves 8 pins which can be dedicated to R W lines Its outputs are the various other resources at the expense of requiring chip select signals an external demultiplexing circuit 4 Yerem Build Your Own MC68HC1 1 Computer Trainer U1 MC68HC11 MODA LIR MODB Vstby 3 These are the mode pins These two pins allow you to configure the MC68HC11 to run in one of four modes Pulling both pins high as in this case EE the microprocessor in Expanded Mode XTAL EXTAL 30 a2toma VN Y1 8 0 MHz 22pF 22pF Lel NRN This is the oscillator circuit It provides the heartbeat for the microprocessor The oscillator generates an 8 MHz square wave which is divided internally by a factor of four to supply a 2 MHz clock pulse to the microprocessor U6 27C64 250 D7_19lo7 A12 D6 18 oe 17 08 A11 Da Tel 95 A10 04 Ag D3 15 KEIER Ag Di 12 0 AT Dor O A6 oo A5 A4 Vee AS VW A2 eg Vpp Al at PGM AQ doe GE 7 This is one of the two EPROMs Erasable Programmable Read Only Memory The computer uses this memory chip to store programs and data semi permanently In other words the information stored here can only be erased by shining an ultraviolet light into t
9. start ordering the parts and constructing the computer skim through this whole document to get an idea of what to expect While this document is presented in chronological order you can avoid many pitfalls as you re building the computer if you know where you re heading To build this computer you will need some common pieces of electronic tools and test equipment The major tools you will need access to are an EPROM programmer and a 15 W soldering iron with a small tip The test equipment you will need are a 5 VDC power supply a voltmeter a personal computer with an RS 232 serial port a terminal emulation program and possibly an oscilloscope Additionally it would help to have access to the World Wide Web The following timeline depicts a minimum time schedule required to complete this project If all goes well you can probably finish this project in a week or two Keep in mind though that this estimate does not include the time required to overcome learning how to build a computer or the time required to debug the computer which can be two large variables in this schedule Of course overcoming these obstacles embodies the whole purpose of this project Monday Order Parts Download Software Order Data Sheets Tuesday Buy parts from Radio Shack Wednesday Receive Mail Order Parts Thursday Program PAL and EPROM Lay out the board Friday Wire the computer Saturday Wire the computer Sunday Test the computer Ordering t
10. states than decimal digits is that you need more binary digits to represent the same number in the decimal system Nonetheless both number systems can each represent every possible number Ultimately electronic computers use binary digits because by only having two states it has a minimal chance of confusing one state with the other and that provides a maximum level of reliability A computer uses its electronic versions of numbers to perform its purpose acting out a series of directions given by a person Since numbers can represent anything we can use numbers to represent the instructions that we want the computer to follow as well as raw information and even some physical actions like turning on an indicator light sending messages to a teletype or making a sound The microprocessor chip contains all of the electronics needed to perform a majority if not all of the actions of a computer system Usually though a certain amount of the resources of a computer are too expensive or impractical to squeeze onto one integrated circuit chip The most notable of these resources is memory Memory is the single most expensive element of a computer system Memory gives the computer a place to store numbers The more memory a computer has the more numbers it can store Computer memory typically stores raw data and programs If a microprocessor is going to work with external memory it needs external signals to control the memory These signals can be bro
11. 19 0 19 10 R10 0M 10 MQ 1 4 W Resistor 0 05 0 50 10 R330 330 Q 1 4 W Resistor 0 05 0 50 1 100R16 100 pF 16V Radial Electrolytic Capacitor 0 14 0 14 4 10R63 10 pF 63V Radial Electrolytic Capacitor 0 10 0 40 2 22PF 22 pF Ceramic Capacitor 0 05 0 10 9 T 1 35 0 1 pF Tantalum Capacitor 0 15 1 35 Connectors 1 DBO9SRS Right Angle PC Mount Female DB 9 Connector 0 59 0 59 IC Sockets 1 16 PIN WW 16 Pin DIP WW Socket 3 Level 0 79 0 79 3 20 PIN WW 20 Pin DIP WW Socket 3 Level 1 09 3 27 3 28 PIN WW 28 Pin DIP WW Socket 3 Level 1 49 4 47 1 40 PIN WW 40 Pin DIP WW Socket 3 Level 1 69 1 69 Headers 10 JUMPER KT 10 Shorting Jumper Block 0 99 0 99 1 HDR 40R t 1x40 Snappable Header with Right Angle Pins 0 89 0 89 Sub Total 43 63 Radio Shack http www radioshack com Unit Total Part No Part Description Price Price 1 278 503 50 30 Gauge Blue Wrapping Wire 2 79 2 79 1 276 1396 6 x8 IC Spacing Perfboard 3 49 3 49 1 276 1570 id Wire Wrapping Tool 7 49 7 49 Sub Total 13 77 3 2 Downloading the Software While you are waiting for the parts to arrive you can download the software required for the computer from the Internet Motorola has an FIP site which has lots of free software that can be used for developing computers based on Motorola microprocessors For this project the one important piece of software required is the BUFFALO monitor program BUFFALO is a stand alone program written for operating a simple MC68HC11 com
12. 21 3 Greenfield Joseph D The 68HC11 Microcontroller Orlando FL Saunders College Publishing 1992 4 Motorola Inc MC68HC11A8 Technical Data Book Lit No MC68HC11A8 D Phoenix AZ Motorola Inc 1991 5 Motorola Inc MC6821 Peripheral Interface Adapter Data Sheet Lit No MC6821 D Phoenix AZ Motorola Inc 1985 6 Motorola Inc M68HC11EVB Evaluation Board User s Manual Lit No M68HC11EVB D1 Phoenix AZ Motorola Inc 1986 7 Olney Bruce L Inexpensive 68HC11 Cross development Circuit Cellar INK 44 1994 22 29 8 Swiger Frank and Joe Glover The FS 100 MC68HC11 Based Single Board Computer Circuit Cellar INK 24 1991 52 59 dE RPRENRPRR RHR 1 1 1 1 1 4 2 9 Hm 34 Yerem Build Your Own MC68HC1 1 Computer Trainer Appendix 1 Master Parts List This is the master parts list for the prototype computer that was built The quantity manufacturer manufacturer part number and general description is shown Specific manufacturers aren t listed for easy to find generic parts C13 C16 C11 C12 C2 C9 J4 J4 8 bit HCMOS MCU PIA 2 MHz Octal Tri State D Type Latch Octal Tri State Transceiver PAL 16L8B 15ns 8kx8 lt 250ns EPROM 32kx8 lt 250ns Static RAM 5V Powered Dual RS 232 Trans Rcvr 3 8V O D Low Voltage Detector 8 0 MHz Crystal 4 7 kQ SIP 7 Resistor Network 330 Q 1 4 W Resistor 10 MQ 1 4 W Resistor 100 pF Radial Electrolytic Capac
13. Build Your Own MC68HC11 Computer Trainer Geoffrey C Yerem Department of Electrical Engineering University of Tennessee Knoxville Introduction The electronic computer has been called the most complex machine built by man and anyone fascinated by technology recognizes the computer as the ultimate machine Infinitely configurable through programming the computer is a machine that is malleable as clay is to a skilled sculptor If you love computers you probably want to become a skilled computer sculptor Becoming a skilled programmer provides half of the skills you need Completing your skills means understanding computer hardware at the heart of which is the microprocessor If learning about computer hardware is your goal then read on This paper is going to show you how to build your own practical working computer from scratch This document will show you how to build your own computer trainer based on the Motorola MC68HC11 microprocessor The design used here is similar to many of the commercially available MC68HC11 single board computers particularly the Motorola M68HC11 Evaluation Board EVB You will learn a great deal by building this project and in the end you will have a working EVB of your very own that you can program and customize This document contains six sections Section 1 Introduction Section 2 The Structure of a Small Computer System Section 3 Building the Computer Section 4 Testing the Computer Se
14. EPROM PAS P B600 B7FF E PIAZ PIA 2 A400 A7FF PIA 1 A000 A3FF WR IO ACOO AFFF RD IO A800 ABFF SHEER 98 Extra ROM 8000 9FFF Main RAM 0000 7FFF Internal Registers 1000 103F PPA Internal RAM PPAG 0000 00FF Io Use this memory map to plan the organization of any hardware and software that you add to the computer The MC68HC11 has a large number of on chip peripherals to take advantage of The MC68HC11 data book describes how to program the on chip peripherals 28 Yerem Build Your Own MC68HC1 1 Computer Trainer 5 1 1 5 1 2 5 2 Using BUFFALO The BUFFALO monitor program will allow you to do most of your program development In BUFFALO you can view and modify memory and registers assemble and disassemble programs and perform advanced debugging The most important feature of BUFFALO is its Load command It allows you to download Motorola Hex s19 files to the computer s RAM through the serial port Here is a procedure for using BUFFALO in your program development 1 Write the source code 2 Give the source code a base address somewhere in the RAM s address space between 0000 7FFF watch out for the MC68HC11 s Control Registers 3 Cross compile your program as an s19 file 4 Atthe BUFFALO prompt type load t ENTER Now BUFFALO will wait to receive a s19 byte stream over the serial port Use your terminal emulator program to send the s19 text file to BUFFALO 5 If e
15. G2IOC1 Pot The MC68HC11 has many useful circuits already built into it For example it has built in digital I O ports a sophisticated timing system an asynchronous serial port for RS 232 communications a synchronous serial port an analog to digital converter and a built in crystal oscillator circuit It also has built in memory such as 256 bytes of Random Access Read Write Memory RAM 512 bytes of Electrically Erasable Programmable Read Only Memory EEPROM and in some versions 8 kB of Read Only Memory ROM Having all these resources on one chip allows the MC68HC 11 to be used as a single chip microcontroller requiring no extra support chips For this project though we will treat the MC68HC11 as a conventional microprocessor by adding various external resources to it Following is a block by block description of the computer s design using sections taken from the main schematic diagram The complete schematic diagram can be found in Appendix 3 Address Bus A0 A15 US PAL16L8 12 19 BOOT A14 A13 A12 A11 A10 o a of n B7 BS T ADA TA p AD3 15 e AD2 16 Be ADT 17 ADO 18 B3 B2 Bt Seereere 74H0245 u4 This is the address data demultiplexer 2 This is the Chip Select PAL Its job is to circuit It separates the one address data decode the address
16. OOOOH U o U td as ae U oc c d lt OT Ge Gee GE Q 000 800 SAOO A40 SA80 SACO CO0 E00 oe SO OO O S7FFF SOFFF SA3FF SATFF SABFF SAFFF SDFFF SFFFF 13 3 4 3 2 Using PALASM or a similar program compile the PAL program to generate a JEDEC file PALASM is a freeware program from AMD which runs under DOS 3 Using an EPROM programmer program the PAL using the JEDEC file You can test your PAL by placing it in a solderless breadboard and examining the outputs for different input combinations Board Layout The next step is to lay out the components on the board First place the sockets and discrete components on the perfboard The scale drawing in Appendix 2 offers a suggested layout Keep in mind that the DIP wire wrap sockets have an indentation which marks pin 1 of the chip The indentation on the socket corresponds to the indentation on the chip itself Next label the underside of the board This will prevent errors when you are wiring the board It can be very frustrating to finish wiring a project only to find out that you ve wired the chips backwards White adhesive correction tape which can be found at office supply stores works good for this purpose Also you can buy preprinted labels for wire wrapping if you don t want to make the labels yourself For this project Appendix 4 has some pre printed labels that you can cut out and glue to the board Now
17. al I O The following sections will describe how to use the MC68B21 and how add even more digital I O to the design How to use the MC6821 The MC6821 Peripheral Interface Adapter PIA chip provides bi directional digital I O for the 6800 family of microprocessors with a minimum of fuss The MC6821 has two bi directional 8 bit data ports along with two handshaking control lines for each port The handshaking lines allow each port to be used as parallel communication ports U2 MC68B21 cst pe 27 07 oe 26 D6 cso D5 D4 29 Ds 50 Di RSO 3 G de PIA1 A000 D2 31 25 E D2 E z Di 32 NE R W Do 33 34 RESET DO RESTO CA2 39 19 CB2 Internally the MC6821 has six registers for operating the chip three registers for Port A and three registers for Port B When RS1 0 the Port A register set is selected and when RS1 1 the Port B registers are selected When RS0 1 the Control Register for the given port is selected When RS0 0 the register that is accessed depends on bit 2 the DDR Access Bit of the Control Register If the DDR Access Bit is 0 the Data Direction Register is selected If the DDR Access Bit is 1 the Peripheral I O Register is selected The MC6821 Control Register Lob b bs bi bB b b bo IRQ A B 1 IRQ A B 2 CA2 CB2 DDR CAI CBI Flag Flag Control Access Control 30 Yerem Build Your Own MC68HC1 1 Computer Trainer The Data Direction Register for each port allows an
18. ar timer overflow flag Rotate test pattern Write test pattern Assemble the program using the AS11 assembler Load the resulting s19 file into the EPROM programmer as before specifying a base address of E000 Program and verify the test EPROM 3 4 2 Programming the Chip Select PAL The Chip Select PAL Programmable Array Logic chip is used to perform the logic which glues the computer together By using a PAL we reduce the 12 Yerem Build Your Own MC68HC1 1 Computer Trainer number of components by eliminating many discrete logic gates The PAL can provide much more complex designs than normally would be attempted with discrete logic Also if the logic needs to change a new chip can be programmed replacing the old design Since all of the memory and I O chips share the same data and address busses they need a way to know when they are being addressed The PAL will do this job by decoding the current value on the address bus and selecting the appropriate chip Additionally the PAL gates the RAM and ROM chip select signals with the E clock signal since the data bus isn t ready until E is high Also the ROM chip selects are gated with the R W line so that the ROM is only selected during a read cycle Programming the PAL 1 Using a text editor type in the program shown in Listing 2 and save it in a text file Listing 2 The program listing for the Chip Select PAL D Declarat
19. ction 5 Using the Computer Section 6 Conclusion The instructions in the rest of this document assume that you have had little or no exposure to microprocessor electronics You should though have some computer programming experience particularly with assembly language Also you should have some experience with digital electronics as well as some experience with basic electronic assembly Barring no problems you can construct this project in about one full week Good luck you are on your way to building your first but probably not your last computer Copyright O 1999 by Geoffrey C Yerem First Printing 2 Yerem Build Your Own MC68HC1 1 Computer Trainer The Structure of a Small Computer System The purpose of a computer is to act out a series of directions given by a person ultimately performing some physical action This goal starts with numbers Numbers as it turns out can represent any type of information Since computers manipulate numbers computers also manipulate representations of information The form of numbers that electronic computers use are groups of binary digits or bits Bits are simply numerical digits which only have two states O and 1 This is just like a digit in our decimal system which has ten states O through 9 one state for each finger on our two hands So you might say that by using the binary system a computer probably has only one finger on each of its hands A consequence of bits having fewer
20. d html Here are the part numbers for the data books to order MC68HC11A8 D MC68HC11A8 Technical Data Book MC6821 D MC6821 Peripheral Interface Adapter Data Sheet M68HC11EVB D1 M68HC11EVB Evaluation Board User s Manual Construction Now that the parts have arrived it is time to assemble your computer We will start by programming the boot EPROM and the chip select PAL Following will be a tutorial on wire wrapping Finally we will lay out the components on the board and do the actual wiring Sena wan EI w n g BENS B Programming the EPROMs The boot ROM will give our computer a program to run every time the computer is powered up This is possible since the boot ROM provides non volatile storage it doesn t lose its memory when the power is turned off This step will require the use of an EPROM programmer This might be troublesome if you don t have access to one Since an EPROM programmer can be an expensive item you might want to get help from someone who owns one The Electrical Engineering department at your local university would have one as well as your local electronics trade school It is also possible that your local electronics repair shop would have one that you can use If these options aren t available to you or if you think you will be building more computers in the future you might want to invest in your own personal EPROM programmer Most electronics supply stores carry them For this project be sure t
21. e Macintosh by Georgia Tech Use MacBinary to download this application While you re downloading software you might want to get a copy of PALASM PALASM is a freeware program from American Micro Devices AMD which you can use to compile the program for the Chip Select PAL The AMD WWW site is located at http www vantis com software software html Download PALASM When you reach the web site follow the registration procedure for downloading PALASM Ordering the Data Sheets Component manufacturers publish data books and data sheets for all of their components Usually the literature and the phone call are free Additionally most major manufacturers have World Wide Web sites which have the literature in electronic form For this project it would be a good idea to get the data sheets for some of the components Particularly the data sheets for the MC68HC11 and the MC6821 are indispensable You have two options for ordering the literature You can either call up Motorola literature group or you can access their WWW site I would recommend using the WWW site since it is as simple as filling out a form If you choose to go to Motorola s web site be sure to browse around to see the other services they provide Here is the phone number for the Motorola Literature Distribution 1 800 441 2447 10 erem Build Your Own MC68HC11 Computer Trainer 3 4 3 4 1 While here is their WWW address http mot2 mot sps com home lit_or
22. hat the programmer you use is able to program both EPROMs and PALs You can erase an EPROM by using an EPROM eraser which contains an ultraviolet lamp The ultraviolet light is shined through the window on the chip Never look directly at an ultraviolet lamp as it can cause serious eye damage Programming the Buffalo EPROM 1 Load the buf34 s19 file into the EPROM programmer You might have to tell it that the file is in Motorola Hex format Specify a base address of E000 11 2 Program and verify the BUFFALO EPROM Programming the Test EPROM Store the test program in Listing 1 into a text file 1 Listing 1 The test program listing test as RegBase PORTA TCTL1 TFLG2 PACTL PIA PRA PIA CRA PIA PRB PIA CRB start delay loop equ DO DD DD OD 99 9 0 9 Q Q eelere Zeie le D Q ldaa staa staa ldaa staa staa ldaa staa clr ldab cle ldy brclr ldaa staa dey bne rolb stab stab stab bra org fdb 1 So 2 2 2 SA SA SA SA kk 00 ooo Wu o H CO OO OO CH On o o oo w N E000 PIA CRA PIA_CRB SFF PIA PRA PIA PRB 04 PIA_CRA PIA_CRB 80 PACTL x TOTEI x 38 o TELG2 x 80 TELG2 x loop PORTA x PIA PRA PIA PRB delay SFFFE start RegBase 80 loop Initialize PIA Initialize test pattern Wait 0 23 seconds by counting seven timer overflows Wait for timer overflow Cle
23. he Parts Mail order is the best way to obtain electronic parts While it s tempting to run down to the local electronics store and buy the parts off the shelf you will usually have trouble getting exactly what you need and wind up paying a lot extra With mail order you can almost always get exactly what you want at a good price All you need is a credit card and a telephone Begin signing up on the mailing lists of mail order houses which sell electronic parts This is easy to do since every major mail order house has a toll free number as well as a World Wide Web WWW site There are three parts listings given for this project one for each parts supplier Generally the fewer orders you make the less overall shipping charges you have to pay It turns out that JDR Microdevices Digi Key and Radio Shack have all of the parts that well need JDR Microdevices and Digi Key are mail order houses while Radio Shack is usually just a car ride away Keep in mind that the parts list and the whole design for that matter isn t etched in stone If you find a better supplier come up with better parts or just want to save money many of these parts can be substituted or even left out entirely Look over the part list carefully and check the items with the mail order catalogs Try to understand what you re buying If you find that a particular part isn t in stock it would be best to substitute the part for another or order it somewhere else as o
24. he glass window on the chip J4 PEO 4 This is the J4 jumper The BUFFALO monitor program uses this jumper to determine whether or not to j to the internal EEPROM or run the BUFFALO monitor at startup RP1 47 ka U10 MN13811 Q eli 2 LVI O Vee 3 This is the reset circuit Pressing the Reset button will cause the computer to stop what it is doing and start from scratch The LVI Low Voltage Interrupt chip can also assert the Reset line if the power supply voltage drops below 4 V This Pe the microprocessor from runnin efore the power reaches a meaning level U8 HM62256 LP15 gt D7 19 yoz A14 a p28 os A13 E oY Ds 17 8 a 105 A12 Ss D4 16 a SEN A11 5 H 1 03 A10 S a y D2 13 05 ad 3 S Da Ag Z a TI E Do 1 00 A7 Ag Ag Ad Ag AZ Ai Ad 22 doe R W eli CE 8 This is the RAM Random Access Memory chip While the MC68HC11 has 256 bytes of RAM internally this usually is not enough for software development The HM62256 provides the computer with an additional 32 kB of R W memory Notice that the EPROM and the RAM chip have similar pin outs This is due to the JEDEC standard which specifies the pin outs of byte wide 8 bit memory devices The JEDEC standard allows memory of different sizes and from different manufacturers to be used in the same sockets with little or no modifications U2 MC68B21
25. ion Segment TITL EVB Address Decoder PATTERN REVISION AUTHOR G Yerem COMPANY UTK DATE 06 19 97 CHIP _CSPAL PAL16L8 SN PIN 1 A15 PIN 2 A14 PIN 3 A13 PIN 4 A12 PIN 5 A11 PIN 6 A10 PIN 7 RW_EN PIN 8 IO EN PIN 9 RW PIN 10 GND PIN 11 E PIN 12 RAM SEL PIN 13 EXTRA SEL PIN 14 PIA1 SEL PIN 15 PIA2 SEL PIN 16 RDIO SEL PIN 17 WRIO SEL PIN 18 SPARE SEL PIN 19 BOOT SEL PIN 20 VCC inn Boolean Equation Segment EQUATIONS RAM SEL A15 E XTRA SEL A15 A14 A13 E RW PIA1_SE Al5 Al4 A13 A12 A11 A10 PIA2_SE Al5 Al4 A13 A12 A11 A10 RDIO SEL Al5 A14 A13 A12 All A10 WRIO SEL A15 A14 A13 A12 All A10 SPARE SEL Al5 Al4 A13 E RW BOOT_SE Al5 Al4 A13 E RW IO_E IO_E PIN Declarations CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO CO MBI IBI IBT IBI IBI IBI IBI IBI IBI IBI IBI IBI IBI IBI IBI IBI IBI IBI EX RW 4 E RW 4 ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI ATORIAI Li Li Li ATORIAI HHHHH HHH Q H a Se a e e e e e e GG E AS UD FD H E H d OO OO
26. is too low lt 4 V the LVI chip will activate holding the computer in a Reset state e Are any chips loose Check to make certain that each chip is firmly plugged in e Is a pin bent under Sometimes a chip s pin can be bent underneath when inserting the chip into its socket causing the pin not to make contact e Is a chip plugged in backwards or wired backwards Here is a step by step procedure for testing the computer 1 Check for shorts in the power buss with a continuity meter If you use an ohmmeter to check for continuity keep in mind that the filter capacitors will charge up giving you a changing reading Now hook up a 5 VDC power supply to the computer With no chips installed power the computer and check each socket for power with a voltmeter Make certain that you read 5 VDC at the correct polarity EE i COROS diii diiis akii EE Ot a ET EE NA 330 Q PAI MW PA6 e EN Ee K 4 PAS gt K VV PA4 Wi ee K PA3 2 Turn off the power and plug in the MC68HC11 the Test ROM the 74HC373 the 74HC245 and the PAL16L8 The Test ROM should be plugged into the 24 Yerem Build Your Own MC68HC1 1 Computer Trainer Boot ROM socket Also wire five LEDs to PA3 through PA7 of the MC68HC11 It s time to perform a smoke test A smoke test is simply a test where you turn on the project and check for smoke After you turn on the computer feel each chip to make sure that none are getting hot This cou
27. itor 10 pF Radial Electrolytic Capacitor 22 pF Ceramic Capacitor 0 1 pF Tantalum Capacitor Right Angle PC Mount Female DB 9 Connector Shorting Jumper Block 1x3 WW Header Pins 16 Pin DIP WW Socket 3 Level 20 Pin DIP WW Socket 3 Level 28 Pin DIP WW Socket 3 Level 40 Pin DIP WW Socket 3 Level 48 Pin DIP WW Socket 3 Level PC Board Mount Green LED With Holder SPST Momentary Square Yellow Pushbutton 2 Position Terminal Block 6 x8 IC Spacing Perfboard 6 5 Solderless Breadboard w Power Busses 54 Point Terminal Strip with Solder Tails Male Female DB 9 Cable 2m MC68HC11A1P MC68B21 74HC373 74HC245 16L8B 27C64 250 HM62256LP 10 MAX232CPE MN13811 O 123 93 648 41 001 5381H5 520 01 2 ED1609 276 1396 923252 923292 AK131 2 Part Description Part No Manufacturer Motorola Motorola Maxim Panasonic Mill Max Industrial Devices Inc E Switch On Shore Technology Inc Radio Shack 3M 3M Assmann 35 Appendix 2 Suggested Board Layout 00000 O00000 O00000 OOFF7F00 OOOO 0000 00000 o0000 DOC 00000 00000 00000 O00000 OOO00 OOOOH 0000 00000 DOC DOC 00000 RE SE 20 O U2 MC68B21 P HM62256 LP15 U6 27C64 250 U7 27C64 250 00000000000000 000000000 CG o0o0o000000 ooooooo o oo 0000000000 0000000000 0000000000 36 Yerem Build Your Own MC68HC1 1 Computer Trainer Appendix 3 Schematic Diagram Address
28. ken into three parts an address bus a data bus and a control bus The address bus is a series of digital signal lines which can send out a binary number which in tum represents a single location in the computer s memory space Since the address bus can only represent a finite amount of unique numbers there can only be a finite number of memory locations in a computer system Once you have a place to store numbers you need a way access them That s where the data bus comes in Just like the address bus the data bus is a series of digital signal lines which can send and receive numbers In this case the numbers represents raw data physical actions or a program Finally the control bus uses its digital signals to keep the address and data busses of the microprocessor synchronized with the external components 2 1 The Design The computer we are about to build will have the Motorola MC68HC11 microprocessor at its core Motorola designed the MC68HC11 so that it requires a minimum of support circuitry in order to build a working design with it This will suit our purposes nicely since it will allow us to learn how to build a computer without sinking in excessive complexity uty MCSBHCHAIP 25 fa MODACUR PETE MODB VSIby rech D Aid mo Pesto Ra Paal PEQ ANS PEZIANZ PENAN D PEO ANO gl a posrss Ll possc PDaMoS paz PD2MISO Pos S nn pos PDO AKD PB4 3 Pa7iPavoc1 pc2 PAB O
29. ld be about 1 tum of insulation and about 4 turns of bare wire wrapped around a post e While spinning wires onto a post be sure not to oppose the direction of wires already tied there e Try not to tie too many wires to a single post Four connections to a single post is about the limit while two connections is the average e A nice straight connection usually works best It may take a few trys to thread the wire to its destination Tweezers help for doing this e Try not to force the tool when you are spinning it because the wire may break and you will have to start over With a little practice you will find that a light touch works best e When wiring the discrete components cut the leads to about 1 2 inch long e Be careful not to twist and break the leads of a discrete component e Do not solder the chip connections Soldered wire wrap connections are impossible to remove if a mistake has to be corrected or if a repair is needed The wire wrap connection alone is strong enough to last 10 20 years e Do not cut the wire wrapping pins if you can help it Again corrections and modifications are easier to make if you leave the posts intact 17 3 4 5 e Do solder the discrete component connections Discrete component connections usually require some soldering since the leads are rounded unlike the rectangular wire wrapping posts As a result there are no edges for a wire to grip onto A 15 watt soldering iron with a small tip does
30. ld indicate a backwards power connection Keep one hand on the power switch and be ready to turn off the power at the first sign of trouble Now check the LEDs Are they blinking Is the program running If not it s time to do some troubleshooting Is the EPROM programmed properly Is the PAL programmed properly Is the crystal oscillator running Check the E clock signal on an oscilloscope and look for a 2 MHz square wave Is the Reset line high Try pressing the Reset button and see if the program starts running emg E as ais ann E E Sone EE Don t disconnect the LEDs yet Tum off the computer and plug in the MAX232 chip Power up the computer again and perform another smoke test Make sure that the MAX232 is not getting hot Using a voltmeter check pin 2 of the MAX232 it should be 10 VDC with respect to ground Now check pin 6 it should be 10 VDC with respect to ground Also make certain that the test program is still running For this step you need a serial terminal program for your personal computer Turn off the project remove the Test ROM and plug the BUFFALO ROM in its place don t plug the ROM in backwards Also make certain that the J4 jumper is grounded Hook up the computer to the serial port on your personal computer Set the serial terminal program to 9600 Baud 8 Data Bits No Parity 1 Stop Bit and No Handshaking 25 Now power up the computer and perform another smoke test Did you get a BUFFALO
31. nd order them since you re getting a pretty good deal from the mail order houses The parts marked are optional and can be substituted for something less exotic Digi Key 1 800 344 4539 http www digikey com dE Ee bech kechl Unit Total Part No Part Description Price Price AE1020 ND Male Female DB 9 Cable 2m 5 35 5 35 ED1609 ND 2 Position Terminal Block 0 37 0 37 ED4648 ND 48 Pin DIP WW Socket 3 Level 5 49 5 49 MN13811 Q ND 3 8V O D Low Voltage Detector 0 85 0 85 EG1403 ND SPST Momentary Square Yellow Pushbutton 0 98 0 98 923252 ND t 6 5 Solderless Breadboard w Power Busses 19 25 19 25 923292 ND t 54 Point Terminal Strip with Solder Tails 9 65 9 65 L20165 ND PC Board Mount Green LED With Holder 0 67 0 67 Sub Total 42 61 8 erem Build Your Own MC68HC1 1 Computer Trainer JDR Microdevices 1 800 538 5000 http www jdr com Unit Total Part No Part Description Price Price Integrated Circuits 1 74HC245 Octal Tri State Transceiver 0 39 0 39 1 74HC373 Octal Tri State D Type Latch 0 45 0 45 1 MAX232CPE 5V Powered Dual RS 232 Trans Rcvr 1 39 1 39 1 68HC11A1P 8 bit HCMOS MCU 11 99 11 99 1 68B21 2 PIA 2 MHz 2 89 2 89 2 27C64A 200 8kx8 250ns EPROM 2 89 5 78 1 HM62256LP 10 32kx8 100ns Static RAM 1 99 1 99 1 16L8B PAL 16L8B 15ns 1 49 1 49 Discrete Components 1 8 0MHZ 8 0 MHz Crystal 1 39 1 39 1 RPS7 4 7K t 4 7 kQ SIP 7 Resistor Network 0
32. nly difference between the second PIA and the original one is that the CS2 pin of the new PIA is connected to the PIA2 signal This means that the base address of the new PIA begins at A400 instead of A000 Data Bus sng ssouppy sng joguog PIA2 A400 Vee Pin 20 Gnd Pin 1 Now you have two extra bi directional ports to work with Similarly you can add as many PlAs to the computer as you need keeping in mind that there are only a finite number of unused address locations available 32 Yerem Build Your Own MC68HC1 1 Computer Trainer 6 Conclusion I hope this was a great learning experience for you When I built my first computer it was pretty frustrating Part of the frustration was due to the complexity of the computer and part was due to errors in the instructions I hope that I ve at least eliminated those two variables for you Nonetheless after a lot of struggling I was able to get the computer working and learned a lot in the process I m sure you will get much use out of your new computer and I know there will be more home built computers in your future Just think ten years from now you will look back fondly to this experience 33 References 1 Ciarcia Steve and Burt Brown Using the Motorola MC68HC11 Circuit Cellar INK 18 1990 36 48 2 Farmer Brian Planting Geraniums by Robot Build an MC68HC11 based 2 D Sensor Circuit Cellar INK 29 1992 12
33. ntil after the testing stage when you are sure that the computer is working Additionally it would be a good idea to add some standoffs to the corners of the board Machine screws work good for this purpose Alternatively you can mount it in a box to protect the wiring You might want to hold off on mounting the computer until after the computer is tested out though EET mes Masai ra ii mn a Wow That was a lot of work Now it s time to test the computer out 23 Testing the Computer Now let s test the computer and see if it works The testing stage is an opportunity where you can learn the most so try not to get frustrated if everything doesn t work the first time Every problem that you face can be conquered with a little patience and the success will be rewarding and educational Turn on your detective skills The process of elimination will illuminate many hidden problems While you are testing check for obvious errors For example go through and double check your connections with a continuity tester Sometimes a broken or shorted connection is not visible to the naked eye Remember a single miswired connection can have bad effects Here is a common sense checklist to keep in mind during the testing e Is the power on Check the power light e Is the power supply set to 5 VDC Be careful not to supply a high voltage to the computer because that will damage the chips On the other hand if the power supply voltage
34. of the spool of wire needed keeping in mind an extra half inch plus some slop 15 5 Strip off a half inch insulation from 6 the other end using some needle nose pliers Place the tool over the first post With the forefinger of your free hand hold the socket to the board and with your thumb hold the wire taught Turn the tool in one direction until all of the bare wire is spun onto the post Now while holding the socket give the turns a push with the tool This will eliminate the gap between the turns and the board mechanically holding the socket firmly to the board 4 Cutthe wire Place the wire in the special slot in the tool with about an eighth inch of insulation inside of the tool Bend the wire at a right angle at the tip of the tool Place the free end of the wire into the tool the same way as before with about an eighth inch of insulation inside of the tool 16 erem Build Your Own MC68HC11 Computer Trainer z 9 Place the tool over the destination post 10 Spin the wire onto the destination post and pull the wire taught with some and give it a press when your done pliers Be careful not to break the wire 11 This is the end result To correct a mistake you can spin the tool in the opposite direction which removes the wire Be careful though not to inadvertently unwrap any wires underneath Here are some handy tips to follow when wire wrapping e There shou
35. ottom We will use these openings to wire power directly to the bread board The photograph in Step 15 shows the recommended orientation for the holes One thing to keep in mind is that the power strips on the breadboard are actually divided in half In other words the strips don t connect all the way across An easy solution is to put small jumper wires in the top of the board 15 Mount the Breadboard and Terminal Strip Drill all the mounting holes for the solderless breadboard and the terminal strip Also drill and cut the two holes for the power connections to the breadboard Screw on the breadboard and terminal strip 16 Wire the Terminal Strip The connections to the terminal strip are arbitrary A recommended series of signals to bring out is listed on the label in Appendix 4 22 Yerem Build Your Own MC68HC1 1 Computer Trainer 17 Wire the Power Connections Power Connector and LED Use heavier gauge wire for the power busses Wire the power busses on the breadboard You might want to paint the power busses on the breadboard so that you remember the polarity The final step in construction is to solder the discrete components Using a 15W iron with a small tip place a small bead of solder on the discrete component connections After soldering the discrete components you can cut their leads shorter Again do not cut or solder the chip sockets It s a good idea that you wait before doing any soldering u
36. pposed to backordering the part Backorders can mean waiting weeks or possibly not getting the part at all not to mention extra shipping charges Be sure to keep the mail order catalog handy when you place your order in case you need to make a quick substitution Backorders shouldn t be a problem for this project since most of the parts are pretty commonplace If you choose you can order all of the mail order parts over the Internet Simply go to the respective WWW site and follow the ordering procedure One advantage to ordering parts over the Internet is that you can instantaneously check the stock for each item as you go along Also you won t feel rushed in case you need to change your mind while ordering If you place your order early in the day the parts suppliers will usually ship the order the same day As a result the shipping method you choose will determine the amount of time it will take to get the parts Second day air mail is usually a good buy With second day air mail the parts will arrive within two business days of when they are shipped The prices and part numbers which are listed below reflect what was available at the time of printing As time progresses the prices availability and part numbers will change If you can t find a part in the recent catalogs find substitutes using the master parts list in Appendix 1 The parts marked are ones you might already have in your parts box If you don t have them go ahead a
37. puter through a dumb terminal We will put the BUFFALO program in an 8 kB boot EPROM so that the computer will be ready for work at power up Additionally there are two other pieces of software that would be useful for this project The AS11 program is a freeware cross assembler provided by Motorola It s invaluable for writing software for the MC68HC11 Also the FTP site has a copy of BASIC11 a stand alone BASIC interpreter for the MC68HC11 The interpreter is fairly complete and fits inside of an 8 kB ROM The Motorola FTP site is located at http www mot com pub SPS MCU 3 3 Alternatively the University of Alberta Motorola Archive is a mirror site ftp nyquist ee ualberta ca pub motorola Download the BUFFALO Monitor You only need the s19 file but if you want an up to date source listing for BUFFALO then download the zip file Path Size Date Comments mon buf34 s19 19182 03 30 1994 BUFFALO 3 4 monitor for the HC11 mon buf34 zip 116221 03 02 1995 BUFFALO 3 4 monitor for the HC11 with source code Download a cross assembler AS11 is a freeware cross assembler for the MC68HC11 It has been ported to many platforms since Motorola has distributed the C source code for the assembler Path Size Date Comments ibm as11 exe 18870 03 30 1994 Cross assembler for the MC68HC11 ibm as11new exe 19584 03 30 1994 Improved version of as11 mac XASMHC11 MAC 49024 03 30 1994 This is asll ported to th
38. rainer reliability For now though don t solder anything just in case you need to make corrections Me i EE mE EE HEN 2 Wire the Internal Connections The internal connections in this case are the leads which are grounded or pulled high The 74HC373 the PAL16L8 the 27C64s the HM62256 and the MAX232 all have internal connections els Wire the Multiplexed Address Data Bus These are the lines labeled ADO through AD7 which connect the MC68HC11 to the 74HC245 and 74HC373 Wire the Data Bus These are the lines labeled DO through D7 The Data Bus connects the 74HC373 to the 27C64s the HM62256 and the MC68B21 Wire the Address Bus These are the lines labeled AO through A15 The lines AO through A7 originate with the 74HC373 and go to the 27C64s the HM62256 and the MC68B21 while the lines A8 through A15 originate with the MC68HC11 and go to the 27C64s the HM62256 and the PALI6L8 19 6 Wire the Control Bus The signals in the control bus include RESET AS E R W BOOT SPARE RAM and PIA1 8 ions go to the MC68HC11 Be careful the pins are short and fragile We ll solder the connections later The pin with the dot above it is the common which goes to Vcc You can use tweezers to manually wrap the wires to the resistor pack Alternately you can wire the pins first then thread the wires through the board In that case you may need to drill the holes out a little 7
39. remove the discrete components and carefully turn the board over Cut out the labels in Appendix 4 and glue them underneath the appropriate sockets A knife and tweezers are helpful for placing the labels Also double check to make sure you have the orientations correct 14 Yerem Build Your Own MC68HC1 1 Computer Trainer 3 4 4 How to Wire Wrap Wire wrapping involves spinning 30 gauge wire onto special sockets with rectangular posts in order to make point to point electrical connections Does that sound simple Well actually it is Wire wrap connections are very reliable and well suited for digital signals Some tools you might find useful for wire wrapping are tweezers a wire wrapping tool an X Acto knife diagonal cutters needle nose pliers and a wrapping wire dispenser Here is a close up picture of the wire wrapping tool that Radio Shack sells It s a manual tool which is very reliable Also hidden in the handle you will find a handy wire stripper ET T If you shop around you will find that there are many varieties of wire wrapping tools available Some tools will dispense strip and cut the wire automatically for you and some are also motorized to spin the wire for you 1 personally use a manual tool because it is inexpensive and yields very reliable results Here is a step by step description of wire wrapping 1 Strip off about a halfinch of insulation 2 Measure the pointto point length from the end
40. ug in the MC68B21 Wire eight LEDs to the PIA Perform the usual smoke test Run the test program Are the LEDs blinking Congratulations You have just built your own working computer from scratch 27 Using the Computer 5I Now that the computer is finished you can start putting it to use This section will describe what is required to program your new computer In addition to reading this section read through the MC68HC11A1 data book the MC6821 data sheet and the M68HC11EVB Evaluation Board user s manual These documents cover a lot of information not dealt with here Our computer was designed to be similar to the Motorola MC68HC11 Evaluation Board EVB which you may be familiar with Nonetheless our board has many differences from the EVB so keep this in mind when you are programming This section will cover what those differences are Programming When you are programming your computer the most important thing to be aware of is the memory map The Chip Select PAL divides up the 64 kB memory space among the external memory and peripherals while the MC68HC11 handles the addressing of its internal devices When there is an address space conflict between the internal and external devices the internal devices have priority In the memory map drawn below you can see that the internal RAM and Control Registers overlap the 32 kB of external RAM Boot ROM E000 FFFF PAI ER Spare ROM C000 DFFF 15 PAG Internal E
41. va 2a4 7 In7 De Sl un 2a3 H Ing a D 3 7 13 B NDS 2Y2 2A2 In5 sh D4 9 T E S 2Y1 2A1 In4 2 OND 12 iva vaak In3 De ven taste i 5 D1 16 yo Ali in O Do 18 2 y 1Y1 AI Ino 2G Vee Pin 20 HG Gnd Pin 10 To read the current state of the input lines simply perform a read from the address A800 The following line of assembly language will read the values of the eight input lines into the A register ldaa SA800 This circuit can apply to other type of digital input that you would want to connect to the computer such as an analog to digital converter 31 5 2 3 Adding a Basic Output Port Here is a circuit similar to the previous one which provides eight digital outputs to the computer 74HC273 8D Out7 D6 17 p 16 Ge ges Qs gt Out a 6D 6Q gt Outs sh D4 13 12 Ka 5D 5Q gt Out4 al AND3 8 9 a Ars gt Out3 sas gt Out2 8 2055 gt Outi 1Q gt Outo Vee Pin 20 Gnd Pin 10 A simple write to the address AC00 will change the states of the outputs The following two lines of assembly language show how to do this ldaa AA staa AC00 You can of course use this circuit as an example for connecting other types of output devices to the computer 5 2 4 Adding More PIAs If you require more sophisticated I O you can add more PIAs to the computer Simply plug the new PIA into the breadboard and wire it directly to the data bus through the terminal strip The o
42. verything goes well BUFFALO will print the message done and provide the command prompt again 6 You can now run your program by using the go command If you forget a command in BUFFALO typing help ENTER will display the list of commands The EVB manual has detailed descriptions of the other BUFFALO commands Programming Your Own ROMs You can write your program to fit in a boot ROM First you have to place the program in the space between E000 FFFF and place a jump vector to your program in the address FFFE When your new ROM is programmed you must physically remove the BUFFALO ROM and replace it with your new ROM Subsequently your new program will run every time the computer is turned on Alternately you can use the Spare ROM socket for your program In this case you must place your program within the space C000 DFFF This time though you won t be able to modify the Reset jump vector to jump to your program You can either run your program from the BUFFALO prompt or pull the J4 jumper high to tell BUFFALO to jump to the first location of the MC68HC11 s internal EEPROM at B600 Then you simply need to put a jump instruction at B600 to call your new program Keep in mind that the Spare ROM socket is for your use and can be left empty most of the time Most of the time though you will be loading your program into the computer s RAM and executing the program from there The advantage of this is that you
43. will be able to rapidly change your program and try it out The disadvantage is that the program will disappear when the computer is tumed off Interfacing In order to keep the design practical certain built in resources of the MC68HC11 aren t available on our computer For example in this design the pins PDO and PD1 are used for the serial port and as a result aren t readily available for use as digital I O Also since the BUFFALO monitor program uses PEO as an input 29 5 2 1 for the J4 jumper PEO shouldn t be used for other purposes Additionally lines PE4 through PE7 of Port E aren t pinned out on the MC68HC11A1P version used in this design This is because the DIP Dual Inline Package version of the MC68HC11A1 used here doesn t have enough pins to accommodate all of Port E The pins PE4 through PE7 are only available on the PLCC Plastic Leaded Chip Carrier version The PLCC version wasn t used for this project because it would have been harder to wire by hand Finally Port B Port C STRA and STRB are unavailable because we are operating the MC68HC11 in expanded mode as opposed to single chip mode Expanded mode is what allows us to connect external memory like the HM62256 RAM chip and the 27C64 EPROM chip to the microprocessor Despite these limitations expanded mode allows us to add as much I O to the computer as we require albeit with a few extra chips required In this design the MC68B21 chip augments the available digit
44. y of the lines on a port to be configured as inputs or outputs A zero bit will configure a line as an input while a one bit will configure the line as an output Similarly the Peripheral I O Register allows you to read from and write to the I O ports A simple procedure for programming a port on the MC6821 is to 1 Set the DDR Access Bit in the Control Register to 0 2 Program the Data Direction Register 3 Set the DDR Access Bit in the Control Register to 1 4 Access the Peripheral I O Register to read and write the I O port This procedure applies for both Port A and Port B Once you have programmed the Data Direction Register you probably will want to leave the DDR Access Bit set to 1 for the rest of the program Here is a code snippet which demonstrates how to program the MC6821 clr SA001 Set the DDRA Access Bit to 0 clr A003 Set the DDRB Access Bit to 0 ldaa AER staa A000 Set all bits on Port A to output ldaa 0F staa A002 Set upper bits of Port B to input and lower bits to output ldaa 04 staa A001 Set the DDRA Access Bit to 1 staa A003 Set the DDRB Access Bit to 1 ldaa FF staa SA000 Turn on all of the bits on Port A ldaa SA002 Read Port B Check the MC6821 data sheet to find out how to use its more advanced features 5 2 2 Adding a Basic Input Port If you need digital inputs the following one chip circuit will do the job 74HC244 D7 Sa

Download Pdf Manuals

image

Related Search

Related Contents

rapport d=enquête aéronautique a05q0024 atterrissage à côté de la  Manuale - Bombeeck Digital  Kat. Nr. 35.1129  TPS300 Basic Series  User Manual EKI-6528TI/ 6528TPI  2014 - Ligue d`Alsace du Sport Adapté  LEC T5039  National Instruments 371685C-01 Network Card User Manual  Philips 8718291794073 energy-saving lamp  Manual de instruções  

Copyright © All rights reserved.
Failed to retrieve file