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.

MSP430FR2355: SLAA458 PULSE OXIMETER WITH MSP430FR2355

Part Number: MSP430FR2355


Hello All,

Iam trying to design a pulse oximeter using MSP430FR2355 Launchpad. I've been able to successfully use the SAC module and get the SPO2 raw data from the SAC . I have also used ADC to read the SAC output and convert to digital form. Iam following SLAA458 & SLAA897 TI Documents. Can anybody tell me what is the meaning of the below shown code. This code is picked up from SLAA458 . 

 /* Track the beating of the heart */
        heart_signal_sample_counter++;
        if (pos_edge)
        {
            if (edge_debounce < 120)
            {
                edge_debounce++;
            }
            else
            {
                if (ir_heart_ac_signal < -200)
                {
                    edge_debounce = 0;
                    pos_edge = 0;
                    display_pulse(0);
                }
            }
        }
        else
        {
            if (edge_debounce < 120)
            {
                edge_debounce++;
            }
            else
            {
                if (ir_heart_ac_signal > 200)
                {
                    edge_debounce = 0;
                    pos_edge = 1;
                    display_pulse(1);
                    display_correcting(1, 0);
                    if (++heart_beat_counter >= 3)
                    {
                        log_heart_signal_sample_counter = heart_signal_sample_counter;
                        log_sq_ir_heart_ac_signal = sq_ir_heart_ac_signal;
                        log_sq_vs_heart_ac_signal = sq_vs_heart_ac_signal;
                        heart_signal_sample_counter = 0;
                        sq_ir_heart_ac_signal = 0;
                        sq_vs_heart_ac_signal = 0;
                        heart_beat_counter = 0;
                        _BIC_SR_IRQ(LPM0_bits);
                                            // Do a dummy wake up roughly
                                            // every 2 seconds
                    }
                }
            }
        }

 what is meaning of edgebounce , pos edge, and 

ir_heart_ac_signal >200 or
ir_heart_ac_signal < -200 ?


My other question is regarding UART of the MCU.
Is There any way to use printf command to send data over UART with a newline ending . It is easy to send data using newline & print f as I do not have to break the data into MSB & LSB.

Currently Iam using

while(!(UCA1IFG & UCTXIFG));
UCA1TXBUF = data ; // LSB OF DATA

I mean I've been using TIVA C series MCU'S and UART communication in them is pretty easy to use.
  • Hi Sumit,

    Sumit Mourya said:
    what is meaning of edgebounce , pos edge

    pos edge is looking for the positive edges of the pulses. edge_debounce is looking to wait for the signal to settle.

    Sumit Mourya said:
    ir_heart_ac_signal >200

    These 2 lines of the code  

    ir_heart_signal = ir_filter(i);
    // Filter away the large DC
    // component from the sensor */
    ir_heart_ac_signal = ir_heart_signal - dc_estimator(&ir_2nd_dc_register, ir_heart_signal);

    indicate that the 200 is the signal levels above which is used for valid signal.

    UART: The standard examples available for MSP430 use the approach you are already using. Just for reference, https://dev.ti.com/tirex/explore/node?node=APOB8PmsO4aurCVoXwMXYA__IOGqZri__LATEST uses what you are doing.

    Srinivas

  • Hi Srinivas,

    Sorry for the late reply, I was stuck in my project. Thanks for replying. 

    positive edges means signal value greater than 0 ,be it going upwards towards the peak or coming downwards towards the trough?

    Why is 200 & -200 used as reference for valid signals? What if signal range is below 200? Since The DC is removed away, there is no motion artifact in the signal right?

    Even I use my own bandpass filter of 0.7 - 5HZ in the signal , How can I determine if the signal range is valid? 

    I've used my own bandpass filter of 0.7 - 5HZ in the MCU and Iam getting a clean Spo2 Signal . The signal range is between 150 to -150  . 

  • Hi , 

    Can somebody help me understand the code part with a graphical representation of the signal. Fixed no. of samples say ( 2 seconds of data) .

    In the data, where is pos edge considered? edge debounce is considered what in the signal so that the signal is settled?

    Why 200 & -200 values are used for valid signals?

    It would be really helpful to understand these things looking at a graphical waveform. 

**Attention** This is a public forum