Cpm1/Cpm1A Interrupt Functions; Types Of Interrupts - Omron CPM1 - PROGRAMING MANUAL 02-2001 Programming Manual

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

Advertisement

CPM1/CPM1A Interrupt Functions

2-3

CPM1/CPM1A Interrupt Functions

2-3-1 Types of Interrupts

Interrupt Priority
Interrupt Program
Precautions
1, 2, 3...
High-speed Counter
Instructions and Interrupts
This section explains the settings and methods for using the CPM1/CPM1A in-
terrupt functions.
The CPM1/CPM1A has three types of interrupt processing, as outlined below.
Input Interrupts
CPM1/CPM1A PCs have two or four interrupt inputs. Interrupt processing is
executed when one of these inputs is turned ON from an external source.
Interval Timer Interrupts
Interrupt processing is executed by an interval timer with a precision of 0.1 ms.
High-speed Counter Interrupts
The high-speed counter counts pulse inputs to one of CPU bits 00000 to 00002.
Interrupt processing is executed when the count reaches the set value of a built-
in high-speed counter.
When an interrupt is generated, the specified interrupt processing routine is
executed. Interrupts have the following priority ranking.
Input interrupts > Interval interrupts = High-speed counter interrupts
When an interrupt with a higher priority is received during interrupt processing,
the current processes will be stopped and the newly received interrupt will be
processed instead. After that routine has been completely executed, then pro-
cessing of the previous interrupt will be resumed.
When an interrupt with a lower or equal priority is received during interrupt pro-
cessing, then the newly received interrupt will be processed as soon as the rou-
tine currently being processed has been completely executed.
When two interrupts with equal priority are received at the same time, they are
executed in the following order:
Input interrupt 0 > Input interrupt 1 > Input interrupt 2 > Input interrupt 3
Interval interrupts > High-speed counter interrupts
Observe the following precautions when using interrupt programs:
1. A new interrupt can be defined within an interrupt program. Furthermore, an
interrupt can be cleared from within an interrupt program.
2. Another interrupt program cannot be written within an interrupt program.
3. A subroutine program cannot be written within an interrupt program. Do not
write a SUBROUTINE DEFINE instruction, SBN(92), within an interrupt pro-
gram.
4. An interrupt program cannot be written within a subroutine program. Do not
write an interrupt program between a SUBROUTINE DEFINE instruction
(SBN(92)) and a RETURN instruction (RET(93)).
Inputs used as interrupts cannot be used as regular inputs.
The following instructions cannot be executed in an interrupt subroutine when
an instruction that controls high-speed counters is being executed in the main
program:
INI(61), PRV(62), or CTBL(63)
Section
2-3
77

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents