Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Posts
    35


    Did you find this post helpful? Yes | No

    Question Darrels' Bring Together Interrupts

    Hello,


    I have been toying with Darrels' interrupts and the elapsed timer

    programs. It's an amazing piece of work and just what I need at the

    moment. Thanks!

    Going on, I tried the "bring together" demo but that didn't go so

    well. It won't compile using MPASM. The error messages are ;


    FATAL ERROR too many errors
    Error line 15: redefination of VAR. (DT_INTS-14.bas)
    Error line 26: redefination of VAR. (DT_INTS-14.bas)
    Error line 27: redefination of VAR. (DT_INTS-14.bas)


    ........Etc.


    I am using the Pic 16f877 but that shouldnt matter at this point.

    Any ideas?

    Thanks John
    Thanks,
    Homerclese

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


    Did you find this post helpful? Yes | No

    Default

    mmm, weird, no problem here. so we talk about
    http://darreltaylor.com/DT_INTS-14/combine.html

    If so, did you add something special in the code or you're using EXACTLY the following...
    Code:
    LED1   VAR  PORTD.0
    LED2   VAR  PORTD.1
    
    INCLUDE "DT_INTS-14.bas"     ' Base Interrupt System
    INCLUDE "ReEnterPBP.bas"     ' Include if using PBP interrupts
    INCLUDE "Elapsed_INT.bas"    ' Elapsed Timer Routines
    
    ASM
    INT_LIST  macro    ; IntSource,        Label,  Type, ResetFlag?
            INT_Handler    INT_INT,  _ToggleLED1,   PBP,  yes
            INT_Handler   TMR0_INT,  _ToggleLED2,   PBP,  yes
            INT_Handler   TMR1_INT,  _ClockCount,   PBP,  yes
        endm
        INT_CREATE               ; Creates the interrupt processor
    ENDASM
    
    OPTION_REG = OPTION_REG & $80 | 1  ; Set TMR0 Prescaler to 256, leave RBPU alone
    @    INT_ENABLE   INT_INT     ; enable external (INT) interrupts
    @    INT_ENABLE  TMR0_INT     ; enable Timer 0 interrupts
    @    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 SecondsChanged = 1 THEN  
           SecondsChanged = 0
           LCDOUT $FE,$C0, DEC Days,"d-",DEC2 Hours,":",DEC2 Minutes,":",DEC2 Seconds
        ENDIF
    GOTO Main
    
    '---[INT - interrupt handler]---------------------------------------------------
    ToggleLED1:
         TOGGLE LED1
    @ INT_RETURN
    
    '---[TMR0 - interrupt handler]-------------------------------(Blinky Light)------
    T0Count  VAR WORD
    ToggleLED2:
        T0Count = T0Count + 1
        IF T0Count = 512 THEN T0Count = 0 : TOGGLE LED2
    @ INT_RETURN
    which version of PBP and MPASM are you using?

    Are all files located in the same folder?
    Last edited by mister_e; - 2nd March 2007 at 01:11.
    Steve

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

  3. #3
    Join Date
    Oct 2005
    Posts
    35


    Did you find this post helpful? Yes | No

    Question

    Hello,

    I tried a cut and paste of your code and got a whole new set of errors. The only code differences I could find were the ones at the top for outputting to a LCD display. The include files all exist in my usual PBP folder. I'm using Microcode Studio version 2.2.1.1 with Pic Basic Pro 2.40.


    Thanks John
    Thanks,
    Homerclese

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


    Did you find this post helpful? Yes | No

    Default

    did you get...
    <img SRC="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1438&stc=1&d=117284877 8">

    If so, make sure you have selected MPASM in the View>> Compile And Program option >>> Assembler

    EDIT
    Pic Basic Pro 2.40.
    I don't know if it could be the problem... The current version is now 2.47.
    Attached Images Attached Images  
    Steve

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

  5. #5
    Join Date
    Oct 2005
    Posts
    35


    Did you find this post helpful? Yes | No

    Question

    Gettin' better!

    MPASM box was not checked. I didn't know it existed. No errors on compile now, however it can not find the .HEX file for programming. I did a system search and there is no .HEX file generated after compile. There are .HXH and .HXL files.

    Is your result box a screen capture?

    Thanks again
    Thanks,
    Homerclese

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


    Did you find this post helpful? Yes | No

    Default

    It happen because you probably have selected INH8XS file format under the MPASM check box. use INHX8M instead.

    Is your result box a screen capture?
    Yes indeed, CTRL + PrintScr, then you paste it in Paint or whatever else to edit it.
    Steve

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

  7. #7
    Join Date
    Oct 2005
    Posts
    35


    Did you find this post helpful? Yes | No

    Question

    Good, That worked. However, when I add a line to the top of the program as simple as :
    TRISA = %00000000
    AlarmOUT VAR PORTA.0

    I get

    Error[113 cbp\pbpic14.lib 1588 : Symbol not previously defined (port A)
    Error[113 cbp\pbpic14.lib 1612 : Symbol not previously defined (port A)
    Error[113 cbp\pbpic14.lib 1619 : Symbol not previously defined (port A)

    .........Etc.


    Also, going back to the previously working "elapsed timer demo" and using the MPASM settings I get the same type of errors there if I try to add a port reference.

    I can get the result box into Photoshop but can't get the edited image to paste into the forum.


    Thanks
    Last edited by Homerclese; - 3rd March 2007 at 20:44.
    Thanks,
    Homerclese

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