Temperature Indicator Usage


Results 1 to 14 of 14

Threaded View

  1. #1
    Join Date
    Dec 2012
    Location
    Türkiye
    Posts
    103

    Default Temperature Indicator Usage

    Hello ;

    I'm trying to use the built in temperature sense function of PIC16F1827 but so far I haven't had any luck with that .. All I have tried to do is reading the RAW ADC value of the silicon die operating temperature value but I don't get anything meaningful ...

    I have a potentiometer connected to RB1 (analog channel 11) and the other adc reading is performed on analog channel 29 which is supposed to give me the result of the raw temperature reading of the silicon die .. When I rotate the potentiometer I see what I must see which is the actual expected raw adc reading result coming from the ADC channel 11 but the temperature reading I'm trying to get changes too while I rotate the pot and works dependent to the ADC value that I get from my potentiometer ...

    I was so exciting with the idea of reading the chip temperature without any external component but It's been a total frustration ...

    Code:
    '****************************************************************
    '*  Name    : PIC16F1827.BAS                                    *
    '*  Author  : BURAK GÜNAY                                       *
    '*  Notice  : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
    '*          : All Rights Reserved                               *
    '*  Date    : 27.4.2014                                         *
    '*  Version : 1.0                                               *
    '*  Notes   : PIC16F1827                                        *
    '*          :                                                   *
    '****************************************************************
    
    #header
      errorlevel -303  ; suppress Program word too large
    #ENDHEADER
    
    
    #config
     __CONFIG _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _CPD_OFF & _BOREN_OFF & _CLKOUTEN_OFF & _IESO_OFF & _FCMEN_OFF 
     __CONFIG _CONFIG2, _WRT_OFF & _PLLEN_ON & _STVREN_OFF & _BORV_19 & _LVP_OFF
    #ENDCONFIG
    '-------------------------------------------------------------------------------
    'define OSC 4
    'DEFINE OSC 16
    define OSC 32
    
    
    'OSCCON=%01101010    'OSC is @ 4 MHZ
    'OSCCON=%01111000    'OSC is @ 16 MHZ
    OSCCON=%11110000    'OSC is @ 32 MHZ  --- PLLEN MUST BE ENABLED
    
    
    '------------- LCD DEFINES ------------------------
    DEFINE LCD_DREG PORTB 'LCD data port 
    DEFINE LCD_DBIT 4 'LCD data starting bit 0 or 4 
    
    
    DEFINE LCD_RSREG PORTA 'LCD register select port 
    DEFINE LCD_RSBIT 7 'LCD register select bit
    
    
    DEFINE LCD_RWREG PORTA   ' LCD read/write port
    DEFINE LCD_RWBIT 5   ' LCD read/write pin bit  
    
    
    DEFINE LCD_EREG PORTA 'LCD enable port 
    DEFINE LCD_EBIT 6 'LCD enable bit
    
    
    DEFINE LCD_BITS 4 'LCD bus size 4 or 8 
    DEFINE LCD_LINES 4 'Number lines on LCD
    
    
    DEFINE ADC_BITS 10     ' ADCIN resolution  (Bits)
    DEFINE ADC_CLOCK 6     ' ADC clock source  (Fosc/64)
    DEFINE ADC_SAMPLEUS 20 ' ADC sampling time (uSec)
    
    
    '------------- LCD DEFINES -------------------------
    
    
    '-------------------------------------------------------------------------------
    PORTA=%00000000     :      PORTB=%00000000
    TRISA=%00000000     :      TRISB=%00000010 
    ANSELA=%00000       :      ANSELB=%00000010
    ADCON0=%00000001    :      ADCON1=%11100000
    FVRCON=%00110000
    '-------------------------------------------------------------------------------                     
    
    
    value       var word    :   value=0
    rawtemp     var word    :   rawtemp=0
             
    lcdout $fe,1
    pause 500
      
    MAIN:
    
    
    adcin 11,VALUE
    adcin 29,rawtemp
    
    
    LCDOUT $FE,$80,"      ",DEC5 rawtemp,"     "
    LCDOUT $FE,$C0,"      ",DEC5 VALUE,"     "
    
    
    GOTO MAIN
    Where do I make mistake ?

    I'm expecting your helps , there must be at least a couple others that might have been interested in this function of such MCUs ... Thanks in advance
    Last edited by gunayburak; - 26th July 2015 at 18:16.
    - Ipsa scientia potestas est -

Similar Threads

  1. One of 33 LED output Indicator
    By SOTASOTA in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th December 2012, 17:26
  2. About the replacement of the indicator with BASIC.
    By apollo21 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th June 2008, 04:56
  3. Interrupt usage
    By Russ Kincaid in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 20th April 2008, 16:20
  4. Serin usage?
    By champion in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 24th January 2007, 00:57
  5. Temp. Indicator.
    By PIC Coder in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th April 2005, 06:10

Members who have read this thread : 1

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