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.

DS90UB954-Q1: How to set PGEN_COLORx registers to get at least 3 color bar in RGB by RAW12 format ?

Part Number: DS90UB954-Q1
Other Parts Discussed in Thread: ALP

Hi,

I'm modifying PGEN_COLORx registers in ub9xx_raw_test_pattern driver in PSDKR_v7.2.0

The original color bar only shown in two color : blue and yellow.

But I want to get at least 3 colors in R/G/B, such as:

So how to set PGEN_COLORx to get above color bar in RAW12 format (PGEN_CSI_DI = 0x2C) ?

Thanks!

  • Hi Keelung, 

    I would recommend that you use our PATGEN tab in our ALP GUI. You can configure the number of color bars (1, 2, 4, or 8). and the colors can be modified in registers PGEN_COLORX.

    I know you can generate solid Blue pattern by setting registers 0x10 = 0xff while setting 0x11 and 0x12 = 0x00. You can get a solid Green by setting 0x11 = 0xff and 0x10 and 0x12 = 0x00. You can get a solid Red by setting 0x12 = 0xff and 0x10, 0x11 =0x00. So you may have to play around a little with how you offset the colors to get the right RGB bars.

    Thanks, 
    Sally 

  • Hi Sally,

    Even use PATGEN in ALP GUI, then how to display? You still need one of vision apps which set ser/des registers again.

    So I don't think using PATGEN ALP GUI is a good idea.

    I tested your solution in multi-cam app by selected UB9xxx_RAW12_TESTPATTERN sensor / LDC(No) / 1 camera enabled.

    After removing DCC in ISS_SENSOR_RAWTESTPAT_FEATURES in imaging/sensor_drv/src/ub9xx_raw_test_pattern/iss_sensor_raw_testpat.h,

    and fixing AWE issues as descripted in https://e2e.ti.com/support/processors/f/791/t/976128

    I still get wrong colors which not as the same as you descripted.

    Here are my settings and display results:

    0. Change RAWTESTPAT_DES_CFG_SIZE from 39 to 45 in  imaging/sensor_drv/src/ub9xx_raw_test_pattern/raw_testpat_serdes_config.h

    1. Set [0x10, 0x11, 0x12] registers to [00, FF, 00], and got display:

    2. Set [0x10, 0x11, 0x12] registers to [00, 00, FF], and got display:

    And BTW, if DCC enabled, then the display is very dark, but the colors are still as same as when DCC disabled.

    Finally, all what I wanted is displaying at least 3 bars in Red, Green, and Blue on my monitor by setting PGEN_COLORx

  • Hi Keelung, 

    We have a patgen tab and you progam your parameters. From there, then you can hit apply and display registers. You can copy those registers into your script.

    See my image example.

  • Hi Sally,

    Please check the thread title, the question at the end of the first post, the sensor driver I selected, the changing of registers, and the related thread.

    All of them are talking about RAW12, not RGB888.

  • Hi Keelung, 

    I understand that your data type is raw 12. I was just showing you the default view, so you can change it in PATGEN. 


    Thanks

    sally 

  • Hi Sally,

    You bring me to another way. My question is about RAW12 not RGB888. And in your first answer you even not metioned your format is RGB888.

    You can not just change PGEN_COLORx or PGEN_CSI_DI to got the right result. They must be changed at same time, and also other registers such as PGEN_LINE_SIZE.

    Can you shown your register settings which can show 3 bars in red/green/blue by RAW12 format?

    I can't. That why I create this thread here.

    Thanks!

  • Hi Keelung, 

    Please give me all your video parameters and I can send you the script. 

    fps? (e.g. 30 fps)

    horizontal active timing ? (e.g. 1920)

    vertical active timing? (e.g. 1080)

    vertical blanking timing? (e.g. 200)

    Thanks

    Sally 

  • Hi Sally,

    Here are my sensor's parameters which snapshoted from datasheet. 

    And FPS == 30 is a safe value for testing.

    Thanks!!

  • Hello Keelung,

    I think there is some basic mis-understanding here about how the PATGEN feature works. There is no way to display exactly 3 distinct colors like R/G/B. There are two options:

    1. Reference bar mode where each bar has a different color. In RGB they will all be grayscale because R/G/B values will all be the same value (with varying intensity)

    2. Fixed color bar mode where you send a fixed pattern of bytes with a certain block size for the first bar followed by the inverse pattern of bytes in the next bar and so on (a total of two different colors alternating back and forth) 

    It looks like you are configuring fixed color bar mode which is why you are getting two colors alternating. There is no way to display a purely R/G/B image with RAW12 format because RAW12 uses a non-integer number of bytes per pixel. In RGB888 you have 3 bytes per one pixel, but in RAW12 you have 3 bytes per 2 pixels. So that is why you are getting shades of orange and violet based on your RAW to RGB conversion going to the display. 

    So this is expected behavior and it is not possible to generate three distinct colors like you are attempting. 

    As Sally mentioned, it is much easier to generate these configurations in ALP with the GUI tool. You can select whatever datatype you like including RAW12, set up the number of bars, color registers, etc. and then the GUI lets you export the register values used so that you can dump them into your code. 

    Best Regards,

    Casey 

  • Hi Casey,

    Thanks for your info!

    But color bar no color doesn't make sense for many newbies of Ti Ser/Des.

    I don't understand why inverse pattern is enabled forcely, and users can not disable it.

    Anyway, users should be allowed to generate any color in PATGEN in supported pixel formats.

    Limited pattern isn't a good design.