Commit 7f0ff5f8 authored by Jan Wagemakers's avatar Jan Wagemakers

custom chars + minor optimazations

parent 2aaf6cd9
......@@ -124,7 +124,9 @@ WAITms MACRO TIME
;
thermowait
thermowait2
;
btCounter
;
btIN ; 0 : S S P O
btIN1 ; 1 : P P V P
btIN2 ; 2 : = ? ? ?
......@@ -146,8 +148,12 @@ start
CLRF PORTA ; Initialize PORTA by clearing output
CLRF PORTB ; Initialize PORTB by clearing output
; data latches
MOVLW 0x7F ; Set RB's & RA's as
MOVWF ADCON1 ; digital I/O pins
movlw B'00010001' ; VREF = VDD/VSS ; Channel 4 selected
movwf ADCON0
movlw B'01101111' ; RB0/AN4 = analog input
movwf ADCON1
movlw B'10111110'
movwf ADCON2 ; right justified / TADJ / FOSC
movlw B'00100000'
movwf TRISA ; 0 = OUTPUT ; 1 = INPUT
......@@ -172,7 +178,95 @@ start
call Wacht1s
call initlcd ; setup LCD display
movlw H'40' ; create custom chars
call SendINS
movlw D'4' ; 0 : thermometer symbol
call SendCHAR
movlw D'10'
call SendCHAR
movlw D'10'
call SendCHAR
movlw D'10'
call SendCHAR
movlw D'17'
call SendCHAR
movlw D'31'
call SendCHAR
movlw D'14'
call SendCHAR
movlw D'0'
call SendCHAR
movlw D'24' ; 1 : °C
call SendCHAR
movlw D'24'
call SendCHAR
movlw D'3'
call SendCHAR
movlw D'4'
call SendCHAR
movlw D'4'
call SendCHAR
movlw D'4'
call SendCHAR
movlw D'3'
call SendCHAR
movlw D'0'
call SendCHAR
movlw D'8' ; 2 : SP
call SendCHAR
movlw D'16'
call SendCHAR
movlw D'8'
call SendCHAR
movlw D'19'
call SendCHAR
movlw D'3'
call SendCHAR
movlw D'2'
call SendCHAR
movlw D'2'
call SendCHAR
movlw D'0'
call SendCHAR
movlw D'0' ; 3 : open hart
call SendCHAR
movlw D'0'
call SendCHAR
movlw D'10'
call SendCHAR
movlw D'21'
call SendCHAR
movlw D'17'
call SendCHAR
movlw D'10'
call SendCHAR
movlw D'4'
call SendCHAR
movlw D'0'
call SendCHAR
movlw D'0' ; 4 : full hart
call SendCHAR
movlw D'0'
call SendCHAR
movlw D'10'
call SendCHAR
movlw D'31'
call SendCHAR
movlw D'31'
call SendCHAR
movlw D'14'
call SendCHAR
movlw D'4'
call SendCHAR
movlw D'0'
call SendCHAR
movlw H'80' ; goto line 1
call SendINS
PRINT jan ; PRINT jan
......@@ -455,17 +549,21 @@ ADstart:
movff ADRESH, H_SOLL ; AD --> H_SOLL/L_SOLL
movff ADRESL, L_SOLL
skipMAN:
movlw B'00010001' ; VREF = VDD/VSS ; Channel 4 selected
movwf ADCON0
movlw B'01101111' ; RB0/AN4 = analog input
movwf ADCON1
movlw B'10111110'
movwf ADCON2 ; right justified / TADJ / FOSC
bsf ADCON0, 1 ; start ADC
ADend:
decfsz thermowait, F
return
movlw D'211'
call SendINS ; goto last char of line 2
movf thermowait2, w
andlw D'1'
bnz nz
movlw D'3'
bra cmn
nz
movlw D'4'
cmn
call SendCHAR
decfsz thermowait2, F
return
; decfsz thermowait3, F
......@@ -480,16 +578,16 @@ ADend:
call SendINS
; - print huidige temp -------------------------
movlw B'01111110'
call SendCHAR
clrw
call SendCHAR ; thermometer symbol
movff H_IST, H_TEMP
movff L_IST, L_TEMP
call printTemp
; ----------------------------------------------
; - print gewenste temp ------------------------
movlw B'01111111'
call SendCHAR
movlw D'2'
call SendCHAR ; SP symbol
movff H_SOLL, H_TEMP
movff L_SOLL, L_TEMP
call printTemp
......@@ -527,8 +625,7 @@ thON
bra filterON
movff FILTER, FILTER_COUNTER
bsf RELAY
PRINT spc
bra thdone
bra spc
thOFF
bsf STATUS, C
decf FILTER_COUNTER, f
......@@ -536,13 +633,17 @@ thOFF
bra filterOFF
clrf FILTER_COUNTER
bcf RELAY
PRINT spc
spc
movlw " "
call SendCHAR
bra thdone
filterON
PRINT plus
movlw "+"
call SendCHAR
bra thdone
filterOFF
PRINT min
movlw "-"
call SendCHAR
thdone
call printManAuto
;------------------------------------------------------------------------
......@@ -608,7 +709,10 @@ printTemp
call SendCHAR ; PRINT .
movf ASCII_FRACTION, w
call SendCHAR
PRINT celsius
movlw D'1' ; PRINT °C
call SendCHAR
movlw " " ; print " "
call SendCHAR
return
; ---------------------------------------------------------------------------
......@@ -636,23 +740,32 @@ convTemp
call ConvDec ; Convert XX
;==============================================================;
; Calculate .X ;
; ------------ ;
; See DS18B20.gnumeric ;
;==============================================================;
clrw ; XX.0
btfsc fraction, 3 ; If bit 3 = 1 then
ADDLW D'5' ; W = W + 5
btfsc fraction, 2 ; If bit 2 = 1 then
ADDLW D'3' ; W = W + 3
btfsc fraction, 1 ; If bit 1 = 1 then
ADDLW D'1' ; W = W + 1
btfss fraction, 0 ; If bit 0 = 1
bra ready ; and bit 2 <> 1 then
btfss fraction, 2 ; W = W + 1
ADDLW D'1'
ready:
movf fraction, w ; w = fraction
mullw D'10' ; PRODL = fraction * 10
movlw D'8' ; W = 8 | 8/16 = .5
addwf PRODL
movf PRODL, w ; W = fraction * 10 + 8
mullw D'16' ; PRODH = (fraction * 10 + 8)/16
movf PRODH, w ; w = (fraction * 10 + 8)/16
; ;==============================================================;
; ; Calculate .X ;
; ; ------------ ;
; ; See DS18B20.gnumeric ;
; ;==============================================================;
; clrw ; XX.0
; btfsc fraction, 3 ; If bit 3 = 1 then
; ADDLW D'5' ; W = W + 5
; btfsc fraction, 2 ; If bit 2 = 1 then
; ADDLW D'3' ; W = W + 3
; btfsc fraction, 1 ; If bit 1 = 1 then
; ADDLW D'1' ; W = W + 1
; btfss fraction, 0 ; If bit 0 = 1
; bra ready ; and bit 2 <> 1 then
; btfss fraction, 2 ; W = W + 1
; ADDLW D'1'
;ready:
;
addlw '0'
movwf ASCII_FRACTION
......@@ -899,12 +1012,8 @@ DSRXLP:
; Strings used in the program
; ---------------------------------------------------------------------------
jan db " - Jan Wagemakers - ",0
celsius db B'11011111',"C ",0
aan db "___",0
uit db "_/_",0
plus db "+",0
min db "-",0
spc db " ",0
spc20 db " ",0
auto db "AUTO ", 0
man db " MAN ", 0
......
:020000040000FA
:10000000600ED36E806A816A7F0EC16E200E926E82
:10001000130E936E100E62EC02F0010E0E6E4B0E7C
:100020000F6E5A0E156E010E166E176E186E55EC89
:1000300002F0CBEC01F0800E0EEC02F0000EF86E38
:10004000050EF76E6C0EF66E0900FCEC01F0190E51
:10005000AF6EB06AAA96AC94AC98AB8EAB88AC8A03
:10006000196A00EE1AF0D4EC00F09EAAFCD7AECFCD
:10007000EFFFD0EC00F0080E1960F2D7192A0D0E30
:10008000EE62F1D7D40E0EEC02F0000EF86E050E03
:10009000F76E940EF66E0900FCEC01F079EC01F0BD
:1000A00000EE1AF00D0EEF6201D004D0EE5004EC19
:1000B00002F0F8D7200E04EC02F03F0E1C623FD095
:1000C000500E1A6223D0560E1B6220D010C00CF0C6
:1000D00011C00DF0AAEC01F01250AD6E04EC02F06C
:1000E000FA0E62EC02F01350AD6E04EC02F0FA0E60
:1000F00062EC02F02E0EAD6E04EC02F0FA0E62EC31
:1001000002F01450AD6E04EC02F040D0530E1A62AF
:1001100008D0500E1B6205D00EC00CF00FC00DF0C1
:10012000D9D74F0E1A620AD0500E1B6207D0300E7C
:1001300080BE310EAD6E04EC02F028D023D03D0E0F
:100140001C6220D0530E1A621DD0500E1B621AD0B2
:100150002E0E1F6217D080BA14D0300E1D5C0A0D0F
:10016000300E1E5CF324100DF4CF0EF0F3CF0FF021
:10017000300E205C100DF350CD0DF450200DF450D6
:100180000F12CAD73F0EAD6E04EC02F0FA0E62EC0D
:1001900002F00D0EAD6EFA0E62EC02F030EF00F0E0
:1001A000ABB2AB98AB881200C2B210D0D890C432B8
:1001B000C33280AA04D0C4CF0EF0C3CF0FF0110E0B
:1001C000C26E6F0EC16EBE0EC06EC282172E1200BE
:1001D000182E12000400C00E0EEC02F07E0E04EC8D
:1001E00002F010C00CF011C00DF092EC01F07F0E87
:1001F00004EC02F00EC00CF00FC00DF092EC01F018
:1002000080BE0AD0000EF86E050EF76E8A0EF66EEE
:100210000900FCEC01F009D0000EF86E050EF76E37
:10022000860EF66E0900FCEC01F00E50106401D051
:1002300018D0106001D004D00F50116401D011D03B
:10024000162A155016641DD015C016F0808E000EAB
:10025000F86E050EF76E920EF66E0900FCEC01F0DA
:1002600023D0D8801606D8B016D0166A809E000E0D
:10027000F86E050EF76E920EF66E0900FCEC01F0BA
:1002800013D0000EF86E050EF76E8E0EF66E090096
:10029000FCEC01F009D0000EF86E050EF76E900E22
:1002A000F66E0900FCEC01F079EC01F071EC02F063
:1002B00009A0FCD7CC0E85EC02F0440E85EC02F0D0
:1002C0009F0E086E6BEC02F071EC02F009A0EED705
:1002D000CC0E85EC02F0BE0E85EC02F09BEC02F039
:1002E0000AC006F09BEC02F00AC010F006C011F044
:1002F0001200D40E0EEC02F080BA0AD0000EF86E96
:10030000050EF76EAA0EF66E0900FCEC01F009D09E
:10031000000EF86E050EF76EB00EF66E0900FCECDE
:1003200001F01200AAEC01F0125004EC02F013509C
:1003300004EC02F02E0E04EC02F0145004EC02F077
:10034000000EF86E050EF76E820EF66E0900FCECDC
:1003500001F012000CC00AF00DC006F0076AD89038
:1003600006320732063207320632073206320732C9
:10037000073A0A38061049EC02F0E86A07B6050F9A
:1003800007B4030F07B2010F07A002D007A4010FA3
:10039000300F146E1200280E62EC02F08098030EEB
:1003A00018EC02F0050E62EC02F0808C809C1F0EAF
:1003B000086E6BEC02F0808C809C1F0E086E6BEC5C
:1003C00002F08098020E18EC02F01F0E086E6BEC23
:1003D00002F0280E0EEC02F0100E0EEC02F0060EEB
:1003E0000EEC02F00C0E0EEC02F0010E0EEC02F020
:1003F000050E62EC02F01200F550D8B4120004ECC5
:1004000002F00900F9D7300F016E0138808818EC2E
:1004100002F00150808818EC02F01200016E0138E1
:10042000809818EC02F00150809818EC02F012004D
:10043000026E809680948092809002B6808602B48C
:10044000808402B2808202B08080808C809C1F0EEB
:10045000086E6BEC02F01200036A043804240F0BE0
:10046000D8B2160FD8B2060F060FD8A2FA0F04B8EA
:100470001B0FD8A2FA0F04BA300F04BC600F04BEE1
:10048000200F600F033603A0A00F056E04BE032AE1
:100490001200046E2CEC02F005380F0B300F126EB8
:1004A00005500F0B300F136E1200FA0E62EC02F0C3
:1004B000FA0E62EC02F0FA0E62EC02F0FA0E62EC56
:1004C00002F01200006EC70E086E6BEC02F0002EF8
:1004D00063EF02F0120000000000082E6BEF02F044
:1004E000000C938A096A819A939A630E086E6BECEA
:1004F00002F0938A0D0E086E6BEC02F081AA092AB5
:10050000550E086E6BEC02F0000C0A6E080E0B6EB6
:10051000819A939A0000000000000A32D8B0938AB2
:100520000B0E086E6BEC02F0938A000000000B2E9D
:1005300088EF02F0000C080E0B6E819A939A00006F
:1005400000000000000000000000938A000000008E
:10055000000000008150200BFF0F0A32090E086EC8
:100560006BEC02F00B2E9DEF02F0000C202D204AC8
:10057000616E20576167656D616B657273202D2018
:100580000000DF4320005F5F5F005F2F5F002B00F4
:100590002D0020002020202020202020202020208E
:1005A000202020202020202000004155544F2000F2
:0605B000204D414E200029
:10000000600ED36E806A816A110EC26E6F0EC16E71
:10001000BE0EC06E200E926E130E936E100EC4ECC8
:1000200002F0010E0E6E4B0E0F6E5A0E156E010E83
:10003000166E176E186EB7EC02F02DEC02F0400E43
:1000400070EC02F0040E66EC02F00A0E66EC02F0B0
:100050000A0E66EC02F00A0E66EC02F0110E66EC77
:1000600002F01F0E66EC02F00E0E66EC02F0000EBF
:1000700066EC02F0180E66EC02F0180E66EC02F068
:10008000030E66EC02F0040E66EC02F0040E66EC61
:1000900002F0040E66EC02F0030E66EC02F0000EB5
:1000A00066EC02F0080E66EC02F0100E66EC02F050
:1000B000080E66EC02F0130E66EC02F0030E66EC1E
:1000C00002F0020E66EC02F0020E66EC02F0000E88
:1000D00066EC02F0000E66EC02F0000E66EC02F038
:1000E0000A0E66EC02F0150E66EC02F0110E66ECDC
:1000F00002F00A0E66EC02F0040E66EC02F0000E4E
:1001000066EC02F0000E66EC02F0000E66EC02F007
:100110000A0E66EC02F01F0E66EC02F01F0E66EC93
:1001200002F00E0E66EC02F0040E66EC02F0000E19
:1001300066EC02F0800E70EC02F0000EF86E060E17
:10014000F76E300EF66E09005EEC02F0190EAF6E1F
:10015000B06AAA96AC94AC98AB8EAB88AC8A196A9C
:1001600000EE1AF053EC01F09EAAFCD7AECFEFFFE1
:100170004FEC01F0080E1960F2D7192A0D0EEE624D
:10018000F1D7D40E70EC02F0000EF86E060EF76E8A
:100190004E0EF66E09005EEC02F0E2EC01F000EEAD
:1001A0001AF00D0EEF6201D004D0EE5066EC02F0B2
:1001B000F8D7200E66EC02F03F0E1C623FD0500EC6
:1001C0001A6223D0560E1B6220D010C00CF011C052
:1001D0000DF010EC02F01250AD6E66EC02F0FA0E6B
:1001E000C4EC02F01350AD6E66EC02F0FA0EC4ECF3
:1001F00002F02E0EAD6E66EC02F0FA0EC4EC02F0C8
:100200001450AD6E66EC02F040D0530E1A6208D066
:10021000500E1B6205D00EC00CF00FC00DF0D9D7E8
:100220004F0E1A620AD0500E1B6207D0300E80BEED
:10023000310EAD6E66EC02F028D023D03D0E1C626C
:1002400020D0530E1A621DD0500E1B621AD02E0EF3
:100250001F6217D080BA14D0300E1D5C0A0D300E0C
:100260001E5CF324100DF4CF0EF0F3CF0FF0300E20
:10027000205C100DF350CD0DF450200DF4500F12F2
:10028000CAD73F0EAD6E66EC02F0FA0EC4EC02F077
:100290000D0EAD6EFA0EC4EC02F0AFEF00F0ABB293
:1002A000AB98AB881200C2B20AD0D890C432C33225
:1002B00080AA04D0C4CF0EF0C3CF0FF0C282172E95
:1002C0001200D30E70EC02F01850010B02E1030E85
:1002D00001D0040E66EC02F0182E12000400C00ECD
:1002E00070EC02F0E86A66EC02F010C00CF011C08D
:1002F0000DF0FBEC01F0020E66EC02F00EC00CF00B
:100300000FC00DF0FBEC01F080BE0AD0000EF86EBD
:10031000060EF76E4A0EF66E09005EEC02F009D08A
:10032000000EF86E060EF76E460EF66E09005EECD5
:1003300002F00E50106401D00FD0106001D004D034
:100340000F50116401D008D0162A155016640ED033
:1003500015C016F0808E06D0D8801606D8B00AD008
:10036000166A809E200E66EC02F007D02B0E66EC1B
:1003700002F003D02D0E66EC02F0E2EC01F0D3ECBB
:1003800002F009A0FCD7CC0EE7EC02F0440EE7EC3B
:1003900002F09F0E086ECDEC02F0D3EC02F009A043
:1003A000EED7CC0EE7EC02F0BE0EE7EC02F0FDEC6F
:1003B00002F00AC006F0FDEC02F00AC010F006C020
:1003C00011F01200D40E70EC02F080BA0AD0000EC8
:1003D000F86E060EF76E640EF66E09005EEC02F023
:1003E00009D0000EF86E060EF76E6A0EF66E090062
:1003F0005EEC02F0120010EC02F0125066EC02F01B
:10040000135066EC02F02E0E66EC02F0145066EC0F
:1004100002F0010E66EC02F0200E66EC02F0120013
:100420000CC00AF00DC006F0076AD89006320732F9
:10043000063207320632073206320732073A0A38E6
:100440000610ABEC02F007500A0D080EF326F3502D
:10045000100DF450300F146E1200280EC4EC02F090
:100460008098030E7AEC02F0050EC4EC02F0808C4A
:10047000809C1F0E086ECDEC02F0808C809C1F0EBD
:10048000086ECDEC02F08098020E7AEC02F01F0E9E
:10049000086ECDEC02F0280E70EC02F0100E70EC3D
:1004A00002F0060E70EC02F00C0E70EC02F0010E81
:1004B00070EC02F0050EC4EC02F01200F550D8B456
:1004C000120066EC02F00900F9D7300F016E013816
:1004D00080887AEC02F0015080887AEC02F01200F9
:1004E000016E013880987AEC02F0015080987AEC25
:1004F00002F01200026E809680948092809002B684
:10050000808602B4808402B2808202B08080808CB7
:10051000809C1F0E086ECDEC02F01200036A0438B6
:1005200004240F0BD8B2160FD8B2060F060FD8A2AC
:10053000FA0F04B81B0FD8A2FA0F04BA300F04BC8C
:10054000600F04BE200F600F033603A0A00F056EDE
:1005500004BE032A1200046E8EEC02F005380F0B65
:10056000300F126E05500F0B300F136E1200FA0E83
:10057000C4EC02F0FA0EC4EC02F0FA0EC4EC02F085
:10058000FA0EC4EC02F01200006EC70E086ECDEC3D
:1005900002F0002EC5EF02F0120000000000082E4D
:1005A000CDEF02F0000C938A096A819A939A630E48
:1005B000086ECDEC02F0938A0D0E086ECDEC02F0C1
:1005C00081AA092A550E086ECDEC02F0000C0A6EC5
:1005D000080E0B6E819A939A0000000000000A3208
:1005E000D8B0938A0B0E086ECDEC02F0938A00000F
:1005F00000000B2EEAEF02F0000C080E0B6E819A41
:10060000939A000000000000000000000000938AA0
:1006100000000000000000008150200BFF0F0A3294
:10062000090E086ECDEC02F00B2EFFEF02F0000C6D
:10063000202D204A616E20576167656D616B657280
:1006400073202D2000005F5F5F005F2F5F00202080
:10065000202020202020202020202020202020209A
:10066000202000004155544F2000204D414E2000D5
:020000040030CA
:0E000000FFC80D1FFF0081FF03C003E0034097
:00000001FF
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