comparison src/isr.asm @ 636:2737ddc643bb

3.11 release
author heinrichsweikamp
date Mon, 25 May 2020 17:35:30 +0200
parents 4050675965ea
children 8c1f1f334275
comparison
equal deleted inserted replaced
635:9a64914a8fca 636:2737ddc643bb
286 286
287 banksel 0xF16 ; TMR7H/L are not part of the access RAM 287 banksel 0xF16 ; TMR7H/L are not part of the access RAM
288 movlw .248 ; reload timer 7, high byte (8x256 ticks -> 62.5 ms) 288 movlw .248 ; reload timer 7, high byte (8x256 ticks -> 62.5 ms)
289 movwf TMR7H ; ... (keep low byte running ) 289 movwf TMR7H ; ... (keep low byte running )
290 290
291 btfss update_surface_pressure ; shall update the surface pressure?
292 bra isr_tmr7_0 ; NO - skip
293 bcf update_surface_pressure ; YES - clear request flag
294 MOVII pressure_abs_ref,pressure_surf ; - update surface pressure
295
296 isr_tmr7_0:
291 call get_analog_switches ; get analog readings - bank-safe, but CAUTION: returns in bank common 297 call get_analog_switches ; get analog readings - bank-safe, but CAUTION: returns in bank common
292 banksel isr_backup ; back to ISR default bank 298 banksel isr_backup ; back to ISR default bank
293 299
294 btfss INTCON3,INT1IE ; external IRQ 1 enabled? 300 btfss INTCON3,INT1IE ; external IRQ 1 enabled?
295 bra isr_tmr7_a ; NO - skip next 301 bra isr_tmr7_a ; NO - skip next
342 348
343 bsf trigger_S8_data_update ; signal a data update 349 bsf trigger_S8_data_update ; signal a data update
344 ENDIF 350 ENDIF
345 351
346 isr_tmr7_2: 352 isr_tmr7_2:
347 btfsc block_sensor_interrupt ; sensor interrupts disabled? 353
348 bra sensor_int_state_exit ; YES - goto exit 354 ;isr_sensor_state2:
349
350 isr_sensor_state2:
351 btfss sensor_state_counter,0 ; every 1/4 second 355 btfss sensor_state_counter,0 ; every 1/4 second
352 bsf trigger_quarter_second ; set flag 356 bsf trigger_quarter_second ; set flag
353 357
354 btfss speed_is_normal ; CPU running on normal speed? 358 btfss speed_is_normal ; CPU running on normal speed?
355 rcall isr_set_speed_to_normal ; NO - set CPU speed to normal 359 rcall isr_set_speed_to_normal ; NO - set CPU speed to normal
356 360
357 ; update surface pressure
358 btfss update_surface_pressure ; shall update the surface pressure?
359 bra isr_sensor_state2_1 ; NO
360 bcf update_surface_pressure ; YES - clear request flag
361 MOVII pressure_abs_ref,pressure_surf ; - update surface pressure
362
363 isr_sensor_state2_1:
364 incf sensor_state_counter,F ; counts to eight for state machine 361 incf sensor_state_counter,F ; counts to eight for state machine
365 362
366 ; State 1: clear flags and average registers, get temperature (51 us) and start pressure integration (73.5 us) 363 ; State 1: clear flags and average registers, get temperature (51 us) and start pressure integration (73.5 us)
367 ; State 2: get pressure (51 us), start temperature integration (73.5 us) and calculate temperature compensated pressure (233 us) 364 ; State 2: get pressure (51 us), start temperature integration (73.5 us) and calculate temperature compensated pressure (233 us)
368 ; State 3: get temperature (51 us) and start pressure integration (73.5 us) 365 ; State 3: get temperature (51 us) and start pressure integration (73.5 us)