how to remap interrupt vector - pic18f4550


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    21

    Default how to remap interrupt vector - pic18f4550

    hi

    can any one tell me how to remap interrupt vector in pbp or assembly? i have written a bootloader which loads new firmware with help of external eeprom. when interrupt occurs in the new firmware it then jumps to bootloader interrupt vector and gets hang/reset. to solve this problem i need to remap interrupt vector in my bootloader
    please help me

    thank you

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: how to remap interrupt vector - pic18f4550

    It depends what you mean by "remap".
    If you are writing a bootloader, it is likely that you will have to deal with a variety of devices, so you will have only one interrupt level. When a PIC gets an interrupt, it jumps to location 0x08. Put a jump to whatever you want in that location.
    Charles Linquist

  3. #3
    Join Date
    Jul 2011
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Re: how to remap interrupt vector - pic18f4550

    Quote Originally Posted by Charles Linquis View Post
    It depends what you mean by "remap".
    If you are writing a bootloader, it is likely that you will have to deal with a variety of devices, so you will have only one interrupt level. When a PIC gets an interrupt, it jumps to location 0x08. Put a jump to whatever you want in that location.
    thanks for your reply.
    but how to put jump instruction at 0x0008? i tried using this asm code but i got error "overwriting previous address content"
    Code:
    asm
    org 0x0008
    goto 0x2008
    endasm
    also if i am putting jump at 0x0008 then if in bootloader interrupts (usb rx interrupts) occur then it will also jump to 0x0008 and then to 0x2008?
    thanks

  4. #4
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: how to remap interrupt vector - pic18f4550

    It would appear that you already have an INT assigned. As a result, there is something in that location already and you are over-writing it.

    ALL high priority interrupts go to 0x08. You are responsible for deciding what generated the interrupt by reading PIR(x.x and others) and doing the correct things.
    Charles Linquist

  5. #5
    Join Date
    Jul 2011
    Posts
    21


    Did you find this post helpful? Yes | No

    Default Re: how to remap interrupt vector - pic18f4550

    Hi Charles,
    i created this simple program and tried to run but it didn't worked. it should blink led and remap high priority interrupt vector
    adcon1 = 15
    DEFINE OSC 48

    asm
    org 0x0008
    goto 0x2008
    endasm

    i var byte
    j var byte

    main:
    high porta.0
    for i = 0 to 254
    for j = 0 to 254
    high porta.0
    next j
    next i
    for i = 0 to 254
    for j = 0 to 254
    low porta.0
    next j
    next i
    goto main
    but if i comment out the goto 0x2008 line it starts to blink led. since i am not using any interrupt then why its not blinking led?
    can you please help me

    thank you

  6. #6
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: how to remap interrupt vector - pic18f4550

    I hope there is more to your program that you show. The PIC jumps to the interrupt vector location (0x08) when some peripheral (timer, serial port, etc) generates an interrupt, at which time the program counter gets reset to 0x08.

    Just use Darrel's Instant Interrupts.
    Charles Linquist

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts