ADC timer definition


Closed Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2015
    Posts
    13

    Default ADC timer definition

    Hello
    I have been understanding ADC, but the PBP manual only shows the option 3 (RC)
    when defining its clock letting in the nothing the explanation of the options 0 to 2 (that is an omission in the manual). Is this (3) the best option to use de ADC? Or maybe the only one reasonable?

    I'm using the 4550 with a 20 Mhz crystal. Do the 0 - 2 options would use this clock? Would it have any advantage respect using the AD RC? (I understood it is internal so I have to do nothing for it to work)

    I saw in the 4550 manual about the tad and fosc selections but I suppose that PBP makes that I can ignore them. Am I right?

    Thank you for your gentle advice.
    Luis Jiménez

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: ADC timer definition

    I have been understanding ADC, but the PBP manual only shows the option 3 (RC)
    not really it says
    DEFINE ADC_CLOCK 3 ' Set clock source (rc =3)
    The ADC_CLOCK value corresponds to a value set with 2-5 bits in a register within
    the PIC MCU. In most cases, the default value of 3 (binary %11) selects an
    independent RC clock that returns an accurate conversion result without regard for
    the system clock frequency. Conversion execution time may be enhanced in some
    cases by changing this setting.
    when defining its clock letting in the nothing the explanation of the options 0 to 2 (that is an omission in the manual). Is this (3) the best option to use de ADC? Or maybe the only one reasonable?
    you need to read the data sheet to see what your options are , not all pics are the same ,and osc speed matters
    for a pic18f4550 @20mHz the rc clock [3] is a poor choice (see data sheet) , fastest conversion time needs DEFINE ADC_CLOCK 5 ' Set clock source (fosc/16), (2 and 6 would probably also be ok)

    I saw in the 4550 manual about the tad and fosc selections but I suppose that PBP makes that I can ignore them. Am I right?
    no acquisition time varies with source impedence and the conversion clk needs to be appropriate .
    Attached Images Attached Images  
    Last edited by richard; - 19th June 2016 at 06:59.
    Warning I'm not a teacher

  3. #3
    Join Date
    Nov 2015
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: ADC timer definition

    Richard: Thank you very much for your answer. I have studied the manual and it doesn't have the text you showed, surely I have an older version. (if you would have a link) Anyway, thank you. With this information I'm not quite sure about what to do except letting the define_clock at 3. The application doesn't require very fast readings but accurate. I'll read PT100 sensors and I'm now busy making the propper signal conditioner with some op amps. Indeed is a microchip circuit proposal (AN687c document) with little modifications, using the AD of the 4550 instead of an independent AD, and testing with stereo audio cable to connect the three cables between the pic circuit and the PT100 sensors. Yes it is more entertaining than TV, maybe not more than, for instance, "Obsession" movie, with Juliette Binoche (my girlfriend) and Jeremy Irons. Have a good day.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,386


    Did you find this post helpful? Yes | No

    Default Re: ADC timer definition

    I have studied the manual and it doesn't have the text you showed, surely I have an older version. (if you would have a link)
    http://melabs.com/resources/index.htm#Manuals
    With this information I'm not quite sure about what to do except letting the define_clock at 3.
    for a pic18f4550 @20mHz the rc clock [3] is a poor choice (see data sheet) if you are using the adcin command . for accuracy the device needs to sleep during the conversion according to the data sheet and adcin will not do that
    Warning I'm not a teacher

  5. #5
    Join Date
    Nov 2015
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: ADC timer definition

    Thank you again.
    Then ADCIN is an instruction nobody should use in order to have precision?
    Excuse me but I have another question, If I use the pins dedicated for AN2 and AN3 in another matters, will the ADC have the 5 volts of Vdd as reference as default? (I hope so because I have any pins left) Or I have to use necesarily AN2 and AN3 to specify that reference?
    Have a good day or night.
    Luis

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


    Did you find this post helpful? Yes | No

    Default Re: ADC timer definition

    Then ADCIN is an instruction nobody should use in order to have precision?
    why would you say that ?
    adcin is only an issue if you use that chip [pic18f4550] with the adc clock option 3 [rc] and fosc > 1mHz
    with fosc=20mHz adcin is fine with adc clock option 5



    If I use the pins dedicated for AN2 and AN3 in another matters, will the ADC have the 5 volts of Vdd as reference as default? (I hope so because I have any pins left) Or I have to use necesarily AN2 and AN3 to specify that reference?
    the default powerup state for vcfg is 00, which defaults to vss/vdd for reference
    Attached Images Attached Images  
    Warning I'm not a teacher

  7. #7
    Join Date
    Nov 2015
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: ADC timer definition

    Thank you very much. I'll use it so and tell you what happens.
    Luis

Similar Threads

  1. ADC values above 4095 for 12 bit ADC
    By longpole001 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 1st February 2015, 23:24
  2. ADC problem on 18F46K22 device using all 28 ADC pins
    By JimAvanti in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd February 2012, 21:22
  3. Button command, definition badly worded !?!
    By lerameur in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th December 2010, 08:27
  4. Moved from PM to MPASM and have fuse definition problems
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 26th November 2008, 23:27
  5. What is the definition of "Several Weeks" ????
    By keithdoxey in forum General
    Replies: 1
    Last Post: - 3rd April 2006, 15:10

Members who have read this thread : 1

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

Tags for this Thread

Posting Permissions

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