1The Radiotrack radio driver
2===========================
3
4Author: Stephen M. Benoit <benoits@servicepro.com>
5
6Date:  Dec 14, 1996
7
8ACKNOWLEDGMENTS
9----------------
10
11This document was made based on 'C' code for Linux from Gideon le Grange
12(legrang@active.co.za or legrang@cs.sun.ac.za) in 1994, and elaborations from
13Frans Brinkman (brinkman@esd.nl) in 1996.  The results reported here are from
14experiments that the author performed on his own setup, so your mileage may
15vary... I make no guarantees, claims or warranties to the suitability or
16validity of this information.  No other documentation on the AIMS
17Lab (http://www.aimslab.com/) RadioTrack card was made available to the
18author.  This document is offered in the hopes that it might help users who
19want to use the RadioTrack card in an environment other than MS Windows.
20
21WHY THIS DOCUMENT?
22------------------
23
24I have a RadioTrack card from back when I ran an MS-Windows platform.  After
25converting to Linux, I found Gideon le Grange's command-line software for
26running the card, and found that it was good!  Frans Brinkman made a
27comfortable X-windows interface, and added a scanning feature.  For hack
28value, I wanted to see if the tuner could be tuned beyond the usual FM radio
29broadcast band, so I could pick up the audio carriers from North American
30broadcast TV channels, situated just below and above the 87.0-109.0 MHz range.
31I did not get much success, but I learned about programming ioports under
32Linux and gained some insights about the hardware design used for the card.
33
34So, without further delay, here are the details.
35
36
37PHYSICAL DESCRIPTION
38--------------------
39
40The RadioTrack card is an ISA 8-bit FM radio card.  The radio frequency (RF)
41input is simply an antenna lead, and the output is a power audio signal
42available through a miniature phone plug.  Its RF frequencies of operation are
43more or less limited from 87.0 to 109.0 MHz (the commercial FM broadcast
44band).  Although the registers can be programmed to request frequencies beyond
45these limits, experiments did not give promising results.  The variable
46frequency oscillator (VFO) that demodulates the intermediate frequency (IF)
47signal probably has a small range of useful frequencies, and wraps around or
48gets clipped beyond the limits mentioned above.
49
50
51CONTROLLING THE CARD WITH IOPORT
52--------------------------------
53
54The RadioTrack (base) ioport is configurable for 0x30c or 0x20c.  Only one
55ioport seems to be involved.  The ioport decoding circuitry must be pretty
56simple, as individual ioport bits are directly matched to specific functions
57(or blocks) of the radio card.  This way, many functions can be changed in
58parallel with one write to the ioport.  The only feedback available through
59the ioports appears to be the "Stereo Detect" bit.
60
61The bits of the ioport are arranged as follows:
62
63.. code-block:: none
64
65	MSb                                                         LSb
66	+------+------+------+--------+--------+-------+---------+--------+
67	| VolA | VolB | ???? | Stereo | Radio  | TuneA | TuneB   | Tune   |
68	|  (+) |  (-) |      | Detect | Audio  | (bit) | (latch) | Update |
69	|      |      |      | Enable | Enable |       |         | Enable |
70	+------+------+------+--------+--------+-------+---------+--------+
71
72
73====  ====  =================================
74VolA  VolB  Description
75====  ====  =================================
760	 0  audio mute
770	 1  volume +    (some delay required)
781	 0  volume -    (some delay required)
791	 1  stay at present volume
80====  ====  =================================
81
82====================	===========
83Stereo Detect Enable	Description
84====================	===========
850			No Detect
861			Detect
87====================	===========
88
89Results available by reading ioport >60 msec after last port write.
90
91  0xff ==> no stereo detected,  0xfd ==> stereo detected.
92
93=============================	=============================
94Radio to Audio (path) Enable	Description
95=============================	=============================
960				Disable path (silence)
971				Enable path  (audio produced)
98=============================	=============================
99
100=====  =====  ==================
101TuneA  TuneB  Description
102=====  =====  ==================
1030	0     "zero" bit phase 1
1040	1     "zero" bit phase 2
1051	0     "one" bit phase 1
1061	1     "one" bit phase 2
107=====  =====  ==================
108
109
11024-bit code, where bits = (freq*40) + 10486188.
111The Most Significant 11 bits must be 1010 xxxx 0x0 to be valid.
112The bits are shifted in LSb first.
113
114==================	===========================
115Tune Update Enable	Description
116==================	===========================
1170			Tuner held constant
1181			Tuner updating in progress
119==================	===========================
120
121
122PROGRAMMING EXAMPLES
123--------------------
124
125.. code-block:: none
126
127	Default:        BASE <-- 0xc8  (current volume, no stereo detect,
128					radio enable, tuner adjust disable)
129
130	Card Off:	BASE <-- 0x00  (audio mute, no stereo detect,
131					radio disable, tuner adjust disable)
132
133	Card On:	BASE <-- 0x00  (see "Card Off", clears any unfinished business)
134			BASE <-- 0xc8  (see "Default")
135
136	Volume Down:    BASE <-- 0x48  (volume down, no stereo detect,
137					radio enable, tuner adjust disable)
138			wait 10 msec
139			BASE <-- 0xc8  (see "Default")
140
141	Volume Up:      BASE <-- 0x88  (volume up, no stereo detect,
142					radio enable, tuner adjust disable)
143			wait 10 msec
144			BASE <-- 0xc8  (see "Default")
145
146	Check Stereo:   BASE <-- 0xd8  (current volume, stereo detect,
147					radio enable, tuner adjust disable)
148			wait 100 msec
149			x <-- BASE     (read ioport)
150			BASE <-- 0xc8  (see "Default")
151
152			x=0xff ==> "not stereo", x=0xfd ==> "stereo detected"
153
154	Set Frequency:  code = (freq*40) + 10486188
155			foreach of the 24 bits in code,
156			(from Least to Most Significant):
157			to write a "zero" bit,
158			BASE <-- 0x01  (audio mute, no stereo detect, radio
159					disable, "zero" bit phase 1, tuner adjust)
160			BASE <-- 0x03  (audio mute, no stereo detect, radio
161					disable, "zero" bit phase 2, tuner adjust)
162			to write a "one" bit,
163			BASE <-- 0x05  (audio mute, no stereo detect, radio
164					disable, "one" bit phase 1, tuner adjust)
165			BASE <-- 0x07  (audio mute, no stereo detect, radio
166					disable, "one" bit phase 2, tuner adjust)
167