12 bit or higher ADC on a PIC that works with PBP?


Closed Thread
Results 1 to 9 of 9
  1. #1
    Brandon's Avatar
    Brandon Guest

    Question 12 bit or higher ADC on a PIC that works with PBP?

    Can someone list a few Pics that can do better then 10-bit ADC?
    I am using 16f88 Pics now to monitor two Pots (on different pins) using the ADC command at 10-bits.
    It's all great, (better then 8-bit) but I'd like something that can do 12-bit or better.

    I checked all the Pic chips and I just can't tell which ones will work with PBP and have 12-bit ADCs that work. For example the Pic16f882 looks to have 12-bit ADCs but in the datasheet it only talks about 10-bit ADCs.

    Thanks for any help,
    Brandon
    Last edited by Brandon; - 11th November 2007 at 06:34.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    go here http://melabs.picbasic.com/Scripts/p....pl?action=adv
    select 12 bits for the ADC resolution
    Your answer will appear.

    If you select the 16c774, make sure and read the errata. I used them years ago and they were not quite able to produce 12 bit resolution at the time ...
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Brandon's Avatar
    Brandon Guest


    Did you find this post helpful? Yes | No

    Default Thank Paul...

    Thanks Paul,

    But I've used that utility, and one of the chips that comes up is the 16f882 as a 12-bit adc. But when I downloaded the datasheet for it, there is only mention of 10-bit ADC and 12-bit PWM.

    I know there are other Pics that the search comes up with. And I guess what I am asking for is one or two Pics that people know will work at 12-bit with PBP with no problems.

    Thanks again

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Brandon's Avatar
    Brandon Guest


    Did you find this post helpful? Yes | No

    Talking Any first hand experience?

    Just to be really clear... I'm looking for actual Pic model numbers. Not just links to Microchips web site or big lists of chips.

    Anyone ever use a Pic with 12bit ADCs with PBP?
    What chip was it?
    How well did it work in 12bit?

    Thanks

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Sorry and welcome on the forum so far, but if you can't do a simple search for a part number, imagine how hard the coding will be... school work i guess?

    first hit
    PIC18F2423, PIC18F2523, PIC184423, PIC18F4523, datasheet : http://ww1.microchip.com/downloads/e...Doc/39755B.pdf

    it worked great
    Last edited by mister_e; - 11th November 2007 at 10:31.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    Brandon's Avatar
    Brandon Guest


    Did you find this post helpful? Yes | No

    Default really not looking for an argument (really)

    I was looking for some first hand knowledge on Pic chips with 12bit ADCs.

    I have searched for them and its not that I haven't found any, it's that I found a lot.
    But at-least one of them, the 16f882 seems unclear about the ADCs. Some searchs come back stating it has 12bit ADCs but the datasheet doesn't clearly state 12bit, infact it states 10bit.

    I could buy some of the other Pic chips that claim to have 12bit ADCs but I was looking for a little advice from someone who may have used one before with PBP.

    Your link to the entire Microchip website wasn't really what I was looking for.

    But thanks and I hope I have not offended you.

  8. #8
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    As far as I can tell the 16F882 is 10-bit. I wouldn't think the 882 had 12-bit when the rest
    of the same family like 883, 884, 886 and 887 were all 10-bit.

    I've used the 18F2553 and 18F2523 12-bit A/D. Here's a short code example;
    Code:
    'CONFIG settings in 18F2553.INC
    'CONFIG PLLDIV=5,CPUDIV=OSC1_PLL2,USBDIV=2,FOSC=HS,FCMEN=OFF,IESO=OFF
    'CONFIG VREGEN=OFF,CCP2MX=ON,WDT=OFF,WDTPS=32768,PBADEN=OFF,PWRT=OFF,MCLRE=OFF
    'CONFIG LPT1OSC=OFF,BOR=ON,BORV=2,STVREN=ON,LVP=OFF,XINST=OFF,DEBUG=OFF,WRTB=ON
        
        DEFINE OSC 20
        DEFINE DEBUG_REG PORTC
        DEFINE DEBUG_BIT 6    ' Hardware USART TX pin
        DEFINE DEBUG_BAUD 9600
        DEFINE DEBUG_MODE 0   ' Non-inverted mode through MAX233
        
        ADResult VAR WORD
        
        Q CON 3126         ' (5/4095)*256=0.312576313. rounded up to 3126
        
        ADCON0 = %00000001 ' A/D module enabled, channel 0
        ADCON1 = %00001110 ' Vref = Vdd & Vss, AN0 = analog
        ADCON2 = %10101011 ' Right justified, 12 Tad, Frc clock
        INTCON = %01000000 ' Global ints disabled, enable peripheral interrupts
        PIE1.6=1           ' A/D interrupt enabled (for wake from sleep)
        
        ' Note we don't use an interrupt routine since the A/D complete
        ' interrupt is only waking the PIC from sleep.
        
    Main:
        ADCON0.1=1           ' Start the A/D conversion
        @ SLEEP              ' Sleep until A/D conversion finished
        WHILE ADCON0.1       ' A/D complete?
        WEND                 ' 
        PIR1.6=0             ' Clear A/D int flag
        
        ASM
         MOVFF ADRESL,_ADResult   ; get low byte
         MOVFF ADRESH,_ADResult+1 ; get high byte
        ENDASM
        
        DEBUG "Raw A/D val = ",DEC ADResult,13,10
        ADResult = ADResult */ Q
        DEBUG "ADResult */ ",DEC Q," = ",DEC ADRESULT,13,10
        DEBUG "ADResult = ",DEC ADResult DIG 4,".",DEC ADResult DIG 3,_
        DEC ADResult DIG 2,DEC ADResult DIG 1,"V",13,10
        PAUSE 2000
        GOTO Main
        
        END
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  9. #9
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    I have used the new 18F8723 with 12 bit A/D.

    To get the the full resolution, you have to use DEFINE

    "DEFINE ADC_BITS 10"

    Because PBP only "knows about" 8 and 10 bit converters.
    If the DEFINE is missing or not interpreted properly in the
    compiler, it will default to 8 bits.

    If you use the line above at the top of your program,
    and have a 12-bit converter in your chip, the result will
    indeed have a full 12 bits of resolution.
    Charles Linquist

Similar Threads

  1. decoding quadrature encoders
    By ice in forum mel PIC BASIC Pro
    Replies: 93
    Last Post: - 28th February 2017, 09:02
  2. AT/PS2 Keybord - PIC Interface?
    By Kamikaze47 in forum Code Examples
    Replies: 73
    Last Post: - 9th August 2009, 16:10
  3. Replies: 2
    Last Post: - 10th February 2006, 01:04
  4. PBP 16-bit ADC result math
    By sonic in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 13th March 2005, 14:21
  5. Using PBP Hex Files with FED Pic Programmer
    By jrudd in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th February 2005, 10:57

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