i tried to get an interrupt at .1ms using dt-ints.
i used 16f877a at 4MHz and timer1 1:1 prescaler , want to toggle a led that connected to portb.7 to test interrupt.
timer1 pre-load value is 65437. The signal must be 5KHz , but it is about 2.4KHz.
The code is below.What am i missing or what is the mistake?
Code:INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
LED VAR PORTB.7
OUTPUT LED
ADCON1 = 7
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _TMR1_INT, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts
T1CON = %00000101 ; Prescaler = 1, TMR1ON
TMR1L = $9D ; TMR1 = 65437
TMR1H = $FF
MAIN :
PAUSE 50
GOTO MAIN
TMR1_INT :
TMR1L = $9D
TMR1H = $FF
TOGGLE LED
@ INT_RETURN