Neo6502- Open Source Hardware Modern Retro Computer Project

I will admit, I have a sentiment for retro computers. This is probably because my career in IT started many years ago with the Bulgarian Apple ][ clone called IMKO2, later renamed to Pravetz 82.

This is also one of the reasons Olimex stepped into the AgonLight production.

AgonLight sparked a lot of enthusiasm and activity, not only here at Olimex. Bernardo Kastrup hit the sweet spot of the Retro Computer maniacs by offering them a small, fast, feature-packed real Z80 machine with plenty of memory. The Facebook group already has close to 1000 members!

There are a lot of posts about why not having a 6502-based machine, and Kyle (mos_8502), Rebecca (RenewedRebecca) and Bernardo (TheByteAttic) are already working on a W65C265 version using the same ESP32 FabGL-based video and audio system.

Two weeks ago, I started thinking, as an engineering challenge, is it possible to build a modern peripheral 6502 computer that is with the lowest possible cost.

Then I put the minimal requirements for my 6502 computer:

  • It must have a real 6502 processor.
  • It must have a minimum of 64KB of RAM.
  • This computer must run as fast as possible. People confirm that the W65C02 from WDC can be overclocked up to 16Mhz. On the other hand, a lot of software depends on instruction execution time for loops, so the possibility to run at a lower 1Mhz clock will ensure backward software compatibility. This can be achieved with a variable clock that can be set by 6502 software.
  • The computer must have a modern video interface like DVI/HDMI so that you can connect it to your home TV or modern monitor.
  • Support for a modern USB keyboard.
  • A sound synthesizer like the popular C64 SID.
  • The power supply should be via a USB-C connector so that you can use any phone charger with a USB-C cable.
  • A UEXT connector with modern interfaces like UART, I2C, SPI.
  • Disk storage for code.
  • The 6502 bus should be available on a slot/connector so that additional hardware can be easily added on.

The final requirement is to design such a system to be at the lowest possible price, making it an easy purchase decision, similar to what the Raspberry Pi did with a price of $25-30.

This is a good hardware engineering challenge!

After some research I have decided to use the Raspberry Pi’s new dual-core Cortex-M0 RP2040 as an emulator for everything except the 6502.

The RP2040 will emulate:

  • The RAM memory. The RP2040 has 264KB of RAM, which is plenty of RAM to hold the emulator code and at least 64KB for the 6502. As the RP2040 runs at 133 MHz, there will be no issue serving the slow 6502 with memory read/write operations. If there is more RAM left, we can implement some kind of bank switching, such as 56KB of continuous RAM from $2000-FFFF and switchable RAM banks for $0000-1FFFF. Alternatively, we can define a pointer and block size somewhere in the upper memory location, which can overlap different RAM segments at any address at any time. After all, what the RP2040 will serve at a given address depends only on the pointer, which will show where this data needs to be fetched from.
  • Initially, I thought of using the Si5153 programmable oscillator, which can clock from 250kHz up to 100MHz, but after checking the RP2040 PWM specs, I found that the RP2040 can also generate a programmable clock for the 6502 from 0 up to 100MHz. This saves us one more IC!
  • There is already a DVI generation project with RP2040 called picoDVI, which supports 640×480 pixel resolution with RGB565 16-bit color depth. This project loads about 60% of one of the cores in RP2040.
  • RP2040 has USB host capability, so there are no issues whatsoever in connecting a USB keyboard to it.
  • There are already RP2040 SID player projects that exist and can be reused for sound generation, such as picoSID.
  • Although the UART, I2C, and SPI are interfaces that the 6502 originally did not have, we can catch memory location read/write exceptions with RP2040 and emulate a classic PIA or ACIA. Alternatively, we can define some API in memory to access I2C and SPI buffers.
  • As for disk storage, RP2040 will have 2MB of external SPI flash to hold the firmware, but there will be a lot of free space. The Apple ][ 5″ floppy was holding the humble 114KB, so around 10 classic floppy discs could fit in a little more than 1MB.

One week ago, I posted my idea on the Homebrew 6502 Facebook group and received more than 100 replies with valuable comments and suggestions.

To summarize all the feedback and prevent redundant discussions, here are the FAQ:

Q: Why not emulate the 6502 with RP2040 as well?
A: Emulating memory or ACIA PIA is simple, but the 6502 is a complex state machine, and an emulator will never be 100% accurate. Even N6502 and W65C02 have differences, and we want to have a REAL processor.

Q: Have you checked the CommanderX16 project? You may get inspiration from it.
A: I have seen this project, but it is over-complicated, expensive, lacks modern peripherals, and is slower compared to what I want to achieve. This is going to be a MODERN 6502 computer. The CommanderX16 has no modern interfaces like USB keyboard, HDMI, SID Sound, or SPI/I2C. Additionally, the CommanderX16 costs $500, while we aim to target a $25-30 board.

Q: Why not make it with VGA? I have one in the basement.
A: We want Neo6502 to be a MODERN computer, and VGA is 40 years old technology.

Q: Why not use W65C265S or W65C816S, etc.?
A: These are not 8-bit and have more address lines to deal with, which will make the design more complex and far from the rock bottom price goal. For those who want a W65C625 computer, Kyle, Becky and Bernardo are already working on Agon X65.

Q: Why not Kickstart it?
A: Although Kickstarter is a great advertising platform, it has its cost. Kickstarter/PayPal combination takes 20-30% of the collected funds. We target rock bottom costs for our customers and count every cent, so we will not inflate the prices with 20-30% to use the platform.

Q: Do you have firmware developers for it?
A: Not yet, so any help and collaboration are welcome. I have already obtained all the parts together and will have a proof of concept on a breadboard this weekend. Then, we will design PCB and some prototypes in a few weeks. If you want to participate in software/firmware development for both RP2040 and 6502, you are welcome to join us! We will have some free early prototypes to send to developers. Send us email to info at olimex dot com.

Tsvetan