Define Interrupt Label Problem


Closed Thread
Results 1 to 9 of 9
  1. #1
    Join Date
    Jun 2011
    Posts
    4

    Question Define Interrupt Label Problem

    I get 'Error[113] c:\Progra~1\picbas~1\incfil~1\pbppi18l.lib : Symbol not previously defined (HIGHINT)' whenever I try to compile the program. Best I can tell, this is straight by the book. I use ASM/ENDASM to put in assembly code so I know I get to MPASM. Also I have PBPL checked.
    The part I'm using is 18F8520 and I need the interrupts.

    Why the Error? and is there a list of Error codes that I can get?

    My extremely shortened program -

    DEFINE OSC 20
    Goto Start

    DEFINE INTHAND HIGHINT
    DEFINE INTLHAND LOWINT

    Start:

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


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    Where are your HIGHINT and LOWINT routines?

    And the rest of the code required to use interrupts?
    DT

  3. #3
    Join Date
    Feb 2011
    Location
    Michigan, USA
    Posts
    33


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    just a shot in the dark here, but do you have the following line somewhere in your code?
    HIGHINT:

    If so, is it inside the ASM/ENDASM block?

    Mike -

  4. #4
    Join Date
    Jun 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    Sorry - I did leave out some code.
    To simplify things I tried -

    DEFINE OSC 20
    Goto Start

    DEFINE INTHAND HIGHINT

    Start:
    PAUSEUS 10
    Goto Start

    HIGHINT: PAUSEUS 10
    RESUME

    I still get - 'Error[113] c:\Progra~1\picbas~1\incfil~1\pbppi18l.lib : Symbol not previously defined (HIGHINT)'.

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


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    PicBasic Pro labels will need an underscore in front of them.
    Labels in assembly language do not.

    Code:
    DEFINE INTHAND _HIGHINT
    But remember, you are creating an Assembly Language interrupt handler.
    You cannot use PAUSEUS, PAUSE, SERIN or any of the other PBP commands.

    And resume only works with ON INTERRUPT.
    DT

  6. #6
    Join Date
    Jun 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    Thanks! _HIGHINT works. That's not in the book! Can PBP subroutines be called from an assembly language interrupt? I can try it but if you already know the answer it'll save time.

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


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    It's not in the book, because you are not supposed to use PBP subroutines for Assembly Language Interrupts.

    You should not call any PBP subroutines from ASM interrupts either.
    Any PBP commands that use system variables will corrupt the program flow and it will have unexpected results.

    If you need to run PicBasic language interrupts, you should use either ON INTERRUPT or DT_INTS
    DT

  8. #8
    Join Date
    Jun 2011
    Posts
    4


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    I really like the look of DT_INTS-18.bas but there are a few syntaxes I didn't understand.
    In the 'Elapsed_INT-18.bas' program you use 'MOVE?CT 0, T1CON,TMR1ON'
    and in 'DT_INTS-18.bas' you use 'L?GOTO _RestorePBP_H'.
    I've been looking for the '?' syntax. Where can I find it? It wasn't in the MPASM User Guide (at least not mine) or the PBP Compiler book.

    I'll probably make a lot of people feel smart by asking this but I like to understand what I'm using.

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


    Did you find this post helpful? Yes | No

    Default Re: Define Interrupt Label Problem

    Those are macros from the PBP library. You won't find them in any manuals.

    You don't really need to understand the inner workings of DT_INTS to use them.
    Which is kindof the purpose, allowing people to use Interrupts without knowing all the details of using interrupts.

    After you have used them for a while, digging into the ASM code will make more sense.
    DT

Members who have read this thread : 1

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