Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,170


    Did you find this post helpful? Yes | No

    Default

    OK. I got it. Was the goto main before Interrupt setup.

    Sorry for my careless... A cupof coffee did the job!

    Ioannis

  2. #2
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    I'm needing to use DIV32 in my program, this from the compiler manual...

    "...blah, blah, blah...........ON INTERRUPT must be
    DISABLEd from before the multiply until after the DIV32. If ON
    INTERRUPT is not used, there is no need to add DISABLE to the
    program. Interrupts in assembler should have no effect on the internal
    variables so they may be used without regard to DIV32."


    Now I'm blissfully unaware how DT's interrupts work 'under the hood' ...so could someone put a layman's spin on whether DT's interrupts are "interrupts in Assembler" (& therefore whether I'm free to use DIV32or not?)

    Thanks.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    DIV32 only has a problem with ON INTERRUPT.

    ASM interrupts and DT_INTS has no problem with it.
    DT

  4. #4
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    DIV32 only has a problem with ON INTERRUPT.

    ASM interrupts and DT_INTS has no problem with it.
    Excellent news....and thanks for the quick response (I'm off to divide 2147483647 by 32767 .....just because)

  5. #5


    Did you find this post helpful? Yes | No

    Default Problem with Comparator Interupts

    Hello,

    I was trying to experiment with HankMcSpank's comparator interupt code. But am having problems getting it to compile.

    I am using,
    PIC18f4480
    PBP 2.60A
    DT_INT-18 3.3
    ReEnter-18 v?
    MPASM 5.2

    It is giving me "missing argument", Interupt(FlagReg,Flagbit) not found etc
    Error ("Int_handler"..... Error (Int_Enable

    If anyone has any ideas, I would be greatfull.

    Thanks
    Attached Files Attached Files

  6. #6
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    The 18F4480 only has 1 interrupt flag for both comparators.

    You would use CMP_INT, then check the C1OUT/C2OUT bits in CMCON to determine which one triggered the interrupt.
    DT

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    The 18F4480 only has 1 interrupt flag for both comparators.

    You would use CMP_INT, then check the C1OUT/C2OUT bits in CMCON to determine which one triggered the interrupt.
    Thank you, Darrel!

    Had the same issue with the PIC16f877A- Will revisit tonight.

  8. #8
    Join Date
    Mar 2009
    Posts
    653


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mark_s View Post
    Hello,

    I was trying to experiment with HankMcSpank's comparator interupt code.
    Be warned...it's still very much a work in progress, I've just revisited this one & noticed a whopping proble. On the basis that a picture is worth a thousand words, I just posted up a youtube video, which illustrates my last remaining problem - there appears to be bit of an ssue measuring smaller phase shifts...

    Have a look at my video on this thread...

    http://www.picbasic.co.uk/forum/show...4382#post94382
    Last edited by HankMcSpank; - 25th September 2010 at 15:28.

  9. #9


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by HankMcSpank View Post
    Be warned...it's still very much a work in progress, I've just revisited this one & noticed a whopping proble. On the basis that a picture is worth a thousand words, I just posted up a youtube video, which illustrates my last remaining problem - there appears to be bit of an ssue measuring smaller phase shifts...

    Have a look at my video on this thread...

    http://www.picbasic.co.uk/forum/show...4382#post94382
    Hank,

    I got my code working last night , thanks to Darrel. The pic chips I am using only have one comparator interupt. By reading the output bits on each comparator and putting an IF statement in the ISR, I can read the frequency and phase like your code. My test so far is with a fixed 180 deg. I need to wire up a variable phase shifter, so that I can compare my results with yours. Not sure why you can't read below 33 deg? Maybe phase locking between the two comparators or interupt house keeping? What happens if you halve the frequency?

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 4

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

Tags for this Thread

Posting Permissions

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