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

  • Hey Viney,

    I am not totally sure how the EVM firmware works. However, I'm fairly certain a 24-bit conversion value is output to the PC eventually. Perhaps try looking at how the data is stored in memory in the first place. Side note: historically, we provide the firmware source code as a convenience to our users but do not support questions regarding its implementation so unless another community member understands the problem better than me, you're likely on your own for this one.

    Regards,
    Brian Pisani
  • Brian,

    Is it likely that the source code that comes when we install the EVM software is a little different to the one that is functioning on the EVM?

    Regards

    Viney Chaddha

  • Viney,

    I doubt it. I believe that the program that is stored on the MSP's flash memory when the boards are shipped is simply the compiled version of that source code.

    Regards,
    Brian Pisani