Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jan 2006
    Posts
    31


    Did you find this post helpful? Yes | No

    Default Multiple interrupts

    Hi darrel,

    This is my follow up inquiry about your excellent code for multiple interrupts.

    I've seen your code and it was amazing. After compiling, Microcode studio locked up. I'm using PIC16F628A, 4MHz xTAL and PICBasic Pro v2.33.

    Your site states that MPASM is required. Does it have any relevance to the compilation?

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emavil View Post
    Your site states that MPASM is required. Does it have any relevance to the compilation?
    Besides the fact that it won't work without it. No.

    Hmmm, PBP V2.33
    There's been at least a hundred different things fixed with PBP since that version from Several years ago.
    There's no telling what could be going wrong with such an ancient compiler.

    Time to spend the 10 bucks for an upgrade.
    DT

  3. #3
    Join Date
    Jan 2006
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    thanks a lot for that reply.

    I have also this notion that its really the PBP Compiler that limits me from utilizing your code. thank you very much.

    With regard to PBP 2.33. I managed to enable the feature of 16F628A coz if we look at the installation files, only 16F628 is present.

    Now, my question is, what is really the minimum version of PBP just to compile your "multiple interrupt" codes?

    You said 10 bucks, with all your respect, can you let me have that upgrade for that amount. I'm just a hobbyist and purchasing a new PBP compiler by far costly for me? What are the possible solutions can you suggest?

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emavil View Post
    You said 10 bucks, with all your respect, can you let me have that upgrade for that amount. I'm just a hobbyist and purchasing a new PBP compiler by far costly for me? What are the possible solutions can you suggest?
    Hey PAL....Let me give you a little hint...

    WE'RE ALL JUST HOBBYISTS!!!

    What makes you so special? And it's 10 bucks. If you can't afford that, then you probably shouldn't be buying any more hardware until you can save up that amount.
    Oh...but you're looking at buying the new PBP compiler...which means that you can't upgrade.
    Why can't you upgrade? Is this because the version you have right now isn't exactly....oh nevermind...I give up...

    Another one for the list...
    Last edited by skimask; - 22nd March 2007 at 03:59. Reason: $10 for upgrade...$25 for upgrade plus manual...duh!!!

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by emavil View Post
    Now, my question is, what is really the minimum version of PBP just to compile your "multiple interrupt" codes?
    My first version of PBP was 2.40, and that had to be 6 or 7 years ago. I don't know of anything that would keep DT_INTS from working with that. But 2.33, geez how many years ago was that. There's just no way of knowing if anything would work with it.

    Quote Originally Posted by emavil View Post
    You said 10 bucks, with all your respect, can you let me have that upgrade for that amount. I'm just a hobbyist and purchasing a new PBP compiler by far costly for me? What are the possible solutions can you suggest?
    I'm not a PBP reseller, which are the only ones that can sell you an upgrade. And to do that, they would have to have sold PBP to you in the first place.

    If you can't afford the price of the compiler, then you've chosen the wrong hobby. Because you'll be spending hundreds, if not thousands on the different parts, modules, processors, displays etc. The compiler itself is a relatively small cost, comparatively.

    And you'll find that the people that did pay for the compiler, aren't willing to help someone that's pirated theirs. Sorry, but that includes ME.
    <br>
    DT

  6. #6
    Join Date
    Jan 2006
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    thanks for your advice Darrel, you're a man of character.

    anyway, i would like to ask an apology to those guys who were not able to grasp what i meant.

    I will consult MELabs about the technical details of this issue.

    I was trying to ask for a reasonable price and location for PBP coz in my place (Philippines) there's no reseller or distributor for MELABs products. I have to order it abroad. That's what i meant for "COSTLY". I have to pay for extra charges. Unlike if it is available in my country, its easy for me order the right version without spending extra charges.

    Right now i will just go back to the old drawing board and maximize my resources. I will find resources just save extra for an upgrade of the latest version of PBP.

    thanks anyway, this forum is the best. I love people who always criticize for good.

    with regard to my post about the digital clock that utilizes 6 7-segment displays for time display, Darrel do you something in mind to maintain the 1/100 tick accuracy while refreshing the 7-segments? Right now i can use only one interrupt (TMR1) for timer tick count. I do not know how to refresh the displays(7-segments). This is no problem for the LCD, right?
    Last edited by emavil; - 22nd March 2007 at 02:23.

  7. #7
    Join Date
    Jan 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default RBC interupt

    read the thread many times,

    pic 18F4525
    interupt on port B.0 works great with DT add-on using int0_int
    but on falling edge of incoming pulse
    the full program runs without any problem


    i want to change it on rising edge using rbc_int
    but - pic blocks - nothing works anymore ???
    even de ledflash sub .....
    what am i doing wrong - i don't see it.


    code



    '****************************
    ' as test for RBC_int
    INTCON.0 = 0 ' RBIF
    INTCON.3 = 1 ' RBIE
    ' INTCON2.0 = 1 ' RBIP
    '****************************
    ' ok for int0_int on port B but falling edge ( unusable in this case)

    INTCON2.6 = 1 ' rising edge ????
    INTCON.1 = 0
    INTCON.4 = 1 ' enable int0 interrupt RB0
    '****************************
    ' include special interupts
    INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
    INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
    INCLUDE "Elapsed_INT-18.bas" ; Elapsed Timer Routines

    ASM
    INT_LIST macro ; IntSource, Label, Type, ResetFlag?
    ; INT_Handler INT0_INT, _triggertest, PBP, yes
    INT_Handler RBC_INT, _triggertest, PBP, yes
    INT_Handler TMR1_INT, _ClockCount, PBP, yes
    endm
    INT_CREATE ; Creates the interrupt processor
    ENDASM
    gosub initial ; all var to 0
    gosub ledflash ; flash leds 10 times
    T0CON = %10010010 ; T0 = 16-bit, Prescaler 8
    ;@ INT_ENABLE INT0_INT ; enable external (INT) interrupts
    @ INT_ENABLE RBC_INT ; enable RB (INT) interrupts on change
    @ INT_ENABLE TMR1_INT ; Enable Timer 1 Interrupts

    GOSUB ResetTime ; Reset Time to 0d-00:00:00.00
    GOSUB StartTimer ; Start the Elapsed Timer


    '*******************************************
    Main:
    if trig_in =1 then
    ................
    endif

    trig_in = 0
    goto main
    '******************************************
    ';---[INT - interrupt handler]--------------------------
    triggertest:
    trig_in = 1 ' set flag interupt
    @ INT_RETURN
    end

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


    Did you find this post helpful? Yes | No

    Default

    tiger_bel,

    RBC_INT's generate an interrupt on BOTH edges of RB4 thru RB7. You can't set it to just Rising or Falling.

    Then once it interrupts, you have to read PORTB to "End the Mismatch".
    A simple Dummy = PORTB in the handler will do it.

    You also need to compare that read, with the value of PORTB the last time it interrupted to figure out which pin changed, and which state it changed to.
    <br>
    DT

  9. #9
    Join Date
    Jan 2005
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    many thanks for the info,

    i just figured out that using a simple sub to scan the port works fine...
    and i use port B.0 not 4...7

    rgds
    tb

  10. #10
    Join Date
    Mar 2011
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    I have a fair amount of experience with MPLab and PBP. I'm trying to hook up instant interrupts, and have run into an odd situation. I've pored through the ASM file, source file, compiler and assembler manuals, and the MPLab info, and searched on line, including here. I'm sure it's simple and I'll slap my own forehead when someone points it out, but ... well, if you can supply a pointer, I'd be grateful.

    I'm trying to compile the instant interrupts "BlinkyLight" program, which is as follows:

    Code:
    ' ================================
    ' this Blinky Light program will continue Blinking at the same rate, no
    ' matter what else you add to the Main: program loop.
    LED1   VAR  PORTB.1
    
    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,  _ToggleLED1,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    T1CON = $31                ; Prescaler = 8, TMR1ON
    @ INT_ENABLE  TMR1_INT     ; enable Timer 1 interrupts
    
    Main:
      PAUSE 1
    GOTO Main
    
    ' ---[TMR1 - interrupt handler]--------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    ' ======================================
    I'm running MPLab v8.60 with PBP 2.60a. I have used this setup to successfully compile to HEX other programs in PBP. MPASM is the assembler, and I'm using the 110 level of instant interrupts.

    I get this odd error from the assembler that it cannot continue, as follows:
    Code:
    Executing: "C:\PBP\PBPMPLAB.BAT" -p16F628A -ampasmwin -k# "BlinkyLight1.bas"
    Executing: "C:\PBP\PBPW.EXE" -p16F628A -ampasmwin -k# "BlinkyLight1.bas"      
    PICBASIC PRO(TM) Compiler 2.60A, (c) 1998, 2010 microEngineering Labs, Inc.
    All Rights Reserved.
    
    ERROR: Unable to execute mpasmwin.Error[101]   E:\AVS\V2 DEVT\DUAL DELAY\BLINKYLIGHT1.ASM 231 : ERROR: (wsave variable not found,)
    Error[101]   E:\BLINKYLIGHT1.ASM 195 : ERROR: ("                     Add:"       wsave VAR BYTE $70 SYSTEM)
    Error[101]   E:\BLINKYLIGHT1.ASM 252 : ERROR: (Chip has RAM in BANK1, but wsave1 was not found.)
    Error[101]   E:\BLINKYLIGHT1.ASM 202 : ERROR: ("   Add:"       wsave1 VAR BYTE $A0 SYSTEM, Or change to   wsave BYTE $70 SYSTEM)
    Error[101]   E:\BLINKYLIGHT1.ASM 268 : ERROR: (Chip has RAM in BANK2, but wsave2 was not found.)
    Error[101]   E:\BLINKYLIGHT1.ASM 209 : ERROR: ("   Add:"       wsave2 VAR BYTE $120 SYSTEM, Or change to   wsave BYTE $70 SYSTEM)
    BUILD FAILED: Thu Mar 10 13:21:14 2011
    It looks like the problem is in assembling the instant interrupts code - I think. I clearly have something set up wrong, but what?? Just point me in the direction and I'll go find it.
    Last edited by R.G.Keen; - 10th March 2011 at 20:47. Reason: can't spell... 8-)

  11. #11
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Read the error message. It tells you what to do.
    Dave
    Always wear safety glasses while programming.

  12. #12
    Join Date
    Mar 2011
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Got it. Thanks very much. Somehow I missed that the error message was the cure.

    I understand the issue now. It seems to work Now got to go burn chips...

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    Darrel has changed the way DT-INTs work now.

    It may surprise but is far better now.

    Happy burning

    Ioannis

  14. #14
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default Re: Instant Interrupts - Revisited

    You have error messages that tell you exactly what to do:

    Add wsave etc...

    Look into your DT-INT-14.bas file at the first section that says:

    ;-- Place a copy of these variables in your Main program -------------------
    ;-- The compiler will tell you which lines to un-comment --
    ;-- Do Not un-comment these lines --

    and follow the instructions of the errors you get.

    Ioannis

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

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