diff code_part1/OSTC_code_asm_part1/ms5535.asm @ 169:e26f49674956

Merge decoplan display for both GF and Buhlmann models. + Add CF(54) to reverse deco plan display order. + Clean state machine to faster redisplay in divemode. Fix don't flip screen for soft emulation.
author JeanDo
date Wed, 26 Jan 2011 19:19:02 +0100
parents 8d6aca08f66b
children 6d8a2550c9ea
line wrap: on
line diff
--- a/code_part1/OSTC_code_asm_part1/ms5535.asm	Tue Jan 25 01:02:35 2011 +0100
+++ b/code_part1/OSTC_code_asm_part1/ms5535.asm	Wed Jan 26 19:19:02 2011 +0100
@@ -18,13 +18,18 @@
 ; routines for Intersema MS5535A, MS5541B and MS5541C
 ; history:
 ; 2005-09-26: Written by Matthias Heinrichs, info@heinrichsweikamp.com
-; 2008-08-21: MH last updated
+; 2008-08-21: MH last updated, with second order compensation.
 ; 2011-01-19: jDG Clean up using true signed arithmetics.
 ; known bugs:
 ; ToDo: 
 
-; with second order temperature compensation
+;=============================================================================
+; Expose internal variables, to ease debug:
+    global D1, D2
+    global C1, C2, C3, C4, C5
+    global xdT, xdT2, OFF, SENS, amb_pressure
 
+;=============================================================================
 calculate_compensation:
     ; calculate UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760)
 	clrf	isr_xA+1
@@ -193,6 +198,7 @@
 calc_pos_temp:
 	return			                    ; Fertig mit allem
 
+;=============================================================================
 get_pressure_start:
 	rcall	reset_MS5535A
 	movlw	b'10100000'	;+3*high as start and 1+low as stop!
@@ -212,6 +218,7 @@
 #endif
 	return
 
+;=============================================================================
 get_temperature_start:
 	rcall	reset_MS5535A
 	movlw	b'10010000'	;+3*high as start and 1+low as stop!
@@ -226,20 +233,8 @@
 #endif
 	return
 
+;=============================================================================
 get_calibration_data:
-;	; read addional temperature correction from internal EEPROM 0x100
-;	bsf		no_sensor_int				; No sensor interupt!
-;	clrf	temperature_correction		; clear compensation value
-;	movlw	LOW		0x100
-;	movwf	EEADR
-;	movlw	HIGH	0x100
-;	movwf	EEADRH
-;	call	read_eeprom
-;	clrf	EEADRH						; Only 256Bytes used in normal program
-;	movlw	d'200'						; limit value
-;	cpfsgt	EEDATA						; EEDATA>200?
-;	movff	EEDATA, temperature_correction	; No, Store for compensation
-;	
 	rcall	reset_MS5535A
 	movlw	d'13'
 	movwf	clock_count
@@ -398,6 +393,7 @@
 	bcf		no_sensor_int		; enable sensor interrupts
 	return
 
+;=============================================================================
 reset_MS5535A_one:
 	bsf		sensor_SDO
 	nop
@@ -485,7 +481,6 @@
 	decfsz	clock_count,F
 	bra		recieve_loop
 	return
-	
 
 send_data_MS55535A:
 	; send three startbits first