diff code_part1/OSTC_code_asm_part1/eeprom_rs232.asm @ 283:4ec488f046f4

Battery sign color coded, work on new uart-started 115200Baud bootloader (Do NOT use yet!)
author heinrichsweikamp
date Tue, 19 Apr 2011 19:31:16 +0200
parents c97c5514b165
children 908d0013727e
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Tue Apr 19 13:03:01 2011 +0200
+++ b/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Tue Apr 19 19:31:16 2011 +0200
@@ -197,4 +197,39 @@
 	bcf		RCSTA,CREN		; Clear receiver status
 	bsf		RCSTA,CREN
 	bsf		rs232_recieve_overflow		; set flag
-	return				; and return anyway
\ No newline at end of file
+	return				; and return anyway
+
+uart_115k_bootloader:
+	bcf		PIE1,RCIE				; disable interrupt for RS232
+	bcf		RCSTA,CREN				; Clear receiver status
+	bsf		RCSTA,CREN
+	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'
+	WAITMS	d'250'
+	WAITMS	d'50'
+	btfss	PIR1,RCIF				; New byte in UART?
+	bra		uart_115k_bootloader2	; No, Abort	
+	movlw	0xC1
+	cpfseq	RCREG					; 115200Baud Bootloader request?
+	bra		uart_115k_bootloader2	; No, Abort	
+	DISPLAYTEXTH	d'303'			; Yes, "Please wait!"
+	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