Other Parts Discussed in Thread: ADS1298ECGFE-PDK, ADS1298
I am trying to get my ADS1298ECGFE-PDK to work with my Arduino Uno. I’m trying to read some data and have had my serial port reading out a stream of binary data that looks very similar to the following structure: I am getting the 1100 in the first four bits that appear in my Serial Port terminal.
However, the only way to verify that this is the real ECG signal I’m getting is to actually plot out the voltages measured. I’m going to try to use Matlab to perform the binary conversion and plotting out on a graph in Matlab.
Screenshot from the datasheet:
You may ignore the yellow highlights. This screenshot is from the pdf that I reference and highlight for my usage.
Here is my understanding of how data format works:
The ground (or baseline) is at 0V, and the ECG signal will cary up and down that baseline. Assuming that I set my Vref to 2.4V via the CONFIG3 register, my signal should not exceed +/- 2.4V or it will be clipped at 7FFFFFh and 800000h. And based on the information on that same page, the data is in 2's complement so I will need to convert them back to its signed magnitude form.
Do let me know if I have interpreted it wrongly.
I did a bit of a search on the forum and found a post by a fellow TI Engineer, Tom Hendrick : http://e2e.ti.com/support/data_converters/precision_data_converters/f/73/t/102784.aspx
Hi Ismail, Sorry for the delay in getting back to you. The ADS1298 has a BTC output and that can complicate the SW a little in trying to convert hex to voltage. The easiest way to go about this (IMHO) is to take the raw code and convert the BTC data to straight binary. You can do this by 'XORing' the data with 0x800000. Full scale positive is 0x7FFFFF, XORing that with 0x800000 would give you 0xFFFFFF. Full scale negative is 0x800000, which yields 0x000000 when XORed. Your code to voltage input relationship is essentially [code-1 (in decimal)*LSB size]/gain. The LSB size is given in page 30 under the Format section as VREF/(2^23-1). If you need to compensate for polarity, simply take the result and subtract your reference voltage.
1) He says that i need to XOR the data with 0x800000. I don't quite understand the need for this. It seems like whatever is XORed with 0x800000 will yield the code itself. Eg if i XOR a codeword A with 0x800000 will yield codeword A itself.
2) He says that the final equation for XORed code to voltage should be [Code - 1(in decimal) * LSB size] / gain.
Just to clarify, when he said Code - 1 (in decimal) actually means the signed magnitude of the code in decimal, subtract 1 in decimal? Am I right to say that?
3) I can see the reason of dividing by the gain, but what does it mean by multiplying with LSB size? I see from the datasheet that LSB size is Vref/(2^23 - 1). Is that right?
Is there anything else I should look out for when it comes to data conversion?
Thanks in advanced for your help.
Regards,
Aslam

