CHAPTER 3: Clock Supervisor
148 FM4 Peripheral Manual, Doc. No. 002-04856 Rev. *E
Example of Anomalous Frequency Detection Function Window Setting
The anomalous frequency detection counts up between edges of the divided clock of high-speed CR. The
measurement interval is also affected by the accuracy of CR. When you configure the window register
value, therefore, the CR accuracy must be considered for the value.
For frequency accuracy of the CR oscillator, check the relevant Data Sheet.
Calculation method
The count value range of anomalous frequency detection must be added the CR accuracy, then, the
window register value is set. The count range expression must be used as follows.
The count value by main clock of frequency L [Hz] can be calculated using the divide-by-Y CR oscillator
clock of ±Z% accuracy with frequency K [Hz].
Count value A (positive CR frequency accuracy) = 1/[ (K/Y) × (1 + Z/100)] × L
Count value B (negative CR frequency accuracy) = 1/[ (K/Y) × (1 - Z/100)] × L
Those expressions lead the count value within the range A to B added internal CR accuracy.
Set the value smaller than count value A for the lower limit of the window, and larger than count
value B for the upper limit.
The window setting is determined by the value allowed for frequency fluctuation of main
oscillation defined by the user.
Example calculation
The count value by main clock of frequency 4 MHz is calculated using the divide-by-1024 CR oscillator
clock of ±5% accuracy with frequency 4 MHz.
Count value A (positive CR frequency accuracy)
Count value B (negative CR frequency accuracy)
Those expressions yield the count value within the range 975 to 1078 including the high-speed
CR error. If the window setting value is 5%, window setting value is as follows.
Window lower limit = 975 × 0.95(-5%) = 926.25 3.43 MHz
Window upper limit = 1078 × 1.05(+5%) = 1131.9 4.64 MHz