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.

Time critical for switch video channel input using TVP5146 and DM6437

Other Parts Discussed in Thread: TVP5146

Hi,

I'm facing a problem where I have to get a frame for analyses in a period of 200ms.

My board was made using like reference the EVM6437.

At my board I have a TVP5146 configured for two video inputs (CVBS NTSC) selecting by I2C, and I'm using a DSP6437-400Mhz.

The problem is that, sometimes the video captured are mixed between the two inputs.

I have already tried to change in a higher period of time like 500ms and it's worked well. But I really need to work with 200ms or less.

Someone could help me with an idea?

  • Hi,

     

    I think you should just wait to get ths signal locked. Once it is locked, you should be able to see correct output.

     

    Thanks,

    Brijesh Jadav

  • Hi,

    I have already tried by reading the status 1 register address “3Ah” from decoder and test the bit1 = horizontal sync lock status and bit2 = vertical sync lock status. But it still gave me the mixed frame.

    Thanks for your reply.

  • Hi,

    Can you provide more detail on how the 200/500ms delay is being used?  Is your delay based solely on channel switch and unrelated to lock status change?

    Switch channel?

    Wait 200ms or 500ms?

    Start frame capture?

     

     

     

  • Larry Taylor said:
    Wait 200ms or 500ms?

    Hello,

    It's 200ms, 500ms was made a test.

     

    Larry Taylor said:
    Switch channel?

    Yes, the channel is switched by I2C communication for the TVP5146.

     

    Larry Taylor said:
    Start frame capture?

    The start frame happen with external interrupt request.

     

    Larry Taylor said:
    Can you provide more detail on how the 200/500ms delay is being used?  Is your delay based solely on channel switch and unrelated to lock status change?

    My software receive an interrupt request for where I set a flag that is verified at infinite loop on a task.

    When this flag is set I capture a frame using FVID command, after this a PDR is counted until 200ms in a step of 10 ms.

    After the PRD of 200ms I verify the sync lock status with TVP, capture a frame and switch the channel.

    I have two other task, one for process and another to display.

    Let me know if you need some other information.

    Thanks.

     

    //--------------------------------------------------------------

    Void task0(){

         for(;;){

         //Capture frame to update the driver buffers

        if((!fg_init_cap) && ((count_PRD>19 && !fg_lock_channel2)==0){

            fn_teste_channel();

            fn_capture_frame();

        }

     

        //Capture frame for camera 1 and switch for camera 2

        if(fg_init_cap){

            fg_init_cap = 0;

            fn_teste_channel();

            fn_capture_frame();

            fn_switch_channel();

        }

     

        //Capture frame for camera 2 and switch for camera 1

        if(count_PRD>19 && !fg_lock_channel2){

            fg_lock_channel2 = 1;

            fn_teste_channel();

            fn_capture_frame();

            fn_switch_channel();

         }

         }

    }

     

    //--------------------------------------------------------------

    void fn_PRD(){ //Periodic interrupt 10ms

        count_PRD++;

    }

     

    //--------------------------------------------------------------

    void interrup_ext(){ //Periodic interrupt 400ms

        fg_init_cap = 1;

        fg_lock_channel2 = 0;

        count_PRD = 0;

    }

     

     

  • The TVP5146 takes approximately 12 fields to acquired following an input change.  A 200ms delay between channel changes may be marginal.  Following delay, can you remain in a loop to check lock status and read lock status multiple times to ensure that lock condition has stabilized?

  • The TVP5146 takes approximately 12 fields to acquire lock following an input change.  A 200ms delay between channel changes may be marginal.  Following delay, can you remain in a loop to check lock status and read lock status multiple times to ensure that lock condition has stabilized?

  • Hi,

     

    At the function “fn_teste_channel();” I´m already doing a sync verification.

     

    Is like this:

     

    void fn_teste_channel(){

    Uint8 bufferGS[2];

                bufferGS[0] = STATUS_1_REG;

                if(TRUE == i2c_readReg(I2C_TVP_SLAVE_ADDR,bufferGS,2u)){

                if(bufferGS[1] & (BIT1+BIT2) != 0x06){

                            do{

                                       fn_delay_ms(30);

                                       bufferGS[0] = STATUS_1_REG;

                                       i2c_readReg(I2C_TVP_SLAVE_ADDR,bufferGS,2u);

                            }while(bufferGS[1] & (BIT1+BIT2) != 0x06);

                }

    }

    }