changeset 578:fbd5e2b75a63

adding access to CF64-CF95
author heinrichsweikamp
date Tue, 24 Apr 2012 08:39:43 +0200
parents e3ffc6d62a63
children fff1d38625f0
files code_part1/OSTC_code_asm_part1/definitions.asm code_part1/OSTC_code_asm_part1/eeprom_rs232.asm code_part1/OSTC_code_asm_part1/interface.asm code_part1/OSTC_code_asm_part1/isr.asm code_part1/OSTC_code_asm_part1/menu.asm code_part1/OSTC_code_asm_part1/start.asm code_part1/OSTC_code_asm_part1/surfmode.asm docu/ostc_interface_description.odt
diffstat 8 files changed, 48 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/definitions.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/definitions.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -444,7 +444,7 @@
 #DEFINE	menubit2			flag3,0	; menu
 #DEFINE	menubit3			flag3,1	; menu
 #DEFINE	set_minutes			flag3,2	; set minutes (not hours)
-;#DEFINE unused				flag3,3	;
+#DEFINE internal_eeprom_write3 flag3,3 ;=1: start routine to access internal EEPROM BANK 2 via the UART
 #DEFINE	menubit4			flag3,4	; quit set time 
 #DEFINE	display_velocity	flag3,5	; velocity is displayed
 #DEFINE	temp_changed		flag3,6	; temperature changed
@@ -530,7 +530,7 @@
 #DEFINE	neg_flag_isr			flag12,3	;=1: ISR Negative flag (Math)
 #DEFINE	select_bailoutgas		flag12,4	;=1: Select Bailout instead of Setpoint in Gaslist
 #DEFINE	FLAG_apnoe_mode			flag12,5	;=1: Apnoe mode selected
-;#DEFINE	unused		flag12,6	;=1: 
+#DEFINE	uart_send_int_eeprom3	flag12,6	;=1: Send internal EEPROM BANK 2
 #DEFINE	uart_send_int_eeprom2	flag12,7	;=1: Send internal EEPROM BANK 1
 
 #DEFINE	internal_eeprom_write2	flag13,0	;=1: start routine to access internal EEPROM BANK 1 via the UART
--- a/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/eeprom_rs232.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -40,21 +40,27 @@
 	movwf	EEADR
 	bra		read_eeprom					; reads and "returns" after write
 
+internal_eeprom_access_b2:				; accesses internal EEPROM BANK 2 via the UART
+	bcf		internal_eeprom_write3		; clear flag!
+	movlw	d'2'
+	movwf	EEADRH						;BANK1
+	movlw	"n"
+	bra		internal_eeprom_access1		; Continue with common routines
+
 internal_eeprom_access_b1:				; accesses internal EEPROM BANK 1 via the UART
 	bcf		internal_eeprom_write2		; clear flag!
 	movlw	d'1'
 	movwf	EEADRH						;BANK1
 	movlw	"i"
-	bra		internal_eeprom_access1		; Continue with bank1 and bank0 common routines
+	bra		internal_eeprom_access1		; Continue with common routines
 
 internal_eeprom_access_b0:				; accesses internal EEPROM BANK 0 via the UART
 	bcf		internal_eeprom_write		; clear flag!
 	clrf	EEADRH						; Bank0
 	movlw	"d"
-;	bra		internal_eeprom_access1		; Continue with bank1 and bank0 common routines
-
+;	bra		internal_eeprom_access1		; Continue with common routines
 internal_eeprom_access1:
-	movwf	TXREG						; Send command echo ("i" or "d")
+	movwf	TXREG						; Send command echo ("i", "d" or "n")
 	bsf		no_sensor_int				; No Sensor Interrupt
 	movlw	d'4'
 	movwf	EEADR
--- a/code_part1/OSTC_code_asm_part1/interface.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/interface.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -63,30 +63,24 @@
 ; send internal EEPROM BANK 0 via the UART
 send_int_eeprom_b0:
 	bcf			uart_send_int_eeprom	; clear flag
-	bcf			PIE1,RCIE				; No Interrupt for UART
-	bsf			LED_blue
-	
-	clrf		EEADRH						; Point to Bank0
-	rcall		send_internal_eeprom1		; sends complete 1st. page of internal EEPROM
-
-	bcf			LED_blue
-	bsf			PIE1,RCIE				; Interrupt for RS232
+	movlw		.0						; Point to Bank0
+	rcall		send_internal_eeprom1	; sends complete 1st. page of internal EEPROM
 	goto		surfloop_loop			; return to surface loop
 
 ; send internal EEPROM BANK 1 via the UART
 send_int_eeprom_b1:
 	bcf			uart_send_int_eeprom2	; clear flag
-	bcf			PIE1,RCIE				; No Interrupt for UART
-	bsf			LED_blue
-
+	movlw		d'1'
+	movwf		EEADRH					; Point to Bank1
+	rcall		send_internal_eeprom1	; sends complete 2nd page of internal EEPROM
+	goto		surfloop_loop			; return to surface loop
 
-	movlw		d'1'
-	movwf		EEADRH						; Point to Bank1
-	rcall		send_internal_eeprom1		; sends complete 2nd page of internal EEPROM
-	clrf		EEADRH						; Point to Bank0
-
-	bcf			LED_blue
-	bsf			PIE1,RCIE				; Interrupt for RS232
+; send internal EEPROM BANK 2 via the UART
+send_int_eeprom_b2:
+	bcf			uart_send_int_eeprom3	; clear flag
+	movlw		d'2'
+	movwf		EEADRH					; Point to Bank1
+	rcall		send_internal_eeprom1	; sends complete 2nd page of internal EEPROM
 	goto		surfloop_loop			; return to surface loop
 
 
@@ -154,7 +148,9 @@
 
 	DISPLAYTEXT	.17						; "Data"
 
+	movlw		.0							; Point to Bank0
 	rcall		send_internal_eeprom1		; sends complete 1st. page of internal EEPROM
+	bsf			LED_blue
 
 	call		rs232_wait_tx				; wait for UART
 	movff		batt_voltage+0,TXREG			; Battery
@@ -232,6 +228,9 @@
 	goto		surfloop					; back to surfacemode
 
 send_internal_eeprom1:
+	movwf		EEADRH						; Point to Bank "WREG"
+	bcf			PIE1,RCIE					; No Interrupt for UART
+	bsf			LED_blue
 	clrf		uart1_temp					; Send the total of 256bytes
 	clrf		EEADR						; Send bytes 0-255 from internal EEPROM
 send_internal_eeprom2:
@@ -241,4 +240,7 @@
 	call		rs232_wait_tx				; wait for UART
 	decfsz		uart1_temp,F				; until limit reached
 	bra			send_internal_eeprom2
+	clrf		EEADRH						; Point to Bank0
+	bcf			LED_blue
+	bsf			PIE1,RCIE				; Interrupt for RS232
 	return
\ No newline at end of file
--- a/code_part1/OSTC_code_asm_part1/isr.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/isr.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -79,7 +79,10 @@
 		bsf		uart_store_tissue_data		; set flag
 		dcfsnz	uart1_temp,F				; "l"
 		bsf		uart_dump_screen            ; set flag
-	
+		dcfsnz	uart1_temp,F				; "m"	
+		bsf		uart_send_int_eeprom3		; set flag
+		dcfsnz	uart1_temp,F				; "n"	
+		bsf		internal_eeprom_write3		; set flag
 		movlw	0xC1
 		cpfseq	RCREG						; 115200Baud Bootloader request?
 		bra		uartint1					; No
--- a/code_part1/OSTC_code_asm_part1/menu.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/menu.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -431,9 +431,9 @@
 	return
 
 toggle_brightness:
-	movlw	LOW		0x104
+	movlw	LOW		0x103
 	movwf	EEADR
-	movlw	HIGH 	0x104
+	movlw	HIGH 	0x103
 	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
 	call	read_eeprom				; read byte
 	bcf		oled_brightness_high	; Eco mode
@@ -449,9 +449,9 @@
 	call	PLED_brightness_full	; Set OLED
 
 	; ...and write it again to EEPROM
-	movlw	LOW		0x104
+	movlw	LOW		0x103
 	movwf	EEADR
-	movlw	HIGH 	0x104
+	movlw	HIGH 	0x103
 	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
 	movlw	.0
 	btfsc	oled_brightness_high
--- a/code_part1/OSTC_code_asm_part1/start.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/start.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -152,9 +152,9 @@
 
 ; After update resets
 	; Reset brightness to ECO
-	movlw	LOW		0x104
+	movlw	LOW		0x103
 	movwf	EEADR
-	movlw	HIGH 	0x104
+	movlw	HIGH 	0x103
 	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
 	movlw	.0
 	movwf	EEDATA
@@ -271,9 +271,9 @@
 	call	logbook_convert_64k		; No, convert now (And write 0xAA to internal EEPROM 0x100)
 
 ; Set OLED brightness flag
-	movlw	LOW		0x104
+	movlw	LOW		0x103
 	movwf	EEADR
-	movlw	HIGH 	0x104
+	movlw	HIGH 	0x103
 	movwf	EEADRH					; OLED brightness (=0: Eco, =1: High)
 	call	read_eeprom				; read byte
 	bcf		oled_brightness_high	; Eco mode
--- a/code_part1/OSTC_code_asm_part1/surfmode.asm	Sun Apr 22 21:32:04 2012 +0200
+++ b/code_part1/OSTC_code_asm_part1/surfmode.asm	Tue Apr 24 08:39:43 2012 +0200
@@ -196,6 +196,8 @@
 	goto	internal_eeprom_access_b0	; Yes!
 	btfsc	internal_eeprom_write2		; Access internal EEPROM BANK 1 via UART module
 	goto	internal_eeprom_access_b1	; Yes!
+	btfsc	internal_eeprom_write3		; Access internal EEPROM BANK 2 via UART module
+	goto	internal_eeprom_access_b2	; Yes!
 	btfsc	uart_send_hash				; Send MD2 hash values
 	goto	send_md2_hash				; Yes!
 	btfsc	uart_send_int_eeprom		; Send internal EEPROM BANK 0
@@ -204,6 +206,8 @@
 	goto	reset_decodata				; Yes!
 	btfsc	uart_send_int_eeprom2		; Send internal EEPROM BANK 1
 	goto	send_int_eeprom_b1			; Yes!
+	btfsc	uart_send_int_eeprom3		; Send internal EEPROM BANK 2
+	goto	send_int_eeprom_b2			; Yes!
 	btfsc	uart_store_tissue_data		; Store tissue data?
 	goto	uart_store_tissues			; Yes!
 	btfsc	uart_115200_bootloader		; Look for 115200Baud bootloader?
Binary file docu/ostc_interface_description.odt has changed