ADC resolution for 16F616


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Apr 2016
    Location
    Plainfield, Illinois
    Posts
    73


    Did you find this post helpful? Yes | No

    Default Re: ADC resolution for 16F616

    Your answer is appreciated, you took awhile to answer and you're right - read. Most people would just reply with - hey idiot - read the docs for petes sake.
    I've read the docs about 25 times, but sometimes this 65 year old brain is a bit slow.

    Now - I didn't start w page 73 on this topic, I started with 74. If I would have slowed down and read pg 73 I might have understood better. So - again thanks for taking the time to explain. I actually got it to work by "massaging the ADCON0 register but need to read your reply again and figure out why it worked.

    Would you be willing to write code for me? - for a price of course.. email [email protected] - my name is Rich. I could use a good programmer for my side business. (hope this is ok to post)
    Last edited by pescador; - 26th April 2018 at 13:45.
    My dad never liked you...

  2. #2
    Join Date
    Apr 2016
    Location
    Plainfield, Illinois
    Posts
    73


    Did you find this post helpful? Yes | No

    Default Re: ADC resolution for 16F616

    My ADCON0 register looks like this 10010011. Now I have to figure out why it worked.

    starting from left

    1 = Right justified, needed for 10 bit
    0 = reference is VDD
    0010 = using AN2
    1 = not sure..
    1 = ADC is enabled.


    INPUT PORTA.2
    ANSEL - PORTA.2
    WPUA = ?
    Last edited by pescador; - 26th April 2018 at 14:02.
    My dad never liked you...

  3. #3
    Join Date
    Apr 2014
    Location
    OK
    Posts
    557


    Did you find this post helpful? Yes | No

    Default Re: ADC resolution for 16F616

    With PBP3 you won't need to even list ADCON0 unless you change your resolution. PBP3 has to address the ADCON0 Register to select the appropriate AD Channel, and the Justify Bit. Try not listing ADCON0 or ADCON1 at all and see if it still works.

  4. #4
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,132


    Did you find this post helpful? Yes | No

    Default Re: ADC resolution for 16F616

    Everything you need to setup the registers is really in the pdf of your chip. Please be careful selecting new chips as Microchip may issue a Preliminary pdf file having a lot of errors. Also keep your eye on the errata files that Microchip publishes on the chip's page.

    Now, you asked for more precision on your first post.

    Most chips have 8 or 10 bits at the low end 8-bit chips. If you can spare some time on your chip and your application, then you may use the Oversampling routine published here: http://dt.picbasic.co.uk/CODEX/AnalogueOverSampling

    You may reach 16-bits results given you will sacrifice 50-100ms, depending on the chip. I thing 12 or 14 bits are good enough with maximum 6.2ms delay in your program (less if you have a fast MCU).

    With the routine mentioned, you do not need to filter your results for noise or invalid sampling.

    Ioannis

Similar Threads

  1. 16F616 A to D
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 1st May 2009, 16:37
  2. Configuring 16F616
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 16th February 2009, 16:28
  3. How to calculate ADC resolution (pic12f683)
    By peu in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th April 2007, 18:39
  4. Replies: 14
    Last Post: - 4th October 2006, 05:45
  5. High resolution ADC
    By vsingh in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 29th April 2004, 18:53

Members who have read this thread : 0

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