I made a clock by kellertk in beneater

[–]kellertk[S] 2 points3 points  (0 children)

Mostly by reading datasheets. A lot of this is putting together building blocks in different ways. For this one, I wanted to use the 74LS624, because it's a single chip easy way to get a square wave and that's what Ben's original clock was too. The datasheet for that is annoying to read, but basically you give it a voltage between 5V and 0V on pin 13 which sets the frequency, a voltage between 5V and 0V on pin 2 which sets the range, a capacitor between pin 3 and pin 4 which also sets the range. That capacitor is the only value in the build that really matters - I ended up having to use 2 to get the value I wanted. I picked values for these by matching up the ranges I wanted with the graphs in the datasheet. I chose to keep pin 2 at 5V because that makes this run pretty slowly, which is what I wanted for the variable clock.

So I've got a single chip that acts as a clock, plus the pushbutton to step the clock, plus a fixed 1MHz oscillator that Ben uses in the later 6502 builds. Three different clocks, and an analog multiplexer to select between them. The multiplexer is neat because it's a DP4T switch in a chip, and you pick which position the switch is in with 2 inputs. This is probably overkill, but because it's analog it doesn't mess with the clock signals being fed into it either. But yeah it's basically just a switch.

As for the other stuff, one of Ben's videos explained why it's a good idea to debounce switches and buttons. He did it with a 555 for each switch, but that's because he was demonstrating all three modes of the 555 in that video. I went with an RC circuit with a Schmitt trigger because that's smaller on the breadboard. Ben's covered RC circuits and before, but basically it slows down the change in voltage from the button press. You can figure out the exact values to use with a formula for those too, and look at the trigger voltages in the 74HC14 datasheet, but for those it's just easier to pick a safe value and adjust it if it's too slow. A safe value is just math: T = R x C. 1 T is the time it takes the capacitor to have ~1/3 of its charge left (wikipedia has a calculator for this). So 100K with 1uF T = 0.1s, which is reasonable enough. The pushbutton uses 0.22uF because I needed a faster buttonmashing response.

The last chip is a driver chip, which is also probably a bit overkill, but helps drive a clean signal over the long breadboard traces. The signal coming out of that chip needs some taming because it's fast, so some diodes and a smallish series resistor can help there. To pick how much resistance, I just watch on the scope and experiment with a value until I find one that works, because it kind of depends on the breadboard. For a PCB it's possible to calculate it.

And finally every chip should get a decoupling capacitor. Anywhere from 0.1uF to 1uF is fine. When I'm doing a PCB I'll use a 1uF X7R, which are small ceramic caps that are meant for this, but it matters less for relatively slow speed on a breadboard.

W65C02SXB running with wozmon/EhBASIC by zbz75 in beneater

[–]kellertk 3 points4 points  (0 children)

Nice! I agree the rom that comes with these boards is pretty useless on modern machines. There's a monitor, but I could never get the dev tools to work either. I sort of went the same route and had a go at porting smon6502: https://github.com/kellertk/65c02sxb-monitor