5. Functions
46
AO-1604LX-USB
Counter Function
1. Setting the Operating Conditions
This specifies the conditions for counter operation.
Operating conditions
The basic operation of the counter is to count an external input signal.
The counter includes a function to detect a count match and perform a specified operation when the
current count value reaches a preset count value.
Compare count values
The compare count load function automatically loads the next compare count value when a count match
occurs.
The figure above shows an example of using the compare count load function.
After the counter starts, the first count match occurs when the count reaches 1000.
When the count reaches 1000, the counter value at which the second compare count match is to occur
(2000) is set.
This continues with the next value from the array being set each time a count match occurs.
After the final value from the array is loaded, operation can start again from the beginning of the array.
Alternatively, loading can be halted (in which case, the compare count value remains at 2000).
Input signal
The external clock can be selected as the counter input signal.
Digital filter
A digital filter can be used on external input bits.
The filter time can be set to "don't use", 1
µ
s by software.
Event
The event function notifies the application when something occurs on the device.
The following events can be used as required.