Mercurial > public > hwos_code
comparison src/calibrate.asm @ 268:29acdb601548
BUGFIX: Increase timing tolerance for S8 HUD (cR only)
author | heinrichsweikamp |
---|---|
date | Sun, 19 Apr 2015 20:41:48 +0200 |
parents | e2ea74646127 |
children | 653a3ab08062 |
comparison
equal
deleted
inserted
replaced
267:f64afa14ef07 | 268:29acdb601548 |
---|---|
359 ; 24bit AD result is in 244,1406541nV | 359 ; 24bit AD result is in 244,1406541nV |
360 ; Devide 24bit value through 409,5999512 -> 410 (0,01% error) | 360 ; Devide 24bit value through 409,5999512 -> 410 (0,01% error) |
361 #DEFINE ad2mv_factor .410 | 361 #DEFINE ad2mv_factor .410 |
362 ; Sensor 1 | 362 ; Sensor 1 |
363 clrf xC+3 | 363 clrf xC+3 |
364 movff ir_s8_buffer+.6,xC+2 | 364 movff s8_rawdata_sensor1+2,xC+2 |
365 movff ir_s8_buffer+.5,xC+1 | 365 movff s8_rawdata_sensor1+1,xC+1 |
366 movff ir_s8_buffer+.4,xC+0 | 366 movff s8_rawdata_sensor1+0,xC+0 |
367 movlw LOW ad2mv_factor | 367 movlw LOW ad2mv_factor |
368 movwf xB+0 | 368 movwf xB+0 |
369 movlw HIGH ad2mv_factor | 369 movlw HIGH ad2mv_factor |
370 movwf xB+1 | 370 movwf xB+1 |
371 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | 371 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder |
372 movff xC+1,o2_mv_sensor1+1 | 372 movff xC+1,o2_mv_sensor1+1 |
373 movff xC+0,o2_mv_sensor1+0 ; in 100uV steps | 373 movff xC+0,o2_mv_sensor1+0 ; in 100uV steps |
374 ; Sensor 2 | 374 ; Sensor 2 |
375 clrf xC+3 | 375 clrf xC+3 |
376 movff ir_s8_buffer+.9,xC+2 | 376 movff s8_rawdata_sensor2+2,xC+2 |
377 movff ir_s8_buffer+.8,xC+1 | 377 movff s8_rawdata_sensor2+1,xC+1 |
378 movff ir_s8_buffer+.7,xC+0 | 378 movff s8_rawdata_sensor2+0,xC+0 |
379 movlw LOW ad2mv_factor | 379 movlw LOW ad2mv_factor |
380 movwf xB+0 | 380 movwf xB+0 |
381 movlw HIGH ad2mv_factor | 381 movlw HIGH ad2mv_factor |
382 movwf xB+1 | 382 movwf xB+1 |
383 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | 383 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder |
384 movff xC+1,o2_mv_sensor2+1 | 384 movff xC+1,o2_mv_sensor2+1 |
385 movff xC+0,o2_mv_sensor2+0 ; in 100uV steps | 385 movff xC+0,o2_mv_sensor2+0 ; in 100uV steps |
386 ; Sensor 3 | 386 ; Sensor 3 |
387 clrf xC+3 | 387 clrf xC+3 |
388 movff ir_s8_buffer+.12,xC+2 | 388 movff s8_rawdata_sensor3+2,xC+2 |
389 movff ir_s8_buffer+.11,xC+1 | 389 movff s8_rawdata_sensor3+1,xC+1 |
390 movff ir_s8_buffer+.10,xC+0 | 390 movff s8_rawdata_sensor3+0,xC+0 |
391 movlw LOW ad2mv_factor | 391 movlw LOW ad2mv_factor |
392 movwf xB+0 | 392 movwf xB+0 |
393 movlw HIGH ad2mv_factor | 393 movlw HIGH ad2mv_factor |
394 movwf xB+1 | 394 movwf xB+1 |
395 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder | 395 call div32x16 ; xC:4 / xB:2 = xC+3:xC+2 with xC+1:xC+0 as remainder |