Loving the series so far. Ben Eater’s is awesome but quite slow paced (lower level, I guess, so more minute detail). So it’s nice to see the same kind of thing from a higher level and is much easier to follow! As an 80s guy who owned a Spectrum it’s extra special :) +1 sub
Don't make the clock too fast! Time passes by in the wink of an eye, it is over before you notice it. I still remember when I was in school, hobbying with electronics. Then came computers with 600 kHz clock, later on with 900 kHz and even ONE MEGAHERTZ! Society should have stayed there, back then times were good, girls were girls and men were men, mister we could use a man like Herbert Hoover again.
great video ! one suggestion: * id put output after input. so that you always output new values right away instead of looping before. same result, quicker. * id do this: loop: call input cp d jr z, loop call output that way the inout loop is tighter (faster) and only bothers to update output if it has changed. maybe close to twice as fast to detect your inputs being optimistic. also you might have made up and down as subs instead of labels and call them inside loop, though that will make them slower. but it might mke it easier to understand and modify.
i realized youd need to refactor the logix a bit. loop: call input cp d jz z, loop call output input: previous code jr forgot call up cp ... jr skip next instruction call down ret
Thank you. I very much appreciate the feedback. It's nice that we are finally discussing coding rather than mainly looking at hardware. Feels like things are progressing. I will be doing a larger keyboard soon, so maybe I could introduce some of these ideas.
Great video and great explanation, thanks, I was however wondering, is there a need for debounce on the switches, unsure at what frequency you may start to see it.
That's a very good point. I'm not sure. We do have the buffer in between the switch lines and the data bus, but whilst that will filter out a small amount of noise I don't think it will fully debounce the switches. I'm not seeing an issue right now, but I'm not sure if it might start showing up at higher frequencies. I'm leading up to a keyboard matrix. I've never seen any hardware debouncing on keyboard matrix circuits. It's possible people just deal with it in software. I'll try to do some experimenting.
I'm watching these in order so don't know yet if you resolved this, but there's an error in your oscillator section, at least on the schematic - R5 should be across the crystal, and R6 should go from one end of the crystal to the 4060, as per the datasheet - your schematic has it with R5 and R6 in series across the crystal. Secondly I would just point out for reference if anyone needs the formula for capacitor selection based on the specs of the crystal, and I've seen a lot of demos/guides using arbitrary values for these, there's a useful application note number AN2867 by ST, see pp.11-13 for a good clear description.
It seems I made quite a few mistakes in this video. No, I had not realised that error. Thank you for pointing it out. Thinking about the resistances involved I imagine it doesn't make much difference. Which is probably why it still seems to work ok. But you are quite right and I will get it corrected. I'll give you a shout-out in a future video.
@@SteveRaynerMakes yeah there's probably a good margin... I'm enjoying the project, and look forward to seeing how the rest works out. Hoping to get stuck in to a z80 computer of my own before long. Thanks for posting!
It's "megohm" and not "meggerohm" although there actually is an instrument known as a "megger." It's short for "megohmmeter" and it's used to test insulation under a high voltage to ensure it won't break down and short out a circuit under high voltage.
I'm afraid I will always refer to it as Mega Ohm. Ohm is the base unit and Mega is the SI prefix for ten to the power of six. Do you refer to RAM size in terms of Meg bytes? And yes I'm fully aware of the company Megger. I used their equipment for portable appliance testing back in my electrical engineering and manufacturing days. Boy that was a long time ago now.
I was watching the LED on A8 while you were going up and down RAM/ROM. It seemed to be on (dim) whilst in ROM but randomly came on and off while you were in RAM. I was trying to think of a scenario that might lead to this observation but I could not. I would be fascinated to find out what was causing it.
Yes, a bit baffling. Almost certainly a wiring issue somewhere, but it doesn't seem to affect the functionality. It would not be the first time that I thought things were working ok, but actually, there was a fairly fundamental issue hiding in there.
I think all is OK. I believe it is the stack pointer. I single-stepped through it and it seems to be memory read and memory writes to addresses FEFF and FEFE. I initialise the SP to FF00. So it's one and two bytes below that address. It's really easy to notice A8, but by single stepping I could see it's also with and without A0.
There are a few mistakes on my schematic. R6 should say 2.2K not 220k, and it's also in the wrong position (see synthnerd4539's comment below). Also pin 12 master reset should be connected to ground, not to the +5v.
I agree the back side of your pcb is a bit messy and you decided to use the 4060 chip . Can you expand on way the system would probably not work well at high frequency . I am building a z80 system and dont understand why mine works fine at 1.2 mhz but wont run at 5mz.
Great content yet again! thank you. Give a 4Mhz crystal a go with something like a CD4049U(not a Fairchild or Onsemi). I'm pretty sure it will run, i have seen rats nest wire wrapping run a z80 that fast and your wiring looks more than fine for these speeds.
So the reason why count doesn't just run when you press up and down buttons is that in the code you look for changes in the button state and not the state of the button in that moment.
Loving the series so far. Ben Eater’s is awesome but quite slow paced (lower level, I guess, so more minute detail). So it’s nice to see the same kind of thing from a higher level and is much easier to follow! As an 80s guy who owned a Spectrum it’s extra special :) +1 sub
thank you, much appreciated
Crystal load issues is why I use TTL oscillators. They require 5V and put out a fairly nice square wave at the specified frequency.
Don't make the clock too fast! Time passes by in the wink of an eye, it is over before you notice it. I still remember when I was in school, hobbying with electronics. Then came computers with 600 kHz clock, later on with 900 kHz and even ONE MEGAHERTZ! Society should have stayed there, back then times were good, girls were girls and men were men, mister we could use a man like Herbert Hoover again.
great video !
one suggestion:
* id put output after input. so that you always output new values right away instead of looping before. same result, quicker.
* id do this:
loop:
call input
cp d
jr z, loop
call output
that way the inout loop is tighter (faster) and only bothers to update output if it has changed. maybe close to twice as fast to detect your inputs being optimistic.
also you might have made up and down as subs instead of labels and call them inside loop, though that will make them slower. but it might mke it easier to understand and modify.
i realized youd need to refactor the logix a bit.
loop:
call input
cp d
jz z, loop
call output
input:
previous code
jr forgot
call up
cp ...
jr skip next instruction
call down
ret
Thank you. I very much appreciate the feedback. It's nice that we are finally discussing coding rather than mainly looking at hardware. Feels like things are progressing. I will be doing a larger keyboard soon, so maybe I could introduce some of these ideas.
Another great video and something that addresses exactly what I've been thinking about. 🙂
Steve, I added a 'Like'' here - the last one I originally missed, sorry 🙂
Great video and great explanation, thanks, I was however wondering, is there a need for debounce on the switches, unsure at what frequency you may start to see it.
That's a very good point. I'm not sure. We do have the buffer in between the switch lines and the data bus, but whilst that will filter out a small amount of noise I don't think it will fully debounce the switches. I'm not seeing an issue right now, but I'm not sure if it might start showing up at higher frequencies. I'm leading up to a keyboard matrix. I've never seen any hardware debouncing on keyboard matrix circuits. It's possible people just deal with it in software. I'll try to do some experimenting.
@@SteveRaynerMakes Would be an interesting experiment to try and identify at what frequency you see this, if at all..
I'm watching these in order so don't know yet if you resolved this, but there's an error in your oscillator section, at least on the schematic - R5 should be across the crystal, and R6 should go from one end of the crystal to the 4060, as per the datasheet - your schematic has it with R5 and R6 in series across the crystal. Secondly I would just point out for reference if anyone needs the formula for capacitor selection based on the specs of the crystal, and I've seen a lot of demos/guides using arbitrary values for these, there's a useful application note number AN2867 by ST, see pp.11-13 for a good clear description.
It seems I made quite a few mistakes in this video. No, I had not realised that error. Thank you for pointing it out. Thinking about the resistances involved I imagine it doesn't make much difference. Which is probably why it still seems to work ok. But you are quite right and I will get it corrected. I'll give you a shout-out in a future video.
@@SteveRaynerMakes yeah there's probably a good margin... I'm enjoying the project, and look forward to seeing how the rest works out. Hoping to get stuck in to a z80 computer of my own before long. Thanks for posting!
It's "megohm" and not "meggerohm" although there actually is an instrument known as a "megger." It's short for "megohmmeter" and it's used to test insulation under a high voltage to ensure it won't break down and short out a circuit under high voltage.
I'm afraid I will always refer to it as Mega Ohm. Ohm is the base unit and Mega is the SI prefix for ten to the power of six. Do you refer to RAM size in terms of Meg bytes? And yes I'm fully aware of the company Megger. I used their equipment for portable appliance testing back in my electrical engineering and manufacturing days. Boy that was a long time ago now.
I was watching the LED on A8 while you were going up and down RAM/ROM. It seemed to be on (dim) whilst in ROM but randomly came on and off while you were in RAM. I was trying to think of a scenario that might lead to this observation but I could not. I would be fascinated to find out what was causing it.
Yes, a bit baffling. Almost certainly a wiring issue somewhere, but it doesn't seem to affect the functionality. It would not be the first time that I thought things were working ok, but actually, there was a fairly fundamental issue hiding in there.
Makes me wonder if that line is actually A15, not A8. But I don't think it totally explains it.
I think all is OK. I believe it is the stack pointer. I single-stepped through it and it seems to be memory read and memory writes to addresses FEFF and FEFE. I initialise the SP to FF00. So it's one and two bytes below that address. It's really easy to notice A8, but by single stepping I could see it's also with and without A0.
@@SteveRaynerMakes Ah, that makes sense! Thank you.
There are a few mistakes on my schematic. R6 should say 2.2K not 220k, and it's also in the wrong position (see synthnerd4539's comment below). Also pin 12 master reset should be connected to ground, not to the +5v.
I agree the back side of your pcb is a bit messy and you decided to use the 4060 chip . Can you expand on way the system would probably not work well at high frequency . I am building a z80 system and dont understand why mine works fine at 1.2 mhz but wont run at 5mz.
Great content yet again!
thank you.
Give a 4Mhz crystal a go with something like a CD4049U(not a Fairchild or Onsemi). I'm pretty sure it will run, i have seen rats nest wire wrapping run a z80 that fast and your wiring looks more than fine for these speeds.
So the reason why count doesn't just run when you press up and down buttons is that in the code you look for changes in the button state and not the state of the button in that moment.
By the way Steve, I subscribe at Episode 4 😉
This is very nice 👍 🎉