Omron FQM1-MMP21 7-2-3Disabling and Enabling All Interrupts, Interrupt Functions, Section

Models: FQM1-MMP21 FQM1-MMA21 FQM1-CM001

1 414
Download 414 pages 44.52 Kb
Page 164
Image 164
7-2-3 Disabling and Enabling All Interrupts

Interrupt Functions

Section 7-2

Method 1:

Disabling all interrupts in the main program

This situation can be avoided with the programming methods shown in the fol- lowing diagram.

Method 2:

Executing the routine in the main program instead of the interrupt task, where it could not be executed.

MSKS 0100 0000 0000

@PLS2

0001

0000

D00010

MSKS

(Main program)

0002.00

PRV

0001

0002

D00000

@CTBL

0001

0000

D00000

(Interrupt task)

P_On

Always

ON

P_ER

ER Flag

CTBL

0001

0000

D00000

SET 0002.00

0200

0000

0000

Disabling All Interrupts RSET 0002.00

Note Only one interrupt task number is recorded for pulse output and high-speed counter interrupts. When a pulse output or high-speed counter interrupt is on standby (because another interrupt is being executed or interrupts are dis- abled) and another interrupt occurs, the earlier interrupt task number is replaced with the most recent interrupt task number. Design the system to allow sufficient time between interrupts for the length of the interrupt tasks to prevent unwanted conflicts between interrupts.

7-2-3 Disabling and Enabling All Interrupts

All interrupts can be disabled using the DI(802) instruction, as shown below.

The following interrupts are disabled and enabled by DI(802) and EI(694).

Input interrupts

Interval timer interrupts

High-speed counter interrupts

Pulse output interrupts

Observe the following precautions when using DI(802).

DI(802) and EI(694) cannot be used within an interrupt task to disable or enable interrupts.

Do not use DI(802) to disable all interrupts unless there is a specific need to do so.

Disabling All Interrupts

The DI(802) instruction will disable all interrupts.

Enabling All Interrupts (@)DI

Note Interrupt processing will not be executed for an interrupt that occurs while interrupts are disabled, but the interrupt event will be recorded for each type of interrupt and interrupt processing will be executed when interrupts are enabled.

Enabling All Interrupts

The EI(694) instruction clears the prohibition on all interrupts that was set with the DI(802) instruction.

(@)EI

Note Executing the EI(694) instruction merely returns the interrupts to the status they were in before all interrupts were prohibited (disabled by DI(802)).

141

Page 164
Image 164
Omron FQM1-MMP21 7-2-3Disabling and Enabling All Interrupts, Interrupt Functions, Section, Disabling All Interrupts