This is only a preview of the May 1997 issue of Silicon Chip. You can view 33 of the 96 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "NTSC-PAL Converter":
Items relevant to "Neon Tube Modulator For Cars & Light Systems":
Items relevant to "Traffic Lights For A Model Intersection":
Articles in this series:
Items relevant to "The Spacewriter: It Writes Messages In Thin Air":
Articles in this series:
Articles in this series:
Articles in this series:
Purchase a printed copy of this issue for $10.00. |
By Chris Schach & Braden Phillips*
*Chris Schach & Braden Phillips are the principals of Current Dynamics.
A Teletext decoder
for your PC
If you haven’t looked at it lately, there’s a
heap of information from all sorts of sources
on Teletext. Now you can display these
Teletext pages on your PC screen using this
standard card which plugs into your
motherboard. The software is Windows 95
and 3.1x compatible.
Imagine the scenario: you’re at your
computer and suddenly you’d like to
know the weather report on the Gold
Coast tomorrow or you need to check
some current share prices. Perhaps
you’d like to know the current Sheffield Shield cricket scores or you are
about to phone overseas and you’d
like to check the time in Vancouver
before you dial.
Or maybe, perish the thought,
6 Silicon Chip
you’ve had a little flutter on the horses
and you’d like to check the results.
You get the picture? Now if you
are at home and you have Teletext on
your TV, you can switch on the set
and wait for it to bring up the screen
you want. But there’s something a
bit decadent about having the TV on
while you are supposed to beavering away at the your computer, isn’t
there? Wouldn’t it be so much more
convenient to click on the Teletext
icon and select the page you want
from the control panel? Well, now
you can do just that with this Teletext
card for a PC.
The Teletext card occupies a standard 8-bit slot in your computer and it
comes with Windows software on a
floppy disc. The only other hardware
you need is a VCR – that feeds the offair video signal to the Teletext card
for processing.
By using a standard VCR as the
source of off-air video, the Teletext
card is much cheaper and less complicated since it does not need on-board
TV tuners (VHF & UHF) and all the
associated video circuitry.
You need to set the VCR to the
station you want (generally one of
the Seven Network stations carrying
Teletext) and then connect its video
output to the Teletext card via a cable
This Teletext decoder card plugs into a
spare ISA slot on your PC. An interrupt
is not required; instead, it communicates
using polling over a small amount of I/O
address space.
fitted with an RCA phono socket. Your
VCR’s video output may use a BNC or
RCA socket so you will need a cable
to match.
By the way, the VCR you use only
needs to have its video functions
working; if it doesn’t work in playback
or record that is unimportant. So you
could use a VCR with a dud transport
for the job.
Noise-free TV signal
We should point out that you will
need a good TV antenna or at least,
a good noise-free source of off-air TV
signals otherwise you won’t get to first
base. If your present TV reception is
snowy, you will not get reliable Teletext reception, regardless of whether
you are using this Teletext PC card
or your TV itself has built-in Teletext
facilities.
Note that your PC doesn’t need to be
a Pentium-based machine. The software runs under Windows 95 or 3.1x
and can be on a 486 or 386 machine.
All the Teletext processing is done
on the card itself and does not involve the PC. Nor does the Teletext
card require a PC hardware interrupt,
something that can be hard to find on
today’s feature-loaded machines. Instead, the Teletext card communicates
using polling over a small amount of
I/O address space.
Nor does the PC need to store
Teletext pages. The Teletext card
captures and stores the pages, using
an on-board microprocessor and static
RAM (SRAM).
The PC card itself is half-size. It
is double-sided with plated-through
holes and uses conventional ICs,
transistors and passive components.
One IC is mounted in a chip carrier
socket. No surface-mount components are used so you don’t have to
worry on that score. You will need a
temperature controlled soldering iron
with a small tip.
On-screen features
The software supplied with the
Teletext card runs under Windows,
as already mentioned. To install the
software you run Setup.exe and then
follow the bouncing ball. Actually,
you don’t follow a bouncing ball;
you follow the on-screen prompts. By
default, the software is installed in a
folder (directory) called “Teletext”
and, for Windows 95, an appropriate
entry is added to the Start menu.
Alternatively, for Windows 3.1x, the
relevant icons are added to the Program Manager.
Launching the program brings up
the Teletext control panel, as can be
seen in one of the screen grabs accompanying this article. The control panel
defaults to page 100 and it brings up
a Teletext window with the message
“The requested page has not yet been
captured ...”
Meanwhile, the page counter in
the control panel ticks over to show
its progress. By the way, as each page
comes in, it is stored in the buffer
which is virtual memory; ie, on the
hard disc. Ultimately, all Teletext
pages are stored in this way and so
May 1997 7
any page can be accessed almost instantaneously. This is a big advance
on Teletext in normal TV sets because
they don’t have a buffer and you have
to wait for the wanted page to be transmitted before you can see it on screen.
Once the wanted pages are in the
buffer, you can display as many
Teletext windows as you want on
screen. You can also print them out,
on virtually any printer.
You can also elect to save the buffer
(to a directory on the hard disc) and
you can thereby display those pages
on screen at any time, long after they
have ceased to be transmitted.
So there you have it. This Teletext
card enables you to access and display
more pages than you could with a
normal TV and you have the bonus
of storing and printing out countless
pages, if you wish.
8 Silicon Chip
There are two differences to be
noted between those Teletext pages
displayed on your PC’s screen and
those displayed on a normal TV. First,
because of the resolution of a VGA
screen, the Teletext pages on your PC
will be sharper than those on your TV.
Not that there’s a real benefit but they
are sharper.
Second, while Teletext pages normally have the same 4:3 aspect ratio as
a normal TV screen, when displayed
on your PC, they are somewhat squarer. That too is immaterial and is an
effect of the software.
OK, so you now know what the
Teletext card does. Let’s have a brief
look at the circuit details.
Circuit details
As you may be aware, Teletext
signals are sent during the vertical
blanking interval of a normal off-air
TV signal. If you roll the picture up,
you will see several bright lines of
ever-changing data embedded in the
vertical blanking bar. The data is
mainly text and single graphics.
The data is normally decoded by the
TV set and reconstituted into pages
on the screen. Up to 800 or so pages
can be transmitted and they are sent
in sequence. The time to access a par
ticular page off air depends on where
it is in the sequence and how recently
it was sent. It can take several minutes
for a page to be captured.
The Teletext data signal comes in
at high speed, with a serial bit rate
of 6.9375MHz. This, coupled with
Fig.1 (right): the Teletext decoder
extracts ASCII text and graphics from
an off-air composite video signal,
usually from a VCR. The data is
stripped from the video signal using
video slicer U6 and then processed in
U3 under the control of U1, the PIC
microprocessor.
This screen capture shows how the Teletext Control Panel and the Teletext
window appear on the Windows 95 desktop. You can open as many Teletext
windows as you like and all incoming pages are stored in a buffer for quick
access. The buffer can also be saved to the hard disk and the pages printed out.
May 1997 9
Open
a new
teletext
window
Close the
active
teletext
window
Reveal
hidden
text
the need for other high speed digital
processing of the Teletext signal, requires specialised hardware so that
the microprocessor only needs to take
on a coordinating and hence relatively
low-speed role. An XILINX FPGA, U3,
was chosen to do the job. FPGA stands
for Field Programmable Gate Array.
U3 is controlled by the PIC16C57
microprocessor and stores its data in
an HM62256 static RAM, U4.
The interface between the PC and
the card consists of a GAL20V8 logic
array, U5, and two 74HC373 Tri-state
buffers, U2 & U8 (note: GAL stands for
Generic Array Logic). Data from the
PC is latched into U8 when the PC
writes to one of the four I/O addresses
stored in the GAL and selected by the
jumpers JP1 & JP2. The PIC1657 reads
the data by enabling the outputs of
U8 and it can write data to the PC by
latching it into U2. The PC can read
this latch at any time by reading from
the correct I/O address.
10 Silicon Chip
Display Capture
the next page 100
sub page
now
Load a
buffer
from file
Save the
buffer to
a file
Empty
the
buffer
The PIC16C57 microprocessor contains 2048 words of on-board program
space and 72 bytes of on-board RAM.
In addition, it contains 20 I/O lines
and can operate at cycle times as low
as 200ns. It is used as the interface
between the data capture hardware
and the PC. It accepts commands from
the PC and responds appropriately
with actions and/or data.
For example, if the PC wants a specific page of Teletext, it will issue the
appropriate command word to the PIC
followed by the page number. The PIC
will set the SRAM address to 0 and
then initiate a Teletext line capture.
When the line capture is complete,
the PIC will check to see if the line
was a valid header row, in which case
it will check to see if it is from the
required page.
If not, it will reset the SRAM address and continue looking. When the
correct header line is found, the PIC
will continue capturing and storing
Print
teletext
page xxx
Stop
autocapture
Quit the
teletext
viewer
lines until it comes across another
line 0. Another line 0 means that a
full page has been received and the PC
can be notified that the page capture
is complete.
Data slicer
A Philips SAA5231 data-slicer, U6,
is used to extract the Teletext clock
and data signal from the incoming
video signal. The clock and data
outputs from this IC must be level
shifted to produce TTL signals. This is
accomplished using transistors Q1 &
Q2 and a dual high-speed comparator,
U7. The comparators use the average
of the incoming clock signal as their
reference, eliminating drift problems
possible with a fixed reference.
The level-shifted signals then go
directly to the FPGA. The 5231 needs
a “sandcastle” input which must stay
low for 8.5µs after the start edge of a
video sync pulse. This is generated
via a counter in the FPGA.
Fig.2: the parts are installed on the PC board and tested in stages, as detailed in
the article. Make certain that all parts are correctly oriented before soldering their
leads, as this is a double-sided board with plated-through holes.
The FPGA uses volatile configuration data and must be reconfigured after each power up. The configuration
data is sent from the PC to the FPGA
via the PIC in a serial data stream. The
whole configuration process takes a
fraction of a second.
The Teletext data signal is fed to an
8-bit shift register whose outputs can
be enabled onto the SRAM’s data bus.
An 8-bit comparator is also attached
to the outputs which produces a sync
signal whenever the line sync byte
appears. This sync signal is used to
reset both the bit counter and the byte
counter at the start of a line and also to
set the line capture process in motion.
When a line capture is in progress,
the SYNC REC output will indicate that fact to the PIC. As the bit
counter clocks over each time, the
byte currently in the shift register is
written to the SRAM at the location
pointed to by an address counter also
contained in the FPGA and both the
address counter and byte counter
are incremented by 1. When the byte
count reaches 43, the line capture is
complete and SYNC REC will go low.
The upper eight bits of the 11-bit
May 1997 11
address counter can be set by the
PIC before a line capture takes place.
The PIC can read the contents of the
SRAM by asserting _READ which
enables both the SRAM output buffers and connects the microprocessor
and memory data busses through
the FPGA. The PIC increments the
address counter by asserting the CLK
signal.
Construction
Begin by inspecting the double
sided PC board carefully for short
circuits or broken tracks, being especially careful in areas that will be
concealed by components. Fix any
problems as necessary using solder or
a sharp knife. The metal bracket can
be mounted at this stage, adjusting the
alignment as necessary to suit your
computer’s expansion slot.
The suggested way of assembly is to
progressively populate the board, testing as you proceed. This is made easy
though a program called TT_TEST
included on the installation discs.
Ensure that each of the test options
are run in sequence each time the
program is restarted to ensure that the
Teletext card is properly initialised.
The first components to install
are the GAL20V8 (U5), C18, R9, R10
and JP1&2 which form a sub-circuit
responsible for I/O address decoding.
The first two test program options
enable the reset line (U5 pin 21) to be
toggled between 0V and +5V respec
tively. Choose these options and use
a multimeter to make sure the reset
line behaves as expected. When this
part of the circuit works, proceed to
the next stage.
The PIC16C57 microprocessor (U1),
Where To Buy A Kit
This Teletext decoder was designed by Current Dynamics who own the design
and software copyright. The kit will include a high quality double-sided PC board
with plated-through holes, screen printed component overlay and green solder
mask, all components, 3.5-inch 1.44MB installation discs and instructions. The
discs will include the full Windows Teletext viewing software, a test program and
some example C source code for those who wish to develop their own software.
The complete kit is priced at $150 plus $5 for postage within Australia. For postage to New Zealand, add an extra $7.00 (Australian dollars). Remittances may
be sent by bank cheque, money order, Visa, Bankcard or Mastercard.
Current Dynamics can be contacted by phoning (08) 8303 3349 or by fax on
(08) 8303 4363; email currentd<at>ozemail.com.au or http://www.ozemail.com.
au/~currentd
Send mail orders to Current Dynamics, 37 Queen Street, Thebarton, SA 5031.
12 Silicon Chip
X1, C8, C22, R8, C17, C19 and the
74HC373s (U2 & U8) are next. Anoth
er test option enables the function of
this section to be verified by a simple
command/echo sequence between the
PC and the PIC. It also has the effect of
ensuring that both the PC and the PIC
have synchronised “clock” variables.
Now for the XILINX2064-68PC (U3).
Be careful to ensure correct device
and socket orientation. The bevelled
corners on the socket and overlay
should be aligned. Also, the pin 1 dot
on the IC should be aligned with the
white legend dot on the PC board. Be
warned that once the IC is inserted,
it can be difficult to remove without
a special tool.
Next, solder in C15, C16, R7 and
the RAM (U4). To check this section
of the circuit a test routine has been
developed which sends a configuration to the FPGA. If this operation
is completed successfully we can
be fairly sure the FPGA is alive and
well and communicating with the
microprocessor and the PC.
The next task is to test the RAM. A
difficulty here is that the FPGA only
writes to the RAM when it is receiving Teletext. Therefore, the best we
can do is use a test routine to read
the entire contents of the RAM and
then check to see that it is stable by
reading it again.
The remaining components can
now be inserted. At this point, a suitable video signal is required. For most
constructors, this will mean access
to the video output of a VCR tuned
SILICON
CHIP
This page is blank because
it contained advertising
which is now out of date
and the page has been
removed to prevent
misunderstandings.
to a channel with a Teletext service (Channel 7 or 10 in
Australia). To be sure that the video signal is of sufficient
quality, it is wise to monitor the picture quality on a TV
while your computer is running.
A computer can be a significant cause of noise input
to an RF television signal, so it is important to keep
your antenna and your computer well separated. Picture
quality needs to be reasonably good with little “snow”.
Moderate ghosting does not usually cause many errors
in Teletext pictures.
The final test routine will verify that the Teletext data
and clock lines are active. The test will look for sync
characters present at the start of each Teletext line. A
video signal must be present for this test to pass.
Acknowledgement: all Teletext screen grabs in this article
SC
reproduced courtesy Austext, Channel 7.
May 1997 13
|