Wednesday, February 29, 2012

Replica 1 ROM and Hardware Ramblings

I should mention the software (technically firmware) that comes in the EEPROM of the Replica 1.

The Replica 1 has 8 kilobytes of ROM. ROM, of course, is Read Only Memory, memory which is persistent and remains when the system is powered off.

My system came with a 28HC64 EEPROM chip which is an Electrically Erasable Programmable Read Only Memory chip, one which can be reprogrammed (more about this in a later installment).

I understand that some Replica 1 kits shipped with a 27C64 EPROM which is also programmable but must be erased using ultraviolet light. These chips have a small window made of quartz glass so that the chip inside can be exposed to light. The 2864 and 2764 chips are electrically compatible other than the method of erasing.

The original Apple 1 had only 256 bytes of ROM. It contained the machine language monitor written by Steve Wozniak that allows displaying and modifying memory in hexadecimal and running programs. This was sufficient to allow a user to enter programs, typically that were hand assembled on paper and entered as hex numbers. While this sounds primitive, it was actually a great advance over other computers of the same era such as the Altair which required entering programs as ones and zeroes using switches on a front panel (the Altair, in fact, had no ROM at all).

Of the parts on the Replica 1, most are still manufactured. One of the exceptions is the 6502 chip. It is still, however, available from some suppliers as NOS (new old stock). The chip on my board is a Synertek 6502B and the date code on it is 8109, indicating it was manufactured in the 9th week of 1981. That makes it one of the original NMOS 6502 chips. Later a CMOS version called the 65C02 with new instructions was introduced. I'll talk about it in a future blog posting.

In the extra space available in the 8K ROM the Replica 1 includes the version of the BASIC language that Woz also wrote for the Apple 1 (which on a real Apple 1 was typically loaded from cassette tape using the optional tape interface).

It also contains the Krusader assembler written by Ken Wessen. This allows entering assembly language programs as English mnemonics rather than hex numbers, and also includes an disassembler and machine language mini monitor.

I made a few small hardware modifications to my Replica 1. Since there is no case, rubber feet on the bottom of the circuit board will keep it more stable on a surface, avoid scratching a desk, and avoid shorting it on a metal surface. You can get suitable adhesive rubber feet at most dollar stores.



While I was waiting for my missing crystal oscillator to arrive, and running it from the circuit I breadboarded, I ran my system at 2MHz (rather than 1) since I had a 2MHZ crystal and the 6502B chip in my system is rated up to 2MHz. I later installed a socket so I can put in a 1 or 2 MHz oscillator.

The serial port on the Replica 1, like the Apple 1, has no hardware handshaking, and even though it runs at only 2400 bps you need to add delays when transferrring files to ensure that data is not lost while the system is operating. This makes uploading of programs quite slow.

I made the high speed serial mod described here that allows the port to run at 115,200 bps with hardware handshaking while remaining software compatible with the Apple 1. The mod worked quite well for me. It requires reprogramming the Propeller chip which requires some care to do correctly. You also need to install 4 jumper wires. I highly recommend this as large programs now load in a few seconds which formerly took many minutes. I also found I can use the Linux minicom program to transfer files, which I was never able to use reliably without the serial mod.
Once minor annoyance is that the Replica 1, like the Apple 1, has no power on reset circuit. You need to hit the reset button after power up. Adding a power on reset would be a nice improvement although I haven't done it on my system. There would be room on the prototype area to add it. One possible circuit is the one used by the Apple 2 using a 555 type timer chip. In fact the first Apple 2 systems did not have a power on reset circuit and it was added in a later revision. Another option is a MAX707 chip as was done here.

Finally, on the subject of hardware, Briel Computers offers some add-on accessories for the Replica 1. The Multi I/O board adds a full serial port, 2 8-bit parallel ports, an EEPROM programmer, and space for an optional speech synthesis chip. I'll discuss this board in a future blog posting.

A Compact Flash Adapter board allows loading and saving programs to flash memory. Unfortunately, the supplier of these boards is not currently making them.

A slot 1 Expander provides 3 additional Apple 1-compatible expansion slots, so you can install multiple add-on boards.

Several people also offer replicas of the only option board offered for the original Apple 1, the casstte tape interface, so you can save and load programs using cassette tapes.

Tuesday, February 28, 2012

The Replica 1

I recently built a Replica 1 computer kit. I've been having a lot of fun with it doing some retro computing, so I'm going to blog some of my experiences here.

The Replica 1 is a recreation of the Apple 1, the computer that started Apple computer as a company. The Replica 1 is not an exact copy, as the original Apple 1 used a number of components that are now hard to obtain and was quite complex. The Replica 1 uses some modern components, but the same 6502 processor and is compatible enough to run software written for the original Apple 1.

You can read about it in detail, but briefly, the key features are:
  • a 6502 processor with 32K of RAM
  • 8K of ROM containing a machine language monitor and BASIC (written by Steven Wozniak) and an assembler/disassembler/debugger
  • support for an ASCII keyboard (like the Apple 1) or a modern PS/2 PC keyboard
  • composite video output to a television or monitor
  • a serial port that allows transferring files to a computer
  • an Apple 1 compatible slot and expansion connector
You can buy it assembled or as a kit. I chose the kit version. Assembly was quite straightforward. I'm an experienced kit builder but there is nothing particularly challenging about the kit as it has no surface mount components and the instruction manual is very well written. Below is a picture of all the parts in the kit organized and ready to start assembly.


Here is the board assembled but no ICs yet inserted in the sockets:

And here is the board with ICs installed being powered up for initial testing:

I used a PS/2 keyboard as ASCII keyboards are very difficult to find these days (the most common source would be to take one out of an old Apple 2 computer). I had a suitable DC power adaptor although I also tried it with an ATX style PC power supply (which is much larger).

For video output I tried it with both a television and an old Commodore 1702 monitor. The Commodore monitor was a little better quality and more authentic.

All ICS are socketed. I followed the recommended procedure of first testing all the power supply voltages before installing the ICs. Then I installed the Propeller chip and EEPROM to verify the video output. At this point I had one problem - there didn't seem to be any video output. Eventually I realized that the EEPROM for the Propeller chip was not the large 28C64 EEPROM, it was the little 8-bin 24LC256 chip. Once I installed the right chip, the Propeller chip loaded it's code and displayed the "@" prompt. Next I installed the 6502 and remaining chips and the machine language "Woz" monitor came up, allowing me to examine memory.

I had one other issue - my kit was missing the 1 MHz crystal oscillator used for the 6502 processor. An e-mail to Vince Briel had one of these on its way in the mail, but in the mean time I built a crystal oscillator circuit on a breadboard using a TTL chip and a 1.4 MHz crystal I had in my junk box. You can see it in the picture below.

In future blog postings I will talk in more detail about some of the interesting hardware and software available for the Replica 1 as well as some of the software I've written and experimented with.

Finally, in researching the Apple 1 on the Internet I came across the web site signedbywoz.com that sells pictures and other memorabilia signed by Steve Wozniak, the designer of the Apple 1 and Apple 2. I just had to have one of these items for my "man cave" where I work with computers and electronics. I ordered a signed Apple 1 schematic. Here is a picture of it framed on the wall.

References: