This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Support for PAL interfacing with C6748 EVM Facedetect Demo program ..!!

Other Parts Discussed in Thread: CDCE913, TVP5147

Hello,


I have developed our own customized board, which is moreover same as per C6748 LCDK.

And we have added Composite Video Out peripheral and taken its design as per C6748 EVM.

And we have NOT incorporated CDCE913 and port expander. we are running it directly.

And we want to work Face detect DEMO example from C6748 EVM with our board.

My Composite input is CAMERA and camera type is PAL.

So, can anybody please help me to change the code accordingly.??

Because the demo program is made for EVM is for NTSC input/output. and code is mapped with I2C section line and port expander..!

We are still not able to test Composite out with our design,

Looking forward to get answer for Demo Face detect example change as per PAL interfacing and without CDCE913 and port expander

Thanks,

Ketan Patel

  • Hi Ketan,

    Thanks for your post.

    If your camera capture and display supports PAL standard, you shall modify the mode to PAL passed as arguments thru. the API calls VPIFCaptureModeConfig() & VPIFDisplayModeConfig() while you intialize capture thru. SetUpVPIFRx() and initialize display thru. SetUpVPIFTx(). You shall check the #define macros in the include file vpif.h and the file shall be located in PDK package installation path as below:

    ~\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\include\vpif.h

    In the above file, you shall add new supporting mode for PAL as #define macro and the value shall be passed to VPIFCaptureModeConfig/VPIFDisplayModeConfig. API's to select mode of capture/display.

    By this way, we shall change the Face detect demo code to interface for PAL camera type.

    The above changes in the face detect demo will be reflected in the source file facedetect_evmC6748.c and the file shall be found in the below installation path:

    ~\c6sdk_02_00_00_00\demos\facedetect\src\facedetect_evmC6748.c

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------

  • Hello..!

    thanks for quick reply..!

    I have already made changes as per http://e2e.ti.com/support/embedded/starterware/f/790/p/223776/810098.aspx

    And its working with Composite in and VGA out. and that is for C6748 LCDK. and on our customized hardware.

    But, my concern point is that, we want to make it working for composite in and composite out..! Also look at the first post in which i have mentioned hardware changes with respect to C6748 EVM from logic PD.

    Kindly reply,,!


    Thanks

    Ketan Patel

  • Hi Ketan,

    Thanks for your update.

    In my understanding, you need to refer the codec datasheets (tvp5147 & adv7343) to configure the appropriate codec registers thru. CodecRegWrite() in the code to initialize composite video out peripheral.

    http://www.analog.com/static/imported-files/data_sheets/ADV7342_7343.pdf

    http://www.ti.com/lit/ds/symlink/tvp5147.pdf

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 
    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------
  • Hello,


    I have gone through the suggested datasheet.

    But can u please let me know the correction in driver file as well as in face detection file as per the http://e2e.ti.com/support/embedded/starterware/f/790/p/223776/810098.aspx link.

    Link is for Video in and VGA out

    Pls suggest correction points for composite Video in And composite Video out.

    Regards

    Ketan Patel

  • Hi Ketan,

    Thanks for your update.

    Please find the possible combinations of SD only output configuration as specified in Table 37 (page no. 51) of ADV7343 DAC datasheet as below:

    http://www.analog.com/static/imported-files/data_sheets/ADV7342_7343.pdf

    Please check the above table to properly configure for CVBS (Composite video out), SD only DAC1/DAC2 outputs. Kindly look into the Codec Register subaddresses (0x02 bit5, 0x82 bit 2 (SD DAC2) & bit 1(SD DAC1), 0x84 bit 7) via CodecRegWrite() which Initializes the ADV7343 to output composite video thru. the API "ADV7343CompositeInit()" in adv7343.c which in turn, this API is referred in facedetectTask() in facedetect_evmC6748.c

    adv7343.c

    void ADV7343CompositeInit(unsigned intbaseAddr)

    {

       CodecRegWrite(baseAddr, 0x17, 0x02);   // please check the right value thru. ADV7373 datasheet

       Delay(10000);

       CodecRegWrite(baseAddr, 0x00, 0xFC); // please check the right value thru. ADV7373 datasheet

       CodecRegWrite(baseAddr, 0x82, 0xCB); // please check the right value thru. ADV7373 datasheet

       CodecRegWrite(baseAddr, 0x84, 0x00); // please check the right value thru. ADV7373 datasheet

    }

    Thanks & regards,

    Sivaraj K

    ------------------------------------------------------------------------------------------------------- 

    Please click the Verify Answer button on this post if it answers your question.
    -------------------------------------------------------------------------------------------------------

  • Hello

    Thanks for helping reply,

    I have gone through the setting suggested. I have made changes in ADV7343CompositeInit()  as per the table 79 on page 97 of http://www.analog.com/static/imported-files/data_sheets/ADV7342_7343.pdf

    void ADV7343CompositeInit  ( unsigned int baseAddr)
    {
        // Table no: 79
        CodecRegWrite(baseAddr, 0x17, 0x02);    // S/W reset
        Delay(10000);
        CodecRegWrite(baseAddr, 0x00, 0xFC);    // All DAC anabled
        CodecRegWrite(baseAddr, 0x01, 0x00);    // SD input mode
        CodecRegWrite(baseAddr, 0x80, 0x11);    // PAL standard, SSAF luma filter enabled
                                                                                   // 1.3MHz chroma filder enabled
                                                                                   // ketan added 0x05 old
        CodecRegWrite(baseAddr, 0x82, 0xC1);   // Pixel data valid    //0xCB
                                                                                   // YPbPr and CVBS/Y-C out
                                                                                   // SSAF luma filter enabled
                                                                                   // Active video edge control enabled
        CodecRegWrite(baseAddr, 0x88, 0x08);    // 16 bit input enabled
        CodecRegWrite(baseAddr, 0x8A, 0x0C);    // timing mode 2 (slave)
                                                                                    // HSYNC/VSYNC synchronization
     }

    void TVP5147CompositeInit ( unsigned int baseAddr) // its working for Composite in with PAL and VGA out for 

                                                                                                    // facedetect_lcdk.c
    {
        unsigned char reg_val;
        CodecRegWrite(baseAddr, 0x03, 0x01);    // power saver ON
        Delay(1000000);
        CodecRegWrite(baseAddr, 0x03, 0x00);    // power saver OFF
        Delay(1000000);

        CodecRegWrite(baseAddr, 0x00, 0x05);    // VI_2_B channel selected
                                                                                   // Autoswitch includes
                                                                                   // (B, D, G, H, I, N) PAL (default)
        CodecRegWrite(baseAddr, 0x08, 0x00);    // processing control register
        CodecRegWrite(baseAddr, 0x0E, 0x04);    // Try: 0x0C also
        CodecRegWrite(baseAddr, 0x34, 0x11);
        CodecRegWrite(baseAddr, 0x02, 0x02);    // For:  (B, D, G, H, I, N) PAL = o/p selected
        reg_val = CodecRegRead(baseAddr, 0x3A);
        //while((reg_val | 0xF1) != 0xFF)                                 // Compulsory comment
        //    reg_val = CodecRegRead(baseAddr, 0x3A);    // Compulsory comment
        Delay(10000);
    }

     

    Even i have made changes in vpif.c file at "C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\drivers" locatoin

     

    void VPIFCaptureModeConfig ( unsigned int baseAddr, unsigned int mode, unsigned int sdChannel, unsigned int rawWidth, VPIFVbufParam* buf ) // working for Composite in with PAL and VGA out for facedetect_lcdk.c
    {   

    // some lines

    if(mode==VPIF_PAL)
                {
                    if(sdChannel==VPIF_CHANNEL_0)
                    {
                        HWREG(baseAddr + C0HCFG) = (280 << VPIF_C0HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C0HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C0VCFG0) = (1 << VPIF_C0VCFG0_L1_SHIFT) | (23 << VPIF_C0VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C0VCFG1) = (311 << VPIF_C0VCFG1_L5_SHIFT) | (313 << VPIF_C0VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C0VCFG2) = (336 << VPIF_C0VCFG2_L9_SHIFT) | (624 << VPIF_C0VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C0VSIZE) = 625 << VPIF_C0VSIZE_VSIZE_SHIFT;
                    }
                    if(sdChannel==VPIF_CHANNEL_1)
                    {
                        HWREG(baseAddr + C1HCFG) = (280 << VPIF_C1HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C1HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C1VCFG0) = (1 << VPIF_C1VCFG0_L1_SHIFT) | (23 << VPIF_C1VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C1VCFG1) = (311 << VPIF_C1VCFG1_L5_SHIFT) | (313 << VPIF_C1VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C1VCFG2) = (336 << VPIF_C1VCFG2_L9_SHIFT) | (624 << VPIF_C1VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C1VSIZE) = 625 << VPIF_C1VSIZE_VSIZE_SHIFT;
                    }
                }

    // some lines

    }

    void VPIFDisplayModeConfig  ( unsigned int baseAddr, unsigned int mode, unsigned int sdChannel, VPIFVbufParam* buf )

    .

    .// some lines

        if(mode==VPIF_PAL)
                {
                    //if(sdChannel==VPIF_CHANNEL_0) // lcdk
                    if(sdChannel==VPIF_CHANNEL_2)    // evm
                    {
                        HWREG(baseAddr + C0HCFG) = (280 << VPIF_C0HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C0HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C0VCFG0) = (1 << VPIF_C0VCFG0_L1_SHIFT) | (23 << VPIF_C0VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C0VCFG1) = (311 << VPIF_C0VCFG1_L5_SHIFT) | (313 << VPIF_C0VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C0VCFG2) = (336 << VPIF_C0VCFG2_L9_SHIFT) | (624 << VPIF_C0VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C0VSIZE) = 625 << VPIF_C0VSIZE_VSIZE_SHIFT;
                    }
                    //if(sdChannel==VPIF_CHANNEL_1)    // lcdk
                    if(sdChannel==VPIF_CHANNEL_3)    // evm
                    {
                        HWREG(baseAddr + C1HCFG) = (280 << VPIF_C1HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C1HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C1VCFG0) = (1 << VPIF_C1VCFG0_L1_SHIFT) | (23 << VPIF_C1VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C1VCFG1) = (311 << VPIF_C1VCFG1_L5_SHIFT) | (313 << VPIF_C1VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C1VCFG2) = (336 << VPIF_C1VCFG2_L9_SHIFT) | (624 << VPIF_C1VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C1VSIZE) = 625 << VPIF_C1VSIZE_VSIZE_SHIFT;
                    }
                }

    |

    | // some lines

    }

    But still i m not able to get output..

    Any hint or solution..?

    Thanks in advance..!

    KeTaN

  • Hello,

    Thanks for helping reply for composite out for facedetect_EVM6748

    I have gone through the suggestion and datasheet for ADC7343.pdf.

    I have made changes in ADV7343.C file as shown here as per the page 97 ( Table 79 )

    void ADV7343CompositeInit ( unsigned int baseAddr )
    {
        // Table no: 79
        CodecRegWrite(baseAddr, 0x17, 0x02);    // S/W reset
        Delay(10000);
        CodecRegWrite(baseAddr, 0x00, 0xFC);    // All DAC anabled
        CodecRegWrite(baseAddr, 0x01, 0x00);    // SD input mode
        CodecRegWrite(baseAddr, 0x80, 0x11);    // PAL standard, SSAF luma filter enabled
                                                                                   // 1.3MHz chroma filder enabled
        CodecRegWrite(baseAddr, 0x82, 0xC1);   // Pixel data valid    // Also tried 0xC3
                                                                                   // YPbPr and CVBS/Y-C out
                                                                                   // SSAF luma filter enabled
                                                                                   // Active video edge control enabled
        CodecRegWrite(baseAddr, 0x88, 0x08);    // 16 bit input enabled
        CodecRegWrite(baseAddr, 0x8A, 0x0C);    // timing mode 2 (slave)
                                                                                   // HSYNC/VSYNC synchronization
    }

    I have made changes in TVP5147.C file as shown here and its working for facedetect_lcdk.c with Composite in and VGA out for PAL interfacing

    void TVP5147CompositeInit(unsigned int baseAddr)
    {
        unsigned char reg_val;
        CodecRegWrite(baseAddr, 0x03, 0x01);    // power saver ON
        Delay(1000000);
        CodecRegWrite(baseAddr, 0x03, 0x00);    // power saver OFF
        Delay(1000000);

        CodecRegWrite(baseAddr, 0x00, 0x05);    // VI_2_B channel selected
        CodecRegWrite(baseAddr, 0x08, 0x00);    // processing control register
        CodecRegWrite(baseAddr, 0x0E, 0x04);    // Try: 0x0C also
        CodecRegWrite(baseAddr, 0x34, 0x11);
        CodecRegWrite(baseAddr, 0x02, 0x02);    // ketan: For:    (B, D, G, H, I, N) PAL = o/p selected
        reg_val = CodecRegRead(baseAddr, 0x3A);
        //while((reg_val | 0xF1) != 0xFF)                                 // ketan: Compulsory comment
        //    reg_val = CodecRegRead(baseAddr, 0x3A);    // ketan: Compulsory comment
        Delay(10000);
    }


    Even i have also made changes in VPIF.c file at "C:\Program Files\Texas Instruments\pdk_C6748_2_0_0_0\C6748_StarterWare_1_20_03_03\drivers"

    void VPIFCaptureModeConfig ( unsigned int baseAddr, unsigned int mode, unsigned int sdChannel, unsigned int rawWidth, VPIFVbufParam* buf ) // its working for facedetect_lcdk.c with Composite in and VGA out for PAL interfacing
    {

    // some lines

       if(mode==VPIF_PAL)
                {
                    if(sdChannel==VPIF_CHANNEL_0)
                    {
                        HWREG(baseAddr + C0HCFG) = (280 << VPIF_C0HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C0HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C0VCFG0) = (1 << VPIF_C0VCFG0_L1_SHIFT) | (23 << VPIF_C0VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C0VCFG1) = (311 << VPIF_C0VCFG1_L5_SHIFT) | (313 << VPIF_C0VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C0VCFG2) = (336 << VPIF_C0VCFG2_L9_SHIFT) | (624 << VPIF_C0VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C0VSIZE) = 625 << VPIF_C0VSIZE_VSIZE_SHIFT;
                    }
                    if(sdChannel==VPIF_CHANNEL_1)
                    {
                        HWREG(baseAddr + C1HCFG) = (280 << VPIF_C1HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C1HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C1VCFG0) = (1 << VPIF_C1VCFG0_L1_SHIFT) | (23 << VPIF_C1VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C1VCFG1) = (311 << VPIF_C1VCFG1_L5_SHIFT) | (313 << VPIF_C1VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C1VCFG2) = (336 << VPIF_C1VCFG2_L9_SHIFT) | (624 << VPIF_C1VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C1VSIZE) = 625 << VPIF_C1VSIZE_VSIZE_SHIFT;
                    }
                }

    // some lines

    }

    void VPIFDisplayModeConfig ( unsigned int baseAddr, unsigned int mode, unsigned int sdChannel, VPIFVbufParam* buf )               // Need to check
    {

    // some lines

        if(mode==VPIF_PAL)
                {
                    //if(sdChannel==VPIF_CHANNEL_0) // lcdk
                    if(sdChannel==VPIF_CHANNEL_2)    // evm
                    {
                        HWREG(baseAddr + C0HCFG) = (280 << VPIF_C0HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C0HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C0VCFG0) = (1 << VPIF_C0VCFG0_L1_SHIFT) | (23 << VPIF_C0VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C0VCFG1) = (311 << VPIF_C0VCFG1_L5_SHIFT) | (313 << VPIF_C0VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C0VCFG2) = (336 << VPIF_C0VCFG2_L9_SHIFT) | (624 << VPIF_C0VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C0VSIZE) = 625 << VPIF_C0VSIZE_VSIZE_SHIFT;
                    }
                    //if(sdChannel==VPIF_CHANNEL_1)    // lcdk
                    if(sdChannel==VPIF_CHANNEL_3)    // evm
                    {
                        HWREG(baseAddr + C1HCFG) = (280 << VPIF_C1HCFG_EAV2SAV_SHIFT) | (1440 << VPIF_C1HCFG_SAV2EAV_SHIFT);
                        HWREG(baseAddr + C1VCFG0) = (1 << VPIF_C1VCFG0_L1_SHIFT) | (23 << VPIF_C1VCFG0_L3_SHIFT);
                        HWREG(baseAddr + C1VCFG1) = (311 << VPIF_C1VCFG1_L5_SHIFT) | (313 << VPIF_C1VCFG1_L7_SHIFT);
                        HWREG(baseAddr + C1VCFG2) = (336 << VPIF_C1VCFG2_L9_SHIFT) | (624 << VPIF_C1VCFG2_L11_SHIFT);
                        HWREG(baseAddr + C1VSIZE) = 625 << VPIF_C1VSIZE_VSIZE_SHIFT;
                    }
                }

    // some lines

    }

    Stil not able to get output

    Kindly go through it..!

    Thanks in advance

    Ketan

  • Hello ..!

    Any update ?

    Please reply..!

    Waiting .!

  • Hello,

    Using Program for Face-detect for composite out, even VPIF clock signals are not generated from CPU..!

    And also Not any single DATA is generated from CPU ..!

    Waiting for Reply..!

    Thanks

  • Hello !!

    I have already made changes as per http://e2e.ti.com/support/embedded/starterware/f/790/p/223776/810098.aspx

    But I have any things in the screen :

    Could you pleae attach the full project that work

    Thank you !!

    Mus An