11-21
11 High-speed Counters
CP1E CPU Unit Software User’s Manual(W480)
11-3 High-speed Counter
Interrupts
11
11-3-3 High-speed Counter Interrupt Instruction
The CTBL instruction compares the PV of a high-speed counter (0 to 5) to target values or ranges and
executes the corresponding interrupt task (0 to 15) when the specified condition is met.
Contents of the Comparison Table
• Target-value Comparison Table
Depending on the number of target values in the table, the target-value comparison table requires
a continuous block of 4 to 19 words.
11-3-3 High-speed Counter Interrupt Instruction
COMPARISON TABLE LOAD Instruction: CTBL
Operand Settings
C1 Port specifier #0000 High-speed counter 0
~
~
#0005 High-speed counter 5
C2 Control data #0000 Registers a target-value comparison table and starts the com-
parison operation.
#0001 Registers a range comparison table and starts the comparison
operation.
#0002 Registers a target-value comparison table.
#0003 Registers a range comparison table.
S First compari-
son table word
Specifies the first word address of the comparison table, which is described
below.
@CTBL
C1
C2
S
Execution condition
C1: Port specifier
C2: Control data
S: First comparison table word
S+1
S+2
S+3
S
015
03478
000 0
11121415
S+16
S+17
S+18
Upper word of target value 1
Interrupt task number for target value 1
00000000 to FFFFFFFF hex
00000000 to FFFFFFFF hex
Number of target values
0001 to 0006 hex (1 to 6 target values)
Interrupt Task Number
Interrupt task number
00 to 0F hex (0 to 15)
Direction
OFF: Incrementing,
ON: Decrementing
Upper word of target value 6
Interrupt task number for target value 6
Lower word of target value 1
Lower word of target value 6