2-2
Section
CPM2A/CPM2C High-speed Counters
71
Either an incrementing or decrementing count can be used with interrupt inputs
in counter mode.
Incrementing Counter Mode
As the set value (SV) is refreshed, the count is incremented from 0, and the inter-
rupt subroutine is executed when the present value (PV) matches the SV.
The subroutine is executed when the count is up,
and the PV is reset to 0.
PV
SV
Incrementing
Incrementing
Interrupt
Subroutine executed.
Time
Interrupt
Subroutine executed.
Decrementing Counter Mode
As the set value (SV) is refreshed, the count is is decremented toward 0, and the
interrupt subroutine is executed when the present value (PV) reaches 0.
PV
SV
Decrementing
Decrementing
Interrupt
Subroutine executed.
Interrupt
Subroutine executed.
Time
The subroutine is executed when the count is up,
and the PV is reset to the SV.
With the CPM2A, wire the input terminals as shown in the following illustration.
Input 00003: Input interrupt (counter mode) 0
Input 00004: Input interrupt (counter mode) 1
Input 00005: Input interrupt (counter mode) 2
Input 00006: Input interrupt (counter mode) 3
With the CPM2C, wire the input terminals as shown in the following illustration.
Selecting Incrementing
or Decrementing Count
Wiring the Inputs