This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Clarification on the ADS1292 program

Other Parts Discussed in Thread: ADS1292

Hi,

I was going through the code for the ECG program for ADS1292 EVM. the part of the code is given below:

ADS1x9x_ECG_Data_buf[1] = ADS1x9x_ECG_Data_buf[1] >> 4;
ADS1x9x_ECG_Data_buf[2] = ADS1x9x_ECG_Data_buf[2] >> 4;

ADS1x9x_ECG_Data_buf[1] &= 0xFFFF;
ADS1x9x_ECG_Data_buf[2] &= 0xFFFF;

The ADS1x(x_ECG_Data_buf[1] and [2] are filled by the SPI data recieved from the ADS and is a 24 bit data in two's complement. My question is:

By having the data shifted by 4 bits to the right would leave only 20 MSB of the data in the buffer. After that doing the AND operation with 0xFFFF would keep the 16 LSB of the new data and we would be loosing the sign bit of the data - the MSB. So by doing these operations on the buffer are we not loosing the correctness of the data. - It could be a negative or a positive number and the AND operation will knock off that information and the new data would be treated as a positive number!!!!

Can someone clarify this part for me please.

Regards

Viney Chaddha