DEVICE 16F877
Declare XTAL 4
ON_INTERRUPT GOTO Interrupcion
SYMBOL T0IE =INTCON.5 ' TMR0 Overflow Interrupt Enable
SYMBOL T0IF =INTCON.2 ' TMR0 Overflow Interrupt Flag
SYMBOL GIE =INTCON.7 ' Global Interrupt Enable
SYMBOL PS0 =OPTION_REG.0 ' Prescaler ratio bit-0
SYMBOL PS1 =OPTION_REG.1 ' Prescaler ratio bit-1
SYMBOL PS2 =OPTION_REG.2 ' Prescaler ratio bit-2
SYMBOL PSA =OPTION_REG.3 ' Prescaler Assignment (1=assigned to WDT 0=assigned to oscillator)
SYMBOL T0CS =OPTION_REG.5 ' Timer0 Clock Source Select (0=Internal clock 1=External PORTA.4)
goto marcha
Interrupcion:
toggle portb.0
T0IF = 0
CONTEXT RESTORE
enable
Marcha:
ALL_DIGITAL=True
TRISB=0
PORTB=0
GIE = 0 ' Turn off global interrupts
PSA = 0 ' Assign the prescaler to external oscillator
PS0 = 1 ' Set the prescaler
PS1 = 1 ' to increment TMR0
PS2 = 1 ' every 256th instruction cycle
T0CS = 0 ' Assign TMR0 clock to internal source
TMR0 = 0 ' Clear TMR0 initially
T0IE = 1 ' Enable TMR0 overflow interrupt
GIE = 1 ' Enable global interrupts
Marcha_2:
@nop
@nop
@nop
GOTO MARCHA_2
END
prueba con esas modificaciones
