Sensoray 626 User Manual
Page 22

Sensoray Model 626 Instruction Manual
20
10.5.1 Software Control of the Index
If ‘Counter A Index Source’=10 or 11 then an index is caused by toggling the ‘Counter A Index Edge
Selection’ bit. When this kind of software control of the index pulse is needed it is recommended that
the ‘Counter A Index Source’ is set to 10. Then setting ‘Counter A Index Edge Selection’ will set the
index input to the counter & clearing it will clear the index input to the counter. If the ‘Counter A Index
Source’ be set to 11 then setting ‘Counter A Index Edge Selection’ will clear the index input to the
counter & clearing it will set the index input to the counter.
10.5.2 Multiplier
The ‘Counter A Multiplier’ bits are used to multiply counter A’s incoming pulses by 1, 2 or 4 or to
allow software count control.
The ‘Counter B Multiplier’ bits are used to multiply counter B’s incoming pulses by 1, 2 or 4 or to allow
an overflow from counter A to cause counter B to count 1.
The multiplying feature is only used when the encoder or digital inputs are used to drive the counters. If
only a count and direction input is being used then the multiplier should be 1x or 2x. Channel A is the
direction & channel B the count.
10.5.3 Software Control Of Direction & Count Generation
This mode is only available on counter A. Direction control & a count pulse can be generated
completely under software control for counter A. This mode uses the counters index interface to
generate the count pulse. As a result, while in this mode, the index cannot cause an interrupt, a latch or a
pre-load of counter A. To place counter A in this mode ‘Counter A Enable’ must be 1 and ‘Counter A
Multiplier’ must be 11.
Channel A & B combined, of counter A will now control the count direction. They can be connected to
the channel A encoder inputs, the channel A digital inputs or can be software controlled. To use
software control for the direction, ‘Counter A Edge Selection’ must be 0. To set the count direction
down ‘Counter A Source’ must be 10. To set the count direction up ‘Counter A Source’ must be 11.
When using the encoder or digital inputs then channel A & B must be connected in parallel to form a
single direction control.
The index channel of counter A will control the counting. It can be connected using the encoder index
channel, the digital input index pin or it can be software controlled. To use software control for the count
pulse, it is recommended that the ‘Counter A Index Source’ be set to 10. Then setting ‘Counter A Index
Edge Selection’ will set the index input & clearing it will clear the index input, thus creating a count
pulse. If the ‘Counter A Index Source’ is set to 11 then setting ‘Counter A Index Edge Selection’ will
clear the index input & clearing it will set the index input also creating a count.
10.6 Driving Counter B From Counter A’s Overflow
This mode is only available on Counter B. Counter B can be setup so that it will count every time
counter A overflows. To do this ‘Counter B Multiplier’ must be 11, which will cause the count input to
counter B to come from counter A’s overflow.
Channel A of counter B will now control the count direction. It can be connected to the channel A
encoder input, the channel A digital input or it can be software controlled. To use software control for
the direction, ‘Counter B Source Edge Selection’ must be 0. To set the count direction to down ‘Counter
B Source’ must be 11. To set the count direction to up ‘Counter B Source’ must be 10.