Hello, I had a problem getting the CIR data
here is my code & result (acc CIR data)
Code:
static uint8_t CIR_data[6097];
int32_t real_CIR[1016];
dwt_readaccdata(CIR_data, 6097, 0);
int j = 0;
for(int i=1; i<6097; i+=6){
real_CIR[j] = ((CIR_data[i+2]) << 16 | (CIR_data[i+1]) << 8 | (CIR_data[i])) & 0x3ffff;
printf("%d,",real_CIR[j]);
Sleep(0.001);
j++;
}
Result:
Output data(real part) joy:
Low : 218 (0xda)
Mid : 254 (0xfe)
High : 255 (0xff) so, → 11111111 11111110 11011010 → 111111111011011010 (18bit)
I read 1016 CIR samples and created a CIR real value array that excluding the upper 6 bits of the real part, but the values are too large.
Much thanks!