AW: [bascom] Interrupt service routines


From "Udo Barthel" <info@pcds.de>
Date Fri, 20 Jun 2003 11:29:24 +0200

Hi Bud,

The ON Interrupt is not a command it rather tells the compiler which address
to put into the vector table - the address of your interrupt service routine
(ISR). It is actually the address of the label of your ISR. Keep in mind
that you have to enable the INT1 interrupt AND the global interrupt.
Furthermore you must specify if the INT1 interrupt should be generated
either on signal level or negative edge. So it has to look like:

On Int1   ISR_INT1
set      TCON.2                         ' INT1 negative edge
Enable   Int1
Enable   Interrupts                      ' GLOBAL ENABLE
Do
Loop

ISR_INT1:
... your stuff
Return

Pay attention that you dont put a RETURN statement (e.g. in a sub) between
the label of the ISR and the RETURN of the ISR. Bascom compiles the first
return statement after an ISR label into a RETI (return from Interrupt). Any
called subroutines must be put outside of the ISR except you are using
assembler.

With best regards - Udo Barthel

-----Ursprungliche Nachricht-----
Von: owner-bascom@grote.net [mailto:owner-bascom@grote.net]Im Auftrag
von George Saum
Gesendet: Freitag, 20. Juni 2003 04:27
An: bascom
Betreff: [bascom] Interrupt service routines


  I cannot get the ON Interrupt command in Bascom-8051 as shown in the
Language Reference to work.  It seems that the interrupt service routine
is not being accessed.  In my system the INT1 interrupt is initially
vectored to 0013h where an ljmp command vectors the pc to 7D13h.  At
7D13h there is no code. Consequently, the processor hangs up.
Can someone tell me where (in code space) Bascom places interrupt
service routines?.
            Best Regards,
                Bud