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.

Re: ADS1115 Data read problem

Other Parts Discussed in Thread: ADS1115

Hi,

 

    I am having a lot of trouble with this chip......for starters when I read the result register I get back 0x00 0x00 I am not sure why this has NO CONVERSION data???? I also am confused how this chip knows when to convert.....I tried setting the first config register to continuous and sometimes the OS bit is not being set and is somehow cleared even though I sent 0x83 lets say.......my bigger concern for now is the fact I can read and write the config register but no conversions are happening.......

 

Craig

  • Craig,

    When you first start up the ADS1115, the conversion register is zero and remains zero until a conversion replaces it with a result.  So you probably have not really started continuous conversion mode.

    A couple of things.  To start with, you need to make sure that you have set the register pointer to the correct location when communicating to the device.  Another thing to keep in mind is that all register communication is in two byte transfers....in other words all registers are 16-bit.  So what is the actual configuration setting that you are trying to use, ie are you trying to use the default setting 0x8583 or something else.  For example if you want the device to be in continuous mode, but keep the default settings for all other bits you need to write to the config register 0x8483, which changes bit 8 to a zero.

    The device should now be in continous conversion mode, so to read out the data you need to write the pointer to the conversion register, then you need to read out the results.

    Best regards,

    Bob B

  • Ugh.....it was a hardware issue on the board side......sorry hahahaha..... a few things that are confusing....what is +/-4.096 PGA....I need to read up to 5V it looks like this is a bipolar config and I can only read up to positive half which is ~2V???? what is the OS bit for??? I can poll this to see when a sample is ready????

  • Hello Craig,

    The ADS1115 will convert the differential voltage between AINP and AINN. You may set up your configuration to measure a single ended signal or a differential signal. On a single-ended configuration the negative input of the ADC is internally connected to GND. When set up to measure a differential signal, you may connect the negative input to a different channel in the mux. The analog inputs voltage range (AINP or AINN) must not be above VDD or below GND.

    The Full-Scale Input voltage +/-4.096V/PGA refers to the maximum scale of the converter; where 4.096V is the full-scale voltage and PGA is Programmed Gain Amplifier setting. The internal PGA amplifies the signal coming through the inputs before the delta-sigma converter. The available gain settings are 2/3, 1, 2, 4, 8 ,16.

    For example: if VDD=5.5V; PGA=1, the full scale voltage is +/-4.096V when set up in differential ended mode; or 0 to 4.096V when set up on single-ended mode.

    If you set PGA Gain=2/3; delta sigma modulator will perform the code conversions based on a full-scale range of +/- 6.144V; however the inputs should never be above VDD or below GND. If you need to read 5V with respect to GND; you may set your PGA gain to 2/3 and perform conversions in this manner.

    The OS bit is used to indicate the status of the conversion. On single -shot mode, the ADS1115 waits until the OS bit is set high. Once asserted the device sets the bit "0" indicating the conversion is in progress. Once the conversion is completed, the bit is re-asserted indicating the conversion is ready.  You may pole the OS bit to see when the conversion result is ready. In continuous conversion mode, you need to pole the OS bit in order to read the conversion result and time the reading of the conversions appropriately.  When using the fast data rates the user has to be careful and ensure that the complete conversion result is read before the next conversion is ready.

    Please let me know if this helps,

    Thank you,

    Luis

     

  • How do I poll the OS bit in continuous mode??? How do I put the device in power down mode??

  • Hello Craig,

    The user may set up the device in continuous mode or Power down single-shot mode by setting the appropiate configuration register.  Table 9 on page 18 of the datasheet shows the Config Register. Setting Bit[8] of the config register controls the conversion mode of the ADS1115:  As described on Page 19 setting this bit to 1 sets the device on Power-down single shot mode (default); setting it to 0 configures the device on continuous conversion mode.

    The quick start guide description on page 11, provides a helpful example where the device is set to continuous conversion mode by sending three commands: writing to the config register(4 bytes), writing to the pointer register (2 bytes), and reading the conversion register (3 bytes).

    --The user can pole the OS bit by reading the configuration register:

    1) Send a command write to the pointer register:
    First byte: I2C Address followed by a low write bit
    Second byte: 0b00000001 (point to the config register)

    2) Send a command to read the config register:
    First byte: I2C address followed by high read/write bit
    Second byte: ADS1115 response with the MSB of the config register
    Third byte: ADS1115 response with the LSB of the config register

    Where bit 15 is the OS bit.

    -- After reading that the OS bit = 1, you may read the conversion result:

    1)Send a command to write to the pointer register:
    First byte:     I2C Address followed by a low write bit
    Second byte: 0b00000000 (points to the conversion register)

    2)Send a command to read the conversion register:
    First byte:     I2C Address followed by a high read/write bit
    Second byte and Third byte: Response with the conversion result

    The user has to be able to read the complete coversion result before the next conversion start, therefore the user has to time this process carefully depending on the sampling rate.

    At the beginning of your development, it may be easier that you first try to set up the device on "Power down single shot mode" first; this may simplify the timing on your program.

    Thanks,

    Luis

  • Sir,
    Thanks for the wonderful answer.
    Recently i am trying to interface ADS1115, but the problem is in reading the conversion register. While I try to read the conversion register i get the device id as MSB and a random value in LSB. Why so ?
    Inside my project i just have 2 read the ADCcontinuously.
  • Sir,
    For programming i used the same steps as provided in datasheet.
  • Prashant,


    I'm not sure I understand what your problem is. I assume that you are reading the conversion register with the read word diagram as shown in Figure 30 of the datasheet. Then you get the device ID? Do you mean the I2C address?

    To debug this problem, it would help to make sure the communications are correct. It would be best to get some logic analyzer to make sure the read back is interpreted correctly. If you don't have that, an oscilloscope might be handy, but you'd need to capture the entire transaction. Then you'd need to match it back to Figure 30.

    How do you have the configuration register set up? Are you sure you have the correct inputs, gain and data rate? What data are you getting? I'd really like the full 2 byte read back. Once you determine the gain and the inputs are correct, verify what you have as a voltage on the inputs.

    Also, you could try to read back the configuration register to make sure the data transaction works. It should be a two byte transaction that should be correct each time.


    Joseph Wu