I'm working to build a LabVIEW interface for the TI ADS1015 analog to digital converter. This is a teaching project, so the hardware is on the cheap. LabVIEW uses an Arduino as an i2c interface for the ADS1015. The LINX labview module provides basic i2c communication function via the Arduino Uno's built-in SCL ans SDA pins.
I'm using the ADS1015 on a breakout board from Adafruit. The device is set up with i2c address of 1001000_2=0x48=72_10 (LabVIEW specifies byte addresses as unsigned ints).
The LabVIEW (graphical) code looks like:
This program runs without errors, but the results don't make sense to me yet. The code above starts up the i2c interface and then sends a series of i2c commands (the "quickstart" series from the datasheet, page 8, cdn-shop.adafruit.com/.../ads1015.pdf):
i2c Write 0b10010000
i2c Write 0b00000001
i2c Write 0b00000100
i2c Write 0b10000011
i2c Write 0b10010000
i2c Write 0b00000000
i2c Write 0b10010001
i2c Read
i2c Read
The LabVIEW program returns 133_10 from both of the i2c read commands at the end of the program sequence.
133_10=0b10000101=0x85
So, the total data returned from the ADS1015 would then be 0b1000 0101 1000 0101 = 0x8585 ?
This is the 12bit ADC, so I think (again, based on the datasheet) that the relevant part of the i2c signal is 0b1000 0101 1000 0101, ie, the ADC reading is -2^11 + 64+16+8 = -2048+88 = -1960_10 out of a possible +/- 2048? Assuming no scaling (and the board was connected to 5v supply this would be a reading of about 5v*(1960/2048) ~= -4.78v ?
0. Should I be troubled that the "reserved" part of the returned (read) i2c signal (Conversion Register) is 0101? What does "0h" in the spec sheet mean? Does this part of the conversion register mean something special?
1. Does my analysis of the ADC signal seem like a plausible result? Am I thinking about the returned signal in the right way?
2. In the quickstart demo, which of the four analog pins am I reading from? Am I using amplification, single-ended vs double ended, etc? I'm still confused about this part of the datasheet.
Grateful for any comments on what I'm doing wrong!