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.

failed to connect CMOS sensor mt9d131 to dm365 ISIF

I have a mt9d131 module connected to dm365 with 8bit generic YCbCr interface, but I can not get any data from V4L2 API. Does anyone have experience using this CMOS sensor?

  • Hi Scotty,

    Have you put the sensor driver and connected it to davinci capture driver for DM365?

    If yes, are you using continuous chained mode or single shot mode of capture?

    Have you checked whether the sensor is configured correctly and is sending out VD, HD and data signals to DM365?

    What do you mean by the fact that you are not getting any data? Do you mean VIDIOC_DQBUF ioctl is returning properly without error but data in the buffer is not updated?

    We need much more details to really pin point the problem. Ideally, this sensor should work with DM365.

    Regards,

    Anshuman

  • Thanks for your answer.

    First, please forgive me for my broken english.

    Information about my sensor module:

    Output: YCbCr-BT.601 8 bit , progressive

    PLL Clock: 80MHz

    colorspace: V4L2_COLORSPACE_470_SYSTEM_BG // YUV/YCbCr control register=0xf

    sensor_w = 1280; sensor_h = 720;  /* height/width of sensor area read-out */

    crop_w = 1280; crop_h = 720; /* crop window, height and width */

    output_w = 1280; output_h = 720; /* output window, height and width */

    sensor_x0 = 0; sensor_y0 = 0; /* informational only */

    crop_x0 = 0; crop_y0 = 0; /* informational only */

    mode.mode_config = 0x30  (disable JPEG on both A and B)

    mode.fifo_config1_b = 0x501 (set N1 to 1, PCLK1_slew=7) , Set Context B Blanking to Minimum , auto exposure on

    I checked VD, HD and PCLK signal with oscillator, and the sensor seems to work correctly.

    Here is the code I modify in ccdc_dm365.c:

     case CCDC_YCBCR_SYNC_8:
      ccdcfg |= CCDC_DATA_PACK8;
      //ccdcfg |= CCDC_YCINSWP_YCBCR;
      ccdcfg &= ~CCDC_YCINSWP_YCBCR; /*  swap to CIN[0..7] */

    in davinci_vpfe.c

    00039:   static u32 device_type = MT9D131;

     03168:   case MT9D131: 
     03169:             strncpy(name, "MT9D131", sizeof(name));

     03555:  else if (device_type == MT9D131) 
     03556:           ccdc_hw_if->set_hw_if_type(CCDC_YCBCR_SYNC_8);

     

    Part of my mt9d131 driver as follow:

    static struct decoder_device mt9d131_dev[MT9D131_NUM_CHANNELS] = {
     {
      .name = "MT9D131",
      .if_type = INTERFACE_TYPE_YCBCR_SYNC_8,
      .channel_id = 0,
      .capabilities = 0,
      .initialize = mt9d131_initialize,
      .std_ops = &standards_ops,
      .ctrl_ops = &controls_ops,
      .input_ops = &inputs_ops,
      .fmt_ops = NULL,
      .params_ops = &params_ops,
      .deinitialize = mt9d131_deinitialize
     }
    };

     

    I execute the script "loadmodules_hd.sh" and  run ./encode  -v test.264 -y 3 -o  -t 60, but I got nothing in the file test.264.

    Can anyone help me solving the problem?

    Scotty

  • Hi Anshuman,

    How can I use DM365 (leopard board) with MT9p031 mono sensor to make a still B/W camera (save JPEG file on SD card or USB drive)?

    Thanks a lot!

    Mr Yao