Post Go back to editing

Tag not appearing when reading from FIFO

Category: Datasheet/Specs
Product Number: MAXM86161

When using the MAXM86161, I am trying to read out the data from the FIFO, following from the suggested pseudocode on page 20 - 22, especially the one on "Pseudo-Code Example of Reading Data from FIFO". This is the code for that written in C++ for the application:

bool error;
uint8_t databuffer[128*3];
uint8_t samples;
uint32_t temp_data;
int label;
int value[32];

// Get the number of samples to read
error = _samples_to_read(samples);
if (!error || samples == 0){
return false;
}
// Read all of the sample data from the FIFO
Adafruit_BusIO_Register data = Adafruit_BusIO_Register(i2c_dev, MAXM86161_FIFO_DATA);
error = data.read(databuffer, samples*3);
if (error){
for (int i = 0; i < samples; i++){
temp_data = 0;
temp_data = (databuffer[i*3 + 0] << 16)
| (databuffer[i*3 + 1] << 8)
| databuffer[i*3 + 2];
}
label = (temp_data >> 19) & 0x1F;
}
When reading the value of 0x20, the LED sequence control register value, I found that the value was 0x01, corresponding to the green LED, which I could see
lit up on the chip. For this application, we've designed a PCB similar to the suggested one in the datasheet. The problem, is
although 0x20 has a non-zero value, all data coming out has a tag value of 0, which is confusing as that has no interpretation
in the datasheet. The value of temp_data does appear to change as light around it changes, including fully reducing in
values when covering with a finger. I was wondering if there could be any reason why the tag would be zero, as it is needed
for this application to differentiate between red and IR values stored in the FIFO.