The I/O board

A project log for MRC6502 - Modular Retro Computer

MRC6502 is a fantastic opportunity to learn more about digital electronics and 6502 assembly programming... step by step.

padnestpadnest 02/09/2022 at 08:140 Comments

A computer with no I/O capabilities doesn't do much... right?

So here we have the I/O board that will implement these interfaces:

The I/O board has:

Schematics: here

User port (1)

It is a GPIO port directly connected to the peripheral data ports of VIA#1.

This port also provides the system power supply (+5v).

PS/2 keyboard adapter (2)

Is the logic needed to adapt a standard PS/2 keyboard protocol to the VIA#2.

The PS/2 keyboard clock and data lines go into an external serial register (74LS164) that feeds VIA#2 with:

VIA#2 CA1 is configured as input to fire an CPU IRQ when keyboard data byte has been received and can be processed.

VIA#2 CA2 is configured  as output to clean the serial register in order to receive the next keyboard data event.

Perhaps it will also be necessary to add a protection between the logic and the VIA#2 port.

VIAs (3)

Two WDC Versatile Interface Adapters W65C22N (datasheet) are connected to the system bus in this way:

Each VIA has 15 internal registers that can be accessed by address llines A0-A3.

The base address is $DA00 for VIA#1 and $DB00 for VIA#2 and the memory mapping will be:

ACIA (4)

The WDC Asynchronous Communications Interface Adapter W65C51N (datasheet) is connected to the bus in the same way but it has only 4 internal registers so just two address lines, A0-A1, are used:

The ACIA base address is $DC00 and the memory mapping of internal registers will be:

SPI port and SD card module (5 & 8)

The SPI protocol is hardware implemented using the serial registers of the two VIAs: this allows us to have the maximum possible data transmission speed!

CB1 is configured as serial clock output on VIA#1 and as serial clock input on VIA#2.

CB2 is configured as serial data output (MOSI) on VIA#1 and as serial data input (MISO) on VIA#2.

Perhaps it will also be necessary to add a protection between VIA#1 CB1 and VIA#2 CB1.

SPI is shared between the SPI Port and the SD Card module; the SPI port has two dedicated CS lines connected to VIA#2 PB5 and PB6

Here the popular Arduino SD Card module that I have choosen:

Usb serial (6)

The usb serial interface is provided by a CP-2102 usb serial module and is connected to the ACIA:

Here the CP-2102 usb serial module I'm using:

Stay tuned for the next step!