Showing posts with label EEPROM. Show all posts
Showing posts with label EEPROM. Show all posts

Wednesday, December 7, 2016

Building a 68000 Single Board Computer - Programming the ROMs


The original TS2 computer design used 2764 8Kx8 EPROMs for read-only memory. There are four, providing a total of 32KB of ROM. The 2764 type were popular at the time the board was designed, providing a good tradeoff between cost and storage capacity.

These are EPROMs - Erasable Programmable Read Only Memory, programmed using a device programmer which provides the correct timing including a programming voltage (12.5V for these particular devices). They can be erased using an ultraviolet lamp. Erasing sets all bits to ones.

I'm also planning to support 28C64 EEPROMs which are electrically erasable. The device programmer can erase them electrically in a few seconds. You can also write to them in-circuit, but not typically at full speed (you need to wait a short time before subsequent writes).

Because the chips are 8 bits wide and the 68000 has a 16-bit address bus, pairs of ROMs are used -- one for even addresses (D0-D7) and one for odd addresses (D8-D15). There are four sockets on the board, but the TS2 monitor is less than 16KB in size and will fit in one pair of chips.

When you program them you need to split the data into even and odd data. You can either do that when creating the download files, or many ROM programmers can do it directly as an option when loading the files.

My monitor source code when assembled generates Motorola S record files. I added rules to the make file to generate odd and even download files.


My programmer is a low-cost Willem GQ-4X which can program various types of devices,including 2764 EPROMs and 28C64 EEPROMs. The software can perform splitting into even or odd data if desired.


I programmed a pair of 2764 EPROMs and also a pair of 28C64 EEPROMs in preparation for testing the board once it gets assembled.


To erase EPROMs, I have a low cost UV eraser which I bought on eBay. It will erase the devices in about 20 minutes.

Incidentally, the RAM on the system uses 6264 8x8K static RAM chips which have almost the same pinout as the EEPROMs. Four sockets are provided, supporting a total of 32KB of RAM.

Tuesday, May 8, 2012

JMON Enhanced for EEPROM

To accomodate the 16K memory card when using EEPROM, I added a write delay ("W") command to my JMON monitor program so that you can specify a delay after writes, which is needed when writing to EEPROM. It is used for the COPY, FILL, and TEST commands. Typically 28C64 EEPROM chips needs anywhere from 0.5 ms to 10 ms for a write to complete, depending on the chip manufacturer.

I used the delay routine from the Apple II ROM monitor, which is well documented in the book "Assembly Cookbook for the Apple II/IIe" by Don Lancaster.

With that change, I can copy data from RAM to the EEPROM or run the memory test on EEPROM from JMON.

JMON with New Write Delay Command

Below is a screen shot running my Replica 1 port of OSI BASIC. It is running out of an 8K EEPROM with a 8K RAM chip installed so the system has 40K of contiguous RAM.


OSI BASIC with 40K of Available Memory




Monday, May 7, 2012

16K Memory Board is Complete

The 16K memory board is assembled and works fine.  It has two sockets for 8K RAM, EPROM, or EEPROM chips, so you can add any combination of 16K RAM, 16K EPROM/EEPROM, or 8K RAM and 8K EPROM/EEPROM. The EEPROM is writeable but needs to be written with a delay after each write (approximately 1ms depending on the brand of chip used). There are jumpers for each chip to enable writing, so that the EEPROMs can be made read-only, if desired.

Memory Board Installed in Replica 1
I ran the memory test in my JMON monitor on the board stuffed with RAM to verify it.

Running Memory Test on 16K RAM 
So, for example, I could put Applesoft Lite or Enhanced BASIC in ROM (these are too big for the one 8K EEPROM on the Replica 1), or I could use RAM and bring the Replica 1 up to 48KB of contiguous RAM, twelve times what the original Apple 1 had (and then run really big programs).

I only used about half the protoboard, so I could add more circuitry to it later.

Wiring Side of Memory Board
I've put the design files here in case anyone wants to build their own or adapt the design for their own projects.

16K Memory Card Progress


I've now wired up most of the memory board for the Replica 1. I started with the address decoding and control lines and confirmed that it worked (e.g reading addresses in the correct range generated appropriate chip select signals as observed on an oscilloscope).

Testing Address Decoding
I then wired up the first of the two EEPROM/RAM sockets and confirmed that it is working, both with EEPROM and RAM chips. I now need to wire up the second memory chip socket.

Component Side

The wiring is rather tedious and time consuming. I might consider wirewrap for future projects, although the end result doesn't look as attractive with the big wirewrap pins sticking out of the back of the board.

Wiring Side





I'm also continuing to tweak the Apple 1 BASIC source, adding comments.

Thursday, April 19, 2012

16K Memory Card Update


The protoboard arrived today. It is the Vector Plugbord model 4112-4. It fits the Replica 1 slot nicely. It is quite large and could be cut in size for this project but I may use the space for additional circuitry later.




I'm still waiting on some of the other parts.

I did some investgation into the EEPROM write timing. It takes worst case 1 msec to write (at least for the datasheet for the chip vendor I looked at). So for example, my JMON monitor program's fill and copy commands will write data too fast to EEPROM. Uploading a file to the Woz monitor over the serial port is fine. I'll investigate a way to put optional delays into JMON's commands for the slower EEPROM in case I need to move data around.

I don't yet have a RAM chip to confirm if the design works with RAM as well as EEPROM.



I had a request to create binaries (Woz monitor files) for some of my code, specifically the adventure game and and OSI BASIC. These are now on github for anyone who wants them and doesn't have the development tools to build them from source.

Wednesday, April 18, 2012

Replica 1 16K Memory Card


I've started a little hardware project to build an expansion board for the Replica 1. It's a simple memory expansion card that can hold one or two 8K RAM, EEPROM, or EPROM chips. The two chips are addressed at $8000-$9FFF and $A000-$BFFF. This can conflict with devices on some other cards like the EEPROM on the Multi I/O board if you have it installed at the same time (You would need a slot expander to do that). This is about all the space there is available for addressing beyond what is on the Replica 1 board. There will be a write enable jumper for each chip so you can disable writing (which only really makes sense for EEPROMs). Basically, it uses Vince Briel's one-chip EEPROM circuit documented here and used on the Multi I/O board, with suitable address decoding (my implementation takes 2 chips).

It's a simple board but it will allow me, for example, to put programs larger than 8K (like Microsoft BASIC or my adventure game) in EEPROM or to have up to a total of 48K of contiguous RAM available. There will be room on the board for more circuitry later, if needed.

Prototype on Breadboard

So far I have prototyped the circuit on a breadboard. I didn't hook up all the data and address lines and only used one EEPROM. I've confirmed that it can read and write. I used the gschem schematic capture software, more just to make a nice printed schematic than for any other reason. I did several rough designs earlier on paper.

I ordered the remaining parts I needed, most notably a Vectorbord proto board. I got most parts from Unicorn Electronics. I bought the protoboard from Digikey as shipping was the most reasonable of several vendors.

There are several Vectorbords from Vector Electronics that fit the Replica 1 slot. Note that the protoboard sold by Achatz Electronics will not work on the Replica 1 as it uses a different connector.

I will post another installment reporting on my progress when I start assembling the real board. I'll also include the schematic.

If I get really ambitious I might lay out a circuit board. This would probably only be feasible if I made a few boards. Anyone interested in a board like this either as a bare board, kit of parts, or assembled? If so, drop me a line.

Monday, March 12, 2012

Applesoft Lite in EEPROM


Recently I've been playing with the EEPROM on the Replica 1 Multi I/O board. The other day I built my JMON monitor program to run out of it. It just needed to have the link address changed to $A000. It was nice to see that it worked out of ROM without any code changes.

Today I rebuilt the Applesoft Lite BASIC interpreter to run out of the Multi I/O EEPROM socket. I downloaded the source code and just made some changes to a couple of files.

By default it builds at address $E000 so it can replace the the on-board EPROM and includes the Woz monitor at $FE00. I didn't need to include the Woz monitor so I removed it from the list of objects to link. Here is the diff to the Makefile:

% diff Makefile.orig Makefile
4c4
< OBJS    = applesoft-lite.o io.o cffa1.o wozmon.o
---
> OBJS    = applesoft-lite.o io.o cffa1.o

It needs to be linked starting at address $A000 rather than $E000, so I made these changes to
the file replica1.cfg, as well as removing the Woz monitor code:

% diff replica1.cfg.orig replica1.cfg
2,3c2,3
<       BASROM:         start = $E000, size = $1F00, fill = yes, file = %O;
<       MONROM:         start = $FF00, size = $100, fill = yes, file = %O;
---
>       BASROM:         start = $A000, size = $1FFF, fill = yes, file = %O;
> #     MONROM:         start = $FF00, size = $100, fill = yes, file = %O;
8c8
<       MONITOR:        load = MONROM,  type = ro;
---
> #     MONITOR:        load = MONROM,  type = ro;

With that it built and worked like a charm. I can now load Applesoft Lite at any time with an "A000R" command from the Woz monitor.
Applesoft Lite running from EEPROM
The code builds with the CC65 assembler, which I had installed. There is a handy utility in the version of CC65 which has been patched to support the Replica 1. The bintomon program converts a binary file from the CA65 tools to the format that can be loaded by the Woz monitor over a serial port.

I made an enhanced version of this program that adds a few features. Specifically:

  1. You can optionally get the start address from the binary file (which seems to be the case when building a C program but not when building an assembler program).
  2. You can specify the load address on the command line.
  3. You can optionally specify the run address on the command line (when it differs from the load address)
  4. Support for  standard command line option parsing.
  5. A verbose option that displays information about the file.

The command usage is:

bintomon [-v] [-f] [-l LoadAddress] [-r RunAddress] filename

To generate the download file for Applesoft Lite I used:

bintomon -l 0xa000 applesoft-lite.bin >applesoft-lite.txt

In a future blog posting I will talk more about the CC65 assembler package and how to use the accompanying C compiler with the Replica 1.