PIC16F18446 - 12 bits ADC gives 16 bits results!!!!


Results 1 to 4 of 4

Threaded View

  1. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,144


    Did you find this post helpful? Yes | No

    Default Re: PIC16F18446 - 12 bits ADC gives 16 bits results!!!!

    Your code does not set the ADCON0 register properly to right justify the result. The default is Left justification, hence the 65520, or FFF0 or 1111 1111 1111 0000 result, which seems as 12 bit just fine, only left justified.

    You need to set FRM bit to 1. It is the bit 2 in the ADCON0 register. Look at the page 536 of the datasheet. There are many other settings regarding ADC converter if you need other features.

    I bet that your first reading after 0 was 16 then 32, then 48 etc instead of 1,2,3

    Ioannis
    Last edited by Ioannis; - 24th February 2024 at 21:50.

Similar Threads

  1. Parity & Stop Bits settings and results
    By svjohngalt in forum Serial
    Replies: 4
    Last Post: - 27th January 2018, 20:16
  2. Replies: 2
    Last Post: - 23rd April 2013, 16:34
  3. Incorrect adc channel bits generated
    By grahamg in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 6th February 2010, 18:56
  4. DT_INTS-14 /interrupts enable bits / flag bits
    By bogdan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 16th May 2009, 18:42
  5. parsing adc word into bits
    By GREYBIRDMAN in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 13th April 2007, 21:08

Members who have read this thread : 2

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