0
votes

To perform ISR on Timer0, we use 0x04 address, or in code

ORG 0x04
GOTO tmr0_ISR

Which address should I use if I'm using Timer1 or does ISR for it requires different approach? (using PIC16F877A)

1

1 Answers

2
votes

On the PIC16F877A, all interrupts trigger the same ISR stored at 0x04.

Therefore, you need something along the lines of:

ORG 0x04
GOTO ISR

Elsewhere:

ISR:
  BTFSC INTCON, TMR0IF
    GOTO tmr0_ISR
  BTFSC PIR1, TMR1IF
    GOTO tmr1_ISR

My syntax might not be correct, it's been a while since I've written PIC16 assembly.