Processing The Same Memory Locations With The Main Program; And Interrupt Subroutines - Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual

Hide thumbs Also See for CPM1 - PROGRAMING MANUAL 02-2001:
Table of Contents

Advertisement

CPM2A/CPM2C Interrupt Functions
!
Caution
Order of Priority for
Interrupts
Interrupt inputs

2-1-1 Processing the Same Memory Locations with the Main Program

and Interrupt Subroutines

Processing Interrupted
between 1st and 3rd
Operands
3. It is not possible to write a subroutine program within an interrupt subroutine.
Do not nest an ordinary subroutine program between the SBN(92) and
RET(93) instructions.
4. It is not possible to write an interrupt subroutine within an ordinary subrou-
tine program. Do not nest an interrupt subroutine between the SBN(92) and
RET(93) instructions.
When an interrupt subroutine is defined, an SBS UNDEFD error will be gener-
ated during the program check but execution will be normal.
Although IORF(97) can be used in interrupt subroutines, you must be careful of
the interval between IORF(97) executions. If IORF(97) is executed too frequent-
ly, a fatal system error may occur (FALS 9F), stopping operation. The interval
between executions of IORF(97) should be at least 1.3 ms + total execution time
of the interrupt subroutine.
The order of priority for interrupts is as follows:
Count-up interrupts
=
If an interrupt with a higher priority is generated. during interrupt program execu-
tion, the interrupt that is currently being processed will be stopped and the new
interrupt will be processed first. Then the original interrupt will be resumed after
the higher-priority interrupt processing has been completed.
If interrupts of the same priority are generated simultaneously, they will be pro-
cessed in the following order:
Interrupt input 0
Interrupt input 1
cluding count-up mode)
Interval timer interrupt
If a memory location is manipulated both by the main program and an interrupt
subroutine, an interrupt mask must be set to disable interrupts.
When an interrupt occurs, execution of the main program will be interrupted im-
mediately, even during execution of an instruction. The intermediate processing
results is saved for use after completing the interrupt subroutine, i.e., when the
interrupt subroutine has been executed, execution of the main program is
started from the same position with data restored to the previous condition. If any
of the memory locations being used by the main program are changed in the in-
terrupt subroutine, the changes will be lost when data is restored to the previous
state when restarting execution of the main program. It is thus necessary to dis-
able interrupts before and enable interrupts after any instructions that should be
executed to completion even if an interrupt occurs.
Interval timer
>
interrupts
Interrupt input 2
High-speed counter interrupt
Section
High-speed counter
=
count check interrupts
Interrupt input 3 (in-
2-1
27

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents