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.

Why we only get 8bits data from 12bits mt9p031 ?

it11 Hello,

         We only get 8bits data  from 12bits mt9p031. Capture high 4 bit data from mt9p031 always is 0, the low 8 bit is okay. but the high 4 bits has data bits through oscillocope. ( This mode is CCDC_NO_COMPRESSION). and data bit11 of mt9p031 is connected to CDATA 11.

  CCDCFG = 0.

  MODESET = 0

 CGAMMAWD = 0x1108

****************************************************************************************************************************************

        If we  use CCDC_ALAW, but the getting 8 bits data is very  small. That is to day, the high 4 bit  hasn't data.

       How can we get correctly 12 bits data form mt9p031? That is to say, we can get high 4 bit data when use CCDC_NO_COMPRESSION.

       When we use CCDC_NO_COMPORESSION, the sdram is set 16 bit pack(not 12 bit pack), is it correct?

       waiting for your answers,     

 

  The folling is using by CCDC_ALAW, the registers of CCDC.

        input_std_paramsdavinci_resizer davinci_resizer.2: RSZ_G_CONFIG:1:1:176
: name = V4L2_STD_MT9P031_1080p_davinci_previewer davinci_previewer.2: ipipe_set_preview_config
30FPS
input_std_params: output width = 1920
opdavinci_previewer davinci_previewer.2: ipipe_set_preview_config
ening resize device
Successfully set mode to single shot in resizer
default configuration setting in Resizer successfull
Resizer initialized
Operating mode changed successfully to continuous in previewerSetting default configuration in previewer
default configuration setting in previewer successfull
Setting default for LUT Defect Correction
Setting default for OTF Defect Pixel Correction
Setting default for 2-D Noise filter - 1
Setting default for 2-D Noise filter - 2
Setting default for Green Imbalance Correction
Setting default for CFA Interpolation
Setting default for RGB-RGB Conversion - 1
Setting default for Gamma MUX: initialized GPIO40
Correction
Setting default for RGB-RGB Conversion - 2
Setting default for 3D LUT
Setting default for RGB-YCbCr conversion
Setting default for Global Brightness,Contrast Control
Setting default for YUV 422 conversion
Setting default for Luminance Adjustment
Setting default for Edge Enhancer
Setting default for Chromatic Artifact Reduction
Setting default for Chromatic Gain Suppression
previewer initialized
setting data format
SetDataFormat:setting std to 0
input.name = RAW
input.name = RAW-1
InitDevice:ioctl:VIDIOC_S_INPUT, selected input

Calling configCCDCraw()
pix_fmt = 0
frm_fmt = 0
fid_pol = 0
vd_pol = 0
hd_pol = 0
data_size = 4
data_shift = 0
test_pat_gen = 0
win.width = 640
win.height = 480
module_params.culling.hcpat_odd = 0xff
module_params.culling.hcpat_even = 0xff

configCCDCraw Done

S_STD Done

vpfe ccdc capture vpfe ccdc capture.1: hpitch = 1920, vpitch = 1080, bpp = 1
GetSTD Done WITH std = 0
Found the std information
stdinfo.name = 1080P-MP-30
stdinfo.frameperiod.numerator = 1
stdinfo.frameperiod.denominator = 30
SetDataFormat:requesting width:1920 height:1080
Compression enabled

S_FMT Done
initializing capture buffers

REQBUF Done

QUERYBUF Done
buffer = 0x84000000

QUERYBUF Done
buffer = 0x80800000

QUERYBUF Done
buffer = 0x83000000
Capture initialized
/sys/class/davinci_display/ch0/output was opened successfully
Current output value is COMPOSITE

DavinciDisplay DavinciDisplay.1: Not MMAP
Changed output tDavinciDisplay DavinciDisplay.1: Not MMAP
o COMPONENT

/User set bytesperline: 3840
width: 0
height: 0
sizeimage: 4147200
sys/class/davincBefore finishing with S_FMT:
layer.pix_fmt.bytesperline = 3840
layer.pix_fmt.width = 1920
layer.pix_fmt.height = 1080
layer.pix_fmt.sizeimage =4147200
i_display/ch0/mopixfmt->width = 1920
layer->layer_info.config.line_length = 3840
de was opened successfully
Currcalling ccdc_config_raw()
ent mode value i*************************Starting ccdc_config_raw..
s 480P-60

Chastarting ccdc_reset...nged mode to 108<7>
End of ccdc_reset...0I-30

Enabled<7>***********Writing 0x2 to ...CCDCFG
 streaming on di************************************Writing 0x0 to MODESET...
splay device
In*************************************Writing 4e4e to CCOLP ...
itialized displaStarting ccdc_setwin...y
Queing buffer<7>
End of ccdc_setwin...:0

Q_BUF Done<7>
******************************End of ccdc_config_ycbcr...

Queing buffer:***********Read 0x2 to ...CCDCFG
1

***********Read 0x0 to ...MODESET

***********Read 0x4e4e to ...CCOLP

 

 

  • I need some clarification.

    1. Did you check you can get signal from sensor (using Scope)?

    2. Can you check Raw data and did it only provide 8bit data?

    3. I assume you don't use A-law, DPCM or 12bit PACK. If so, the raw data should store the data in 2byte format (and 1byte should have zero value as the data is only 8bit). Does the data stored in 2byte format?

    4. Did you have very bright spot in your scene? It is needed to check the range of data.

     

    Regards,

    Sang-Yong

     

     

  • I have check the signal frmo the SCope. There are  the pulse of  high 4 bit mt9p031 data bus.

    Yes, I only use CCDC_NO_COMPRESSION and 16bit PACK.

    But the high 4 bit of capture data still is zero.

    I think the data flow is:  mt9p031 ---> IPIPEIF ---> ISIF ---> DDR.  But  CFG  is 0x405.

    So INPSRC2 = 1,  ISIF from SDRAM (raw data). and  DATASFT = 0,  Output data (13:0) = read data(13:0). Does is correct?

    Now I dont connect the I2C with the MT9p031. so The clock isnt match with MT9P031 clock.  But I think the IPIPEIF only using the PCLK from the MT9P031.

    How to get the 12bit data from mt9p031?

    The blow is the register of IPIPEIF and ISIF.

    input_std_paramsdavinci_resizer davinci_resizer.2: RSZISIF_G_CONFIG:1:1:176
    : name = V4L2_STD_MT9P031_1080p_30FPS
    input_stddavinci_previewer davinci_previewer.2: ipipe_set_preview_config
    _params: output IPIPEIF Registers
    width = 1920
    op**************************************************
    ening resize devIPIPEIF ENABLE = 0x0
    ice
    SuccessfullIPIPEIF CFG = 0x2405
    y set mode to siIPIPEIF PPLN = 0x288
    ngle shot in resIPIPEIF LPFR = 0x1ea
    izer
    default coIPIPEIF HNUM = 0x280
    nfiguration settIPIPEIF VNUM = 0x1e0
    ing in Resizer sIPIPEIF ADDRU = 0x0
    uccessfull
    ResiIPIPEIF ADDRL = 0x0
    IPIPEIF ADOFS = 0x0

    Operating mode IPIPEIF RSZ = 0x10
    changed successfIPIPEIF GAIN = 0x200
    ully to continuoIPIPEIF DPCM = 0x0
    us in previewerSIPIPEIF CFG2 = 0x0
    etting default cIPIPEIF INIRSZ = 0x0
    onfiguration in IPIPEIF OCLIP = fff
    previewer
    IPIPEIF DTUDF = 0
    IPIPEIF CLKDIV = 5
    IPIPEIF DPC1 = 0
    IPIPEIF DPC2  = 0
    IPIPEIF DFSGVL  = 0
    IPIPEIF DFSGTH  = fff
    IPIPEIF RSZ3A  = 10
    IPIPEIF INIRSZ3A  = 0
    IPIPE Registers
    **************************************************
    davinci_previewer davinci_previewer.2: ipipe_set_preview_config
    default configurIPIPEIF Registers
    ation setting in**************************************************
     previewer succeIPIPEIF ENABLE = 0x0
    ssfull
    IPIPEIF CFG = 0x405
    IPIPEIF PPLN = 0x788
    IPIPEIF LPFR = 0x442
    IPIPEIF HNUM = 0x780
    IPIPEIF VNUM = 0x438
    IPIPEIF ADDRU = 0x0
    IPIPEIF ADDRL = 0x0
    IPIPEIF ADOFS = 0x0
    IPIPEIF RSZ = 0x10
    IPIPEIF GAIN = 0x200
    IPIPEIF DPCM = 0x0
    IPIPEIF CFG2 = 0x0
    IPIPEIF INIRSZ = 0x0
    IPIPEIF OCLIP = fff
    IPIPEIF DTUDF = 0
    IPIPEIF CLKDIV = 5
    IPIPEIF DPC1 = 0
    IPIPEIF DPC2  = 0
    IPIPEIF DFSGVL  = 0
    IPIPEIF DFSGTH  = fff
    IPIPEIF RSZ3A  = 10
    IPIPEIF INIRSZ3A  = 0
    IPIPE Registers
    **************************************************
    Setting default for LUT Defect Correction
    Setting default for OTF Defect Pixel Correction
    Setting default for 2-D Noise filter - 1
    Setting default for 2-D Noise filter - 2
    Setting default for Green Imbalance Correction
    Setting default for CFA Interpolation
    Setting default for RGB-RGB Conversion - 1
    Setting default for Gamma Correction
    Setting default for RGB-RGB Conversion - 2
    Setting default for 3D LUT
    Setting default for RGB-YCbCr conversion
    Setting default for Global Brightness,Contrast Control
    Setting default for YUV 422 conversion
    Setting default for Luminance Adjustment
    Setting defMUX: initialized GPIO40
    ault for Edge Enhancer
    Setting default for Chromatic Artifact Reduction
    Setting default for Chromatic Gain Suppression
    previewer initialized
    setting data format
    SetDataFormat:setting std to 0
    input.name = RAW
    input.name = RAW-1
     ***********CCDC_PACK_16BIT ***********************
    InitDevice:ioctl:VIDIOC_S_INPUT, selected input

    Calling configCCDCraw()
    pix_fmt = 0
    frm_fmt = 0
    fid_pol = 0
    vd_pol = 0
    hd_pol = 0
    data_size = 4
    data_shift = 0
    test_pat_gen = 0
    win.width = 640
    win.height = 480
    module_params.culling.hcpat_odd = 0xff
    module_params.culling.hcpat_even = 0xff

    configCCDCraw Done

    S_STD Done
    vpfe ccdc capture vpfe ccdc capture.1: hpitch = 1920, vpitch = 1080, bpp = 2

    GetSTD Done WI ***********CCDC_PACK_16BIT ***********************
    TH std = 0
    Found the std information
    stdinfo.name = 1080P-MP-30
    stdinfo.frameperiod.numerator = 1
    stdinfo.frameperiod.denominator = 30
    SetDataFormat:requesting width:1920 height:1080
    No Compression

    S_FMT Done
    initializing capture buffers

    REQBUF Done

    QUERYBUF Done
    buffer = 0x84000000

    QUERYBUF Done
    buffer = 0x80800000

    QUERYBUF Done
    buffer = 0x83000000
    Capture initialized
    /sys/class/davinci_display/ch0/output was opened successfully
    Current output value is COMPOSITE

    Changed output to COMPONENT

    /sys/class/davinci_display/ch0/mode was opened successfully
    Current mode value is 480P-60

    DavinciDisplay DavinciDisplay.1: Not MMAP
    Changed mode to DavinciDisplay DavinciDisplay.1: Not MMAP
    1080I-30

    User set bytesperline: 3840
    width: 0
    height: 0
    sizeimage: 4147200
    Before finishing with S_FMT:
    layer.pix_fmt.bytesperline = 3840
    layer.pix_fmt.width = 1920
    layer.pix_fmt.height = 1080
    layer.pix_fmt.sizeimage =4147200
    pixfmt->width = 1920
    layer->layer_info.config.line_length = 3840
    calling ccdc_config_raw()
    Enabled streamin*************************Starting ccdc_config_raw..
    g on display devstarting ccdc_reset...<7>DavinciDisplay DavinciDisplay.1: irq_first time
    ice
    InitializedEnd of ccdc_reset... display
    Queing<7>***********Writing 0x0 to ...CCDCFG
     buffer:0

    Q_B************************************Writing 0x0 to MODESET...
    UF Done
    Queing *************************************Writing 4e4e to CCOLP ...
    buffer:1

    Q_BUStarting ccdc_setwin...F Done
    <7>
    End of ccdc_setwin...<7>
    ******************************End of ccdc_config_ycbcr...
    ***********Read 0x0 to ...CCDCFG
    ***********Read 0x0 to ...MODESET
    ***********Read 0x4e4e to ...CCOLP
    ***********Read 0x1108 to ...CGAMMAWD

    STREAMON Done
    time:146    frame:1
    time:146    frame:2
    time:147    frame:3
    time:147    frame:4
    time:147    frame:5
    Writing frame 5 to file ./55.raw, size = 4147200
    Writing file ./55.raw complete
    Writing frame 5 to file ./output.yuv, size = 4147200
    Writing file ./output.yuv complete
    time:152    frame:6
    Cleaning capture
    DavinciDisplay DavinciDisplay.1: Not MMAP
    Cleaning displayDavinciDisplay DavinciDisplay.1: Not MMAP

    DavinciDisplay DavinciDisplay.1: Not MMAP
    DavinciDisplay DavinciDisplay.1: Not MMAP
    DavinciDisplay DavinciDisplay.1: Not MMAP
    DavinciDisplay DavinciDisplay.1: Not MMAP
    Cleaning display - end
    closing preview- end
    closing resize - end

     

  • Thank you for more info.

    > Output data (13:0) = read data(13:0)

    This one might be wrong as the data will be (11:0) in DDR. But this is not important at this moment.

    First of all, we need to get 12bit Raw data in DDR. Can you attach Raw data you get?

     

    Regards,

    Sang-Yong