comparison code_part1/OSTC_code_asm_part1/sleepmode.asm @ 713:8c293e76a517

no flicker when powering on
author heinrichsweikamp
date Thu, 16 May 2013 13:57:32 +0200
parents 39e02673db4c
children b7f7184d800d
comparison
equal deleted inserted replaced
712:6ff7f894c3af 713:8c293e76a517
192 clrf amb_pressure_avg+1 ; clear for sleep routine 192 clrf amb_pressure_avg+1 ; clear for sleep routine
193 call calculate_compensation ; calculate temperature compensated pressure (233us) 193 call calculate_compensation ; calculate temperature compensated pressure (233us)
194 return 194 return
195 195
196 fatal_error_sleep: 196 fatal_error_sleep:
197 WAITMS d'250' 197 bsf no_sensor_int ; Disable sensor interrupt
198 WAITMS d'250' 198 call get_calibration_data ; Get calibration data from pressure sensor
199 bcf no_sensor_int ; Enable sensor interrupt
199 WAITMS d'250' 200 WAITMS d'250'
200 WAITMS d'250' 201 WAITMS d'250'
201 call get_battery_voltage ; get battery voltage 202 call get_battery_voltage ; get battery voltage
202 btfss enter_error_sleep ; REALLY enter Fatal Error Routine? 203 btfss enter_error_sleep ; REALLY enter Fatal Error Routine?
203 return ; No! 204 return ; No!
205 SAFE_2BYTE_COPY amb_pressure, sub_b
206 movlw LOW d'15001' ; must be lower then 15001mbar
207 movwf sub_a+0
208 movlw HIGH d'15001'
209 movwf sub_a+1
210 call subU16 ; sub_c = sub_a - sub_b
211 bcf enter_error_sleep ; Clear flag
212 btfss neg_flag ;
213 return ; No!
214 bsf enter_error_sleep ; Set flag
204 clrf INTCON 215 clrf INTCON
205 clrf INTCON2 216 clrf INTCON2
206 clrf INTCON3 217 clrf INTCON3
207 bcf ADCON0,0 ; AD converter off 218 bcf ADCON0,0 ; AD converter off
208 call disable_rs232 ; disable UART module 219 call disable_rs232 ; disable UART module