|
- #include
- void main(void)
- {
- WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
- FLL_CTL0 |= DCOPLUS + XCAP18PF; // DCO+ set, freq = xtal x D x N+1
- SCFI0 |= FN_4; // x2 DCO freq, 8MHz nominal DCO
- SCFQCTL = 121; // (121+1) x 32768 x 2 = 7.99 MHz
- P1DIR = 0x22; // P1.1 & P1.5 to output direction
- P1SEL = 0x22; // P1.1 & P1.5 to output MCLK & ACLK
- while(1); // Loop in place
- }
复制代码 以上是8MHz的DCO代码,参考下面的文献说明进行修改
DCOPLUS位需要置1,并且设置D=2即可完成
附带说一句449的CPU工作频率为8MHz,所以超过了这个值就不要直接作为MCLK |
|