# HG changeset patch # User heinrichsweikamp # Date 1303242514 -7200 # Node ID 908d0013727e0cd51116accc303c71ff316bc90e # Parent 4ec488f046f437f00ad71afce711a28f2b096f3d 115200 baud bootloader tested and debugged diff -r 4ec488f046f4 -r 908d0013727e code_part1/OSTC_code_asm_part1/eeprom_rs232.asm --- a/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm Tue Apr 19 19:31:16 2011 +0200 +++ b/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm Tue Apr 19 21:48:34 2011 +0200 @@ -201,18 +201,30 @@ uart_115k_bootloader: bcf PIE1,RCIE ; disable interrupt for RS232 - bcf RCSTA,CREN ; Clear receiver status - bsf RCSTA,CREN - bcf PIR1,RCIF ; clear flag +; bcf PIR1,RCIF ; clear flag call PLED_ClearScreen ; Clear screen movlw color_red call PLED_set_color ; Set to Red DISPLAYTEXTH d'302' ; Bootloader - WAITMS d'250' + movlw d'4' ; one second + movwf uart1_temp +uart_115k_bootloader0: + btfsc PIR1,RCIF ; New byte in UART? + bra uart_115k_bootloader1 ; Yes, Check if 0xC1 WAITMS d'250' - WAITMS d'50' - btfss PIR1,RCIF ; New byte in UART? - bra uart_115k_bootloader2 ; No, Abort + decfsz uart1_temp,F + bra uart_115k_bootloader0 +uart_115k_bootloader2: + DISPLAYTEXTH d'304' ; Aborted! + movlw d'8' ; Two seconds + movwf uart1_temp +uart_115k_bootloader3: + WAITMS d'250' + decfsz uart1_temp,F + bra uart_115k_bootloader3 + goto restart + +uart_115k_bootloader1: movlw 0xC1 cpfseq RCREG ; 115200Baud Bootloader request? bra uart_115k_bootloader2 ; No, Abort @@ -220,16 +232,3 @@ clrf INTCON ; Interrupts disabled bcf PIR1,RCIF ; clear flag goto 0x17F56 ; Enter straight into bootloader. Good luck! -uart_115k_bootloader2: - DISPLAYTEXTH d'304' ; Aborted! - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - goto restart - - \ No newline at end of file