Quantcast
Channel: MSP 低功耗微控制器论坛 - 最近的话题
Viewing all articles
Browse latest Browse all 3634

MSP430F4152使用VLO作为时钟源,UART输出乱码

$
0
0

不外接晶振,直接内部的VLO作为时钟源,倍频之后使用MCLK输出大约1MHz,此时SMCLK也为1MHz。然后配置UART选择SMCLK作为时钟源,波特率设置为9600,具体代码如下:

    UCA0CTL1 |= UCSWRST;
    UCA0CTL1 |= UCSSEL_2;

    UCA0BR0  = 109;
    UCA0BR1  = 0x0;
    UCA0MCTL = 4;

    P6SEL |= BIT5 + BIT6;                       // 端口使能
    UCA0CTL1 &= ~UCSWRST;                       // Initialize USCI state machine

这样配置后输出乱码,但是如果接外部32.768K的晶振,这样的配置是能生效的。不知是否因为VLO波动大导致的,不知大家有没有遇到这种情况,该如何解决。


Viewing all articles
Browse latest Browse all 3634

Trending Articles