SLVAFN0 august   2023 MSPM0L1306 , MSPM0L1343 , MSPM0L1346 , TPS8802

 

  1.   1
  2.   Abstract
  3.   Trademarks
  4. 1Introduction
  5. 2Demo Hardware
  6. 3Demo Software
    1. 3.1 Dual-Ray Measurements and Alarm Detection
    2. 3.2 Additional Demo Functionality
  7. 4Demo GUI
  8. 5Test Results
  9. 6Summary
  10. 7References

Dual-Ray Measurements and Alarm Detection

The demo application performs periodic measurements of the Dual-Ray AFE and implements a simple threshold algorithm to detect if an alarm can be triggered. SysConfig is used to generate the ti_msp_dl_config.c and .h files, which fully configure all peripherals of the MSPM0. The main clock is configured to run from the internal SYSOSC and is running at 32 MHz. No RTC is implemented in this example, instead a low power timer is configured in the TPS880x is used to wake the MSPM0 from sleep using an external GPIO. These files also configure the GPIOS, Timers, Comms, and power policy for the application.

The main loop includes the sampling routine, averaging routines, determining if IR or blue LED thresholds have been reached, sending and receiving information from GUI if enabled, and entering low-power modes. The loop requires either IR or blue reflection to exceed the set threshold three times consecutively before sounding the alarm (see Figure 3-2.) As the warning level rises, the time between measurements is reduced.

GUID-20230724-SS0I-RQR8-CQNS-9JMMZ2VN737H-low.svg Figure 3-2 Software Flow Chart

As Figure 3-3 shows, the measurement routine first enables the TPS880x AFE, configures it's internal power regulators and analog mux to measure the photo diode and makes sure the LEDs are off. The internal ADC12 is configured to take 4 repeat measurements. After some settling time, takes these measurements without the LEDs on for a dark baseline. Then it tells the TPS880x to turn on the IR LED and measures the amount of reflection seen with it on. This process is then repeated with the Blue LED. After both LEDs have been measured, if there is a carbon monoxide sensing enabled in the code, the MCU reconfigures the TPS880x and also reads that sensor.

Once all measurements have been completed, the TPS880x is put in a lower power mode and then the samples are averaged and compensated against any calibration that was done. With this data, the application performs basic dual ray detection by comparing these to thresholds set from the GUI and eventually alarming if they are exceeded.

GUID-20230724-SS0I-Q6GQ-XZGL-D5H6HXL2MZNS-low.svg Figure 3-3 AFE Measurement Routine