The EEPROM still hasn’t arrived. This piece is responsible for storing the BASIC programming language that makes using the computer easier.

Think of it as a layer between the hardware and the user that acts as an interface. BASIC is not only a programming language but helps with essential tasks such as managing files (loading, saving, moving, deleting) and other basic (pun not intended) tasks. The EEPROM is a type of memory that retains the data stored on it even after the computer is not powered. When powering the beast, it loads the program from the ROM (read-only memory) to the RAM that stores data and software temporarily when running a program. EEPROM can only be programmed with a ROM programmer. In other words, when it’s placed in the computer the data on it cannot be modified, only read. In the old days for instance arcade machines and game consoles stored games on ROM. Users of consoles could buy cartridges thats contained games.

So here’s the deal: I have BASIC as a so called ‘ROM image’. It’s a file that contains BASIC as a series of bytes (8 kilobyte to be precise). Each byte is either data or instructions. Imagine a piece of code that adds two numbers: that includes an instruction (add) and the two numbers as bytes. BASIC is constructed of a such instructions: load a byte from the memory, save a byte, increment or decrement a value, compare two bytes, send something to the output, jump to an other instruction, etc. The ROM image has to be copied to the EEPROM. The EEPROM (or simply ROM) can store around 64,000 bytes. Each byte is 8 bit long and has an address, a and and a half byte (12 bits) long number. When programming the ROM, I have to go through all the addresses and write a byte where necessary. BASIC will take up only 8 kilobyte from the 64 available.

Image

To make matters more complicated, the ROM is a parallel one. It means that there are 8 pins on the ROM to transfer each bit of the byte. Same with the addresses, only that they need 12 pins. And finally, there are the three control pins. Their state (LOW or HIGH) determines whether the memory can be read, erased or programmed. All in all, I need to control 8 data pins, 12 address pins and the 3 control pins. That’s 23 pins in total. Luckily I found a great blog post where it’s explained how to copy the ROM image to the EEPROM using an Arduino Mega (other Arduinos don’t have enough digital pins). The 23 pins of the EEPROM (plus the VCC and ground) are all connected to the Arduino. While Dave uses Unix commands to send the hex file (ROM image) over serial, I wrote a simple Max MSP patch that chops up the file to bytes and sends them over serial to the Arduino. The Arduino sketch then receives the bytes, splits them up to bits and sends them to the digital pins. What up!

Advertisements