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.

ADC124S041 unexpected order reading inputs

Other Parts Discussed in Thread: ADC124S021

Hello,

I have a strange behavior of the ADC124S041 when reading the inputs.

The order of the data is not like I'm expecting it. Let me explain this more detailed.

I'm reading all four channels. Starting with CS low than reading IN1 (0x00 + dummy byte), IN2 (0x01 + dummy byte), IN3 (0x10 + dummy byte) and IN4 (0x18 + dummy byte) and setting CS high again.

The voltage level on the pins are about: IN1 0V, IN2 0V, IN3  about 5V and IN4 about 2.5V

Therefore i would expect that i'll get: IN1 0 Bits, IN2 0 Bits, IN3 about 2000 Bits, and IN4  about 4000 Bits. But this is not the case...

At reading IN1 I get the value of IN4

At reading IN2 I get the value of IN1

At reading IN3 I get the value of IN2

At reading IN4 I get the value of IN3

Changing the order of reading doesn't effect the correlation of the results. If I start with reading IN2, IN3, IN4, IN1, the result is

At reading IN2 I get the value of IN1

At reading IN3 I get the value of IN2

At reading IN4 I get the value of IN3

At reading IN1 I get the value of IN4

Reading a single input and never another one (CS low, reading IN4, CS high, waiting... , CS low, reading IN4, CS high, waiting..., and so on) leads to the right result.

However, if I read out two inputs the same way (e.g. IN1 and IN2), the result is wrong. For IN1 I get the IN2 result and for IN2 I get the IN1 result.

To eliminate a read in issue on my controller, I check every test with an oszilloscope. The signals are as described.

All things considered it's a pretty strage behavior I can't explain. Does anybody has an idea what wrong?

  • Hi Patrick,

    What happens if you do the following?

    Power on the device.

    Write the following: (I have listed the input you should get the result from.)

    0x00     IN1 (When powered on the default input is IN1)

    0x00     IN1

    0x00     IN1

    0x01     IN1

    0x01     IN2

    0x01     IN2

    0x00     IN2

    0x00     IN1

    0x00     IN1 

    Mike

  • Hello Mike,

    In your answer I saw that if you change the input you'll get the value of the last input one more time.
    I went ahead and changed my routine like this: (I used the control register values like in the data sheet listened)

    0x00 IN4 (at the very fist reading i'll get IN1, but im doing it over and over again)
    0x00 IN1
    0x08 IN1
    0x08 IN2
    0x10 IN2
    0x10 IN3
    0x18 IN3
    0x18 IN4

    And then I'll get the value I'm expecting on the second time reading the input.

    I'm not sure how to see this. Is this a bug or a feature? I checked the datasheets cap. 2.0 USING THE ADC124S021 and did not find anything indicating this.

    Patrick
  • Hi Patrick,

    This is what you should be seeing.  When you are writing a byte to the register you are setting up the input channel for the next reading.

    Using your example:

    0x00 IN4 (at the very fist reading i'll get IN1, but im doing it over and over again)   >If you powered on the part and this is the first command you sent you should get a reading for IN1.
    0x00 IN1  >You will get the value for IN1 because the previous byte set up that you want the value from IN1
    0x08 IN1  >You will get the value for IN1 because the previous byte set up that you want the value from IN1.  This byte is setting up that the next reading will be from IN2.
    0x08 IN2  >You will get the value for IN2 because the previous byte set up that you want the value from IN2. 
    0x10 IN2  >You will get the value for IN2 because the previous byte set up that you want the value from IN2.  This byte is setting up that the next reading will be from IN3.
    0x10 IN3  >You will get the value for IN3 because the previous byte set up that you want the value from IN3. 
    0x18 IN3  >You will get the value for IN3 because the previous byte set up that you want the value from IN3.  This byte is setting up that the next reading will be from IN4.
    0x18 IN4  >You will get the value for IN4 because the previous byte set up that you want the value from IN4.

    Mike

  • Hey Mike,

    I understood how to use it. It works like it sould now.

    What I tried to say is, that in the datasheet nothing indicates that you need to send four bytes in order to get the value of the input at 3. and 4. byte.

    The timing diagram shows two bytes as well, even the "2.0 USING THE ADC124S021" section says:

    "During the first 3 cycles of SCLK, the ADC is in the track mode, acquiring the input voltage. For the next 13 SCLK cycles the conversion is accomplished and the data is clocked out, MSB first, starting on the 5th clock"

    But not that you have to setting up with two extra bytes before.