Mercurial > public > mk2
comparison code_part1/OSTC_code_asm_part1/start.asm @ 720:4452837aff37
Vault date and time during update
author | heinrichsweikamp |
---|---|
date | Sun, 26 May 2013 11:58:56 +0200 |
parents | b7f7184d800d |
children | ae641bcb0d02 |
comparison
equal
deleted
inserted
replaced
719:ad5ab9910820 | 720:4452837aff37 |
---|---|
161 movwf EEDATA | 161 movwf EEDATA |
162 call write_eeprom ; write byte | 162 call write_eeprom ; write byte |
163 clrf EEADRH ; Reset EEADRH | 163 clrf EEADRH ; Reset EEADRH |
164 | 164 |
165 restart: | 165 restart: |
166 ; check for time/date vault | |
167 movlw .1 | |
168 movwf EEADRH | |
169 read_int_eeprom .5 | |
170 movlw 0xAA | |
171 cpfseq EEDATA ; 0xAA in EEPROM Bank1, Byte 5? | |
172 bra restart0 ; No | |
173 | |
174 movlw 0x00 | |
175 movwf EEDATA | |
176 write_int_eeprom d'5' ; clear flag | |
177 read_int_eeprom .6 | |
178 movff EEDATA,year | |
179 read_int_eeprom .7 | |
180 movff EEDATA,month | |
181 read_int_eeprom .8 | |
182 movff EEDATA,day | |
183 read_int_eeprom .9 | |
184 movff EEDATA,hours | |
185 read_int_eeprom .10 | |
186 movff EEDATA,mins | |
187 read_int_eeprom .11 | |
188 movff EEDATA,secs | |
189 call RTCinit ; Check limits | |
190 restart0: | |
191 clrf EEADRH | |
166 movlw b'00000011' | 192 movlw b'00000011' |
167 movwf T3CON ; Timer3 with 32768Hz clock running | 193 movwf T3CON ; Timer3 with 32768Hz clock running |
168 clrf TMR3L | 194 clrf TMR3L |
169 nop | 195 nop |
170 clrf TMR3H | 196 clrf TMR3H |