Shop Learn P1 Docs P2 Docs Events
ADC refresh rate — Parallax Forums

ADC refresh rate

I am going to run 8 pins of adc in its own Cog. How often can I refresh them?


  • evanhevanh Posts: 14,241

    They're good for a couple of MHz with AC signals. But if you're wanting to do DC instrumentation sampling then it's much much slower because of the need to continuously cycle between GIO, VIO and the pin.

  • @RS_Jim said:
    I am going to run 8 pins of adc in its own Cog. How often can I refresh them?

    It depends on the resolution number of bits, that you need. The adc's are independent from each other. Details can be found on page 95
    In my opinion the word ENOB is used wrongly there. It is used for resolution, while normally it is used for a signal to noise ratio. I have not seen data, which give more than 12 bits of "real ENOB". Averaging can often help.

  • RS_JimRS_Jim Posts: 1,732

    Thanks @evanh for the feedback. However, I am not understanding what you are meaning by cycling through GIO,VIO and the Pin.

  • evanhevanh Posts: 14,241
    edited 2023-01-25 22:25

    GIO and VIO are the measurement of the ground and pin supply voltages. Those have to be measured, as well as the pin's input voltage. And, because of the drifting of the ADC hardware, they need to be repeatedly re-measured over the duration.

    Have a read of this source code and maybe some of the topic on thermistor sampling too -

  • evanhevanh Posts: 14,241
    edited 2023-01-25 23:04
            ratio = (float)(vio - gio) / (float)(vio - value) - 1.0;    // NTC Rt connected to GIO, R0 connected to VIO
            temperature = 1.0 / (log(ratio) / 3380.0 + 1.0 / 298.15) - 273.15;    // Thermistor Beta for 10 kR at 25 C

    The formula for the temperature relies on the external power supply of the thermistor being the same one as VIO. As such, the voltages don't need to be resolved. Temperature can conveniently be calculated with a numerical ratio only.

    PS: Remove the test bias when wiring a real thermistor.

    enum {
        PINBIAS = P_ADC,
    //  PINBIAS = P_ADC | P_OE | P_LOW_150K,
Sign In or Register to comment.