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.

ADC128S102: Configuration of ADC128S102 and communication

Part Number: ADC128S102

Hello,

I'm using the ADC128S102 and I have some problems with it.

How should this ADC be  configured (SPI-Communication-configuration)?

Can you please tell me this.

My settings  are as following:

ClockPolarity = 1
ClockPhase = 0
ClockFrequency = 12,5MHz

I understand, that on power up I will receive the value of IN0.

After power up I start my conversation as following:

1. Write Adress of IN0 (to get this value the next cycle) and receive IN0 (because of power up) and later IN4.

2. Write Adress of IN1 (to get this value the next cycle) and receive IN0 (because of previous communication).

3. Write Adress of IN2 (to get this value the next cycle) and receive IN1 (because of previous communication).

4. Write Adress of IN3 (to get this value the next cycle) and receive IN2 (because of previous communication).

5. Write Adress of IN4 (to get this value the next cycle) and receive IN3 (because of previous communication).

6. start again at point "1." but now there I will receive IN4.

This is doing well.

But if i mix up the communication order above I won't get the expected channel on the expected adress. I put communication point "2." between "4." and "5." (see following:):

1. Write Adress of IN0 (to get this value the next cycle) and receive IN0 (because of power up) and later IN4.

2. Write Adress of IN2 (to get this value the next cycle) and receive IN3 (because of previous communication).

3. Write Adress of IN3 (to get this value the next cycle) and receive IN0 (because of previous communication).

4. Write Adress of IN1 (to get this value the next cycle) and receive IN2 (because of previous communication).

5. Write Adress of IN4 (to get this value the next cycle) and receive IN1 (because of previous communication).

6. start again at point "1." but now there I will receive IN4.

This was problem 1.

The second problem is that with this settings the LSB of the receiving data is in Bit 17, so the received value I get is shifted by 1 to the right (from 16bit to 17bit).

What could be the problem?

My Last point is, do you have a 12-bit ADC-SPI which has following behaviour. I write the desired adress of the channel and will exactly receive this value?

 

Thank you very much.

 

Kind regards,

Philipp Baudermann

  • Sorry for the long delay on this.

    1. When you do the sequence in order IN0, IN1, IN2 …. IN4, you get the expected behavior. Correct?

    2. When you try to access the mux channels out of order you have a problem (IN0, IN2, IN3, IN4). I don’t really understand the issue you are seeing. Each time you read any channel, you will get the conversion result from the previous multiplexer setting. So, for example, consider the transition from IN0 to IN2. When you write IN2 into the control register you will read the conversion result from IN0. So for your sequence:

      Write IN0 – you will read IN4 conversion results (Note: the first conversion will not be valid). This appears to work for you.

      Write IN2 – you will read IN0. You say that you get IN3. This doesn’t make sense, you should get IN0.

      Write IN3 – you will read IN2. You say you read IN0. This doesn’t make sense, you should get IN2.

      Write IN4 – you will read IN3. You say you read IN1. This doesn’t make sense.

      I just trying to make sure that I understand you problem. The way I see your comments none of the communications are working correctly with the second sequence. I suggest you connect each input to a distinctly different voltage. That way it is easy to see what channel you are on.

    3. For the second problem, please try ClockPhase = 1.

    4. For your last point. The idea behind this ADC is that while you are communicating with the ADC it is converting the previous channel and switching the multiplexer. This saves time. If you write to the channel and receive data from the same channel, you will have to wait until after the multiplexer switches, then acquire the signal, and finally do the conversion. The way the ADC128S102 works is how most of these types of converters work. I couldn’t find and exception, but I will ask some colleagues.   One option you could consider if you want to select a register and read from it would be to write the same control register twice in a row. The first associated read would be to the previously selected register (ignore this), the second read would be to the desired register. This wastes time but may simplify your design.

    I hope this helped. Please let me know if I missed something or if further clarification is needed.