I have this code (DS1620 with PIC 16F628), and was trying to understand how works, but i dont know whats means the variables.
Anyone can explain me this code??
Code:
include "Modedefs.bas
DEFINE OSC = 4
VRCON = 0
TRISA= %00000000
TRISB = % 00000000
CFGW CON $0C
CPUCN CON $02
START CON $EE
GETT CON $AA
STH CON $01
STL CON $02
DST var PortB.0
CLK Var PortB.1
RST var PortB.2
SER var PortB.3
Temp var byte
GCel var byte
gosub Init
GoSUB SetHL
gosub LetGo
e_go:
gosub Lee_T
GCel = Temp /2
serout ser,N2400,[GCel]
pause 250
goto e_go
end
Init:
High RST
shiftout DST,CLK,LSBFIRST,[CFGW,CPUCN]
low RST
pause 10
return
LetGo
high RST
shiftout DST,CLK,LSBFIRST,[START]
low RST
pause 10
return
Lee_T:
high RST
shiftout DST,CLK,LSBFIRST,[GetT]
shiftin DST,CLK,LSBPRE,[Temp]
low RST
return
SetHL:
high RST
shiftout DST,CLK,LSBFIRST,[SHL,48\9]
low RST
pause 10
high RST
shiftout DST,CLK,LSBFIRST,[STL,34\9]
low RST
pause 10
return
Thanks!!
Bookmarks