Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    I've used the DT_INTS sucessfully with an 18F4550. I had to move to an 18F87J50 but the DT_INTS would not compile. Not sure if I'm doing something wrong or if the DT_INTS was never tested with J series PIC's. When I compile, I get the following warning message:
    Code:
    Unable to fit variable VP_DelayCount in requested bank 0
    In the "VirtualPort.bas" code, I changed this code:
    Code:
    VP_DelayCount  VAR WORD BANK0  ; Used for internal Delay only
    to this:
    Code:
    VP_DelayCount  VAR WORD BANK1  ; Used for internal Delay only
    and it compiled as expected. I have no clue if this will cause unexpected problems with my program or if this is the correct way to solve it but I haven't noticed any ill effects yet. Seems like this problem could be related to the SFR's but it's way above my level of knowledge.

    Just thought I'd pass it along.

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


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    NO! You can't just change the variable to BANK1!
    That variable must be in BANK0.

    Both DT_INTS-18 and VirtualPort.bas fit quite comfortably in an 18F87J50, with room to spare. Even when using PBPL.

    How many variables have you declared in BANK0 in your program?
    Or, what other include files are you using that may have variables placed in BANK0.
    DT

  3. #3
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    425


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Quote Originally Posted by Darrel Taylor View Post
    NO! You can't just change the variable to BANK1!
    Oh. The door was locked and I couldn't find the key so I just picked the lock.

    Quote Originally Posted by Darrel Taylor View Post
    How many variables have you declared in BANK0 in your program?
    Or, what other include files are you using that may have variables placed in BANK0.
    Good questions and ones that I wish I had answers for. I'm using HIDmaker so that's probably the root cause. Do I need to figure this problem out or is there a workaround?

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


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    I am trying to make an Interrupt on Rising Edge, PortB.0 on a 16F1827 chip.

    When first POR the device, it send the message "Program started" and waits for the Interrupt.

    When interrupt happens, Portb.0 is left open (it has pull-up enabled) the ISR is executed sending the message "Hey, I am sleeping!".

    And then keeps on sending the message even if the PortB.0 has been restored (grounded).

    Anyone sees what stupid thing I missed?

    Ioannis
    Attached Files Attached Files

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


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Ioannis,

    You just need to clear the IOCBF register before exiting the ISR.

    IOCBF = 0
    DT

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


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Oh, I see.

    I thought this was taken care by the DT-INTS.

    Thanks Darrel,
    Ioannis

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


    Did you find this post helpful? Yes | No

    Default

    That's what everyone else thinks too, so don't feel too bad.

    However, the "Interrupt On Change" on some chips have many interrupt flags that "funnel" into a single IOCIF flag.
    DT_INTS only knows about the one IOCIF flag. It has no control over the other 8 flags in the IOCBF register.

    It's alot like the USB modules which have 12 interrupt flags that funnel into a single USBIF flag.
    But for some reason, nobody expects DT_INTS to handle all of those automatically.
    Well actually, if you add DT_HID, they are handled automatically, but that's not the point.

    There are too many variations of the IOC interrupts.
    Some chips have them on PORTB, some on PORTA, and some have combinatons of PORTA, PORTB and PORTC.
    Its the one part of a PIC that you can pretty much assume won't work the same way as the last chip you used.

    And there are too many ways you can use IOC interrupts, there's no way I could make something that would work for everybody.
    It's much easier for the user to add one or two lines of code to clear the flags the way that best fits the application.
    DT

Similar Threads

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