16f877 with LM335 problem


Results 1 to 40 of 47

Threaded View

  1. #29
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,116


    Did you find this post helpful? Yes | No

    Default Re: 16f877 with LM335 problem

    That's because you have left justified the ADC result in ADRESL and ADRESH.

    Set the adcon0 to %10000001.

    Also you have this calculation:

    Code:
     Temperature = (LM35_Vout - LM35_VGND) * 100
    What about LM35_Vout being less than LM35_VGND?

    I expected you would do this and noted in earlier post (#33)

    The simplest way is to have an if-then check first like this:

    Code:
     if LM35_Vout >LM35_VGND then
           Temperature = (LM35_Vout - LM35_VGND) * 100
     else
     if LM35_Vout <= LM35_VGND then
           Temperature = (LM35_VGND - LM35_Vout) * 100
     endif
    Ioannis
    Last edited by Ioannis; - 16th April 2015 at 13:48.

Similar Threads

  1. 16F877 HSERIN problem with 3th party software
    By RFsolution in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 11th March 2009, 17:11
  2. LCD problem with 16F877
    By alexx_57 in forum General
    Replies: 10
    Last Post: - 25th July 2007, 13:47
  3. problem using 16f877
    By yrch in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 20th February 2006, 18:58
  4. 16F877 20MHz problem
    By swordman in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 31st July 2004, 10:02
  5. 16F877, DS18S20 and Serial Comm Problem
    By YellowTang in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 26th April 2004, 10:36

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