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.

BOOSTXL-PGA460: Exporting settings from the EVM GUI

Part Number: BOOSTXL-PGA460
Other Parts Discussed in Thread: PGA460, ENERGIA, PGA460-Q1, MSP-EXP430F5529LP, MSP430F5529

Hello,

I'm currently evaluating the PGA460 interfaced with an Arduino, of which I got the communication working by porting https://github.com/PX4/Firmware/tree/master/src/drivers/distance_sensor/pga460.

However the way the registers with the thresholds are set up it's extremely inconvenient to manually tune the values needed for my purpose, especially since the default values in the Energia library(I copied the Murata MA58MF14-7N values to the library port) don't work as a reference point(the distance is usually the max range). I've tried the simulate option in the GUI to generate the values for me but I can't seem to export the values where the delta time and threshold register(Px_THR_0-15) values are done for me. Is it even possible?

I also don't understand how the other values like (fixed) TVG come into play. There's also mentions of digital/analog gain but it's not clear how these should be tuned.

  • Hi Frank,

    I have never seen this PX4 version of the PGA460 firmware, so I am not certain on its credibility/stability.
    The TI "PGA460 Energia Library and Code Example" ( www.ti.com/.../slac741 ) can be ported and reused in Arduino as well.

    Either way, the PGA460-Q1 EVM GUI offers a user-friendly method of manually adjusting and fine-tuning the threshold levels and times. See the "PGA460 ultrasonic sensing: EVM GUI device configuration" video ( training.ti.com/pga460-ultrasonic-sensing-evm-gui-device-configuration ) for a demonstration on how to optimize both the time varying gain and threhold values. I encourage you to also view the "PGA460 ultrasonic sensing: EVM GUI data monitor" video ( training.ti.com/pga460-ultrasonic-sensing-evm-gui-data-monitor ) to fully understand how the time varying gain and digital gain features visually impact the echo data dump result.

    Once you have optimized the threshold, time varying gain, and digital gain values using the EVM-GUI, you can export a text file with all raw user register values (including all Px_THR_0-15 threhsold values), so that you can import these values into your Arduino code. To do so, navigate to the GUI's Memory Map page, and click the save icon. When attempting to save, you will be prompted to first read all the register values. It is important that you click yes to ensure the threshold memory rows are properly updated on the grid. See the "PGA460 ultrasonic sensing: EVM GUI system diagnostics" video ( training.ti.com/pga460-ultrasonic-sensing-evm-gui-system-diagnostics ) for a demo of the memory map export.

    Note: to use the TVG and threhsold GUI features, you must have the actual PGA460-Q1 EVM hardware. The Memory Map page's TVGAIN1-6 and Px_THR_0-15 cannot be updated without the actual device to read/write from. Simulation mode only works with the other memory map values (which are linked to the GUI's General and Diagnostic page values).
  • Just to be clear I don't have the MSP-ESP430 Launchpad board. I just have the EVM module + daughterboard. Can I still use the GUI for value generation in that case? I can't seem to populate the memory map fields in simulation mode. When I click

    I've ported the Energia library, which took a surprising low amount of time, and used the AutoThreshold sketch to generate the threshold values for me and ran the GetDistance sketch, which gave me valid values for 0.3-1 meters. That still leaves TVG and Digital gain.

    Unrelated: Can I clean up, port and modify the library and publish it for Arduino for others to use? I had to fill out and agree to some terms to download it but the software license itself seems permissive.

  • Hi Frank,
    Without the MSP-EXP430F5529LP, the Threshold and Time Varying values will not update on the Memory Map page. Simulation mode will not be able to substitute as a workaround either. I will need to update the GUI to enable Memory Map simulation of the Threshold and TVG values, but enabling this may take me a couple of weeks. Given the complexity and numerous configuration options on the PGA460, I strongly encourage that you also obtain the PGA460-Q1 EVM's MSP430F5529 LaunchPad to use the GUI to evaluate, optimize, and export the settings.

    I'm glad to hear you didn't have much difficulty porting the Energia library. Energia is intended to be identical in compatibility to the Arduino code and environment, so porting to or from either usually only requires pin number changes in the sketch or library files. It seems the auto threshold routine has enabled short ranging (0.3-1m), but the long ranging is likely still dependent on optimization of the TVG and/or DGM. You may need to export the Echo Data Dump plot to visually inspect the resulting profile. Can you send me a copy of the Px_THR_0-15 values the auto thresholder generated? With these values, I'll be able to gauge how effective it has been autoset for long range measurements.

    I am currently working on getting the Energia PGA460 library and example zip file to be a simple one click downloadable, but enabling this through TI.com could be a challenge. In the meanwhile, feel free to port and modify the library for the Arduino community; it is open-source. The more external references to the code, the easier the find-ability of the code.
  •  These are the values generated by the autothreshold sketch:
            byte P1_THR_0 = 0x88;
    	byte P1_THR_1 = 0x88;
    	byte P1_THR_2 = 0x88;
    	byte P1_THR_3 = 0x88;
    	byte P1_THR_4 = 0x88;
    	byte P1_THR_5 = 0x88;
    	byte P1_THR_6 = 0xFA;
    	byte P1_THR_7 = 0x0E;
    	byte P1_THR_8 = 0x73;
    	byte P1_THR_9 = 0x9C;
    	byte P1_THR_10 = 0xE7;
    	byte P1_THR_11 = 0x33;
    	byte P1_THR_12 = 0x33;
    	byte P1_THR_13 = 0x33;
    	byte P1_THR_14 = 0x33;
    	byte P1_THR_15 = 0x33;


    I also went ahead and got the MSP-ESP430 board. To be honest I'd consider using the full EVM package board a hard requirement to implement and tune the pga460 after experimenting with it. Thank you for the help anyway.

    I'll see if I can clean up the ported library and publish it somewhere like GitHub. And really, the library itself is one big mess probably caused by supporting all multiple protocols. I might just rewrite it completely dropping support for TCI and OWU since they aren't as common in my experience.