hi aratti...i hv tried to change my temp equation from your information but the temperature still not showing correctly..can you plz check my code..
INCLUDE "modedefs.bas"
define FOSC 4
define LCD_DREG PORTD
define LCD_DBIT 4
define LCD_RSREG PORTD
DEFINE LCD_RSBIT 2
define LCD_EREG PORTD
define LCD_EBIT 3
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
'HIGH PORTD.1
C VAR WORD
TRISC = %10111111 ' Set TX (PortC.6) to out, rest in
RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $20 ' Enable transmit, BRGH = 0
SPBRG = 25 ' 9600 Baud @ 0.16%
SPBRGH = 0
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator
define ADC_BITS 10
define ADC_CLOCK 3
define ADC_SAMPLEUS 50
lmtemp var word
temp var byte
vout var byte
quanta con 1250
TRISE = %111
ADCON1 = 0
MAIN:
ADCIN 6, lmtemp
vout = lmtemp/205
temp = (Vout*100)-50
LCDOUT $FE,1
LCDOUT " Programmed by"
LCDOUT $FE,$C0
lcdout "YAN^S TEMP="
LCDOUT #temp
LCDOUT " C"
'HIGH PORTD.1
HSEROUT [dec temp,10]
HSerout ["The Temp Are Now ",#temp,"C",13]
pause 100
GOTO MAIN
end
tq very much...
Bookmarks