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.

IPNC36X-mt5 shutter time and exposure sync pulse problem

Hi, everyone,

It can't out exposure sync pulse at Strobe pin in ERS exposure mode. In GRR mode, the pulse is valid, but pulse width seems abonormal. Such as, I set SHUTTER_WIDTH_L register 340 and tRow about 30us(2048*1536), but strobe pusle wdith just only 30us, expection is 340*30us. My code as following,

int DRV_imgsSetShutterMode(Uint8 exp_mode, Uint32 exp_time, Uint8 flash, Uint8 flash_time)
{
  Uint8 regAddr[4];
  Uint16 regValue[4], read_mode_1;
  int status, i = 0;

  regAddr[0] = READ_MODE_1;
  status = DRV_i2cRead16(&gDRV_imgsObj.i2cHndl, &regAddr[0], &read_mode_1, 1);
  if(status!=OSA_SOK) {
    OSA_ERROR("DRV_i2cRead16() read_mode_1\n");
    return status;
  }
  if(exp_time > 0)
  {
     DRV_ImgsFrameTime *pFrame = &gDRV_imgsObj.curFrameTime;

     regAddr[i] = SHUTTER_WIDTH_L;
     regValue[i] = (exp_time*1000.0 + pFrame->shutterOverhead)/pFrame->t_row;
     if(regValue[i]<1)
        regValue[i] = 1;
     if(regValue[i]>=64*1024)
        regValue[i] = 64*1024 - 1;
     printf("expo sw:%d\n", regValue[i]);

     i++;
  }

  switch(exp_mode)
  {
    case IMG_EXPO_MODE_ERS:
#if 0
    regAddr[i] = RESTART;
    regValue[i] = 0x03;
   i++;
#endif
    regAddr[i] = RESTART;
    regValue[i] = 0x05;
    i++;

    regAddr[i] = READ_MODE_1;
    if(flash)
    {
       read_mode_1 |= (1 << STROBE_BITMASK);
       read_mode_1 |= flash_time;
    }
    else
    {
       read_mode_1 &= ~(1 << STROBE_BITMASK);
    }
    regValue[i] = read_mode_1;
    i++;

    regAddr[i] = READ_MODE_1;
    read_mode_1 |= (1 << SNAPSHOT_BITMASK);
    read_mode_1 &= ~(1 << GLOBALRESET_BITMASK);
    regValue[i] = read_mode_1;
   i++;

    break;
   
    case IMG_EXPO_MODE_GRR:
#if 1
    regAddr[i] = RESTART;
    regValue[i] = 0x03;
   i++;
#endif

    regAddr[i] = READ_MODE_1;
    read_mode_1 |= (1 << SNAPSHOT_BITMASK);
    read_mode_1 |= (1 << GLOBALRESET_BITMASK);
    if(flash)
    {
       read_mode_1 |= (1 << STROBE_BITMASK);
       read_mode_1 |= flash_time;
    }
    else
    {
       read_mode_1 &= ~(1 << STROBE_BITMASK);
    }
    regValue[i] = read_mode_1;
    i++;

    regAddr[i] = RESTART;
    regValue[i] = 0x05;
    i++;
    break;

    case IMG_EXPO_MODE_CONT:
    default:
    regAddr[i] = READ_MODE_1;
    read_mode_1 &= ~(1 << SNAPSHOT_BITMASK);
    //read_mode_1 &= ~(1 << STROBE_BITMASK);
    regValue[i] = read_mode_1;
    i++;
    regAddr[i] = RESTART;
    regValue[i] = 0x01;
    i++;

  }

  status = DRV_i2cWrite16(&gDRV_imgsObj.i2cHndl, &regAddr[0], &regValue[0], i);

  if(status!=OSA_SOK) {
    OSA_ERROR("DRV_i2cWrite16()\n");
    return status;
  }

  return status;
}

I hope someone can get help. It is hard to get Aptina's support for me.