• Please review our updated Terms and Rules here

Designing a Z80-based machine, need help

Capt. 2110

Experienced Member
Joined
May 23, 2015
Messages
362
Location
Texas
So I know enough about electronics and the Z80 to have most of the basics, but I have some important questions that I can't seem to find answers to.

1. If I have a 2732 EPROM, how do I wire CE, OE, and A11? I think A11 just goes to A11 on the Z80 but I can't find anything to confirm it.
2. Do I need the DMA or CTC chips?
3. How would I wire a TMS9918 and a SN76489 to the CPU?
4. Can I get by only using two RAM chips or do I need 8 to fill all of the digital pins?
5. What does the DART chip do/how does it connect to the CPU?
6. I have two 4264 RAM chips. how do I connect WE, RAS, and CAS?

Thanks! I'll probably have more questions over time, but these are the important ones for now.
 
you can get as minimal as you want, you dont need the dma + ctc. you can have just sram+eprom+z80. The TMS9918 is much more complex beast, you probably want some bus tranceivers in there, it has its own memory and bus interface. adding those two chips your going to need some IO mapping and such.
 
Cool. I saw mention of somebody using two Intel 8255 chips for expandability. Is that the kind of chip I would need for mapping or is it simpler than that?
 
The 4264 RAM chips are DRAM, which adds a lot of complication. An SRAM like a 6116 (2K), 6264 (8K), or 62256 (32K) is a lot easier to use as they're are 8-bit each, and don't need to be refreshed like a DRAM.
 
If you're interested in a few contemporary examples, there's the RC2014 and the Zeta-2.

Maybe this is getting the cart ahead of the horse, but I think it makes sense to start by thinking about what you want to run on it. A Z80 computer running BASIC can easily be implemented with a fixed address 32K ROM and 32K SRAM. If you want to eventually run cp/m, then a memory banking scheme is useful. The basic kit RC2104 is an example of an example of the fixed ROM/RAM approach, though boards exist to convert it to a banked approach. The Zeta-2 is an example of the banked approach. The thing I like about the RC2014 approach is that it lets you start simple, and then grow in complexity.

I too would suggest going with SRAM over DRAM, unless you're specifically looking to use DRAM to match a specific historical context.

In addition to peripherals like the 8255, there is a whole Z80 peripheral series -- the PIO, SIO/2, and CTC chips. You're probably going to want some kind of serial IO if your eventual goal is to be able to talk to your computer over a serial connection. Serial IO isn't a necessity, there have been plenty of interesting computers with a keypad and some hex digits.
 
So I know enough about electronics and the Z80 to have most of the basics, but I have some important questions that I can't seem to find answers to.

1. If I have a 2732 EPROM, how do I wire CE, OE, and A11? I think A11 just goes to A11 on the Z80 but I can't find anything to confirm it.
2. Do I need the DMA or CTC chips?
3. How would I wire a TMS9918 and a SN76489 to the CPU?
4. Can I get by only using two RAM chips or do I need 8 to fill all of the digital pins?
5. What does the DART chip do/how does it connect to the CPU?
6. I have two 4264 RAM chips. how do I connect WE, RAS, and CAS?

Thanks! I'll probably have more questions over time, but these are the important ones for now.

Somehow, I don't think your first statement is right. You are asking questions that show that you clearly don't know enough about electronics.
1. A11
If you want to use the full address space of your 2732 you have to connect A11 to something. Connecting to the processor A11 is clearly an option. If you just connect it to ground, you'll only have 1/2 the available EPROMs address space. You might connect it to another address, say A15, if you want half of the EPROM in the low part of memory and half in the high part. Most people just use it as a continuous block of memory, as seen by the processor.
OE is usually connected to the inverse of the write enable from the processor and CE is connected to an address decoder of the remaining part of the address, A12 to A15. One can tie OE and combine the address decode with the write signal into CE. Before you get too far, the signals on a 2732 are OE* and CE* indicating that they are active low, not active high. This means the logic that selects them must be 0 when it is selected. A common address decoder is a 74138 or a 74688, depending on how you want to do it.
Get the copy of the spec sheets for each part you want to use. Look at the timing diagrams until you understand them.
2. I doubt you'll need a DMA chip in a simple system. A CTC is one way to get to the outside world. It would be convenient.
3. Connecting a video chip is beyond what count be done in a few lines of text. Again, look for data sheets and possibly ap notes.
4. 6. Combined: It would be really difficult to do much with 2 bits out of 8 data bits for RAM. It would clearly be an exercise beyond what you will be able to deal with. DRAM, as mentioned by another is not a good idea for a first project. The Z80 can do DRAM but be careful as the Z80 can only directly do 128 cycle refresh and some 64K DRAM need 256 cycle. It is especially bad as they use the same part numbers. I also recommend getting 8 bit SRAMs. They are connected to the bus, similar to the EPROM. Usually they are not a full 64K making it easier to have mixed EPROM and SRAM on the same address space.
5. DART is just two serial chips in one package. Again, refer to data sheets!
6 answered at 4.

It seems clear that you don't fully understand the concepts of addressing. Each device on the bus needs a specific address space defined by some form of decoder logic. The Z80 is a bit more difficult than say a 6502 in that it has 2 address spaces. It has an I/O address space and a main instruction/data address space. One typically connects I/O devices using the I/O addressing but there is no hard rule that says you need to do that.
Again, spend some time looking at the data sheets. Should you decide to to get 6 more DRAMs, you might study the schematics of some other simple computers. You might look at things like the ZX80/ZX81 computers. Another is the Jupiter Ace. These are about as simple as you can get using DRAM.
Dwight
 
I should mention that you can totally control a EPROM with either the OE* or the CE*. There are some slight timing differences and power usages. Logic to decode is often simpler using both as one can optimize gate usage for other parts of the system.
Dwight
 
Welp I clearly know less than I thought. That stinks.
So, how can I tell if a chip is DRAM or SRAM, without digging for the schematics? Can I tell from the numbers or do I have to try to find schematics for each chip?
The A11 question came from an old schematic I found using an older style of EPROM that didn't have an A11 pin, but still had A11 connected to something.
I think I have a 74138 lying around somewhere, so I'll look at the differences first.
I was actually looking over the ZX81 a bit. I forgot about the Ace.
I'll try to redesign the board with everything in mind. Thanks!
 
So, how can I tell if a chip is DRAM or SRAM, without digging for the schematics?

I would suggest googling the part number and looking at the datasheet. It will say in the description. If you're using scavenged vintage components, more often than not it's going to be DRAM, as large SRAM were either not available or not cost effective back in the day. The SRAM chips people are using in vintage designs these days are often 8-bit, so the pin count will typically be larger than a 1-bit DRAM.

62256 would be one option for a 32 KB static RAM, and would fit nicely together with the 27XX EPROM of your choice. IMO UV erasable EPROM are a bit of a pain in the butt to deal with these days, when EEPROM and FLASH are available alternatives.

The A11 question came from an old schematic I found using an older style of EPROM that didn't have an A11 pin, but still had A11 connected to something.

The number of "A" pins generally correlates to the amount of memory available on the IC. Smaller EPROM = fewer address lines.
 
Welp I clearly know less than I thought. That stinks.
So, how can I tell if a chip is DRAM or SRAM, without digging for the schematics? Can I tell from the numbers or do I have to try to find schematics for each chip?
The A11 question came from an old schematic I found using an older style of EPROM that didn't have an A11 pin, but still had A11 connected to something.
I think I have a 74138 lying around somewhere, so I'll look at the differences first.
I was actually looking over the ZX81 a bit. I forgot about the Ace.
I'll try to redesign the board with everything in mind. Thanks!

74138 is not an EPROM, it is used as an address decoder. You'll need that unless you want your 4K EPROM to repeat itself over and over through the address. You'd usually tie one of the decoded outputs to the CE* pin. The inputs would be connected to the processors A12 through A15. You could pick any combinations of addresses for the inputs and tie the other inputs to a level that would enable the chip. I don't recall if the Z80 has any other qualifying signals so you'll need to check the data sheets. I do recall that the processor boots to the address of 0000h. You'll want your EPROM to decode there. You could use the same chip for a SRAM. 4kX8 SRAMs are getting a little harder to get now days, you'd most likely need to get a larger part. You need to determine if you want through hold of one of the surface mount parts as well. You don't need particularly fast memory. Most of the stuff today is way faster than you'd ever need.
I really do recommend spending some time looking at some schematics. You need to really understand what the connections are for before making your own. This is really, really, important. You also need to think about software as well. It won't do anything but use power without some code.
Dwight
 
I've started going through some of the schematics.
I know. I'm sorry if my phrasing was confusing. What is the 74688? Same concept, or is it something else?
I currently now have one HM6264 SRAM chip, along with an old 27C16 EPROM. I need to get an EPROM programmer sooner or later. Is it particularly hard to make one? I'd assume so, but I wanna ask just in case.

Currently I have:
Z80 CPU
Z80 CTC
Z80 DART
Z80 PIO
27C16
HM6264
20x4 display (as it is simple to operate and I don't have a real video chip yet (except for the 6845, but I'd rather start designing it around the 9918 once I know more)
Thanks for all the help so far! I guess I don't know as much as I had though.
 
I know. I'm sorry if my phrasing was confusing. What is the 74688? Same concept, or is it something else?

74688 is a magnitude comparator. It's also used for addressing, though a slightly different approach than the 3-8 decoder. The 3-8 decoder will take three input lines and decode them into 8 outputs, often used for chip selects. Many SBC designs will use a single 3-8 decoder to generate chip selects for several different IO devices or several different memory chips.

The 74*688 will take two sets of inputs and output a chip select if they match. The 74*688 is often used with a dipswitches to put a single IO device at a specific address.

I need to get an EPROM programmer sooner or later. Is it particularly hard to make one? I'd assume so, but I wanna ask just in case.

I've made a parallel-port EPROM programmer before, but those things have gone by the wayside. I'd suggest one of the TL866 variants on eBay. You'll be spending a fair amount of time programming and reprogramming, might as well make the process as simple and modern as possible.

20x4 display (as it is simple to operate and I don't have a real video chip yet (except for the 6845, but I'd rather start designing it around the 9918 once I know more)

20x4 display? A parallel LCD of some sort? Fortunately those are fairly simple to interface to an 8-bit microprocessor.
 
It is a slightly different way of decoding an address. The 74138 gives you 8 outputs for different chunks of memory. The 74688 only gives you one output but sometimes that is what you want. If you want to change where things are addressed, the 74688 is the way to go. If you just want to have a number of fixed blocks of memory the 74138 is the way to go. You can even mix them up. You can use the 74688 to select the block that you'll want. You'd then use 74688 for part of the address and use its output as the select for the 74138. The way you'd use the 74688 is usually with a number of dip switches.
You need a method to boot to address 0000h so moving the decode around may not be so handy for your boot code.
As for building your own programmer, I'd not recommend doing it. Although, the 2716 programming is relatively easy, you'd need a programmer to write the code for the programmer.It can be done with switches but that is a very error prone way to do it.
Dwight
 
74688 is a magnitude comparator. It's also used for addressing, though a slightly different approach than the 3-8 decoder. The 3-8 decoder will take three input lines and decode them into 8 outputs, often used for chip selects. Many SBC designs will use a single 3-8 decoder to generate chip selects for several different IO devices or several different memory chips.

The 74*688 will take two sets of inputs and output a chip select if they match. The 74*688 is often used with a dipswitches to put a single IO device at a specific address.

I've made a parallel-port EPROM programmer before, but those things have gone by the wayside. I'd suggest one of the TL866 variants on eBay. You'll be spending a fair amount of time programming and reprogramming, might as well make the process as simple and modern as possible.

20x4 display? A parallel LCD of some sort? Fortunately those are fairly simple to interface to an 8-bit microprocessor.
Cool, thanks!
I'll see if I can pick one up at some point.
And yes, it's one of the LCDs you see hooked up to Arduino boards constantly. Hitachi driver iirc. Super easy to use.

It is a slightly different way of decoding an address. The 74138 gives you 8 outputs for different chunks of memory. The 74688 only gives you one output but sometimes that is what you want. If you want to change where things are addressed, the 74688 is the way to go. If you just want to have a number of fixed blocks of memory the 74138 is the way to go. You can even mix them up. You can use the 74688 to select the block that you'll want. You'd then use 74688 for part of the address and use its output as the select for the 74138. The way you'd use the 74688 is usually with a number of dip switches.
You need a method to boot to address 0000h so moving the decode around may not be so handy for your boot code.
As for building your own programmer, I'd not recommend doing it. Although, the 2716 programming is relatively easy, you'd need a programmer to write the code for the programmer.It can be done with switches but that is a very error prone way to do it.
Dwight
Good to know. If I do it I'll probably start off with the 74138.
I kinda figured that would be the case. While programming with switches sounds fun, I'm almost certain once the novelty wears off it'll be tedious and irritating.

Thanks!
 
Back
Top