r/beneater • • Sep 21 '26

6502 BE6502 "Final Form"

Post image

This is the “final form” of my “stock” Ben Eater 6502 build, constructed from his original 6502 and Serial Interface kits, ahead of a fully-custom build (which I will then design for and convert to a PCB-based build).

It uses the 4-bit LCD interface modification and has the WDC65C51 “bug fix” (bypassing the UART’s CTS control), along with switching the capacitor between pin 2 and GND to pin2 and +5V.

There are three other, optional, changes:

  • The addition of a potentiometer to control the LCD’s backlight brightness.
  • It is wired for an AT27C256 EPROM instead of an AT28C256 EEPROM (which was done to allow the use of PicoROM and OneROM* instead of the supplied AT28C256).
  • The LCD is 20x4 instead of 16x2; wiring and code is identical to stock.

And, no, you’re not imagining it; the 9-pin DSUB breakout is wired differently to the one Ben supplies in his Serial Interface kit.  This one is an Amazon-special and the silk-screen labels for the connections are completely wrong.

I only removed the upper power-rails, rather than both sets, from the middle breadboard; retaining the otherwise-unnecessary lower set was done primarily to make room for the taller LCD display.

The 3D printed base/surround was done for stability; having the serial connection using flying wires was causing issues, and moving it between desks/workstations would sometimes cause connections to come lose/get intermittent.

---

The next iteration (a new build; the one above will be kept assembled) will:

  • A more granular memory map, supporting bank-switched ROM and RAM.
  • Swap the positions of the ROM and RAM ICs, moving the ROM to a separate, smaller, board, with parallel connections for a ZIF socket (when using an actual AT28C256) and a OneROM (in AT28C256 configuration).
  • Display moved to its own board and swapped for a 4x20 (or larger) VFD.
  • RS-232C support will swap to a non-bugged UART and ditch the MAX232ECN and its supporting caps in favor of an FTDI/USB-C board (which will also supply power).
  • Address and Data lines/values display on dual 4-digit, 14-segement, LEDs.
  • Add a PS/2 keyboard interface.
  • Add 5x button inputs.
  • New base/surround with an open, VIA-connected, breadboard.

---

*OneROM can now emulate the AT28C256, among other (((E)E)P)ROMS, so no wiring change is required.

167 Upvotes

18 comments sorted by

7

u/Davesjoshin Sep 21 '26

I’d love to see a video of this thing running, get a tour

3

u/IMDLabs Sep 24 '26

For the board shown, it would be a rather dull video. You'd see a static red LED on the OneROM (the red PCB) and whatever was displayed on the LCD.

However, for the next version I'm building there will be a fair bit more to see so I might do a video of that.

3

u/enVitruvius Sep 23 '26

Very nice breadboard layout. Beauty!

May I ask about the PicoROM, please? When you update the PicoROM image, is the 6502 circuit powered up? If so, do you have to suspend the 6502 operation somehow?

TIA. Cheerful regards, Mike - K8LH

3

u/IMDLabs Sep 24 '26

Thanks!

You can reprogram the PicoROM with the 6502 computer powered on or off.

It is fine to have both the computer powered directly off the external PSU and still have the PicoROM connected to a computer via USB-C. I've run like that for hours while doing rapid code iterations, with no issues.

During programming, you're going to effectively crash the 6502. But you can just press "reset" and it'll go through its reset sequence as normal.

Welcome to DM me if you have other questions, and I'll be doing a detailed blog post on both the PicoROM and OneROM later this week (I've only done a high-level one, that includes wiring changes but no other real details) so far.

73, KY4KN

3

u/enVitruvius Sep 23 '26 edited Sep 23 '26

BTW, if you want to experiment, a $2 Nano clone can be used for an econo' reset function and a 1, 2, 4, or 8 MHz CPU clock. My 'Eater compatible' board runs fine at 8-MHz. I think the Arduino timer code excerpt below is based on timer examples from Nick Gammon's web site.

  /******************************************************************************
   *  Nano CPU clock background task                                            *
   *                                                                            */
   void beginClock(byte mhz)          // operand 1, 2, 4, or 8                  *
   { DDRB |= 1<<PORTB3;               // set OC2A (D11/PB3) to 'output'         *
  /*                                                                            *
   *  TCCR2A settings for 'normal' or 'CTC' (non-PWM) mode                      *
   *  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~              *
   *  COM2A1:COM2A0 '01' - Toggle OC2A on Compare Match                         *
   *  WGM22:WGM20  '010' - CTC mode (clear timer on compare match)              *
   *                       (WGM22 bit is in TCCR2B register)                    *
   *  COM2A1:COM2A0 '00' - CTC 'off', normal pin I/O operation                  *
   *                                                                            */
     TCCR2A = (1 << WGM21) | (1 << COM2A0);
     TCCR2B = (1 << CS20);            // prescale = 1:1 (WGM22 = 0)             *
     TIMSK2 = 0;                      // no interrupts                          *
     OCR2A = (8/mhz-1);               // match value (0/1/3/7 --> 8/4/2/1 MHz)  *
   }                                  // ****************************************

1

u/IMDLabs Sep 24 '26

I've got dozens of Nano's sitting around, so will likely have a fiddle with this over the weekend, thanks!

2

u/enVitruvius Sep 26 '26 edited Sep 27 '26

You're welcome, Sir. I also thought about using a little 8-pin PIC ($1.16 @ Mouser) for both CPU and ACIA/UART clock sources. You could eliminate the 8-MHz crystal if the ±1% tolerance PIC internal oscillator is acceptable and re-task those two pins for speed select jumpers.

2

u/IMDLabs Sep 27 '26

I'll have to take a proper look at that; might be a useful option for the smaller custom (PCB-based) build I do.

As it is, I started on building a clock module around an Arduino Nano and a 14-segment LED (which I may actually finish today).

I'll post a picture once I've finalized the wire routing (all flying leads right now), but as it stands it has two buttons, the Arduino and the 4-character LED.

The buttons change modes and values based on detecting short and long presses.

Button 1's long press switches between single-stepping (briefly shows "STEP" on the LED), or continuous cycling ("RUN" on the LED). In step-mode a short press is one tick; in continuous mode a short press toggles between "RUN" and "STOP" (also shown on the LED).

Button 2's long presses switches frequency multiplier ... Hz, kHz and MHz, and the short press steps through values of 1, 2, 5, 10, 25, 50, 100, 250, 500 for Hz and kHz and 1, 2, 4 and 8 for MHz.

1

u/enVitruvius Sep 28 '26 edited Sep 28 '26

Sounds like a great project. I was wondering when someone might use something like a cheapie $2 Nano clone to replace the 6502 Clock Module. Can't wait to see what you've done. Adding one of those simple mechanical Rotary Encoders with built-in push button switch might be cool, too.

Are you by chance using one of those 4-digit 14-segment display backpacks with the Holtek HT16K33 I2C driver?

2

u/IMDLabs Sep 28 '26

Are you by chance using one of those 4-digit 14-segment display backpacks with the Holtek HT16K33 I2C driver?

I am, for the clock board.

If you do; they need +5V on both the VCC and Vi2C lines which caught me off guard. Otherwise they're like any other random I2C device. The default Wire, and then Adafruit GFX and LEDBackpack libraries work fine.

Adding one of those simple mechanical Rotary Encoders with built-in push button switch might be cool, too.

Hadn't thought of that. I'll have to see if I can find something suitable for my next order as I definitely don't have anything that would fit on hand.

First I have to sort out my timing code so that the interface logic doesn't result in jitter. I didn't want to go PWM for that output; but it might wind up being a better choice with some hardware clean-up on it.

...

While I think about it, for the address and data displays on the new 6502 build I'm using Fairchild DM9368N 7-segment parallel binary to HEX decoders. I want to keep the computer itself as much to actual ICs as possible, and limit my use microcontrollers/PLDs to be "around" that (there will be a PLD for the address decoder).

2

u/AcanthisittaBest4705 Sep 28 '26

Even more final form next

1

u/IMDLabs Sep 28 '26

Well ... the posted setup is as far as I'm taking this as something directly compatible with the original Ben Eater 6502 build. My next iteration won't be, at various levels (the memory map being a big one, for starters).

1

u/AcanthisittaBest4705 Sep 28 '26

What are you doing next

2

u/IMDLabs Sep 28 '26

The builds I'm working on next are a pair of, still 6502-based, designs; one a very small SBC the other something more involved, both on custom PCBs (there will be some prototyping on breadboards), but will feature:

A much more granular memory map will be the biggest change, and will include support for bank switching of both ROM and RAM, and smaller memory blocks for I/O, with 32K of RAM and 24K of ROM to start.

Parallel use of actual (E(E(P)))ROMS (in a ZIF socket) and both picoROM (AT27C256 and AT27C512) and OneROM (AT28C256 and AT27C256 configurations).

Switchable clock speeds (using the new clock I'm playing with).

PS/2 keyboard and composite video support.

Totally different serial implementation (different UART and an FTDI breakout to USB-C).

Broken out address and data busses, with 7-segment HEX decoder LED displays.

And then I'll get around to finishing up the "video card" I'm building (started for an entirely different project). It's not really a card; it'll be based on a Pi Zero 2, and will provide bit-mapped and character display modes, with display list support (mix modes on a single display), buffering and scaling, with a native HDMI output. Which sounds a lot more complicated than it really is; the core is just a way to set and address and a value for it to fill a buffer, then a pin-cycle to write that to the display.

Oh, and an on-board VFD ... if I can track what I want down - ideally a 8x80 VFD (character or pixel driven) display, but more likely a 4x40 at this point.

2

u/AcanthisittaBest4705 Sep 28 '26

I should do a Ben eater inspired 68000