Figure 4-4 shows the flow diagram of the application.
The application starts by initializing the basic functionality of
the system including peripherals, clocks, and I/Os, followed by initializing the HMI peripherals including LCD,
GUI communication, buttons, and LEDs. Finally, the system performs the initial configuration of the ultrasonic
subsystem and its algorithms.
After initialization, the application stays in a continuous loop
performing the following tasks:
- HMI pre-measurement: Performs user interaction functions before
an ultrasonic measurement, such as checking if the GUI has a new configuration to send or if the user
pressed a button.
- USS measurement: Performs an ultrasonic measurement. The result
of this function is an ADC-sampled waveform.
- HMI post-measurement: Performs user interaction functions after
a measurement such as sending the ADC waveform to the GUI.
- USS algorithms: Runs ultrasonic algorithms on the ADC-sampled
waveform to calculate data such as the ToF and volume flow rate.
- HMI post-algorithms: Performs user interaction functions after
the algorithms are executed. This includes sending the results to the GUI or displaying them on the
LCD.
- Delay: The device goes to a low-power state waiting for the
next iteration.
For more information on the architecture and implementation of the
application, see the MSP Ultrasonic Sensing User’s Guide and the USS Library API Guide.