As part of the RetroChallenge 2023/10, I am building an extension for the VG-5000µ that behaves like a boot ROM, but can be stuffed with content from an third-party computer. It is called : the « hot ROM ».

Digging-up into the electronic parts drawer for the best component combo resulted in:

  • a CY7C199 : static 32K RAM (way too much for what I need, but a good start).
  • an old Arduino Nano : this could be the perfect communication bridge to a PC.

Looking closer at the number of digital pins required, it is quite obvious that the Arduino, with its 18 available GPIOs, is not able to handle the 27 necessary pins by itself (15 bits of address, 8 bits of data, plus control).

The address bus is output only, so a pair of cascaded 8-bits shift-registers would be enough, and they would require only a few GPIOs. Digging slightly more provided with some 74HC595. The dual layer structure is likely overkill, but they have a 3-state output, this will do the job !

Here is the resulting breadboard work:

  • the RAM chip is at the center and the right hand smaller ones are shift registers.
  • the long blue wires are the address bus, which is driven by the shift registers.
  • the orange wires control the shift registers from the Arduino.
  • the white wires are the data bus, which connects directly the RAM and the Arduino.

Wrote a bit of code to exercise the circuit:


void output_address(uint16_t addr) {
  uint8_t i = 16;

  while (i--) {
    digitalWrite(SHIFT_DATA, addr & 0x8000 ? HIGH : LOW);
    digitalWrite(SHIFT_CLK, HIGH);
    addr <<= 1;
    digitalWrite(SHIFT_CLK, LOW);
  }
  digitalWrite(SHIFT_CLK, HIGH);
  digitalWrite(SHIFT_CLK, LOW);

  digitalWrite(SHIFT_3ST_, LOW);
}

void output_data(uint8_t data) {
  uint8_t i = 8;
  while (i--) {
    digitalWrite(data_pin[i], data & 0x80 ? HIGH : LOW);
    data <<= 1;  
  }

  data_out_enable(true);  
}

uint8_t input_data() {
  uint8_t val = 0;
  uint8_t i = 8;
  while (i--) {
    val <<= 1;
    val |= (digitalRead(data_pin[i]) == HIGH) ? 1 : 0;
  }

  return val;
}

void write_RAM(uint16_t addr, uint8_t val) {
  digitalWrite(RAM_OE_, HIGH);
  output_address(addr);

  output_data(val);

  digitalWrite(RAM_WE_, LOW);
  delayMicroseconds(1);
  digitalWrite(RAM_WE_, HIGH);
}

uint8_t read_RAM(uint16_t addr) {
  uint8_t val;
  data_out_enable(false);

  output_address(addr);
  delayMicroseconds(1);
  digitalWrite(RAM_OE_, LOW);
  delayMicroseconds(1);
  val = input_data();

  return val;
}

A pair of commands are implemented over the serial port to write and read back bytes, and it works® ! Well, mostly, as sometimes, I get strange readings back… this is something to troubleshoot (maybe the power supply is not clean enough ?).

The next step will be to connect this circuit to an actual VG-5000µ, but is it going to work ?