I am in early development with a PGA460 interfacing with an MCU. I have adapted the slac741h library to work with my MCU with minimal changes and am using the library similar to the example code.
The setup seems to be working, except that the ultrasonic measurement results that I am reading seem to indicate the previous result instead of the most recent. This is evident when moving the distance from an object to the transducer while debugging. After I move the object, the first result reflects the previous distance. If I trigger another measurement, then it is correct.
I would typically assume I am doing something wrong, but I notice that when using the GUI and the BOOSTXL-PGA460, requesting a single ultrasonic measurement results triggers two sets of burst pulses, leading me to believe the GUI is possibly working around the same issue by simply performing the measurement twice. Is there indeed an errata with the PGA460 that I am experiencing, or some common mistake that could have to do with pulling the result to quickly?
The commands I'm using for my measurement are ultrasonicCmd(), followed immediately by pullUltrasonicMeasResult() and printUltrasonicMeasResult(). I have inserted a delay of up to 1ms before calling pullUltrasonicMeasResult() with no change in behavior.
Any advice would be most helpful. Thanks