Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    I like the 683 too. If for nothing more than the CCP module. Of course the extra RAM and program space is also handy.

    With the 629 only having 64 bytes of RAM,
    PBP uses 24-26 bytes
    and DT_INTS-14 and ReEnterPBP want 31 bytes of it (without T? vars)

    Which only leaves about 6-7 bytes for the program. Not much you can do with that.

    But, when using ASM interrupt handlers, DT_INTS-14 only needs 7 bytes of RAM, leaving around 38 bytes for the users program. Now that, is workable. It also uses less program space that way.

    You mentioned earlier that you only needed to toggle a pin in the interrupt, so you might take a look at this page...

    DT_INTS-14 (Assembly Language Interrupts)
    http://www.darreltaylor.com/DT_INTS-14/asm_ints.html

    The ToggleLED1: handler does just that. And if the other handlers aren't too tuff, you might still fit it in a 629.

    HTH,
      DT

  2. #2
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Darrel

    I'm going to be moving a project from a 16F88 to an 18F1320. The reason for the move is the 18F1320 has 3 external interrupts, 2 of which I will be using. Currently I'm using instant interrupts and INT_INT on the 16F88. The question is will instant interrupts work with multiple external interrupts? I see in the datasheet that the external interrupts have numbered flags.

  3. #3
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen
    Darrel

    I'm going to be moving a project from a 16F88 to an 18F1320. The reason for the move is the 18F1320 has 3 external interrupts, 2 of which I will be using. Currently I'm using instant interrupts and INT_INT on the 16F88. The question is will instant interrupts work with multiple external interrupts? I see in the datasheet that the external interrupts have numbered flags.
    See http://darreltaylor.com/DT_INTS-18/home.html. Darrel has done a good job documenting the Instant Interrupts, and it shows on the right side of the page that multiple external interrupts are implemented.

    Steve

  4. #4
    Join Date
    Jun 2005
    Location
    Wisconsin
    Posts
    382


    Did you find this post helpful? Yes | No

    Default

    Thanks Steve, I forgot that he was using a separate version for the 18Fs.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Its now 7:34 am, I just read this thread from start to finish, I would like to say it went completely over my head but some must have aimed a bit lower as I now have one hell of an headache........

    I read it as I have just got a shiny new programmer and a 18f2550, I was looking for ways to port some old f88 stuff I wrote that used serial comunication, I want to it to use usb...

    I found that they are some examples to make the 2550 emulate a serial port, and I may go that way, seems easier to port that way.

    Then I read more and got more ambitious, and was wondering if I can port it over with the 2550 running fake serial over usb, but drop a bootloader in it before my old f88 code and use the bootloader over usb, then I wont need to use my pc serial port at all?


    To summise, can I re-burn the chip via usb with a boot loader to debug my ported f88 code?

    If I can, am I right in thinking all I need is to give up one i/o line to a switch to trigger the bootloader?

    And like most things come in three's (especially questions), how to edit/burn to usb? with the f88 I usually create a hex file, quit basic, load the programmer software (winpic/whatever) and burn chip, remove from programmer, get a pin stuck in thumb and lose blood, stick in proto board, bend a pin etc...

  6. #6
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default

    Lez, you might want to check the USB forum for that information.

    Robert
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  7. #7


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Demon
    Lez, you might want to check the USB forum for that information.

    Robert
    Either I'm really dumb today (I blame last night) or their is no usb sub forum etc on here!

    found a few threads, gave me some stuff to read and I'm about ready to try and knock up a pcb to test the chip with, then i'll have a go with the mouse circle hid to test wiring, then throw in the serial demo and expand on that, thanks.
    Last edited by Demon; - 4th October 2016 at 18:42.

  8. #8
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by DynamoBen
    Darrel

    I'm going to be moving a project from a 16F88 to an 18F1320. The reason for the move is the 18F1320 has 3 external interrupts, 2 of which I will be using. Currently I'm using instant interrupts and INT_INT on the 16F88. The question is will instant interrupts work with multiple external interrupts? I see in the datasheet that the external interrupts have numbered flags.

    Maybe assigning high & low priorities might help you:
    http://darreltaylor.com/DT_INTS-18/LowPriority.html

    One problem I am having now is that an internal interrupt (USB Service) seems to lose connection after I use an external interrupt (incoming USART data). Assigning a priority to each is just what I'm about to test and see how things go.

    Robert
    Last edited by Demon; - 15th August 2006 at 04:22.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

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


    Did you find this post helpful? Yes | No

    Default

    Sounds like a good idea.

    Since an HSERIN can take up to several hundred milliseconds (depending on baud rate and data size), it's best to have HSERIN in a Low Priority handler.

    And things that "must" go without fail, in the High Priorities.

    DT

  10. #10
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default

    Yup, that's what I was thinking, having the USB SERVICE come first, and have the USART interrupt 'whenever'.

    Edit: WEEE !!!

    Robert
    Last edited by Demon; - 15th August 2006 at 04:22.
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  11. #11
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,170


    Did you find this post helpful? Yes | No

    Default

    Darrel,

    How about this one? I have one interrupt to generate a USB Service, that part works fine. I'd like to add another interrupt for USB reception, is that what USB_INT is for?

    Here is a snip of code:


    Code:
    ;----[High Priority Interrupts]-----------------------------------------------
    ASM
    INT_LIST  macro    ; IntSource,        Label,      Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ServiceUSB,    PBP,  yes
            INT_Handler   USB_INT,    _ReceiveUSB,   PBP,  yes
        endm
        INT_CREATE               ; Creates the High priority interrupt processor
    ENDASM
    
    '---[USB - interrupt handler]------------------------------------------------
    ReceiveUSB:
       @ INT_DISABLE TMR1_INT   ; disable USB service interrupt
       USBBufferCount = USBBufferSizeRX 
    DoUSBIn:
       USBservice ; Generate USB Service manually
       USBIn 1, USBBuffer, USBBufferCount, DoUSBIn
       varUsbIn = conByteHigh  ' Set flag data has arrived
    @ INT_ENABLE  TMR1_INT   ; enable USB Service interrupts
    @ INT_RETURN
    
    '---[TMR1 - interrupt handler]--------------------------------------------------
    ServiceUSB:
        USBservice
    @ INT_RETURN
    Does that make sense? Or can I leave the USB Service interrupt enabled throughout the USB Reception interrupt?

    Robert
    Last edited by Darrel Taylor; - 15th August 2006 at 07:45. Reason: added [code][/code] tags
    My Creality Ender 3 S1 Plus is a giant paperweight that can't even be used as a boat anchor, cause I'd be fined for polluting our waterways with electronic devices.

    Not as dumb as yesterday, but stupider than tomorrow!

  12. #12
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    almost 3 Am here.. it sounds good to me BUT i'll suggest to remove the USBSERVICE in the INT handler... m i'm sure i miss something anyway...
    Last edited by mister_e; - 15th August 2006 at 08:04.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

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


    Did you find this post helpful? Yes | No

    Default

    Well, I don't really know.

    But, the datasheet for the 18F4550 shows 12 different interrupts from the USB module that all funnel into the single USB_INT. So I doubt it's that easy.

    But if I were going to try it, I might set the ...

    TRNIE: Transaction Complete Interrupt Enable bit

    and see what happens.

    DT

    Added: and then all the others just to be sure.

  14. #14
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default 12F683 code to 12F629

    Quote Originally Posted by Darrel Taylor View Post
    I like the 683 too. If for nothing more than the CCP module. Of course the extra RAM and program space is also handy.

    With the 629 only having 64 bytes of RAM,
    PBP uses 24-26 bytes
    and DT_INTS-14 and ReEnterPBP want 31 bytes of it (without T? vars)

    Which only leaves about 6-7 bytes for the program. Not much you can do with that.

    But, when using ASM interrupt handlers, DT_INTS-14 only needs 7 bytes of RAM, leaving around 38 bytes for the users program. Now that, is workable. It also uses less program space that way.

    You mentioned earlier that you only needed to toggle a pin in the interrupt, so you might take a look at this page...

    DT_INTS-14 (Assembly Language Interrupts)
    http://www.darreltaylor.com/DT_INTS-14/asm_ints.html

    The ToggleLED1: handler does just that. And if the other handlers aren't too tuff, you might still fit it in a 629.

    HTH,
      DT
    Hi Darrel,
    I tried this above tip to get back some RAM space to try put my old 12F683 code into a 12F629, but I get a persistent PBP error when I try to compile it.

    error[101] d:temp\8chppm~3.asm 450: Error: (ReEnterPBP must be INCLUDEd to use PBP type interrupts)

    I also fiddled the wsave value to get past other errors, but this one escapes me, due to not being very familiar with assembly I'd expect.

    Heres my ASM code at the start of the program, what did I mess up ?
    Thanks Martin
    'Interrupt driven 20mS timer for PPM frame timing. See also "my_handler". Uses Timer 1 interrupts.
    INCLUDE "DT_INTS-14.bas" ' Base Interrupt System
    'INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts

    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    INT_Handler TMR1_INT, _my_handler, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts

    ENDASM

    T1CON = $1 ; TMR1ON
    '@ INT_ENABLE TMR1_INT ; enable Timer 1 interrupts

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


    Did you find this post helpful? Yes | No

    Default The Error says it all

    error[101] d:temp\8chppm~3.asm 450: Error: (ReEnterPBP must be INCLUDEd to use PBP type interrupts)

    'INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
    \<-- commented

    INT_Handler TMR1_INT, _my_handler, PBP, yes

    Ahhh chuew ...
    DT

  16. #16
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    error[101] d:temp\8chppm~3.asm 450: Error: (ReEnterPBP must be INCLUDEd to use PBP type interrupts)

    'INCLUDE "ReEnterPBP.bas" ' Include if using PBP interrupts
    \<-- commented

    INT_Handler TMR1_INT, _my_handler, PBP, yes

    Ahhh chuew ...
    Hi,
    Sorry Darrel I'm even more confused from the reply. I interpreted your old post and the website info to mean that if I wasn't using PBP interrupts e.g. 'On Interrupt' that I could rem out the ReEnterPBP.bas include. I see I'm interpreting that post wrong.
    Can I take that reply to mean that in this case I can't do that, or does this mean I need to write the handler in ASM ?

    That's MR Ahhh Cheuw :-)

  17. #17
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default

    Hi,
    You can use Darrels routines with interrupt service routines written in assembly and/or BASIC. If the interrupt service routines you write are written in BASIC (PBP) you should declare them as type PBP in the INT_LIST AND you must INCLUDE ReEnterPBP.bas. If you write your interrupt service routines in assembly you declare them as Type ASM in in the INT_LIST and then ReEnterPBP file is NOT needed because you're not using ISR's written in BASIC. Anytime one or more of you ISR's are written in BASIC the ReEnterPBP file must be included, only when all handlers are in ASM can it be left out.

    ON INTERRUPT is the compilers own way of handling interrupts and has nothing to do with DT_Ints. You use either ON INTERRUPT or Darrels routines.

    /Henrik.

  18. #18
    Join Date
    Nov 2008
    Posts
    96


    Did you find this post helpful? Yes | No

    Default

    Thanks Henrik, that explanation is clear, concise, and fully understood now.

    cheers,
    Martin

  19. #19
    Join Date
    Jan 2010
    Location
    PHILADELPHIA, PA - USA
    Posts
    34


    Did you find this post helpful? Yes | No

    Default Understanding RBC_INT

    Well I think I've finally figured out some of the nuances of RBC_INT.
    I think the last example I tried to use was not a very good way to test it out.

    I tried to document this working code example in a way that's understandable and can be used as a template to build on.

    This is setup with PBP type interrupts using ReEnterPBP-18.bas, since I'm using PBP in the Interrupt handler, but ... it seems to work just fine when run as ASM type, and not including ReEnterPBP-18.bas. You can just uncomment out the appropriate lines to suit your needs.

    The thing that was giving me so much of a headache before was the need to read one of the Port B <4-7> registers prior to exiting the Interrupt handler. This ends the mismatch condition and allows the RB Port Change Interrupt Flag Bit to be cleared. Even though I was reading the Port B <4-7> registers frequently, it seems that using GOTO to enter the Interrupt handler exit subroutine, caused the Interrupt Flag Bit to reset.

    Program operation:
    This Program uses DEBUG to send status comments to a 9600 Buad Serial ASCII Terminal on PORTC.6
    On first press of any of the PORTB<4-7> buttons, the program enters the interrupt handler.
    The Interrupt Handler, continuously reads the buttons.
    Buttons 1,2 & 3 just display a status message. You could put any subroutine in place of the DEBUG Statement.
    Button 4 gracefully exits the interrupt handler.
    At this point, RBC_INT is reset and awaiting any PORTB<4-7> button press again to reenter the Interrupt handler.


    Anyway here's the Code and a schematic of the setup... I hope this helps someone who's struggling with RBC_INT like I was.
    The ZIP file attachment has the code, and copies of the version of DT_INTS-18.bas and ReEnterPBP-18.bas that are included.

    Bob W.

    Code:
    ' RBC TEST.BAS
    ' Bob Wozniak
    ' PIC 18F6480 @ 20 MHZ
    ' MPLAB IDE V8.40  /  PBP V2.60  /  Build Options: [-ampasmwin]
    ' RB4  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RB5  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RB6  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RB7  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RC6  22K ohm to RX on 57600-N-8-1 Serial Terminal
    ' This program created to check Port-B Change Interrupts
    
    INCLUDE "DT_INTS-18.bas"		  ; Include Darrel Taylor's Base Interrupt System for PIC18F [Version:3.4 (NOV 04, 2009)]
    INCLUDE "ReEnterPBP-18.bas"      ; Need to include if using PBP type interrupts
    
    DEFINE OSC 20
    
    DEFINE DEBUG_REG PORTC	' SETUP DEBUG to view output on 9600 BAUD ASCII Terminal on PORTC.6
    DEFINE DEBUG_BIT 6 			
    DEFINE DEBUG_BAUD 9600
    DEFINE DEBUG_MODE 1 
    
    I VAR WORD
    X VAR BYTE
    
    ASM
    INT_LIST  macro ; IntSource,  Label,             Type, ResetFlag?
    ;       INT_Handler RBC_INT, _RBC_INT_HANDLER,   ASM,  no             ; use for ASM type interrupts
            INT_Handler RBC_INT, _RBC_INT_HANDLER,   PBP,  no             ; use for PBP type interrupts
        endm
        INT_CREATE
    ENDASM
    @ INT_ENABLE   RBC_INT
    
    
    
    HOLD_HERE:          ' **** This subrouting loops continuously and waits for button press to activate RBC interrupt handler
    IF I = 0 THEN DEBUG 10,13,10,13,"HOLDING FOR PORTB <4-7> BUTTON PRESS to ACTIVATE INTERRUPT",10,13 : I = 1
    PAUSE 10
    GOTO HOLD_HERE
    
    
    
    RBC_INT_HANDLER:     ' **** Program jumps here when ANY PORTB.4 thru PORTB.7 are changed ****
    DEBUG "############### RBC INTERRUPT ACTIVATED #################",10,13
    PAUSE 250    ' This pause allows time for button debounce - needs to be here unless immediate read of interrupt button req'd
    
    
    READ_BUTTONS:        ' **** Program cycles reading buttons, until button 4 is pressed ****
    If PORTB.4 = 1 Then DEBUG "BUTTON 1 PRESSED",10,13
    If PORTB.5 = 1 Then DEBUG "BUTTON 2 PRESSED",10,13
    If PORTB.6 = 1 Then DEBUG "BUTTON 3 PRESSED",10,13
    If PORTB.7 = 1 Then DEBUG "BUTTON 4 PRESSED - EXITING",10,13 : I = 0 : GOTO END_RBC_INT
    PAUSE 5  
    GOTO READ_BUTTONS
    
    
    END_RBC_INT:        ' **** this subroutine gracefully exits the interrupt handler and resets for next RBC event ****
    PAUSE 250              ; This pause allows time for button debounce - needs to be here or interrupt will immediatly reactivate
    DEBUG "################ EXITING RBC INTERRUPT HANDLER ############",10,13
    
    X = PORTB.7            ; NOTE: Prior to returning from RBC Interrupt, you MUST read at least 1 PORTB <4-7> to end
                           ; the mismatch condition and allow the RB Port Change Interrupt Flag Bit to be cleared.
                           ; If not here, the interrupt will immediatly reactivate if using the GOTO END_RBC_INT statement.
    @ INT_CLEAR RBC_INT
    @ INT_ENABLE RBC_INT
    @ INT_RETURN
    END

    Attached Images Attached Images  
    Attached Files Attached Files
    Last edited by WOZZY-2010; - 20th February 2010 at 05:54. Reason: clarify
    Wozzy-2010

  20. #20
    Join Date
    Jan 2010
    Location
    PHILADELPHIA, PA - USA
    Posts
    34


    Did you find this post helpful? Yes | No

    Default Understanding RBC_INT... or not

    Hi,

    I've been trying vary to fully understand the RBC_INT interrupt handler in DT_INTS-18.pbp.

    So I wrote this little program, Created a simulator circuit model and also a similar hardware circuit.

    Here is the Code:
    Code:
    ' RBC TEST.BAS
    ' PIC 18F6480
    ' MPLAB IDE V8.40
    ' PBP V2.60
    ' Build Options: [-ampasmwin]
    ' RB4  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RB5  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RB6  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RB7  Momentary Contact Button Goes High on Press,  10K Resistor to Ground
    ' RC6  22K ohm to RX on 57600-N-8-1 Serial Terminal
    
    INCLUDE "DT_INTS-18.bas"		; Include Darrel Taylor's Base Interrupt System for PIC18F [Version:3.4 (NOV 04, 2009)]
    
    DEFINE OSC 20
    DEFINE DEBUG_REG PORTC	
    DEFINE DEBUG_BIT 6 			
    DEFINE DEBUG_BAUD 57600
    DEFINE DEBUG_MODE 1 
    DEFINE  SHOWDIGITAL 1
    
    TRISB=%11111111
    ADCON0=%00000000
    ADCON1=%00001111
    
    BTN	  VAR	BYTE
    
    ASM
    INT_LIST  macro ; IntSource,  Label,      Type,  ResetFlag?
            INT_Handler RBC_INT, _DO_RBC_INT,   ASM,  yes	
        endm
        INT_CREATE
    ENDASM
    
    @  INT_ENABLE   RBC_INT
    
    DEBUG "INTERRUPT CREATED",10,13
    DEBUG "INTERRUPT ENABLED",10,13
    
    HOLD_HERE:
    DEBUG "WAITING FOR INTERRUPT",10,13
    PAUSE 2500
    GOTO HOLD_HERE
    
    DO_RBC_INT
    DEBUG "############### RBC INTERRUPT ACTIVATED #################",10,13
    
    MENU:
    PAUSE 200
    DEBUG "MENU - READ BUTTONS",10,13
    If PORTB.4 = 1 Then PAUSE 250: Goto DO_ENABLE
    If PORTB.5 = 1 Then PAUSE 250: Goto DO_DISABLE
    If PORTB.6 = 1 Then PAUSE 250: Goto DO_RETURN
    If PORTB.7 = 1 Then PAUSE 250: Goto DO_CLEAR
    GOTO MENU
    
    DO_ENABLE:
    DEBUG "RUNNING DO_ENABLE",10,13
    @ INT_ENABLE RBC_INT
    Pause 250
    GOTO HOLD_HERE
    
    DO_DISABLE:
    DEBUG "RUNNING DO_DISABLE",10,13
    @ INT_DISABLE RBC_INT
    PAUSE 250
    GOTO HOLD_HERE
    
    DO_RETURN:
    DEBUG "RUNNING DO_RETURN",10,13
    @ INT_RETURN
    PAUSE 250
    GOTO HOLD_HERE
    
    DO_CLEAR:
    DEBUG "RUNNING DO_CLEAR",10,13
    @ INT_CLEAR RBC_INT
    PAUSE 250
    GOTO HOLD_HERE
    
    END
    Here is the Circuit:


    There are 4 buttons connected to PORT B <4.7>
    Here are my observations:

    The first press of any button activates the RBC Interrupt and sends program to DO_RBC_INT subroutine, then on to MENU where it checks for button presses. This behaves exactly as I would expect it to.

    Now...After that....

    Pressing Button RB.4 [ENABLE] Runs the DO_ENABLE subroutine then the HOLD_HERE subroutine. At this point, the Interrupt handler seems to shut down as no Port B inputs activate the interrupt handler. I would expect the Interrupt to remain active.

    Pressing Button RB.5 [DISABLE] Runs the DO_DISABLE subroutine then the HOLD_HERE subroutine. The Interrupt handler is now disabled as expected.

    Pressing Button RB.6 [RETURN] Runs the DO_RETURN subroutine then the HOLD_HERE subroutine. It then sends program to DO_RBC_INT subroutine, then on to MENU. I would expect it to return to HOLD_HERE which is wherr the interrupt was originally activated

    Pressing Button RB.7 [CLEAR] Runs the DO_CLEAR subroutine. At this point, the Interrupt handler seems to shut down as no Port B inputs activate the interrupt handler. I would expect this to just clear the interrupt then await another RBC trigger.

    So it seems I can only activate the interrupt one time.

    It doesn't seem to matter whether I use ASM or PBP types or set Resetflag to yes, or no

    Can anyone shed light on what I'm doing wrong, or am I simply misinterpreting the function of the INT_* utilities.

    I'm just not sure if I've got a mistake, am staying up too late working on this stuff, or just really don't get it.

    Thanks,
    Bob
    Attached Images Attached Images  
    Attached Files Attached Files
    Wozzy-2010

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


    Did you find this post helpful? Yes | No

    Default

    The idea of an Interrupt, is that it Stops the normal flow of the program ... executes an Interrupt Service Routine (ISR) ... then RETURNs back to the same point it was at when it was Interrupted.

    You can't go back to the Main Loop without INT_RETURN'ing.
    In other words ... no GOTO HOLD_HERE.
    <br>
    DT

  22. #22
    Join Date
    Jan 2010
    Location
    PHILADELPHIA, PA - USA
    Posts
    34


    Did you find this post helpful? Yes | No

    Default Not understanding RBC_INT

    Darrel,

    Thanks for the quick reply.

    I made a cut & paste error in my last post.

    It should have stated:
    Pressing Button RB.6 [RETURN] Runs the DO_RETURN subroutine. It then sends program to DO_RBC_INT subroutine, then on to MENU. I would expect it to return to HOLD_HERE which is where the interrupt was originally activated.

    Pressing Button RB.7 [CLEAR] Runs the DO_CLEAR subroutine Then the HOLD_HERE. At this point, the Interrupt handler seems to shut down as no Port B inputs activate the interrupt handler. I would expect this to just clear the interrupt then await another RBC trigger.

    I agree that it should never get to the GOTO HOLD_HERE statement, at the end of DO_RETURN:, but should still end up in HOLD_HERE since that is where the program was was when the RBC_INT interrupt was initially activated.
    Wozzy-2010

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 : 6

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