<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Wed, 10 Feb 2010 01:11:58 +0000
From   : philpem@... (Philip Pemberton)
Subject: Ground Control UTA-1 Teletext Receiver: The Gory Details

Hi guys,

I've been doing a bit of reverse-engineering this evening... I hacked my 
copy of the RPCEmu RiscPC emulator to log I2C requests, and ran the 
driver for the Ground Control Teletext interface (or rather Rick 
Murray's !Teletext) inside it. Miraculously it worked well enough to get 
some useful protocol traces. I've figured out a few of the unknowns 
about the hardware, which I just happen to feel like sharing with you 
lucky folk :)

Note that this is the first time (that I know of) that the UTA-1's 
secrets have been publicly disclosed...


== Hardware =
There are two (known) versions of the Universal Teletext Adapter: the 
UTA-1, and the UTA-3. Both devices are based on (essentially) the same 
chipset, but differ in the tuners used to receive the signal:

   * The UTA-1 uses a Mullard "dumb tin-can" tuner and a Philips SAB3036 
"CITAC" chip. The CITAC feeds a 32V tuning voltage to the tuner can, 
which adjusts the frequency of the tuner. This tuning voltage is 
controlled by a frequency-locked loop in the CITAC. The CITAC is 
accessed via the I2C bus.

   * The UTA-3 uses an all-in-one tuner module, which sits directly on 
the I2C bus. The CITAC (or a similar part) is inside the tuner can.

There's a page on Rick Murray's website which has annotated photos of 
the UTA circuit boards, and some info on cabling. See 
<http://www.heyrick.co.uk/software/ttx/ttxcirc.html>.

Both versions of the UTA have three ports on the front -- the antenna 
socket, the Aux port (which carries composite video and mono audio), and 
the Data port. The latter carries I2C clock, I2C data, and ground. 
Annoyingly, Ground Control used the same connector for both sockets -- a 
5-pin 180-degree DIN. This makes it easy to mix up the two connectors...

Pinouts for both ports are on Rick Murray's website, see above link, 
then select "How It Works".

Both UTAs appear to use a Philips EuroCCT Teletext receiver. The UTA-1 
uses an SAA5240 EuroCCT with an SAA5231 VIP (data slicer). The UTA-3 
uses an SAA5243 EuroCCT with the same VIP chip. Programming of these ICs 
is essentially identical; the VIP is not present on the IIC bus, but the 
SAA524x is. The SAA524x is accessed using I2C addresses 0x22 and 0x23.

== Tuning the UTA-1 =
To tune the UTA-1 to a given frequency, you first need to initialise the 
tuner module. This should be done every time the frequency is changed 
(just in case the UTA has been power-cycled between the last and current 
tuning events).

To initialise the UTA, send the following:
   s C0 29 0D p

s = "I2C Start"
p = "I2C Stop"
[0-9A-F][0-9A-F] = a hexadecimal byte to send

This sets:
   Tuner current -- Imax=875mA, ITmin = 250uA us, delta-VtunMax 250uV
   Tuning window -- 100kHz

Now we need to do some maths.
If you're tuning based on a UHF Channel number (from 21 to 69):
   TunerValue = ((ChannelNum * 160) + 6848)

If you're tuning based on a frequency (the centre frequency):
   TunerValue = (UHFFreq / 50) + 728

If you're tuning based on a frequency (the vision carrier frequency):
   TunerValue = (UHFFreq / 50) + 783

Now take TunerValue and OR it with 0x8000 -- that is, set the most 
significant bit. This is the "Instruction" bit for the CITAC. Split it 
up into two bytes, then send them to the CITAC like this:

   s C0 aa bb p

s = "I2C start"
p = "I2C stop"
C0 = CITAC write address
aa = (TunerValue >> 8)    -- the most  significant byte of TunerValue
bb = (TunerValue & 0xff)  -- the least significant byte of TunerValue

If you want to find out if the tuner has locked on, then you need to 
read the CITAC's status register. This is done as follows:

   s C1 g p

s = "I2C Start"
p = "I2C Stop"
g = "I2C Read" without ACK
C1 = CITAC read address

Take the byte returned in "g", and if the most-significant bit (0x80) is 
set, then the tuner is locked. If it's clear, the tuner is unlocked.


== Tuning the UTA-3 =
See "How it Works: Ground Control Teletext Adapter" 
(<http://www.heyrick.co.uk/software/ttx/ttxcirc.html>).


== Programming the SAA5240/SAA5243 =
I need to get hold of a copy of the SAA5240 User's Manual before I can 
write this section.... anyone have a spare copy to sell or donate? It 
doesn't seem to have been scanned and put online (though IIRC, parts of 
the SAA5243 manual were uploaded to someone's Freeserve homepage a while 
ago).

The SAA5243 is, to the best of my knowledge, near identical to the 
SAA5240 (from a programming perspective).

Note that the UTAs only have 2K of RAM, and operate in Ghost Row mode. 
A0-A9 are wired to the RAM as-is, A10 and A11 are (typically) 
open-circuit, and A12 is wired to A10 on the RAM. This allows the 
EuroCCT to save the extended Teletext packets into the RAM where A12=1. 
This allows the EuroCCT to save data related to e.g. Fastext page links.

Unfortunately this also means that while the SAA524x chips can grab four 
pages of Teletext at a time, the limited RAM available (and its address 
wiring) means you can only grab a single Teletext page at a time on the UTA.


-----8<------

Comments (and constructive criticism) gratefully received. A copy of the 
SAA5240 manual (PDF or dead tree) would be even more gratefully received 
(hint hint) :)

Cheers,
-- 
Phil.
philpem@...          
http://www.philpem.me.uk/
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>