endif
bc_fa T0CON,5 ; timer0 use internal clock
- bc_fa T0CON,3 ; use prescaler
ifndef SLOW_VERSION
- bc_fa T0CON,2 ; }
- bc_fa T0CON,1 ; } prescale value 1:2
- bc_fa T0CON,0 ; } (not-testing)
+ mov_fw T0CON
+ and_lw ~((1<<PSA)|(1<<T0PS2)|(1<<T0PS1)|(1<<T0PS0))
+ ior_lw nmra_master_t0scale
+ mov_wf T0CON ; prescale value calculated from
+ ; program.clocks (not-testing)
endif
ifdef SLOW_VERSION
+ bc_fa T0CON,3 ; use prescaler
bs_fa T0CON,2 ; }
bc_fa T0CON,1 ; } prescale value 1:16
bc_fa T0CON,0 ; } (testing)
endif
ifndef SLOW_VERSION
- mov_lw 0x73 ; (not-testing)
+ mov_lw nmra_master_t0init
endif
mov_wfa TMR0L ; set timer0 to appropriate value (so interrupt takes 58us)