3 . Instruction Set

¾6 comparators are available for software counters while 8 comparators are available for 2 groups of hardware counters ( 4 comparators for each group)

¾Output timing of software comparator Æ count value equals to comparative value in both counting up/down modes.

¾Output timing of the hardware comparator with firmware version 1.xx Æ count value equals to comparative value+1 in counting-up mode; count value equals to comparative value -1 in counting-down mode.

¾Output timing of the hardware comparator with firmware version 2.00 and above Æ count value equals to comparative value in both counting up/down modes.

8.Difference between software and hardware comparators (it is only applicable to DVP-SE):

¾6 comparators are available for software counters while 4 comparators are available for 2 groups of hardware counters ( 2 comparators for each group)

¾Output timing of software comparator Æ count value equals to comparative value in both counting up/down modes.

¾Output timing of the hardware comparator Æ count value equals to comparative value+1 in counting-up mode; count value equals to comparative value -1 in counting-down mode.

Program Example 1:

Set/reset M0 by applying software comparator

M1000

DCNT C235 K100

DHSCS K100

C235

M0

¾When value in C235 varies from 99 to100, DHSCS instruction sets M0 ON. (M1235 = OFF, C235 counts up)

¾When value in C235 varies from 101 to100, DHSCR instruction resets M0. (M1235 = ON, C235 counts down)

¾Timing diagram for the comparison:

2

1

M0

Counting

No.

98

99

100

101

 

 

 

 

 

101

100

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Count up

Count down

 

 

 

 

99 98

Time

Program Example 2:

Set/reset M0 by applying hardware comparator

3 - 127

Page 243
Image 243
Delta DVP-ES2/EX2/SS2/SA2/SX2/SE manual Counting