SOLVED: How can I reduce ADC jitter


Results 1 to 40 of 96

Threaded View

  1. #31
    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

    According to this:

    https://skills.microchip.com/introdu...tecture/691929

    The pull-up is disabled automatically when either TRIS is set to an output or the pin is set as an analog input. These changes to TRIS and ANSEL will override WPU settings.

    I can just set all pull-ups ON, leave the unused pins unconnected and forget about them. Then use the others as I wish in ANSEL and TRIS.

    The only times I need to be concerned with WPU is on pins that must not be disturbed for whatever special reason.


    Code:
    WPUA = %11111111    '----------------------------------------------------------------'
    WPUB = %11111111    '           ALWAYS SET WEAK PULL-UPS ON ALL PINS FIRST           '
    WPUC = %11111111    '----------------------------------------------------------------'
                        '       CHANGES TO ANSEL AND TRIS WILL OVERRIDE AS REQUIRED      '
                        '----------------------------------------------------------------'
    
    ANSELA = %00000010                      ' Pin A3 = SW input                 not implemented yet
                                            ' Pin A2 = ADC (B5K)                not implemented yet
                                            ' Pin A1 = ADC (B5K)
                                            ' Pin A0 = ADC (voltage divider)    not implemented yet
    ANSELB = %00000000
    ANSELC = %00000000
    
    TRISA = %00000010                       ' Pin A3 = SW input                 not implemented yet
                                            ' Pin A2 = ADC input 2              not implemented yet
                                            ' Pin A1 = ADC input 1
                                            ' Pin A0 = ADC input 0              not implemented yet
    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 ***

    EDIT: I can even leave PORT at the top in case a pin is left as analog output.

    Code:
    PORTA = %00000000                       '-------------------------------------------' 
    PORTB = %00000000                       '       ALWAYS SET PINS LOW FIRST           '
    PORTC = %00000000                       '-------------------------------------------'

    Or did I miss something important...?
    Last edited by Demon; - 4th March 2025 at 23:29.
    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, 22:11
  2. Replies: 6
    Last Post: - 5th November 2023, 17: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, 15:57
  4. Unwanted output signal jitter
    By LinkMTech in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 18th January 2008, 03:31
  5. Dmx Solved !!!!!!!
    By oscar in forum mel PIC BASIC Pro
    Replies: 18
    Last Post: - 2nd July 2005, 22: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