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.

ADS1018 temperature reading

Other Parts Discussed in Thread: ADS1018

Hello, 

I am having difficulty getting the ADS1018 ADC to work in a new design, to read temperature, or anything else.
This is first time I've used this part, but used a lot of SPI interface data converters.

Been working a week on this.  Can't see what I'm doing wrong.  Need some more eyes.

When I power up the part it should come up in power down, single conversion mode.
I keep it there.

I do a 32 bit transmission cycle every 15 ms, using config code 0x8112.

SCLK is low
CS goes low
I see DOUT go low (saying a conversion is ready?).

I send the hex code 0x8112, twice in succession, as follows:

I set the DIN from the MS bit of the word being sent, I raise SCLK for 5 us, lower SCLK then read DOUT.
I do this for 32 clocks, wait 5 us after the 32nd time SCLK goes low, then raise CS.  End of cycle

0x8112  should be single shot read, doing 1 conversion of temperature sensor and staying in power down mode.

On the next (and successive cycles) I would expect to see the first 16 bits from DOUT be the temperature value, and the next 16 bits be whatever was in the config register, 0x8112.

What I get is 0x0000  (for the data) and 0x0E70  for the config.  This does not change with temperature.

The ADS1018 Vdd is 5 v, very clean.
Ground is clean.
I'm driving the ADS1018 from a PIC24 3.3v mpu, using gpio bits.

CSL, SCLK and DIN inputs are pulled up to 5v through 2k resistors.
Signals swing rail to rail, very clean, Vih and Vil values are met easily, no ringing.

I put 50 ohm resistors in series with the PIC outputs - no joy.
I checked the 4 voltage input pins,  They're all sitting nicely at 0 - not over driven or anything bad coming in.

I made another board with another ADS1018 - same thing.

I changed the config word to 0x0000 then 0xFFFF which should be ignored because the NOP code isn't valid.
They were. In these cases, the output of the ADS1018 did not change, it was still  0x0000  0x0E70.

I am trying to read temperature to eliminate variables.  Attempts to use the MUX and PGA were similarly confusing.


What am I missing?  Or where should I look?

Thanks,

Ed Kelleher

  • Hi Ed,

    Your read back of the config should also end with the lsb as high.  I would suspect that you have something wrong in the communication either with SPI being too fast (4MHz max), or the wrong SPI mode.  This should be mode 1.  Do you have any scope shots of the communication?  One thing that is sometimes missed is CS must remain low throughout the entire 32 bit communication transaction.

    I would try and read back the default configuration to see if you can get the correct value when you first start up.

    Best regards,

    Bob B

  • Thanks Bob for the reply.

    Yes, the funny config word return is saying I'm not putting stuff in right (or not reading it right).

    All the setup timings are easily met, as I am programming the bits on/off.  The SCLK pulse with is 5 us, which is maybe 100 kHz.


    I have scope shots of everything:   CS and SCLK string (32 clocks),  showing CS going low 10 us or so before SCLK goes high first time, staying low till 10 us or so after 32nd SCLK goes low.

    Also, DIN and SCLK, DOUT and SCLK.

    All data transitions are shown occurring on the rising edge of SCLK and are stable when SCLK falls.  Happy to send them.

    I tried leaving CS low all the time, then varied the cycle between 15 ms and 30 ms, bracketing the 23 ms SPI timeout interval.  Still got 0 for data and variable stuff for the config readout.  I have everything else on the board (DAC and pulse analyzers) turned off.  But it does seem that the ADS1018 appears to get some valid config word on a cycle then nothing else changes it, it just keeps reading back same thing.

    Ed

    Ed

  • Hi Ed,

    The easiest way to send the scope shots is to zip them up and attach them to the post using the paper clip icon.

    One other thing you could do is remove the 2k pull-ups on SCLK and DIN.  There may be a slight delay with respect to the edges.

    Best regards,
    Bob B

  • Thanks Bob,

    I'm using the pull ups to meet Vih.  The PIC24 is a 3.3v part and that's all it can do.  It has 5 volt tolerant I/O so I use the pull ups, as recommend by Microwhoever.

    I'll use the paperclip to attach a zip file.  All my sceen shots were from the 16 bit transmission cycle.  Went back to get some of the 32 bit cycle, and saw the CS only went up to 3.3v now.  I think my pull up resistor came unglued.

    Attached are the scope pics.2474.ADS1018_Kelleher_ScopePics.zip

    Have to go, but I'll see if CS not going all way hi causes a problem. Don't see why it should, but never can tell. 

    Thanks again Bob for quick response.

    Ed

  • Hi Ed,

    In general the scope shots look ok, but I do notice that the low side voltage goes a little lower than it should with respect to scope ground.  This may not mean anything as it could be something to do with scope calibration.  However if you have a mixed supply voltages you may have an issue with the grounds.  I would double check and make sure that both the PIC and the ADS1018 are referenced to the same potential and there are no issues related to grounding.  Also, I would look at the inputs to the ADS1018 with the scope to make sure that it looks the same relative to the I/O of the micro and there are no edge delays.

    Best regards,

    Bob B

  • Hello Bob,


    I'll grasp at any straw at this point.

    Yup, the scope is 17 years old and has never been calibrated.  Yes the scope reference marks are a bit off.   It's the reference marks.  I checked and the low part of the signals seen on both channels are within 50mv of ground level.

    According to a Fluke 45 (5 digit 100,000 count DMM) the difference between ground at the packages between the PIC and ADS1018 is 0.12 mv and it's rock solid.

    I agree the scope shots look ok as far as lo/hi voltage levels, setup times, rise/fall time and pulse widths are concerned.  Also the polarities/phases are correct, I'm feeding the right bits in, on the right clock cycles, on the right edges, with CS as it should be.

    But the problem remains that when I send the config word  0x8112, twice in a 32 bit transmission cycle as shown in fig 15 of the datasheet (rev B),  I get  0x0000 0x0E70 back.

    I know that's wrong, that the lsb of the config word should read back as a 1.

    The chip is responding correctly to SCK,  32 bits go in, 32 bits come out with the correct phase.

    Now, if the ADS1018 responds at all - cycling DOUT in response to SCK inputs, then the LSB of the returned CONFIG word should always be 1.

    Correct?

    If it's not 1, it's not the CONFIG word.

    The value doesn't change with temperature of the package, so it's not the returned data value either.

    Am I reading the data sheet correctly?

    Config word  0x8112  should mean:

    Start a single conversion

    MUX values don't care

    PGA FS is +/- 6.144 V

    Do single conversion and return to power down mode

    Conversion rate of 128 SPS (7.8 ms/conversion, I'm repeating every 12-15 ms so no problem there)

    Temperature sensor mode selected

    No pull up on DOUT

    NOP = 01 for valid data

    LSB=0

    I've checked the PIC I/O bits for conflicts (like 3.3 v push/pull output driving line with 5 v pull up) and all is as the manufacturer recommends.

    I didn't mention it before, but the same PIC I/O bits (SCK SD) are driving an SPI DAC just fine.  (sorry, from another manufacturer) I don't read anything back from the DAC though.

    I'll keep checking.

    Appreciate your help.

    Best,

    Ed

  • Hi Ed,

    Your understanding of the configuration register is correct.  As I mentioned in my first response, I would first try to read the contents of the configuration register before reading/writing to the ADS1018 or any other devices.  You should get the configuration register defaults.  If you do not, then I would suggest probing at every pin of the ADS1018 and make sure that the input/output is as expected.  I would also verify that there are not any schematic/layout issues where the CS line is going to more than one device.

    If you would like me to look at your schematic and/or layout for potential issues I would be glad to take a look at them.  You can either 'start a conversation' privately on the forum by clicking on my name, or you can communicate to me through email at:

    pa_deltasigma_apps@ti.com

    Best regards,

    Bob B