Input Interrupts

Section 7-3

7-3-6 Application Example

This example shows input interrupt 0 and input interrupt 1 used in interrupt input mode and counter mode, respectively.

Before executing the program, verify that the following System Setup settings have been made: input 0 and input 1 both set to Interruption (up). The other System Setup settings are set to their default settings.

Interrupt task 0

Interrupt task 1

P_First_Cycle

(ON for the first cycle)

0002.00

0002.00

P_On (Always ON)

MOV

#000A

A521

@CLI

#0000

#0001

@CLI

#0001

#0001

@MSKS

#0000

#0000

@MSKS

#0001

#0002

@MSKS

#0000

#0001

@MSKS

#0001

#0001

CLC

ADB

A521

#000A

A521

MSKS

#0001

#0002

END

END

The SV of input interrupt 1 counter mode operation is set to 10 in 4-digit hexadecimal (000A).

When CIO 0002.00 is ON, the following instructions are executed.

(1)Clears any masked interrupts for input interrupts 0 and 1.

(2)Enables interrupts by input interrupt 0 in Input interrupt mode.

(3)Enables interrupts by input interrupt 1 in counter mode. (The counter SV is 10 decimal.)

When CIO 0002.00 is OFF, MSKS(690) masks input interrupts 0 and 1 and disables those interrupts.

Interrupt task 000 is called when there is an interrupt from input interrupt 0, 10 is added to the counter SV for input interrupt 1 (the SV increases to 20), and the counter is refreshed.

When input interrupt 1 counts down to 0, interrupt task 001 is called and executed.

145

Page 168
Image 168
Omron FQM1-CM001, FQM1-MMA21, FQM1-MMP21 operation manual Application Example