Sensoray 626 User Manual
Page 23

Sensoray Model 626 Instruction Manual
21
10.7 Triggering A Counter Load
Each counter has a pre-load register that can be loaded into the counter when triggered by various
events. Each counters pre-load register is set up by simply writing the 24 bit value to the lsb & msb of
the pre-load register.
Pre-loading counter A can be triggered by and index or overflow of counter A. Pre-loading counter B
can be triggered by an index or an overflow of counter A or B. A load must not be set to be triggered
from counter A’s index if the index is being used to run the counter under software control. Doing so
will cause a load every time counter A counts.
10.8 Clearing Counter B From Counter A’s Overflow
Setting ‘Clear Counter B’ to 1 will allow an overflow from counter A to clear counter B. This is only
available for counter B. Of course the same effect could be achieved by pre-loading the counter with 0.
10.9 Latching The Counters
Each pair of counters 0, 1 & 2 have one latch between them. There are two distinct sets of modes of
operation for the latches.
Mode 1: ‘Latch Source’=00 allows either counter A or counter B to be captured any time. The least
significant word (lsw) must be read first. This causes the entire 24 bit count to be latched
allowing the most significant word (msw) to be read later without causing the count to be re-
latched. The read address will decide which counter will be latched. (See “Table 14 Counter
Registers” P16 for the read addresses).
Mode 2: In the second set of modes the appropriate counter is latched by an event that would usually be
programmed to also create an interrupt. This interrupt then prompts the user to read the latched
count before it is overwritten by the next event. To read the count the lsw and msw of either latch
A or B for the appropriate counter can be read. (See “Table 14 Counter Registers” P16 for the
read addresses). In this mode it does not matter which order the lsw & msw are read as they will
have already been latched.
‘Latch Source’=01 will latch counter A when there is a counter A index.
‘Latch Source’=10 will latch counter B when there is a counter B index.
‘Latch Source’=11 will latch counter B when counter A overflows.
(Useful when frequency counting).