ASM Interrupt


Results 1 to 10 of 10

Thread: ASM Interrupt

Threaded View

  1. #8
    mikep's Avatar
    mikep Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks languer....

    I'm going to decide you are right..... It does not have to return.

    I re-read the datasheet a few times, brought this up with some people on the pic list and although some people did say I had to, I don't see why. (Others said they have done this before also)

    The PBP Manual says:

    "The routine should end with an Retfie instruction to return from the interrupt and allow the processor to pick up where it left off in your PicBasic Pro program."

    However I've spoken with a few people that have done it (in ASM only though) with no problems.

    My test program runs fine without it.


    Basically from this (datasheet):
    ----------------------------------------------------------------------
    When an interrupt is responded to, the GIE bit is
    cleared to disable any further interrupt, the return
    address is pushed onto the stack and the PC is loaded
    with 0004h. Once in the Interrupt Service Routine, the
    source(s) of the interrupt can be determined by polling
    the interrupt flag bits. The interrupt flag bit(s) must be
    cleared in software before re-enabling interrupts to
    avoid recursive interrupts.
    ----------------------------------------------------------------------

    As far as I can tell the only thing that happends is the return address gets pushed onto the stack. This shouldn't bother me as no longer need whatever was on the stack anyways. However if I could figure out how to POP it that would be cool.

    The PC is loaded with 0004h which is fine because that's where it is!

    If I want to re-enable interrupts I needs to reset the interrupt flag bits and GIE.

    As for W again I'm asusming don't need this since I'm not returning anyways.

    I still need to figure out what STATUS and PCLATH are exactly.

    I would like to ask a ME techie about this... and if so, they should change the text from "should end" to "usually will end" or something similar.

    The other thing that is making me ask a few questions is this line out of the manual:

    "The interrupt routine should be as short and fast as you can possibly make it. If it takes too long to execute, the Watchdog Timer could timeout and really make a mess of things."

    By the ISR in this case do they mean whatever is in between the ASM and ENDASM?

    I'm leaving the watchdog timer on in my tests and it does not seem to be behaving badly in anyway.



    Cheers,
    Mike
    Last edited by mikep; - 24th October 2003 at 03:10.

Similar Threads

  1. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 03:35
  2. 18F2480 asm interrupt
    By Richard Storie in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th March 2009, 20:40
  3. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 03:59
  4. 16F877a ASM Interrupt Confused
    By modifyit in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 19th September 2005, 04:16
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 02:07

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