SSDA010 August 2025 MSPM0G3507
The main loop runs a self-compensating sequence that includes DC bias adjustment, cascaded voltage calculation, saturation control, and UART transmission.
Figure 7-1 Main.c coderemove_dc_voltage() calculates the amplified input using the
output of the first op amp and DAC reference. An exponential moving average (EMA) filter
isolates the DC component, and the DAC is adjusted to center the output voltage around
mid-scale.cascade_input_voltage() computes the cascaded signal G1⋅G2⋅Vin
using both DAC values and op amp outputs. This output represents the system's filtered and
gain-corrected signal.saturation_control() prevents output clipping in the second op amp
by adjusting the DAC reference if the output voltage exceeds defined limits.send_UART_Data() breaks the 32-bit cascaded output into 4 bytes
and transmits over UART.All tunable system constants such as gain
values, voltage thresholds, buffer length, and smoothing factor are defined in
customizable_features.h.