need help in DCO modulator. I don't understand how the modulator does to adjust the frequency of DCO.in the user guide is not well explainedsomebody know how really work and how configurate the registers?
The DCO is in its core an R/C oscillator like many. However, it's R (or C, I don't know) is composed of multiple precision components that can be switched between by a difital control.
The RSELx bits configure the main resistance and therefore the operating frequency rane. DCOx controls the switched components to generate one of 8 to 32 (depending on DCO version) frequencies within this range. Since this only gives you a small colleciton of possible frequencies, there is also the modulation (MODx). These bits modulate the DCOx setting with each DCO clock tick based on an internal pattern. So out of 32 DCO clock cycles, the output frequency is taken from DCOx for n and from DCOx+1 for 32-n clock cycles (evenly distributed). Which results in 32 times as many 'averaged' output frequencies. (average over 32 clock pulses)
However, as it is an R/C oscillator, precision is poor adn no two MSPs give exact the same frequency for the same register setting. 4x and 5x family provide an FLL to auto-adjus tthe DCO registers in comparison to a reference signal (e.g. a 32kHz crystal).For the 2x family, many devices contain factory-provided settings for the most common frequencies (e.g. 1-4-8 MHz) that only need to be copied from info memory to the DCO registers.
_____________________________________Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.