Tuesday, November 13, 2018

Using the Apple II as a 28C16 EEPROM Burner

This is a tutorial on how to use an Apple II with a Super Serial Card as a 28C16 EEPROM programmer. For the purposes of this tutorial, I will be giving instructions on programming a lowercase character ROM for the Apple II+ Rev 7. You can use an earlier Apple II for general EEPROM programming though. The simplest way to transfer the data from a binary file to the EEPROM without extra hardware is to use the Mac's headphone port connected to the Apple II Cassette input port, and that method is what I will demonstrate here. Alternatively, you could use a virtual disk, TCP/IP card, or another Super Serial Card to transfer the data to the Apple II.

Supplies:

  • Apple II+ Rev 7 (minimum to accept the finished lowercase character ROM)
  • Apple Super Serial Card (SSC)
  • Atmel 28C16 EEPROM
  • ROM binary file
  • Macintosh running OS X

Process:

Install c2t on your Mac
c2t will convert a binary file to the audio format that the Apple II can use. You can find instructions to install on the c2t GitHub page. However, due to an HTML redirect and a typo, some of the instructions did not work correctly for meThe instructions are now correct, and I had to use the Terminal commands:
sudo curl -L https://github.com/datajerk/c2t/raw/master/bin/c2t >/usr/local/bin/c2t
sudo chmod 755 /usr/local/bin/c2t
Get and convert the ROM binary file to audio format

Apple ROM files are fairly easy to find. Once the archive is downloaded to your Downloads folder, extract the files and convert to audio using the Terminal commands:

open ~/Downloads/APPLE+II+ROMS.zip
cd ~/Downloads/APPLE\ II\ ROMS/APPLE\ II+/
c2t -2 APPLE\ II+\ -\ LOWERCASE\ CHARACTER\ GENERATOR\ -\ 2716.bin,8000 ~/Downloads/LOWERCASE_ROM.aif

This creates an audio file in your Downloads folder named "LOWERCASE_ROM.aif", which can be used to transfer the ROM data to your Apple II. This audio file is available for download, if you want to skip installing c2t.
Modify the Super Serial Card

The Apple SSC manual documents how to modify the card to accept an SRAM chip, which is compatible with the pinout of a 28C16 EEPROM. I have a clone of the SSC which is slightly different and will allow me to easily enable and disable this function.

First, I removed the ROM (the lower big chip) so I didn't accidentally damage it. Then, I cut the traces that link the some of the vias in the center of the card, and removed the solder in the vias.

These vias correspond to the bow-ties and solder pads on the SSC card. I soldered in gold and silver double row header pins so I can easily see which pins should be jumped at the same time.

If you have an SSC, card just cut the bowties and solder across the jumper pads, according to the instructions in the manual. Note that you will have to undo this modification to use the original SSC ROM

With the pins soldered in, I can use jumpers to configure the card for the original ROM, for EEPROM, and to set the write enable separately for the EEPROM (black jumper cap).

Now, install the 28C16 EEPROM into the ROM location (double check the orientation of the EEPROM chip!) and insert the card into slot 2 of the Apple II.

Connect the Computers
Use a 3.5mm Male to Male Audio Aux Cable to connect the Mac headphone jack to the Apple II Cassette Input port. The cable can can be stereo or mono, although stereo is easier to find nowadays. Turn the Mac volume up to the maximum level.
Transfer and Write the ROM Data

It would be really simple if we could just transfer the audio data directly into the memory locations of the EEPROM. Unfortunately, I was unable to do this. I believe that the EEPROM needs more time to write than is given to it by the Apple II Monitor, so maybe the faster AT28C16E would work better for direct writing. I could only successfully write about 16 bytes at a time reading audio or copying directly to the AT28C16.

Instead, we will copy to the Apple II memory, then slowly POKE it into the EEPROM using AppleSoft BASIC. On the Apple II, assuming 64K of RAM:

] CALL -151
* 8000.87FFR

Play the LOWERCASE_ROM.aif file on your Mac. When it is loaded, you should hear a beep on the Apple II, and get another * prompt.

At this point, you could try directly copying to the EEPROM by:

* CFFF
* C200
* C800<8000.86FFM
* C200<8700.87FFM
But, I received errors when verifying:
* C200<8700.87FFV

So, if that doesn't work, let's load an AppleSoft BASIC program to get the data into the EEPROM. To load it, return to BASIC by hitting:

<CTRL><RESET>
Enter the BASIC command:
] LOAD
Then use the Mac to download and play the audio file for the ROM transfer BASIC program or, skip the LOAD command and enter it by hand:

5 REM ?"TRANSFER BIN FROM $8000 TO SSC CARD"
10 S = 2 : REM ?"SLOT 2, DO NOT USE 0, 1, 3" 
20 LM = 49152 + (S*256) : REM ?"SLOT IOSEL"
30 HM = 51200 : REM ?"$C800"
40 ST = 32768 : REM ?"$8000"
50 X=PEEK(53247) : REM ?"$CFFF"
60 X=PEEK(LM) : REM ?"ENABLE HM"
70 BL = 1792 : REM ?"IOSEL SIZE"
80 LM=LM-BL
100 FOR X= 0 TO 2047
110 V= PEEK(ST+X)
120 IF X < BL THEN EA = (HM+X) : GOTO 140
130 EA = (LM+X)
140 POKE EA,V
150 ? EA; ": ";V
160 NEXT X
170 ? "TRANSFERRED ";X;" BYTES" 
200 END
After the beeps, run the loaded BASIC program:
] RUN
This will slowly write the data you previously stored in the $8000 memory range to the I/O shared $C800.$CEFF range, and the slot 2 $C200.$C2FF range. The process should take less than 2 minutes (1 min 45 secs). You can edit the BASIC program to change slots if you need to, but don't use slot 1 on any Apple, or slot 3 on an Apple //e, as the IOSEL area we are using is not normally addressable in those slots.

Once the program runs, turn off the Apple II, remove the EEPROM and insert it into the "ROM_SPCL" location at the bottom of the logic board (double check the orientation of the EEPROM chip!). You will normally have to disassemble the computer case to reach down there.

2 comments:

  1. can this method be used to replace the applesoft roms? with integer basic for example

    ReplyDelete
    Replies
    1. Hoshikawa,
      Unfortunately, the Applesoft ROMs are not pin compatible with 28C16 EEPROMs. Here are some solutions to the problem: The Integer ROM Dilema. Using one of those methods will let you use 28C16 EEPROMS for Applesoft. The character generator ROM IS compatible though.

      Delete