assembly error on DT interrupts


+ Reply to Thread
Results 1 to 20 of 20

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Hello,
    This "DT_INTS-18-k80.bas" and the matching re-enter file, did you download them from somewhere or are you trying to customize the default ones yourself?

    I don't have those files and a simple search did not find them so I can't test much here except compiling a bare bones example with the standard DT-Ints-18 files and, needless to say, it compiles and assembles without errors.
    Code:
    CLEAR                       'Clears memoryinclude "codesize.pbp" .
    Define Measure 1
    
    wsave1 var byte $A0 system  ;location for W if in bank0
    wsave2 var byte $120 system ;location for W if in bank0                                           
    wsave3 var byte $1A0 system ;location for W if in bank0
    
    
    INCLUDE "DT_INTS-18.bas"    ; Basic Interrupt System
    INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
    
    DEFINE OSC 20              ' clock frequency
    DEFINE USE_HIGHPRIORITY 1  ' use high priority interrupts
    'define USE_LOWPRIORITY  1 ' not using low priority interrupts
     
    DEFINE WRITE_INT 1
    
    INTCON2.6 = 0           ' Int on falling edge 
                            
    ' Set up data direction registers for all the pins.
    TRISA = %00111111       ' Set PORTA RA6 is Osc output to crystal
    TRISB = %00101001       ' Set PORTB
    TRISC = %00010100       ' Set PORTC
    TRISD = %00000011       ' Set PORTD
    TRISE = %00111011       ' Set PORTE only lower 4 bits available
    
    ';----[High Priority Interrupts]----------------------------------------
    ASM
    INT_LIST  macro    ; IntSource,    Label,      Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ClockCount,   PBP,  yes  ;-- Timer Int.
            INT_Handler   INT0_INT,  _MoveCmd,      PBP,  yes  ;-- Flap Switch
       endm
        INT_CREATE          ; Creates High Priority interrupt processor
    ENDASM
    
    Main:
    GOTO Main
    
    '-------------------------------------------------------------------------------------------------
    ' Interrupt service routine
    '-------------------------------------------------------------------------------------------------
    ClockCount:
        LATA.0 = !LATA.0
    @ INT_RETURN
    
    MoveCmd:
        LATB.0 = !LATB.0
    @ INT_RETURN
    If you try the above with the stock DT-Ints files, does it compile? If you try with your K80-version of the DT-Ints files, does it compile?

    /Henrik.

  2. #2
    Join Date
    Apr 2022
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Hello Henrik,

    I tried to compile the original DT Interrupt file linked from the DT Interrupts tab above. It generated the same error as I listed in my first post. It says that the "INTHAND" was not previously defined. As you can see from the code listed on the DT Interrupts page, INTHAND was defined. It is not a processor problem because it reproduces with different processors. I am using the PIC18F46K80. It does not complain about the INTLHAN definition so I don't know what is going on here. I removed all my files and tried to compile just the original DT interrupts and got the same error.

    Thanks,

    Paul

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


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    I removed all my files and tried to compile just the original DT interrupts and got the same error.
    Something is wrong here... It sounds like you're trying to compile the DT-Ints file by itself, is that the case? If so, just stop doing that. They're not meant to compile by themself, they must be "fed" with information from the program in which they are used, namely the names of entry point for various interrupts, ie the INT_LIST macro (the part shown below).

    No, that's not what you're doing. OK, moving on...

    Like I said in my previous post, the code I posted does compile for the K80 using the stock DT-Ints-18 files.
    If you look closely the DEFINE USE_LOWPRIORITY is commented so not in play (same in your code above). If I uncomment that line I get Symbol not previously defined (INT_ENTRY_L) because I'm telling DT-Ints that I want to use low priority interrupts but have none defined.

    Then, if I remove the whole interrupt declaration part, ie
    Code:
    ASM
    INT_LIST  macro    ; IntSource,    Label,      Type, ResetFlag?
            INT_Handler   TMR1_INT,  _ClockCount,   PBP,  yes  ;-- Timer Int.
            INT_Handler   INT0_INT,  _MoveCmd,      PBP,  yes  ;-- Flap Switch
       endm
        INT_CREATE          ; Creates High Priority interrupt processor
    ENDASM
    I get both Symbol not previously defined (INT_ENTRY_L) and Symbol not previously defined (INT_ENTRY_H), again because I've now not told DT-Ints which interrupt handlers I want "connected" with what interrupts.

    /Henrik.

Similar Threads

  1. Assembly Interrupts for PIC 18F27K42
    By dtbarber in forum Code Examples
    Replies: 3
    Last Post: - 7th January 2021, 00:59
  2. Error using DT's Inst Interrupts and PIC BASIC PRO Long
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 6th December 2014, 18:11
  3. Replies: 1
    Last Post: - 30th March 2012, 04:13
  4. LP Instant Interrupts Error
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th December 2009, 09:13
  5. Replies: 2
    Last Post: - 8th February 2009, 05:10

Members who have read this thread : 18

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

Posting Permissions

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