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.

Is patch download of TVP5158 necessary?

Other Parts Discussed in Thread: TVP5158

Hi,

           I got a sample code of TVP5158 driver which has been tested for DM6467, In the sample code, I found a operation about  patch download of TVP5158 ,

Is it necessary? 

       In the sample code of TVP5158, It is easy to set this chip, there are four steps to set TVP5158,  the first is GetchipID, the second is OfmReset, the

third is patchDownload ,then  SetOfmMode and SetAudioMode,  Can this operations make TVP5158  work normally according to parameters of SetSetOfmMode and SetAudioMode?

Thanks

  • Hi Jerry,

    The patch is not required but recommended to make the TVP5158 to work perfectly since it addresses some bugs such as interrupt, QCIF mode field swap, Macrovision detection, etc...

    If you are running with DM6467, it is required.

    Regards,

    Viet

  • Hi, Viet:

           Thank you for your suggestion, I am running with S3C6410 .There is  a strange issue.  At first,I reset the chip , and I can get chip ID ,and access(R/W) other register well, but if I write a value (0x05) to the chip sub-address 0xB2, then I read data back from this register, I get the value is 0x20. if I write other value into it , I get back 0x20 also! (This register is written to video decoder core 0.)

          I try to  write some value to other registers(R/W), I can get right value back . Is there a  relationship with between accessing 0xB2-register and firmware updating ?or the chip I tested is bad ?

        Following picture is  a IIC waveform of writting  0x05 to the chip sub-address 0xB2.

     

    Following picture is  a IIC waveform of reading data from  the chip sub-address 0xB2.( the back value is 0x20)

    Jerry

  • Hello Jerry,

    There is a problem with bit 6 of register B2h in ROM.  Can you try to download the patch to see if it works for you?

    Regards,

    Viet

  •      Hi, Viet  

                  I don't know  the patch downloading  is successful or fail . how to check the result of patch downloading ?

    Is the download regAddr always  E1h?    

    the total data size of a write operation is (wrSize+1). then repeat the write operation untill patch downloading  finished. Can I complete the patch downloading ?

       

             best regards

        Jerry

                 If  I execute a write operation (in "TVP5158_patchDownload()"  function ), the first byte is regAddr,all of following data (size is wrSize)is patch data .

  •  Hi, Viet  

                  I don't know  the patch downloading  is successful or fail . how to check the result of patch downloading ?

    Is the download regAddr always  E1h?    

        If  I execute a write operation (in "TVP5158_patchDownload()"  function ), the first byte is regAddr,all of following data (size is wrSize)is patch data .

     

     

             

    the total data size of a write operation is (wrSize+1). then repeat the write operation untill patch downloading  finished. Can I complete the patch downloading ?

         

        best regards

        Jerry

  • Hello Jerry,

    Yes, the regAddr is always E1h.  You can check if the patch is downloaded and running by reading back the RAM and RAM Test Version in I2C register 05h and 06h.  For example, if you are using patch v020117, you should get 01h in 05h and 17h in 06h.

    Regards,

    Viet

  • Hi, Viet: Thanks for your replying, your answer is very helpful to me , I had tried to download patch to RAM , but failed, because the TVP5158 device I2C address for patch downloading is not BEh, it is B8h, right? I find the operation of patch downloading in the "TVP5158 How to Load RAM Code.pdf". I have two questions to ask you again: 1) If I write 0x60,0x00,0xA0 to the register E8h,E9h,EAh, or other I2C read/write operation except setting the register E1h, Is the TVP5158 device I2C address BEh? 2) Only I load the RAM code use the register E1h ,I need use the TVP5158 device I2C address B8h, Is my understanding right ? Best regards Jerry
  • Hi, Viet :

            Sorry, I make a mistake, I had set the TVP5158 device I2C address BEh for write , and BFh for read.

    when I set the TVP5158 device I2C address B8h,then I find I can get a NACK from TVP5158.

          So the TVP5158 device I2C address B8h in "TVP5158 How to Load RAM Code.pdf" is a example address.

          If you set the TVP5158 device I2C address at first , the TVP5158 device I2C address is stable, Is it rigth?

    Best regards

    Jerry

  • Hi Jerry,

    Attached is the new pdf file that show you how to download patch to TVP5158 in detail.  Please let me know if you still have question.

    Regards,

    Viet

    TVP5158_patch_download_app_note_050310.pdf
  • Hi Jerry,

    The Decoder write and read enable registers are FEh and FFh respectively.  BEh, BFh, and B8h are for some thing else.  You can download the TVP5158 data sheet from this website:

    http://focus.ti.com/docs/prod/folders/print/tvp5158.html

    Regards,

    Viet

  • Hi, Viet:

             According to your suggestion and the "TVP5158_patch_download_app_note_050310.pdf",I tried to download  the patch , the version is v02_01_17.

    After I completed  the patch downloading , I can't get  01h in register 05h and 17h in register 06h, the value I got is 00h and 00h. but if I retry to download ,

    I can get the 02h from  the register E0h ,It shows that Patch is already running, Is my downloading successful?

            If you do not download the patch , what value can you get from the register 05h and 06h?

          

     

  •  Hi ,Viet :

               I can read value from the register B2h now, but the cause is not patch downloading ,but I modify I2C connection wire.  

    If I do not  download the patch , the value I  got from the register 05h/06h is 00h/00h. I think my read operation about

    the register 05h/06h is not right. Is it same as the reading  chip ID?

              If I power down the TVP5158, then I retry to download patch, now, I can download the patch again, and after I completed

    downloading , I can't get  01h in register 05h and 17h in register 06h, the value I got is 00h and 00h. but if I retry to download ,

    I can get the 02h from  the register E0h ,It shows that Patch is already running.

            My downloading method is follow the sample code (TVP5158  tested for DM6467), I find it is consistent  with the

    "TVP5158_patch_download_app_note_050310.pdf".

             What problem about my operation?

    Best regards

    Jerry

     

     

     

     

  • Hi ,Viet :

              After I finish setting TVP5158(include  setOfmMode, setAudioMode), Although I can't get RAM version from the register 05h and 06h, but when I read the register 00h(status 1), 01h(status 2), 0Ch(Video Standard Status), I can get the value 7Eh, B0h,82h.  It seems like I had got CVBS data . but I can't  get TVP5158 output clock waveform

    and data waveform(ITU656 protocol).

               Is my setting successful ? why I can't get clock and data waveform?

    Best regards

    Jerry

  • Hello Jerry,

    I am sorry that you had this problem and the delay due to holiday.  I think before trying to download the patch, let get the I2C read/write correctly first.  From the driver, I suggest you to comment out the download patch and get the read/write to work first.  For registers 04, 05, and 06, you should get 02, 00, and 00 respectively.  And the chip ID in 08 and 09 should be 51h and 58h.  If download successfully, you should get the 05 and 06 update to the patch version.

    Regards,

    Viet

  • Hi, Viet:

              Thanks for your replying, I tried to download patch yesterday and today , but I couldn't get the patch version in 05h and 06h. Before I download the patch, I can get 02,00 and 00 respectively from 04h,05h and 06h. and I can get the chip ID in 08h and 09h is 51h and 58h.and other I2C operations is right.so I think my I2C read/write is correct. abd   during the patch downloading, I capture the I2C waveform , It looks like right also. My downloading steps is as follows:

    //step 1
     status = TVP5158_selectWrite(0xF);
    //step 2
     vbusStatus |= 0x1;
     status = TVP5158_vbusWrite(0xB00060, vbusStatus, 1);
    //step 3
     status = TVP5158_selectWrite(0xF);
    //step 4
     status = TVP5158_vbusWrite(0x400000, 0, 0);
    //step 5
     memset(regAddr, 0xE1, sizeof(regAddr));
     while(patchSize) { 
        if(patchSize < sizeof(regAddr))
           wrSize = (UCHAR)patchSize; 
        else
           wrSize = sizeof(regAddr);
        status = DRV_i2cWrite8(regAddr, patchAddr, wrSize);
        patchAddr += wrSize;
        patchSize -= wrSize;
    }
    //step 6
     vbusStatus |= 0x3;
     status = TVP5158_vbusWrite(0xB00060, vbusStatus, 1);

           Could you give me other suggestion? If I can't get the RAM version in 05h and 06h again, maybe I need change another TVP5158 Chip.

    Best regards

    Jerry

     

      

  • Hi Jerry,

    Can you do 1 more step?  This is step 7 after all your steps:

    ///////////////////////////////////////////////////////////////////////////

    // step 7

      vbusStatus &= ~(0x1);

      status = TVP5158_vbusWrite(i2cHndl, 0xB00060, vbusStatus, 1);
      if(status!=OSA_SOK)
        goto error_exit;

      OSA_waitMsecs(300);
    ///////////////////////////////////////////////////////////////////////////

    This will take the TVP5158 out of reset and run from patch.

    Regards,

    Viet

  • Hi, Viet:

              Thank you very much, I have got the RAM version from the register 05h and 06h ,the value is 01h and 17h now. so the "TVP5158_patch_download_app_note_050310.pdf" need add  1  step.

               I will debug the TVP5158 chip other function. thanks for your supporting again!

    Best regards

    Jerry