When I first started studying the PET
schematics, I tried to understand how the two
video RAM banks worked and I realized that
color systems do something similar. They have
one area for storing the characters on screen
and another to store the color. Both areas are
read simultaneously just like in the 80-column
PET. Ah-ha! To add color to the PET, all I
needed to do was figure out how to use one
bank of video memory for color information
rather than character information.
We have 2 KB total of video RAM, so with
two bytes for each character, we will only be
able to display a 40-column color screen.
Therefore, we need to set our motherboard
jumpers to 40-column mode. Normally, the two
video RAM banks are set so that one bank is
for even memory addresses, and the other bank
is set for odd addresses in a single memory
range; in this case, appearing at $8000-$87FF in
the memory space. We need to re-configure
them so that one bank (the character RAM)
appears at $8000-$83FF and the other bank
(the color RAM) appears at $8400-$87FF. We
do this by removing jumpers J7 and J8, then
feeding the BA10 address line to the “A” input of the
47LS138 chip at UC3 pin 1.
So, now the computer fetches both bytes and latches
them as before, but now we need to use the color bytes
to actually generate color. We have eight bits of data, so
how do we use them? We could take all eight bits and use
them to produce 2^ 8 = 256 colors for each character,
then have a fixed background color such as black. We
could output this to an analog RGB monitor by assigning
some bits for RED, some for GREEN, and some for BLUE.
We could then run those through a digital-to-analog
converter (DAC) consisting of simple resistors.
Another option would be to split the eight bits into
two groups, assigning four bits to the character’s
foreground color and four bits to the background color.
With four color bits, we could use them as RGBI, giving
16 colors suitable for an RGBI digital monitor. I have
designed circuits for both of these options, but for this
project we will build the digital version as it’s a little
The color data is available at the UB8 latch chip. We
will tap into this chip, diverting the latched data to our
circuit. Here’s the crucial part of our plan: We are going to
use the PET’s normal monochrome video pixel signal as a
toggle. When it is 0 (off), we use the background color;
when it is 1 (on), we use the foreground color.
We can accomplish this with a 74LS157 quad
multiplexer chip. We feed the four background bits to the
A inputs and the four foreground bits into the B inputs.
The monochrome pixel signal goes to the selector input
and switches all four lines simultaneously. We now have a
We’re not done yet. Where does this data go? We
now output those four bits, representing RGBI to the
monitor. Vintage monochrome and color monitors require
differing sync signals and refresh rates. Our PET’s internal
monochrome monitor uses positive h- and v-syncs and
runs at a 20 kHz refresh rate (Figure 3). We need to adjust
these in order to connect to an RGBI monitor. These
monitors require negative syncs and a 15 kHz refresh like
early TV signals. A couple inverters will take care of the
sync, but in order to adjust the refresh rate we will need to
modify the timing of the CRTC chip.
The CRTC contains many registers that let you define
the parameters of the video. When the PET powers on, it
initializes the CRTC with routines in the EDITOR ROM.
There are two tables in the ROM that define a “text”
mode and a “graphic” mode. These tables will need to be
modified to configure the signal for 15 kHz. During initial
prototyping, I found that the refresh rates were similar
enough that I could display a picture on both monitors at
the same time, but the internal monitor was unstable and
would blank out occasionally. To figure out what
parameters were needed for the CRTC, I wrote a little
program that let me adjust the chip registers in real time
until I got a stable signal on the monitor (Figure 4).
By adding color, we find there are a few issues of
concern. First, fetching data from the character ROM takes
additional time. This has the effect of shifting the character
and color data so that the first character on the screen
September 2015 47
FIGURE 4. Video timing software.