I am having different results of the CIR data depending on whether I read all 4064 bytes from register 0x25 at once or if I read the complex numbers (4 bytes) step by step (actually I read 5 bytes per number because the 1st byte is to be discarded according to the user manual).
Does anybody else see this happing in their code?
This is my algorithm for reading each value one by one:
for idx in range(0, 992): raw_cir_data = read(reg_addr=0x25, sub_reg_addr=idx * 4, len=5, spi_cs=PIN_CS, spi=spi) low_byte_real = raw_cir_data high_byte_real = raw_cir_data low_byte_imag = raw_cir_data high_byte_imag = raw_cir_data real = int.from_bytes([high_byte_real, low_byte_real], byteorder="big", signed=True) imag = int.from_bytes([high_byte_imag, low_byte_imag], byteorder="big", signed=True)
or everything at once:
raw_cir_data = read(reg_addr=0x25, sub_reg_addr=0x00, len=992 * 4 + 1, spi_cs=PIN_CS, spi=spi)[1:]