7-2
Section
Interrupt Functions
92
The following program sections show how to handle this problem.
Method 1
Disabling all interrupts in the main
program when controlling a port
Method 2
Executing in the main program
instructions that could not be
executed in a subroutine
Programming in subrou-
tine for method 2
Always
ON
ER Flag
Note
1. Only one interrupt subroutine number is recorded for pulse output or high-
speed counter interrupts when another interrupt is being executed or inter-
rupts are disabled. The subroutine number of the most recent interrupt is
always recorded. Design the system to allow sufficient time between inter-
rupts for the length of the subroutines to prevent unwanted competition be-
tween interrupts.
2. “No SBS” errors will occur when interrupt subroutines are defined, but these
will not affect operation.
7-2-3 Disabling and Enabling All Interrupts
All interrupts can be disabled using the INT instruction. The following interrupts
are disabled and enabled by INT.
•
Input interrupts
•
Interval timer interrupts
•
High-speed counter interrupts
•
Pulse output interrupts
Observe the following precautions when using INT.
•
INT cannot be used within a subroutine to disable or enable interrupts.
•
Do not use INT to disable all interrupts unless there is a specific need to do so.
Disabling All Interrupts
The following instruction will disable all interrupts.
Note Interrupts that occur while interrupts are disabled will be recorded and pro-
cessed when interrupts are enabled.
Enabling All Interrupts
The following instruction will enable all interrupts.
Note Enabling interrupts merely returns the interrupts to the status they were in before
they were disabled. If an interrupt was masked before it was disabled, it will still
be masked after it is enabled.
Summary of Contents for CS1 -
Page 1: ...Cat No W378 E1 1 Customizable Counter Units SYSMAC CS1 CS1W HI001 HCP22 HCA22 OPERATION MANUAL...
Page 2: ......
Page 3: ...CS1W HIO01 HCP22 HCA22 Customizable Counter Units Operation Manual Produced January 2001...
Page 4: ...iv...
Page 6: ...vi...
Page 10: ......
Page 20: ......
Page 40: ......
Page 60: ......
Page 146: ......
Page 166: ......