However, all the ones I've seen so far have had the whole address and data bus wired up to the microcontroller. To save microcontroller pins, I came up with a much simpler design, that also works for CPUs without a BE input. It's so simple, it doesn't even need a circuit diagram.
The data bus is wired to the microcontroller, CPU and RAM, while the address bus is only wired between the CPU and RAM. The microcontroller also provides the clock and reset signals.
At startup, the microcontroller can put instructions directly onto the data bus. To load up the memory, it would use LDA, STA repeatedly to write to memory, without needing direct control of the address bus.
I haven't got the RAM wired up yet, but I have the CPU executing instructions straight from the microcontroller (Arduino nano) as a proof-of-concept. The code tells it to jump between 0x5555 and 0xAAAA repeatedly, which means I can put some LEDs on the address lines to verify that it works. I have attached some images of the system in action.
This is the Arduino code I used:
Code: Select all
#define RST A0
#define CLK A1
#define d27 B11111100
#define d01 B00000011
void setup() {
pinMode(RST, OUTPUT);
pinMode(CLK, OUTPUT);
DDRD |= d27;
DDRB |= d01;
digitalWrite(RST, LOW);
nClocks(7);
digitalWrite(RST, HIGH);
portWrite(0xEA);
nClocks(6);
portWrite(0x55);
nClocks(2);
}
void nClocks(int count) {
while(count--) {
digitalWrite(CLK, HIGH);
digitalWrite(CLK, LOW);
}
}
void portWrite(byte data) {
PORTD = data & d27;
PORTB = data & d01;
}
void loop() {
portWrite(0x4C);
nClocks(1);
portWrite(0xAA);
nClocks(2);
delay(500);
portWrite(0x4C);
nClocks(1);
portWrite(0x55);
nClocks(2);
delay(500);
}