CBMSTEVE.CA - Personal pages of Steve J. Gray |
Changes | Info | Prototypes | Remakes | PET Projects | CBM Projects | Modding | 3D Models | KiCad | Github | Ohio Scientific | Other | My Software | My Collections | Facebooks |
Welcome to the "Colour PET" Project Page! For a long time I have been facinated by reading some of the history of Commodore and their secret projects. In particular are the Colour PET's.. Yes P.E.T.S! Apparently there were several prototype machines that could be called "Colour PET". As can be expected, commodore had internal prototypes. Some were shown some not. One such machine was Moorepark's 8033 Colour PET (aka TOI, seen above) possibly based on the 6562 or 6564 VIC chips and built into 8032-type case. There was also the "Japanese ColourPET" supposedly based on a TI video chip, the MicroPET based on the VIC-I chip, and also another Colour PET, said to be a hack of an 8032 motherboard using discreet chips.
Here's a magazine clipping of one such Colour PET
I've always wondered how it might be done, and what it would take to duplicate it. I suppose no one will really know exactly what it might have become if it had been completed, but this project will be an attempt to create a Colour PET along the same lines.
This project will be a fun and practical way for me to learn electronics and more of the inner workings of the PET both hardware and software-wise. Any input is gladly accepted!
Commodore PETs run at 1MHz. This is fast enough to do 40 column video. In order to make an 80 column PET, they had to come up with a trick. They wired up two blocks of video ram in parallel. The CRTC controller accesses the two bytes at the same time, latches the data and then displays out each byte one after the other. The "Universal Dynamic PET" motherboard has jumpers to allow either 40 or 80 column operation. For 40 column we have 1K video ram installed in the "EVEN" ram bank. For 80 column we have an additional 1K ram in the "ODD" bank for a total of 2K video (80 x 25 = 2000 bytes).
My idea is to jumper the board as 40 column, but still have both ram banks filled. This will mean the "ODD" bank of ram will be installed but not accessed for 40 column mode. We are going to use this ram as our colour ram. Now we have to decide how to use these 8 bits of colour info. We also have to keep in mind what type of Monitor we ultimately will need to use to display the final output. We have 8 bits to work with. We could split the 8 bits into two 4 bit values, with one set for foregound and one for background. This would give us 16 colors, like the C128's VDC mode (3 bits for RGB colour, plus 1 for intensity) and we could use an RGBI monitor like the 1902. This would be a digital output. Or, more colours would be more impressive, so we could use all 8 bits, giving us 256 possible colours, using an Analog signal suitable for Amiga monitors like the 1084. One nice thing about PETSCII is that you get 128 unique characters plus the REVERSE of each, so effectively we can use the reverse character to get 256 background colours as well (sort of).
The PET video circuitry has everything needed to generate monochrome video. This consists of three signals: H-sync, V-sync, and the pixel (on/off) video output. With 80 column mode the EVEN and ODD RAM is accessed in parallel and LATCHED. Normally these two latches hold the character info to be sent to the CHARACTER ROM then shifted out pixel-by-pixel to the monitor. With this mod, the ODD ram latch (UB8) will now hold the colour information. This value will be diverted to our add-on board to generate the colour signal. How we use these 8 bits will determine how many colours we can generate and which type of output (monitor) is needed. Our minimal circuit will mount on the ODD latch. The 3 PET video signals will also feed into the circuit.
The motherboard will be jumpered for 40 columns, with one change. The BA10 line needs to be fed to the "A" input of UC3. This will re-map the ODD ram to the $8400-$87FF range. Normal character ram will remain at $8000-$83FF.
The 8 bits will go directly to a single MUX chip. 4 bits will be foreground colour, and 4 will be background. We will have one bit for Red, one for Green, and one for Blue, plus one for Intensity. This will give us 16 possible colours. The normal PET pixel line will toggle the MUX between foreground and background color. We can use any CGA or RGBI monitor like the Commodore 1902. The signals will be TTL level, 0V (off) or 5V (on).
The 8 bits from the ODD latch will be fed to the "A" inputs of two 74LS157 MUX chips. Eight (8) additional bits will be used as the background colour on the "B" inputs. Both MUX chips will be controlled by the pixel output of the pet. The 8 outputs of the MUX's go through 3 groups of resistors configured as a DAC (digital to analog converter), representing the R, G, and B values. We will use 3 bits for RED, 3 for GREEN, and 2 for BLUE (since our eyes are supposedly less sensitive to blue). So we have 2^3 = 8 levels for RED, 8 for GREEN, and 2^2 = 4 levels for BLUE. We can generate 256 colours in total, suitable for an RGB analog monitor. We need to determine optimal DAC resistor values to first generate the different colour levels, but also to reduce the voltages to make them compatible to Analog RGB levels (1.0 or 0.7V P-P but not sure which).
The background colour will be hard wired - probably black, but could be any colour you want. The DAC outputs, along with our H and V syncs, are sent to the RGB Analog output connector.
The PET internal monitor uses TTL level voltages and the video signal is either on (5V) or off (0V). An Analog RGB monitor will require different voltages. Also, Amiga monitors run at 15kHz, so we need to make sure the PET video runs at the same frequency. Some tweaking of the CRTC registers may also be required. The RGB DAC resistor values still need to be investigated. It might also be possible to connect our output to a VGA monitor provided it supports 15kHz timing (I have one such NEC monitor that can be tested). And lastly, normal VGA monitors that scan at 30kHz might also be usable if a scan-doubler is used.
I have also been investigating Colour CRT monitors that might be suitable for installation INSIDE the PET monitor casing. So far I've determined that CRT tubes are much longer than monochrome tubes, so it's likely that some modification to the casing will be nesessary. The PET has a 12" tube. Apple made a 12" RGBA monitor for the Apple IIgs that might work. Atari also made a couple 12" monitors for the Atari ST computers that are also analog and will likely fit. If you have other ideas please contact me!
There are two options to make a working ColourPET. Upgrade a 4032, or Downgrade an 8032. Either will work and it depends on what you are comfortable doing.
Upgrading a 4032: This will involve installing the missing chips. You will need to supply the chips. You will need to remove the solder from the holes, solder in sockets and install the chips. Since it's already set for 40 column you will only have one jumper to change (BA10). Most 4000 series PETs came with the "normal/graphics" keyboard. This was the route I took for the first prototype.
Downgrading an 8032: For this all the chips are already installed, but you will need to de-solder the ODD latch chip and install a socket. You will need to change all the jumpers to 40 column mode, except for the BA10 jumper. Most 8000 series have the "business" keyboard. Since I didn't use this method, but I did transfer my prototype's motherboard into an 8032 high profile case in order to have the business keyboard and the ESC key, which is needed for the new firmware.
Both methods require one jumper change. You will need to disconnect J7/J8 and connect the BA10 line to the "A" input of UC3. This is required to re-map colour RAM to the correct $8400-$87FF address range. This is the white wire that can be seen on the motherboard of my prototype.
The first step was breadboarding the digital version. I had to invert the sync to get it working on a 1084 monitor. The current schematics show the first working version with inverter chip added to fix the sync. I have been playing with the CRTC registers and finally got a stable picture. The CRTC registers are very finicky. A value even one off can corrupt the display. When the timing is set for the 1084 monitor it caused the internal monitor to go crazy, so I have burned a new edit ROM and have disconnected and removed the internal monitor (see picture at top of page!).
The current circuit has a flaw. Due to character rom access times, the video data gets delayed, causing the character and colour data to be offset by one character. So for example the top left of the screen is at location $8000 and the colour for that character should come from $8400, but due to the delay it ends up being offset so that the colour under the character actually is at $8401. We could work with this, but I would rather get it working properly.
After that I want to implement a definable border colour, but it only needs 4 bits, so I had an idea. If we add another latch it will have 8 bits. We could make 4 bits for border colour and 4 bits for background colour. Now, we already have a background colour for each character you might say... correct, so I was thinking we could make background colour 0 (black) be transparent. Whenever we see a character background of 0 we use the background colour from the latch. This could let us do some interesting colour effects in conjunction with reverse (128-255) characters.
For World of Commodore 2014 I built a point-to-point version. I also transplanted the motherboard into a new 8032 "hp" case with Business keyboard and removable bezel with drive cutouts for future floppy drives (some day)."
Christian Dirks and Nils Eilers got together and tried to fix the shift. What they did was add a second latch that is controlled by a flip flop. This flip flop is timed using specific offsets from the 16MHz clock. They also made the sync polarity selectable via jumpers, as well as adding a monochrome output. You can download their schematics below. I have not yet built this version myself.
In 2016 I am working on ColourPET+G. I have started breadboarding various sub-sections of the design and also making PCB's. I have my first PCB completed and made. This PCB is called "ColourPET-40/Dual" and it is a simple extension to ColourPET that attempts to fix the colour shift using an eprom that is functionally the same as the PET's character ROM. Theoretically the video stream and colour stream are delayed by the same rom access thereby synchronizing them at the output. It also occured to me that adding a shift-register would effectively add a second video screen to the PET! One additional IC is all we need. As well, I added a resistor DAC to convert the RGBI to greyscale. I am currently assembling the PCB and will test it soon.
For the 2016 World of Commodore show I demonstrated the ColourPET-40/Dual pcb and an internally mounted colour CRT monitor in the standard PET monitor housing. Of course, colour monitors are a lot deeper than monochrome and this meant extending the back of the housing a bit. I made a foam board mockup of an extended case, and eventually I hope to 3D print a permanent one. The internal monitor is a 12" RGB analog monitor which required that I build a small RGBI-to-RGB adapter board.
Diagram to connect an Atari SC-1224 monitor.
I have been continually updating my Editor ROM project and have added some new startup screens - one of which looks like the C65 start screen! The editor includes ESC codes and fully supports colour printing, scrolling, setting windows and other advanced features. It also has the ability to include a built-in DOS Wedge for making disk image mounting and sub-directories easier to work with. There is a new Autostart facility that will be able to automatically activate option roms.
Support is included for the current 16-colour digital version and also for the not-yet-complete 256-colour analog version, as well as support for NTSC or PAL video timing, and various Keyboard layouts. The project can be found here, or on GitHub here. You can assemble a ColourPET rom with any screen or keyboard combination you desire. Colour can be selected by printing the same CHR codes as the C128. As well, you can now use ESC sequences just like the C128 to set windows, change mode, scroll etc. I have added ESC sequences to set colour as well. Work continues on implementing all the ESC sequences, and squashing some bugs NOTE: These new edit rom images cn be up to 4K in size, so you must burn them to 2532 EPROMS or equivilent. Support is added for putting code in the option ROM space, allowing the Editor to be up to 10K in size.
The ColourPET has been included for a while now in beta releases of VICE, but with the VICE 3.0 release it is official! Download the latest vice along with the ColourPET firmware here. Enable ColourPET support using the "Cartridge/IO settings" menu. Next go to "ROM settings" and select the ColourPET firmware binary file. Reset VICE and you can now try it!
As we are developing new firmware and new hardware capabilities we will need some new tools. I am writing several utilities using VisualBASIC 6. I have created a Font Utility, Colour Palette Editor, and Delay-ROM generator. You can find links to these in the download section.
A certain friend of mine is constantly nagging me about the name of my project, particularly the spelling of "Colour". It's an ongoing joke. Now, being Canadian I would naturally include the "U". My friend, being non-canadian prefers "Color". I suppose both are equally valid, however Commodore was also a Canadian company early on, and the photos of their prototype machines also use the "U". So, I'm gonna stick to that! ;-)
I have begun planning the next version, tentatively called "ColourPET+G". The "+G" stands for Graphics. Thanks to an idea by MikeS. Mike and I had been discussing ColourPET, 40/80 switching, and Soft-Fonts at TPUG meetings for over a year. When the topic of Soft-fonts came up on the VCF forums Mike suggested using some colour ram bits to select different character sets. I worked out some features and drew up a block diagram and it looks feasable.
The following are planned, but are subject to change:
Soft fonts are ok, you might say... but what about the "G" for graphics? Well, the PET has 128 unique characters in a single font (since the reverse characters are hardwired). So 128 characters times 16 sets gives 2048 possible unique characters. The 40 column screen has 1000 positions (40x25) so if we place a unique character at each screen position and each of those characters is definable, then we effectively have a 320x200 pixel bitmap screen! Plus, each 8x8 pixel character can be one of 16 possible colours!
Here is the current "work-in-progress" block diagram - Comments, suggestions, feedback is appreciated:
Read my Theory of Operation for details.
The items marked in RED still need to be worked out. I need to decide where the character set RAM and latches will be located in the memory map. The character RAM will likely go into option rom space at $9000 or $A000. The latches I would like to have located near the CRTC controller registers at $E880. Finally, there is still an issue with colour alignment that needs to be worked out in the current ColourPET circuit before this next-gen version can be built.
If there is enough interest in this project I will consider running a small batch of PCB's and either sell them as a kit, or pre-assembled. Please contact me to show your interest.
While developing ColourPET+G I am learning Kicad in order to create a ColourPET+G PCB. To test various ideas, schematics etc I am making PCB's of various designs. I figure that the cost of a small run of 10 PCB's at DirtyPCB.com would cost me less than the time it would take me to do a point-to-point version. That and the fact I hate cutting/stripping wires, soldering etc.
PCB SUBSECTION NAME | STATUS-DATE | DESCRIPTION |
ColourPET-40/Dual | PCB-2016-05-28 | This board is my first ColourPET PCB! This is a test to see if I can fix the colour shift with an EPROM. The EPROM will delay the colour data in the same manner that the character ROM delays the video data. It then occured to me that adding a second shift register effectively gives you a second video screen for almost free! I also want to test a greyscale resistor DAC option. So, this board will give you RGBI output just like the original ColourPET circuit, an option to use the internal PET monitor with 16 greyscales, or add an independent secondary monochrome video screen. |
ColourPET-SoftFont | In Dev | This board is being developed. It is the Soft Font section of ColourPET+G. |
ColourPET-80 | In Dev | This board is being developed. It will add 2K of additional RAM at $8800-8FFF to allow an 80-column colour screen. |
I have created schematics in ExpressSCH. Future schematics will be in Kicad format. Some schematics are PRELIMINARY and UNTESTED. I take no responsibility if you decide to build them.
FILE | VERSION | DESCRIPTION |
pdf-schematic-v3.pdf | V3 | Digital Version Schematic. 16 colours. Submitted by Christian Dirks and Nils Eilers. Fixes colour shift! |
pic-d-schematic-v2b.bmp | V2 | Digital Version Schematic. 16 colours. First working Prototype, but needs more work. Re-assigned colour bits. "RGBI" ordering (updated). This now matches the C128's VDC bits. |
pic-a-schematic-v1.bmp | V1 | Analog Version Schematic. 256 colours. Pre-prototype concept (untested) |
This is pre-assembled firmware for the current ColourPET circuit. Use this if you want a quick, simple ROM. For the latest and most stable firmware I would recommend you check out my CBM-Editor-ROM project, that will allow you to pick the options you wish, and to compile your own customized firmware.
FILE | VERSION | COLS | KBD | Hz | SCREEN | OTHER | NOTES |
cpet-40-b-ntsc-beta1.bin | Beta1 | 40 | B | 50 | NTSC | ESC | First beta with some bugs/missing features. |
cpet-40-b-pal-beta1.bin | Beta1 | 40 | B | 50 | PAL | ESC | First beta with some bugs/missing features. |
cpet-40-din-pal-beta1.bin | Beta1 | 40 | DIN | 50 | PAL | ESC | First beta with some bugs/missing features. |
cpet-40-nsjg-ntsc-beta1.bin | Beta1 | 40 | N-SJG | 50 | NTSC | ESC | First beta with some bugs/missing features. USE "@" as "ESC" key |
These are Character set ROMs:
FILE | VERSION | DESCRIPTION |
colourpet-char.bin | 1 | ColourPET Character ROM. 4K ROM that contains standard PET and C64 fonts. USE ESC+Y or ESC+Z to select. |
This software runs on the PET/ColourPET/VICE:
FILE | VERSION | DESCRIPTION |
cpetx.prg | 2 | ColourPET CRTC Explorer - modify screen timing (updated timing values). |
demo1.prg | 1 | ColourPET Demo#1 - Surprise colour reveal demo. ColourPET's first public showing at TPUG. |
cpettest.prg | 1 | ColourPET Colour Tester - Simple program to show all 16 RGBI colours, with names for calibration. See screenshot. |
cpetpicview.zip | 1 | ColourPET Picture - CSDB PETSCII Art Contest; "The Game is Apaw!" converted to ColourPET! Includes ACME source code! |
This is support software that runs on the PC:
FILE | VERSION | DESCRIPTION |
ColourPET Font Utility | - | Lets you manipulate fonts, font sets, and build a Font ROM with up to 64 fonts (16 font sets). |
ColourPET Delay ROM Utility | - | Creates Delay ROM binary for ColourPET/Dual PCB. |
ColourPET Palette Editor | - | Lets you edit 256-colour palettes for ColourPET+G. |
At the moment there is not a lot of real documentation as the project is still in development. However, as things stabilize I will place what I can here:
FILE | DESCRIPTION |
ColourPET ESC codes.txt | List of ESC codes and status as of Jan 15,2014. |
These are old files which have been made obsolete or redundant, but are kept here for reference.
FILE | VERSION | DESCRIPTION |
pic-d-schematic-v1.bmp | V1 | Digital Version Schematic. 16 colours. Pre-prototype concept (untested). "IBGR" ordering. |
edit-4-40-n-60Hz-ntsc-01.bin | 01 | Simple EDIT ROM for stable picture on NTSC monitor. For 40 column, normal keyboard, 60Hz power PET. |
edit-4-40color-n-60Hz-sjg-02.bin | 02 | ColourPET EDIT ROM (IBGR ordering). Boots to stable screen with Green text on black background on NTSC monitor. For 40 column, normal keyboard, 60Hz power PET. |
Page Created: Dec 17/2012. Last updated: Feb 7/2018, 11:30pm EST
Send comments or feedback to Steve Gray(sjgray@rogers.com)