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.

ADC12 Questions

Other Parts Discussed in Thread: MSP430F5528

 

All:

I am using MSP430F5528 processor, and I have a few questions regarding the ADC12.

1. The datasheet has an equation for tsample of

     tsample = ln(2n+1) x (Rs + Ri) x Ci + 800 nsec

    a. I assume that for 12-bit ADC, the natural log value is 9.011, correct?

    b. I would also assume that Ri and Ci are internal resistance and capacitance values for the specific processor. In the case of the F5528, Ri is close to 2k Ohms and Ci is 25 pF, correct?

    c. Rs would be the resistance of the driving circuit in front of the ADC input, correct?

    d. Where does the "800 nsec" come from?

2. Setting up the ADC12SHT parameter - is the following equation correct?

   ADC12SHT = tsample x ADC12CLK

    a. After computing, do you then pick a value for ADC12SH that is close but not "under" the value computed.

        For instance, I have computed a value of ADC12SHT = 34. Therefore, I cannot use ADC12SHT01 (=32), but I need to go the next higher value. In my case, I chose ADC12SHT02 (=64). But I could have chosen ADC12SHT01+ADC12SHT00 to get a value of 48, correct?

So far, I have been able to confirm that my choices have created the ADC environment where I am getting valid measurements on my ADC inputs. I have also looked at sampling times, and the ADC computations are done in a "timely" fashion. (That is, the interrupt service routine time is well within the sampling period.)

  • Todd Anderson78572 said:
        a. I assume that for 12-bit ADC, the natural log value is 9.011, correct?

    Yes. With same success you can ask about 2*2=4 :)

    Todd Anderson78572 said:
    In the case of the F5528, Ri is close to 2k Ohms and Ci is 25 pF, correct?

    Ri is somewhere between 10 and 1900 ohms depending on VCC and temperature. Ci is between 20 and 25 pF. Did you read datasheet or not? :)

    Todd Anderson78572 said:
        c. Rs would be the resistance of the driving circuit in front of the ADC input, correct?

    Yes.

    Todd Anderson78572 said:
        d. Where does the "800 nsec" come from?

    Science. As long as formula is supposed to be correct - does it really matter?

    Todd Anderson78572 said:

    2. Setting up the ADC12SHT parameter - is the following equation correct?

       ADC12SHT = tsample x ADC12CLK

    Why are you in doubt?

    Todd Anderson78572 said:
        a. After computing, do you then pick a value for ADC12SH that is close but not "under" the value computed.

    Depends. When I have slow sample rate - I don't care and pick everything about ADC on safe side - "over" computed value. When I need ADC to sample as fast as possible, I take various considerations in account to squeeze maximum I can get out of given "hardware". For instance in single channel continuous sampling mode, especially when there's anti-alias input filter, I consider "under" values and it works for me. Very important to remember: datasheet figures are worst case figures, They shall be correct in whole temperature, VCC and input voltage swing ranges - even for consecutive ADC samples.

    Todd Anderson78572 said:
    So far, I have been able to confirm that my choices have created the ADC environment where I am getting valid measurements on my ADC inputs.

    If you are getting everything you need- congratulations!

  • Todd Anderson78572 said:
    d. Where does the "800 nsec" come from?

    Maybe some setup clocks/time?

    Todd Anderson78572 said:
    I cannot use ADC12SHT01 (=32), but I need to go the next higher value

    You can use 32, you don’t need to go to a next higher value, you are free to do what you want.

    The ADC needs to charge his capacitor as a conversion reference, it’s a simple rule 1RC is 63%, 5RC is near 100% but not exactly 100%. Now it’s up to you how precise you want to have the conversion result, the longer the sample time the more precise the result.


  • Guys:

    I have essentially updated some existing code and my sample times are 16 times faster than previous - which is dramatic. (Sample times went from >1400 usec to under 100 usec.) I have to justify all of the changes that I made to get to this point, and seeing no other posts that went into detail on the ADC equations, I sent the previous post.

    This is great news for the project that I have been working on...overall sample rates have gone up, and from the optimizations I have been able to do, the overall time spent in interrupt service routines has gone down, resulting in longer battery life.

**Attention** This is a public forum