Interrupt while asmmbler command.


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    14

    Default Interrupt while asmmbler command.

    Hi,

    I know that PBP will not go to ISR while it is in a PBP command, but is it also true when performing a asm command ?

    I tryed it and as i show it dosn't ,am i wrong ?

    Thanks
    Shamir

  2. #2
    Join Date
    Feb 2005
    Location
    Kolkata-India
    Posts
    563


    Did you find this post helpful? Yes | No

    Default What is your app ?

    Hi,

    PBP does not branch to the interrupt vector when an interrupt occurs. By using the On Interrupt, PBP checks for interrupts and flags it. When it finishes the current function it jumps to the defined basic interrupt routine. For example when executing a function block, say serout, PBP would complete the serial out and then process the interrupt. So that's where the latancy is introduce. If PBP is executing a pause then it does it by some iterations of its own library. That means pause is itself a delay loop and your statement defines how many times it should loop around to introduce the desired delay. Thus while executing its own library PBP would finish it and then process. If you are executing an asm statement that already means that PBP is not in the process of executing its built in library. So the latency is less.
    As I always mention please look at this thread and appreciate the smart and hard work darrel has done, http://www.picbasic.co.uk/forum/showthread.php?t=3251

    BTW if your app is time sensitive and you would be handling higher/lower priority interrupts it is a good idea to use asm. Also to reduce your bank addressing headache you can use the system bank to hold your variables (if they fit) used in the ISR. If not then indirect addressing is what I use on the PIC18

    Happy New Year to All
    Last edited by sougata; - 26th December 2006 at 07:56.
    Regards

    Sougata

  3. #3
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi,Shamir

    Answering your question, Assembler interrupts have a small latence time ... Microchips tells "around" 4 clock cycles in its datasheets and midrange manual.

    this gives one assembler instruction time ... two, if pessimistic !!!

    Now, the good question is to know EXACTLY what needs to be saved ( and restored after ... ) THIS portion of code always take some time, and even need some timing values to be corrected in a further step.

    Darrel's "instant Interrupts" is the easiest way to care with interrupts "headache" ... but just takes MINIMUM time - Only MINIMUM !!!

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  4. LCDout Command causes Interrupt!!??
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 31st March 2005, 04:18
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 1

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