The frequency value can be checked with two defined limits (lower and upper).
The result of the compare function can provide:
The compare function has two limits:
The upper limit value must be greater than the lower limit value. If the upper limit value is less than or equal to the lower limit value, the lower limit does not change but it is ignored.
The default value for both MAXIMUM_FREQUENCY and MINIMUM_FREQUENCY is 0.
The results are stored in the COMPARE_STATUS register which is updated at the same time than the frequency value.
The possible results are:
-
FREQUENCY_METER_LESS: The frequency value is less than the lower limit value.
-
FREQUENCY_METER_WINDOW: The value is between the upper and lower limits or equal to one of the two limits.
-
FREQUENCY_METER_GREAT: The value is greater than the upper limit.
Modification of the Limits During the Operational Phase
If the application needs to modify the limits, the COMPARE_SUSPEND bit holds the COMPARE_STATUS (%IWr.m.c.1) register during the modification.
COMPARE_STATUS register needs the COMPARE_ENABLE bit (%Qr.m.c.5) set active (1) and COMPARE_SUSPEND bit (%Qr.m.c.4) set inactive (0) to be updated.
Care must be exercised when limit compares are active to avoid unintended or unexpected results from the outputs or from sudden event task execution. If the compare function is disabled, limit values can be modified freely since COMPARE_STATUS is forced to 0. However, if the compare function is enabled, suspend at least the compare function while modifying the limit values.