comparison code_part1/OSTC_code_asm_part1/interface.asm @ 578:fbd5e2b75a63

adding access to CF64-CF95
author heinrichsweikamp
date Tue, 24 Apr 2012 08:39:43 +0200
parents c512a868937c
children 6e456a6398e0
comparison
equal deleted inserted replaced
577:e3ffc6d62a63 578:fbd5e2b75a63
61 goto surfloop_loop ; return to surface loop 61 goto surfloop_loop ; return to surface loop
62 62
63 ; send internal EEPROM BANK 0 via the UART 63 ; send internal EEPROM BANK 0 via the UART
64 send_int_eeprom_b0: 64 send_int_eeprom_b0:
65 bcf uart_send_int_eeprom ; clear flag 65 bcf uart_send_int_eeprom ; clear flag
66 bcf PIE1,RCIE ; No Interrupt for UART 66 movlw .0 ; Point to Bank0
67 bsf LED_blue 67 rcall send_internal_eeprom1 ; sends complete 1st. page of internal EEPROM
68
69 clrf EEADRH ; Point to Bank0
70 rcall send_internal_eeprom1 ; sends complete 1st. page of internal EEPROM
71
72 bcf LED_blue
73 bsf PIE1,RCIE ; Interrupt for RS232
74 goto surfloop_loop ; return to surface loop 68 goto surfloop_loop ; return to surface loop
75 69
76 ; send internal EEPROM BANK 1 via the UART 70 ; send internal EEPROM BANK 1 via the UART
77 send_int_eeprom_b1: 71 send_int_eeprom_b1:
78 bcf uart_send_int_eeprom2 ; clear flag 72 bcf uart_send_int_eeprom2 ; clear flag
79 bcf PIE1,RCIE ; No Interrupt for UART
80 bsf LED_blue
81
82
83 movlw d'1' 73 movlw d'1'
84 movwf EEADRH ; Point to Bank1 74 movwf EEADRH ; Point to Bank1
85 rcall send_internal_eeprom1 ; sends complete 2nd page of internal EEPROM 75 rcall send_internal_eeprom1 ; sends complete 2nd page of internal EEPROM
86 clrf EEADRH ; Point to Bank0 76 goto surfloop_loop ; return to surface loop
87 77
88 bcf LED_blue 78 ; send internal EEPROM BANK 2 via the UART
89 bsf PIE1,RCIE ; Interrupt for RS232 79 send_int_eeprom_b2:
80 bcf uart_send_int_eeprom3 ; clear flag
81 movlw d'2'
82 movwf EEADRH ; Point to Bank1
83 rcall send_internal_eeprom1 ; sends complete 2nd page of internal EEPROM
90 goto surfloop_loop ; return to surface loop 84 goto surfloop_loop ; return to surface loop
91 85
92 86
93 ; Send firmware version and 16bytes MD2 hash via the UART 87 ; Send firmware version and 16bytes MD2 hash via the UART
94 send_md2_hash: 88 send_md2_hash:
152 ;clrf eeprom_address+0,F 146 ;clrf eeprom_address+0,F
153 ;clrf eeprom_address+1,F 147 ;clrf eeprom_address+1,F
154 148
155 DISPLAYTEXT .17 ; "Data" 149 DISPLAYTEXT .17 ; "Data"
156 150
151 movlw .0 ; Point to Bank0
157 rcall send_internal_eeprom1 ; sends complete 1st. page of internal EEPROM 152 rcall send_internal_eeprom1 ; sends complete 1st. page of internal EEPROM
153 bsf LED_blue
158 154
159 call rs232_wait_tx ; wait for UART 155 call rs232_wait_tx ; wait for UART
160 movff batt_voltage+0,TXREG ; Battery 156 movff batt_voltage+0,TXREG ; Battery
161 157
162 call rs232_wait_tx ; wait for UART 158 call rs232_wait_tx ; wait for UART
230 bcf LED_blue 226 bcf LED_blue
231 bsf PIE1,RCIE ; Interrupt for RS232 227 bsf PIE1,RCIE ; Interrupt for RS232
232 goto surfloop ; back to surfacemode 228 goto surfloop ; back to surfacemode
233 229
234 send_internal_eeprom1: 230 send_internal_eeprom1:
231 movwf EEADRH ; Point to Bank "WREG"
232 bcf PIE1,RCIE ; No Interrupt for UART
233 bsf LED_blue
235 clrf uart1_temp ; Send the total of 256bytes 234 clrf uart1_temp ; Send the total of 256bytes
236 clrf EEADR ; Send bytes 0-255 from internal EEPROM 235 clrf EEADR ; Send bytes 0-255 from internal EEPROM
237 send_internal_eeprom2: 236 send_internal_eeprom2:
238 call read_eeprom ; read byte 237 call read_eeprom ; read byte
239 movff EEDATA,TXREG ; send byte 238 movff EEDATA,TXREG ; send byte
240 incf EEADR,F ; increase pointer 239 incf EEADR,F ; increase pointer
241 call rs232_wait_tx ; wait for UART 240 call rs232_wait_tx ; wait for UART
242 decfsz uart1_temp,F ; until limit reached 241 decfsz uart1_temp,F ; until limit reached
243 bra send_internal_eeprom2 242 bra send_internal_eeprom2
243 clrf EEADRH ; Point to Bank0
244 bcf LED_blue
245 bsf PIE1,RCIE ; Interrupt for RS232
244 return 246 return