NTC thermistor temperature sensing


Closed Thread
Results 1 to 37 of 37

Hybrid View

  1. #1
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,653


    Did you find this post helpful? Yes | No

    Default

    ADCIN 1,tb0
    tb1=tb0-16170
    tb1=tb1*tb3
    tb2=Div32 634
    tb0=tb2/100
    tb1=tb2//100
    see any difference between Tb0 value @ line 1 and Tb0 Value @ line 5 ???

    really no ?

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  2. #2


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mackrackit View Post
    Never trust a sim.
    Try it in real life and come back.
    In real life with the same code:


    Quote Originally Posted by Acetronics View Post
    see any difference between Tb0 value @ line 1 and Tb0 Value @ line 5 ???

    really no ?

    Alain
    My updated code :

    Code:
    define OSC 20
    DEFINE ADC_BITS 10
    DEFINE ADC_SAMPLEUS 10
    DEFINE LCD_DREG PORTC
    DEFINE LCD_RSREG PORTC
    DEFINE LCD_EREG PORTC
    DEFINE LCD_EBIT 5 
    
    ntc VAR WORD
    tb0 VAR WORD
    tb1 VAR WORD
    tb2 VAR WORD
    
    TRISA=%11111111     
    ADCON1=%10000010   
    
    PAUSE 4000
    
    lp:
    
    ADCIN 1,ntc
    tb0=ntc
    if tb0>=16170 then
    tb1=tb0-16170 
    ELSE 
    tb0=0
    ENDIF
    tb1=tb1*100                                      
    tb2=Div32 634
    tb0=tb2/100   
    tb1=tb2//100    
               
    PAUSE 100
    
    Lcdout $fe,$c0,"ITS: ",DEC (tb0 DIG 1),DEC (tb0 DIG 0),".",DEC (tb1 DIG 1),"°C"
    
    goto lp
    I was surprised because the previous code worked good.

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