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.

Interfacing ADS1282 with Micro controller

Other Parts Discussed in Thread: ADS1282, ADS1256, PCA9535, OPA1632, SN74LVC2G157

Hi,

I have to interface ADS1282 with a microcontroller. I need to use SPI to do so. I went through the datasheet and its pretty confusing, I didn't get any idea where to start with. I would be happy if anyone can help me in this regard.

I'm planning to use TM4C1294 connected launchpad or PIC32MZEC.

Thank you in advance

  • Hi Santosh,

    If you have any specific questions about the interface, I would be glad to help answer them.

    Unfortunately I do not have any helpful ADS1282 code examples, but you could reference this ADS1256 code example, since the SPI commands are very similar for the ADS1256 and ADS1282.

    6740.ADS1256 Example - Multiplexing Channels.zip

    Best Regards,
    Chris

  • Hi Chris,

    Its good hear from you. I am waiting for my PIC32MZEC dev board to arrive. Once I get it, I will first try to configure SPI on the micro after that, do I need to configure the ADS1282 or does it have default configurations?

    Once the configurations are done, I need to give a series of commands to read the digital output. Is that correct? If am wrong please correct me.

    Thank you,

    Santosh

  • Hi Santosh,

    The ADS1282 has default configurations. Pages 36-39 in the datasheet explains the register settings and their reset (default) values. The reset values will be programmed after a power-up or reset occurs.

    Some important default settings are:

      • Data rate = 1kSPS
      • Filter = SINC + FIR (aka LPF) in linear phase mode
      • Inputs = AINP1 and AINN1
      • PGA Gain = 1

    You may want to write to the corresponding registers to change the default settings. For example, you may only want to use the SINC filter to avoid the long settling time of the FIR filter.

    IMPORTANT NOTE: Before reading or writing to any of the registers, first send the SDATAC command to exit "the read data continuous mode". In this mode the ADS1282 is ignoring other commands.

    To read data for the ADS1282 you will use one of two modes:

    1. Read Data Continuous - this mode is enabled by default when you reset the device. In this mode you just clock out the data (hold DIN low or send zeros to the ADS1282 on DIN) after /DRDY goes low. You exit this mode by sending SDATAC. If you exit this mode to write to the device registers, then you will need to send RDATAC after configuring the device to enter this mode again.

    2. Read Data by Command - this mode is enabled when you send SDATAC. This mode requires that you send the RDATA command first, then wait for /DRDY to go low, then finally clock out the data. It requires the extra RDATA command before every conversion is retrieved.
      1. IMPORTANT NOTE: RDATA must be sent before the next data conversion completes to retrieve the following data. The ADS1282 is different from our other delta-sigma data converters in this regard.

    I believe most people use the "Read Data Continuous" mode because it is more convenient.

    In summary, choosing the mode that you read data will affect the order of SPI commands. I hope those explanations help!

    Best Regards,
    Chris

  • I finally configured SPI. Using continuous data mode, I was able to see DRDY activity on scope. However, I see 0x0 in the SBUF of my microcontroller. I am I missing something?

  • I have attached screenshot of SPI lines. As you can see the ADC chip is giving 0x0 all the time. But I can see the DRDY pin going low periodically. Am I missing some hardware connections?

    I am using ADS1282 EVM board. I am sure all the ground pins are connected. 

    Am unsure about what might be causing me the issue? I am applying 3.3V to the analog input and what I receive is 0 which is obviously not relevant.

  • Hi Santosh,

    Is the MMB0 connected to the ADS1282EVM?

    If so, then there may be some contentions on the SPI bus.

    If not, you may need to probe the pins that are normally controlled by the PCA9535 on the ADS1282EVM, and make sure they are in an okay state. The PCA9535 is normally controlled by the DSP on the MMB0 motherboard.

    Also, how do you have the jumpers set on the ADS1282EVM?

    Regards,
    Chris

  • Santosh,

    Another important note about the ADS1282EVM...

    The buffers on this EVM require that you supply the external +/-10V supply rails. Even though the +/-10V supplies do not power the ADS1282 directly, I've observed that communication does not work properly without them. I believe the floating outputs of the OPA1632 may be holding the ADS1282 in a latch-up condition.

    Have you been providing these supply rails?

    Regards,
    Chris

  • Yes Chris I am supplying +/- 12 V(+/- 10 to 15V is acceptable) to the OPA and no the MMB0 is not being used.

    All the jumpers are in its default state as shown on page 7 of the ADS1282EVM-PDK User's guide.

    Am using on board reference.

    I didn't quite understand the stuff you are talking about "PCA9535". Can you elaborate that?

    The GPIO's of ADS1282 are floating is that Okay? 

  • Santosh,

    Okay, I was just checking about the +/10V external supplies. Most of our other EVMs do not require additional supplies, so it is common for them to be forgotten on the ADS1282EVM.

    The PCA9535 is an I2C expander that is on the ADS1282EVM. The MMB0 controls it via I2C which in turn controls the following GPIOs on the ADS1282:

    • SYNC
    • RESET
    • PMODE
    • PDWN

    Most of these signals have pull-up or pull-down resistors - so that they are not floating when the PCA9535 is not driving them. I believe all GPIOs on the PCA9535 default as high-impedance inputs.

    Another function the MMB0 controls is the SN74LVC2G157 (U11) multiplexer. The MMB0 can select whether the crystal on the ADS1282EVM is used as the master clock for the ADS1282 or if the MMB0 controls the clock. I believe you need to set the J3 jumper to pins 2-3 (non-default setting) to select the ADS1282EVM crystal oscillator.

    I think the rest of the jumpers can be left set to their defaults.

    Regards,
    Chris

  • J3 2-3 itself is the default position. I tried by shifting it to 1-2 this time the DRDY is inactive. Inorder to use the 4.096MHz crystal, J3 should be connected to 2-3 (DVDD position). 

  • Hi Santosh,

    I don't see any issues with the hardware connections then.

    Have you been able to get any SPI communication work, such as reading back the register settings? Do you have a logic analyzer you can use to capture screenshots of the SPI communication?

    Regards,
    Chris

  • I am able receive some data from the chip but its not relevant to the input voltage. Yes, I have the following protocol analyzer (http://www.totalphase.com/products/beagle-i2cspi/)  

    I am polling the DRDY pin and clocking out the data. I am using 8bit SPI is that causing any problem. I think my micro has a feature to use 32bit SPI. Should I go for 32 Bit SPI?

  • Santosh,

    The ADS1282 uses 8-bit SPI.

    Could you share any screenshots of your SPI communication? That will help me narrow down the issue.

    Thanks,
    Chris

  • The above is the screenshot of SPI on the protocol analyzer. This is the output of the ADS 1282 when the analog input is 5V. This seems ok but when I apply 0v it is not zero on the analyzer.

  • Santosh,

    What data do you get when you provide the zero input?

    I see "FF FF FF FE" in the image above. If that is the data for a 0V differential input, then it looks correct! The ADS1282 outputs 2's compliment data, so "FF FF FF FE" is a practically zero. Refer to the Data Format section on page 27 of the ADS1282 datasheet.


    I also see five bytes of data in the image above "1F FF FF FF C0". This tells me that you may be running the device in "read data by command" mode, is this correct?

    If that is the case, then you would need to send the RDATA command and then wait until the next /DRDY falling edge before you can clock out the data. The ADS1282's "read data by command" mode operates a little differently that other devices with the same mode. You may want to use "read data continuously" mode to clock out the data as soon as /DRDY goes low.

    Note the ADS1282 output codes scale differently with the SINC and FIR filters.

    Also, applying 5V will over-range the ADS1282's PGA.

    Regards,
    Chris

  • Hi Chris,

    For +3.3v and +5v I get 0XFFFFFFFE and for 0V, It gives me 0xFFDC0BDE (varying every time 0xFFDBA77A, 0xFFDB7BA6 etc...)

    No, I am using read continuous mode. Does those values make any sense?

    I will take a look into the documentation for data format.

  • Hi Santosh,

    I'm assuming you are connecting your +3.3V signal to A0(+) on J6 and then connecting 0V to A0(-), is that correct?

    Bit 31, or the LSB of the 32-bit data word is a redundant sign bit for the ADS1282. Therefore, the MSB and LSB should be equal. Being different, that tells me that input is over-ranged. Over-ranged data is not valid.

    Try applying a smaller input - for example: 3V to A0(+) and 2V to A0(-). Once we have a valid input signal, then we can start to question the validity of the output code.

    Regards,
    Chris

  • Hi Chris,

    There is no A0 on ADS1282, what it has is A1 and A2. I applied +3.3V to A1(+) and GND to A1(-). I am using it in Uni-polar mode.

    In your example above, you said to connect 3V to A1(+) and 2V to A1(-) right? So, the (-) terminals of the two sources should be connected to the common ground, Is that correct?

  • Hi Chris,

    It works fine now when I used a varying power supply and the results make sense. -2.5v (0x00000000), -2.5v (0xFFFFFFFE).

    I still have a question left for you, How do I use it in UNIPOLAR mode? I want to convert 0-5V range.

    In the above table, J8.4 is to be supplied for bipolar mode so, I left it unconnected. Do I need to connect it to GND?

    Thanks for you help.

  • Hi Santosh,

    You'll find the ADS1282EVM schematic on page 29 of the ADS1282EVM User's Guide.

    You do not need to apply the -5V supply if you want to operate in unipolar supply mode. This supply is only used by U13 to generate the -2.5V supply rail for AVSS in bipolar supply mode.

    To use unipolar mode you can do one of two things:

    1. Set GPIO3 HIGH for a unipolar supply (U8 will invert GPIO3, then U10 and U13 LDOs will be disabled and Q1 and Q3 will bypass the LDO outputs).
    2. Instead of using the circuitry shown below, simply connect your 5V supply to J7.2 and ground J7.4.

    In my previous post, A0(+) and A0(-) where referring to J6.1 and J6.2 on the ADS1282EVM schematic. Those pins are the inputs to U4 and AIN1P/AIN1N on the ADS1282.

    Regards,
    Chris