ADC_CLOCK Question


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2006
    Posts
    89

    Default ADC_CLOCK Question

    where do the numbers for Define ADC_Clock come from. I have seen a 1, 3, 8. How do I know what to set it to and where do I get this list of numbers? I am using PBP with a 16f876a and a 20 mhz crystal. Thanks in advance.

  2. #2
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Travin77, You need to look in the data sheets for the PIC micro you are using. For instance in the data sheet for the 16F88 bits 7 & 6 of ADCON0 register need to be set to binary equiv. of 3 for the internal RC clock source for the A/D. This is the same as the DEFINE ADC_CLOCK 3 statement.

    Dave Purola,
    N8NTA

  3. #3
    Join Date
    Feb 2006
    Posts
    89


    Did you find this post helpful? Yes | No

    Default Adc Clock

    Thanks. I just gave up on it. My sensor was bad anyway. Thanks again.

  4. #4
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Thumbs up

    As stated in Data Sheet:

    bit 7-6 ADCS1:ADCS0: A/D Conversion Clock Select bits
    00 = FOSC/2
    01 = FOSC/8
    10 = FOSC/32
    11 = FRC (clock derived from the internal A/D module RC oscillator)


    If these are complex things to play with then use the following DEFINEs instead:


    For FOSC/2:
    DEFINE ADC_CLOCK 0

    For FOSC/8:
    DEFINE ADC_CLOCK 1

    FOSC/32:
    DEFINE ADC_CLOCK 2

    For A/D RC oscillator:
    DEFINE ADC_CLOCK 3




    -----------------------------------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

Similar Threads

  1. ADCIN question
    By Greg McFadden in forum General
    Replies: 4
    Last Post: - 16th September 2008, 02:53
  2. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 17:39
  3. Remote PIC input question
    By Adrian in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st September 2007, 15:44
  4. Question for a math guru
    By Christopher4187 in forum General
    Replies: 3
    Last Post: - 22nd November 2006, 09:45
  5. Please answer my first question
    By John_001 in forum Off Topic
    Replies: 1
    Last Post: - 15th September 2006, 06:49

Members who have read this thread : 1

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