r/homebrewcomputer • u/Maestro_gaylover • 17d ago
question about the clock
hello there, so far for my z80 computer i made a corcuit that and have a question, i want to use a separate clock for my modules and i will be using a 10Mhz cmos z80 with at28c256 eeprom and as6c62256a ram and the eeproms access time is 150ns. So my question is what type frequency clock should i use? i have 4 mhz crystal and 5-6 mhz oscillator
48
Upvotes
3
u/LiqvidNyquist 17d ago
If you can find a copy of the z80 datasheet online, one with the timing diagrams and parameters that include a 10 MHz CMOS version, that will be useful for you.
In general, the z80 provides two clock cycles for your memory access. Actually could be more like two and a half but since there's a delay in creating the RD and MREQ signals it's closer to two. So with a 6 MHz clock, that's 166 ns per cycle, so you would have roughly 330 ns of time. The data needs to be on the bus a little before the end of the last cycle by about 40 ns, so let's call it 290 ns. Then your RAM access plus decode time (how long it takes for your 74xx138 to tun on it's decode output in response to its inputs) needs to be under this time. WIth a 140 ns RAM access time you should be okay.
2
u/S52_DiDah 17d ago
Issues with the demultiplexer. Outputs must NOT be connected to ground. How are you planning to write the assembly code for it?
1
u/IQueryVisiC 17d ago
With „separate“, you mean a clock divider?
1
u/Icy-Culture-993 17d ago
74HC138 - Y0 thru Y7 are OUTPUTs, so they must not be connected to ground!
1
u/SpontaneousDegen 16d ago
I noticed a couple more little issues to check on the schematic.
- The NMI pullup (CPU pin 17)/bus break out does not have a dot on the T junction - it may not be connected.
- I don't see any decoupling caps on the power pins of the chips and the oscillator. Check the datasheets for recommendations, but a 0.1 uF ceramic rated for at least 10V (2x the applied voltage) is a decent start. You may also want a bigger cap such as a 22uF electrolytic to provide a larger current buffer for surges.
1
u/roberts7531new 16d ago
note that in addition to the memory decoder outputs that are shorted to gnd, I see that WR is also shorted to VCC, see near EEPROM
As for the clock question, I dont know the math off the top off my head, but I think you should be safe up to like 10MHz