PDA

View Full Version : Define Interrupt Label Problem



Junkman55
- 8th June 2011, 21:33
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:

Darrel Taylor
- 8th June 2011, 23:55
Where are your HIGHINT and LOWINT routines?

And the rest of the code required to use interrupts?

MikeWinston
- 9th June 2011, 00:02
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 -

Junkman55
- 9th June 2011, 15:32
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)'.

Darrel Taylor
- 9th June 2011, 15:39
PicBasic Pro labels will need an underscore in front of them.
Labels in assembly language do not.


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.

Junkman55
- 13th June 2011, 15:42
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.

Darrel Taylor
- 13th June 2011, 17:02
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 (http://darreltaylor.com/DT_INTS-14/intro.html)

Junkman55
- 14th June 2011, 17:00
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.

Darrel Taylor
- 14th June 2011, 17:41
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.