这个FLLN和FLLD到底是设置什么的?
user guide上说FLLN为乘数N,但即然是乘数怎么会写在分频器上呢?还有为什么有10位。。。。,还有FLLD写在预分频器上又是什么意思?难道是二次分频?实在弄不明白
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
这个FLLN和FLLD到底是设置什么的?
user guide上说FLLN为乘数N,但即然是乘数怎么会写在分频器上呢?还有为什么有10位。。。。,还有FLLD写在预分频器上又是什么意思?难道是二次分频?实在弄不明白
请参考附件以及注释,上面有怎么算出来的。
// Initialize DCO to 2.45MHz
__bis_SR_register(SCG0); // Disable the FLL control loop
UCSCTL0 = 0x0000; // Set lowest possible DCOx, MODx
UCSCTL1 = DCORSEL_3; // Set RSELx for DCO = 4.9 MHz
UCSCTL2 = FLLD_1 + 74; // Set DCO Multiplier for 2.45MHz
// (N + 1) * FLLRef = Fdco
// (74 + 1) * 32768 = 2.45MHz
// Set FLL Div = fDCOCLK/2
__bic_SR_register(SCG0); // Enable the FLL control loop
// Worst-case settling time for the DCO when the DCO range bits have been
// changed is n x 32 x 32 x f_MCLK / f_FLL_reference. See UCS chapter in 5xx
// UG for optimization.
// 32 x 32 x 2.45 MHz / 32,768 Hz = 76563 = MCLK cycles for DCO to settle
__delay_cycles(76563);