overflow by trying to store too many addresses on the
stack. You can’t read the stack pointer to tell how
many levels have been used, so you have to keep
track manually while coding. Reading the fine print of
the PIC’s datasheet may be overwhelming, but it will
help your coding and debugging!
Putting It All Together
While it is theoretically possible to breadboard this
circuit (Photo 3), you’ll really want a circuit board. I’ve
built some flexibility into the hardware — particularly
with respect to the memory. The pinouts of the 62256
SRAM and 27C256 EPROM are not identical, but only
the functions of pins 1 and 27 differ. I added two two-position jumpers on the back of the circuit board (not
shown on the schematic for clarity) to swap the
functions of these two pins (Write/Vpp and A14) and
allow Socket 0 to hold a SRAM or
an EPROM. If you have smaller
capacity memory chips such as a
6264 8K SRAM or a 27C128 16K
EPROM, these can also be used with
some caveats. You’d think that the
un-needed address pins for these
chips would simply be “no-connect,”
but sometimes they are used as
additional chip select inputs. Check
your datasheets carefully and either
modify your code to set these inputs
as necessary or break a trace or two on the circuit board
to set them in hardware.
The schematic and PCB layout support a few other
hardware options, including a general-purpose crystal
oscillator using a couple of leftover inverters; an external
crystal oscillator for the PIC for greater clock accuracy or
if you want to run faster than its 8 MHz internal clock
limit; access to the clock and interrupt outputs of the RTC
chip; and a three-terminal analog temperature sensor.
There is also an unused output on the 74HC138 decoder
that can be used to access other data bus devices or drive
a piezo speaker.
Note that there are no pads for R11 on the circuit
board as I just couldn’t find space for it, so you’ll have to
solder it across the pins of crystal X3 on the back of the
board; the same goes for R12, the pull-up resistor for the
open-collector CLKOUT pin of the RTC.
The circuit board holes for the case mounting tabs of
J7, the mini-DIN PS/2 keyboard jack are not full size as
they are too close to the edge of the board. Use a cutoff
wheel or hobby saw to cut notches in the edge of the
board to accommodate these tabs.
A potential application for this project is an EPROM
programmer or “burner.” One of the Socket 0 jumpers
isolates the programming voltage pin on the EPROM
The code I’ve written for this project uses a very
simple command-line structure to select subroutines that
demonstrate the hardware functions described above.
Among other things, it will check for the presence of
SRAM or EPROM in Socket 0 and adjust the SRAM start
address accordingly. I’ve also included a very bare-bones
file system to use the EEPROM as a tiny disk drive; its
structure is explained in a separate tab of the reference
spreadsheet available online.
A 9600 baud serial link with a laptop running a
terminal program displays the list of files on the “disk” and
supports data import to and export from the SBC. A
command reference that explains how each subroutine
works is also available online. There are plenty of
comments to explain the code and help you roll your own
PIC based operating system. So, dust off those vintage
chips, read their datasheets, and build a microcomputer to
call your own! NV
Vintage Computing
January 2017 31
FIGURE 3: Voltage selector circuit
for EPROM programming.
PHOTO 3:
Prototype SBC on
breadboards.