comparison code_part1/OSTC_code_asm_part1/ms5535.asm @ 289:6d8a2550c9ea

Fix zero-depth gas color in de-activation menu.
author JeanDo
date Thu, 21 Apr 2011 20:09:09 +0200
parents e26f49674956
children ecbbbd423e86
comparison
equal deleted inserted replaced
288:9feb224f6871 289:6d8a2550c9ea
24 ; ToDo: 24 ; ToDo:
25 25
26 ;============================================================================= 26 ;=============================================================================
27 ; Expose internal variables, to ease debug: 27 ; Expose internal variables, to ease debug:
28 global D1, D2 28 global D1, D2
29 global C1, C2, C3, C4, C5 29 global C1, C2, C3, C4, C5, C6
30 global xdT, xdT2, OFF, SENS, amb_pressure 30 global xdT, xdT2, OFF, SENS, amb_pressure, temperature
31 31
32 ;============================================================================= 32 ;=============================================================================
33 calculate_compensation: 33 calculate_compensation:
34 ; calculate UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760) 34 ; calculate UT1 = 8*C5 + 10000 (u16 range 10.000 .. +42.760)
35 clrf isr_xA+1 35 clrf isr_xA+1
240 movwf clock_count 240 movwf clock_count
241 movlw b'01010100' ;+3*high as start and 1+low as stop! 241 movlw b'01010100' ;+3*high as start and 1+low as stop!
242 movwf isr1_temp 242 movwf isr1_temp
243 rcall send_data_MS55535A 243 rcall send_data_MS55535A
244 rcall get_2bytes_MS5535A 244 rcall get_2bytes_MS5535A
245
246 #ifdef TESTING
247 movlw LOW(.18556)
248 movff WREG,W1+0
249 movlw HIGH(.18556)
250 movff WREG,W1+1
251 #else
245 movff dMSB,W1+1 252 movff dMSB,W1+1
246 movff dLSB,W1+0 253 movff dLSB,W1+0
254 #endif
247 255
248 movlw d'13' 256 movlw d'13'
249 movwf clock_count 257 movwf clock_count
250 movlw b'01011000' ;+3*high as start and 1+low as stop! 258 movlw b'01011000' ;+3*high as start and 1+low as stop!
251 movwf isr1_temp 259 movwf isr1_temp
252 rcall send_data_MS55535A 260 rcall send_data_MS55535A
253 rcall get_2bytes_MS5535A 261 rcall get_2bytes_MS5535A
262 #ifdef TESTING
263 movlw LOW(.49183)
264 movff WREG,W2+0
265 movlw HIGH(.49183)
266 movff WREG,W2+1
267 #else
254 movff dMSB,W2+1 268 movff dMSB,W2+1
255 movff dLSB,W2+0 269 movff dLSB,W2+0
270 #endif
256 271
257 movlw d'13' 272 movlw d'13'
258 movwf clock_count 273 movwf clock_count
259 movlw b'01100100' ;+3*high as start and 1+low as stop! 274 movlw b'01100100' ;+3*high as start and 1+low as stop!
260 movwf isr1_temp 275 movwf isr1_temp
261 rcall send_data_MS55535A 276 rcall send_data_MS55535A
262 rcall get_2bytes_MS5535A 277 rcall get_2bytes_MS5535A
278 #ifdef TESTING
279 movlw LOW(.22354)
280 movff WREG,W3+0
281 movlw HIGH(.22354)
282 movff WREG,W3+1
283 #else
263 movff dMSB,W3+1 284 movff dMSB,W3+1
264 movff dLSB,W3+0 285 movff dLSB,W3+0
286 #endif
265 287
266 movlw d'13' 288 movlw d'13'
267 movwf clock_count 289 movwf clock_count
268 movlw b'01101000' ;+3*high as start and 1+low as stop! 290 movlw b'01101000' ;+3*high as start and 1+low as stop!
269 movwf isr1_temp 291 movwf isr1_temp
270 rcall send_data_MS55535A 292 rcall send_data_MS55535A
271 rcall get_2bytes_MS5535A 293 rcall get_2bytes_MS5535A
294 #ifdef TESTING
295 movlw LOW(.28083)
296 movff WREG,W4+0
297 movlw HIGH(.28083)
298 movff WREG,W4+1
299 #else
272 movff dMSB,W4+1 300 movff dMSB,W4+1
273 movff dLSB,W4+0 301 movff dLSB,W4+0
302 #endif
274 303
275 ; calculate C1 (16Bit) 304 ; calculate C1 (16Bit)
276 movff W1+1, C1+1 305 movff W1+1, C1+1
277 bcf STATUS,C 306 bcf STATUS,C
278 rrcf C1+1 307 rrcf C1+1