Dear all,
I am trying to understand ICG module of above mentioned controller and i am very sorry to say the contents of datasheet is not very comprehensive ! There are certain terms in datasheet ,that are not described in details.So newcomer like me is getting problem in understanding the terms!
Anyway ,my problem is about ICG mode Section 10.5
I not at all understand terms like lock and unlock which are mentioned in relation with Internal and External! Also there is no proper explanation about "error counter" I have searched this word through out documents but didnot get its meaning ! Likewise nunlock and nlock these are terms which are not described properly!
I really stuck on this terms so anybody who knows please help me !
Thank you!
As for the "error counter" I think that it can be explained like that:
You got you high CPU frequency, let's say it's 16MHz.
Micro has a comparison cycle (a period) which is made by another independent internal clock. Lets' say the comparison cycle is 1ms.
So, in you comparison cycle you expect to count 16,000 CPU cycles.
This number is subctracted by let's say 15,500. 16,000-15,500 = 500
If the number goes lower than e.g. 250 or over e.g. 750 you say your CPU clock is faulty and you may want to stop your machine or send an alarm to the world.
This is what I understand from here:
FLL Lock and Loss-of-Lock Detection
I do agree the explanation of ICG in the HC08 datasheet is not really clear.
I had to go throught it more times myself.
Other microprocessor brands have an easier clock part.
Anyway, I think that your "lock" and "unlock" refers to the FLL block.
FLL is a frequency multiplier. It multiplies the input frequency by 512.
As you know, passing from a higher frequency to a lower one is not a problem, but passing from a lower to a higher frequency requires a delicate circuit called the FLL (which is a brother of the PLL).
Since output frequency is not guarantee to be always stable (Vdd spikes, interferences, so on), they say the FLL is locked when it's working correctly and unlocked when the output frequency is out of control.
More, you can switch the FLL on and off, and when you switch it on, it takes some time (milliseconds ?) to be stable.
As they say:
Frequency-locked loop — A frequency-locked loop (FLL) stage takes either the internal or
external clock source and multiplies it to a higher frequency. Status bits provide information when
the circuit has achieved lock and when it falls out of lock. Additionally, this block can monitor the
external reference clock and signals whether the clock is valid or not.
Hope it clearer.