12f675 sensing temperature...


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    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! :-)

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by rossfree View Post
    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
    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; - 6th April 2007 at 00:43.

  3. #3
    Join Date
    Oct 2004
    Location
    New Hampshire
    Posts
    76


    Did you find this post helpful? Yes | No

    Default

    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! :-)

Similar Threads

  1. Replies: 10
    Last Post: - 17th February 2012, 08:19
  2. Write Onewire data toa I2C memory / read ASCI
    By Eugeniu in forum mel PIC BASIC Pro
    Replies: 67
    Last Post: - 16th November 2008, 20:19
  3. Conversion problem
    By eva in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th March 2007, 19:21
  4. Help for decimal conversion
    By eva in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 15th March 2007, 19:20
  5. Serout "onewire.bas"
    By puru in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th July 2005, 01:14

Members who have read this thread : 0

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