comparison code_part1/OSTC_code_asm_part1/eeprom_rs232.asm @ 284:908d0013727e

115200 baud bootloader tested and debugged
author heinrichsweikamp
date Tue, 19 Apr 2011 21:48:34 +0200
parents 4ec488f046f4
children 86fc79735d3b
comparison
equal deleted inserted replaced
283:4ec488f046f4 284:908d0013727e
199 bsf rs232_recieve_overflow ; set flag 199 bsf rs232_recieve_overflow ; set flag
200 return ; and return anyway 200 return ; and return anyway
201 201
202 uart_115k_bootloader: 202 uart_115k_bootloader:
203 bcf PIE1,RCIE ; disable interrupt for RS232 203 bcf PIE1,RCIE ; disable interrupt for RS232
204 bcf RCSTA,CREN ; Clear receiver status 204 ; bcf PIR1,RCIF ; clear flag
205 bsf RCSTA,CREN
206 bcf PIR1,RCIF ; clear flag
207 call PLED_ClearScreen ; Clear screen 205 call PLED_ClearScreen ; Clear screen
208 movlw color_red 206 movlw color_red
209 call PLED_set_color ; Set to Red 207 call PLED_set_color ; Set to Red
210 DISPLAYTEXTH d'302' ; Bootloader 208 DISPLAYTEXTH d'302' ; Bootloader
209 movlw d'4' ; one second
210 movwf uart1_temp
211 uart_115k_bootloader0:
212 btfsc PIR1,RCIF ; New byte in UART?
213 bra uart_115k_bootloader1 ; Yes, Check if 0xC1
211 WAITMS d'250' 214 WAITMS d'250'
215 decfsz uart1_temp,F
216 bra uart_115k_bootloader0
217 uart_115k_bootloader2:
218 DISPLAYTEXTH d'304' ; Aborted!
219 movlw d'8' ; Two seconds
220 movwf uart1_temp
221 uart_115k_bootloader3:
212 WAITMS d'250' 222 WAITMS d'250'
213 WAITMS d'50' 223 decfsz uart1_temp,F
214 btfss PIR1,RCIF ; New byte in UART? 224 bra uart_115k_bootloader3
215 bra uart_115k_bootloader2 ; No, Abort 225 goto restart
226
227 uart_115k_bootloader1:
216 movlw 0xC1 228 movlw 0xC1
217 cpfseq RCREG ; 115200Baud Bootloader request? 229 cpfseq RCREG ; 115200Baud Bootloader request?
218 bra uart_115k_bootloader2 ; No, Abort 230 bra uart_115k_bootloader2 ; No, Abort
219 DISPLAYTEXTH d'303' ; Yes, "Please wait!" 231 DISPLAYTEXTH d'303' ; Yes, "Please wait!"
220 clrf INTCON ; Interrupts disabled 232 clrf INTCON ; Interrupts disabled
221 bcf PIR1,RCIF ; clear flag 233 bcf PIR1,RCIF ; clear flag
222 goto 0x17F56 ; Enter straight into bootloader. Good luck! 234 goto 0x17F56 ; Enter straight into bootloader. Good luck!
223 uart_115k_bootloader2:
224 DISPLAYTEXTH d'304' ; Aborted!
225 WAITMS d'250'
226 WAITMS d'250'
227 WAITMS d'250'
228 WAITMS d'250'
229 WAITMS d'250'
230 WAITMS d'250'
231 WAITMS d'250'
232 WAITMS d'250'
233 goto restart
234
235