comparison src/calibrate.asm @ 187:669b5d00706d

CHANGE: Longer timeout (4 min) for calibration menu Ignore 1,2mV noise for not-connected inputs
author heinrichsweikamp
date Sat, 25 Oct 2014 15:28:18 +0200
parents fdd4e30846ae
children e79bc535ef9e
comparison
equal deleted inserted replaced
186:a004b482604a 187:669b5d00706d
340 ; 24bit AD result is in 244,1406541nV 340 ; 24bit AD result is in 244,1406541nV
341 ; Devide 24bit value through 409,5999512 -> 410 (0,01% error) 341 ; Devide 24bit value through 409,5999512 -> 410 (0,01% error)
342 #DEFINE ad2mv_factor .410 342 #DEFINE ad2mv_factor .410
343 ; Sensor 1 343 ; Sensor 1
344 clrf xC+3 344 clrf xC+3
345 movff ir_buffer+.6,xC+2 345 movff ir_s8_buffer+.6,xC+2
346 movff ir_buffer+.5,xC+1 346 movff ir_s8_buffer+.5,xC+1
347 movff ir_buffer+.4,xC+0 347 movff ir_s8_buffer+.4,xC+0
348 movlw LOW ad2mv_factor 348 movlw LOW ad2mv_factor
349 movwf xB+0 349 movwf xB+0
350 movlw HIGH ad2mv_factor 350 movlw HIGH ad2mv_factor
351 movwf xB+1 351 movwf xB+1
352 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder 352 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
353 movff xC+1,o2_mv_sensor1+1 353 movff xC+1,o2_mv_sensor1+1
354 movff xC+0,o2_mv_sensor1+0 ; in 100uV steps 354 movff xC+0,o2_mv_sensor1+0 ; in 100uV steps
355 ; Sensor 2 355 ; Sensor 2
356 clrf xC+3 356 clrf xC+3
357 movff ir_buffer+.9,xC+2 357 movff ir_s8_buffer+.9,xC+2
358 movff ir_buffer+.8,xC+1 358 movff ir_s8_buffer+.8,xC+1
359 movff ir_buffer+.7,xC+0 359 movff ir_s8_buffer+.7,xC+0
360 movlw LOW ad2mv_factor 360 movlw LOW ad2mv_factor
361 movwf xB+0 361 movwf xB+0
362 movlw HIGH ad2mv_factor 362 movlw HIGH ad2mv_factor
363 movwf xB+1 363 movwf xB+1
364 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder 364 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder
365 movff xC+1,o2_mv_sensor2+1 365 movff xC+1,o2_mv_sensor2+1
366 movff xC+0,o2_mv_sensor2+0 ; in 100uV steps 366 movff xC+0,o2_mv_sensor2+0 ; in 100uV steps
367 ; Sensor 3 367 ; Sensor 3
368 clrf xC+3 368 clrf xC+3
369 movff ir_buffer+.12,xC+2 369 movff ir_s8_buffer+.12,xC+2
370 movff ir_buffer+.11,xC+1 370 movff ir_s8_buffer+.11,xC+1
371 movff ir_buffer+.10,xC+0 371 movff ir_s8_buffer+.10,xC+0
372 movlw LOW ad2mv_factor 372 movlw LOW ad2mv_factor
373 movwf xB+0 373 movwf xB+0
374 movlw HIGH ad2mv_factor 374 movlw HIGH ad2mv_factor
375 movwf xB+1 375 movwf xB+1
376 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder 376 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder