4. Functions
58
CNT-3208M-PE
<Example 2> Start sampling with a count value of 500 and stop it with a count value of 1000.
Figure 4.14. Example 2
<Example 3> Set comparison values of 100, 200, 300, 400, 500, … and generate interrupts in sequence.
Figure 4.15. Example 3
Initial setting
Sampling start conditions: Count match(Register0)
Sampling stop conditions: Count match(Register1)
Channel 0 Comparison register 1 = 1000
Channel 0 Comparison register 0 = 500
Channel 0 Preset register = 0
Event at (2) (Agrees with comparison register 1)
- A sampling stop with count value = comparison register 1.
Event at (1) (Agrees with comparison register 0)
- A sampling start with count value = comparison register 0.
1000
500
Counter start
(1)
(2)
0
Initial setting
Count match (register 0),Count match(register 1), Enable interrupts
Channel 0 Comparison register 0 = 100
Channel 0 Comparison register 1 = 200
Channel 0 Preset register = 0
Counter
start
(1)
(2)
0
Event at (4) (Count value = 400 = comparison register 1)
- A interrupt is occured with count value = comparison register 1.
-
Check the interrupt status and, if COMP1 contains 1, set comparison register 1 to 600.
- Reset COMP1 to 0. *2
Event at (3) (Count value = 300 = comparison register 0)
- A interrupt is occured with count value = comparison register 0.
-
Check the interrupt status and, if COMP0 contains 1, set comparison register 0 to 500.
- Reset COMP0 to 0. *2
Event at (2) (Count value = 200 = comparison register 1)
- A interrupt is occured with count value = comparison register 1.
-
Check the interrupt status and, if COMP1 contains 1, set comparison register 1 to 400.
- Reset COMP1 to 0. *2
Event at (1) (Count value = 100 = comparison register 0)
- A interrupt is occured with count value = comparison register 0.
-
Check the interrupt status and, if COMP0 contains 1, set comparison register 0 to 300.
- Reset COMP0 to 0. *2
200
300
400
500
100
(3)
(4)
*1
*1 Time required between events: About 5 ms (depending on the system configuration)
*2 COMP0 :Count match(register 0)Status
COMP1 :Count match(register 1)Status
Summary of Contents for CNT-3208M-PE
Page 7: ...vi CNT 3208M PE ...
Page 15: ...1 Before Using the Product 8 CNT 3208M PE ...
Page 30: ...2 Setup CNT 3208M PE 23 3 Click on the End button to finish condition setting Click on End ...
Page 35: ...2 Setup 28 CNT 3208M PE ...
Page 71: ...4 Functions 64 CNT 3208M PE ...