MSP430FR6047: 流道为空管时,程序跑飞问题

Part Number: MSP430FR6047

此前我询问过此问题,但依旧没解决,现在我有新的发现,程序是我结合DEMO程序自己写的,首先我确认我在使用2MHz超声波晶片换能器时,无论管路有无液体,程序运行均正常,且USS库能正常返回数值。当我将换能器更换为1MHz时,并通过USS图形软件生成了对应的.h文件,程序烧录后,在管路有液体时,程序执行也正常,但是当管路无液体时,程序执行USS_runAlgorithmsFixedPoint函数后,会跑飞。

  • <struct> Memory:0x50f4 USS_SW_Library_configuration
    systemConfig ussSystemConfig (0x4F16) Memory:0x50f4 USS_System_Configuration *
    mCLKFrequency 8'000'000 Memory:0x4f16 uint32_t
    LFXTFrequency 32'768 Memory:0x4f1a uint16_t
    timerBaseAddress 896 Memory:0x4f1c uint16_t
    measurementPeriod 983 Memory:0x4f1e uint16_t
    diagMode USS_diagnostics_mode_2 (2) Memory:0x4f20 USS_diagnostics_mode
    meterConfig ussMeterConfig (0x4F2E) Memory:0x50f8 USS_Meter_Configuration *
    volumeScaleFactor 2.701'798'75E+6 Memory:0x4f2e float
    volumeAddlScaleFactor 1.0 Memory:0x4f32 float
    acousticLength 70.0 Memory:0x4f36 float
    transducerFreq 1'000'000 Memory:0x4f3a uint32_t
    measurementConfig ussMeasurementConfig (0x4F60) Memory:0x50fc USS_Measurement_Configuration *
    sequenceSelection '.' (0x02) Memory:0x4f60 uint8_t
    eofSequenceState USS_measurement_end_of_sequence_state_power_off (256) Memory:0x4f62 USS_measurement_end_of_sequence_state
    ch0DriveStrength USS_measurement_drive_strength_pre_trimmed_drive (0) Memory:0x4f64 USS_measurement_drive_strength
    ch1DriveStrength USS_measurement_drive_strength_pre_trimmed_drive (0) Memory:0x4f66 USS_measurement_drive_strength
    pulseConfig ussPulseConfig (0x4F4E) Memory:0x4f68 USS_Pulse_Configuration *
    startPPGCount 75 Memory:0x4f6c uint_least16_t
    turnOnADCCount 25 Memory:0x4f6e uint_least16_t
    startPGAandINBiasCount 0 Memory:0x4f70 uint_least16_t
    startADCsamplingCount 222 Memory:0x4f72 uint_least16_t
    restartCaptureCount 937 Memory:0x4f74 uint_least16_t
    captureTimeOutCount 3'750 Memory:0x4f76 uint_least16_t
    restartLowPowerCaptureCount 98 Memory:0x4f78 uint_least16_t
    ulpBiasDelay USS_measurement_ULP_bias_delay_300_usec (3) Memory:0x4f7a USS_measurement_ULP_bias_delay
    biasImpedance USS_measurement_bias_impedance_2800_Ohms (3) Memory:0x4f7b USS_measurement_bias_impedance
    muxChargePumpMode USS_measurement_mux_charge_pump_always_off (1) Memory:0x4f7c USS_measurement_mux_charge_pump
    startRxEnCount 0 Memory:0x4f7e uint16_t
    pllConfiguration ussPLLConfig (0x4FA0) Memory:0x5100 USS_HSPLL_Configuration *
    ussXtalFreq USS_HSPLL_input_clock_freq_8_MHz (1) Memory:0x4fa0 USS_HSPLL_input_clock_freq
    HSPLLInputCLKType USS_HSPLL_input_clock_type_ceramic_resonator (512) Memory:0x4fa2 USS_HSPLL_input_clock_type
    pllOutputFreq USS_HSPLL_output_clk_freq_80_MHz (0) Memory:0x4fa4 USS_HSPLL_output_clk_freq
    outputPLLXtal 0 Memory:0x4fa5 bool
    hspllTolerance 419 Memory:0x4fa6 uint16_t
    ussXTALsettlingCount 164 Memory:0x4fa8 uint16_t
    captureConfig ussCaptureConfig (0x4FB4) Memory:0x5104 USS_Capture_Configuration *
    overSampleRate USS_Capture_Over_Sample_Rate_10 (0) Memory:0x4fb4 USS_Capture_Over_Sample_Rate
    sampleSize 320 Memory:0x4fb6 uint16_t
    gainRange USS_Capture_Gain_Range_10_7 (38) Memory:0x4fb8 USS_Capture_Gain_Range
    enableWindowHiComp 0 Memory:0x4fb9 bool
    enableWindowLoComp 0 Memory:0x4fba bool
    windowHighThreshold 1'040 Memory:0x4fbc int
    windowLowThreshold -1'040 Memory:0x4fbe int
    agcConstant 60 Memory:0x4fc0 uint16_t
    pCapturesBuffer gUSSLEATempMemBlock (0x2C60) Memory:0x4fc2 int *
    maxCapture 700 Memory:0x4fc6 uint16_t
    isCapAccumulationEnabled 0 Memory:0x4fc8 bool
    pAccCaptureBuffer 0x0 Memory:0x4fca int *
    triggerConfig ussTriggerConfig (0x5140) Memory:0x5108 USS_Trigger_Configuration *
    triggerConfig USS_Triger_Configuration_Software_Trigger (0) Memory:0x5140 USS_Trigger_Configuration_Trigger
    algorithmsConfig ussAlgConfig (0x4FE8) Memory:0x510c USS_Algorithms_User_Configuration *
    absTOFInterval 1 Memory:0x4fe8 uint16_t
    ADCAdditionalCaptureDelay 0.0 Memory:0x4fea float
    dcOffset 0.0 Memory:0x4fee float
    ratioOfTrackLobeToPeak 3.100'000'02E-1 Memory:0x4ff2 float
    numPulsesBeforeThreshold '.' (0x01) Memory:0x4ff6 uint8_t
    windowingMode '.' (0x01) Memory:0x4ff7 uint8_t
    signalValueThresholdCheck 100.0 Memory:0x4ff8 float
    numCycleSearchCorrPeak '.' (0x02) Memory:0x4ffc uint8_t
    searchLobeSampleSteps 1 Memory:0x4ffe uint16_t
    maxRatioPeak2PeakVariation 2.000'000'03E-1 Memory:0x5000 float
    winStartIndexBackOffNumCycles '.' (0x02) Memory:0x5004 uint8_t
    winTrapzRampOverNumCycles '.' (0x04) Memory:0x5005 uint8_t
    winPeakIndex2EdgeNumCycles '\0' (0x00) Memory:0x5006 uint8_t
    corrValueThresholdCheckFactor 5.000'000'07E-2 Memory:0x5008 float
    calibratedDCOffsetUPS 0 Memory:0x500c int
    calibratedDCOffsetDNS 0 Memory:0x500e int
    isInitAlgorithms 0 Memory:0x5010 bool
    dtofVolInterval USS_dtof_volume_flow_calculation_interval_1 (1) Memory:0x5011 USS_dtof_volume_flow_calculation_interval
    pLEAMemBuffer1 gUSSLEARAMReservedBlock1 (0x31D8) Memory:0x5012 int *
    -1'024 Memory:0x31d8 int
    pNvMemBuffer gNVMemBlock (0x4496) Memory:0x5016 long *
    0 Memory:0x4496 long
    highFlowOption USS_highFlow_option_disabled (0) Memory:0x501a USS_highFlow_option
    cycleSlipThreshold 1.100'000'02 Memory:0x501c float
    thresholdX1X3 2'000'000 Memory:0x5020 long
    clockRelativeError -4'797 Memory:0x5024 _iq27
    winNumCycles 23 Memory:0x5028 uint32_t
    enableFilter 0 Memory:0x502c bool
    filterLength 0 Memory:0x502e uint16_t
    filterCoeffs 0x0 Memory:0x5030 int *
    16'383 Memory:0x0 int
    absToFOption USS_Alg_AbsToF_Calculation_Option_lobe (0) Memory:0x5034 USS_Alg_AbsToF_Calculation_Option
    pLEAMemBuffer2 gUSSLEARAMReservedBlock2 (0x321C) Memory:0x5036 int *
    29'696 Memory:0x321c int
    hilbertTransformCoeffs gUSSHilbertCoeffs (0x4EE6) Memory:0x503a int *
    -636 Memory:0x4ee6 int
    hilbertTransformCoeffsLength 12 Memory:0x503e uint16_t
    negSearchRange -20 Memory:0x5040 int
    posSearchRange 2 Memory:0x5042 int
    crossThreshold 20.0 Memory:0x5044 float
    pBinaryPattern gUSSBinaryPattern (0x34C8) Memory:0x5048 int *
    7'168 Memory:0x34c8 int
    binaryPatternLength 0 Memory:0x504c uint16_t
    maxBinaryPatternLenght 200 Memory:0x504e uint16_t
    pAdditionalBinaryPattern 0x0 Memory:0x5050 int *
    16'383 Memory:0x0 int
    additionalPatternLength 0 Memory:0x5054 uint16_t
    maxAdditionalBinaryPatternLength 0 Memory:0x5056 uint16_t
    dtoFCalcOption USS_Alg_dToF_Calculation_Option_estimate (0) Memory:0x5058 USS_Alg_dToF_Calculation_Option
    volumeCalOption USS_Alg_volume_flow_Calculation_Option_water (0) Memory:0x5059 USS_Alg_volume_flow_Calculation_Option
    maxSampleShift 20 Memory:0x505a int
    pInterpCorrectionTablePtr gUSSAbsToFLUT (0xC580) Memory:0x505c int (const *)[2]
    <array> Memory:0xc580 int (const)[2]
    [0] 0 Memory:0xc580 int const
    [1] 2'699 Memory:0xc582 int const
    interpCorrectionTableLenght 1'024 Memory:0x5060 int
    volumeCalibrationOption USS_Alg_volume_flow_Calibration_Option_disabled (0) Memory:0x5062 USS_Alg_volume_flow_Calibration_Option
    calibObject <union> Memory:0x5064 union __Unnamed_2_518
    flowCalibObject 0x0 Memory:0x5064 USS_Alg_volume_Flow_Calib_Object *
    pMeterConfiguration 0xF'3FFF Memory:0x0 USS_Algorithms_Flow_Meter_Constant *
    numOfRanges '?' (0xFF) Memory:0x4 uint8_t
    flowTempCalibObject 0x0 Memory:0x5064 USS_Alg_volume_Flow_Temperature_Calib_Object *
    pQuadMeterConstants 0xF'3FFF Memory:0x0 USS_Algorithms_Quad_Meter_Constant *
    iq16M0 -12'583'105 Memory:0xf3fff long
    iq16M1 -12'583'105 Memory:0xf4003 long
    iq16M2 -12'583'105 Memory:0xf4007 long
    iq16M3 -12'583'105 Memory:0xf400b long
    pQuadPoints 0xF'3FFF Memory:0x4 USS_Algorithms_Quad_Point *
    numOfFlows '?' (0xFF) Memory:0x8 uint8_t
    numOfTemps '?' (0x3F) Memory:0x9 uint8_t
    searchQuadCount '?' (0xFF) Memory:0xa uint8_t
    rowNum '?' (0x3F) Memory:0xb uint8_t
    colNum '?' (0xFF) Memory:0xc uint8_t
    state '?' (0x3F) Memory:0xd USS_Alg_volume_flow_Calibration_state
    tempCalcObject 0x0 Memory:0x5068 USS_Alg_temperature_Calculation_Object *
    pTempLUT 0xF'3FFF Memory:0x0 long (const *)[3]
    <array> Memory:0xf3fff long (const)[3]
    [0] -12'583'105 Memory:0xf3fff long const
    [1] -12'583'105 Memory:0xf4003 long const
    [2] -12'583'105 Memory:0xf4007 long const
    tempLUTLength 16'383 Memory:0x4 uint16_t
    iq24transducerConstant 1'073'692'671 Memory:0x6 long
    temperatureCalcOption USS_Alg_temperature_Calculation_Option_disabled (0) Memory:0x506c USS_Alg_temperature_Calculation_Option
    interruptConfig ussInterruptConfig (0x513C) Memory:0x5110 USS_Interrupt_Configuration *
    enableUUPSPREQIGInterrupt 0 Memory:0x513c bool
    enableSAPHPingTransmitDoneInterrupt 0 Memory:0x513d bool
    validationKey 0 Memory:0x5114 uint16_t  这个是我的uss配置  只要流道变成空管后  调用USS_runAlgorithmsFixedPoint程序就直接跑飞了

  • 您好,

    已经收到了您的案例,调查需要些时间,感谢您的耐心等待

  • 我们会尽快找到专家来协助您。

  • 我们会尽快找到专家来协助您。

  • 你好,

    你比较过图形用户界面生成的文件和你的项目文件吗?它们之间有什么区别?或者你可以上传相关的配置文件(.h 文件),我可以看一下。

    此致,
    彼得

  • 您好!

    首先,感谢您的回复,我的USS_userConfig.h文件,是通过USS软件生成的,是我使用MSP430FR6047评估板搭配结构所采取的配置。我想将其复制发出来,但不知道为什么,添加后回复时,论坛显示出现错误。

  • 你好,

    能否请您也上传一下您使用 2MHz 传感器时的文件?我也想看一下。另外,您之前在使用 1MHz 传感器时遇到过无液体情况下的卡顿问题,而使用 2MHz 传感器时没有出现这个问题。这两个传感器之间的唯一区别是否仅仅是您更换了传感器并修改了 userConfig.h 文件?您还做了哪些其他修改?

    此致,
    彼得

  • 您好!

    感谢您的回复,是的,我仅更换了.h文件,甚至我仅更改.h文件中的频率,依然会导致此现象。

  • 你好,

    我注意到您设置的参数USS_SYS_MEASUREMENT_PERIOD有点小,983 对应 30 毫秒,我对这个参数设置有些担忧,怀疑算法卡住可能是由此引起的,能否请您将其增加到 32768(对应 1 秒)看看是否可以解决这个问题?

    此致,
    彼得

  • 好的  我尝试一下  如果是由于此时间导致  建议最快设置到多少

  • 你好,

    友情提醒,请注意,更高的测量速率会增加功耗。我没有测试过最短的测量周期,所以无法提供具体的数值,因为它与传感器之间的距离以及其他一些相关参数设置有关。测量周期包含信号传输和算法处理的时间,因此需要预留足够的时间。我建议您先将其设置为较大的数值,例如 1 秒,待一切正常后再尝试逐渐缩短测量周期。

    此致,
    彼得