Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

How to write code in Address 0x0008? (Interrupt Vector)

Status
Not open for further replies.

electroRF

Member
Hi

I'm using PIC18F4520, with MPLAB IDE, XC8 Compiler.

I wanna write code for ISR, at address 0x0008.

How do I do that?

Thank you.
 
A rewrite.... I hate giving code untested,,,, So I wrote this to test

C:
#include<xc.h>
volatile int x;

void interrupt low_priority ISRL()
    {
    x = 2;
    INT1IF = 0;  // cancel button 1 press
    }
  
void interrupt ISRH()
    {
    x = 1;
    INT2IF = 0;  // cancel button 2 press
    }
  
void main(void)
    {
    IPEN = 1;   // Interrupt prority set,,,
    ADCON1 = 0xF;  // PORTB ADC off
    INTCON3 = 0x98;  // set interrupt priority to INT1 and INT2
    INTCON = 0xC0;    // GIEH and GIEL set
    while(1)
        {
        }  
    }

This DOES work...
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top