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.

OPT3101-SDK: Performing Illum Crosstalk

Part Number: OPT3101-SDK
Other Parts Discussed in Thread: OPT3101

Hello,

I had a problem with Illum Crosstalk : Without masking photodiode ,why do I always get  0.0  when Performing Illum Crosstalk?

I'm checking the SDK source code but can't find the reason.

Best regards

Kailyn

  • Kailyn,

      Is this a custom board or are you using the EVM? Any information about your setup would be great as well. 

    Thank you.

  • Hi,

    This is a new design.

    The software calls dev.perUnitFactoryUpdateIllumXtalk(); in main.cpp for testing.

    void OPT3101::device::initialize(void)
    {
        // List of registers to initialize OPT3101 device after power-up
    
        this->reg.force_en_slave = 1; // add code!!!
    
        this->reg.tg_ovl_window_start = 7000; // //Overload flab observation window
        this->reg.en_temp_conv = 1;           // //Enables the internal
    
        this->reg.clip_mode_fc = 1;     // //Enables Clip mode for Frequency correction
        this->reg.clip_mode_temp = 0;   // //Disables Clip mode for Temp coff phase correction
        this->reg.clip_mode_offset = 0; // //Disables Clip mode for phase offset correction
        this->reg.iq_read_data_sel = 3; // //Enables 16 bit frame counter
        this->reg.iamb_max_sel = 14;    // //Sets maximum ambient support
        this->reg.en_temp_corr = 1;     // //Enables Temperature Correction
        this->reg.gpio1_obuf_en = 1;    // //Enabled output buffer on GPIO1 pin
        this->reg.gpo1_mux_sel = 2;     // //select dig_gpo_0 on gpio1
        this->reg.dig_gpo_sel0 = 9;     // //Select Data Ready on dig_gpo_0
    
        this->reg.num_sub_frames = 255;       // 255;   !!!     // //Sub frames count
        this->reg.num_avg_sub_frames = 127;    // 127;  !!!  // //Average frames count
        this->reg.xtalk_filt_time_const = 3;  // //Crosstalk filter time constant
        this->reg.tg_seq_int_start = 9850;    // //Sequence Start
        this->reg.tg_seq_int_end = 9858;      // //Sequence End
        this->reg.tg_seq_int_mask_start = 127; // !!! 127 //Same as AvgFrame Count
        this->reg.tg_seq_int_mask_end = 127;   // !!! 127 //Same as AvgFrame Count
    
        this->reg.hdr_thr_high = 25500; // //High Threshold
        this->reg.hdr_thr_low = 5875;   // //Low Threshold
        this->reg.en_adaptive_hdr = 1;  // 1 !!! //Enables adaptive HDR feature
    
        this->reg.illum_dac_h_tx0 = 31;  // //High Current settings [173.6mA:5.6mA X 31]
        this->reg.illum_scale_h_tx0 = 0; // //Illum scale for H [173.6mA:5.6mA X 31]
    
        this->reg.illum_dac_l_tx0 = 31;  // //High Current settings [043.4mA:1.4mA X 31]
        this->reg.illum_scale_l_tx0 = 3; // //Illum scale for H [043.4mA:1.4mA X 31]
    
        this->reg.illum_dac_h_tx1 = 31;  // //High Current settings [173.6mA:5.6mA X 31]
        this->reg.illum_scale_h_tx1 = 0; // //Illum scale for H [173.6mA:5.6mA X 31]
    
        this->reg.illum_dac_l_tx1 = 31;  // //High Current settings [043.4mA:1.4mA X 31]
        this->reg.illum_scale_l_tx1 = 3; // //Illum scale for H [043.4mA:1.4mA X 31]
    
        this->reg.illum_dac_h_tx2 = 31;  // //High Current settings [173.6mA:5.6mA X 31]
        this->reg.illum_scale_h_tx2 = 0; // //Illum scale for H [173.6mA:5.6mA X 31]
    
        this->reg.illum_dac_l_tx2 = 31;  // //High Current settings [043.4mA:1.4mA X 31]
        this->reg.illum_scale_l_tx2 = 3; // //Illum scale for H [043.4mA:1.4mA X 31]
    
        this->reg.tx_seq_reg = 2340; // //Setting TX Switching order
        this->reg.en_tx_switch = 1;  // 1 charge!!! //Enable TX Switching order
    
        this->reg.sel_tx_ch = 0;
    
    
        this->reg.ILLUM_DC_CURR_DAC = 4;  //!!! add , bias current x 0.5mA
    
        this->reg.tg_en = 1; // //Enables Timing Generator
    
        this->configurationFlags_xtalkFilterTau = 3;   // //This is not a register but a settings flag for the SDK
        this->configurationFlags_monoshotMode = false; // //This is not a register but a settings flag for the SDK
        this->configurationFlags_xtalkSettlingOneTauInMilliSeconds =
            512; // //This is not a register but a settings flag for the SDK
        this->configurationFlags_xtalkSettlingOneTauInDataReadyCounts =
            8;                                                   // //This is not a register but a settings flag for the SDK
        this->configurationFlags_frameTimeInMilliSeconds = 64;   // //This is not a register but a settings flag for the SDK
        this->configurationFlags_avgFrameCountExponentOfTwo = 7; // //This is not a register but a settings flag for the SDK
    
        // tx2 xtalk compensation
        // this->reg.EN_CTALK_FB_CLK=1;
        // this->reg.EN_CALIB_CLK=1;
        // this->reg.calib_curr1_en_I=1;
        // this->reg.calib_curr1_gain_sel=0;
        // this->reg.calib_curr1_DAC_I=4;
        // this->reg.calib_curr1_inv_CLK_I=0;
    }

    void OPT3101::device::perUnitFactoryUpdateIllumXtalk()
    {
    
        this->reset(); ///* Resets the device calling OPT3101::device::reset method
    
        host.printf("INFO::Writing Initialization sequence I2C registers\r\n");
        this->initialize(); ///* Initializes the OPT3101 device by calling OPT3101::device::initialize method
        host.printf("INFO::Device Initialization Completed\r\n");
        this->measureAndCorrectInternalCrosstalk(&this->calibration->internalCrosstalk[0]); ///* Calls method OPT3101::device::measureAndCorrectInternalCrosstalk with argument OPT3101::calibrationC::internalCrosstalk
        this->calibration->internalCrosstalk[0].report(); ///* Calls the method OPT3101::crosstalkC::report for debug and data analysis
    
        this->measureIllumCrosstalkSet(false);
        this->loadIllumCrosstalkSet(false); ///* Calls the OPT3101::device::loadIllumCrosstalkSet with false argument so that method to load all illum crosstalk settings from the OPT3101::device::crosstalk::illumCrosstalk member
    
        // this->calibrationSession_perUnitFactoryCalibrationWriteRegisterDataToNonVolatileMemory(); ///* Calls the OPT3101::device::calibrationSession_perUnitFactoryCalibrationWriteRegisterDataToNonVolatileMemory to store the calibration data to a non-volatile memory
    }

    Regards,

    Annie

  • Annie,

      I am reviewing your settings. I always check hardware first. My first thought is to verify the PCB and supplies, then check communications, I see you have pull up resistors. Verify they are being pulled up. I am going to suggest verifying the polarity of the emitter and the photodiode just in case. I will need time to go through these settings and see what else comes to mind. Verify you can talk to the part correctly by reading out some registers and check the values. 

    If this is your own board, I assume you have written your own code to talk the the OPT3101. You may have an initiliazition issue. Let me know how some of this works and I will see if I can find something simple to verify that you are communicating.  

  • Hi Gordon,

    Thank you very much for your reply.

    This is the schematic diagram of my test system. I am checking my PCB hardware problem.

    The IIC communication is observing the correct waveform and data through the oscilloscope.

    Other hardware problems are under investigation. When the materials are purchased back, SFH4556 and SFH203PFA will be replaced with the corresponding devices in EVM for confirmation.

    Best regards

    kailyn

  • kailyn,

      Thank you, keep me up to date on your progress and let me know if you have more questions.