看了一下MSP430G2xx2系列的底层函数库,很迷茫。我准备用MSP430G2303,板子已经回来了。看了MSP430x2xx Family User's Guide,感觉对寄存器的描述不详细。比如:
5.3.1 DCOCTL, DCO Control Register
DCOx Bits 7-5 DCO frequency select. These bits select which of the eight discrete DCO frequencies within the range defined by the RSELx setting is selected.
MODx Bits 4-0 Modulator selection. These bits define how often the f DCO+1 frequency is used within a period of 32 DCOCLK cycles. During the remaining clock cycles (32-MOD) the f DCO frequency is used. Not useable when DCOx = 7.
5.3.2 BCSCTL1, Basic Clock System Control Register 1
XT2OFF Bit 7 XT2 off. This bit turns off the XT2 oscillator
0 XT2 is on
1 XT2 is off if it is not used for MCLK or SMCLK.
XTS Bit 6 LFXT1 mode select.
0 Low-frequency mode
1 High-frequency mode
DIVAx Bits 5-4 Divider for ACLK
00 /1
01 /2
10 /4
11 /8
RSELx Bits 3-0 Range select. Sixteen different frequency ranges are available. The lowest frequency range is selected by setting RSELx = 0. RSEL3 is ignored when DCOR = 1.
(还不会贴图,见谅,见手册288页),看后还是不知道怎么设置。后来在DATASHEET里看到了不同DCOx,RSELx计算DCO频率的方法。
如果对寄存器有详细描述,我直接操作寄存器应该是很快上手的,因为其寄存器并不多。哪位老师能够提供MSP430G2303寄存器的详细说明。
另外,按照DATASHEET描述,DCO频率是一个范围,就是说这个频率不是很精准,那么用这个频率设置串口波特率是会不会导致误码率很高呢? |