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.