NTC thermistor temperature sensing


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825


    Did you find this post helpful? Yes | No

    Default

    Code:
    From your code:
    
    ADCIN 1,ntc
    tb0=ntc
    if tb0>=16170 then
    tb1=tb0-16170 
    ELSE 
    tb0=0
    ENDIF
    Since ntc could be 0 or 1023 maximum, the condition if tb0>=16170 then is always false so tbo will be always zero and tb1 will be never setted with your required calculation tb1=tb0-16170.

    Cheers

    Al.
    Last edited by aratti; - 15th January 2011 at 17:19.
    All progress began with an idea

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by aratti View Post
    Code:
    From your code:
    
    ADCIN 1,ntc
    tb0=ntc
    if tb0>=16170 then
    tb1=tb0-16170 
    ELSE 
    tb0=0
    ENDIF
    Since ntc could be 0 or 1023 maximum, the condition if tb0>=16170 then is always false so tbo will be always zero and tb1 will be never setted with your required calculation tb1=tb0-16170.

    Cheers

    Al.
    The code works for me because the value of my ADC varies from 0 to 65525 (it's a 10-bit ADC, but with bits shifted to a 16-bit value).

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