comparison code_part1/OSTC_code_asm_part1/interface.asm @ 21:73014f788032

1.60 stable rc1
author heinrichsweikamp
date Wed, 21 Apr 2010 17:37:30 +0200
parents 96a35aeda5f2
children 14a074e1a375
comparison
equal deleted inserted replaced
20:8824446f7241 21:73014f788032
24 ; ToDo: 24 ; ToDo:
25 25
26 uart_store_tissues: 26 uart_store_tissues:
27 bcf uart_store_tissue_data ; Clear flag 27 bcf uart_store_tissue_data ; Clear flag
28 bcf PIE1,RCIE ; No Interrupt for UART 28 bcf PIE1,RCIE ; No Interrupt for UART
29 call set_LEDusb 29 bsf LED_blue
30 call simulator_save_tissue_data ; store and set flag for automatic restore 30 call simulator_save_tissue_data ; store and set flag for automatic restore
31 movlw 'k' ; send echo 31 movlw 'k' ; send echo
32 movwf TXREG ; When done 32 movwf TXREG ; When done
33 call rs232_wait_tx ; wait for UART 33 call rs232_wait_tx ; wait for UART
34 call clear_LEDusb 34 bcf LED_blue
35 bsf PIE1,RCIE ; Interrupt for RS232 35 bsf PIE1,RCIE ; Interrupt for RS232
36 goto surfloop_loop ; return to surface loop 36 goto surfloop_loop ; return to surface loop
37 37
38 ; reset Decodata 38 ; reset Decodata
39 reset_decodata: 39 reset_decodata:
40 bcf uart_reset_decodata ; clear flag 40 bcf uart_reset_decodata ; clear flag
41 bcf PIE1,RCIE ; No Interrupt for UART 41 bcf PIE1,RCIE ; No Interrupt for UART
42 call set_LEDusb 42 bsf LED_blue
43 43
44 call deco_main_clear_tissue ; Reset Decodata 44 call deco_main_clear_tissue ; Reset Decodata
45 movlb b'00000001' ; select ram bank 1 45 movlb b'00000001' ; select ram bank 1
46 call deco_main_calc_desaturation_time ; calculate desaturation time 46 call deco_main_calc_desaturation_time ; calculate desaturation time
47 movlb b'00000001' ; select ram bank 1 47 movlb b'00000001' ; select ram bank 1
55 movlw 'h' ; send echo 55 movlw 'h' ; send echo
56 movwf TXREG ; When done 56 movwf TXREG ; When done
57 call rs232_wait_tx ; wait for UART 57 call rs232_wait_tx ; wait for UART
58 58
59 bsf oneminupdate ; set flag, so display will be updated at once 59 bsf oneminupdate ; set flag, so display will be updated at once
60 call clear_LEDusb 60 bcf LED_blue
61 bsf PIE1,RCIE ; Interrupt for RS232 61 bsf PIE1,RCIE ; Interrupt for RS232
62 goto surfloop_loop ; return to surface loop 62 goto surfloop_loop ; return to surface loop
63 63
64 ; send internal EEPROM BANK 0 via the UART 64 ; send internal EEPROM BANK 0 via the UART
65 send_int_eeprom_b0: 65 send_int_eeprom_b0:
66 bcf uart_send_int_eeprom ; clear flag 66 bcf uart_send_int_eeprom ; clear flag
67 bcf PIE1,RCIE ; No Interrupt for UART 67 bcf PIE1,RCIE ; No Interrupt for UART
68 call set_LEDusb 68 bsf LED_blue
69 69
70 clrf EEADRH ; Point to Bank0 70 clrf EEADRH ; Point to Bank0
71 rcall send_internal_eeprom1 ; sends complete 1st. page of internal EEPROM 71 rcall send_internal_eeprom1 ; sends complete 1st. page of internal EEPROM
72 72
73 call clear_LEDusb 73 bcf LED_blue
74 bsf PIE1,RCIE ; Interrupt for RS232 74 bsf PIE1,RCIE ; Interrupt for RS232
75 goto surfloop_loop ; return to surface loop 75 goto surfloop_loop ; return to surface loop
76 76
77 ; send internal EEPROM BANK 1 via the UART 77 ; send internal EEPROM BANK 1 via the UART
78 send_int_eeprom_b1: 78 send_int_eeprom_b1:
79 bcf uart_send_int_eeprom2 ; clear flag 79 bcf uart_send_int_eeprom2 ; clear flag
80 bcf PIE1,RCIE ; No Interrupt for UART 80 bcf PIE1,RCIE ; No Interrupt for UART
81 call set_LEDusb 81 bsf LED_blue
82
82 83
83 movlw d'1' 84 movlw d'1'
84 movwf EEADRH ; Point to Bank1 85 movwf EEADRH ; Point to Bank1
85 rcall send_internal_eeprom1 ; sends complete 2nd page of internal EEPROM 86 rcall send_internal_eeprom1 ; sends complete 2nd page of internal EEPROM
86 clrf EEADRH ; Point to Bank0 87 clrf EEADRH ; Point to Bank0
87 88
88 call clear_LEDusb 89 bcf LED_blue
89 bsf PIE1,RCIE ; Interrupt for RS232 90 bsf PIE1,RCIE ; Interrupt for RS232
90 goto surfloop_loop ; return to surface loop 91 goto surfloop_loop ; return to surface loop
91 92
92 93
93 ; Send firmware version and 16bytes MD2 hash via the UART 94 ; Send firmware version and 16bytes MD2 hash via the UART
94 send_md2_hash: 95 send_md2_hash:
95 bcf uart_send_hash ; clear flag 96 bcf uart_send_hash ; clear flag
96 bcf PIE1,RCIE ; No Interrupt for UART 97 bcf PIE1,RCIE ; No Interrupt for UART
97 call set_LEDusb 98 bsf LED_blue
98 99
99 call rs232_wait_tx ; wait for UART 100 call rs232_wait_tx ; wait for UART
100 movlw softwareversion_x ; Softwareversion 101 movlw softwareversion_x ; Softwareversion
101 movwf TXREG 102 movwf TXREG
102 call rs232_wait_tx ; wait for UART 103 call rs232_wait_tx ; wait for UART
110 call rs232_wait_tx ; wait for UART 111 call rs232_wait_tx ; wait for UART
111 movff POSTINC2,TXREG ; copy hash byte to TXREG 112 movff POSTINC2,TXREG ; copy hash byte to TXREG
112 decfsz temp1,F 113 decfsz temp1,F
113 bra send_md2_hash2 ; loop 16 times 114 bra send_md2_hash2 ; loop 16 times
114 115
115 call clear_LEDusb 116 bcf LED_blue
116 bsf PIE1,RCIE ; Interrupt for RS232 117 bsf PIE1,RCIE ; Interrupt for RS232
117 goto surfloop_loop ; return to surface loop 118 goto surfloop_loop ; return to surface loop
118 119
119 120
120 ; Sends first 256Byte from internal and first 32KB from external EEPROM using the UART module 121 ; Sends first 256Byte from internal and first 32KB from external EEPROM using the UART module
121 menu_interface: 122 menu_interface:
122 bcf dump_external_eeprom ; clear flag 123 bcf dump_external_eeprom ; clear flag
123 bcf PIE1,RCIE ; No Interrupt for UART 124 bcf PIE1,RCIE ; No Interrupt for UART
124 call set_LEDusb 125 bsf LED_blue
125 call PLED_ClearScreen 126 call PLED_ClearScreen
126 call PLED_topline_box 127 call PLED_topline_box
127 WIN_INVERT .1 ; Init new Wordprocessor 128 WIN_INVERT .1 ; Init new Wordprocessor
128 DISPLAYTEXT .15 ; "Interface" 129 DISPLAYTEXT .15 ; "Interface"
129 WIN_INVERT .0 ; Init new Wordprocessor 130 WIN_INVERT .0 ; Init new Wordprocessor
221 call WaitMSSP 222 call WaitMSSP
222 223
223 DISPLAYTEXT .20 ; Done. 224 DISPLAYTEXT .20 ; Done.
224 225
225 WAITMS d'250' 226 WAITMS d'250'
226 call clear_LEDusb 227 bcf LED_blue
227 bsf PIE1,RCIE ; Interrupt for RS232 228 bsf PIE1,RCIE ; Interrupt for RS232
228 goto surfloop ; back to surfacemode 229 goto surfloop ; back to surfacemode
229 230
230 send_internal_eeprom1: 231 send_internal_eeprom1:
231 clrf uart1_temp ; Send the total of 256bytes 232 clrf uart1_temp ; Send the total of 256bytes