; timer0 initial config for NMRA timer
- bsf T0CON,6,0 ; p107 Timer0 -> 8bit mode
+ bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode (testing)
+; bsf T0CON,6,0 ; p107 Timer0 -> 8bit mode (not-testing)
bcf T0CON,5,0 ; timer0 use internal clock
bcf T0CON,3,0 ; use prescaler
- bcf T0CON,2,0 ; }
- bcf T0CON,1,0 ; } prescale value 1:2
- bcf T0CON,0,0 ; }
+; bcf T0CON,2,0 ; }
+; bcf T0CON,1,0 ; } prescale value 1:2
+; bcf T0CON,0,0 ; } (not-testing)
+ bsf T0CON,2,0 ; }
+ bcf T0CON,1,0 ; } prescale value 1:32
+ bsf T0CON,0,0 ; } (testing)
;----------------------------------------------------------------------------
timer0_interrupt
bcf INTCON,2,0 ; clear interrupt-set bit
- movlw 0x6E
+ movlw 0x00 ; (testing)
+; movlw 0x6E ; (not-testing)
movwf W,TMR0L ; set timer0 to 0x6E (so interrupt takes 58us)
; timer0 initial config for NMRA timer
- bsf T0CON,6,0 ; p107 Timer0 -> 8bit mode
+ bcf T0CON,6,0 ; p107 Timer0 -> 16bit mode (testing)
+; bsf T0CON,6,0 ; p107 Timer0 -> 8bit mode (not-testing)
bcf T0CON,5,0 ; timer0 use internal clock
bcf T0CON,3,0 ; use prescaler
- bcf T0CON,2,0 ; }
- bcf T0CON,1,0 ; } prescale value 1:2
- bcf T0CON,0,0 ; }
+; bcf T0CON,2,0 ; }
+; bcf T0CON,1,0 ; } prescale value 1:2
+; bcf T0CON,0,0 ; } (not-testing)
+ bsf T0CON,2,0 ; }
+ bcf T0CON,1,0 ; } prescale value 1:32
+ bsf T0CON,0,0 ; } (testing)
;----------------------------------------------------------------------------
timer0_interrupt
bcf INTCON,2,0 ; clear interrupt-set bit
- movlw 0x6E
+ movlw 0x00 ; (testing)
+; movlw 0x6E ; (not-testing)
movwf W,TMR0L ; set timer0 to 0x6E (so interrupt takes 58us)