Commit 825ba94a authored by Jan Wagemakers's avatar Jan Wagemakers

YYMMDDhhmm

parent e8ac7b2b
......@@ -90,6 +90,7 @@ WAITms MACRO TIME
; Variables
; ---------------------------------------------------------------------------
cblock 0x00
heart
delay
Temp
dummy
......@@ -99,7 +100,7 @@ WAITms MACRO TIME
tens_and_ones
; temp.display
MEM
fraction
; fraction
; DS18B20
TMP0
PDBYTE
......@@ -127,6 +128,25 @@ WAITms MACRO TIME
;
btCounter
;
metar1 ; E ; location weather information
metar2 ; B
metar3 ; A
metar4 ; W
;
YY
YY1
;
MM
MM1
;
DD
DD1
;
hh
hh1
;
mm
mm1
btIN ; 0 : S S P O O
btIN1 ; 1 : P P V P T
btIN2 ; 2 : = ? ? ? =
......@@ -508,25 +528,189 @@ equal2:
; -----------------------------------------------------------------
; Command OT=
; -----------------------------------------------------------------
movlw H'94' ; goto line 3 of LCD
call SendINS
PRINT spc20 ; clear line 3
movlw "E" ; metar weather hardcoded ATM
movwf metar1
movlw "B"
movwf metar2 ; Europe Belgium AntWerp
movlw "A"
movwf metar3
movlw "W"
movwf metar4
movlw H'94' ; goto line 3 of LCD
call SendINS
movf metar1, W
call SendCHAR
movf metar2, W
call SendCHAR
movf metar3, W
call SendCHAR
movf metar4, W
call SendCHAR
clrw
call SendCHAR ; thermometer symbol
lfsr 0, btIN3
L3:
OT:
movlw D'13'
cpfseq INDF0 ; ENTER?
bra L3NEXT
bra OTNEXT
call printCelsius
goto again
L3NEXT:
bra sendRETURN
OTNEXT:
WAITms D'250'
movf POSTINC0, w
movwf TXREG ; Send OT back to BlueTooth
call SendCHAR ; Send OT to display
bra L3
bra OT
equal3:
movlw "Y"
cpfseq btIN
bra equal4
cpfseq btIN1
bra equal4
; -----------------------------------------------------------------
; Command YY=
; -----------------------------------------------------------------
movf btIN3, w
movwf YY
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf YY1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
equal4:
movlw "M"
cpfseq btIN
bra equal5
cpfseq btIN1
bra equal5
; -----------------------------------------------------------------
; Command MM=
; -----------------------------------------------------------------
movf btIN3, w
movwf MM
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf MM1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
equal5:
movlw "D"
cpfseq btIN
bra equal6
cpfseq btIN1
bra equal6
; -----------------------------------------------------------------
; Command DD=
; -----------------------------------------------------------------
movf btIN3, w
movwf DD
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf DD1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
equal6:
movlw "h"
cpfseq btIN
bra equal7
cpfseq btIN1
bra equal7
; -----------------------------------------------------------------
; Command hh=
; -----------------------------------------------------------------
movf btIN3, w
movwf hh
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf hh1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
equal7:
movlw "m"
cpfseq btIN
bra equal8
cpfseq btIN1
bra equal8
; -----------------------------------------------------------------
; Command mm=
; -----------------------------------------------------------------
movf btIN3, w
movwf mm
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf mm1
movwf TXREG
WAITms D'250'
DateTimePrinter:
movlw H'80' ; goto line 1
call SendINS
movlw " "
call SendCHAR
movlw " "
call SendCHAR
movlw "2"
call SendCHAR
movlw "0"
call SendCHAR
movf YY, w
call SendCHAR
movf YY1, w
call SendCHAR
movlw "/"
call SendCHAR
movf MM, w
call SendCHAR
movf MM1, w
call SendCHAR
movlw "/"
call SendCHAR
movf DD, w
call SendCHAR
movf DD1, w
call SendCHAR
movlw " "
call SendCHAR
movf hh, w
call SendCHAR
movf hh1, w
call SendCHAR
movlw ":"
call SendCHAR
movf mm, w
call SendCHAR
movf mm1, w
call SendCHAR
movlw " "
call SendCHAR
movlw " "
call SendCHAR
bra sendRETURN
equal8:
; -----------------------------------------------------------------
; add check's for other commands below
; -----------------------------------------------------------------
......@@ -572,27 +756,24 @@ skipMAN:
ADend:
decfsz thermowait, F
return
movlw D'211'
call SendINS ; goto last char of line 2
movf thermowait2, w
decfsz thermowait2, F
return
movlw D'211'
call SendINS ; goto last char of line 2
incf heart
movf heart, w
andlw D'1'
bnz nz
movlw D'3'
bra cmn
movlw D'3'
bra cmn
nz
movlw D'4'
cmn
call SendCHAR
decfsz thermowait2, F
return
; decfsz thermowait3, F
; return
movlw D'4'
cmn
call SendCHAR ; show heart beat
CLRWDT ; clear the watchdog timer
; movlw D'5'
; movwf thermowait3
movlw H'C0' ; goto line 2
call SendINS
......@@ -742,34 +923,13 @@ printCelsius
; ASCII_TEMP10, ASCII_TEMP1, ASCII_FRACTION
; ---------------------------------------------------------------------------
convTemp
;movff H_TEMP, IOBYTE
movf L_TEMP, W
mullw D'16' ; PRODH = L_TEMP/16 | PRODL = fraction * 16
swapf H_TEMP, w ; W = H_TEMP * 16 (ignore negative and big values)
iorwf PRODH, w ; W = H_TEMP:L_TEMP/16
;movff L_TEMP, MEM
;clrf fraction ; fraction = 0
;bcf STATUS, C ; clear carry flag
;rrcf MEM, f
;rrcf fraction, f
;rrcf MEM, f
;rrcf fraction, f ; MEM = MEM/16 , fraction
;rrcf MEM, f
;rrcf fraction, f
;rrcf MEM, f
;rrcf fraction, f
;swapf fraction, f ;
;swapf IOBYTE, w ; W = IOBYTE * 16
;iorwf MEM, w ; W = HTEMP+LTEMP
call ConvDec ; Convert XX
;movf fraction, w ; w = fraction
swapf PRODL, w ; w = fraction (PRODL/16)
mullw D'10' ; PRODL = fraction * 10
movlw D'8' ; W = 8 | 8/16 = .5
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment