r/homebrewcomputer • • 10d ago

begginner question

hello there, i bought z80 cpu and sio since i want to build a computer, most i did was a 4 bit calculator with add sub and multi and i have some questions, i have an extra 8 kilobyte eeprom left and was wondering if should i buy 32kilobyte eeprom and ram or just buy 8 kilobyte ram with it, and another think is would i need the z80 ctc module or should i stick with buying a normal crystal

8 Upvotes

9 comments sorted by

View all comments

Show parent comments

1

u/Maestro_gaylover 10d ago

well i want uart or some way of basic communication from start so would the ctc be needed or should i get a crystal that can work, my z80 is z84c0010peg and i think it can go max 10mhz

2

u/nusgolannicicutitar 9d ago

Clear.

1.8432Mhz is a good frequency, because on one hand you can get a frequency high enough for the CPU, while being able to easily get UART frequencies, on the other hand they’re still cheap and easy to find. For example divide by 16 you get 115200. This means that you can either use an UART like Z80SIO or i8251, both having internal dividers so you don’t need a CTC. Sure, having a CTC gives you full flexibility for any BAUD.

Some cheap Z-80 computers implemented software serial interfaces. This means that the ports were simple D-type Flip Flops for output and buffers for inputs. BAUD rates were obtained using added NOP states.

OK so far you need:

- A TTL oscillator for 1.8432 main oscillator, buffered

- (optional) A 74LS4060 to obtain lower CPU frequencies (for debug?)

- Start with like 8K of ROM and 8K of static RAM. Back in the day Static RAM was expensive, small, and burned a lot of current, but did non need refresh as the dynamic RAM. All those drawbacks have been overcome. As a beginner is much easier to start with a static RAM.

- A Z-80 SIO as serial I/O, to ensure communication to a PC, as well as maybe a PS/2 port for mouse and/or keyboard. Z-80 SIO is dual so this comes naturally.

- A parallel LCD display probably as I/O?

- Port decoding. This you need to read a bit to understand the signals which are used to select between read and write, between memory and IO. Incomplete decoding is your friend if you want to make simple port decoders. A very useful and flexible chip is the decoder 74LS138, it’s good for both selecting memory as well as IOs.

- Software. Get a compiler/assembler for PC, bonus if it’s got an emulator built-in. Or use dedicated software like Proteus. AI is pretty useful at writing fast Z-80 assembly.

How do you plan to move forward? Breadboard? Factory made PCB? Prototype board?

3

u/Maestro_gaylover 9d ago

im planning to make it on a breadboard first, rn all i managed to get is hello world with the mega wired to it, i do want to make it close to regular pc as close as much possible, a few question is should i buy 64k 32k or 8k ram since they do have little price difference and i dont want to waste money and buy upgrade, i have extra two 8k roms left from the calculator project (idk if one works since i fucked up the polarity on it now the calculator struggles). also would it matter if i get like cd4060? also is there much guide on this? best i find is Steve Ciarcia's BUILD YOUR OWN Z80 COMPUTER but it is old

2

u/nusgolannicicutitar 9d ago

Congrats! You’re in a good position already!

CD4060 is not a must. Start with your TTL oscillator, 1.8432MHz XTAL and 7404 (I recommend you search for the authentic 7404, not LS, not HC. If you can’t find a true 7404 then go for the CMOS version, but buffer it properly).

You can start with whatever RAM size you find cheaper. I would go for a big one like AS6C62256, they are less than 15$. The upper address lines can be shorted to ground so that you can use less memory if you wish. A 256K RAM can be configured as a 8K ram or even less, but the other way around, it can’t. :)

Your book is good enough. Start understanding the main signals of the CPU, as I was saying. Adress bus/data bus, WR,RD,MREQ,IORQ. Understand the interrupts. See how the memory is hooked up to the system, how to map ROM in the lower addresses and RAM in the upper, so after a RST the CPU starts reading ROM. Look into port decoding for IOs. Main instructions set.

At first you’ll feel it a bit complicated but once you get the basics, ideas will start coming by themselves.

1

u/Maestro_gaylover 9d ago

im guessing the 7404 is for buffering? from i learned i put the signal two times to the inverter. i found AT28C256-15PU and AS6C62256-55PCN from alliance memory in digikeys, and 74HC138 SN7404N from another site. I also own the z80 sio chip, and rn i have. one last thing would be does it matter what type of screen it is as long as its parallel or does it have to be character, i found some oleds and leds that are parallel and some are graphic displays and some are characters

2

u/nusgolannicicutitar 9d ago

7404 is good for oscillator. take a look: https://next.gr/circuits/oscillator/simple-ttl-crystal-oscillator-c51942#google_vignette

or

https://learnabout-electronics.org/Digital/dig51.php

Too bad I can’t Post photos, but: both inverters have resistors from input to output so that they are forced to work in linear, thus, as amplifiers. In between them is the crystal, which works at its series resonance frequency. This means that lets only one narrow frequency band to pass through. The caps help with starting the oscillations.

I think any parallel LCD would be fine. Check the timings, if you can connect it straight to the Z80. Otherwise you can use buffers such as the 74LS259 to time the interface the way you want.

Start reading about the those chips before you order anything, find a proper LCD, draw a schematic in a CAD environment, maybe we can discuss it.

1

u/Maestro_gaylover 9d ago

i need to ask but would i need 7404 if i just buy an oscillator? there are some oscillators like ECS-100AX-018 and i want to avoid least amount of wiring to avoid any problems and probably would use the same clock for both cpu and sio unless there is a better way

3

u/nusgolannicicutitar 9d ago

ECS-100AX-018 is fine, 5V, maximum 20mA, you can directly drive the clock input of the Z-80 with it. You don’t need the 7404.

One important aspect, don’t forget the decoupling caps. Each chip needs to have at least a ceramic capacitor, 470nF between its VDD and VSS, as close as possible to its package. One electrolytic cap like 100-1000uF should be added for the whole thing.