Author Topic: PIC32MX170F256D(A2), IVref impedance?  (Read 1077 times)

0 Members and 1 Guest are viewing this topic.

Offline Chris CTopic starter

  • Frequent Contributor
  • **
  • Posts: 259
  • Country: us
PIC32MX170F256D(A2), IVref impedance?
« on: September 21, 2015, 05:32:50 am »
I'm testing the ADC channels on this MCU, and being thorough.  Sampling all 16 channels about 50x per second, everything is giving the expected results, except AN14.

AN14 is internally connected to IVref, which is an internal 1.2V precision voltage reference.  However, with a sample and hold (S/H) time of 250ns, I'm only measuring IVref as 0.687V.  Boosting the S/H time to 750ns, I get closer to the expected result.

According to the main datasheet, S/H of 200ns is sufficient for a signal impedance of up to 5.0K.  I've checked all related datasheets and can't find IVref's impedance listed, nor do I know what might be a typical impedance.  But I suspect it must be rather high.  And if the ADC's S/H capacitor is capable of momentarily pulling down the IVref voltage, then one should never sample it at all; else it may cause false triggering of other things using it (comparators, CTMU).

Does this seem like a valid assessment?  Or is there another explanation?  Code follows, in case I've made some error. 

Code: [Select]
void DAQ_Scan() {
    UNATIVE i1;

    AD1CON1 = 0;
    AD1CON1bits.SSRC = 0b111; // internal counter ends sampling and starts conversion (auto convert)
    AD1CON1bits.CLRASAM = 1; // stop conversions when interrupt occurs
    AD1CON2 = 0;
    AD1CON2bits.CSCNA = 1; // scan inputs
    AD1CON3 = 0;
    AD1CON3bits.ADCS = 1; // Tad=4*Tpb, pb=48Mhz, Tpb=20.833ns, so Tad=83.333ns
    AD1CON3bits.SAMC = 3; // S&H=3*Tad, so 250ns
    AD1CHS = 0;
    AD1CON1bits.ON = 1; // turn ADC module on

    AD1CON2bits.SMPI = 15; // interrupt after 16 samples
    AD1CSSL = 0xFFFF; // scan 16 channels
    IFS0bits.AD1IF = 0; // clear interrupt
    AD1CON1bits.ASAM = 1; // start sampling
    while (!IFS0bits.AD1IF) {}; // wait for sample complete
    UI32* ptr = (UI32*)&ADC1BUF0;
    for (i1=0; i1<16; i1++) {
        AdcResults[i1] = *ptr;
        ptr+=4;
    };
}
 

Offline Moondeck

  • Regular Contributor
  • *
  • Posts: 142
  • Country: dk
  • i really like compilers
Re: PIC32MX170F256D(A2), IVref impedance?
« Reply #1 on: September 23, 2015, 10:23:58 am »
yup, it probably has too big impedance. Its pretty bad with documentation on such small things in PICs, i couldnt find the DAC speed the other day, for the PIC16F series
I'm selling 100ml bottles of free energy, PM me for pricing.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf