SOLVED: How can I reduce ADC jitter


+ Reply to Thread
Results 1 to 40 of 96

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    Ok, thanks.

    I've reverted to legacy mode, still using FVR, removed all LCD components, added USART:

    Code:
    #CONFIG
        __config _CONFIG1, _FEXTOSC_OFF & _RSTOSC_HFINT32 & _CLKOUTEN_OFF & _CSWEN_OFF & _FCMEN_ON
        __config _CONFIG2, _MCLRE_ON & _PWRTE_OFF & _LPBOREN_OFF & _BOREN_ON & _BORV_LO & _ZCD_OFF & _PPS1WAY_OFF & _STVREN_ON & _DEBUG_OFF
        __config _CONFIG3, _WDTCPS_WDTCPS_11 & _WDTE_OFF & _WDTCWS_WDTCWS_7 & _WDTCCS_LFINTOSC
        __config _CONFIG4, _WRT_OFF & _SCANE_available & _LVP_OFF
        __config _CONFIG5, _CP_OFF & _CPD_OFF
    #ENDCONFIG
    
    DEFINE OSC 32
    
    DEFINE  ADC_BITS 10                 ' 10-bit Analog to digital
    DEFINE  ADC_SAMPLEUS 50             ' Set sampling time in uS
    
    DEFINE  HSER_RXREG PORTC
    DEFINE  HSER_RXBIT 7
    DEFINE  HSER_TXREG PORTC
    DEFINE  HSER_TXBIT 6
    
    DEFINE  HSER_RCSTA 90h              ' Enable serial port & continuous receive
    DEFINE  HSER_TXSTA 24h              ' Enable transmit, BRGH = 1
    Define  HSER_BAUD 115200
    DEFINE  HSER_CLROERR 1              ' Clear overflow automatically
    DEFINE  HSER_SPBRGH  0
    DEFINE  HSER_SPBRG  68
    
    ;--- Setup registers -----------------------------------------------------------
    
    BAUDCON.3 = 1                       ' Enable 16 bit baudrate generator
    
    FVRCON = %10000011                  ' FIXED VOLTAGE REFERENCE CONTROL REGISTER
    '   bit 7   FVREN: Fixed Voltage Reference Enable bit
    '       --->    1 = Fixed Voltage Reference is enabled
    '   bit 1-0 ADFVR<1:0>: ADC FVR Buffer Gain Selection bit
    '       --->    11 = ADC FVR Buffer Gain is 4x, (4.096V)(2)
    
    ADCON0 = %10000100                  ' ADC CONTROL REGISTER 0
    '   bit 7   ADON: ADC Enable bit
    '        --->   1 = ADC is enabled
    '   bit 2   ADFRM0: ADC results Format/alignment Selection
    '        --->   1 = ADRES and ADPREV data are right-justified
    
    ADCON2 = %00000000                  ' ADC CONTROL REGISTER 2
    '   bit 2-0 ADMD<2:0>: ADC Operating Mode Selection bits(1)
    '        --->   000 = Basic (Legacy) mode
    
    ADCLK = %00111111                   ' ADC CLOCK SELECTION REGISTER
    '   bit 5-0 ADCCS<5:0>: ADC Conversion Clock Select bits
    '        --->   111111 = FOSC/128
    
    ADREF = %00000011                   ' ADC REFERENCE SELECTION REGISTER
    '   bit 4 ADNREF: ADC Negative Voltage Reference Selection bit
    '        --->   0 = VREF- is connected to AVSS
    '   bit 1-0 ADPREF: ADC Positive Voltage Reference Selection bits
    '        --->   11 = VREF+ is connected to FVR_buffer 1
    
    ADPCH = %00000000                   ' ADC POSITIVE CHANNEL SELECTION REGISTER
    '        --->   000000 = ANA0
    
    ANSELA = %00001001                      ' Pin A3 = ADC (voltage divider)
                                            ' Pin A0 = ADC (B5K)
    ANSELB = %00000000
    ANSELC = %00000000
    
    TRISA = %00001001                       ' Pin A3 = ADC input 3
                                            ' Pin A0 = ADC input 0
    TRISB = %00000000                       ' Pin B7 = ...not available, ICSPDAT
                                            ' Pin B6 = ...not available, ICSPCLK
    TRISC = %11000000                       ' Pin C7 = RX      *** Datasheet requirement, INPUT ***
                                            ' Pin C6 = TX      *** Datasheet requirement, INPUT ***
    
    ADCinput            var WORD
    ADCdiff             var WORD
    
    OldADC0             var WORD
    OldADC3             var WORD
    
        Pause 100                           ' Let PIC and LCD stabilize
        ADCinput = 0        : ADCdiff = 0
        OldADC0 = 9999      : OldADC3 = 9999
    
        Hserout [   "ADC TEST",                     _
                    10,                             _
                    "Initial values = 9999", 10, 10]         
    
    Mainloop:
    
    rem                             ADC 0
    
        adcin 0, ADCinput : adcin 0, ADCinput
        
        if ADCinput < oldADC0 then
            ADCdiff = oldadc0 - adcinput
        else
            ADCdiff =  adcinput - oldadc0
        endif
    
        if ADCinput <> oldADC0 then
            oldADC0 = ADCinput
            Hserout [   "B5K pot = ", dec4 ADCinput,"    diff = ", dec4 ADCdiff, 10]         
            while TXSTA.1 = 0               ' Check TRMT bit
            wend
        endif
    
    
    rem                             ADC 3
    
        adcin 3, ADCinput : adcin 3, ADCinput
        
        if ADCinput < oldADC3 then
            ADCdiff = oldadc3 - adcinput
        else
            ADCdiff =  adcinput - oldadc3
        endif
    
        if ADCinput <> oldADC3 then
            oldADC3 = ADCinput
            Hserout [   "                                         ", _ 
                        "Volt/divider = ", dec4 ADCinput,"    diff = ", dec4 ADCdiff, 10]         
            while TXSTA.1 = 0               ' Check TRMT bit
            wend
        endif
    
      GOTO Mainloop
    end

    This is what I get now, variations of 1 and 2 mostly:

    Code:
    ADC TEST
    Initial values = 9999
    
    B5K pot = 0680    diff = 9319
                                             Volt/divider = 0627    diff = 9372
    B5K pot = 0681    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0679    diff = 0002
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0629    diff = 0002
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0630    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0630    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0629    diff = 0001
                                             Volt/divider = 0628    diff = 0001
                                             Volt/divider = 0629    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0628    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0680    diff = 0002
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0630    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0631    diff = 0001
                                             Volt/divider = 0632    diff = 0001
                                             Volt/divider = 0631    diff = 0001
                                             Volt/divider = 0632    diff = 0001
    B5K pot = 0677    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0631    diff = 0001
                                             Volt/divider = 0630    diff = 0001
    B5K pot = 0677    diff = 0001
    B5K pot = 0679    diff = 0002
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0628    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0628    diff = 0001
                                             Volt/divider = 0629    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0628    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0627    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0628    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0627    diff = 0002
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
                                             Volt/divider = 0627    diff = 0001
                                             Volt/divider = 0626    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0627    diff = 0001
                                             Volt/divider = 0628    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0627    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0678    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
                                             Volt/divider = 0625    diff = 0001
                                             Volt/divider = 0626    diff = 0001
                                             Volt/divider = 0625    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0626    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0626    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0625    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0625    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0625    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0678    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0625    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0681    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0681    diff = 0002
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0625    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0622    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0622    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0622    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0622    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0622    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0622    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0681    diff = 0001
                                             Volt/divider = 0622    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0002
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0681    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0624    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0624    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
    B5K pot = 0679    diff = 0001
                                             Volt/divider = 0622    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0622    diff = 0001
                                             Volt/divider = 0623    diff = 0001
    B5K pot = 0679    diff = 0001
    B5K pot = 0680    diff = 0001
                                             Volt/divider = 0622    diff = 0001
    Last edited by Demon; - 24th February 2025 at 23:39.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    With those differences, I suppose I should add a mean average and call it a day.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  3. #3
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    Would dual TPS56637 step-down circuits help me reduce noise by PWM, LCD and other "noisy stuff"?

    Name:  Dual TPS56637.png
Views: 78930
Size:  126.4 KB


    Would diodes help in further isolating the 2 circuits? (like blocking surges) I looking for the minimum voltage for the TPS56637 circuit now, to make sure the voltage drop from 2 diodes wouldn't interfere with 9V input.

    I'd use dedicated PICs per function; 1 for input on top circuit, 1 for output on bottom circuit.
    Last edited by Demon; - 25th February 2025 at 00:24.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    I found this, that says it wouldn't hurt to put Schottkys on VDD.


    You don't need the diodes for ground, only using diodes for Vcc is sufficent....

    You could use schottky diodes as the voltage drop is 0.2V, that would be easiest.
    Circuit with dual power source: Replacing diodes with MOSFETs
    https://electronics.stackexchange.co...s-with-mosfets


    I suppose adding a bunch of filter caps downstream of the diodes would help reduce "fluctuations" before it enters the TPS56637.
    Last edited by Demon; - 25th February 2025 at 00:48.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  5. #5
    Join Date
    May 2013
    Location
    australia
    Posts
    2,666


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    stick a 2200uF low esr electrolytic in every power rail on each bread-board and be done with it. if it still noisy add another set.

    if that fails isolate noisy bits behind rfc's [rf chokes]. ditch the hi switching speed [noise inducing] mosfets for pwm, use bjt instead, its only a backlight

    as ioannis says, breadboards and low noise are very close to mutually exclusive concepts
    Last edited by richard; - 25th February 2025 at 03:43.
    Warning I'm not a teacher

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,666


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    i tried the burst mode averaging method. very nice if you don't need the adc for anything else, it would be ideal for monitoring a lifepo4 battery during all phases of discharge/charging/float. no great advantage for multiple inputs that i can see
    Warning I'm not a teacher

  7. #7
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    Quote Originally Posted by richard View Post
    i tried the burst mode averaging method. very nice if you don't need the adc for anything else, it would be ideal for monitoring a lifepo4 battery during all phases of discharge/charging/float. no great advantage for multiple inputs that i can see
    I'm going to see about using something like your MEAN average example. I had something like that a while ago (inspired by Melanie), but I had noisy power supplies. The TPS56637 works nicely, so I was hoping ADC2 could make my life easier.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: SOLVED: How can I reduce ADC drift

    Quote Originally Posted by richard View Post
    stick a 2200uF low esr electrolytic in every power rail on each bread-board and be done with it. if it still noisy add another set....
    I only have a few 1000uF electrolytics, so I put 2 on each rail, same ADC flutter of mostly 1, sometimes 2.


    Quote Originally Posted by richard View Post
    ...if that fails isolate noisy bits behind rfc's [rf chokes]....
    I only have these 2 on hand:
    RL-1284 100uH, https://www.electronicsurplus.com/re...uh-irms-0-4amp
    79F101K-TR-RC 100uH, https://www.mouser.com/datasheet/2/5...te-1371239.pdf


    Quote Originally Posted by richard View Post
    ...ditch the hi switching speed [noise inducing] mosfets for pwm, use bjt instead, its only a backlight...
    I was having difficulties turning the backlight all the way off using 2N2907A PNP. The BS250P P-chan worked like a charm from full OFF to full ON.


    Quote Originally Posted by richard View Post
    ...as ioannis says, breadboards and low noise are very close to mutually exclusive concepts
    Yeah, that's why I moved away from my larger main prototype board to only 2 PCB boards to get ADC working perfectly.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

Similar Threads

  1. SOLVED - IOC works on B0 but not B5
    By Demon in forum General
    Replies: 19
    Last Post: - 26th September 2024, 21:11
  2. Replies: 6
    Last Post: - 5th November 2023, 16:26
  3. trying to reduce current consumption on a 12HV615
    By Max Power in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 30th November 2011, 14:57
  4. Unwanted output signal jitter
    By LinkMTech in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th January 2008, 02:31
  5. Dmx Solved !!!!!!!
    By oscar in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 2nd July 2005, 21:57

Members who have read this thread : 16

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts