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.

MSP430FR6047: How to change the USS parameters without using Ultrasonic Sensing Design Center

Part Number: MSP430FR6047

Hi Everyone,

I am trying to change the USS parameters Transmit frequency, gap between pulse start and ADC capture, number of pulses, UPS and DNS gap, UPS0 and UPS1 gap and gui based gain control. However I want to change these parameters without using USDC (Ultrasonic Sensing Design Center) . I have  a device connected to MSP via JTAG UART (TXD and RXD), is it possible to change these parameters via UART or is there any other better way to do this?

Thanks in advance
Antony

  • Hi Antony,

    I don't believe that we have a full example for configuration via UART, but there is an example of getting basic UART output data.

    Please see Leonardo's answer in this older thread: https://e2e.ti.com/support/microcontrollers/msp-low-power-microcontrollers-group/msp430/f/msp-low-power-microcontroller-forum/919211/evm430-fr6047-how-to-communicate-with-the-uss-design-center-gui-through-uart-instead-of-i2c

    He also points to the library documentation, which will show what configuration functionality is available. 

    Best Regards,
    Brandon Fisher

  • Hi Brandon ,

    Thank you for your response.

    I am using FR6047_USSSWLib_template_example for clamp on flow meter, I am collecting the data via UART, since we are testing it as clamp on flow meter when the pipe diameter changes the USS parameters mentioned above have to be changed. Using the same UART can we change the USS parameter as well.

    Regards
    Antony

  • Hi Antony,

    Currently looking into this. Will update you again today. 

    Best Regards,
    Brandon Fisher

  • Hi Antony,

    From the looks of that basic UART example, it doesn't seem to have any handling for receiving UART commands. If you wanted to add that functionality to the example code you could. 

    According to the Ultrasonic Sensing Design Center User's Guide, the UPS to DNS gap is really just a convenient parameter for the design center GUI. What you really want to modify are the restartCaptureCount and restartLowPowerCaptureCount members of the USS_Measurement_Configuration structure. Section 13.10 and 13.11 of that same user's guide give the relationship. 

    In the example firmware this value is initially set using the USS_configureUltrasonicMeasurement() function from the library. 

    From the user's guide its not clear how UPS0 to UPS1 is implemented, but based on the description I believe this is just done via the measurementPeriod member of the ussSystemConfig struct. You can also set this using the USS_configAppTimerPeriod() function of the USS Library. 

    You can find a description for all of these functions from the library in the API Guide. 

    Best Regards,
    Brandon Fisher

  • Hi Brandon,

    Thanks for your valuable suggestion, I was able to modify the FR6047_USSSWLib_template_example to receive UART command and I found a way to change the UPS0 and UPS1 gap by setting USS_configAppTimerPeriod() function of the USS Library. 

    However, I am struggling to change the GAP between pulse start and ADC capture, this configured in USS_message_code USS_updateSAPHConfiguration() function in UssSoftwareLibraryConfiguration.c, in this function at line 542 this parameter is set ashown below

    GENERIC_SAPH_ATM_D = config->measurementConfig->startADCsamplingCount;

    Here startADCsamplingCount is ((USS_PLL_FREQ*USS_ADC_SAMP_COUNT_SEC)/16) and USS_ADC_SAMP_COUNT_SEC is GAP between pulse start and ADC capture.


    Any suggestion to reconfigure this parameter while the MSP is running in while loop?

    Thanks
    Antony

  • Hi Antony,

    Based on the API guide description you are targeting the correct parameter and using the correct function.

    Do you see the SAPH.ATM_E.TimeMarkE value updating when you call this function? When running in Debug mode in CCS or IAR you can use the Register view window to check this. 

    Best Regards,
    Brandon Fisher

  • Hi Brandon,

    I tried debugging and found out value updating the register SAPH, is shown below.

    SAPHATM_D is setting with value 0x0339 which is 825 in decimal. It is exactly what you get from ((USS_PLL_FREQ*USS_ADC_SAMP_COUNT_SEC)/16) where USS_PLL_FREQ is 80 MHz and USS_ADC_SAMP_COUNT_SEC is 165 micro seconds.

  • According to the user's guide that is the correct register value to modify. Can you describe the issue you are seeing in more detail? Is the ASQ to ADC capture time not properly changing when you set this parameter? 

    Best Regards,
    Brandon Fisher

**Attention** This is a public forum