// Example C Code for setting up WSS/CGMS Line Mode Registers
//
// Load C-RAM
//
// NTSC WSS/CGMS Line Mode setup for line 20 of both fields
I2CWriteByte(TVP5154A, 0xEC, 0x09);
// line 20 field 1 (0xEC), mode bits = 0x09
I2CWriteByte(TVP5154A, 0xED, 0x09);
// line 20 field 2 (0xED), mode bits = 0x09
I2CWriteByte(TVP5154A, 0xCB, 0x4E);
// Set Pixel Alignment [7:0]to 0x4E
I2CWriteByte(TVP5154A, 0xCC, 0x00);
// Set Pixel Alignment [9:8]to 0x00
// PAL WSS/CGMS Line Mode setup for line 23 (source input) of both fields.
// PAL line numbering has 3 line offset so the Line 26 line mode registers are used.
I2CWriteByte(TVP5154A, 0xF8, 0x08);
// line 26 field 1 (0xF8), mode bits = 0x08
I2CWriteByte(TVP5154A, 0xF9, 0x08);
// line 26 field 2 (0xF9), mode bits = 0x08
I2CWriteByte(TVP5154A, 0xCB, 0x4E);
// Set Pixel Alignment [7:0]to 0x4E
I2CWriteByte(TVP5154A, 0xCC, 0x00);
// Set Pixel Alignment [9:8]to 0x00
Line Mode Registers
www.ti.com
relative to actual PAL line numbers. For PAL systems, the Line Mode register for line “N+3” must be used
to configure a data service transmitted on line N of the input source.
shows example C code for
configuring WSS/CGMS data services for NTSC and PAL. Included in this example is an I
2
C write to the
Pixel Alignment Registers (CBh-CCh), which define the horizontal position where data slicing begins. The
value used (4Eh) is recommended for all data services.
Table 3. Line Mode Configuration Bits for Supported Modes
Line Mode Register
Name
Video Line Number
Description
(D0h-FCh) Bits [3:0]
0000b
WST SECAM
6-23 (field 1, 2)
Teletext, SECAM
0001b
WST PAL B
6-22 (field 1, 2)
Teletext, PAL, System B
0010b
WST PAL C
6-22 (field 1, 2)
Teletext, PAL, System C
0011b
WST, NTSC B
10-21 (field 1, 2)
Teletext, NTSC, System B
0100b
NABTS, NTSC C
10-21 (field 1, 2)
Teletext, NTSC, System C
0101b
NABTS, NTSC D
10-21 (field 1, 2)
Teletext, NTSC, System D (Japan)
0110b
CC, PAL/SECAM
22 (field 1, 2)
Closed caption PAL/SECAM
0111b
CC, NTSC
21 (field 1, 2)
Closed caption NTSC
1000b
WSS/CGMS, PAL/SECAM
23 (field 1, 2)
Wide-screen signal, PAL/SECAM
1001b
WSS/CGMS, NTSC
20 (field 1, 2)
Wide-screen signal, NTSC
1010b
VITC, PAL/SECAM
6-22
Vertical interval timecode, PAL/SECAM
1011b
VITC, NTSC
10-20
Vertical interval timecode, NTSC
1100b
VPS, PAL
16
Video program system, PAL
1101b
EPG/Gemstar
Electronic program guide - Custom mode
1110b
x
x
Reserved
1111b
Active Video
Active Video
Active video/full field
Figure 3. Line Mode Setup for WSS/CGMS
6
TVP5154A VBI Quick Start
SLEA104 – July 2010
Copyright © 2010, Texas Instruments Incorporated