Tool/software:
Hi all,
I have a question about the data conversion for ADS130B04.
I used all 4 channels as single-ended channels, with negative inputs connected to ground.
Communication and setup are working fine, also the voltage values seem to be correct, but on channel 1 and 3, the sign is swapped.
I have on all channels an input voltage of around 0.6V, but channel 1 and 3 say -0.6V.
In the datasheet it says that the data is represented as two's complement, so my conversion is:
int16_t data = (int16_t)(((uint16_t)msb << 8) | lsb);
float volts = ((float)data * 1.2f) / 32768.0f;
MSB and LSB are the first and second byte read by NULL command from each data channel.
And the 1.2 / 32768 come from the reduces scale range.
What do I do wrong here? Any suggestions?
Thanks in advance,
Peter