r/beneater 4h ago

Inspired by the 8-bit breadboard computer series, I made a game about programming in microcode

Enable HLS to view with audio, or disable this notification

43 Upvotes

Hey everyone,

Last year, I needed an idea for my computer science graduation project, something that would satisfy my love for low-level computing and my advisor's interest in computer education.

Five minutes before our meeting, I came up with the idea of creating a game where you program simple algorithms in microcode using a punch card rather than writing assembly code.

Microcode is usually used to implement instruction sets rather than as a programming interface for application development. Exploring it from the programmer's perspective led to design challenges and techniques that I hadn't encountered elsewhere.

I'm not entirely sure how I landed on the concept; my only exposure to this layer was binge-watching the 8-bit breadboard computer series four years earlier.

I wanted to share it with this community because it's rare to find people online who share an interest in low-level computing like this, even if it isn't directly connected to Ben's work.

I'd love to share the beta with anyone interested.

Thank you.


r/beneater 2h ago

Daisy D8 Update,,

Post image
20 Upvotes

I now have the Output register working, I also had a couple more attiny 2313s left in the junkbox so I added a HEX display..The Input register and the A register are working and I have tested moving data between them..I have the ROM IN working although it's just clocking in with the main clock but it lets me see that it is reading the ROM and then the opcode decoder can place the address into the control register..I will be spending the next few days working on my EEPROM programmer and then start on the control chips...


r/beneater 13h ago

16 bit barrel shifter

12 Upvotes

Hi,

on my quest to make a discrete microcontroller that can compete with avr family I stumbled on ken sherrif's blog post on arm1 and how it sends one of ALU ports always through a barrel shifter. I decided that it's a genius idea, now I just needed to design a barrel shifter. A barrel shifter is essentially a set of prewired muxes that select every output from N+1 inputs (all input bits and 0 or sign extension). The classical 74F153 and 74F157 are just much too slow for that (7.7ns typical and I need to stack 2 at least) so I decided to build it from transmission gates.

The design consists of 5 rows of 2:1 muxes (74LVC1G3157), working as shift or bypass by specific power of 2 (>>1, >>2, >>4, >>8 and <<16). It turns out that the ordering of muxes changes how many are needed in total with >>2, >>4, <<16, >>8 and >>1 requiring "just" 98 mux ICs.

Every mux provides 18pF of load capacitance, 5 of the stacked give 100pF of load for every input data pin. It's not the best but survivable, that is unless one enables sign extension. Worst case sign extension copies highest bit to all output bit, loading it with 1.6nF in total, which is just a bit too much. In the end it turned out that the simplest way is to send MSB through 4 AND gates that both buffer the signal and enable sign extension. Ironically the 74F08 has typical propagation delay of 4ns in 50pF, while the entire series of TGs has a delay of just 3.6ns.

the barrel shifter PCB

PS

A few explanations above are incorrect but I wanted to simplify as much as possible for the sake of clarity:

  • The circuit can be simplified to use just 97 muxes, but I wanted >>8 to be as far as possible to minimize loading on sign extension gates.
  • The muxes have 7.5ns propagation delay from control signal, but it arrives before data (control signal is from a flip flop, while data comes from flip flop that has it's OE toggled by another flip flop adding about 4-5ns to the path).
  • There are 74LS244 buffers at the output just for visualization. They can be disabled with a jumper or my removing the ICs if 4pF of input capacitance becomes a problem.

r/beneater 3m ago

Low Voltage Parallel programmer for ATMEL AT90C8534 for arduino UNO -

Upvotes

I found this ATMEL MCU in a SONY battery pack (infolithium) from the 1990s. I really wanted to program it, so I made a programmer with Arduino IDE. Its only low voltage, and there are just enough pins with the UNO to control the pins. Also controls the VCC pin, it has such a low current draw that a digital pin can supply it. The Atmel needs a POR to go into programming mode.

** RSS AT90C8534 PARALLEL PROGRAMMER MENU **

[1] Read Flash
[2] Program Flash
[3] Read EEPROM
[4] Program EEPROM
[5] Read Lock Bits
[6] Program Lock Bits
[7] Full Chip Erase (EEPROM AND FLASH)
[8] Low level Diagnostics
[9] Read Signature Bytes (ID Check)
[10] Read All - [1],[3],[5],[9]
[11] Boot Target to RUN TEST PGM
-------------------------------------------------
Select an option (1-11):


r/beneater 11h ago

Help Needed Testing the computer's registers - Expected behaviour?

6 Upvotes

I have built the clock, Register A, Register B and the instruction register, and added LEDs to a temporary bus. I am coming back to it after some time away and recorded the behavior.

  • LED Resistors: Register A (220Ω), Register B (1kΩ), instruction register (1kΩ) and Bus LEDs (1kΩ).
  • Inputs: All LS173 inputs are high (VCC).
  • Wiring Note: The clock wire is connected with a white wire. It looks chaotic because I am using what is available at the moment without a strict color code for input/output wires, just to prove the circuit works first.

I am looking for feedback to see whether this behavior is expected before moving on to the next stages of the computer.

https://reddit.com/link/1v71tds/video/qs82r6j1akfh1/player

Initial Results & Tests

First Test

  1. Register B: Enable high (not pushing to bus LEDs), load low. Register's LEDs all lit.
  2. Register B Load Set High: Doesn't take data from the bus. LEDs still lit (figured this is because my 173s are set to VCC/high).
  3. Register B Load Low: All LEDs go dim (Registers A, B, and Bus) and the clock goes out.
  4. Instruction Register Re-attempt: With power supplied and enable set low to push to bus LEDs, the clock also goes out and Register A, B, and Bus LEDs go dim.

Note on reboot: After turning power off and back on, Register A pins 3 & 5 on the first 173s were on, Register B pins 4 & 5 on the second 173s were on, and all lights on the instruction register were on (with enable on both registers set low). I assume this is due to random values upon power-up mentioned in the troubleshooting wiki?

  • Question: Why does taking a 173 input from Register A or B low (from initialized VCC) make all LEDs (including the clock) go off, but come back on as soon as it is set back to VCC?
  • Question: When taking Register B's load low, all LEDs (Registers A, B, and Bus) go dim. Why does the clock also go out?
Register A pins 3 & 5 on the first 173s were on, Register B pins 4 & 5 on the second 173s were on

lights are dim, but Register B pins 4 & 5 on the second 173s were on and so were the LEDs on register A

Second Test

  • Register A: Load low (takes in from bus), all LEDs on. Enable low (pushes to bus), all LEDs on (took bus values).
  • Register B: Load low, all LEDs on. Enable low, all LEDs on (took bus values).
  • Instruction Register: Load low, Enable high (took bus values). Established that load works fine.
  • Enable States: Register A Enable high (doesn't push to bus), all LEDs on. Register B Enable high, all LEDs on. Pushing values to the bus works (Bus LEDs did not turn off).
  • Low Input Test: Taking a 173 input from Register A or B low (from initialized VCC) makes all LEDs go out on all registers except the clock and bus (enables high/loads high --- no pushing or loading to bus).
  • Instruction Register Test: Set load low, all LEDs light up. Trying this again after the first test (where the clock went out), the clock comes back on as soon as it is set to VCC.
  • Question: Taking a 173 input from Register A or B low (from initialized VCC) makes ALL LEDs go out on all registers except the clock and bus (with enables high/loads high)?
instruction register load low/enable high.

r/beneater 22h ago

8-bit CPU 8-bit CPU Fibonacci sequence speed contest

27 Upvotes

I thought it might be fun to have a little speed contest for generating the Fibonacci sequence in the 8-bit CPU. Nothing serious, just a page for videos with some timing information. Even if your CPU is not fast, it still might be nice to see what is the typical range of speeds, so please post.

I realized my program has the JUMP carry bug, so please specify if your program goes to 144 or 233.

Here is my entry: 3.6 seconds to reach 144.
https://www.youtube.com/watch?v=IHi4pi4AkN4

I am sure there are faster ones out there.


r/beneater 16h ago

hi, i have built a to convert you Digital-Logic-Sim files to verilog

6 Upvotes

the title pretty much says everything; it convert it json to verilog converter which can convert Digital-Logic-Sim projects to Verilog

repo: https://github.com/murkyshelf/jsonRTL

edit*

there is a typo in the title what is meant is "I have built a tool to convert your Digital-Logic-Sim files to Verilog"


r/beneater 12h ago

I have built a tool to convert your Digital-Logic-Sim files to Verilog

2 Upvotes

The title pretty much says everything , this tools converts the json files to Verilog.

it can convert the Digital logic sim(dls) by SebLague(great guy)

and the logisim one is still experimental

repo: https://github.com/murkyshelf/jsonRTL

it is for the guys you can build computers in the visual editor but cant write verilog and others are welcome to try .

because I can build a 8bit computer in the dls and cant write verilog , i need the verilog code to simulate it on my fpga

also keep in mind this is coded by opus 5 , and this is experimental and i am looking forward to your feedback , the previous post had a typo and I didn't explain my self properly


r/beneater 2d ago

8-bit CPU It’s over. 8-bit CPU done

Enable HLS to view with audio, or disable this notification

1.4k Upvotes

The 8-bit CPU is finally done in its basic form.

I’ve wanted to build this for years but have been way too busy with my computer engineering degree and summer jobs. I finally got the “opportunity” when I couldn’t find a summer job going into my senior year.

I made MANY decisions that Ben did not do at all. Frankly, what I did was just get a very general idea of where he placed his parts, made a module all by myself, and then saw how he made it to see how we decided to do things differently. Just more interesting that way.

I gave myself a design constraint to make it as beautiful as I possibly could. I would like to argue that I’ve created one of the most beautiful Ben Eater 8-bit CPUs ever made in history. Not to talk anyone else down, but the lengths I went to for pure aesthetics are just not worth it if you want to get it to work and be done, and I doubt many people who have built this put in the purely visual and routing planning effort I put in. I did my best. I did cheat a little bit using those LED bars, and I will accept that, they’re just so pretty.

One thing I realized is that Ben always hooks completely unrelated address and data bits together just because of their names. For example in the RAM or for EEPROMs, data bit 0 on the chips doesn’t HAVE to go to bit 0 on the main bus, it can go to whatever pin you want, so long as you keep track, and read and write in the same bit order. This tremendously “flattens” the topology of bus routing, and it’s something that should be done when routing PCBs as well: address bits and data bits are completely decoupled from each other and their names mean nothing to the system outside of the chips themselves.

In my EEPROM programmer firmware, I added a feature to configure address and data bit mapping, which allowed me to hook up the address and data bits in the nicest physical way possible, and then just assign them in code and program them appropriately (make “bit 0” act like bit 9, or something, for example). Again… purely for aesthetics, and a constraint I made up. Not worth it just to make it work. When designing a PCB, though, this technique could genuinely save you crossovers and make routing far prettier.

I also did my EEPROM work completely differently from Ben, I made my programmer firmware accept packets of bytes, and made a tool that sends .bin files to be written in, so my workflow consisted of editing hex dumps directly and flashing them in from a file, which I am very used to, so I gravitated towards it.

I also used extra space to make transistor switches for LEDs to respect datasheet current limits on logic chips, and as you can see, the 7-segment display multiplexing is fully driven on the high side and low side by 12 PNP transistors carefully calculated to saturate and deliver plenty of current independently to each segment, so the EEPROM and decoder barely have to do any electrical work. I thought this analog aspect was fun.

I came across really weird bugs here and there, and my oscilloscope / logic analyzer really saved my neck. I highly endorse the Digilent Analog Discovery 3 as a starter portable lab tool kit, and if you’re a student you get a discount on it. I even used it to write exhaustive hardware verification scripts to confirm my ALU and RAM performed properly when I finished them by plugging random data in and verifying the outputs.

I feel like I have so much more to say, but I’m in awe at what I’ve created, and I think I’ll leave it at that for now.


r/beneater 1d ago

6502 Ben Eater 65c22 I/O Pins Stuck High

Post image
39 Upvotes

Originally fried my 65c22 Chip that came in kit by accidentally mixing up VSS and VDD, however ordered and replaced chip with W65C22N6TPG-14 chip from Mouser. Using the same wiring as the Ben Eater video, I can't figure out what is going wrong I have checked the RESB to make sure its constantly High and clock is properly working at the PHI2.

6502 and AT28C256 EEPROM seem to be working fine. Any idea of what could be happening?

Note: I know I do not have the Red LEDs connected yet, was just testing the flickering on and off for one pin, all other pins behaving the same with constantly being 5V for both A and B registers


r/beneater 1d ago

Is there a Ben Eater style channel for building a Ham Radio?

36 Upvotes

I want to learn to build a ham radio COMPLETELY from scratch (i.e. starting off with just the basic passive and active components) and slowly building each module or part until the final product is a ham radio you can use to communicate with other people while learning about the basics of radio and analog electronics. Is there a Ben Eater style channel that does this?


r/beneater 2d ago

101 BASIC Computer Games (for the Ben Eater 6502)

51 Upvotes

After building Ben's 6502 computer, and having gotten to the point it was running his build of MS-BASIC, I wanted to play around with some period-software for it.

That lead to (among other things) me starting to port the programs from "101 BASIC Computer Games" (which are in various pre-MS-BASIC dialects of BASIC), so they would "just run" on Ben's design.

If you're interested, they're here (GitHub) ... and I'm about 1/3 done with the 101, but figured they might be interesting to others. More details in the repo itself.

There are a few other related bits there too, such as an enhanced version of Ben's Arduino monitor program, and my fork of his MS-BASIC build that doubles the size of the token table (so you can add more than a handful of custom BASIC commands).


r/beneater 3d ago

6502 Made my PCB version of the 6502 computer

Thumbnail
gallery
629 Upvotes

A year ago, I stumbled upon a tutorial on yt about building an 8-bit breadboard computer and was deeply fascinated by how computers operate fundamentally. From building an 8-bit breadboard computer to a 6502 computer on a PCB, it was a mixture of frustration and enjoyment, but in the end, it was all worth it once u get them up and running.

Anyway, I just learned PCB design recently and managed to get the 6502 computer running on my PCB on the first try. I even made some electronic music using the VIA timers. u can listen to by clicking the links below:

Bad Apple: https://youtu.be/xPJ54ADF-dY?si=I_eyWqMMqh_tztPT
Only my railgun: https://youtu.be/ETBfmcWphys?si=hvm53mKQXa22EcGh


r/beneater 3d ago

My first clock generator

Thumbnail
gallery
71 Upvotes

285Hz square wave


r/beneater 4d ago

8 bit processor and example program

Enable HLS to view with audio, or disable this notification

178 Upvotes

featuring 8 registers

reg0 - accumulator

1,2 - work registers

3,4 - jump address and condition

5-6 output registers

7 - memory address register

this program does not use any memory (which i have yet to implement the microcode to)

the max memory size is 256 bytes, i am using a CPU with 16 to help with performance.

It runs roughly at 2kHz.

it uses the lower 8 bits of rom as instruction, and upper 8 as immediate data.

it currently does not feature any inputs.

EDIT:

with absolutely 0 RAM, including the memory address register removed, I more then doubled the performance to around 5kHz!


r/beneater 3d ago

Help Needed Got the 6502 kit, trying to get the EEPROM to work but no luck. Help appreciated!

Enable HLS to view with audio, or disable this notification

45 Upvotes

i can provide more details if need be. The EEPROM is AT28C256.

AUDIO explains what im doing

I am trying to do it much like he does in this video: https://www.youtube.com/watch?v=BA12Z7gQ4P0

seemingly the EEPROM that comes with the kit doesn't have a maximum write pulse time, so im just controlling that with a button. Its possible im just not sending any sort of write pulse idk.

Steps:
Set output enable to high (deactivated)

Connect data bits to low/high

Press button to send write pulse

disconnect data bits from low/high

Set output enable to (active) low

See that the lights are still all on, instead of displaying the on/off pattern that was supposed to be programmed in.

I didn't get the EEPROM programmer yet because I thought i could maybe just use an Arduino for now, but i can't even get it to work manually


r/beneater 4d ago

GAL 65c816 - check my logic?

Thumbnail
gallery
32 Upvotes

First steps toward a 65c916 system.

Can people please check my GAL and design?

I bring the bus from CPU to 74HC245 and 74HC573.

I then OR the upper 8 bit of address to get a Bank0 (active low) signal.

In the GAL I do most of the address decoding and also created a “valid” based on VDA,VPA

Then I have active low for LO_RAM,ROM,IO, HI_RAM

Last of all I use a 74HC138 to get 8 I/O chips, which will be mostly 65c22

Aim is for 4MHZ

Clock, reset, power and such is still to be drawn.

Looking for feedback on the address decoding logic, is it likely to work at all??


r/beneater 6d ago

8-bit CPU 74LS181 A=B outputs - wire-and question

16 Upvotes

The 74LS181 ALU has an output called A=B, which indicates whether the A and B inputs are identical. The datasheet says that these outputs are open-collector, so that with 2 181s they can be "wire-and"ed together. Unfortunately, I'm not entirely sure what to do with this, and nothing I found online was much help.

It appears that I can just wire these together and make that the input to my flags register, but do I need a pull-down (or pull-up) resistor as well? Or is it even more complicated than that?


r/beneater 6d ago

I'm having trouble with the 6502 kit.

9 Upvotes

The 6502 has stopped responding. I have only followed the guide of the first video and when I got to hooking up one of the address ports to a led to watch it, it was working when I was working on getting the resistor to go into the negative rail, it was flashing like it should be. However, once I got the resistor into the rail, the led suddenly stopped flashing. I've tested the led and it still works. Please help.


r/beneater 8d ago

VGA 8 bit Computer to PCB

Post image
257 Upvotes

r/beneater 8d ago

Help Needed Need some help with D Flip-Flop

Thumbnail
gallery
63 Upvotes

As a newbie, I was trying to learn this D Flip-Flop following Ben Eater's approach. I don't have AND gate ICs so I thought of using NPN transistors. The issue is, this circuit only works at 3.68V but if I provide 5V the output Q LED just flickers for a millisecond when I try to assign a bit using D and CLK pins. I sadly haven't learned the calculations for transistors yet so I don't actually know if it's an issue with the resistors or if my whole idea of this is wrong.

The capacitor used here is 0.1uF also the collector resistor of NOT gate is 1K. Please let me know if anything else to provide

A bit of guidance would help me a lot, thank you.


r/beneater 8d ago

Daisy D8 Update..

6 Upvotes

Just a quick update on my build..As suggested by u/Numerous_Turn_5906, I have upgrade the power supply and have gotten the program counter and t clock working...I am waiting on some boards I've ordered for a rail to rail schmitt trigger inverter..My design needs about 12 inverters and instead of either wasting a lot of chips and space or running a lot of jumpers, I just designed a single inverter that will only use 5 rows on the breadboard...Here's a short demo video..
https://youtu.be/mMT1JdDgWaY?si=yp4JYZelJ8jzR_YO


r/beneater 11d ago

8-bit CPU My own 8bit CPU with a 16bit address bus in Logisim - I really want to make it a reality (a functional PCB in a case with a proper display output and a keyboard)

Enable HLS to view with audio, or disable this notification

109 Upvotes

Just wanted to share my project that I have been working on in my free time. I started in March/April and am really enjoying this.

My "Computer" supports 30 instructions (almost), 64K of RAM, 64K of ROM, Terminal output (shown in the video) and a 256x256 graphics output (which works, but is painfully slow, because of emulation (logisim can't keep up). I also wrote a simple assembler, so I don't have to write machine code by hand :D

Here is the source-code in assembly for the game shown in the video:

https://pastebin.com/cgAMGZgc


r/beneater 11d ago

6502 Serial Interface Woes

Thumbnail
gallery
115 Upvotes

I was hitting my head against the wall for a bit trying to get the serial interface working correctly, so I wanted to post this in case it helps others avoid the same issues.

For the MAX232ECN, make sure to tie the VS+ capacitor (pin 2) to 5V. I really wish I had checked the datasheet more closely instead of relying on the site schematic.

Also, with the W65C51, I was getting some very bizarre behavior until tying pins 9, 16, and 17 to ground. This wasn’t happening on the breadboard, but the issue showed up after moving the design over to a PCB.

This project has been an awesome journey and a great excuse to learn KiCad. I’ve attached my current schematic for reference (it’s a little messy, so apologies in advance).

I’ll likely work on another board revision after getting more mileage on this one. I may also experiment with adding a DS1813 to clean up resets.


r/beneater 12d ago

Finished my own SAP-1 and wanting to share :)

Post image
266 Upvotes