assembly error on DT interrupts


+ Reply to Thread
Results 1 to 20 of 20
  1. #1
    Join Date
    Dec 2021
    Location
    Illinois, USA
    Posts
    11

    Default assembly error on DT interrupts

    When assembling the DT Interrupts for the 18F, I get the following error.
    [ASM ERROR] Symbol not previously defined (INT_ENTRY_H) (0) : Error[113]

    Below is the code from DT's Interrupt code.

    Code:
    
    DEFINE  INTHAND       INT_ENTRY_H  ' Context saving for High Priority Ints
    DEFINE  INTLHAND      INT_ENTRY_L  ' Context saving for Low Priority Ints
    This is being used on a PIC18F46K80. Any idea why the assembler might be complaining? Has anyone else run into this?

    -Thanks

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,042


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Quote Originally Posted by Zapman View Post
    ...
    Below is the code from DT's Interrupt code.
    ...
    Do you have a link to DT's code?

    A copy of your code wouldn't hurt either.

    It might help give us a clue to the problem.
    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!

  3. #3
    Join Date
    Apr 2022
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Hello Demon,

    the two line code snippet is from the interrupt code on this site. Downloads | Book of Interrupts

    I
    t is where the variable is defined and yet the assembler complains about it.

    I was wondering if anyone else had this happen. It also shows up in the error file.

    Thanks,

    Paul

  4. #4
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,042


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    For one, there's an order to place the DT includes in your program.

    And it would REALLY help to see your complete code.
    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!

  5. #5
    Join Date
    Apr 2022
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Hello Demon.

    here is the code. It does not show any errors for the main code but the DT interrupts when assembled gives the error code listed above.


    Code:
    CLEAR                       'Clears memoryinclude "codesize.pbp"      'measure the size of the code.
    Define Measure 1
    
    
    '..... If any of these next three lines cause an error 
    '......Comment them out to fix the problem...
    '......which variables are needed, depends on the chip you are using.......
    
    
    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-k80.bas"; Basic Interrupt System
    INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
    'INCLUDE "ReEnterPBP-18LP.bas"  ; Include if using Low Priority. PBP INTS
    INCLUDE "modedefs.bas"      'defines modes for serial in and out
    INCLUDE "ProfileGen3.pbp"   'Motion profile generator for motor move
    INCLUDE "incPIDv1_5.pbp"    'include the PID controller
    INCLUDE "CANBus.pbp"        'CAN bus header file
    
    
    
    
    ' Define clock speed
    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
    
    
    '*********************************************************************
    ' have to define this so interrupts are masked when doing EEPROM
    ' writes.  It handles masking and un-masking
    '*********************************************************************
     
    INTCON2.6 = 0           ' Int on falling edge 
                            ' External Interrupt 0 Edge Select bit
    
    
     
                            
    ' Set up data direction registers for all the pins.
    TRISA = 111111       ' Set PORTA RA6 is Osc output to crystal
    TRISB = 101001       ' Set PORTB
    TRISC = 010100       ' Set PORTC
    TRISD = 000011       ' Set PORTD
    TRISE = 111011       ' 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
    and this is the Interrupt code from DT's Interrupts.

    Code:
    '****************************************************************'*  Name    : DT_INTS-18-K80.bas                                *
    '*  Author  : Darrel Taylor modified for PIC18F46K80         *
    '*  Notice  : Copyright (c) 2003                                *
    '*  Version : 1.0    MAR 21, 2022                               *
    '*  Date    : MAR 21, 2022                                      *
    '****************************************************************
    '*  Versions:                                                   *
    '*   1.0  : MAR 21, 2022 first version modified for PIC66K80    *
    '*   3.3  : MAR 24, 2008                                        *
    '*           Corrects an initialization problem affecting the   *
    '*           first pass if CLEAR is not used                    *
    '*   3.2  : Aug 26, 2007                                        *
    '*           Update for PBP 2.50 using LONG's with PBPL         *
    '*           Added many new INT sources                         *
    '*   3.1  : JUL 18, 2006                                        *
    '*           Modified to handle smaller BANKA in the newer chips*
    '****************************************************************
    ;DISABLE DEBUG
    
    
    
    
    DEFINE  INTHAND       INT_ENTRY_H  ' Context saving for High Priority Ints
    DEFINE  INTLHAND      INT_ENTRY_L  ' Context saving for Low Priority Ints
    
    
    wsave       var byte  BANKA  SYSTEM   ' location for WREG
    ssave       var byte  BANK0  SYSTEM   ' location for STATUS register
    bsave       var byte  BANK0  SYSTEM   ' location for BSR register
    psaveUH     VAR BYTE  BANK0  SYSTEM   ' PCLATU Hi Pri.
    psaveUL     VAR BYTE  BANK0  SYSTEM   '        Lo Pri.
    psaveH      VAR BYTE  BANK0  SYSTEM   ' PCLATH Hi Pri.
    psaveL      VAR BYTE  BANK0  SYSTEM   '        Lo Pri.
    fsave0H     var WORD  BANK0  SYSTEM   ' locations for FSR registers
    fsave1H     var WORD  BANK0  SYSTEM
    fsave2H     var WORD  BANK0  SYSTEM
    fsave0L     var WORD  BANK0  SYSTEM   ' low priority FSR locations
    fsave1L     var WORD  BANK0  SYSTEM
    fsave2L     var WORD  BANK0  SYSTEM
    RetAddrH    VAR BYTE[3]  BANKA  SYSTEM  ' 21-bit return address Hi Pri.
    RetAddrL    VAR BYTE[3]  BANKA  SYSTEM  '                       Lo Pri.
    INT_Flags   VAR BYTE  BANKA  SYSTEM
      Serviced_H  VAR INT_Flags.0
      Serviced_L  VAR INT_Flags.1
      InHPint     VAR INT_Flags.2
      NoPriority  VAR INT_Flags.3
    
    
    INT_Flags = 0 
    
    
    goto  OVER_DT_INTS_18
    
    
    ASM
    ;____ Check for PBPL (PBP ver. 2.50 and above only)__________________________
    PBPLongs_Used = 0
      if (R1 - R0 == 4)
    PBPLongs_Used = 1
    ;    messg PBPL Used = 1
      endif
    
    
    ;  nolist
    ;____ DEFINE available interrupt sources_____________________________________
    The error is for the INTHAND not being defined but, as you can see it is.

    Thanks,
    Paul

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


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Posting snippets is just a waste of time...

    Ioannis

  7. #7
    Join Date
    Apr 2022
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Thanks for that enlightening comment Ioannis. If I posted all the code it would be about 4000 lines worth of code. The original question had to do with the assembler complaining about the (INT_ENTRY_H) not being defined. The code snippets are because Demon requested them. They show that the (INT_ENTRY_H) is defined in DT's code. So the only question would be if my includes meet the requirements that Demon was speaking about.

    Thanks,
    Paul

  8. #8
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    671


    Did you find this post helpful? Yes | No

    Question Re: assembly error on DT interrupts

    My first guess is that you have a missing file that it is supposed to be in the same directory as the pbp file.

    My second guess is that that PIC doesn't support the Darrel high priority interrupts. I have used a few new chips that don't like the Darrel interrupts. I would try your code with a 18F4550 first to see if it works, and go from there.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  9. #9
    Join Date
    May 2013
    Location
    australia
    Posts
    2,546


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    beginning to look like another stone soup exercise
    Warning I'm not a teacher

  10. #10
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,580


    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.

  11. #11
    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

  12. #12
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,580


    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.

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


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Quote Originally Posted by PCzar3 View Post
    Thanks for that enlightening comment Ioannis. If I posted all the code it would be about 4000 lines worth of code. The original question had to do with the assembler complaining about the (INT_ENTRY_H) not being defined. The code snippets are because Demon requested them. They show that the (INT_ENTRY_H) is defined in DT's code. So the only question would be if my includes meet the requirements that Demon was speaking about.

    Thanks,
    Paul
    Well, we are here to help on specific problems, not guessing what you might have wrong in your listing. If it is 4k long line let it be.

    There are many kind people here that will have a second look at your code and surely might find that comma or dot it should or shouldn't be there for you.

    If you like guessing work then be it...

    Ioannis

  14. #14
    Join Date
    Apr 2022
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Hello Ioannis,
    I have worked with Henrik in the past and he has been most helpful. I'll look again at what he has suggested. If I find the solution, I'll post an answer. If not, well I'll have to see what I can find. I don't mean to raise your ire with my problem.

    Paul

  15. #15
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,038


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    There is no ire...

    Only that it is extremely difficult to guess what you might have wrong. Posting the listing and the in some cases the wiring to your PIC, power supply etc greatly helps nailing the problem.

    Most do not like guessing, me included.

    I do understand that you may have code not willing to show for any reason. But on the other hand how can one help if has no clue?

    Ioannis

  16. #16
    Join Date
    May 2013
    Location
    australia
    Posts
    2,546


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    i have a suspicion about what the problem is but I'm not willing to waste time testing random
    hypotheticals just for the chance to learn later that that's not actually your problem.
    why don't you post the code you have tried, in fact rather than posting the complete project
    aim to post the simplest compliable program that shows the problem. code snippets generally don't
    cut it, we need to see the config settings, osc speed, var declarations, port settings, chip type etc....

    dt_ints18 for k80 series works perfectly for both high and low priority interrupts for me
    [note even the chip type is guesswork]





    my stock for the stone soup

  17. #17
    Join Date
    Aug 2011
    Posts
    447


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    A number of interrupts for the K80 are different than what's in dt_ints-18.bas, so while it might compile it won't work properly without some adjustments.

    As others have said, without seeing the OP's version it's hard to make recommendations.

  18. #18
    Join Date
    Apr 2022
    Posts
    14


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Well after hours of searching I decided to look at the file with a hex editor. I found a non-printing character appended to the name of one of the interrupt routines. When I edited the character out, all compiled with no errors. I want to thank everyone for their help with this. I don't know where the character came from, but Henrik pointed this out once before on a different problem which is why I decided to look at this again. Tumbleweed, I did modify the interrupts to work with the K80 and have used this before with another program which is why this left me so confused. Ioannis, thanks for your patience with this. I consider this closed now if only I could find what is sticking random values into the ASCII.

    Thanks,
    Paul

  19. #19
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,038


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    Even a simple text editor could do that damage to the file and have such characters stored in them.

    That is why posting the whole file helps us to help you.

    Anyway, glad you got it working as you expected.

    Ioannis

  20. #20
    Join Date
    May 2013
    Location
    australia
    Posts
    2,546


    Did you find this post helpful? Yes | No

    Default Re: assembly error on DT interrupts

    I found a non-printing character appended to the name of one of the interrupt routines
    what chr did you find ?
    every non-printing character i have tried caused a

    WARNING Line 43: Bad token " ".


    error
    Warning I'm not a teacher

Similar Threads

  1. Assembly Interrupts for PIC 18F27K42
    By dtbarber in forum Code Examples
    Replies: 3
    Last Post: - 7th January 2021, 01: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, 19:11
  3. Replies: 1
    Last Post: - 30th March 2012, 05:13
  4. LP Instant Interrupts Error
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 7th December 2009, 10:13
  5. Replies: 2
    Last Post: - 8th February 2009, 06:10

Members who have read this thread : 17

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