
TMC2376
PRODUCT SPECIFICATION
38
P
Programming Strategy
To program the internal registers, external firmware must
communicate with the TMC2376 via the R-bus. Several con-
trol bits must be set in the command registers and nine
parameter registers must be programmed with values derived
from auto-sense algorithms residing in firmware running on
a remote micro-controller or software residing on a host.
First, the command registers must be programmed with the
correct bits for D/A format, PAL/NTSC, filter modes, gains,
D/A power and A/D power. Next, TMC2376 internal regis-
ters must be read to retrieve the count of the number of
incoming TV lines and the length of each line measured in
4f
SC
clock cycles. Finally, based upon these register values,
the nine TMC2376 parameter registers can be programmed
with values extracted from lookup tables which contains reg-
ister values corresponding to common resolutions such as
640x400, 640x480, 800x600 and 1024x768.
Accessing the 10-bit registers via 8-bit data words over the
R-bus is discussed in the Serial Control Port section of this
data sheet.
Programming the Command Registers
For most applications, the two ten bit command registers,
CR and CRE can be programmed to set the video output for-
mat (RGB or CVBS, Y/C), video standard (PAL or NTSC)
and the flicker filter ON. Typical command register settings
are listed in Table 9.
Table 9. Command Register Setting
Zoom Mode
To set up the zoom mode, register 11, bit 2 must be set HIGH
while the value of IHAW must be half the normal setting.
For example, if the incoming video format is VESA
DMT7285 and the outgoing video standard is PAL, then
IHAW must be reduced from 750 to 375. Table 9 also shows
the settings for the zoom mode.
Read Only Registers
Incoming video timing and format can be estimated by inter-
rogating two registers:
IVC, Input Vertical Count.
The number of horizontal lines
between vertical sync pulses.
Once IVC is read, since the aspect ratio of the video is
known to be 4:3, the incoming resolution is known. Usually,
this will be 1024x768, 800x600, 640x480 or 640x400. Out-
side this range, the displayed image should default to the
internal test pattern, BiPGen. Note that IVC is a 10-bit regis-
ter, so 1280x1024 resolution will cause wrap around, leading
to an error that must be sensed by checked the line frequency
through IHC.
IHC, Input Horizontal Count.
The number of 4f
SC
ticks
between horizontal sync pulses. From IHC, the incoming
line rate can be estimated to enable the incoming sampling
rate to be set without overloading the capacities of line mem-
ories.
Note that since IHC is a 9-bit register, so long lines will
cause wrap around (see PAL VGA_m3), leading to an error
that must be corrected. If value in 0 < IHC < 128, assume
that the line count exceeds 512, then add 512 to the IVC
value to obtain the ‘correct’ IVC.
Programming the Parameter Registers
By analyzing data extracted from the IHC and IVC registers,
values can be derived to load the nine 10-bit parameter regis-
ters: IHO, IVO, IHAW, ILS, IHS, VSC, OHO, OVO and
HSC.
Prior to running the analysis, the two command registers CR
and CRE must be loaded to set the output video format and
output TV standard while defaults can be used for the other
bits.
Decision Tree
One straight forward way of implementing the TMC2376
programming firmware or software is solve several equations
to obtain values to be loaded into registers. However,
because linear solution of the equations is not possible, a
more efficient approach is to set up a decision tree to classify
incoming video timing by type.
First, lines per frame and line frequency of the incoming
video timing must be read from the TMC2376 IVC and IHC
registers. Next, these values are passed through the decision
tree to classify the timing. Once the type has been deter-
mined, corresponding values are downloaded to registers in
the PC-to-TV converter.
Based upon the values of IVC, IHC and PAL/NTSC, the pro-
cess of selecting one of 16 tables ripples through two levels
in a decision tree. IVC determines the incoming resolution.
There are four resolution categories:
Table 10. Resolution categories
After categorizing the resolution, the timing format is esti-
mated based upon the value of IHC. The ranges are as shown
in Table 11.
2366/76
Pointer
11,10
15,14
RGB
CVBS
PAL
RGB Zoom
PAL
PAL
0103h 0103h 0002h 0000h 0107h 0105h
0001h 0001h 0001h 0001h 0001h 0001h
NTSC
NTSC
NTSC
IVC min.
420
498
620
799
IVC max.
450
530
670
809
Resolution
640x400
640x480
800x600
1024x768