Commit 923de571 authored by Jan Wagemakers's avatar Jan Wagemakers

Transmit and display on LCD

parent ee90dfb6
......@@ -428,26 +428,22 @@ sendCommon:
call convTemp
movf ASCII_TEMP10, w
movwf TXREG
call SendCHAR
call tx
WAITms D'250'
movf ASCII_TEMP1, w
movwf TXREG
call SendCHAR
call tx
WAITms D'250'
movlw "."
movwf TXREG
call SendCHAR
call tx
WAITms D'250'
movf ASCII_FRACTION, w
movwf TXREG
call SendCHAR
call tx
bra sendRETURN
question2:
......@@ -478,8 +474,7 @@ question3:
movlw "0"
btfsc RELAY
movlw "1"
movwf TXREG
call SendCHAR
call tx
bra sendRETURN
question4:
......@@ -551,6 +546,17 @@ equal2:
; -----------------------------------------------------------------
; Command OT=
; -----------------------------------------------------------------
clrf btIN ; use btIN as flag
OTLOOP:
lfsr 0, btIN3
OT:
movlw D'13'
cpfseq INDF0 ; ENTER?
bra OTNEXT
btfsc btIN, 1 ; First or second time we enter the loop?
bra OTEND ; second --> end loop
incf btIN ; btIN = 1
movlw H'94' ; goto line 3 of LCD
call SendINS
PRINT spc20 ; clear line 3
......@@ -559,17 +565,14 @@ equal2:
call SendINS
movlw D'5' ; flag symbol
call SendCHAR
lfsr 0, btIN3
OT:
movlw D'13'
cpfseq INDF0 ; ENTER?
bra OTNEXT
bra OTLOOP
OTEND:
call printCelsius
bra sendRETURN
OTNEXT:
WAITms D'250'
movf POSTINC0, w
btfss btIN, 1 ; only send back to BT the first time
movwf TXREG ; Send OT back to BlueTooth
call SendCHAR ; Send OT to display
bra OT
......@@ -582,15 +585,9 @@ equal3:
; -----------------------------------------------------------------
; Command YY=
; -----------------------------------------------------------------
movf btIN3, w
movwf YY
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf YY1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
lfsr 0, YY
call updateDateTime
bra sendRETURN
equal4:
movlw "M"
cpfseq btIN
......@@ -600,15 +597,9 @@ equal4:
; -----------------------------------------------------------------
; Command MM=
; -----------------------------------------------------------------
movf btIN3, w
movwf MM
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf MM1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
lfsr 0, MM
call updateDateTime
bra sendRETURN
equal5:
movlw "D"
cpfseq btIN
......@@ -618,15 +609,9 @@ equal5:
; -----------------------------------------------------------------
; Command DD=
; -----------------------------------------------------------------
movf btIN3, w
movwf DD
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf DD1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
lfsr 0, DD
call updateDateTime
bra sendRETURN
equal6:
movlw "h"
cpfseq btIN
......@@ -636,15 +621,9 @@ equal6:
; -----------------------------------------------------------------
; Command hh=
; -----------------------------------------------------------------
movf btIN3, w
movwf hh
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf hh1
movwf TXREG
WAITms D'250'
bra DateTimePrinter
lfsr 0, hh
call updateDateTime
bra sendRETURN
equal7:
movlw "m"
cpfseq btIN
......@@ -654,15 +633,12 @@ equal7:
; -----------------------------------------------------------------
; Command mm=
; -----------------------------------------------------------------
movf btIN3, w
movwf mm
movwf TXREG
WAITms D'250'
movf btIN4, w
movwf mm1
movwf TXREG
WAITms D'250'
DateTimePrinter:
lfsr 0, mm
call updateDateTime
; -----------------------------------------------------------------
; refresh date-time display (only after mm= command)
; -----------------------------------------------------------------
movlw H'80' ; goto line 1
call SendINS
movlw " "
......@@ -723,8 +699,7 @@ equal8:
sendError:
movlw "?"
movwf TXREG
call SendCHAR
call tx
sendRETURN:
WAITms D'250'
movlw D'13'
......@@ -732,6 +707,22 @@ sendRETURN:
WAITms D'250'
goto again
tx: ; send X to serial port and display
movwf TXREG
call SendCHAR
return
updateDateTime:
movf btIN3, w
movwf POSTINC0
call tx
WAITms D'250'
movf btIN4, w
movwf INDF0
call tx
WAITms D'250'
return
clearUART:
; 9. If any error occurred, clear the error by clearing
; enable bit CREN.
......
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