We've been encountering an issue since the beginning of working with this chip where the TI algorithms fail to analyze waveforms. It's like TI refuses to analyze them. You can reset the module, reinitialize everything, and and take a number of different corrective actions, but the TI algorithms will NEVER work again until a reset is performed. Sometimes the TI algorithms start in this state. We don't think the waveforms matter either. We've tried storing waveforms in the code and using the same waveforms over and over again. Sometimes TI will process them and sometimes it fails on the exact same waveforms. Please find a brief debug console log below. It has been annotated to show the issue.
Reset reason: PMMSWBOR software BOR <------- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ******************************** reconfigure_meter Waiting for temperature Waiting for temperature # Debug code: USS_absTOF_status_object status; USS_message_code code = USS_getAbsTOFStatus(&gUssSWConfig, &status); printf("%d UPS(%d %f %s %0.3f) DNS(%d %f %s %0.3f) %+0.2f %d %d\r\n", code, status.UPS.indexMaxAmplitude, _IQ16toF(status.UPS.iq16Index), _stateText(status.UPS.state), data->algResults.totalTOF_UPS * 1e6, status.DNS.indexMaxAmplitude, _IQ16toF(status.DNS.iq16Index), _stateText(status.DNS.state), data->algResults.totalTOF_DNS * 1e6, data->algResults.deltaTOF * 1e12, data->algResults.messageCode, // <-- from TI's USS_Algorithms_Results signalAnalysis_getLastMessageCode()); // <-- USS_runAlgorithms() return value # Annotated output: # (MaxIndex 1stPeakIndex Mode AbsTOF) (MaxIndex 1stPeakIndex Mode AbsTOF) dTOF AlgResults.MessageCode USS_runAlgorithms() 0 UPS(0 0.000000 search 59.227) DNS(0 0.000000 search 59.227) -25.41 0 122 # ADC Delay adjusted for current temperature and body size: # gUssSWConfig.measurementConfig->startADCsamplingCount = newValue; # USS_updateSAPHConfiguration(&gUssSWConfig); # USS_initAlgorithms(&gUssSWConfig); ADC Delay SAPH Count: 345 (69.00 us) --> 348 (69.60 us, computed 69.65 us, error -51.7 ns) 0 UPS(0 0.000000 search 59.227) DNS(0 0.000000 search 59.227) -25.41 0 122 # Where we found the first peaks using our own algorithm ADC First Peaks: 32 u 32 d # TI always returns index 0 or 1 when in error. # The AbsTOF numbers are very close to the ADC delay. # TI always returns: USS_message_code_valid_results = 122 # even though the numbers are wrong. ti failed to find a first peak 0 UPS(0 1.000000 search 59.228) DNS(0 1.000000 search 59.228) -22.68 0 122 ti failed to find a first peak 0 UPS(0 1.000000 search 59.228) DNS(0 1.000000 search 59.228) -22.68 0 122 ti failed to find a first peak 0 UPS(0 1.000000 search 59.228) DNS(0 1.000000 search 59.228) -22.68 0 122 ti failed to find a first peak 0 UPS(0 1.000000 search 59.228) DNS(0 1.000000 search 59.228) -22.68 0 122 # Meter detects the TI error and eventually resets. # It can take only 1 reset or hours of resets before the TI algorithm works as seen below Reset reason: RSTIFG RST/NMI ******************************** reconfigure_meter Waiting for temperature Waiting for temperature 0 UPS(0 0.000000 search 0.000) DNS(0 0.000000 search -0.000) +0.00 11240 122 ADC Delay SAPH Count: 345 (69.00 us) --> 348 (69.60 us, computed 69.65 us, error -49.7 ns) 0 UPS(0 0.000000 search 0.000) DNS(0 0.000000 search -0.000) +0.00 11240 122 ADC First Peaks: 32 u 32 d # Annotated: # Water Temp v-- where math says the avg(U+D) AbsTOF should be v-- where TI found it (our math isn't perfect) 76.370 F | Center (+-5%) 60.47 63.65 66.83 | dTOF_Center 63.10 | AbsTof_Center 63.10 0 UPS(0 31.952118 track 63.096) DNS(0 31.949249 track 63.096) +14.27 0 122 0 UPS(0 31.946564 track 63.096) DNS(0 31.952118 track 63.096) +39.85 0 122 0 UPS(0 31.953186 track 63.096) DNS(0 31.948669 track 63.096) +13.19 0 122 0 UPS(0 31.950378 track 63.096) DNS(0 31.952484 track 63.096) +17.85 0 122
Since the TI algorithms are closed source, we can't debug this. We can only throw code at it and see if the TI results change without knowing why.
Thanks.