cheetha
Full Member level 2
- Joined
- Sep 17, 2011
- Messages
- 146
- Helped
- 1
- Reputation
- 2
- Reaction score
- 2
- Trophy points
- 1,298
- Activity points
- 2,310
in order to check the modifications in LM35 circuit i grounded the RA4 pin of
PIC and then analyzed the effects
PROCESSING TEMP
KK:
MOVWF 58H
BSF ADCON0,GO
BACKADC:BTFSC ADCON0,DONE
BRA BACKADC
MOVF ADRESL,W
CALL HEX2BCD
CALL BCD2ASCII
MOVLW 82H
CALL COMDWRT
CALL DELAY
CALL VALUEWRT
Not a picture, but just the drawing of the schematic. If possible.albbg, are you asking about the picture of real circuit which is on project board ?
as it will be a little difficult of taking an intelligible picture due wiring ....
thanks
.... your code
; add these variable in your code
bdixmil
bmille
bcent
bdix
bun
btmp
val1:2
val2:2
valx:2
Drapeaux ; multipurpose flags
;Drapeau:7= signe mesure temp 1=negatif 0=positif pour DS1624
;Drapeau:6= Elligibilite de stockage mesure
;Drapeau:5 =test si saisie binaire ou BCD
;Drapeau:4= choix format 1=999 0=65535 pour bcd53 (5 ou 3 digits)
;Drapeau:3= choix format 1=XX 0=XXX pour bcd3
;Drapeau:2= choix output 1=Rs232 0=LCD
;Drapeau:1= choix format 1=XXXX.X 0=XXXXX pour bcd5
;Drapeau:0= pour effacer zero inutile
;PROCESSING TEMP to modifiy
KK:
BSF ADCON0,GO
BACKADC:
BTFSC ADCON0,DONE
BRA BACKADC
MOVF ADRESL,W
movwf val1
MOV ADRESH,W
movwf val1+1
bsf Drapeau,4 ; mode 5 digits to see 00000 up to 01023
call bcd53
CALL DELAY
; routine to display word 16 bits value on LCD
; affichage word --> decimal 3 ou 5 digits
; si Drapeau,4=1 -> 000 a 999 sinon -> 0000 … 65535
; en entree val1 et val1+1 contiennent le mot de 16 bits à afficher
; valx sert à sauvegarder cette valeur,qui est modifié dans le sous programme
; puis restituee en sortie de programme
; les variables intermediares bmille, bcent,bdix,bun servent à decortiquer la valeur en elements decimaux
; au passage on met le resultat en ascii
bcd53
movf val1,w ;LSB value
movwf valx
movf val1+1,w ;MSB value
movwf valx+1
swapf val1,w
iorlw 0xf0
movwf bmille
addwf bmille,f
addlw 0xE2
movwf bcent
addlw 0x32
movwf bun
movf val1,w
andlw 0x0F
addwf bcent,f
addwf bcent,f
addwf bun,f
addlw 0xE9
movwf bdix
addwf bdix,f
addwf bdix,f
swapf val1+1,w
andlw 0x0F
addwf bdix,f
addwf bun,f
rlf bdix,f
rlf bun,f
comf bun,f
rlf bun,f
movf val1+1,w
andlw 0x0F
addwf bun,f
rlf bmille,f
movlw 0x07
movwf bdixmil
movlw 0x0A
Lb1:
addwf bun,f
decf bdix,f
btfss STATUS,C
goto Lb1
Lb2:
addwf bdix,f
decf bcent,f
btfss STATUS,C
goto Lb2
Lb3:
addwf bcent,f
decf bmille,f
btfss STATUS,C
goto Lb3
Lb4:
addwf bmille,f
decf bdixmil,f
btfss STATUS,C
goto Lb4
btfsc Drapeau,4 ; mode 999 or 65535
goto Lb5
movf bdixmil,w
addlw '0'
call LCD_Putchar ; envoi diz de milliers sur LCD
movf bmille,w
addlw '0'
call LCD_Putchar ; envoi milliers sur LCD
Lb5:
bcf Drapeau,4
movf bcent,w
addlw '0'
call LCD_Putchar ;envoi centaines sur LCD
movf bdix,w
addlw '0'
call LCD_Putchar ;envoi dizaines sur LCD
movf bun,w
addlw '0'
call LCD_Putchar ;envoi unites sur LCD
; use below if you want to keep original values val1 & val1+1
; movf valx,w
; movwf val1
; movf valx+1,w
; movwf val1+1
return
LCD_Putchar:
; is your routine to display char on LCD
; after writing the car, the position on LCD must be increased
; your code .....
;
;
return
Not a picture, but just the drawing of the schematic. If possible.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?