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
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
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.
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.
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
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
Bookmarks