# HG changeset patch # User heinrichsweikamp # Date 1266174565 -3600 # Node ID 2b5c52ae392318ae1f1e8de0b335368613c6e552 # Parent 3cf8af30b36e14bf80bc28b467e5d85f8c2a6086 1.52 beta rc diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/changelog.txt --- a/code_part1/OSTC_code_asm_part1/changelog.txt Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/changelog.txt Sun Feb 14 20:09:25 2010 +0100 @@ -1,3 +1,7 @@ +New in 1.52 Beta: +BETA Version - Do NOT use for diving! +NEW: Fixed-Setpoint ppO2 limited to physically possible value + New in 1.51 Beta: BETA Version - Do NOT use for diving! BUGFIX: PC Simulator mode diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/definitions.asm --- a/code_part1/OSTC_code_asm_part1/definitions.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/definitions.asm Sun Feb 14 20:09:25 2010 +0100 @@ -23,7 +23,7 @@ ;#DEFINE NO_SENSOR_MODE ; uses Dummy values #DEFINE softwareversion_x d'1' ; Software version XX.YY -#DEFINE softwareversion_y d'51' ; Software version XX.YY +#DEFINE softwareversion_y d'52' ; Software version XX.YY #DEFINE max_custom_number d'41' ; Number of last used custom function @@ -183,7 +183,8 @@ dLSB ;Pressure sensor interface dMSB clock_count - temperature_correction ; additional temperature correction value + ppO2_setpoint_store ; Actual setpoint +; temperature_correction ; additional temperature correction value W1:2 W2:2 W3:2 diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/divemode.asm --- a/code_part1/OSTC_code_asm_part1/divemode.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode.asm Sun Feb 14 20:09:25 2010 +0100 @@ -1504,6 +1504,7 @@ read_int_eeprom d'36' ; Read mix 1 ppO2 btfsc FLAG_const_ppO2_mode movff EEDATA,char_I_const_ppO2 ; Set ppO2 setpoint if in ppO2 mode + movff EEDATA, ppO2_setpoint_store ; Store also in this byte... call clear_LEDnofly ; Clear flags bcf low_battery_state ; clear flag for battery warning mode diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/divemode_menu.asm --- a/code_part1/OSTC_code_asm_part1/divemode_menu.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/divemode_menu.asm Sun Feb 14 20:09:25 2010 +0100 @@ -608,6 +608,7 @@ movwf EEADR call read_eeprom ; Read SetPoint movff EEDATA, char_I_const_ppO2 ; Use SetPoint + movff EEDATA, ppO2_setpoint_store ; Store also in this byte... divemenu_set_gas1a: bcf display_set_setpoint ; Clear Display Flag diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/ms5535.asm --- a/code_part1/OSTC_code_asm_part1/ms5535.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/ms5535.asm Sun Feb 14 20:09:25 2010 +0100 @@ -278,19 +278,19 @@ 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 - +; ; 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 diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/pled_outputs.asm --- a/code_part1/OSTC_code_asm_part1/pled_outputs.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/pled_outputs.asm Sun Feb 14 20:09:25 2010 +0100 @@ -2627,10 +2627,6 @@ PLED_const_ppO2_value: btfsc multi_gf_display ; Is the Multi-GF Table displayed? return ; Yes, No update and return! - btfsc menubit ; Divemode menu active? - return ; Yes, No update and return! - btfsc premenu ; Showing "Menu?"? - return ; Yes, do not display ppO2/"Bail" ostc_debug 'j' ; Sends debug-information to screen if debugmode active @@ -2638,7 +2634,8 @@ WIN_LEFT .65 WIN_FONT FT_SMALL WIN_INVERT .0 ; Init new Wordprocessor - call PLED_standard_color + call PLED_standard_color + lfsr FSR2,letter movff char_I_const_ppO2,lo @@ -2652,6 +2649,31 @@ PLED_const_ppO2_value2: ; Display SetPoint ;Show fixed SP value + movff amb_pressure+0,xA+0 + movff amb_pressure+1,xA+1 + movlw d'10' + movwf xB+0 + clrf xB+1 + ;xA/xB=xC with xA as remainder + call div16x16 ; xC+0=p_amb/10 + ; char_I_const_ppO2 > p_amb/10 -> Not physically possible! -> Display actual value! + + tstfsz xC+1 ; xC>255 + setf xC+0 ; Yes, set xC+0 to 2,55bar ppO2 + + movff ppO2_setpoint_store,WREG + cpfslt xC+0 ; Setpoint value possible? + bra PLED_const_ppO2_value1 ; Yes! + + movff xC+0,char_I_const_ppO2 ; No, Overwrite with actual value + bra PLED_const_ppO2_value1a + +PLED_const_ppO2_value1: + + movff ppO2_setpoint_store,char_I_const_ppO2 ; Restore Setpoint + +PLED_const_ppO2_value1a: + movff char_I_const_ppO2,lo clrf hi bsf leftbind output_16dp d'3' diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/surfmode.asm --- a/code_part1/OSTC_code_asm_part1/surfmode.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/surfmode.asm Sun Feb 14 20:09:25 2010 +0100 @@ -90,6 +90,7 @@ bcf switch_left bcf switch_right + call PLED_active_gas_surfmode ; Show start gas / SetPoint call PLED_custom_text ; Displays custom text movlw d'1' ; next cf to check movwf cf_checker_counter ; @@ -127,7 +128,7 @@ call timeout_premenu ; timeout premenu call set_leds_surfmode ; Sets Warning and No-Fly LEDs call custom_functions_check_surfmode ; Checks CF functions and displays warning symbol if something critical is wrong - call PLED_active_gas_surfmode ; Show start gas / SetPoint +; call PLED_active_gas_surfmode ; Show start gas / SetPoint call PLED_display_decotype_surface ; Show deco mode btfsc enter_error_sleep ; Enter Fatal Error Routine? goto fatal_error_sleep ; Yes (In Sleepmode_vxx.asm!) @@ -184,6 +185,7 @@ update_surfloop60: ; One minute tasks for all modes +; call PLED_active_gas_surfmode ; Show start gas / SetPoint call update_date ; and date in divemode call calc_deko_surfmode ; calculate desaturation every minute call check_temp_extrema ; check for new temperature extremas diff -r 3cf8af30b36e -r 2b5c52ae3923 code_part1/OSTC_code_asm_part1/tempcomp.asm --- a/code_part1/OSTC_code_asm_part1/tempcomp.asm Thu Feb 04 14:56:12 2010 +0100 +++ b/code_part1/OSTC_code_asm_part1/tempcomp.asm Sun Feb 14 20:09:25 2010 +0100 @@ -29,53 +29,49 @@ ; Byte2: high -compensate_temperature: - bcf uart_compensate_temp ; clear flag - bcf PIE1,RCIE ; no interrupt for UART - call set_LEDusb ; LEDusb ON - bcf PIR1,RCIF ; clear flag - - movlw "f" ; send echo - movwf TXREG - call rs232_wait_tx ; wait for UART - - call rs232_get_byte ; low byte - movff RCREG, lo - - call rs232_get_byte ; high byte - movff RCREG, hi - - clrf temperature_correction ; wait for uncompensated temperature value! - WAITMS d'250' ; wait for new temperature - WAITMS d'250' - WAITMS d'250' - WAITMS d'250' - - movff lo,sub_a+0 ; calculate difference - movff hi,sub_a+1 - movff temperature+0, sub_b+0 - movff temperature+1, sub_b+1 - call sub16 ; sub_c = sub_a - sub_b - - movf sub_c+0,W - btfsc neg_flag ; compensate negative? - movlw d'0' ; use zero compensation! - movwf sub_c+0 - - movff sub_c+0,TXREG ; Send answer - - movff sub_c+0,EEDATA ; store low byte only! - movff sub_c+0,temperature_correction ; no reboot required then... - movlw 0x01 - movwf EEADRH - movlw 0x00 - movwf EEADR - call write_eeprom ; stores in internal eeprom - - movlw 0x00 - movwf EEADRH ; reset high address byte - - call clear_LEDusb ; LEDusb OFF - bcf PIR1,RCIF ; clear flag - bsf PIE1,RCIE ; enable interrupt for UART - goto surfloop_loop ; return to surface loop +compensate_temperature: bcf uart_compensate_temp ; clear flag bcf PIE1,RCIE ; no interrupt for UART ; +; call set_LEDusb ; LEDusb ON ; +; bcf PIR1,RCIF ; clear flag ; +; ; +; movlw "f" ; send echo ; +; movwf TXREG ; +; call rs232_wait_tx ; wait for UART ; +; ; +; call rs232_get_byte ; low byte ; +; movff RCREG, lo ; +; ; +; call rs232_get_byte ; high byte ; +; movff RCREG, hi ; +; ; +; clrf temperature_correction ; wait for uncompensated temperature value! ; +; WAITMS d'250' ; wait for new temperature ; +; WAITMS d'250' ; +; WAITMS d'250' ; +; WAITMS d'250' ; +; ; +; movff lo,sub_a+0 ; calculate difference ; +; movff hi,sub_a+1 ; +; movff temperature+0, sub_b+0 ; +; movff temperature+1, sub_b+1 ; +; call sub16 ; sub_c = sub_a - sub_b ; +; ; +; movf sub_c+0,W ; +; btfsc neg_flag ; compensate negative? ; +; movlw d'0' ; use zero compensation! ; +; movwf sub_c+0 ; +; ; +; movff sub_c+0,TXREG ; Send answer ; +; ; +; movff sub_c+0,EEDATA ; store low byte only! ; +; movff sub_c+0,temperature_correction ; no reboot required then... ; +; movlw 0x01 ; +; movwf EEADRH ; +; movlw 0x00 ; +; movwf EEADR ; +; call write_eeprom ; stores in internal eeprom ; +; ; +; movlw 0x00 ; +; movwf EEADRH ; reset high address byte ; +; ; +; call clear_LEDusb ; LEDusb OFF ; +; bcf PIR1,RCIF ; clear flag bsf PIE1,RCIE ; enable interrupt for UART goto surfloop_loop ; return to surface loop