Main Page      

1. The cross assembler "myca"

Translates source code to MyNOR executable files

  1.1 Installation
  1.2 Usage

2. The swiss knife tool "mynor"

Simulator and file converter

  2.1 Installation
  2.2 Usage

3. The EPROM Emulator

A simple emulator for 27C256 EPROMs. This piece of hardware lets you
test your ROM files with real hardware without the need of "burning" EPROMs.

  3.1 Introduction
  3.2 Hardware
  3.3 Firmware
  3.4 Operation

1. myca

myca is an universal cross assembler for my selfmade computer systems. I developed myca for my first CPU project, MyCPU. It was very easy to add support for MyNOR as well.

1.1 Installation

You can get the program in the download section of this website.

1.1.1 Windows

Just start the setup.exe program after you have extracted the zip-file. The installation wizard will guide you through the installation process.

1.1.2 Linux

Extract the zip-file. Open a shell and navigate to the directory where you have extracted the file to. Extract the source code archive from there and compile the program:

# tar xf myca-1.09-sources.tar.gz
# cd myca-sources/
# make

No installation routine is provided. You must manually add the directory in which the myca executable is stored to your system search path.

1.2 Usage

1.2.1 Compile the MyNOR EPROM image

To compile a new or modified operating system image for MyNOR, download the software archive, open a shell and navigate to the source code directory and enter:

# myca mynor-rom.asm -o mynor-rom.bin -l

This will generate the new binary file mynor-rom.bin and the associated list file mynor-rom.lst. You can use the file mynor-rom.bin together with the mynor tool to either run a software simulation or to generate a new EPROM image file (see here).

1.2.2 Compile a MyNOR application program

To compile a MyNOR application program enter the following line:

# myca hello-world.asm -l

This command generates the text-file minesweeper.txt which can than be uploaded to MyNOR. The parameter -l is optional, if it is specified, also the associated list file (minesweeper.lst) is also generated. You can find many sample programs together with the source code files in the software section on this website.

2. mynor

mynor is mainly a hardware simulation tool. It simulates the mynor CPU board and parts of the LCD extension board. I am using it for hardware debugging and software development. Because this tool includes also the microcode compiler, it can be used to generate the combined micro code and program code image for the 32kB EPROM.

2.1 Installation

You can get the program in the download section of this website.

2.1.1 Windows

Extract the zip-file. No installation is required. You can directly use the executable mynor.exe, which is included in the zip-file. For simplification, you should add the directory where you saved mynor.exe to your system search path.

2.1.2 Linux

Extract the zip-file. Open a shell and navigate to the directory where you have extracted the file to. Compile the program by running the script

# ./

You can directly use the generated executable "mynor", no installation is required. For simplification, you should add the directory where you saved "mynor" to your system search path.

2.2 Usage

2.2.1 Use mynor as hardware simulator for software development

The mynor tool can simplify software development a lot. You can test new ROM code directly without the need of burning a new EPROM. Also application programs can be tested with the simulator. To start the simulation of a MyNOR system (only the base board without further extensions), enter:

# mynor -r mynor-rom.bin -t

This command loads the operating system image mynor-rom.bin and starts the simulation. You can communicate with the simulated MyNOR computer through an emulated RS232 terminal (option -t). Application programs (txt-files) can be loaded by copying the content of the txt-file to the clipboard and pasting it into the terminal window.

To simulate a MyNOR system with attached LCD extension board, enter:

# mynor -r mynor-rom.bin -t -l

Note 1: The simulation of the LCD extension board is still incomplete. Sound output is not simulated.
Note 2: I recommend Linux as host system for the simulation. The simulation may not work correctly on a Windows host.

2.2.2 Use mynor as hardware simulator for microcode development and debugging

The mynor tool can output a vcd-file that contains the waveforms of all internal signals. This file can be viewed with the open source tool GTKWave. With the schematics on hand you can try to figure out how MyNORs circuit works:

# mynor -r mynor-rom.bin --vcd mynor-sim.vcd -c 100000
# gtkwave mynor-sim.vcd

The command above runs the simulation for 100000 clock cycles. I strongly recommend limiting the runtime, otherwise the generated vcd-file will become too large. The tool can also perform an almost timing exact simulation of the system with this command:

# mynor -r mynor-rom.bin --vcd mynor-sim-rt.vcd --real-timing -c 100000
# gtkwave mynor-sim-rt.vcd

Although the generated vcd file is more difficult to read, it is very useful to understand the meaning of the setup and hold times of the internal signals at the inputs of the ICs.

2.2.2 Use mynor to generate a new EPROM image file for burning into a 27C256

If you want to make your own 27C256 EPROM image, you can use this tool to merge the MyNOR program code ("operating system") with the microcode into a single file. The command is as follows:

# mynor -r mynor-rom.bin -w 0x0000,0x7FFF,27C256.bin

This command reads the rom file mynor-rom.bin into memory (range 0x2400 - 0x7FFF) and writes the whole EPROM buffer (0x0000-0x7FFF, where 0x0000-0x23FF contains the microcode) to the EPROM image file 27C256.bin. You can use the file 27C256.bin to program (or "burn") a new EPROM.

3. EPROM Emulator for 27C256 EPROMs

3.1 Introduction

An EPROM emulator is a piece of hardware that allows you to test your ROM files with real hardware without having to "burn" many EPROMs. I built this tool to be able to try out different versions of the MyNOR ROM very quickly. It is really a very handy tool for software development and testing. The following picture shows the first version of the emulator together with the first version of the MyNOR computer board:

3.2 Hardware

The emulator consists of the following parts: A SRAM in which the EPROM image is stored, a microcontroller that is used to load the EPROM image into the SRAM, and some bus drivers. For the microcontroller I use an ATMEGA644-20PU. This controller has 64kB flash memory that is used not only for the firmware but also for storing a copy of the EPROM image. Therefore the EPROM image does not have to be loaded via RS232 every time the emulator is switched on.

Here you can download the KiCad design files and the firmware for the AVR. Please note that I publish all my work under a
Creative Commons Attribution-ShareAlike 4.0 International License

 Emulator schematics: schematics_eprom-emu_v1.1.pdf
 Emulator KiCad design files:
 Emulator Gerber data for PCB order:
 Emulator firmware for ATMEGA644:

To connect the emulator to the target system, you need to build an adapter cable that conducts pins 1 to 28 of the ribbon cable connector on the emulator board with the 28-pin DIP socket on the target system. I tried a special ribbon-cable-to-DIP-connector, but it turned out that the left and the right row of the connector are swapped. So I had to swap every two wires in the ribbon cable as you can see in the picture above. The better solution is to take a 28-pin DIP socket and solder the wires directly to the pins, as you can see in the pictures below:

This emulator can also be used to emulate smaller EPROMs like 27128, 2764, 2732 or 2716. To do this, you must connect the unused address lines from the emulator to GND. That are, for example, A13 and A14 for emulating a 2764 EPROM.

3.3 Firmware

The firmware was written with Atmel Studio 7 (7.0.1645). The zip-file contains the entire project including the generated binary files (elf and hex file). You need a JTAG programmer like the ATMEL-ICE to load the firmware file into the ATMEGA644 controller. Please make sure that the fuses in the AVR are set correctly. The firmware is stored in the bootloader area of the microcontroller. This is necessary because only code that is executed in the bootloader area can write to the on-chip flash memory.

3.4 Operation

The emulator can be powered from the target system or through the on-board micro-USB connector. When the power is applied, the firmware first looks if there is an EPROM image stored in the internal flash memory. If so, the image is copied into the external 32kB SRAM and the emulation is started (the green LED is on). Otherwise, the emulator waits for the user to upload a new EPROM image via RS232. Every terminal program that supports the X-Modem protocol can be used for file upload. The settings for the serial port are 38400 baud, 8 data bits, 1 stop bit, no parity bit and no handshaking. I strongly recommend using a physical RS232 port on your PC because I have had bad experiences with USB to RS232 converter cables. But note that the emulator board does not implement a standard conform V.24 interface with -12 to +12 Volt voltage swing, so it may not work with any RS232 host port. You have to try it out.

The firmware periodically sends the character 'C' to the terminal. This character is used to request the X-Modem sender to transmit the first data block. If you see this character in the terminal window everything is fine. Now simply use your terminal emulator to upload the binary file (max. 32768 bytes) via X-Modem. Suited terminal programs are for example HyperTerm, TeraTerm, ExtraPutty (Windows) and minicom (Linux). When the upload is complete the message "Upload succeeded. You may press [w],[Enter] to save file to flash memory." is displayed and the green LED lights up. When you now press the key "w" followed by the "ENTER" key, the image file you have just uploaded will be saved in the internal flash memory. From now on the emulator automatically loads this file into the SRAM after power-up. If you want to delete the file from flash memory again, you can press the key sequence "c" followed by the "ENTER" key and the emulator will reply with "Flash cleared".

Please note that the EPROM emulation does not start immediately after power up, as it takes a while to load the SRAM. This means the target system "crashes" and the system must be reset manually after the emulator is ready for operation. An improvement would be to add an additional reset line from the emulator to the target system, so that the target system is kept in reset state while the emulator is not yet ready for emulation. The source of this reset signal could be the cathode of the green LED that is pulled down when the emulator is ready. For an active low reset you need to add a BC547 transistor whose emitter is connected to ground and whose base is connected to the cathode of the green LED via a 10k resistor. The collector of the transistor is then connected to the (low-active) reset input of the target system (e.g. MyNOR J2 pin 2).

Also note that saving the EPROM image into the internal flash memory also interrupts the EPROM emulation since the microcontroller needs exclusive access to the external SRAM. This means that you have to reset the target system manually after the emulator has finished saving the image in the internal flash memory.