Part Number:OPT3101-SDK
您好!
我们参考OPT3101-EVM设计的测距模块,使用了TI官网的OPT3101-SDK的代码,初始化模块为普通非HDR连续读模式。在这个模式下将系统分别单独配置为默认10MHz和去混叠8.57MHz时,校准和测量都是正常的。但是校准好串扰和相位偏差,同时初始化好8.57MHz时的ALPHA1_DEAL_SCAL、BETA1_DEAL_SCAL、PHASE2_OFFSET_HDR0_TX0、PHASE2_OFFSET_HDR1_TX0这几个寄存器,配置为去混叠模式后,系统不会自动正常切换频率,请问这可能是什么原因?此时,mod_freq打印值会在0和1之间交替变化,但是发射管几乎没有什么电流输出,用示波器测量发射管脉冲频率一直都是10MHz。
参考了TI论坛的一些帖子,但是仍未完全解决我的问题:
OPT3101: using dealias mode
OPT3101: How to perform dealiasing? If I want to measure a distance greater than 15 meters
相关调试信息如下:
1. 寄存器初始化代码
void OPT3101::device::initializeDealiasTest(void){// List of registers to initialize OPT3101 device after power-up this->reg.force_en_slave = 1; // //Since I2C Master bus is floating this register needs to be set to enable device to respond 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 = 0; // //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; // 12=100uA, 14=200uA //Sets maximum ambient support this->reg.en_temp_corr = 1; 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 = 63; // //Sub frames count this->reg.num_avg_sub_frames = 63; // //Average frames count this->reg.xtalk_filt_time_const = 4; // //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 = 63; // //Same as AvgFrame Count this->reg.tg_seq_int_mask_end = 63; // //Same as AvgFrame Countthis->reg.illum_dac_h_tx0 = 18; // //High Current settings: [173.6mA:5.6mA X 31], [078.4mA:5.6mA X 14], [067.2mA:5.6mA X 12] this->reg.illum_scale_h_tx0 = 0; // //Illum scale for H: 0=5.6mA, 1=4.2mA this->reg.sel_hdr_mode = 1; // //Selecting H Channel by defaultthis->reg.tx_seq_reg= 2184; // //Setting TX Switching order this->reg.en_tx_switch = 0; // //Enable TX Switching order//this->reg.override_clkgen_reg = 1;// 将此寄存器设置为 1 可允许用户独立控制 DEALIAS_FREQ、 DEALIAS_EN。//this->reg.dealias_en = 1;// 更改调制频率,去混叠使能。 仅当 OVERRIDE_CLKGEN_REG = 1 时, 此寄存器才有效。//this->reg.en_multi_freq_phase = 1;// 如果此位设置为 1 且 EN_DEALIAS_MEAS = 1, 则 PHASE_OUT 寄存器为相位测量提供两个频率。 相位的频率在 MOD_FREQ 状态位中指示。0: 10MHz 调制 | 1: 10MHz 和 10 × (6 / 7) MHz 或 10 × (6 / 5) MHz 调制//this->reg.dealias_freq = 0;// 当 DEALIAS_EN = 1 时, 选择调制频率。 仅当 OVERRIDE_CLKGEN_REG = 1 时, 此寄存器才有效。0: 10 × (6 / 7) MHz | 1: 10 × (6 / 5) MHz。this->reg.command0 = 0x100; // Set to fo = 10MHzthis->reg.command1 = 0x102; // Set to fo to de-alias frequencythis->reg.command2 = 0x400; // Go to Command0this->reg.ncr_config = 0;// 选择第二个频率进行去混叠操作。0: 10 × (6 / 7) MHz |1: 10 × (6 / 5) MHz。this->reg.give_dealias_data = 1;// 此寄存器设置为 1 时, 在 PHASE_OUT 上发出去混叠的相位。this->reg.en_sequencer = 1;// 启用序列发生器。0: 启用序列发生器 | 1: 禁用序列发生器。this->reg.en_processor_values = 1;// 使用STATUS_OUT值而不是寄存器值。//this->reg.en_dealias_meas = 1;// do it in command1 // 启用去混叠测量。0: 默认工作模式 | 1: 去混叠工作模式 this->reg.tg_en = 1; // //Enables Timing Generator this->configurationFlags_xtalkFilterTau = 4; // //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= 256; // //This is not a register but a settings flag for the SDK this->configurationFlags_xtalkSettlingOneTauInDataReadyCounts= 16; // //This is not a register but a settings flag for the SDK this->configurationFlags_frameTimeInMilliSeconds= 16; // //This is not a register but a settings flag for the SDK this->configurationFlags_avgFrameCountExponentOfTwo= 6; // //This is not a register but a settings flag for the SDK } OPT3101::device::device(void): configurationFlags_isTXChannelActive{true,false,false}, configurationFlags_isRegisterSetActive{false,true} {} OPT3101::calibrationC::calibrationC(void) : calibrationC(true) { this->recordLength= 1; // //This configuration requires 1 crosstalk and other configuration record(s) this->registerAddressListSize= 17; // //This configuration requires 17 registers [544] bits to be stored for calibration this->EEPROM_connected= false; // //This configuration helps configure EEPROM this->extTempSensor_connected= false; // //This configuration helps configure Ext temp sensor this->registerAddressList[0] = 0x31; // //Address for register(s) iphase_xtalk_reg_hdr1_tx0 this->registerAddressList[1] = 0x32; // //Address for register(s) qphase_xtalk_reg_hdr1_tx0 this->registerAddressList[2] = 0x5e; // //Address for register(s) temp_coeff_xtalk_iphase_hdr1_tx0 this->registerAddressList[3] = 0x60; // //Address for register(s) temp_coeff_xtalk_qphase_hdr1_tx0 this->registerAddressList[4] = 0x51; // //Address for register(s) phase_offset_hdr1_tx0,temp_coeff_illum_hdr1_tx0 this->registerAddressList[5] = 0x48; // //Address for register(s) tmain_calib_hdr1_tx0,tillum_calib_hdr1_tx0 this->registerAddressList[6] = 0x2d; // //Address for register(s) temp_coeff_main_hdr1_tx0 this->registerAddressList[7] = 0x52; // //Address for register(s) temp_coeff_illum_hdr1_tx0 this->registerAddressList[8] = 0x2e; // //Address for register(s) illum_xtalk_reg_scale this->registerAddressList[9] = 0x3a; // //Address for register(s) scale_temp_coeff_xtalk this->registerAddressList[10] = 0x71; // //Address for register(s) shift_illum_phase this->registerAddressList[11] = 0x43; // //Address for register(s) en_phase_corr,en_temp_corr,scale_phase_temp_coeff this->registerAddressList[12] = 0xb5; // //Address for register(s) scale_amb_phase_corr_coeff this->registerAddressList[13] = 0x0c; // //Address for register(s) amb_phase_corr_pwl_coeff0 this->registerAddressList[14] = 0xb4; // //Address for register(s) amb_phase_corr_pwl_coeff1,amb_phase_corr_pwl_coeff2,amb_phase_corr_pwl_coeff3 this->registerAddressList[15] = 0xb8; // //Address for register(s) amb_phase_corr_pwl_x0,amb_phase_corr_pwl_x1 this->registerAddressList[16] = 0xb9; // //Address for register(s) amb_phase_corr_pwl_x2 }
非常感谢您的回复!
Amy Luo:
您好,为更加有效地解决您的问题,我们建议您将问题发布在E2E英文技术论坛上,将由资深的英文论坛工程师为您提供帮助。
英文论坛对应子论坛链接:https://e2e.ti.com/support/sensors-group/sensors/f/sensors-forum