ETI April page 41
ADDING COLOUR
TO THE ACE
Black and white is boring, so add a little colour (or a lot, if you
want) to your computer's life with this project from John Wike.
Additional material by Phil Walker.
|
T he two facilities that really enhance the output of a microcomputer are sound and colour. The Jupiter Ace already has sound of sorts and this project provides a means of adding colour to is monochrome display. Eight colours including white and black are available, any of which
EDITORIAL COMMENT It may seem a little strange to publish a project for the Jupiter Ace several months after the manufacture has gone into liquidation. However, there will be a number of readers around who have Aces, and, moreover, we think that there is a lot to be learned from the techniques and systems described here. We think you will agree with us once you have read this article. |
may be selected as fore-ground (ink) or background
(paper) The circuit is active from
switch-on and requites no special
software for monochrome operation. Thus programs maybe listed,
edited and run without the need
to keep swapping over aerial leads
or operating systems. The board
uses the smaller edge connector
and contains a RAM (addressed in
parallel with the Ace video RAM)
to hold the colour- information for
each of the 768 locations on the
screen.
Attributes Each character written on the
screen will have associated with it
the current attribute describing its
ink and paper colours, To Print
anything with different colours the
current attribute must first be
updated. This is easy to implement
and software for doing so is given
later. The default colours at
|
switch-on are green ink and black
paper. The attribute number is
obtained by adding the ink value
to the paper value and adding 128
(80h).
Colour Ink Paper Black 0 0 Blue 1 16 (10h) Red 2 32 (20h) Purple 3 48 (30h) Green 4 64 (40h) Cyan 5 80 (50h) Yellow 6 96 (60h) White 7 112 (70h)About The Ace The Jupiter Ace video display
consists of 24 rows of 32 characters, each of which is selected by
storing the required code at the
appropriate location in the video
RAM. There are 128 character
shapes (plus their inverses) avail-
able and these are re-definable by
the user.
At the rear of the computer (continued on page 43, column 2) |
Fig. 1 Block diagram of the colour board.
|
ETI April page 42 |
||
Painting In Colours
To produce on a suitable TV set
while still I being able to get a good
black and white picture from the
same input signal, the broadcast
authorities have adopted the PAL
system for use in the U.K. This
system operates by retaining a
simple amplitude modulated
brightness (or luminance) signal
which can be used by both colour
and monochrome receivers, The
colour information is added on to
this in a rather complex manner
such that it produces a minimum
amount of interaction on the
screen.
As far as our eyes are concerned, the colour information can be represented by the sum of three 'primary' colours - red, green and blue- in various mixtures. The total brightness effect of the combination is the luminance signal and this is transmitted as such. The colour information is coded differently. The luminance signal is the weighted sum of all the colour signals and the colour information can be sent in two further difference signals obtained by subtracting the luminance signal from the red and the blue |
colour signals. In order to combine
these signals with the, luminance
signal, they are modulated onto
sub-Carrier signals. The frequency
of the two sub-carriers is the same
and has a carefully chosen
relationship to the line frequency.
The difference between the sub-carriers
is that they are 90° out of
phase with each other. This phase
difference is +90° on one line and
-90° on the next to reduce the
visible effects of phase distortion
during, transmission. These modulated
sub-carriers are then combined
with the luminance signal to
form the composite video signal.
This, together with a separate
frequency-modulated sound sub-
carrier, is then used to modulate
the UHF transmitter.
A Typical Video SystemThis, then, is what the colour board project is doing (with the exception of the sound part). Incidentally, there are re a few other such as synchronising and blanking signals which have not been mentioned but are necessary and are provided by circuity on the PCB.
For those of our readers not yet
thoroughly steeped in the inner
|
workings of micros from the hardware side,
we present a short description of a typical black and
white TV style video display.
As far as we can tell from a surreptitious peek inside the case of a Jupiter Ace borrowed for the occasion, there is nothing unusual about the video system used. Fig. 3 shows in block diagram form the main components of such a system. The first major part to consider is the 1K of RAM which stores one 8-bit byte for each character location on the screen. This memory can be written into and read by the processor. By this means information can be updated as necessary. The next part to consider is the video address generator This normally consists of a crystal controlled clock oscillator driving a counter chain. The frequency of the oscillator and the division ratio of the counter chain are.matched together such that they also provide information at the correct time for line and frame synchronising pulses and for the blanking signals necessary to prevent us seeing the line and frame fly-back traces. |
Fig.2 Block diagram of a typical video system |
||
ETI April page 43 |
||
For operation in the UK and
several European countries, the
line period is 64us (15,625kHz)
while the frame period is 20ms (50
Hz). The line blanking period is
nominally 12us while the frame
blanking lasts about 4ms.
The video address generator in the Ace provides S address lines in the horizontal direction and 5 more for the vertical direction. This gives a possible 32 x 32 screen of which only 32 x 24 are actually used. In addition to these 10 address lines there are three more (sometimes four in other machines) which go directly to the character generator - of which more later. When the video system is displaying the data in the video RAM at anytime the address generator supplies 10 address bits to the RAM which then supplies its eight data bits on its output pins. These are taken to the character generator device. The character generator can be either ROM or RAM and in the case of the Ace it is RAM. In the Ace, seven of the data bits from the video RAM are used as address bits for the character generator.and point to a group of eight locations in it. These for cations store the dot pattern for each horizontal line of the character specified by the seven bits from the video RAM. The actual line to be displayed is selected by the three extra address lines coming from the video address generator. The dot pattern for the line of the character to be displayed passes from the output of the character generator to a parallel input shift register. At a suitable time the data is loaded into this device and then shifted out one bit at a time to give the raw video signal. In the Ace there is an extra bit available from the video RAM which is used to invert the polarity of the raw video when it is set. The raw video signal from the shift register is combined with the blanking signals and then the sync. signals to form the composite video signal which drives the UHF modulator. If, as in the Ace, the character generator is not a ROM, then there must be a way for the processor to load it with the correct dot patterns when the machine is first switched on. Note that this is not shown an the block diagram. |
Fig 3 Edge connector details that are not in the manual |
|
(continued from page 41)
there are two edge connectors, the
larger of which is documented in
the manual and brings out the processor
busses for memory and
peripheral expansion. The smaller
connector is not documented, but
it is intended for expansion of the
video circuits and carries the video
RAM address, data and /WE lines as
well as the composite video signal
from the input to the UHF modulator.
The 1 K video RAM appears twice in the Ace memory map, at 2000h-23FFh and at 2400h-27FFh, When addressed in the lower range the processor has priority over the video circuits and accesses can occur during the display period. In the higher range the video circuits have priority and processor accesses are confined to the blanking periods. The latter is the preferred situation so only the range 2400h-27FFh will be considered here. Of this space the 768 bytes at 2400h-26FFh hold the screen data and the 255 bytes at 2701h-27FFh are used as a scratchpad by the system. According to the ACE manual, the one remaining byte at 2700h should always be zero, but this is in fact used only by the input command interpreter to mark the end of the input buffer on the screen. Therefore when a program is running,, the byte can be any value provided it returns to zero before the next operation of the command interpreter. Thus the current colour attribute is held in at latch at 2700h. As a zero written to this address must not affect the contents of the latch, the most significant data bit D7 is set to 1 (by adding 128) to indicate that an attribute is to he stored. The Circuit
The circuit consists of a six-bit
current attribute latch, a 1 K by 6
screen attributable RAM, a blanking
section, ink/paper selector,
colour encoder and UHF modulator,
Both the latch and RAM are
write only so it will be necessary to
maintain separate variables or
arrays to keep a check on their
contents. In most situations, however,
the value required in a particular
RAM location can be
derived from either its
|
address or the contents of the video RAM at
that location.
ConstructionAs there is no blanking signal from the edge connector, it must be re-constituted from the RAM address counters. This can be done provided processor accesses are confined to the blanking periods by using addresses 2400h-27FFh as descried earlier. The selection of ink or paper is determined by the Ace video signal. Areas of the display that are normally white are taken to be ink and black areas to be paper. The colour encoder is based on a National Semiconductor LM1889 colour modulator chip. Although designed to work at the American colour sub carrier frequency of 3.58MHz, it will work at the UK's 4.4336MHz with suitable changes of component values. This IC requires a supply voltage of 10 to 15 volts, for which the author used a spare computer power pack which actually came with a Sinclair printer. Obviously any alternative voltage source could be used. The 5 volt supply for the UHF modulator was derived from the 12 volt line to avoid problems with noise on the logic supply.
Construction of this project is
straightforward but we recommend
that you do it in the following
order using a fine tipped soldering iron.
Firstly, since this is a double sided PCB and is not plated through, some links must be inserted and soldered on both sides of the board; note especially the ten underneath IC8. Also, some component leads must be soldered on both sides. Next fit the recommended IC sockets for IC8 and IC4. Now fit the other ICs and remember to solder the leads on the top, bottom or both sides of the board as necessary. Check this part carefully as mistakes here will be very difficult to locate. Make very sure you put ICs in the right way round as well. Now, fit the resistors, capacitors, variable resistors, variable capacitor, diodes, transistors crystal, edge connector and UHF modulator in this order. Don't forget (continued on page 46) |
|
ETI April 1984 page 44 How it Works
|
||
The address inputs of RAM IC8, the
colour attribute store, are connected to
the address inputs of the Ace video
RAM, HO to H4 and VO to V4. These lines
normally carry the display horizontal and
vertical character position counters, but
during a processor access to the video
RAM (2400h-27FFh) they are equal to
the processor address lines AO to A9.
If the access is a write operation then the decoded write enable signal /WE will go low and data from latch IC4 (via tri-state buffer IC1) will be written into IC8. The /WE signal is further decoded by gales IC2 and 10 so that data written to address 2700h will be latched in IC4 if the most significant bit D7 is high. At switch on, lC4 is cleared by R3/C5, but as this would give a colour attribute of black on black, gate IC6a (controlled by latch IC5b) inverts the green Ink signal to give the default condition of green on black. Latch IC5b will be cleared when IC4 is written to, and the green ink signal will then be passed normally. by IC6a. During the display period, gates |
IC6b
and c in conjunction with output Q2 of
latch IC11 produce a short clock pulse
for ICI1 every time address line HO
changes. As the RAM outputs change
very quickly, timings here are critical so
HO is buffered by lC1b and H1 is
delayed slightly by C2.
The outputs of IC11 consist of three ink bits and three paper bits for the character currently being displayed by the Ace character generator. Selection of ink or paper bits in data selector IC12 Is controlled by Schmidt trigger Q2/3 from the Ace composite video signal. While areas select ink colours and back areas select paper colours. The outputs of IC12 are the red, green and blue video signals. The most significant horizontal address line H4 clocks bistable IC10a on and off to provide line blanking. To ensure that any processor accesses of the video RAM during the blanking period do not lead to incorrect triggering of IC10a, monostable IC7 and differentiated R11/C9 give a short window for triggering to occur. Latch IC5d and output Q1 of IC11 |
serve to delay the
blanking signal for the same period that
the data from the RAM is delayed.
Sync. separator Q1/IC1d provides the line sync for the board from the Ace composite video signal. The sync is integrated by R12/C11 to give a field sync input to set latch IC5c, the field blanking generator. The latch is reset by a short pulse produced by differentiated C9/R9/R10 at the end of one cycle of address line V2. This allows the field display period, which ends when address lines V3 and V4 (combined in IC5a wired as a NAND gate) are both high and sets IC5c again. Integrating networks R13/ C10 and R2/C4 prevent their respective signals responding to changes caused by processor accesses, as these last only about lus. The line sync pulse is applied via R1d to differentiated C13/R15/R16, The recharging period of the trailing edge of the output of this network gives a colour burst gate pulse from IC1f. Broadcast specifications require a gap of approx. 800ns between line sync and burst. |
|
ETI April 1984 page 44 How it works (continued)
|
||
This is provided by delay network R14/C12.
Bistable IC10b is clocked by the line sync to give the PAL alternating phase control. This was found to require phase locking to the field period in order to work with the author's TV so the short differentiated V2 signal at C6/R15/R10 was available to clear the bistable. The red, green, blue and sync signals are combined in R21,30,31,36,37,38, 39 and Dl to give the composite grey scale luminance signal. This is applied via output stage Q6 and Q7 to the UHF modulator. A relatively clean 5 volt supply for the output stages is derived from the 12 volt supply by R41/ZD1. The colour sub carrier is generated by colour modulator IC13 at a frequency determined by the feedback network around pins 18 and 17, set by crystal X1 at 4.433 MHz. The phase shifting networks R33/C17 and C16/R17 ensure that the inputs at pins 1 |
and 18 have a
phase difference of 90 to form the
quadrature components of the sub carrier.
These are modulated respectively
by the R-Y and B-Y colour difference
signals at pins 2 and 4. For the
limited range of colours to be displayed,
the difference signals can be produced
by algebraically subtracting the red and
green and the blue and green colour
signals. This is achieved by the open
collector gates of IC13 switching current
into emitters of Q4 and Q5. The
values of bias resistors R27/R28 and
R25/R26 ensure that the zero level of
the difference signals is equal to the
chrome bias voltage at IC14 pin 3.
The colour burst is produced in the correct phase by mixing the burst gate pulse from IC1f with the R-Y signal in IC6d and the B-Y signal in IC13c. The phase alternation of the R-Y signal occurs in IC13b and IC13a under the control of IC10b. |
|
|
ETI April 1984 page 46
the flying leads for the 12 volt
Supply.
Lastly, insert IC8 and IC14 in their sockets and all should be ready. At this stage, check again carefully for shorted tracks, etc, before setting up. If you do not get a polarising key with your piece of edge connector, either bend the contacts at the slot position in towards each other or alternatively, break the pins off very close to the rear of the connector at the correct position and pull the contact part out of the front. Cut a small piece of PCB material or similar board and having made sure that it fits the slot in the Ace connector, glue it, preferably with a fast-acting cyanoacrylate adhesive, into the front of the edge connector. This will allow positive location of the connector into the Ace. Setting Up After checking the board (again!) very carefully for shorted tracks, etc plug it into the Ace, connect it to a 12 volt supply (that is switched off?), connect. the TV aerial to the board and switch on all supplies. Tune in the television and a blank flickering raster should be present. Now proceed as follows: Turn RV1 fully clockwise. Adjust RV3 so that the blank raster is locked. Adjust RV2 until the whole display area brights up and set it at the mid point of its bright-up range. It may be necessary to adjust RV3 to keep the display steady. The central area of the screen should now be green. If not try re-tuning the TV. Adjust RV1 until the Cursor is visible at the bottom left. Enter VLIST and adjust RV1 to give the boldest lettering with no streaking. Any colour dot crawl can be tuned out with CV1. Produce colour bars by entering and running the following: 16 base c! : colourbars 2700 2400 do i 4 / 8 mod 10 * 80 or 2700 c! 20 i c! loop 87 2700 c! 0 2700 c! ;
Adjust RV3 to give the best range
of colours.
|
RESISTORS (all ¼ W 5%, unless stated) C20 220n R1 170k CV1 5-65p R2-5,8-13,15-21 SEMICONDUCTORS 23,27,32-34 1k0 (22 off) IC1 74LS14 R6,7 470 IC2 74LS27 R14 820 IC3 74LS30 R22,24 10k IC4 74LS174 R25 2k7 IC5 74LS279 R26 1K2 IC6 74LS86 R28 3k9 IC7 74121 R29 6k8 IC8 6116 R30,36 l5k IC9 74LS367 R31 33k IC10 74LS73 R35 3K3 IC11 74LS273 R37,38 2k2 IC12 74LS157 R39 1k8 IC13 74LS136 R40 3k6 IC14 LM1889 R41 220, ½W Q1-3,6,7 BC214L RV1 10k 10-turn preset Q4,5 BCl82L RV2,3 1k0 preset ZD1 4V7 zener, 500 CAPACITORS mW C1,22,25 470n 35V tant Dl 1N4148 C2,16 33p D2 IN4001 C3 l00p C4,10,15.17,23,24 10n MISCELLANEOUS C5 100u 6V3 X1 4.4336 MHz electrolytic crystal C6,7 12 1n0 UM1233 UHF modulator C8,11,14 47n 13-way 0.1" double sided edge C9,18,21 100n connector; 24-pin DIL socket C13 4n7 18-pin DIL socket;PCB;pins C19 100u 25V for link-through's (if preferred); electrolytic wire, etc. |
|
Software
In order to use the colour facilities within FORTH programs it is necessary to define the following words; decimal 16 base c! 2700 constant attriblatch 0 constant black 1 constant blue 2 constant red 3 constant purple 4 constant green 5 constant cyan 6 constant yellow 7 constant white 87 variable attrib : combine attrib c@ and or dup attrib c! attriblatch c! 0 attriblatch c! ; : ink f0 combine ; : paper 10 * 87 combine ;
By way of explanation, INK
and PAPER both expect a colour
number on the stack. They pass
this and a mask value to COMBINE
which masks out the old
colour and adds the new one. This
is stored in the variable ATTRIB
and also in the latch. Zero is then
written to the latch for the reasons
given earlier.
|
These words can now be used
directly by entering for example
white paper blue ink, or they can
be liberally sprinkled at the required
points in applications program's. If when you first turn on the screen is full of random colour blocks, do a CLS. This will write the current attribute (green on black) over the whole screen. Beware when you cause or allow a scroll operation to take place as this with also cause the current attribute to be written over the whole screen, wiping out,all the pretty colours and giving a uniform foreground and background. |
ETI April 1984 page 47
|
ETI April page 69
|
The original scanned pages form the magazine as a pdf. [8.99 Mb zip file] |