Thank you skimask,
but... I kinda want that 8 bit resolution. With Vref set at 2.55 volts, and using an LM34 temperature sensor outputing .01 volts per degree F, I get a digital number that corresponds very nicely with temperature... such that .8 volts in gives me a digital 80 out... representing 80 degrees F.
Dropping off the top two digits doesn't change the resolution... it just lops off the top end.
Can you help me figure out why it doesn't accept my statement:
DEFINE ADC_BITS 8
Thank you,
Ross
Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!
I like that! :-)
I didn't say drop off the top 2 bits of the upper byte, I said drop the top 2 bits of the lower byte (which are actually the bottom 2 bits of the result overall).
I don't think you can have it both ways, well you can, but it's a bit more difficult.
And why is 10 bits a problem? PBP can handle 10 bits easily, even on a PIC12F.
DEFINE ADC_BITS 8 - which version of PBP are you using?
Last edited by skimask; - 5th April 2007 at 23:43.
Thank you Skimask...
You just asked the right question...
The define statement is a PBP statement... and I'm accessing the pic directly with adcon0... not ADCIN. The define is correct if used with ADCIN. I have used it before but forgot I used them together.
I'm using PBP ver 2.45.
I've looked at your suggestion again and it makes more since. Let me see if I got it...
By dropping the two least significant bits, I essentially divide the ten bit result by four. That gives me an eight bit result. Yes?!
It's MILLER TIME!
Ross
Never enough knowledge to be called intelligent but just enough knowledge to be considered dangerous!
I like that! :-)
Bookmarks