High-speed Counter Function
10-28
10.5 Interrupt Program Activation
10.5.1 Overview of Function
When the elapsed value reaches the target value while the high-speed counter instruction
F165 (CAM0)/F166 (HC1S)/F167 (HC1R) is being executed, the interrupt program can be
activated.
Execution method
• Make the setting for the high-speed counter by system registers. There is no need to make
the setting of interrupt input.
• Describe the interrupt program as a sub program.
• Allow the execution of a corresponding interrupt program number by the ICTL instruction in
the main program.
• Execute the F165 (CAM0)/F166 (HC1S)/F167 (HC1R) instruction. When the elapsed value
of the high-speed counter reaches the target value, the interrupt program is activated.
For FP0H mode
( ED )
( INT 0 )
( IRET )
INT0 Program
F166 HC1S instruction
Target value match ON
R9110: CH0 control flag
K0: CH0 specified
K10000: Target value
Y2: Match output set
ICTL instruction
INT0 program
execution enabled
R0
H0ICTL H1
R1
K10000K0
F166 HC1S
Y2
( )
DF
R9110
Corresponding channel numbers and interrupt program numbers
CH1 INT1
(Note): The allocations of control active flags and elapsed value areas for the FPΣ mode are different.
For details of the allocation of flags, refer to "12.2.4 When Using High-speed Counter Function".