time
Clock0
reload
Count0
Counter1 reaches 0 at the
Clock1
Valid0
Error
right time, but since Clock0 is not running,
Valid0 hasn’t started, thus an error is generated.
Count1
Count0 and Valid 0 do not
count down due to an
inactive clock 0
Module Operation
397
SPNU503C – March 2018
Copyright © 2018, Texas Instruments Incorporated
Dual-Clock Comparator (DCC) Module
Figure 11-6. Clock0 Not Present - Results in an Error and Stops Counting
11.2.2 Single-Shot Measurement Mode
The DCC module can be programmed to count down one time by enabling the single-shot mode. In this
mode, the DCC stops operating when the down counter0 and the valid counter0 reach 0. Alternatively, the
DCC can be programmed to stop counting when the down counter1 reaches 0.
At the end of one sequence of counting down in this single-shot mode, the DCC gets disabled
automatically, which prevents further counting. This mode is typically used for spot measurements of the
frequency of a signal. This frequency could be an unknown for the application before the measurement.
Example Usage of Single-Shot Measurement Mode: Trimming the High-Frequency Low-Power
Oscillator
A practical example of the usage of the spot measurement mode is in trimming the HF LPO (clock
source # 5) using the main oscillator as a reference. This measurement sequence would proceed as
follows:
•
The application sets up the seed values for counter0 and valid0 for the duration of the
measurement. Suppose the main oscillator frequency is 10MHz and the intended duration of the
measurement is 500µs. The application needs to configure a seed value of 5000.
•
These 5000 counts need to be divided between the counter0 and the valid0 counters. The
minimum value for the valid0 seed is 4, so the application can configure counter0 seed value as
4996 and the valid0 seed value as 4.
•
Suppose the HF LPO frequency is truly unknown. In this case the application can choose the
maximum allowed seed value for counter1. This increases the probability of counter0 and valid0
counting down while the counter1 has still not fully counted down to zero. The maximum allowed
seed value for counter1 is 1048575.
•
Once the DCC is enabled, the counters counter0 and counter1 both start counting down from their
seed values.
•
When counter0 reaches zero, it automatically triggers the valid0 counter.
•
When valid0 reaches zero, if counter1 is not zero as well, an ERROR status flag is set and a "DCC
error" is sent to the ESM. Counter1 is also frozen so that it stops counting down any further. The
application can enable an interrupt to be generated from the ESM whenever this DCC error is
indicated. Refer the device datasheet to identify the ESM group and channel where the DCC error
is connected.