Homebrew Microcomputer Design

Download as pdf or txt
Download as pdf or txt
You are on page 1of 35
At a glance
Powered by AI
The key takeaways are that the book aims to help students, hobbyists and DIY electronics enthusiasts build their own sophisticated yet minimal microcomputer using both legacy and modern components in a cost-effective way.

Some of the minimal components needed to build a basic microcomputer include a CPU, RAM, ROM/EEPROM, output devices like video and sound, input devices like keyboard and joystick, and glue logic to connect everything together.

When choosing a CPU, factors to consider include personal preference, requirements of the system being designed, whether to use a legacy CPU or modern CPU, and examples given are 6502, Z80, 68000, and modern RISC CPUs. The choice depends on the designer.

Homebrew Microcomputer Design

How to design your own fully functional microcomputer

Objective of this book


To help student,hobbyist and DIY electronics enthusiasts build their own sophisticated yet minimal microcomputer. Using legacy (old) components (ICs) and modern ones too.

Contents:
Choosing components:.......................................................................xx Sourcing affordable parts (ICs)..........................................................xx Design methods..................................................................................xx Using programmable logic (PLDs Vs TTL) ..................................xx A basic Generic design......................................................................xx A More advanced generic design.......................................................xx An ideal generic design .................................................................xx An Example Z80 Design ...............................................................xx

Choosing components.
Choosing components is an important part of any microcomputer design. For the amateur, non commercial enthusiast this normally means low cost modern or legacy ICs. Keeping costs down while still making the system being designed reasonably powerful. What tends to happen is a design will evolve that will use a combination of both legacy and modern ICs. Making a bit of a mongrel, however that is not a bad thing as this approach can prove to be both the most cost affective and efficient. As all homebrew microcomputer designers know you need a minimal of components, namely, CPU (central processing unit), RAM (random access memory), ROM/EEPROM (Read only memory), Output device/ devices ( Video TV, LCD, Sound, Printer port etc), Input devices ( Keyboard, Joystick etc) Input/Ouput (Serial I/O, Parallel I/O), plus not forgetting 'GLUE LOGIC' the stuff that connects everything together. Selecting a CPU: How you select a CPU is entirely up to your personnel preference and requirements, whether this be a legacy CPU or a Modern type. Examples are : ( 65C02, 6809, Z80, 8 bit : 68000/68008 16 bit legacy ICs) or Modern RISC types like ATMEL etc... The choice is yours ! 65C02 : 8 bit, dates from 70/80s used in Acorn BBC B/Electron, ORIC-1 & Apple II to name a few Retro machines. Still made as W65C02P. Z80 : Probably the most common 8 bit CPU from the 70/80s. Used in Amstrad CPC/PCW, MSX I & II, Memotech MTX, Tatung Einstein, SORD M5, ZX Spectrum etc. MC68008: 32 bit internally with 8 bit databus. Used in the Sinclair QL. MC68000: 32 bit internally with 16 bit databus, used in Atari ST & Commodore Amiga from the 80s Selecting RAM : In an 8 bit system 32K or 128K will be enough for most purposes. Using 32K obviously makes memory decoding easier. In a 16 bit system (68008/68000 etc) then a minimal of 128K or 512K would be advised. As these SRAMs are now cheap and readily available this would

be a better option than using DRAMs Examples of SRAM (static RAM) : W24257,UM62256 (both 32k x 8),UM62512 (64K x 8), TC551000,KM681000,HM628128 (128k x 8), KM684000,K6T4000 (512K x 8 bit). Selecting ROM/EEPROM: as with RAM the size of ROM normally depends on whether your using an 8 bit CPU or 16/32 Bit CPU. For an 8 bit system then 32K or 64K would suffice though you could utilise a larger FLASH eeprom for larger ROM storage. 512K Flash ROMs are cheap and easily sourced. Examples of EEPROM: AT28C256 (32K x 8), W27C512 (64k x 8) Input Devices : Connecting things like Joysticks, Keyboards etc can be done in a variety of ways, you could use a microcontroller like the 8051 to read the keyboard/joysticks etc. Or you could use a CPLD (complex programmable device) though you'd need to be able to program it using a boolean logic , ( VHDL or Verilog ). Output Devices : This normally covers things like Video/TV or LCD display. This can be done using a low cost legacy Video processor IC, like the V9958 or V6366. Input/Output devices: These normally mean serial and parallel I/O. This can be done using a dedicated I/O controller IC or utilising spare logic on the CPLD to perform both serial and parallel I/O. This could also produce the signal to drive a legacy (LPT) printer,. Sound Generation: Sound is an audible output and again there is numerous legacy chips to choose from that are as cheap as chips. Things like SN76489,SAA1099,AY-3-8910 etc Glue Logic: On older designs you see a lot of TTL/CMOS 7400/4000 series ICs NAND,AND,NOR gates etc. I fell it is much better to put this logic onto a CPLD or PLD (programmable logic) chip and reduce cost and chip count. It is also a much more elegant approach to use a CPLD as Glue Logic, giving greater flexibility (these can be reprogrammed) and reduce the overall PCB size of your final design. Common CPLDs include Altera MAX series (EPM7128SLC84 etc), Xilinx, Atmel and many other manufacturers.

Sourcing affordable parts


Cost is a major factor for the homebrew designer, keeping things in a realistic budget is very important. It's no good designing a 'Super' System that costs a million dollars to produce. Keeping the cost of the ICs down is important especially if you want other people to make your design. A system that is too expensive just won't be popular. Ideally making everything fit on a double sided PCB (if possible) will also be advantageous, as multiple layered PCBs are much more expensive to produce. Sourcing best prices for parts is just a matter of looking around, there's lots on companies selling ICs, DIGIKEY, RS,FARNELL,MAPLIN electronics etc and of course ebay. There are numerous ebay shops selling NOS (New Old Stock ) ICs from China. These could be legacy or modern ICs. When buying from ebay shops it is often best to deal with them direct. Request a quote for ICs, thus bypassing ebay fees and saving a large chunk of cash. How I normally buy ICs from ebay shops, is to email/contact them direct and RFQ (request For Quote) listing what I want and asking for their best price. Obviously this is best if your asking for quite a few ICs as that way you'll get a good discount. I bought ten Z80 CPUs for a little more that just one Z80 from a UK ebay shop ! Showing that you can save a lot of money buying direct.

Design Methods
Keep it simple !
Simple designs are more likely to work and cheaper to build!
When designing an electronics circuit you should always try to design the most simple and hopefully elegant design. Thus reducing the amount of work ( Man Hours) needed and the overall cost of the design. Using discrete components : One method of designing a homebrew microcomputer is to use a lot of old TTL/CMOS discrete logic. This method has advantages and disadvantages. Advantages : There are lots of old schematics and drawing to copy and use, which some people like. Disadvantages: More ICs means more complexity, larger PCB more time needed to design and produce a PCB layout, may even be more costly. Can if not designed well look messy. May need multilayer PCB . 4 layers or more ! Using PLD/CPLDs: This in my opinion is the most elegant and cost effective method. The CPLD is the one Chip GLUE logic that holds the whole design together. One CPLD can contain the logic for dozen or even hundreds or thousands of discrete TTL logic ICs. Advantages: Can be cheaper to buy one CPLD or PLD as opposed to dozens of TTL ICs. Reduces the chip count significantly to a fraction of what might otherwise be needed. Can be Cheaper. Easier and less time consuming to design the Schematic and PCB layout. The final PCB can be significantly smaller.

Disadvantages: The PLD/CPLDs need to be programmed, so some knowledge of logic programming in VHDL,Verilog or boolean equations is needed

Programmable Logic Vs Discrete TTL


A long long time ago (back in the 70s and 80s) Dinosaurs ruled the earth and blokes with beards designed microcomputers using discrete TTL logic to connect everything together, the TTL chips where called 'Glue' logic. These simple NAND,NOR,DECODERs etc connected all the larger ICs to each other and the outside world. Some discrete ICs still are useful like the 74138 & 74154 decoders used to decode memory. But most are now obsolete and some even in museums ! Thankfully time has moved on and a new kid is on the block... the PLD/CPLD programmable logic. Each PLD can contain effectively dozens on 74 TTL ICs. A CPLD can contain hundreds or even thousands of 74 ICs. Back in the 70s and 80s a small 8 bit microcomputer could contain a hundred or so ICs of which approximately 70% would be small ICs like 7400 type. Now it is possible to make the same or better microcomputer using about 10 ICs. One useful 74 series are the decoders 74138,74154 etc.. These can still perform a good job of memory decoding especially on 16/32 bit systems like MC68000 where for a homebrew design a small block of RAM/ROM used for I/O is acceptable.

Using a 16V8 PLD as memory decoder on a 8 bit system (R65C02)

Using a 74HC138 3 to 8 decoder to memory (MC68008)

Using CPLDs (complex programmable logic)


Using a CPLD reduces the chip count for glue logic to 1 ! Makes the PCB (printed circuit board) easier to design and smaller and hopefully the design will be cheaper and more flexible. As the CPLD can be reprogrammed the design can be modified even after completion! One CPLD can perform numerous functions: Memory Decoding (RAM,ROM,I/O & bank switching etc) Reading keyboard & Mouse Parallel port I/O for printers etc. Serial I/O to connect to serial devices or a PC Video Generation... to generate simple Bitmapped video Device selection to communicate to other ICs..V9938 , I/O devices etc.

Advantages : many discrete ICs can be put on one CPLD, more cost effective, Smaller board size (PCB) hopefully easier to design reducing overall manhours. Disadvantages: No need to be able to program the CPLD or know someone that can.

Programming is normally done in VHDL or Verilog which are programming languages design for boolean equations and electronics.

A basic Generic Microcomputer Design


A simple microcomputer based on a 8 bit CPU, 32K SRAM, 32K EPROM, EPM7128 glue logic, V9958 video processor & Optional Sound Chip, Plus Serial RS232.

Block Diagram
Serial RS232

functionality description: 5V regulator.. a 7805 regulator turns 9V DC input into a fixed and stable 5V level for the design. The Generic CPU/Microprocessor could be a 6502/6809/Z80. The data and address bus are fed to the SRAM, and EPROM as expected. A15 of address bus selects ROM/RAM

Chip (RAM/ROM) select is done by the CPLD, A15,The microprocessor is interfaced to the CPLD. MREQ, IOREQ and other control signals can be fed into the CPLD. The CPLD then outputs.... select ROM, RAM, I/O. Since this system uses 32K RAM, 32K ROM this should be relatively straight forward. One lines selects ROM,one RAM, one I/O etc. Glue Logic, EPM7128. The MAX CPLD control the I/O functions. A0..A7 , D0...D7, MREQ,IOREQ and other control signals from the CPU. The CPLD is programmed to map I/O to select ROM/RAM/Video (V9958), and serail RS232 as well as keyboard/mouse functions. The design is simple as most of the logic design is in the EPM7128 CPLD, probably in a PLCC84 package giving 68 I/O lines to interface too. Serial RS232 is done by the EPM7128 CPLD and the MAX232 voltage converter. The CPLD hold the logic for the serial comms circuitry and the MAX232 generators RS232 compatible signal generates the serial . EPM7128 will need to be programmed as it is blank by default. So some knowledge of VHDL, PLD logic programming is needed. GAL/PLD/CPLDs programmers can be obtained quite easily, some cheap/inexpensive examples are : TOP853,G540 and a USB blaster cable for programming the EPM7128 CPLD. These can found on ebay. Video processor : V9958 this is used as an output device, giving both TEXT and GRAPHICS functions. Other output devices could be used: LCD driver, LEDs etc. However using a legacy Video Processor allows for greater flexibility and are relatively cheap. The V9958 can be used with 4 or 6 DRAMs (D41464 or similar 64K x 4 bit) or one single 128K SRAM. Sound Generator: This is not really needed, but for producing audible tones and music one can be added. The simplest and cheapest are ones like the SN76489, SAA1066 & AY-3-8910. Note the AY-3-8910 has two parallel ports ideal for connecting joysticks.

BOM (Bill of Materials )


Item / Package Z80/6502/6809 28HC256-7 CY62256-70 SN76489 PSG ?? optional EPM7128LC84 PLCC84 V9958 DIP64

Description CPU 32K EPROM 32K SRAM PLD CPLD VDP

QTY

Item / Package

Description Jack conn. Mini Din TV output RS232 CPU CLK VDP CLK

QTY 1 2 1 2 1 1

1 1 1 1 1 1

DC input Jack PS/2 6pin RCA phono DB9 male xxMhz Xtal 21.447MHz Xtal

D41464

DIP18

DRAM 64kx4 RS232 Driver 5V regulator

4 1 1

Caps. Various Resistors Miscellaneous

? ? ?

? ? ?

MAX232CPE DIP16 7805 Voltage Reg.

A More Complex Generic Design

CPU/MPU. Central processor 16/32bit can address several Meg of RAM/ROM. 2 RAM +2 ROM, with Cartridge and I/O selection is done by the 16V8 PLD. Each ROM/RAM could be from 128K to 512K ideally SRAM, eliminating the Refresh circuitry needed for DRAMs. Two CPLDs are used both PLCC84 through hole, one is used for video, and Serial/Parallel I/O. The other for sound and keyboard, spare logic could be used for CTC,WDT, Clock etc Keyboard/Mouse is done via a microcontroller such as a 8051 or ATMEL type this takes some of the work load from the CPU. Video is done via the CPLD generating video out which is fed (Genlocked) into the V9958 giving two effective video processors. This should allow good quality graphics/text for a homebrew design. Sound is done using the AY-3-8910 which has two parallel ports ideal for connecting joystick ports.

You could alternatively use a different sound chip (PSG) like the SAA1099 or SN76489. A Cartridge port is added for connecting external ROM/RAM. Also an expansion bus is shown which could be used to attach a daughter board.

The Ideal Homebrew Microcomputer Design


Some of the Ideal goals for designing a homebrew microcomputer. 1) 2) 3) 4) 5) 6) 7) To be as simple as possible To be a powerful as possible To be Cheap ! To be elegant and stylish To fit (ideally) on to a double/Single sided PCB To use easily sourced components To have connectivity to outside world

Example Z80 Design


Designing a Z80 Based Microcomputer

How to design a minimal high performance Z80 based microcomputer with high quality graphics. Using less than 15 ICs !

Part 1
Preparation. Board Layout and components selection: I've decided to use a board layout of 220 x 160 mm to give plenty of space for each component. I've also decided to use two EPM7128 CPLD. One as a memory decoder and one as an I/O decoder/ interface. Though it would be better to use one EPM7256 144pin SMD (124 I/O lines). You don't have to lay your board out the same way or use two EPM7128s. I'm using FreePCB to do the board layout and am not going to bother with a schematic as there's only a dozen ICs or so. But if you want to do a schematic I'd recommend using Eagle as it's cheap (Free) and easy to use. So lets start: Drag and drop your components from the parts library onto your virtual board. This should take you a quite a few minutes. Some parts you'll probably have to use generic devices, such as a DIP64 for the V9958 IC. Now lets do the power supply. Connect the 9V DC input to the 7805, voltage regulator you could pop a fuse in series with this if you want as a safeguard, also popping in some smoothing capacitors between 0V and 9V input will help. I will also be putting in a LED to show that the board is ON or OFF.

9V in Switch

5V Out
FUSE 7805 Regulator

LED

Now we have 5 Volts and ground (0V) ! These need to go to every IC, Z80, EPM7128s, V9958, SRAM, EEPROM, FLASH, MAX232 , 41464 DRAMs. They'll also have to be connected to very connector, printer DB25 (or Centronics ), PS/2 , Com2,Com2 DB9, Scart (TV) etc... This will take some time as you'll have to look at every connectors datasheet/pinouts to see which pins are ground and Vcc 5V ! This is a time consuming part of the build. Use your logbook to make notes and jot things down. I tend to cut-out the pin-outs and glue them into my logbook to save drawing them! A bit like Blue Peter. It's very important to note things down and keep an accurate log otherwise you'll get in a muddle later !

We can also connect a RESET button placed at the front of the board, this is a SPST momentary switch. It simply momentarily pulls the CPU Z80 Bus RESET to zero . The exact wiring for this can be found in the Z80 Data-sheet with pull-up resistor values etc. It should go to the CPLD that connects to the Z80 Bus (and reset) which will buffer it and stop de-bounce, it will then feed to the external Z80 Bus and thus to every IC with a Reset. Now you know why you printed out all those datasheet IC pinout diagrams !! By now ( several hours later) your ready for a cup of tea. ** See Datasheets at end for 7805 pinouts etc.

Part 2 Connector Z80 Bus , & I/O Bus.


Now lets connect the Z80 Bus to the EPM7128 (lower one) this will be used to decode RAM/ EEROM/FLASH and could use (surplus) extra logic for producing Video (like on the ZX Spectrum or Amstrad CPC) . This video could theoretically be Fed into the V9958s external video-in socket ! The Z80 BUS consists of address line A0..A15, Data lines D0..D7, and control signals, Halt, Reset, R/W , MREQ,IOREQ etc 36 lines in total 40- Crystal,Vcc,Gnd. Make a note of which I/O lines on the EPM7128 you connected these too!! As you'll need this information later. The Z80 I/O Bus consists of D0..D7, A0..A7, R/W, I/OREQ this will go into the upper EPM7128 CPLD , again noting which pins go to which CPLD I/O lines! So now we should have the Z80 BUS connected to one CPLD EPM7128 and the I/O BUS connected to the other CPLD. This all sounds quite easy, but you should of discovered that's not. It'll of taken you several hours to do this properly making notes as you go in your logbook. Now we can connect the 20MHz Crystal to the Z84C0020 CPU.. this is straight from the datasheet, one crystal plus two capacitors!. Then the 21.4772 Crystal on the V9958 in much the same way !

Z80 CPU

Z80 BUS

CPLD PLCC84

CPLD PLCC84

Now you can go and have a cup of tea ....you've earned it ! * Don't forget to save your work *

Part 3 Connecting SRAM, EEROM, & Flash


Now lets connect the SRAM, obviously data-lines D0..D7 go to the corresponding lines on the Z80 bus, as do address lines A0..A13 giving 16K bytes blocks , so RAM is put into 16k blocks. The control lines R/W go the Z80 Bus too. CS chip-select goes to the CPLD as this determines when the chip is ON or OFF and address lines A14,A15,A14 go to the CPLD as this selects which block is paged in. EEPROM is connect in a very similar way to SRAM, D0..D7 to Z80 bus, A0..A13 , plus R/W to Z80 BUS again giving 16K blocks. However only A14 & A15 are connected to the CPLD , chipselect goes to the CPLD. Flash memory can be missed off if you want, if connected then it's connected just like the SRAM again giving 16K blocks which can be switched in or out.. It could also be connected via a DIL/SIL connector like a ROM cartridge allowing it to be removed. So you could have lots of cartridges to plug in, each 512K bytes big.... just like popping in SD cards !! For exact details it's best to look at each ICs pinout from the datasheets !

CPLD Z80 BUS


Memory Decoder Flash Memory Flash memory could be connected via a Cartridge port. Or Even Omitted EEROM SRAM

Address & Data Bus

Part4
Connecting Printer,Expansion port,Keyboard & Joysticks
Now lets connect the printer, Connect it to spare I/O lines on the CPLD for I/O . I believe 13 I/ O lines are needed these include D0...D7 plus control signals for handshaking and stuff.. 5V and Gnd should already be connected. You can either use a DB25 and configure it like a PC LPT port or a Centronics ports as in the original Einstein. The pinouts for an LPT1 port can be found on Wikipedia and a Centronics from the Einstein manual. Remember to make notes of what goes where in your logbook! The Expansion port is normally just the Z80 BUS, but sometimes it is the Z80 BUS plus extra control signals.. it's up to you how you wire it. I wouldn't worry about the original Einstein's connectors and expansion ports.. as most of the stuff it was connected to is completely obsolete! Think of how it can be connected to modern equipment not old ! The PS/2 keyboard and mouse.. they have DATA and CLK that need to be connected to available I/O lines. It might be worth just connecting these to the nearest CPLD for convenience. Again making notes in your logbook! The two joystick ports can be connected like Atari ones, I believe that gives 5 data-lines each , so giving 10 I/O lines to the CPLD. Of course you could miss them off. Or if your short of I/O lines use another CPLD like a ATF1502 or micro-controller to connect them. The Joystick port could also be connected to the PSG via it's two I/O ports as these are no longer needed to scan the keyboard matrix ! This is probably the best option !

Printer

Com1

Com2

Auxiliary

CPLD Z80 I/O BUS


I/O Decoder

Joysticks

Keyboard / Mouse

Part 5 Video V9958 Circuit.


21.4772MHz Crystal VRAM (4 or 6) DRAMS 41464 64K x 4 bit

Data Bus

Control Signals

Mode/Register Select

Video Out

V9958 EVDP Video IC

External Video In Possibly from CPLD

Block diagram of Video Circuitry


This is probably the most complicated and time consuming part of the circuit! It's best to use an existing circuit from the Einstein256 schematics or an MSX Turbo R schematic. You can use 128K (4 x 41464 DRAMs) or 192K (6 x 41464 DRAMS) obviously using six is more complicated. Control lines such as Chip-select go to either the I/O or memory decoder CPLD. Other Control lines like R/W go straight to the Z80 bus Mode select, Mode 0, Mode 1 also go to the CPLD D0...D7 go to the Z80 databus The rest should be pretty well wired as in the Einstein256. Note in the Einstein256 Mode 0 & Mode 1 go to A0 and A1, this is because port 0 and 1 are used by video. But it it best to wire it

through the CPLD rather than straight onto the Address Bus. External video could be connected via DACs to one of the CPLDs allowing external video / Superposition to be used. This would allow ZX Spectrum or Amstrad CPC graphics modes to be used. The V9958 graphics being superimposed or overlaid on top. Use your datasheets and service manuals to help. The MSX turbo R manuals are online, the text is in Japanese, but this does not affect the schematics.

Part6 Sound Chip


General Instruments - AY-3-8910, AY-3-8912, AY-3-8913 Programmable Sound Generator
FEATURES

Full Software Control of Sound Generation Interface to Most 8-bit and 16-bit Microprocessors Three independently Programmed Analogue Outputs Two 8-bit General Purpose I/O ports (AY-3-8910) One 8-bit General Purpose I/O port (AY-3-8912) Single +5 Volt Supply

DESCRIPTION The AY-3-8910/8912/8913 Programmable Sound Generator (PSG) is a LSI Circuit which can produce a wide variety of complex sounds under software control. The AY-3-8910/8912/8913 is manufactured in the General Instrument N-Channel Ion Implant Process. Operation requires a single +5V power supply, a TTL compatible clock, and a microprocessor controller such as the General Instrument 16-bit CP1610 or one of the PIC1650 series of 8-bit microcomputers.

The PSG is easily interfaced to any bus orientation system, its flexibility makes it useful in applications such as music synthesis, sound effects generation, audible alarms, tone signalling and FSK modems. The analogue sound outputs can each provide 4bits of logarithmic digital to analogue conversion greatly enhancing the dynamic range of the sounds produced. In order to perform sound effects while allowing the processor to continue its other tasks, the PSG can continue to produce sound after the initial commands have been given by the control processor. The fact that realistic sound production often involves more than one effect is satisfied by the three independently controllable channels available in the PSG . All of the circuit control signals are digital in nature and intended to be provided directly by a microprocessor/ microcomputer. This means that one PSG can produce the full range of required sounds with no change in external circuitry. Since the frequency response of the PSG ranges from sub-audible at its lowest frequency to post-audible at its highest frequency, there are few sounds which are beyond reproduction ith only the simplest electrical connections. Since most applications of a microprocessor/PSG system would also require interfacing between the outside world and the microprocessor, this facility has been designed into the PSG. The AY-3-8910 has two general purpose 8-bit I/O ports and is supplied in a 40 lead package; the AY-3-8912 has one port and 28 leads; the AY-3-8913 has no ports and 24-leads.

See AY-3-8912 Datasheet for wiring details.

PIN CONFIGURATIONS

28 LEAD DUAL IN LINE


AY-3-8912

24 LEAD DUAL IN LINE


AY-3-8913

PIN FUNCTIONS

DA7--DA0 (input/output/high impedance) pins 30--37 (AY-3-8910) pins 21--28 (AY-3-8912) pins 4--11 (AY-38913) Data/Address 7--0: These 8 lines comprise the 8-bit bidirectional bus used by the microprocessor to send both data and addresses to the PSG and to receive data from the PSG. In the data mode, DA7--DA0 correspond to Register Array bits B7--B0. In the address mode, DA3--DA0 select the register number (0--17 8) and a DA7-DA4 in conjunction with address inputs /A9 and A8 for the high order address (chip select). A8 (input): pin 25 (AY-3-8910) pin 17 (AY-3-8912) pin 23 (AY-3-8913) /A9 (input): pin 24 (AY-3-8910) pin 28 (AY-3-8912) (not provided on AY-3-8913) /Address 9,Address 8 These "extra" address bits are made available to enable the positioning of the PSG (assigning a 16 word memory space) in a total 1,024 word memory area rather than in a 256 word memory area as defined by address bits DA7--DA0 alone. If the memory size does not require the use of these extra address lines they may be left unconnected as each is provided with either an on-chip pull down (/A9) or pull-up (A8) resistor. In "noisy" environments, however, it is recommended that /A9 and A8 be tied to an external ground and +5V, respectively, if they are not to be used. /RESET (input): pin 23 (AY-3-8910) pin 21 (AY-3-8913) pin 16 (AY-3-8912) For initialization/power on purposes, applying a logic "0" (ground) to the /Reset pin will reset all registers to "0". The /Reset pin is provided with an on-chip pull-up resistor. CLOCK (signal): pin 22 (AY-3-8910) pin 20 (AY-3-8913) pin 15 (AY-3-8912) This TTL-compatible input supplies the timing reference for the Tone, Noise and Envelope Generators. BDIR,BC2,BC1 (inputs): pins 27,28,29 (AY-3-8910) pins 18,19,20 (AY-3-8912) pins 2,3 (No BC2 on AY-38913 see below) I/O PORTS Two additional blocks are shown in the PSG Block Diagram which have nothing directly to do with the production of

sound -- these are the two I/O ports (A and B). Since virtually all uses of microprocessor-based sound would require interfacing between the outside world and the processor, this facility has been included in the PSG. Data to/from the CPU bus may be read/written to either of two 8-bit I/O Ports without affecting any other function of the PSG. The I/O Ports are TTL-compatible and are provided with internal pull-ups on each pin. Both Ports are available on the AY-38910; only I/O Port A is available on the AY-3-8912; no ports are available on the AY-3-8913.

Connecting Joysticks to PSG rather than one of the CPLDs !

Joysticks
PSG BLOCK DIAGRAM

How to make your own PCBs


Printed Circuit Boards -- how to make nice looking ones from your own designs

There are a handful of ways available to the hobbyist to turn your own designs into PCBs. They yield results of different qualities. Homemade board tend to be of a much lower quality than professionally manufactured ones. Any process that involves making your own board will have a number of steps in common. At a high level, here's what you're doing: 1. Procure a bare copper coated board. These can be bare copper or photosensitive types. 2. There are loads of excellent videos on YouTube showing you how to design a homebrew PCB. I recommend you spent a couple of hours researching this online. I prefer the laser jet method and a hot iron. Where the design is printed off using a laser jet printer and then the ink from the paper is Ironed onto the copper board.. Again theres You tube videos showing this very well ! 3. There are various methods for using an expensive UV box to a simple water resistant maker pen and even transfers. If you have a plain board, 4. All homemade boards are prone to going wrong, lining up both sides on a double sided board can also pose problems and in general Id only recommend doing it yourself if your experience and confident to do it or the board design is very simple! 5. Cost: the cost of buying all the materials, Ferric Chloride, gloves, goggles, copper board etc can be quite expensive and sometimes it works out cheaper just to send your design off and get one made from a budget no frills PCB manufacturer.

Spend a couple of hours on You Tube !!


Souring a PCB manufacturer to produce your board.: UK : there are literally dozens of small companies in the UK that will make you a PCB, Just go online and see ! There are some simple rules to follow. 1. Send your design to at least three companies for a quotation. They will tell you whether they can do it and how much it will cost. Ive seen quite a few offer no frills boards for 15-20 ! Once youve source a company just send of the money and theyll send you your board in about a week. Then you can solder your components onto it ! 2. China : Again there are lots of companies in China that will make a PCB, some will even design the board from a generalized specification, for a price! However it takes at least three weeks fro stuff to come from China so youve got to think of the time delay !

Z80 Tatung_Einstein256 Schematic

LPT1 DB25 Printer pinouts

Serial Port COM1 / COM2

DB9

Pinouts
The following table lists commonly-used RS-232 signals and pin assignments.
Signal Origin

DE-9 DB(TIA25 574)

8P8C ("RJ45")

10P10C ("RJ50")

Name

Abbreviation

DTE DCE
2 3 3 2

TIA561
6 5

Yost

MMJ
2 5

Cyclades

[4]

National Instruments

Cyclades

[5]

[4

]
4 7

Digi[6]
5 6

Transmitted Data Received Data Data Terminal Ready Carrier Detect Data Set Ready Ring Indicator Request To Send Clear To Send Common Ground Protective Ground

TxD RxD

3 6

3 6

8 9

DTR

20

DCD DSR RI RTS CTS G common

8 6 22 4

1 6

2 7

7 8 1 5 4

10 5 2 4 3 6

8 9 10 2 6 5

10 (alt 2) 2 (alt 10) 1 3 8 7

1 9 7 8 5 8 7 4 1 8 4,5 3,4

5 7

PG

common

SCART TV Connector

Atari joystick

Computer port view of the Atari standard connector: 1. up, 2. down, 3. left, 4. right, 5. (pot y), 6. fire button, 7. +5 V DC, 8. ground, 9. (pot x). 7805 Voltage Regulator

Bill of Materials(BOM) list


Integrated Circuits
Item Z80 CPU SRAM EEPROM RS232 driver Sound Generator CPLD V9958 VDP DRAM 64k Flash 512k 5V, 1.5A regulator Code Z84C0020PEC HM628128BLP-7 W27C512-45Z MAX232 IC AY-3-8912A EPM7128-15 V9958 D41464 AM29F040 7805 Qty 1 1 1 1 1 2 1 Max 6 1 1 Price each 1.75 1.00 0.90 0.50 2.50 3.20 5.75 2.00 1.00 0.15 Total 1.75 1.00 0.90 0.50 2.50 6.40 5.75 12.00 (Max) 1.00 0.15

Connectors
Item LPT1 DB25 Code DB25 female Qty 1 Price each 0.45 Total 0.45

PS2 DIN 6 pin Joystick Scart TV DC power Switch On/Off Expansion connector Auxiliary Connector Reset Button

DIN 6 pin female DB9 male SCART DC Jack socket SWITCH Double SIL DB15 ? Single Momentary

2 2 1 1 1 1 Optional 1

0.25 0.25 0.90 0.10 0.05 0.10 N/A 0.05

0.50 0.50 0.90 0.10 0.05 0.10 N/A 0.05

Miscellaneous
Item Crystal 20MHz Crystal Socket 84 LCC Socket 32 LCC Socket 40 Socket 32 Socket 28 Socket 64 Socket 16 Code XTAL 20 XTAL 21.4772 PLCC84 PLCC32 DIP 40 DIP 32 DIP 28 DIP 64 DIP 16 Qty 1 1 2 1 1 1 1 1 7 (Max) Price each 0.30 0.35 0.70 0.25 0.25 0.15 0.15 0.15 0.10 Total 0.30 0.35 1.40 0.25 0.25 0.15 0.15 0.15 0.70

Approx 220mm

DC 9V IN

DB25 LPT1

Expansion connector

Com_1

Com_2

Scart connector

CPU Microprocessor ON OFF 7805

MAX232 V9938/9958 VDP 64pin DIP

VDP DRAMs

EMP7128
I/O CPLD

Expansion Connector Daughter Board

EMP7128
Memory Decoder CPLD

160mm

PSG AY-3-8912 J1 DB9 J2 DB9 Joystick Ports 128K SRAM 32 Pin DIP 64K EPROM 28 Pin DIP 512K Flash PLCC32 Optional

RESET

Keyboard PS/2

Mouse PS/2

Guideline for Board Layout Microcomputer System

LED

Z80 CPLD Board


Power Printer Expansion Serial Com1 Com2 Scart(TV)
Video (TV) output IC and circuity

Programmable logic CPLD


PSG
Central Processor Z80 6809 68008 etc

EPM7256 or similar 160 pins/ 124 I/O lines

Joysticks

RAM

ROM

Keyboard / Mouse

Approx 220mm

DC 9V IN 7805

DB25 LPT1 CPU Microprocessor

Expansion connector

Com_1

Com_2

Scart connector V9938/9958 VDP 64pin DIP

MAX232 CPLD SMD 160pin

Z80 CPU SMD 44pin

Altera MAX EPM7192 With 124 I/O Lines


120mm

Or Equivalent CPLD

Expansion Connector Daughter Board

PSG AY-3-8912

512K Flash PLCC32 VDP DRAMs

128K SRAM 32 Pin SMD

64K EPROM 28 Pin SMD Keyboard PS/2 Mouse PS/2

J1 DB9 J2 DB9 Joystick Ports

Guideline for Z80 Board Layout (V9958) Microcomputer System

You might also like