SLAAES9 March   2025 MSP430FR5043 , MSP430FR6005 , MSP430FR6007 , MSP430FR6043 , MSP430FR6045 , MSP430FR6047

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Flow Meter Measurement Theory
    1. 2.1 TOF Measurement Algorithm Implementation
      1. 2.1.1 AbsTOF Calculation Method – Lobe
      2. 2.1.2 AbsTOF Calculation Method – Hilbert Wide
      3. 2.1.3 dTOF Calculation Method - Cross-Correlation
        1. 2.1.3.1 Get a High-Precision dTOF Result
        2. 2.1.3.2 Optimization in Cross-Correlation Method
    2. 2.2 Differences between ADC Approach and TDC Approach
  6. 3MSP430 MCUs for USS Application
    1. 3.1 USS Module
    2. 3.2 Differences Between USS and USS_A Module
    3. 3.3 Software Implementation on MSP430 MCUs
  7. 4Hardware Design Flow
    1. 4.1 Schematics
      1. 4.1.1 Water Meter Schematic – MSP430FR6047 and MSP430FR6007
      2. 4.1.2 Water Meter Schematic – MSP430FR6043 and MSP430FR5043
      3. 4.1.3 Gas Meter Schematic – MSP430FR6043 and MSP430FR5043
    2. 4.2 PCB Layout Guide
  8. 5Software Design Guide
    1. 5.1 USS Demo Projects and Related Resources
    2. 5.2 Demo Project Instruction
      1. 5.2.1 Files in Demo Project
      2. 5.2.2 Properties Setting in Demo Project
  9. 6Summary
  10. 7References

Files in Demo Project

Figure 5-2 shows what includes in an USS demo project.

 Files in Demo Project Figure 5-2 Files in Demo Project
  1. Common folder: this includes the USS DC drivers, protocol, utility and command handler. Use one I2C port and an interrupt pin for the communication between the MCU and USS DC. Also prepare an UART interface in this part of code. This can be used for users to build a GUI. Currently, the USS DC does not support using UART communication.
  2. Driverlib folder: this includes the driver library for the MSP430 peripherals.
  3. Hal folder: the hal_adc includes hardware abstraction layer for ADC functions such as using the integrated 12bit SAR ADC for internal temperature sensor capture and external input voltage capture. The hal_lcd includes hardware abstraction layer for FH-1138P segmented LCD. The hal_system includes hardware abstraction layer for MSP system including clocks, watchdog and GPIOs. The hal_uart includes hardware abstraction layer for UART communication.
  4. IQMathLib and QMathLib folder: the MSP IQmath and Qmath Libraries are a collection of highly optimized and high-precision mathematical functions for C programmers to seamlessly port a floating-point algorithm into fixed-point code on MSP430 and MSP432 devices. These routines are typically used in computationally intensive real-time applications where best execution speed, high accuracy and ultra-low energy are critical. By using the IQmath and Qmath libraries, users can achieve execution speeds considerably faster and energy consumption considerably lower than equivalent code written using floating-point math.
  5. USS_Config folder: all modifications to USS SW library are contained in USS_userConfig.h. The USS_userConfig.c contains all temporary buffer used by the library. The lookup tables are used for interpolation method used in the USS library. The calibration header file contains the flow rate calibration data. Users can use USS DC to generate all these header files with custom configuration for certain applications. Then, replace the original one in the project and rebuild and program the project with the new generated header files. MCu does not need to reconfigure these parameters for tests this way.
  6. USSLibGUIApp folder: this folder handles the interaction between USS library and USS DC. The main loop of the project also handles in USSLibGUIApp.c. Users can add an application code in main loop.
  7. UssSWLib folder: this folder contains the USS library and the header file. The ussSwLib.h header file contains all USS library enums, structs, macros, function and global variables definitions. The comments in this header file are also very important for the users to have a better understanding of each variable.
  8. Linker file: the lnk_msp430fr6047.cmd tells compiler where to put the program, data and other things like interrupt vectors in the MSP430 memory space. The linker file in the demo project has been modified to fit the requirement of USS library.