Hi,
My system
MCU: arduino(atmega328)
AFE4400 setting:
AFE4400Write(CONTROL0,0x000000);
AFE4400Write(TIAGAIN,0x000000);
AFE4400Write(TIA_AMB_GAIN,0x00007D); // 10k 100pF
AFE4400Write(LEDCNTRL,0x010F0F);
AFE4400Write(CONTROL2,0x000000);
AFE4400Write(CONTROL1,0x010707);
I test the Osram SFH7050 sensor.
The output of red, ir value is strange.
When i put on my finger on the sensor, output value is over 22bit format such as 286330776,286329805.
The output variable type is uint32_t.
The ir, red value output strange value respectively or simultaneously.
Below picture is the output value.
However, the output vlaue is normal when I take off my finger on the sensor
I test five or six SpO2 sensors, this phenomenon is shown by some SpO2 sensors.
I tried changing LED current and TIA gain but not improved.
This is my SPI read source code.
uint32_t AFE4400Read (uint8_t address)
{
uint32_t data=0;
digitalWrite (SPISTE, LOW); // enable device
SPI.transfer (address); // send address to device
//SPI.transfer (data);
data |= (SPI.transfer (0)<<16); // read top 8 bits data
data |= (SPI.transfer (0)<<8); // read middle 8 bits data
data |= SPI.transfer (0); // read bottom 8 bits data
digitalWrite (SPISTE, HIGH); // disable device
return data; // return with 24 bits of read data
}
Why this error occur?