If you need any help let us know...
ya need some help here. regarding the lm35lcd, can you explain to me why
ToTemp:
CLRF VoutHi
CLRF VoutLo ; x49 = x1 + x 16 + x 32
MOVF ADCLOW,W ; x 1
ADDWF VoutLo
MOVF ADCHIGH,W
ADDWF VoutHi
RLF ADCLOW,F ; add x16 = x5
RLF ADCHIGH,F
RLF ADCLOW,F
RLF ADCHIGH,F
RLF ADCLOW,F ;
RLF ADCHIGH,F
RLF ADCLOW,F
RLF ADCHIGH,F
MOVF ADCHIGH,W
ADDWF VoutHi
MOVF ADCLOW,W
ADDWF VoutLo
BTFSC STATUS,C
INCF VoutHi
RLF ADCLOW,F ; add x32 = x49
RLF ADCHIGH,F
MOVF ADCHIGH,W
ADDWF VoutHi
MOVF ADCLOW,W
ADDWF VoutLo
BTFSC STATUS,C
INCF VoutHi
RETURN
what is the meaning of this?
anyway i connect my lm35dz directly to pic16f877a an0
and the converting part
Convert: ; Takes number in NumH:NumL
SWAPF VoutHi, w ; Returns decimal in
IORLW B'11110000' ; TenK:Thou:Hund:Tens:Ones
MOVWF Thou
ADDWF Thou,f
ADDLW 0XE2
MOVWF Hund
ADDLW 0X32
MOVWF Ones
MOVF VoutHi,w
ANDLW 0X0F
ADDWF Hund,f
ADDWF Hund,f
ADDWF Ones,f
ADDLW 0XE9
MOVWF Tens
ADDWF Tens,f
ADDWF Tens,f
SWAPF VoutLo,w
ANDLW 0X0F
ADDWF Tens,f
ADDWF Ones,f
RLF Tens,f
RLF Ones,f
COMF Ones,f
RLF Ones,f
MOVF VoutLo,w
ANDLW 0X0F
ADDWF Ones,f
RLF Thou,f
MOVLW 0X07
MOVWF TenK
MOVLW 0X0A ; Ten
Lb1: ; At this point, the original number is
ADDWF Ones,f ; equal to
DECF Tens,f ; TenK*10000+Thou*1000+Hund*100+Tens*10+Ones
BTFSS 3,0 ; if those entities are regarded as two's
GOTO Lb1 ; complement binary. To be precise, all of
Lb2: ; them are negative except TenK. Now the number
ADDWF Tens,f ; needs to be normalized, but this can all be
DECF Hund,f ; done with simple byte arithmetic.
BTFSS 3,0
GOTO Lb2
Lb3:
ADDWF Hund,f
DECF Thou,f
BTFSS 3,0
GOTO Lb3
Lb4:
ADDWF Thou,f
DECF TenK,f
BTFSS 3,0
GOTO Lb4
RETURN
sorry, can you please help me to explain ? a rough one