annotate src/comm.asm @ 622:02d1386429a6

0x60 added for (future) option to change logbook offset via PC/Bluetooth
author heinrichsweikamp
date Wed, 10 Apr 2019 10:51:07 +0200
parents ca4556fb60b9
children c40025d8e750
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
heinrichsweikamp
parents:
diff changeset
1 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
2 ;
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
3 ; File comm.asm REFACTORED VERSION V2.99d
0
heinrichsweikamp
parents:
diff changeset
4 ;
heinrichsweikamp
parents:
diff changeset
5 ; RS232 via USB
heinrichsweikamp
parents:
diff changeset
6 ;
heinrichsweikamp
parents:
diff changeset
7 ; Copyright (c) 2012, JD Gascuel, HeinrichsWeikamp, all right reserved.
heinrichsweikamp
parents:
diff changeset
8 ;=============================================================================
heinrichsweikamp
parents:
diff changeset
9 ; HISTORY
heinrichsweikamp
parents:
diff changeset
10 ; 2011-08-22 : [mH] Creation
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
11 ; 2012-02-11 : [jDG] Added "c" set custom text, and "i" identify
0
heinrichsweikamp
parents:
diff changeset
12
275
653a3ab08062 rename into hwOS
heinrichsweikamp
parents: 273
diff changeset
13 #include "hwos.inc"
0
heinrichsweikamp
parents:
diff changeset
14 #include "eeprom_rs232.inc"
heinrichsweikamp
parents:
diff changeset
15 #include "tft.inc"
heinrichsweikamp
parents:
diff changeset
16 #include "wait.inc"
heinrichsweikamp
parents:
diff changeset
17 #include "strings.inc"
heinrichsweikamp
parents:
diff changeset
18 #include "convert.inc"
heinrichsweikamp
parents:
diff changeset
19 #include "external_flash.inc"
heinrichsweikamp
parents:
diff changeset
20 #include "tft_outputs.inc"
heinrichsweikamp
parents:
diff changeset
21 #include "surfmode.inc"
heinrichsweikamp
parents:
diff changeset
22 #include "rtc.inc"
heinrichsweikamp
parents:
diff changeset
23 #include "adc_lightsensor.inc"
299
6c4800af27ac Make char_I_bottom_usage and char_I_deco_usage configurable from PC
heinrichsweikamp
parents: 275
diff changeset
24 #include "shared_definitions.h"
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
25 #include "math.inc"
0
heinrichsweikamp
parents:
diff changeset
26
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
27 extern restart
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
28 extern option_reset_all
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
29 extern option_check_all
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
30 extern gaslist_cleanup_list
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
31 extern get_first_gas_to_WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
32 extern get_first_dil_to_WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
33 extern option_save_all
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
34 extern vault_decodata_into_eeprom
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
35 extern menu_processor_bottom_line_comm
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
36
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
37 IFDEF _rx_functions
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
38 extern I2C_update_OSTC_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
39 ENDIF
0
heinrichsweikamp
parents:
diff changeset
40
heinrichsweikamp
parents:
diff changeset
41
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
42 #DEFINE timeout_comm_pre_mode .240 ; pre-loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
43 #DEFINE timeout_comm_mode .120 ; download mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
44 #DEFINE timeout_service_mode .120 ; service mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
45
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
46 #DEFINE comm_title_row .0
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
47 #DEFINE comm_title_column_usb .50
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
48 #DEFINE comm_title_column_ble .25
0
heinrichsweikamp
parents:
diff changeset
49
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
50 #DEFINE comm_string_row .30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
51 #DEFINE comm_string_column .40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
52
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
53 #DEFINE comm_status1_row .70
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
54 #DEFINE comm_status1_column .10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
55 #DEFINE comm_status2_row .100
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
56 #DEFINE comm_status2_column comm_status1_column
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
57 #DEFINE comm_status3_row .130
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
58 #DEFINE comm_status3_column comm_status1_column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
59 #DEFINE comm_status4_row .160
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
60 #DEFINE comm_status4_column comm_status1_column
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
61
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
62
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
63 #DEFINE comm_warning_row .160
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
64 #DEFINE comm_warning_column .65
0
heinrichsweikamp
parents:
diff changeset
65
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
66 comm CODE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
67
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
68 ;=============================================================================
0
heinrichsweikamp
parents:
diff changeset
69
heinrichsweikamp
parents:
diff changeset
70 ; test for comm
218
8fbd8c5ac51f 1.71beta start
heinrichsweikamp
parents: 200
diff changeset
71 global comm_mode, comm_mode0
0
heinrichsweikamp
parents:
diff changeset
72 comm_mode:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
73 WAITMS d'1'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
74 btfss vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
75 return ; NO - it was only a glitch
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
76 WAITMS d'1'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
77 btfss vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
78 return ; NO - it was only a glitch
218
8fbd8c5ac51f 1.71beta start
heinrichsweikamp
parents: 200
diff changeset
79 comm_mode0:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
80 call TFT_ClearScreen
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
81 WIN_COLOR color_greenish
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
82 btfsc ble_available ; BLE available
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
83 bra comm_mode0_ble
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
84 WIN_SMALL comm_title_column_usb, comm_title_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
85 STRCPY_TEXT_PRINT tUsbTitle ; USB mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
86 bra comm_mode0_common
269
1207cf9a9408 adjust menu for different hardware versions
heinrichsweikamp
parents: 255
diff changeset
87 comm_mode0_ble:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
88 WIN_SMALL comm_title_column_ble, comm_title_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
89 STRCPY_TEXT_PRINT tBleTitle ; BLE mode
269
1207cf9a9408 adjust menu for different hardware versions
heinrichsweikamp
parents: 255
diff changeset
90 comm_mode0_common:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
91 call TFT_standard_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
92 WIN_TOP .10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
93 WIN_LEFT .1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
94 TFT_WRITE_PROM_IMAGE_BY_ADDR usb_ble_logo_block
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
95 WIN_SMALL comm_status1_column,comm_status1_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
96 STRCPY_TEXT_PRINT tUsbStarting ; starting...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
97 call menu_processor_bottom_line_comm ; serial and fw version
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
98 call option_save_all ; save all settings into EEPROM (comm mode may be entered after settings have been changed without leaving the menu in between)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
99
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
100 IFDEF _screendump
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
101 bcf enable_screen_dumps ; =1: ignore vin_usb, wait for "l" command (screen dump)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
102 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
103
0
heinrichsweikamp
parents:
diff changeset
104 bcf switch_right
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
105 bcf comm_service_enabled
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
106 bsf menubit
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
107 bcf battery_removed_in_usb ; =1: the battery has been removed in USB (properly not used for anything useful)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
108 movlw timeout_comm_pre_mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
109 movwf comm_timeout
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
110 WIN_SMALL comm_status1_column+.80,comm_status1_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
111 STRCPY_TEXT_PRINT tUsbStartDone ; done...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
112 call enable_rs232 ; also sets to speed_normal ...
0
heinrichsweikamp
parents:
diff changeset
113 comm_mode1:
heinrichsweikamp
parents:
diff changeset
114 bcf onesecupdate
heinrichsweikamp
parents:
diff changeset
115 bcf LEDr
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
116 dcfsnz comm_timeout,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
117 bra comm_service_exit ; timeout -> exit
0
heinrichsweikamp
parents:
diff changeset
118 comm_mode2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
119 rcall comm_get_byte
0
heinrichsweikamp
parents:
diff changeset
120
heinrichsweikamp
parents:
diff changeset
121 movlw 0xAA ; start byte=0xAA?
heinrichsweikamp
parents:
diff changeset
122 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
123 bra comm_mode2a
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
124 bra comm_mode2b ; start byte for service mode found
0
heinrichsweikamp
parents:
diff changeset
125 comm_mode2a:
heinrichsweikamp
parents:
diff changeset
126 movlw 0xBB ; start byte=0xBB?
heinrichsweikamp
parents:
diff changeset
127 cpfseq RCREG1
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
128 bra comm_mode2c
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
129 bra comm_download_mode ; start byte for download mode found
0
heinrichsweikamp
parents:
diff changeset
130
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
131 comm_mode2c:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
132 btfss vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
133 bra comm_service_exit_nousb_delay ; disconnected -> exit
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
134 comm_mode4a:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
135 btfsc switch_right ; abort with right
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
136 bra comm_service_exit
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
137
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
138 btfsc onesecupdate
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
139 bra comm_mode1
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
140
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
141 bra comm_mode2 ; cycle
393
9e5abca93c32 tweak response timing in comm mode
heinrichsweikamp
parents: 391
diff changeset
142
0
heinrichsweikamp
parents:
diff changeset
143 comm_mode2b:
heinrichsweikamp
parents:
diff changeset
144 ; Startbyte found
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
145 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
146 movlw 0x4B
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
147 movwf TXREG1 ; send answer
0
heinrichsweikamp
parents:
diff changeset
148 ; Now, check comm command
heinrichsweikamp
parents:
diff changeset
149
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
150 rcall comm_get_byte ; first byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
151 rcall comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
152 movff RCREG1,TXREG1 ; Echo
0
heinrichsweikamp
parents:
diff changeset
153 movlw UPPER comm_service_key
heinrichsweikamp
parents:
diff changeset
154 cpfseq RCREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
155 bra comm_mode1 ; wrong -> restart
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
156 rcall comm_get_byte ; second byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
157 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
158 movff RCREG1,TXREG1 ; echo
0
heinrichsweikamp
parents:
diff changeset
159 movlw HIGH (comm_service_key & 0xFFFF)
heinrichsweikamp
parents:
diff changeset
160 cpfseq RCREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
161 bra comm_mode1 ; wrong -> restart
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
162 rcall comm_get_byte ; third byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
163 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
164 movff RCREG1,TXREG1 ; echo
0
heinrichsweikamp
parents:
diff changeset
165 movlw LOW comm_service_key
heinrichsweikamp
parents:
diff changeset
166 cpfseq RCREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
167 bra comm_mode1 ; wrong -> restart
0
heinrichsweikamp
parents:
diff changeset
168
heinrichsweikamp
parents:
diff changeset
169 ; Enable comm service mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
170 WIN_SMALL comm_status2_column, comm_status2_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
171 STRCPY_TEXT_PRINT tUsbServiceMode ; service mode enabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
172 bsf comm_service_enabled ; set flag...
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
173 bra comm_download_mode0 ; ... but use common routine
69
50697bd41c54 +CHANGE: Some French Translations
heinrichsweikamp
parents: 66
diff changeset
174
50697bd41c54 +CHANGE: Some French Translations
heinrichsweikamp
parents: 66
diff changeset
175 comm_service_exit_nousb_delay:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
176 WAITMS d'200'
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
177 btfsc vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
178 bra comm_mode4a ; YES - (still) connected, return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
179 comm_service_exit_nousb: ; NO - disconnected -> exit
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
180 WIN_SMALL comm_status3_column, comm_status3_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
181 STRCPY_TEXT_PRINT tUsbClosed ; port closed
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
182 bra comm_service_exit_common
0
heinrichsweikamp
parents:
diff changeset
183
heinrichsweikamp
parents:
diff changeset
184 comm_service_exit:
heinrichsweikamp
parents:
diff changeset
185 WIN_SMALL comm_status3_column, comm_status3_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
186 STRCPY_TEXT_PRINT tUsbExit ; exited
0
heinrichsweikamp
parents:
diff changeset
187 comm_service_exit_common:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
188 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
189 movlw 0xFF ; reply FF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
190 movwf TXREG1 ; send answer
0
heinrichsweikamp
parents:
diff changeset
191
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
192 call wait_1s ; wait 1 second
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
193 call wait_1s ; wait 1 second
0
heinrichsweikamp
parents:
diff changeset
194
heinrichsweikamp
parents:
diff changeset
195 call disable_rs232
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
196 goto restart
0
heinrichsweikamp
parents:
diff changeset
197
heinrichsweikamp
parents:
diff changeset
198 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
199
heinrichsweikamp
parents:
diff changeset
200 comm_service_ll_bootloader:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
201 bsf LEDr
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
202 WIN_SMALL comm_status3_column, comm_status3_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
203 STRCPY_TEXT_PRINT tUsbLlBld ; low level bootloader started
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
204 WIN_TOP comm_warning_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
205 WIN_LEFT comm_warning_column
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
206 TFT_WRITE_PROM_IMAGE_BY_LABEL dive_warning2_block ; show warning icon
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
207 goto 0x1FF0C
0
heinrichsweikamp
parents:
diff changeset
208
heinrichsweikamp
parents:
diff changeset
209 ;-----------------------------------------------------------------------------
273
12ee30cbced9 CHANGE: Automatically abort connection fail after 2mins (Bluetooth only)
heinrichsweikamp
parents: 269
diff changeset
210 ; send firmware to bootloader
0
heinrichsweikamp
parents:
diff changeset
211 ;
heinrichsweikamp
parents:
diff changeset
212 comm_send_firmware:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
213 movlw 0x50 ; send echo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
214 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
215 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
216
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
217 ; Read 5 bytes into buffer.
0
heinrichsweikamp
parents:
diff changeset
218 lfsr FSR2,buffer
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
219 movlw .5 ; counter
0
heinrichsweikamp
parents:
diff changeset
220 movwf lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
221 movlw 0x55 ; 5'ft byte checksum
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
222 movwf hi
0
heinrichsweikamp
parents:
diff changeset
223
heinrichsweikamp
parents:
diff changeset
224 comm_send_firmware_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
225 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
226 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
227 bra comm_send_firmware_abort ; NO - abort
0
heinrichsweikamp
parents:
diff changeset
228 movf RCREG1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
229 movwf POSTINC2 ; store checksum byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
230 xorwf hi,F ; also xor into checksum
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
231 rlncf hi,F ; and rotate it
0
heinrichsweikamp
parents:
diff changeset
232 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
233 bra comm_send_firmware_loop
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
234
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
235 ; check that 5ft byte checksum's checksum
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
236 movf hi,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
237 bnz comm_send_firmware_failed
0
heinrichsweikamp
parents:
diff changeset
238
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
239 movlw 0x4C ; send OK
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
240 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
241 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
242
heinrichsweikamp
parents:
diff changeset
243 ; Passed: goto second stage verification.
heinrichsweikamp
parents:
diff changeset
244 ; NOTE: Bootloader is Bank0. With buffer at address 0x200.
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
245 call vault_decodata_into_eeprom ; store last deco data (and time/date) into EEPROM
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
246 goto 0x1FDF0 ; and pray...
0
heinrichsweikamp
parents:
diff changeset
247
heinrichsweikamp
parents:
diff changeset
248 comm_send_firmware_failed:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
249 WIN_SMALL comm_string_column, comm_string_row
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
250 call TFT_warnings_color
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
251 STRCPY_PRINT "Checksum failed"
0
heinrichsweikamp
parents:
diff changeset
252
heinrichsweikamp
parents:
diff changeset
253 comm_send_firmware_abort:
heinrichsweikamp
parents:
diff changeset
254
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
255 movlw 0xFF ; send ABORTED byte
0
heinrichsweikamp
parents:
diff changeset
256 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
257 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
258
heinrichsweikamp
parents:
diff changeset
259 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
260 ; Reset to Dive 1 in logbook
heinrichsweikamp
parents:
diff changeset
261
heinrichsweikamp
parents:
diff changeset
262 comm_reset_logbook_pointers:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
263 call eeprom_reset_logbook_pointers ; clear logbook pointers in EEPROM...
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
264 call ext_flash_erase_logbook ; ... and complete logbook (!)
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
265 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
266
heinrichsweikamp
parents:
diff changeset
267 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
268 comm_reset_battery_gauge: ; resets battery gauge registers
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
269 call reset_battery_pointer ; resets battery pointer 0x07-0x0C and battery_gauge:5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
270 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
271
heinrichsweikamp
parents:
diff changeset
272 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
273 ; erases range in 4 kB steps
0
heinrichsweikamp
parents:
diff changeset
274
heinrichsweikamp
parents:
diff changeset
275 comm_erase_range4kb:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
276 movlw 0x42 ; send echo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
277 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
278 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
279 bcf INTCON,GIE ; all interrupts off!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
280 rcall comm_get_flash_address ; get three bytes address or return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
281 btfsc rs232_receive_overflow ; got data?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
282 bra comm_download_mode0 ; NO - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
283 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
284 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
285 bra comm_download_mode0 ; NO - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
286 movff RCREG1,lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
287 ; Got 4 bytes: 3 bytes address and 1 byte (lo) amount of 4kB blocks
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
288 comm_erase_range4kb_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
289 call ext_flash_erase4kB ; erase block
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
290 movlw 0x10
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
291 addwf ext_flash_address+1,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
292 movlw .0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
293 addwfc ext_flash_address+2,F ; increase address by .4096, or 0x1000
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
294 decfsz lo,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
295 bra comm_erase_range4kb_loop ; loop until lo=zero
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
296 bra comm_download_mode0 ; done (sends the 4C OK too)
0
heinrichsweikamp
parents:
diff changeset
297
heinrichsweikamp
parents:
diff changeset
298 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
299
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
300 comm_erase_4kb: ; get 3 bytes start address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
301 bcf INTCON,GIE ; all interrupts off
0
heinrichsweikamp
parents:
diff changeset
302
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
303 rcall comm_get_flash_address ; get three bytes address or return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
304 btfsc rs232_receive_overflow ; got data?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
305 bra comm_download_mode0 ; NO - done
0
heinrichsweikamp
parents:
diff changeset
306
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
307 call ext_flash_erase4kB ; erase one block
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
308 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
309
heinrichsweikamp
parents:
diff changeset
310 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
311
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
312 comm_write_range: ; get 3 bytes start address
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
313 movlw 0x30 ; send echo
0
heinrichsweikamp
parents:
diff changeset
314 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
315 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
316
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
317 bcf INTCON,GIE ; all interrupts off
0
heinrichsweikamp
parents:
diff changeset
318
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
319 rcall comm_get_flash_address ; get three bytes address or return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
320 btfsc rs232_receive_overflow ; got data?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
321 bra comm_download_mode0 ; NO - done
0
heinrichsweikamp
parents:
diff changeset
322
heinrichsweikamp
parents:
diff changeset
323 comm_write_range_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
324 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
325 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
326 bra comm_download_mode0 ; NO - done (and send OK byte too)
0
heinrichsweikamp
parents:
diff changeset
327 movf RCREG1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
328 ; bsf NCTS ; hold Bluetooth chip (requires PC/Android/iOS side to use flow control...)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
329 call ext_flash_byte_write_comms ; write one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
330 ; bcf NCTS ; release Bluetooth chip (requires PC/Android/iOS side to use flow control...)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
331 call incf_ext_flash_address_p1 ; increase address+1
420
789230298511 fix handling for new flash memory chip
heinrichsweikamp
parents: 399
diff changeset
332 bra comm_write_range_loop
0
heinrichsweikamp
parents:
diff changeset
333
heinrichsweikamp
parents:
diff changeset
334 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
335
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
336 comm_send_range: ; get 3 bytes start address and 3 bytes amount
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
337 movlw 0x20 ; send echo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
338 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
339 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
340 bcf INTCON,GIE ; all interrupts off
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
341 rcall comm_get_flash_address ; get three bytes address or return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
342 btfsc rs232_receive_overflow ; got data?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
343 bra comm_download_mode0 ; NO - done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
344 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
345 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
346 bra comm_download_mode0 ; NO - done
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
347 movff RCREG1,up
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
348 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
349 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
350 bra comm_download_mode0 ; NO - done
0
heinrichsweikamp
parents:
diff changeset
351 movff RCREG1,hi
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
352 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
353 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
354 bra comm_download_mode0 ; NO - done
0
heinrichsweikamp
parents:
diff changeset
355 movff RCREG1,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
356 ; if lo==0, we must precondition hi because there are too many bytes sent
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
357 movf lo,W
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
358 bnz $+4
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
359 decf hi,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
360 movlw 0x40
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
361 cpfslt up ; up > 0x3F?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
362 bra comm_download_mode0 ; YES - abort
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
363 ; 6 bytes received, send data
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
364 ; needs ext_flash_address:3 start address and up:hi:lo amount
0
heinrichsweikamp
parents:
diff changeset
365 call ext_flash_read_block_start
heinrichsweikamp
parents:
diff changeset
366 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
367 bra comm_send_range24 ; counter 24 bit
0
heinrichsweikamp
parents:
diff changeset
368 comm_send_range24_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
369 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
370 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
371 comm_send_range24:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
372 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
373 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
374 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
375 decf hi,F
heinrichsweikamp
parents:
diff changeset
376 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
377 cpfseq hi
heinrichsweikamp
parents:
diff changeset
378 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
379 decf up,F
heinrichsweikamp
parents:
diff changeset
380 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
381 cpfseq up
heinrichsweikamp
parents:
diff changeset
382 bra comm_send_range24_loop
heinrichsweikamp
parents:
diff changeset
383 call ext_flash_read_block_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
384 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
385
heinrichsweikamp
parents:
diff changeset
386 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
387
heinrichsweikamp
parents:
diff changeset
388 comm_get_flash_address:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
389 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
390 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
391 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
392 movff RCREG1,ext_flash_address+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
393 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
394 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
395 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
396 movff RCREG1,ext_flash_address+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
397 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
398 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
399 return ; NO - return
0
heinrichsweikamp
parents:
diff changeset
400 movff RCREG1,ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
401 return
heinrichsweikamp
parents:
diff changeset
402
heinrichsweikamp
parents:
diff changeset
403 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
404
heinrichsweikamp
parents:
diff changeset
405 comm_download_mode:
heinrichsweikamp
parents:
diff changeset
406 ; Enable comm download mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
407 WIN_SMALL comm_status2_column, comm_status2_row
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
408 STRCPY_TEXT_PRINT tUsbDownloadMode ; download mode enabled
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
409 bsf INTCON,GIE ; all interrupts on
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
410 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
411 movlw 0xBB ; command echo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
412 movwf TXREG1 ; send answer
0
heinrichsweikamp
parents:
diff changeset
413 comm_download_mode0:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
414 bsf INTCON,GIE ; all interrupts on
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
415 rcall comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
416 movlw 0x4C ; 4C in service mode
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
417 btfss comm_service_enabled
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
418 movlw 0x4D ; 4D in download mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
419 movwf TXREG1 ; send answer
0
heinrichsweikamp
parents:
diff changeset
420 movlw timeout_service_mode
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
421 movwf comm_timeout ; timeout
0
heinrichsweikamp
parents:
diff changeset
422 bcf switch_right
heinrichsweikamp
parents:
diff changeset
423 comm_download_mode1:
heinrichsweikamp
parents:
diff changeset
424 bcf onesecupdate
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
425 dcfsnz comm_timeout,F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
426 bra comm_service_exit ; timeout -> exit
0
heinrichsweikamp
parents:
diff changeset
427 comm_download_mode2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
428 rcall comm_get_byte ; check for a byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
429 btfsc comm_service_enabled
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
430 btg LEDr ; blink in service mode
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
431 btfss vusb_in ; USB plugged in?
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
432 bra comm_service_exit_nousb ; NO - disconnected -> exit
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
433 btfsc switch_right ; abort with right button
0
heinrichsweikamp
parents:
diff changeset
434 bra comm_service_exit
heinrichsweikamp
parents:
diff changeset
435 btfsc onesecupdate
heinrichsweikamp
parents:
diff changeset
436 bra comm_download_mode1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
437 btfsc rs232_receive_overflow
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
438 bra comm_download_mode2 ; wait for command byte
0
heinrichsweikamp
parents:
diff changeset
439
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
440 ; command received
0
heinrichsweikamp
parents:
diff changeset
441 bcf LEDr
heinrichsweikamp
parents:
diff changeset
442 movlw 0xFF
heinrichsweikamp
parents:
diff changeset
443 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
444 bra $+4
heinrichsweikamp
parents:
diff changeset
445 bra comm_service_exit ; exit
heinrichsweikamp
parents:
diff changeset
446 movlw "a"
heinrichsweikamp
parents:
diff changeset
447 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
448 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
449 bra comm_send_headers ; send all 256 dive headers
0
heinrichsweikamp
parents:
diff changeset
450 movlw "b"
heinrichsweikamp
parents:
diff changeset
451 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
452 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
453 bra comm_set_time ; read time and date from the PC and set clock
0
heinrichsweikamp
parents:
diff changeset
454 movlw "c"
heinrichsweikamp
parents:
diff changeset
455 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
456 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
457 bra comm_set_custom_text ; send a opt_name_length byte string of custom text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
458 movlw "f" ; 0x66
0
heinrichsweikamp
parents:
diff changeset
459 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
460 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
461 bra comm_send_dive ; send header and profile for one dive
0
heinrichsweikamp
parents:
diff changeset
462 movlw "i"
heinrichsweikamp
parents:
diff changeset
463 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
464 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
465 bra comm_identify ; send firmware, serial, etc.
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
466 movlw "j"
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
467 cpfseq RCREG1
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
468 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
469 bra comm_hardware_descriptor ; send hardware descriptor byte
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
470 movlw 0x60
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
471 cpfseq RCREG1
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
472 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
473 bra comm_feature_and_hardware ; send more detailed information
0
heinrichsweikamp
parents:
diff changeset
474 movlw "n"
heinrichsweikamp
parents:
diff changeset
475 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
476 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
477 goto comm_send_string ; send a 15 byte string to the screen
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
478 movlw "m"
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
479 cpfseq RCREG1
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
480 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
481 goto comm_send_compact_headers ; send all 256 compact headers
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
482
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
483 IFDEF _screendump
0
heinrichsweikamp
parents:
diff changeset
484 movlw "l"
heinrichsweikamp
parents:
diff changeset
485 cpfseq RCREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
486 bra $+4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
487 call TFT_dump_screen ; dump the screen contents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
488 ENDIF
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
489
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
490 movlw "r"
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
491 cpfseq RCREG1
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
492 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
493 bra comm_read_setting ; read a setting (and send via USB)
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
494 movlw "w"
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
495 cpfseq RCREG1
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
496 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
497 bra comm_write_setting ; write a setting (into RAM)
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
498 movlw "x"
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
499 cpfseq RCREG1
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
500 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
501 bra comm_option_reset_all ; reset all options to factory default
0
heinrichsweikamp
parents:
diff changeset
502
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
503 btfss comm_service_enabled ; done for download mode
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
504 bra comm_download_mode0 ; loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
505
heinrichsweikamp
parents:
diff changeset
506 movlw 0x20
heinrichsweikamp
parents:
diff changeset
507 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
508 bra $+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
509 bra comm_send_range ; send hi:lo:ext_flash_rw bytes starting from ext_flash_address:3
0
heinrichsweikamp
parents:
diff changeset
510 movlw 0x22
heinrichsweikamp
parents:
diff changeset
511 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
512 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
513 bra comm_reset_logbook_pointers ; reset all logbook pointers and the logbook
0
heinrichsweikamp
parents:
diff changeset
514 movlw 0x23
heinrichsweikamp
parents:
diff changeset
515 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
516 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
517 bra comm_reset_battery_gauge ; reset battery gauge registers
0
heinrichsweikamp
parents:
diff changeset
518 movlw 0x30
heinrichsweikamp
parents:
diff changeset
519 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
520 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
521 bra comm_write_range ; write bytes starting from ext_flash_address:3 (stop when timeout)
0
heinrichsweikamp
parents:
diff changeset
522 movlw 0x40
heinrichsweikamp
parents:
diff changeset
523 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
524 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
525 bra comm_erase_4kb ; erase 4 kB block from ext_flash_address:3 (Warning: no confirmation or built-in security here...)
0
heinrichsweikamp
parents:
diff changeset
526 movlw 0x42
heinrichsweikamp
parents:
diff changeset
527 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
528 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
529 bra comm_erase_range4kb ; erase range in 4 kB steps (get 3 bytes address and 1 byte amount of 4 kB blocks)
0
heinrichsweikamp
parents:
diff changeset
530 movlw 0x50
heinrichsweikamp
parents:
diff changeset
531 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
532 bra $+4
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
533 bra comm_send_firmware ; send firmware to bootloader
147
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
534 ; movlw "t"
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
535 ; cpfseq RCREG1
fdd4e30846ae some cleanup
heinrichsweikamp
parents: 136
diff changeset
536 ; bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
537 ; goto testloop ; start raw-data test loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
538 IFDEF _rx_function
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
539 movlw 0x70
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
540 cpfseq RCREG1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
541 bra $+4
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
542 bra comm_update_ostc_rx ; send firmware from external memory 3D0800h -> 3DFFFFh to OSTC RX circuity
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
543 ENDIF
0
heinrichsweikamp
parents:
diff changeset
544 movlw 0xC1
heinrichsweikamp
parents:
diff changeset
545 cpfseq RCREG1
heinrichsweikamp
parents:
diff changeset
546 bra $+4
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
547 bra comm_service_ll_bootloader ; start low-level bootloader
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
548 bra comm_download_mode0 ; loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
549
heinrichsweikamp
parents:
diff changeset
550 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
551
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
552 comm_send_compact_headers:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
553 movlw "m" ; send echo
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
554 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
555 ; send 13 bytes/dive (compact header)
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
556 ; 1st: 200009h-200016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
557 ; 2nd: 201009h-201016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
558 ; 3rd: 202009h-202016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
559 ; 100: 264009h-264016h
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
560 ; 256: 2FF009h-2FF016h
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
561 movlw 0x1F
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
562 movwf ext_flash_address+2
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
563 movlw 0xF0
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
564 movwf ext_flash_address+1
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
565
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
566 comm_send_compact_headers2:
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
567 movlw 0x09
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
568 movwf ext_flash_address+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
569 ; adjust address for next dive
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
570 movlw 0x10
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
571 addwf ext_flash_address+1
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
572 movlw 0x00
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
573 addwfc ext_flash_address+2
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
574
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
575 movlw 0x30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
576 cpfseq ext_flash_address+2 ; all 256 dive send?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
577 bra comm_send_compact_headers4 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
578 bra comm_download_mode0 ; done, loop with timeout reset
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
579
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
580 comm_send_compact_headers4:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
581 movlw .13
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
582 movwf lo ; counter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
583 rcall comm_write_byte ; wait for UART
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
584 call ext_flash_read_block_start ; 1st byte
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
585 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
586 bra comm_send_compact_headers3 ; counter 24 bit
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
587 comm_send_compact_headers_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
588 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
589 movwf TXREG1 ; start new transmit
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
590 comm_send_compact_headers3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
591 rcall comm_write_byte ; wait for UART
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
592 decfsz lo,F
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
593 bra comm_send_compact_headers_loop
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
594 call ext_flash_read_block_stop
347
7e5772df60cd Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 346
diff changeset
595
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
596 ; Offset to total dive counter
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
597 movlw .80
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
598 movwf ext_flash_address+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
599 call ext_flash_read_block_start ; 1st byte
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
600 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
601 rcall comm_write_byte ; wait for UART
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
602 call ext_flash_read_block ; 2nd byte
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
603 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
604 call ext_flash_read_block_stop
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
605 rcall comm_write_byte ; wait for UART
356
fcf3ae0fee6a Changed content for new 0x6F command (Get compact headers)
heinrichsweikamp
parents: 354
diff changeset
606
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
607 ; Offset to Logbook-Profile version
391
682199d87b5c add profile version to compact headers
heinrichsweikamp
parents: 378
diff changeset
608 movlw .8
682199d87b5c add profile version to compact headers
heinrichsweikamp
parents: 378
diff changeset
609 movwf ext_flash_address+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
610 call ext_flash_byte_read ; get byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
611 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
612 rcall comm_write_byte ; wait for UART
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
613 bra comm_send_compact_headers2 ; continue
346
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
614
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
615
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
616 ;-----------------------------------------------------------------------------
cf9ce6053dee New option to download "Compact Headers". Improved BLE support (OSTC 2 and OSTC 3+), updated OSTC interface documentation
heinrichsweikamp
parents: 337
diff changeset
617
0
heinrichsweikamp
parents:
diff changeset
618 comm_send_headers:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
619 movlw "a" ; send echo
0
heinrichsweikamp
parents:
diff changeset
620 movwf TXREG1
heinrichsweikamp
parents:
diff changeset
621 ; Send 256 bytes/dive (Header)
heinrichsweikamp
parents:
diff changeset
622 ; 1st: 200000h-2000FFh
heinrichsweikamp
parents:
diff changeset
623 ; 2nd: 201000h-2010FFh
heinrichsweikamp
parents:
diff changeset
624 ; 3rd: 202000h-2020FFh
heinrichsweikamp
parents:
diff changeset
625 ; 100: 264000h-2640FFh
heinrichsweikamp
parents:
diff changeset
626 ; 256: 2FF000h-2FF0FFh
heinrichsweikamp
parents:
diff changeset
627 movlw 0x1F
heinrichsweikamp
parents:
diff changeset
628 movwf ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
629 movlw 0xF0
heinrichsweikamp
parents:
diff changeset
630 movwf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
631 comm_send_headers2:
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
632 clrf ext_flash_address+0
0
heinrichsweikamp
parents:
diff changeset
633 ; Adjust address for next dive
heinrichsweikamp
parents:
diff changeset
634 movlw 0x10
heinrichsweikamp
parents:
diff changeset
635 addwf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
636 movlw 0x00
heinrichsweikamp
parents:
diff changeset
637 addwfc ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
638 movlw 0x30
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
639 cpfseq ext_flash_address+2 ; all 256 dive send?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
640 bra comm_send_headers4 ; NO - continue
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
641 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
642 comm_send_headers4:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
643 clrf lo ; counter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
644 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
645 call ext_flash_read_block_start ; 1st byte
heinrichsweikamp
parents:
diff changeset
646 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
647 bra comm_send_headers3 ; counter 24 bit
0
heinrichsweikamp
parents:
diff changeset
648 comm_send_headers_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
649 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
650 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
651 comm_send_headers3:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
652 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
653 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
654 bra comm_send_headers_loop
heinrichsweikamp
parents:
diff changeset
655 call ext_flash_read_block_stop
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
656 bra comm_send_headers2 ; continue
0
heinrichsweikamp
parents:
diff changeset
657
heinrichsweikamp
parents:
diff changeset
658 ;-----------------------------------------------------------------------------
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
659
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
660 comm_option_reset_all: ; reset all options to factory default
560
b7eb98dbd800 bump to 2.96beta (REFACTORED VERSION)
heinrichsweikamp
parents: 512
diff changeset
661 movlw "x" ; send echo
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
662 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
663 call option_reset_all
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
664 bra comm_download_mode0 ; done, back to loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
665
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
666 ;-----------------------------------------------------------------------------
0
heinrichsweikamp
parents:
diff changeset
667
heinrichsweikamp
parents:
diff changeset
668 comm_set_time:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
669 movlw "b" ; send echo
0
heinrichsweikamp
parents:
diff changeset
670 movwf TXREG1
heinrichsweikamp
parents:
diff changeset
671
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
672 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
673 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
674 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
675 bra comm_download_mode0 ; NO - abort
0
heinrichsweikamp
parents:
diff changeset
676 movff RCREG1, hours
heinrichsweikamp
parents:
diff changeset
677 movlw d'24'
heinrichsweikamp
parents:
diff changeset
678 cpfslt hours
heinrichsweikamp
parents:
diff changeset
679 clrf hours
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
680 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
681 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
682 bra comm_download_mode0 ; NO - abort
0
heinrichsweikamp
parents:
diff changeset
683 movff RCREG1, mins
heinrichsweikamp
parents:
diff changeset
684 movlw d'60'
heinrichsweikamp
parents:
diff changeset
685 cpfslt mins
heinrichsweikamp
parents:
diff changeset
686 clrf mins
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
687 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
688 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
689 bra comm_download_mode0 ; NO - abort
0
heinrichsweikamp
parents:
diff changeset
690 movff RCREG1, secs
heinrichsweikamp
parents:
diff changeset
691 movlw d'60'
heinrichsweikamp
parents:
diff changeset
692 cpfslt secs
heinrichsweikamp
parents:
diff changeset
693 clrf secs
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
694 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
695 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
696 bra comm_download_mode0 ; NO - abort
0
heinrichsweikamp
parents:
diff changeset
697 movff RCREG1, month
heinrichsweikamp
parents:
diff changeset
698 movlw d'13'
heinrichsweikamp
parents:
diff changeset
699 cpfslt month
heinrichsweikamp
parents:
diff changeset
700 movwf month
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
701 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
702 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
703 bra comm_download_mode0 ; NO - abort
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
704 call comm_check_day ; check day
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
705 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
706 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
707 bra comm_download_mode0 ; NO - abort
0
heinrichsweikamp
parents:
diff changeset
708 movff RCREG1, year
heinrichsweikamp
parents:
diff changeset
709 movlw d'100'
heinrichsweikamp
parents:
diff changeset
710 cpfslt year
heinrichsweikamp
parents:
diff changeset
711 clrf year
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
712 ; all ok, set RTCC
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
713 call rtc_set_rtc ; writes mins,sec,hours,day,month and year to RTC module
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
714 bra comm_download_mode0 ; done, back to loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
715
heinrichsweikamp
parents:
diff changeset
716 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
717 ; Set custom text string (opt_name_length ASCII chars)
0
heinrichsweikamp
parents:
diff changeset
718 ;
heinrichsweikamp
parents:
diff changeset
719
heinrichsweikamp
parents:
diff changeset
720 comm_set_custom_text:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
721 movlw "c" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
722 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
723 rcall comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
724 lfsr FSR2,opt_name
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
725 movlw opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
726 movwf lo ; counter
0
heinrichsweikamp
parents:
diff changeset
727 comm_set_ctext_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
728 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
729 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
730 bra comm_set_ctext_loop_done ; NO - abort
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
731 movff RCREG1,POSTINC2 ; store character
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
732 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
733 bra comm_set_ctext_loop
136
9a637c9bb19a rename Deco Planner to Simulator
heinrichsweikamp
parents: 128
diff changeset
734 comm_set_ctext_loop_done:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
735 tstfsz lo ; got opt_name_length bytes?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
736 bra comm_set_ctext_loop_done2 ; NO - clear remaining chars
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
737 bra comm_download_mode0 ; done, loop with timeout reset
136
9a637c9bb19a rename Deco Planner to Simulator
heinrichsweikamp
parents: 128
diff changeset
738 comm_set_ctext_loop_done2:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
739 clrf POSTINC2
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
740 decfsz lo,F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
741 bra comm_set_ctext_loop_done2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
742 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
743
heinrichsweikamp
parents:
diff changeset
744 ;-----------------------------------------------------------------------------
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
745 ; Reply Serial (2 bytes low:high), firmware (major.minor) and custom text
0
heinrichsweikamp
parents:
diff changeset
746 ;
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
747
0
heinrichsweikamp
parents:
diff changeset
748 comm_identify:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
749 movlw "i" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
750 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
751 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
752
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
753 ;---- Read serial from internal EEPROM address 0000
0
heinrichsweikamp
parents:
diff changeset
754 clrf EEADRH
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
755 clrf EEADR ; get serial number LOW
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
756 call read_eeprom ; read byte
0
heinrichsweikamp
parents:
diff changeset
757 movff EEDATA,lo
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
758 incf EEADR,F ; get serial number HIGH
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
759 call read_eeprom ; read byte
0
heinrichsweikamp
parents:
diff changeset
760 movff EEDATA,hi
heinrichsweikamp
parents:
diff changeset
761
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
762 ;---- Emit serial number
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
763 movff lo,TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
764 rcall comm_write_byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
765 movff hi,TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
766 rcall comm_write_byte
0
heinrichsweikamp
parents:
diff changeset
767
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
768 ;---- Emit firmware hi.lo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
769 movlw softwareversion_x
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
770 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
771 rcall comm_write_byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
772 movlw softwareversion_y
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
773 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
774 rcall comm_write_byte
0
heinrichsweikamp
parents:
diff changeset
775
heinrichsweikamp
parents:
diff changeset
776 ;---- Emit custom text
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
777 movlw opt_name_length
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
778 movwf hi
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
779 lfsr FSR2,opt_name
0
heinrichsweikamp
parents:
diff changeset
780
heinrichsweikamp
parents:
diff changeset
781 common_identify_loop:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
782 movff POSTINC2,TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
783 rcall comm_write_byte
0
heinrichsweikamp
parents:
diff changeset
784 decfsz hi,F
heinrichsweikamp
parents:
diff changeset
785 bra common_identify_loop
heinrichsweikamp
parents:
diff changeset
786
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
787 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
788
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
789 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
790
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
791 comm_get_byte:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
792 goto rs232_get_byte ; ... and return
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
793
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
794 comm_write_byte:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
795 goto rs232_wait_tx ; ... and return
0
heinrichsweikamp
parents:
diff changeset
796
235
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
797 ;-----------------------------------------------------------------------------
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
798 ; Reply hardware descriptor byte
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
799 ;
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
800
23311219dacc under construction: new hardware_flag to configure different hardware versions
heinrichsweikamp
parents: 223
diff changeset
801 comm_hardware_descriptor:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
802 movlw "j" ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
803 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
804 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
805 movff hardware_flag1,TXREG1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
806 bra comm_download_mode0 ; done
0
heinrichsweikamp
parents:
diff changeset
807
441
360acdcda0d7 +BUGFIX: Compatibility with "hwOS Config" fixed
heinrichsweikamp
parents: 426
diff changeset
808 comm_feature_and_hardware:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
809 movlw 0x60 ; send echo
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
810 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
811 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
812 movlw 0x00 ; hardware high byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
813 movwf TXREG1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
814 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
815 movff hardware_flag1,TXREG1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
816 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
817 movlw 0x00 ; feature high Byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
818 movwf TXREG1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
819 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
820 movlw 0x00 ; feature low Byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
821 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
822 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
823 movlw 0x00 ; model descriptor byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
824 movwf TXREG1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
825 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
826
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
827 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
828
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
829 IFDEF _rx_function
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
830
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
831 comm_update_ostc_rx:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
832 movlw 0x70 ; send echo
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
833 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
834 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
835 ; btfss ostc_rx_present ; rx model?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
836 ; bra comm_download_mode0 ; NO - abort
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
837
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
838 ; Setup ext_flash_address:3
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
839 movlw LOW 0x3D0800
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
840 movwf ext_flash_address+0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
841 movlw HIGH (0x3D0800 & 0xFFFF) ; <- & 0xFFFF to suppress warning message...
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
842 movwf ext_flash_address+1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
843 movlw UPPER 0x3D0800
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
844 movwf ext_flash_address+2
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
845
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
846 bsf active_reset_ostc_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
847 WAITMS .5
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
848 bcf active_reset_ostc_rx
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
849 WAITMS .100
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
850 bcf INTCON,GIE ; halt all interrupts
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
851
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
852 movlw LOW .992
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
853 movwf uart1_temp
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
854 movlw HIGH .992
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
855 movwf uart2_temp
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
856 incf uart2_temp,F ; ++1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
857 WAITMS .1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
858
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
859 call ext_flash_read_block_start
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
860 movwf up ; first byte to write
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
861
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
862 comm_update_ostc_rx_loop: ; (run 992 times)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
863 WIN_SMALL comm_status4_column, comm_status4_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
864 movff uart1_temp,xA+0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
865 movf uart2_temp,W
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
866 tstfsz uart2_temp
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
867 decf uart2_temp,W ; --1 for display
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
868 movwf xA+1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
869 movlw .64
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
870 movwf xB+0
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
871 clrf xB+1
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
872 call mult16x16 ; xA * xB = xC
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
873 movff xC+0,lo
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
874 movff xC+1,hi
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
875 bsf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
876 output_16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
877 bcf leftbind
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
878 STRCAT_PRINT " Bytes left "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
879
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
880 call I2C_update_OSTC_rx ; send firmware from external memory 3D0800h -> 3DFFFFh to OSTC RX circuity
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
881
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
882 tstfsz WREG ; returns with WREG=0 if everything was ok
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
883 bra comm_update_ostc_rx_loop_error ; error -> abort
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
884
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
885 decfsz uart1_temp,F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
886 bra comm_update_ostc_rx_loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
887 decfsz uart2_temp,F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
888 bra comm_update_ostc_rx_loop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
889
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
890 comm_update_ostc_rx_loop_done:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
891 call ext_flash_read_block_stop
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
892 bsf INTCON,GIE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
893 WIN_SMALL comm_status4_column, comm_status4_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
894 STRCPY_PRINT " "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
895 bra comm_download_mode0 ; done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
896
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
897 comm_update_ostc_rx_loop_error:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
898 bsf INTCON,GIE
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
899 WIN_SMALL comm_status4_column, comm_status4_row
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
900 STRCPY_PRINT "ERROR. Retry! "
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
901 call wait_1s ; do not use for time critical routines, can be between 0 and 1 sec!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
902 call wait_1s ; do not use for time critical routines, can be between 0 and 1 sec!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
903 call wait_1s ; do not use for time critical routines, can be between 0 and 1 sec!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
904 bra comm_update_ostc_rx_loop_done
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
905
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
906 ENDIF
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
907
0
heinrichsweikamp
parents:
diff changeset
908 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
909
heinrichsweikamp
parents:
diff changeset
910 comm_send_dive:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
911 movlw "f"; 0x66 ; send echo
0
heinrichsweikamp
parents:
diff changeset
912 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
913
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
914 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
915 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
916 bra comm_download_mode0 ; NO - abort!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
917 movff RCREG1,lo ; store dive number (0-255)
0
heinrichsweikamp
parents:
diff changeset
918 ; First, send the header (again)
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
919 ; set ext_flash_address:3 to TOC entry of this dive
0
heinrichsweikamp
parents:
diff changeset
920 ; 1st: 200000h-200FFFh -> lo=0
heinrichsweikamp
parents:
diff changeset
921 ; 2nd: 201000h-201FFFh -> lo=1
heinrichsweikamp
parents:
diff changeset
922 ; 3rd: 202000h-202FFFh -> lo=2
heinrichsweikamp
parents:
diff changeset
923 ; 256: 2FF000h-2FFFFFh -> lo=255
heinrichsweikamp
parents:
diff changeset
924 clrf ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
925 clrf ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
926 movlw 0x20
heinrichsweikamp
parents:
diff changeset
927 movwf ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
928 movlw .16
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
929 mulwf lo ; lo*16 = offset to 0x2000 (up:hi)
0
heinrichsweikamp
parents:
diff changeset
930 movf PRODL,W
heinrichsweikamp
parents:
diff changeset
931 addwf ext_flash_address+1,F
heinrichsweikamp
parents:
diff changeset
932 movf PRODH,W
heinrichsweikamp
parents:
diff changeset
933 addwfc ext_flash_address+2,F
heinrichsweikamp
parents:
diff changeset
934
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
935 incf_ext_flash_address d'2' ; skip 0xFA, 0xFA
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
936 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
937 movff ext_flash_rw,ext_flash_log_pointer+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
938 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
939 movff ext_flash_rw,ext_flash_log_pointer+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
940 call ext_flash_byte_read_plus ; read start address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
941 movff ext_flash_rw,ext_flash_log_pointer+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
942 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
943 movff ext_flash_rw,ext_flash_end_pointer+0
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
944 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
945 movff ext_flash_rw,ext_flash_end_pointer+1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
946 call ext_flash_byte_read_plus ; read end address of profile
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
947 movff ext_flash_rw,ext_flash_end_pointer+2
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
948 decf_ext_flash_address d'8' ; back again to first 0xFA in header
0
heinrichsweikamp
parents:
diff changeset
949
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
950 movf ext_flash_log_pointer+0,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
951 cpfseq ext_flash_end_pointer+0 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
952 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
953
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
954 movf ext_flash_log_pointer+1,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
955 cpfseq ext_flash_end_pointer+1 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
956 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
957
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
958 movf ext_flash_log_pointer+2,W
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
959 cpfseq ext_flash_end_pointer+2 ; equal?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
960 bra comm_send_dive1 ; NO - send header
0
heinrichsweikamp
parents:
diff changeset
961
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
962 ; Start=End -> Not good, abort
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
963 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
964
heinrichsweikamp
parents:
diff changeset
965 comm_send_dive1:
heinrichsweikamp
parents:
diff changeset
966 ; Send header
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
967 clrf hi ; counter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
968 rcall comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
969 call ext_flash_read_block_start ; 1st byte
0
heinrichsweikamp
parents:
diff changeset
970 movwf TXREG1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
971 bra comm_send_dive_header
0
heinrichsweikamp
parents:
diff changeset
972 comm_send_dive_header2:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
973 call ext_flash_read_block ; read one byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
974 movwf TXREG1 ; start new transmit
0
heinrichsweikamp
parents:
diff changeset
975 comm_send_dive_header:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
976 rcall comm_write_byte ; wait for UART
0
heinrichsweikamp
parents:
diff changeset
977 decfsz hi,F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
978 bra comm_send_dive_header2
0
heinrichsweikamp
parents:
diff changeset
979 call ext_flash_read_block_stop
heinrichsweikamp
parents:
diff changeset
980
heinrichsweikamp
parents:
diff changeset
981 ; Set address for profile
heinrichsweikamp
parents:
diff changeset
982 movff ext_flash_log_pointer+0,ext_flash_address+0
heinrichsweikamp
parents:
diff changeset
983 movff ext_flash_log_pointer+1,ext_flash_address+1
heinrichsweikamp
parents:
diff changeset
984 movff ext_flash_log_pointer+2,ext_flash_address+2
heinrichsweikamp
parents:
diff changeset
985
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
986 movlw .6 ; skip 6 byte short header in profile - only for internal use
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
987 call incf_ext_flash_address0_0x20 ; increases bytes in ext_flash_address:3 with 0x200000 bank switching
0
heinrichsweikamp
parents:
diff changeset
988
512
heinrichsweikamp
parents: 507
diff changeset
989 ; Set address for short header/compact header, Byte 0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
990
0
heinrichsweikamp
parents:
diff changeset
991 comm_send_dive_profile:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
992 call ext_flash_byte_read_plus_0x20 ; read one byte into ext_flash_rw, takes care of banking at 0x200000
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
993 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
994 movff ext_flash_rw,TXREG1 ; send a byte
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
995
0
heinrichsweikamp
parents:
diff changeset
996 ; 24bit compare with end address
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
997 movff ext_flash_end_pointer+0,WREG
0
heinrichsweikamp
parents:
diff changeset
998 cpfseq ext_flash_address+0
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
999 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1000 movff ext_flash_end_pointer+1,WREG
0
heinrichsweikamp
parents:
diff changeset
1001 cpfseq ext_flash_address+1
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1002 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1003 movff ext_flash_end_pointer+2,WREG
0
heinrichsweikamp
parents:
diff changeset
1004 cpfseq ext_flash_address+2
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1005 bra comm_send_dive_profile
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1006
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1007 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1008 bra comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
1009
heinrichsweikamp
parents:
diff changeset
1010 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
1011
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1012 comm_read_setting:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1013 movlw "r"
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1014 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1015 rcall comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1016 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1017 bra comm_read_abort ; NO - abort!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1018 rcall comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1019 movlw 0x0F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1020 cpfsgt RCREG1 ; 0x00-0x0F: unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1021 bra comm_read_abort ; abort!
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1022 subwf RCREG1,W ; subtract unused commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1023
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1024 clrf up ; set gas/dil index to 0 (0 = gas 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1025 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1026 bra comm_read_gas_dil ; RCREG1=0x10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1027 incf up ; increment gas/dil index (1 = gas 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1028 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1029 bra comm_read_gas_dil ; RCREG1=0x11
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1030 incf up ; increment gas/dil index (2 = gas 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1031 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1032 bra comm_read_gas_dil ; RCREG1=0x12
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1033 incf up ; increment gas/dil index (3 = gas 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1034 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1035 bra comm_read_gas_dil ; RCREG1=0x13
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1036 incf up ; increment gas/dil index (4 = gas 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1037 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1038 bra comm_read_gas_dil ; RCREG1=0x14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1039 incf up ; increment gas/dil index (5 = dil 1)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1040 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1041 bra comm_read_gas_dil ; RCREG1=0x15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1042 incf up ; increment gas/dil index (6 = dil 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1043 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1044 bra comm_read_gas_dil ; RCREG1=0x16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1045 incf up ; increment gas/dil index (7 = dil 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1046 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1047 bra comm_read_gas_dil ; RCREG1=0x17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1048 incf up ; increment gas/dil index (8 = dil 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1049 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1050 bra comm_read_gas_dil ; RCREG1=0x18
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1051 incf up ; increment gas/dil index (9 = dil 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1052 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1053 bra comm_read_gas_dil ; RCREG1=0x19
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1054
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1055 clrf up ; set setpoint index to 0 (0 = SP 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1056 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1057 bra comm_read_sp ; RCREG1=0x1A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1058 incf up ; increment setpoint index (1 = SP2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1059 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1060 bra comm_read_sp ; RCREG1=0x1B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1061 incf up ; increment setpoint index (2 = SP3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1062 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1063 bra comm_read_sp ; RCREG1=0x1C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1064 incf up ; increment setpoint index (3 = SP4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1065 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1066 bra comm_read_sp ; RCREG1=0x1D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1067 incf up ; increment setpoint index (4 = SP5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1068 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1069 bra comm_read_sp ; RCREG1=0x1E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1070
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1071 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1072 movff opt_ccr_mode, TXREG1 ; RCREG1=0x1F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1073 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1074 movff opt_dive_mode, TXREG1 ; RCREG1=0x20
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1075 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1076 movff char_I_deco_model, TXREG1 ; RCREG1=0x21
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1077 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1078 movff char_I_ppO2_max, TXREG1 ; RCREG1=0x22
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1079 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1080 movff char_I_ppO2_min, TXREG1 ; RCREG1=0x23
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1081 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1082 movff char_I_extra_time, TXREG1 ; RCREG1=0x24
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1083 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1084 movff opt_GF_low, TXREG1 ; RCREG1=0x25
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1085 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1086 movff opt_GF_high, TXREG1 ; RCREG1=0x26
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1087 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1088 movff opt_aGF_low, TXREG1 ; RCREG1=0x27
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1089 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1090 movff opt_aGF_high, TXREG1 ; RCREG1=0x28
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1091 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1092 movff opt_enable_aGF, TXREG1 ; RCREG1=0x29
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1093 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1094 movff opt_sat_multiplier_non_gf, TXREG1 ; RCREG1=0x2A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1095 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1096 movff opt_desat_multiplier_non_gf,TXREG1 ; RCREG1=0x2B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1097 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1098 movff opt_last_stop, TXREG1 ; RCREG1=0x2C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1099 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1100 movff opt_brightness, TXREG1 ; RCREG1=0x2D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1101 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1102 movff opt_units, TXREG1 ; RCREG1=0x2E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1103 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1104 movff opt_sampling_rate, TXREG1 ; RCREG1=0x2F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1105 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1106 movff opt_salinity, TXREG1 ; RCREG1=0x30
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1107 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1108 movff opt_dive_color_scheme, TXREG1 ; RCREG1=0x31
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1109 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1110 movff opt_language, TXREG1 ; RCREG1=0x32
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1111 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1112 movff opt_dateformat, TXREG1 ; RCREG1=0x33
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1113 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1114 movff opt_compass_gain, TXREG1 ; RCREG1=0x34
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1115 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1116 movff opt_pressure_adjust, TXREG1 ; RCREG1=0x35
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1117 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1118 movff opt_enable_safetystop, TXREG1 ; RCREG1=0x36
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1119 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1120 movff opt_calibration_O2_ratio, TXREG1 ; RCREG1=0x37
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1121 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1122 clrf TXREG1 ; RCREG1=0x38 NOT USED ANYMORE (ex opt_sensor_fallback)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1123 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1124 movff opt_flip_screen, TXREG1 ; RCREG1=0x39
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1125 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1126 movff opt_cR_button_left, TXREG1 ; RCREG1=0x3A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1127 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1128 movff opt_cR_button_right, TXREG1 ; RCREG1=0x3B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1129 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1130 movff char_I_bottom_usage, TXREG1 ; RCREG1=0x3C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1131 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1132 movff char_I_deco_usage, TXREG1 ; RCREG1=0x3D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1133 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1134 movff opt_modwarning, TXREG1 ; RCREG1=0x3E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1135 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1136 movff opt_vsitextv2, TXREG1 ; RCREG1=0x3F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1137 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1138 movff opt_vsigraph, TXREG1 ; RCREG1=0x40
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1139 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1140 movff opt_showppo2, TXREG1 ; RCREG1=0x41
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1141 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1142 movff opt_temperature_adjust, TXREG1 ; RCREG1=0x42
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1143 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1144 movff opt_safety_stop_length, TXREG1 ; RCREG1=0x43
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1145 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1146 movff opt_safety_stop_start, TXREG1 ; RCREG1=0x44
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1147 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1148 movff opt_safety_stop_end, TXREG1 ; RCREG1=0x45
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1149 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1150 movff opt_safety_stop_reset, TXREG1 ; RCREG1=0x46
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1151 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1152 clrf TXREG1 ; RCREG1=0x47, ignore conservatism in hwOS tech firmware
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1153 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1154 movff opt_diveTimeout, TXREG1 ; RCREG1=0x48
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1155 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1156 movff button_polarity, TXREG1 ; RCREG1=0x49
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1157 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1158 movff char_I_PSCR_drop, TXREG1 ; RCREG1=0x4A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1159 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1160 movff char_I_PSCR_lungratio, TXREG1 ; RCREG1=0x4B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1161 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1162 movff char_I_ppO2_max_deco, TXREG1 ; RCREG1=0x4C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1163 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1164 movff char_I_ppO2_min_loop, TXREG1 ; RCREG1=0x4D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1165 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1166 movff char_I_tank_size+0, TXREG1 ; RCREG1=0x4E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1167 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1168 movff char_I_tank_size+1, TXREG1 ; RCREG1=0x4F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1169 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1170 movff char_I_tank_size+2, TXREG1 ; RCREG1=0x50
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1171 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1172 movff char_I_tank_size+3, TXREG1 ; RCREG1=0x51
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1173 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1174 movff char_I_tank_size+4, TXREG1 ; RCREG1=0x52
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1175 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1176 movff char_I_tank_pres_fill+0, TXREG1 ; RCREG1=0x53
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1177 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1178 movff char_I_tank_pres_fill+1, TXREG1 ; RCREG1=0x54
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1179 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1180 movff char_I_tank_pres_fill+2, TXREG1 ; RCREG1=0x55
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1181 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1182 movff char_I_tank_pres_fill+3, TXREG1 ; RCREG1=0x56
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1183 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1184 movff char_I_tank_pres_fill+4, TXREG1 ; RCREG1=0x57
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1185 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1186 movff char_I_cc_max_frac_o2, TXREG1 ; RCREG1=0x58
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1187 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1188 movff opt_sim_setpoint_number, TXREG1 ; RCREG1=0x59
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1189 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1190 movff opt_calc_asc_gasvolume, TXREG1 ; RCREG1=0x5A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1191 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1192 movff opt_sim_use_aGF, TXREG1 ; RCREG1=0x5B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1193 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1194 movff char_I_altitude_wait, TXREG1 ; RCREG1=0x5C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1195 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1196 movff opt_enable_IBCD, TXREG1 ; RCREG1=0x5D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1197 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1198 movff opt_sat_multiplier_gf, TXREG1 ; RCREG1=0x5E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1199 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1200 movff opt_desat_multiplier_gf, TXREG1 ; RCREG1=0x5F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1201 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1202 movff opt_transmitter_id_1+0, TXREG1 ; RCREG1=0x60
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1203 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1204 movff opt_transmitter_id_1+1, TXREG1 ; RCREG1=0x61
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1205 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1206 movff opt_transmitter_id_2+0, TXREG1 ; RCREG1=0x62
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1207 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1208 movff opt_transmitter_id_2+1, TXREG1 ; RCREG1=0x63
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1209 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1210 movff opt_transmitter_id_3+0, TXREG1 ; RCREG1=0x64
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1211 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1212 movff opt_transmitter_id_3+1, TXREG1 ; RCREG1=0x65
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1213 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1214 movff opt_transmitter_id_4+0, TXREG1 ; RCREG1=0x66
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1215 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1216 movff opt_transmitter_id_4+1, TXREG1 ; RCREG1=0x67
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1217 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1218 movff opt_transmitter_id_5+0, TXREG1 ; RCREG1=0x68
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1219 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1220 movff opt_transmitter_id_5+1, TXREG1 ; RCREG1=0x69
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1221 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1222 movff opt_transmitter_id_6+0, TXREG1 ; RCREG1=0x6A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1223 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1224 movff opt_transmitter_id_6+1, TXREG1 ; RCREG1=0x6B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1225 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1226 movff opt_transmitter_id_7+0, TXREG1 ; RCREG1=0x6C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1227 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1228 movff opt_transmitter_id_7+1, TXREG1 ; RCREG1=0x6D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1229 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1230 movff opt_transmitter_id_8+0, TXREG1 ; RCREG1=0x6E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1231 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1232 movff opt_transmitter_id_8+1, TXREG1 ; RCREG1=0x6F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1233 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1234 movff opt_transmitter_id_9+0, TXREG1 ; RCREG1=0x70
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1235 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1236 movff opt_transmitter_id_9+1, TXREG1 ; RCREG1=0x71
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1237 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1238 movff opt_transmitter_id_10+0, TXREG1 ; RCREG1=0x72
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1239 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1240 movff opt_transmitter_id_10+1, TXREG1 ; RCREG1=0x73
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1241 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1242 movff char_I_tank_size+5, TXREG1 ; RCREG1=0x74
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1243 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1244 movff char_I_tank_size+6, TXREG1 ; RCREG1=0x75
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1245 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1246 movff char_I_tank_size+7, TXREG1 ; RCREG1=0x76
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1247 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1248 movff char_I_tank_size+8, TXREG1 ; RCREG1=0x77
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1249 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1250 movff char_I_tank_size+9, TXREG1 ; RCREG1=0x78
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1251 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1252 movff char_I_tank_pres_fill+5, TXREG1 ; RCREG1=0x79
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1253 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1254 movff char_I_tank_pres_fill+6, TXREG1 ; RCREG1=0x7A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1255 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1256 movff char_I_tank_pres_fill+7, TXREG1 ; RCREG1=0x7B
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1257 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1258 movff char_I_tank_pres_fill+8, TXREG1 ; RCREG1=0x7C
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1259 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1260 movff char_I_tank_pres_fill+9, TXREG1 ; RCREG1=0x7D
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1261 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1262 movff opt_TR_mode, TXREG1 ; RCREG1=0x7E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1263 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1264 movff opt_TR_1st_pres, TXREG1 ; RCREG1=0x7F
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1265 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1266 movff opt_TR_2nd_pres, TXREG1 ; RCREG1=0x80
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1267 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1268 movff opt_TR_Bail_pres, TXREG1 ; RCREG1=0x81
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1269 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1270 movff char_I_max_pres_diff, TXREG1 ; RCREG1=0x82
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1271 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1272 movff opt_ZfactorUse, TXREG1 ; RCREG1=0x83
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1273 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1274 movff opt_ZfactorTemp, TXREG1 ; RCREG1=0x84
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1275 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1276 movff opt_2ndDepthDisp, TXREG1 ; RCREG1=0x85
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1277
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1278 comm_read_abort:
255
ad62dff7739a add bearing option to compass
heinrichsweikamp
parents: 252
diff changeset
1279 comm_read_done:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1280 bra comm_download_mode0 ; done, loop with timeout reset
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1281
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1282 ;-----------------------------------------------------------------------------
157
5ee76921e359 make new parameters configurable through pc
heinrichsweikamp
parents: 150
diff changeset
1283
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1284 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1285 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1286 ; opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1287 ; opt_dil_O2_ratio res 5 ; O2 ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1288 ; opt_gas_He_ratio res 5 ; He ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1289 ; opt_dil_He_ratio res 5 ; He ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1290 ; opt_gas_type res 5 ; OC/bailout gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1291 ; opt_dil_type res 5 ; dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1292 ; opt_gas_change res 5 ; change depths for OC/Bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1293 ; opt_dil_change res 5 ; change depths for diluents
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1294
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1295 comm_read_gas_dil:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1296 lfsr FSR0,opt_gas_O2_ratio ; load base address of gas data arrays
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1297 movf up,W ; load index (0-9) of gas/dil into WREG, addressing O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1298 movff PLUSW0, TXREG1 ; transmit O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1299 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1300 addlw .10 ; increment index by 10, addressing He ratio now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1301 movff PLUSW0, TXREG1 ; transmit He ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1302 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1303 addlw .10 ; increment index by 10, addressing gas/dil type now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1304 movff PLUSW0, TXREG1 ; transmit gas/dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1305 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1306 addlw .10 ; increment index by 10, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1307 movff PLUSW0,TXREG1 ; transmit change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1308 bra comm_read_done ; done, wait for UART and loop with timeout reset
110
d39493c786a2 BUGFIX: OSTC settings via USB issues
heinrichsweikamp
parents: 97
diff changeset
1309
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1310
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1311 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1312 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1313 ; char_I_setpoint_cbar res 5 ; setpoints in cbar
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1314 ; char_I_setpoint_change res 5 ; change depth for the setpoints in meter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1315
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1316 comm_read_sp:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1317 lfsr FSR0,char_I_setpoint_cbar ; load base address of setpoint cbar values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1318 movf up,W ; load index (0-4) of setpoint into WREG, addressing cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1319 movff PLUSW0, TXREG1 ; transmit setpoint cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1320 rcall comm_write_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1321 addlw .5 ; increment index by 5, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1322 movff PLUSW0, TXREG1 ; transmit change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1323 bra comm_read_done ; done, wait for UART and loop with timeout reset
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1324
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1325 ;-----------------------------------------------------------------------------
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1326
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1327 comm_write_setting:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1328 movlw "w"
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1329 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1330 rcall comm_get_byte ; "Byte 2"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1331 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1332 bra comm_write_abort ; NO - abort!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1333 movff RCREG1,lo ; copy
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1334 rcall comm_get_byte ; "Byte 3"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1335 rcall comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1336 movlw 0x0F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1337 cpfsgt lo ; 0x00-0x0F: unused
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1338 bra comm_write_abort ; abort!
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1339 subwf lo,W ; subtract unused commands
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1340
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1341 clrf up ; set gas/dil index to 0 (0 = gas 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1342 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1343 bra comm_write_gas_dil ; RCREG1=0x10
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1344 incf up ; increment gas/dil index (1 = gas 2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1345 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1346 bra comm_write_gas_dil ; RCREG1=0x11
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1347 incf up ; increment gas/dil index (2 = gas 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1348 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1349 bra comm_write_gas_dil ; RCREG1=0x12
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1350 incf up ; increment gas/dil index (3 = gas 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1351 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1352 bra comm_write_gas_dil ; RCREG1=0x13
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1353 incf up ; increment gas/dil index (4 = gas 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1354 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1355 bra comm_write_gas_dil ; RCREG1=0x14
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1356 incf up ; increment gas/dil index (5 = dil 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1357 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1358 bra comm_write_gas_dil ; RCREG1=0x15
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1359 incf up ; increment gas/dil index (6 = dil 2)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1360 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1361 bra comm_write_gas_dil ; RCREG1=0x16
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1362 incf up ; increment gas/dil index (7 = dil 3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1363 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1364 bra comm_write_gas_dil ; RCREG1=0x17
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1365 incf up ; increment gas/dil index (8 = dil 4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1366 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1367 bra comm_write_gas_dil ; RCREG1=0x18
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1368 incf up ; increment gas/dil index (9 = dil 5)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1369 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1370 bra comm_write_gas_dil ; RCREG1=0x19
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1371
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1372 clrf up ; set setpoint index to 0 (0 = SP 1)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1373 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1374 bra comm_write_sp ; RCREG1=0x1A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1375 incf up ; increment setpoint index (1 = SP2)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1376 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1377 bra comm_write_sp ; RCREG1=0x1B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1378 incf up ; increment setpoint index (2 = SP3)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1379 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1380 bra comm_write_sp ; RCREG1=0x1C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1381 incf up ; increment setpoint index (3 = SP4)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1382 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1383 bra comm_write_sp ; RCREG1=0x1D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1384 incf up ; increment setpoint index (4 = SP5)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1385 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1386 bra comm_write_sp ; RCREG1=0x1E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1387
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1388 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1389 movff RCREG1, opt_ccr_mode ; RCREG1=0x1F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1390 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1391 movff RCREG1, opt_dive_mode ; RCREG1=0x20
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1392 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1393 movff RCREG1, char_I_deco_model ; RCREG1=0x21
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1394 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1395 movff RCREG1, char_I_ppO2_max ; RCREG1=0x22
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1396 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1397 movff RCREG1, char_I_ppO2_min ; RCREG1=0x23
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1398 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1399 movff RCREG1, char_I_extra_time ; RCREG1=0x24
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1400 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1401 movff RCREG1, opt_GF_low ; RCREG1=0x25
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1402 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1403 movff RCREG1, opt_GF_high ; RCREG1=0x26
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1404 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1405 movff RCREG1, opt_aGF_low ; RCREG1=0x27
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1406 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1407 movff RCREG1, opt_aGF_high ; RCREG1=0x28
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1408 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1409 movff RCREG1, opt_enable_aGF ; RCREG1=0x29
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1410 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1411 movff RCREG1, opt_sat_multiplier_non_gf ; RCREG1=0x2A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1412 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1413 movff RCREG1, opt_desat_multiplier_non_gf ; RCREG1=0x2B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1414 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1415 movff RCREG1, opt_last_stop ; RCREG1=0x2C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1416 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1417 movff RCREG1, opt_brightness ; RCREG1=0x2D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1418 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1419 movff RCREG1, opt_units ; RCREG1=0x2E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1420 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1421 movff RCREG1, opt_sampling_rate ; RCREG1=0x2F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1422 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1423 movff RCREG1, opt_salinity ; RCREG1=0x30
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1424 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1425 movff RCREG1, opt_dive_color_scheme ; RCREG1=0x31
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1426 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1427 movff RCREG1, opt_language ; RCREG1=0x32
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1428 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1429 movff RCREG1, opt_dateformat ; RCREG1=0x33
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1430 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1431 movff RCREG1, opt_compass_gain ; RCREG1=0x34
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1432 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1433 movff RCREG1, opt_pressure_adjust ; RCREG1=0x35
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1434 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1435 movff RCREG1, opt_enable_safetystop ; RCREG1=0x36
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1436 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1437 movff RCREG1, opt_calibration_O2_ratio; RCREG1=0x37
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1438 dcfsnz WREG
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1439 nop ; RCREG1=0x38 NOT USED ANYMORE (ex opt_sensor_fallback)
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1440 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1441 movff RCREG1, opt_flip_screen ; RCREG1=0x39
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1442 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1443 movff RCREG1, opt_cR_button_left ; RCREG1=0x3A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1444 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1445 movff RCREG1, opt_cR_button_right ; RCREG1=0x3B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1446 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1447 movff RCREG1, char_I_bottom_usage ; RCREG1=0x3C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1448 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1449 movff RCREG1, char_I_deco_usage ; RCREG1=0x3D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1450 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1451 movff RCREG1, opt_modwarning ; RCREG1=0x3E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1452 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1453 movff RCREG1, opt_vsitextv2 ; RCREG1=0x3F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1454 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1455 movff RCREG1, opt_vsigraph ; RCREG1=0x40
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1456 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1457 movff RCREG1, opt_showppo2 ; RCREG1=0x41
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1458 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1459 movff RCREG1, opt_temperature_adjust ; RCREG1=0x42
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1460 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1461 movff RCREG1, opt_safety_stop_length ; RCREG1=0x43
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1462 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1463 movff RCREG1, opt_safety_stop_start ; RCREG1=0x44
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1464 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1465 movff RCREG1, opt_safety_stop_end ; RCREG1=0x45
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1466 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1467 movff RCREG1, opt_safety_stop_reset ; RCREG1=0x46
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1468 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1469 nop ; RCREG1=0x47, ignore conservatism for standard hwOS
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1470 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1471 movff RCREG1, opt_diveTimeout ; RCREG1=0x48
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1472 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1473 bra comm_write_button_polarity ; RCREG1=0x49
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1474 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1475 movff RCREG1, char_I_PSCR_drop ; RCREG1=0x4A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1476 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1477 movff RCREG1, char_I_PSCR_lungratio ; RCREG1=0x4B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1478 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1479 movff RCREG1, char_I_ppO2_max_deco ; RCREG1=0x4C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1480 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1481 movff RCREG1, char_I_ppO2_min_loop ; RCREG1=0x4D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1482 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1483 movff RCREG1, char_I_tank_size+0 ; RCREG1=0x4E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1484 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1485 movff RCREG1, char_I_tank_size+1 ; RCREG1=0x4F
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1486 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1487 movff RCREG1, char_I_tank_size+2 ; RCREG1=0x50
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1488 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1489 movff RCREG1, char_I_tank_size+3 ; RCREG1=0x51
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1490 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1491 movff RCREG1, char_I_tank_size+4 ; RCREG1=0x52
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1492 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1493 movff RCREG1, char_I_tank_pres_fill+0 ; RCREG1=0x53
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1494 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1495 movff RCREG1, char_I_tank_pres_fill+1 ; RCREG1=0x54
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1496 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1497 movff RCREG1, char_I_tank_pres_fill+2 ; RCREG1=0x55
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1498 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1499 movff RCREG1, char_I_tank_pres_fill+3 ; RCREG1=0x56
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1500 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1501 movff RCREG1, char_I_tank_pres_fill+4 ; RCREG1=0x57
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1502 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1503 movff RCREG1, char_I_cc_max_frac_o2 ; RCREG1=0x58
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1504 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1505 movff RCREG1, opt_sim_setpoint_number ; RCREG1=0x59
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1506 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1507 movff RCREG1, opt_calc_asc_gasvolume ; RCREG1=0x5A
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1508 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1509 movff RCREG1, opt_sim_use_aGF ; RCREG1=0x5B
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1510 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1511 movff RCREG1, char_I_altitude_wait ; RCREG1=0x5C
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1512 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1513 movff RCREG1, opt_enable_IBCD ; RCREG1=0x5D
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1514 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1515 movff RCREG1, opt_sat_multiplier_gf ; RCREG1=0x5E
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1516 dcfsnz WREG
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1517 movff RCREG1, opt_desat_multiplier_gf ; RCREG1=0x5F
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1518 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1519 movff RCREG1, opt_transmitter_id_1+0 ; RCREG1=0x60
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1520 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1521 movff RCREG1, opt_transmitter_id_1+1 ; RCREG1=0x61
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1522 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1523 movff RCREG1, opt_transmitter_id_2+0 ; RCREG1=0x62
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1524 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1525 movff RCREG1, opt_transmitter_id_2+1 ; RCREG1=0x63
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1526 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1527 movff RCREG1, opt_transmitter_id_3+0 ; RCREG1=0x64
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1528 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1529 movff RCREG1, opt_transmitter_id_3+1 ; RCREG1=0x65
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1530 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1531 movff RCREG1, opt_transmitter_id_4+0 ; RCREG1=0x66
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1532 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1533 movff RCREG1, opt_transmitter_id_4+1 ; RCREG1=0x67
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1534 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1535 movff RCREG1, opt_transmitter_id_5+0 ; RCREG1=0x68
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1536 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1537 movff RCREG1, opt_transmitter_id_5+1 ; RCREG1=0x69
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1538 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1539 movff RCREG1, opt_transmitter_id_6+0 ; RCREG1=0x6A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1540 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1541 movff RCREG1, opt_transmitter_id_6+1 ; RCREG1=0x6B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1542 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1543 movff RCREG1, opt_transmitter_id_7+0 ; RCREG1=0x6C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1544 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1545 movff RCREG1, opt_transmitter_id_7+1 ; RCREG1=0x6D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1546 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1547 movff RCREG1, opt_transmitter_id_8+0 ; RCREG1=0x6E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1548 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1549 movff RCREG1, opt_transmitter_id_8+1 ; RCREG1=0x6F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1550 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1551 movff RCREG1, opt_transmitter_id_9+0 ; RCREG1=0x70
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1552 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1553 movff RCREG1, opt_transmitter_id_9+1 ; RCREG1=0x71
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1554 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1555 movff RCREG1, opt_transmitter_id_10+0 ; RCREG1=0x72
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1556 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1557 movff RCREG1, opt_transmitter_id_10+1 ; RCREG1=0x73
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1558 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1559 movff RCREG1, char_I_tank_size+5 ; RCREG1=0x74
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1560 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1561 movff RCREG1, char_I_tank_size+6 ; RCREG1=0x75
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1562 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1563 movff RCREG1, char_I_tank_size+7 ; RCREG1=0x76
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1564 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1565 movff RCREG1, char_I_tank_size+8 ; RCREG1=0x77
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1566 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1567 movff RCREG1, char_I_tank_size+9 ; RCREG1=0x78
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1568 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1569 movff RCREG1, char_I_tank_pres_fill+5 ; RCREG1=0x79
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1570 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1571 movff RCREG1, char_I_tank_pres_fill+6 ; RCREG1=0x7A
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1572 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1573 movff RCREG1, char_I_tank_pres_fill+7 ; RCREG1=0x7B
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1574 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1575 movff RCREG1, char_I_tank_pres_fill+8 ; RCREG1=0x7C
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1576 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1577 movff RCREG1, char_I_tank_pres_fill+9 ; RCREG1=0x7D
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1578 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1579 movff RCREG1, opt_TR_mode ; RCREG1=0x7E
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1580 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1581 movff RCREG1, opt_TR_1st_pres ; RCREG1=0x7F
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1582 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1583 movff RCREG1, opt_TR_2nd_pres ; RCREG1=0x80
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1584 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1585 movff RCREG1, opt_TR_Bail_pres ; RCREG1=0x81
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1586 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1587 movff RCREG1, char_I_max_pres_diff ; RCREG1=0x82
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1588 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1589 movff RCREG1, opt_ZfactorUse ; RCREG1=0x83
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1590 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1591 movff RCREG1, opt_ZfactorTemp ; RCREG1=0x84
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1592 dcfsnz WREG
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1593 movff RCREG1, opt_2ndDepthDisp ; RCREG1=0x85
562
8b7ea27ea1fa seperate desat and sat multipliers for GF and Non-GF modes. Set to 100/100 as default in GF mode
heinrichsweikamp
parents: 560
diff changeset
1594
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1595 comm_write_abort:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1596 comm_write_done:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1597 ; check options, gases and diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1598 call option_check_all ; check all options (and reset if not within their min/max boundaries)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1599 bsf FLAG_diluent_setup ; =1: setting up diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1600 call gaslist_cleanup_list ; take care that only one gas can be first and first has 0m change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1601 bcf FLAG_diluent_setup ; =1: Setting up diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1602 call gaslist_cleanup_list ; take care that only one gas can be first and first has 0m change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1603 call get_first_gas_to_WREG ; make sure at least one gas is "First"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1604 call get_first_dil_to_WREG ; make sure at least one diluent is "First"
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1605 goto comm_download_mode0 ; done, loop with timeout reset
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1606
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1607 ;-----------------------------------------------------------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1608
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1609 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1610 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1611 ; opt_gas_O2_ratio res 5 ; O2 ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1612 ; opt_dil_O2_ratio res 5 ; O2 ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1613 ; opt_gas_He_ratio res 5 ; He ratios of OC/bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1614 ; opt_dil_He_ratio res 5 ; He ratios of diluents
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1615 ; opt_gas_type res 5 ; OC/bailout gas type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1616 ; opt_dil_type res 5 ; dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1617 ; opt_gas_change res 5 ; change depths for OC/Bailout gases
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1618 ; opt_dil_change res 5 ; change depths for diluents
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1619
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1620 comm_write_gas_dil:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1621 lfsr FSR0,opt_gas_O2_ratio ; load base address of gas data arrays
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1622 movf up,W ; load index (0-9) of gas/dil into WREG, addressing O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1623 movff RCREG1,PLUSW0 ; receive O2 ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1624 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1625 addlw .10 ; increment index by 10, addressing He ratio now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1626 movff RCREG1,PLUSW0 ; receive He ratio
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1627 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1628 addlw .10 ; increment index by 10, addressing gas/dil type now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1629 movff RCREG1,PLUSW0 ; receive gas/dil type
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1630 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1631 addlw .10 ; increment index by 10, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1632 movff RCREG1,PLUSW0 ; receive change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1633 bra comm_write_done ; done, loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1634
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1635
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1636 ; Memory map is as follows:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1637 ; -------------------------
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1638 ; char_I_setpoint_cbar res 5 ; setpoints in cbar
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1639 ; char_I_setpoint_change res 5 ; change depth for the setpoints in meter
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1640
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1641 comm_write_sp:
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1642 lfsr FSR0,char_I_setpoint_cbar ; load base address of setpoint cbar values
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1643 movf up,W ; load index (0-4) of setpoint into WREG, addressing cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1644 movff RCREG1,PLUSW0 ; receive setpoint cbar value
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1645 rcall comm_get_byte ; wait for UART
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1646 addlw .5 ; increment index by 5, addressing change depth now
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1647 movff RCREG1,PLUSW0 ; receive change depth
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1648 bra comm_write_done ; done, loop with timeout reset
80
db920ca01491 new commands in download mode:
mh@mh-THINK.localdomain
parents: 79
diff changeset
1649
79
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1650 ;-----------------------------------------------------------------------------
0fc8113ddf6d new command in download mode: "r" - read setting
mh@mh-THINK.localdomain
parents: 69
diff changeset
1651
0
heinrichsweikamp
parents:
diff changeset
1652 comm_send_string:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1653 movlw "n" ; send echo
0
heinrichsweikamp
parents:
diff changeset
1654 movwf TXREG1
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1655 call comm_write_byte ; wait for UART
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1656 WIN_SMALL comm_string_column, comm_string_row
0
heinrichsweikamp
parents:
diff changeset
1657 movlw .16
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1658 movwf lo ; counter
0
heinrichsweikamp
parents:
diff changeset
1659 comm_send_string_loop:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1660 call comm_get_byte
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1661 btfsc rs232_receive_overflow ; got byte?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1662 bra comm_send_string_abort ; NO - abort!
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1663 movff RCREG1,POSTINC2 ; store character
0
heinrichsweikamp
parents:
diff changeset
1664 decfsz lo,F
heinrichsweikamp
parents:
diff changeset
1665 bra comm_send_string_loop
heinrichsweikamp
parents:
diff changeset
1666 comm_send_string_abort:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1667 STRCAT_PRINT "" ; show the text
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1668 goto comm_download_mode0 ; done, loop with timeout reset
0
heinrichsweikamp
parents:
diff changeset
1669
heinrichsweikamp
parents:
diff changeset
1670 ;-----------------------------------------------------------------------------
heinrichsweikamp
parents:
diff changeset
1671
heinrichsweikamp
parents:
diff changeset
1672 comm_check_day:
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1673 movff RCREG1,day
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1674 movff month,lo ; new month
0
heinrichsweikamp
parents:
diff changeset
1675 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1676 movlw .31
heinrichsweikamp
parents:
diff changeset
1677 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1678 movlw .28
heinrichsweikamp
parents:
diff changeset
1679 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1680 movlw .31
heinrichsweikamp
parents:
diff changeset
1681 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1682 movlw .30
heinrichsweikamp
parents:
diff changeset
1683 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1684 movlw .31
heinrichsweikamp
parents:
diff changeset
1685 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1686 movlw .30
heinrichsweikamp
parents:
diff changeset
1687 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1688 movlw .31
heinrichsweikamp
parents:
diff changeset
1689 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1690 movlw .31
heinrichsweikamp
parents:
diff changeset
1691 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1692 movlw .30
heinrichsweikamp
parents:
diff changeset
1693 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1694 movlw .31
heinrichsweikamp
parents:
diff changeset
1695 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1696 movlw .30
heinrichsweikamp
parents:
diff changeset
1697 dcfsnz lo,F
heinrichsweikamp
parents:
diff changeset
1698 movlw .31
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1699 cpfsgt day ; day ok?
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1700 return ; YES
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1701 movlw .1 ; NO - set to 1st
0
heinrichsweikamp
parents:
diff changeset
1702 movwf day
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1703 return
0
heinrichsweikamp
parents:
diff changeset
1704
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1705 comm_write_button_polarity:
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1706 ; store RCREG1 into EEPROM .897
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1707 movlw LOW .897
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1708 movwf EEADR
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1709 movlw HIGH .897
475
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1710 movwf EEADRH
237afdfb4918 2.12 release candidate...
heinrichsweikamp
parents: 464
diff changeset
1711 movff RCREG1,EEDATA
604
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1712 movff EEDATA,button_polarity ; 0xFF (both normal), 0x00 (both inverted), 0x01 (left inverted only), 0x02 (right inverted only)
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1713 call write_eeprom ; EEDATA into EEPROM@EEADR
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1714 clrf EEADRH ; reset EEADRH
ca4556fb60b9 bump to 2.99beta, work on 3.00 stable
heinrichsweikamp
parents: 593
diff changeset
1715 goto comm_download_mode0 ; done, loop with timeout reset
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1716
0
heinrichsweikamp
parents:
diff changeset
1717 ;----------------------------------------------------------------------------
582
b455b31ce022 work on 2.97 stable
heinrichsweikamp
parents: 562
diff changeset
1718 END