Learning XMega clock sources

Any microcontroller needs some clocking mechanism. This is how it performs instructions, count time, generate signals. Normally controller comes with many clocking options as there may be different needs of clocking speed and accuracy. Sometimes you may want to squeeze maximum performance out of it, then you would probably select the highest clock speed. In this case you would loose energy efficiency over performance. Sometimes you only need to send simple control commands and keep time. Then you would choose 32.768kHz clock source which helps to preserve energy and do the job. This is why microcontrollers have so many clocking options available. Shawon wrote pretty good guide about selecting and setting Xmega microcontroller clock source. He explains internal clock sources by listing their benefits and limitations. Then he takes to external sources and usage of PLL (Phase Locked Loop) to multiply crystal clock up to limits. Then he does several experiments to check few clock settings if they are correct by measuring waveforms with scope. Be sure to understand how clocking mechanism work in any micro before you dive any… Continue reading