Video Controller
19.5.1.1 NTSC PROGRAMMING PROCEDURE EXAMPLE. Use the following procedure
to program your video controller using an ADV7176 video encoder in slave mode with video
data in CCIR 4:2:2 format. A clock crystal provides 27MHz to CLK. Our website
(www.motorola.com) has a comprehensive example that includes using I
ADV7176.
• Program the VBCB register with the components of the background video. For a black
background, write 0x80108010 to the VBCB register.
• Program 0x07805A5A to the VFCR1. It defines a field of 240 lines and each line
consists of 90 bursts of data. There is a GAP1 of one line (90 bursts) long between two
consecutive lines due to interlace mode.
• Program the start address of the odd field to VFAA1 register.
• Program the start address of the even field to VFBA1 register. This address must be
equal to VFAA1 address+0x5A0.
• Use Table 19-1 to configure the video controller RAM array.
• Write 0x02 to the VCMR to select RAM_1 and FIFO register set 1 as the active set.
• Reset the ADV7176 and program the default NTSC settings, except for mode register
1 (0x02), timing register 0 (0x02), and mode register 2 (0x08).
• Convert your data to CbYCrY format for the ADV7176. Assuming each color ranges
between 0 and 100, use the following equations to convert from RGB to YC
ADV7176:
void SetPixelRGB (int col, int row, PALLETE color)
{
int location;
VYUY *address;
location = screen.burstlength * (row+25) + ((col+55) / 2*4);
address = (VYUY *) (location + (int) screen.base);
if (col % 2)
{
address -> Y1 = 209 * (color.red + color.green + color.blue) / 300 +16
address -> V = color.blue - color.red/4 - color.green*3/4 = 128;
}
else
{
address -> Y2 = 209 * (color.red + color.green + color.blue) / 300 + 16
address -> U = color.red - color.green*3/4 - color.blue/4 + 128;
}
}
• Program 0x2043 to the VCCR to operate the video controller.
19-22
MPC823e REFERENCE MANUAL
2
C to program the
C
for the
r
b
MOTOROLA