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.

ads1242 reads full scale reading

Other Parts Discussed in Thread: ADS1242

Hi,

I am using ads1242 interfaced with tms320f2805.

Vdd = 3.5 v, vref- = 0V and Vref+ = 2.5v

Gain is set to 1, RANGE = 1, data rate = 15kHz

Mux register is set to 0x01(AIN0 is positive and AIN1 is negative)

and changing this again to  0x23(AIN2 is positive and ANI3 is negative).

I have verified the data written to SETUP,MUX and ACR register by reading the same data with RREG command.

The adc sequence followed is as below

1. Reset command . delay of 250ms.

2.write setup (value 0x00).Delay of 50tosc

3. write MUX(value 0x01). Dealy of 50tosc

4. Write ACR ( RANGE = 0)as needed to send SELFCAL command after this. Delay of 50tosc

5.Send SELFCAL. wait for 4 DRDY cycles.

6. Write ACR again with RANGE =1. delay of 50tosc

7.Send DSYNC command.

8. write MUX again(0x01). wait for 1 DRDY cycle

9.send RDATA command and wait for 2 DRDY cycles.

10.read data but don't  use it. Wait untill DRDY goes high

11. Send RDATA command. again. Wait for 2 DRDY cycles. Read the data on low end of DRDY

I am always  reading  full scale voltage output i.e.0x7FFFFF

I have strong doubts on input voltage provided on the channels.

Please tell for below input voltages, what is the expected output. ( I am using  differential input channels)

1. AIN0 - 3.29
2. AIN1 - 2.495
3. AIN2 - 1.766
4. AIN3 - 0.929

Did MUX setting with (0x23) value should read (AIN2-AIN3 )= 0.8v

and MUX setting with (0x01) should read (AIN0-AIN1)

Please suggest.

  • Prabhavati,

    It looks like you're able to read and write registers, so lets start with some thing to look at, then we can go through your sequence.

    whenever I see that the data read to be full scale, I think there are a few possibilities. First, the reference is lower than expected, reference inputs are floating or shorted, or the inputs are floating or larger than expected. I'd also check to see that the reference is fully settled when doing a SELFCAL. If the reference has a large capacitance, it may take a long time to get it to settle to the final value.

    Another thing to check is to check the FSR value and the OCR value. Compare the register values to the defaults to see if they are close to expected. This might show that the reference isn't settled when the calibration occurs.

    If you are able to provide it, a schematic might help debug the problem.

    As for the command sequence, I do have a couple of comments.

    1. It's good to start with the reset, it gets the device into a known state (although there is a power-on reset in the device).

    2. You don't need to set the SETUP to 00h, the MUX to 01h and the ACR's RANGE to 0. These are already default values.

    3. After the above, I'd send a STOPC command. I believe that the ADS1242 starts off in a RDATAC mode, so that it is outputting data if there's a new /DRDY and there are SCLKs being put out. By issuing the STOPC command, you stop updating the output register and set up the data to be read after the command comes out after the 01h on DIN.

    4. Sending the SELFCAL is ok (but how long after powerup is the SELFCAL sent?)

    5. If you're changing the mux setting, Write the new MUX value BEFORE sending the DSYNC command. The purpose of the DSYNC is to reset the digital filter to start the conversion. Otherwise, you've started the conversion, and then changed the input before completing the conversion and the output data will be a mix between the input from the first mux setting and the current mux setting.  In this case, it doesn't look like you're setting a new value, so it probably doesn't matter.

    6. You should generally read the data at the falling edge of /DRDY. That's when you know when the conversion is completed. I'm not sure of what you're doing with the send RDATA but don't use it. Can you explain that?

    As for the input voltages and expected outputs, here's an example:

    As an example if you are reading with MUX 01h, RANGE=1, and bit 6 of ACR=0 (bipolar format), VREF=2.5V let's look at the expected output data.

    Start with AIN0-AIN1=3.29-2.495=.795V. The full scale input range with RANGE=1, should be VREF/2 or 1.25V. That means the expected data output is going to be (.795/1.25)*2^23 = 5335155d or 516873h. You should be able calculate the expected values for the remaining inputs based on the same method.

    Joseph Wu

  • HI Joseph ,Thanks for the reply.
    Actually I set the buffer ON before calibration. Because of this buffer input range was exceeding. I have done one more change suggested by you.
    Called STOPC command before calibration.ADC is working fine now.
    I am sending RDATA command to read the data. Data is read at the falling edge of /DRDY.
    Data read by first RDATA command is ignored as it contains the result for previous cycle conversation. Data read after issuing second RDATA has been used.
    With 15MHZ data rate, did ADC take around (67ms) 100ms to update the new data(new conversion result)
    Thanks,Prabha