Question

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)

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top