Description

The COSMAC VIP was introduced in 1977 as a small, easy to use single board computer using the RCA COSMAC 1802 processor. It was designed by the designer of the 1802, Joe Weisbecker. The VIP is based on an earlier computer concept called the "FRED" (Flexible Recreational and Educational Device). The MicroVIP is my tribute to the original implemented entirely on a Cyclone II FPGA module. The microprocessor, RAM, ROM and PIXIE video are all implemented in Verilog.

Details

The MicroVIP is built with an inexpensive Altera Cyclone II FPGA module that I got on e-bay. The computer board is built with point-to-point wiring.

The current features of the MicroVIP are:

CDP1802 Microprocessor and CDP1861 Video Controller implemented in Verilog on the FPGA

Project Logs

So, I got this NTSC LCD monitor that's for a backup camera on Amazon. It was a good price. It seems to be much fussier regarding the video signals than a CRT. I am still working on the FPGA modifications to get the timing right for the LCD monitor.

I keyed in CHIP-8 from the VIP manual and saved it on the SPI flash. Then I tried a couple of CHIP-8 programs. One of the programs is VIP Space Intercept (pg 43 of the manual). It works quite nicely. I have a picture of it up in the gallery. (I'm using my old Apple IIc monitor this time which is why the long persistence of the phosphor is seen) I also tried VIP Wipe Off (pg 42) which also works.

So, I think my VIP ROM re-write is good because it works with CHIP 8 right from the manual. The SPI flash read and write has also been working well. It is "lightning fast" compared to a cassette tape.

I want to check the I/O ports next and then the standard VIP operations will be complete.

Since I had the old RCA UT4 monitor program working with the MicroVIP for initial testing, I was trying to think of a way of keeping it and maybe having some kind of dual-boot scheme.

Well, I figured out a way. There is a push button on the FPGA card that can be used. I made some changes to the FPGA code to boot the UT4 ROM if the button is pressed when coming out of reset. Otherwise, the MicroVIP ROM will boot.

To use UT4, connect a USB to TTL adapter (3.3V), and TeraTerm with a setting of 300bps 7N1. Hold the push button on the FPGA card (near the programming connector) and flip the run switch to RUN. Press <CR> in TeraTerm and the UT4 prompt (*) will appear.

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.

First, I built up the basic hardware with the VIP feature set (except for the tape interface). There are some features that can be added later. I got the processor, RAM, ROM going using a modified version of the UT4 monitor. I got things working in ModelSim first. Next, I used a USB to TTL serial adapter (3.3V Prolific) to interact with the computer.

With UT4 and the serial port, I was able to do some basic tests. I wrote simple programs to test the hexadecimal keypad. I also could test the speaker.

From there, I added the VIP ROM and video. With some debugging using ModelSim, I got it working in hardware.

So far, it operates as a standard VIP but with only memory read and write working. The speaker does beep with the Q line. The keypad is functional as well as the video output.

Plans:

Next, I want to get the SPI working to use the serial flash as a tape emulator. I'm using a 16MB serial flash because it's very inexpensive ($5) and easy to acquire. I realize for a 1977 type computer that is a near infinite amount of space. I will also modify the VIP ROM software to use the serial flash.

After that, I want to have CHIP-8 in RAM on power up and recreate some of the projects in the VIP manual.

For the future, I'd like to add a Tiny BASIC and an ASCII keyboard interface

Discussions

Become a member

Love your project! This project brings back a lot of memories! I worked at Radio Shack at the time and got two "broken" pong games that used the 1802 family. I desoldered everything and wire-wrapped a GP computer from their components, total 512 bytes of SRAM. (An Individual Study project at a time when the Altair 8800 was coming out.) I also purchased the Cosmac ELF that had S100 expansion slots, It had a total of 4K RAM if I remember correctly. I also helped a SCUBA diving friend build a small submersible with the 1802, being CMOS it lasted longer underwater. Ironically, Radio Shack was just coming out with their TRS-80, and I suggested to our District Manager that we set one up as a P.O.S. computer system to keep track of all those addresses we had to take down, was told it would never be done. LOL

Here is a tip: For loading programs, first I load in Chip 8 in VIP mode. Then I switch to UT4 mode and load the hex file. (You may have to modify the file to be UT4 compatible.) After the file has been loaded, I reset back into VIP mode and check that the program is still there. I can then store it to flash. The VIP monitor uses upper memory so it won't overwrite a program loaded in the lower memory locations (like a Chip8 program). My version of UT4 uses the scratch memory at C000H so that it doesn't disturb lower memory.

The flash problems I had were due to a defective SOIC to DIP adapter that apparently had two missing or defective vias, I could not believe that it didn't work (the soldering was perfect) until I buzzed things out with a meter. I had to jumper around the problem.

I'm thinking about making a wireless ESP8266 based SPI loader for the flash chip. I found a cache of CHIP-8 games but I dread typing them into a 16-key keypad, and then finding the typos.

Actually, I found at least one of my problems. There is a connector on the silkscreen of the common Chinese Cyclone II board where the pin pair is marked GND (not GND GND, or pxxx pyyy like the others) . Foolishly, I assumed that both pins were ground so I used the outermost pin for the ground of the flash chip. I discovered that It isn't a ground, I believe that it is the power on reset pin. So, after finding a suitable ground, the unit otherwise worked fine except for the flash, "nearly" first crack. Because I built mine in a box with a keyboard connected via ribbon cable and I used a "carrier board" for the FPGA board, that was better initial success than usual :).

The MPJA schematic and photos claim that no resistor is installed for pulling up the /HOLD_RESET function at all, (although there are pads, but no resistor on MPJA's carrier board for the /WP). Looking at the Winbond chip spec, only the SOIC-16 chip may have the reset internally pulled up. So, I'm going to put 10k pullups on those pins tomorrow and see what happens. the symptom is that I read the same bit pattern all the time, and when I write flash, the unit locks up. That SEEMS like a hold or WP problem.

Because of the way my FPGA carrier board is mounted (upside down in a box), it isn't practical for me to push the button on the board to flip the ROM versions. So, I think that I will put a pushbutton to ground on that pin on my external case.

I am in the middle of building one of these because I've never done anything with an FPGA before. I think that I'm close to having it working but ran into a problem. I powered it up and see H/V sync pulses on video, got a pulse on the LED's and speaker, but when I press "C" (or anything else) and flip the run switch it just seems to go dead. I built it from the zipped file above. Is that the latest working code, schematic, etc? I programmed it with the "USB blaster" in advanced serial mode using the Altera software. I put the 100K resistor on p87 if that is critical.

I should mention that the only real difference between your schematic and my build was that I used a "bare" flash chip, with pullups as per the MPJA schematic. Hopefully, these pins are correct;