Close

Cassette Tape Replacement with SPI Flash

A project log for MicroVIP

This is a project to celebrate the 40th anniversary of the RCA COSMAC VIP microcomputer!

david-hunterDavid Hunter 09/04/2017 at 00:150 Comments

First off, thanks to those of you who are following and liking this project.   This is my first major Hackaday project and I'm very pleased to see it has some interest.  THANKS!

UPDATE:

Well, it took some time, but I got the SPI serial flash (Winbond W25Q128F) working.   The hardest part was fitting the software within the same confines as the original VIP ROM.   I also kept the subroutines in the second page (#8100) at the same addresses to stay compatible with VIP software like CHIP-8.

This version communicates with the flash chip using a 12.5MHz SPI clock.   The data transfer is WAY faster than the 1802 bus cycles.   So, no polling is needed for SPI transfers.   Port 7 is defined for SPI I/O with the Q line connected to the chip select by setting the bits in the control register (Port 5).   This is "lightning fast" compared to a cassette tape and with 2MB of space allocated for VIP files it should be enough.   (The rest of the flash space (14MB) is being reserved for a future Tiny BASIC file system)

The Q line driving the chip select caused some issues.   It would seem to deassert all by itself.   In debugging this, I discovered that the Q line is modified by the video interrupt by the tone timer register (R8.0).   Originally I had thought I didn't have to turn the video on and off like the original since I wasn't "bit banging" to a tape.   Well, with this discovery, I still need to shut the video off to talk to the flash and turn video back on when done.   

The entire 4k RAM of the MicroVIP is stored in one of 512 sectors on the serial flash.   A unique "file number" is entered into the keypad like a memory address.  Up to 512 programs / memory images can be saved this way.   The file number can be thought of as the equivalent to a tape counter number.   This number needs to be recorded somewhere in a notebook because there is no directory capability.  (Just like the original VIP)

To save a memory image to the flash:

Press and hold C, flip to RUN, release C

Enter the desired 4 digit file number (0000-01FF)

Press the F key.   

The image will be written to the serial flash under that file number

The last address and byte will be displayed when it is finished.  (0FFF XX)

To load a memory image from the flash:

Press and hold C, flip to RUN, release C

Enter the desired 4 digit file number (0000-01FF)

Press the B key.   

The image will be loaded from flash to memory.

The last address and byte will be displayed when it is finished.  (0FFF XX)

So now, the MicroVIP works like the original VIP of 1977.  The same 4 functions are available in the ROM: Memory Read, Memory Write, Flash Read, Flash Write.   And since this is 2017, the cassette tape has been replaced by a massive serial flash device.

Discussions