comparison code_part1/OSTC_code_asm_part1/start.asm @ 306:ab1678d98e46

some changes for cf defaults
author heinrichsweikamp
date Sat, 30 Apr 2011 20:54:23 +0200
parents 1efd59d689f8
children 122324dafba7
comparison
equal deleted inserted replaced
305:77c70898c7aa 306:ab1678d98e46
26 movlb b'00000001' ; ram bank 1 selected 26 movlb b'00000001' ; ram bank 1 selected
27 movff STKPTR,temp10 27 movff STKPTR,temp10
28 clrf temp10+1 28 clrf temp10+1
29 29
30 call init 30 call init
31
32 read_int_eeprom d'92' ; Read number of CF used in this firmware
33 movlw 0xFF ; First start value
34 cpfseq EEDATA ; Compare
35 bra start2 ; Normal power-on/hard reset boot
36 bra first_start ; Reset and jump to surfmode
37 start2:
31 btfsc divemode ; Reset from Divemode? 38 btfsc divemode ; Reset from Divemode?
32 call PLED_resetdebugger ; Yes! Something went wrong, show reset informations 39 call PLED_resetdebugger ; Yes! Something went wrong, show reset informations
33 40 start3:
34 clrf STKPTR ; Clear Stackpointer 41 clrf STKPTR ; Clear Stackpointer
35 lfsr FSR0, 10Bh ; Clear rambank 1-9, do not delete RTC registers 42 lfsr FSR0, 10Bh ; Clear rambank 1-9, do not delete RTC registers
36 clear_rambank: 43 clear_rambank:
37 clrf POSTINC0 44 clrf POSTINC0
38 movlw 0x0A 45 movlw 0x0A
128 incf EEADR,F ; set to 0x102 135 incf EEADR,F ; set to 0x102
129 movlw softwareversion_y 136 movlw softwareversion_y
130 movwf EEDATA 137 movwf EEDATA
131 call write_eeprom ; write version y 138 call write_eeprom ; write version y
132 clrf EEADRH ; Reset EEADRH 139 clrf EEADRH ; Reset EEADRH
133 ; goto reset_all_cf ; resets all custom functions bank0 and bank1 and jumps to "restart" 140 goto reset_all_cf ; resets all custom functions bank0 and bank1 and jumps to "restart"
134 ; goto reset_all_cf_bank1 ; resets all custom functions bank1 and jumps to "restart" 141 ; goto reset_all_cf_bank1 ; resets all custom functions bank1 and jumps to "restart"
135 142
136 restart: 143 restart:
137 bcf LED_red 144 bcf LED_red
138 bcf LED_blue ; all LEDs off 145 bcf LED_blue ; all LEDs off
348 return 355 return
349 btfsc switch_right ; Ack? 356 btfsc switch_right ; Ack?
350 return 357 return
351 bra screen3_loop ; loop screen 358 bra screen3_loop ; loop screen
352 359
360 first_start:
361 movlw max_custom_number ; Defined in definitions.asm
362 movwf EEDATA
363 write_int_eeprom d'92' ; Store number of CF used in this firmware
364 bra start3 ; continue with normal start
365
353 init: 366 init:
354 movlw b'01101100' ; 4MHz (x4 PLL) 367 movlw b'01101100' ; 4MHz (x4 PLL)
355 movwf OSCCON 368 movwf OSCCON
356 369
357 movlw b'00010001' ; I/O Ports 370 movlw b'00010001' ; I/O Ports