TVP5020 NTSC/PAL Video Decoder Programming for the VIP Host Interface
Total Page:16
File Type:pdf, Size:1020Kb
TVP5020 NTSC/PAL Video Decoder Programming for the VIP Host Interface Application Report March 1999 Mixed-Signal Products SLAA054 IMPORTANT NOTICE Texas Instruments and its subsidiaries (TI) reserve the right to make changes to their products or to discontinue any product or service without notice, and advise customers to obtain the latest version of relevant information to verify, before placing orders, that information being relied on is current and complete. All products are sold subject to the terms and conditions of sale supplied at the time of order acknowledgement, including those pertaining to warranty, patent infringement, and limitation of liability. TI warrants performance of its semiconductor products to the specifications applicable at the time of sale in accordance with TI’s standard warranty. Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty. Specific testing of all parameters of each device is not necessarily performed, except those mandated by government requirements. CERTAIN APPLICATIONS USING SEMICONDUCTOR PRODUCTS MAY INVOLVE POTENTIAL RISKS OF DEATH, PERSONAL INJURY, OR SEVERE PROPERTY OR ENVIRONMENTAL DAMAGE (“CRITICAL APPLICATIONS”). TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED, AUTHORIZED, OR WARRANTED TO BE SUITABLE FOR USE IN LIFE-SUPPORT DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS. INCLUSION OF TI PRODUCTS IN SUCH APPLICATIONS IS UNDERSTOOD TO BE FULLY AT THE CUSTOMER’S RISK. In order to minimize risks associated with the customer’s applications, adequate design and operating safeguards must be provided by the customer to minimize inherent or procedural hazards. TI assumes no liability for applications assistance or customer product design. TI does not warrant or represent that any license, either express or implied, is granted under any patent right, copyright, mask work right, or other intellectual property right of TI covering or relating to any combination, machine, or process in which such semiconductor products or services might be or are used. TI’s publication of information regarding any third party’s products or services does not constitute TI’s approval, warranty or endorsement thereof. Copyright 1999, Texas Instruments Incorporated Contents 1 Introduction . 1 2 Hardware Platform . 2 2.1 VIP Master FPGA . 2 2.1.1 FPGA Reset Procedure. 2 2.1.2 TVP5020 Write Procedure. 3 2.1.3 TVP5020 Read Procedure. 3 3 Program Overview . 5 3.1 Board-Specific and Microcontroller-Specific Code. 6 3.2 Header File: REG652.H . 7 3.3 Source Code Modules . 9 4 Program Description . 10 4.1 Source Code Module: Main . 10 4.1.1 Inclusion of TVP5020 Microcode Files (Lines 11–14). 10 4.1.2 Function: Main() . 10 4.1.3 Function: PowerUpInitialization(). 12 4.1.4 Function: Patch TVP5020 Registers(). 13 4.2 Header File: Main.H . 13 4.3 Source File: MAIN.C . 14 4.4 Source Code Module: I2C . 17 4.4.1 Function: Initia_i2c() (Lines 28–41). 17 4.4.2 Function: start_i2c(). 17 4.4.3 Function: i2c_isr() (Lines 77–266). 17 4.5 Header File: I2C.H . 19 4.6 Source File: I2C.C . 20 4.7 Source Code Module: Timer. 26 4.7.1 Function: timer0_isr() (Lines 26–59). 26 4.7.2 Function: timer0_initialize() (Lines 61–94). 26 4.7.3 Function: ResetTickCount() (Lines 96–112). 26 4.7.4 Function: current_tick() (Lines 114–131). 26 4.7.5 Function: timer0_elapsed_count() (Lines 133–150). 26 4.7.6 Function: timer0_wait() (Lines 152–167). 26 4.8 Header File: Timer.H . 27 4.9 Source File: TIMER.C . 28 4.10 Source Code Module: VIP5020. 31 4.10.1 Function: DecoderReset() (Lines 22–35). 31 4.10.2 Function: HandleDownload() (Lines 37–77). 32 4.10.3 Function: WriteTVP5020() (Lines 79–92). 32 4.10.4 Function: GetControlByte() (Lines 94–132). 32 4.10.5 Function: WriteTVP5020VIP() (Lines 134–170). 33 4.10.6 Function: ReadSwitch() (Lines 172–189). 33 4.10.7 Function: ReadTVP5020() (Lines 192–257). 33 4.10.8 Function: ReadTVP5020VIP1() (Lines 259–294). 33 4.10.9 Function: ReadTVP5020VIP2() (Lines 295–328). 33 4.11 Header File: VIP5020.H . 34 4.12 Header File: VIP5020.C . 35 4.13 Source Code Module: I2C6000. 42 4.13.1 Function: read_tvp6000() (Lines 23–40). 42 4.13.2 Function: write_tvp6000() (Lines 41–50). 42 4.13.3 Function: LoadTVP6000() (Lines 52–75). 42 TVP5020 NTSC/PAL Video Decoder iii Figures 4.13.4 Function: PatchTVP6000() (Lines 77–97. 42 4.14 Header File: I2C6000.H . 43 4.15 Source File: I2C6000.C . 44 4.16 TVP6000 Initialization Data for NTSC with CCIR601 Sampling. 46 4.17 TVP6000 Initialization Data for NTSC with Square Pixel Sampling. 47 4.18 TVP6000 Initialization Data for PAL with CCIR601 Sampling. 48 4.19 TVP6000 Initialization Data for PAL with Square Pixel Sampling. ..