1265 views|0 replies

3836

Posts

19

Resources
The OP
 

msp430f149 baud rate setting [Copy link]

TI MSP430 series microcontroller, the baud rate value of the usart module is determined by the following three registers: UxBR0, UxBR1, UxMCTL Baud rate = BRCLK/N, mainly to calculate N. BRCLK: clock source, which can be set by the register as the clock source; through the SSEL two bits of the register UCAxCTL1, 01: ACLK, 02: SMCLK
N: The frequency division factor generated by the baud rate. N=UxBR1+UxBR0+UxMCTL, where UxBR1+UxBR0 is the integer part, UxMCTL is the set fractional part, where UxBR1 is the high bit, UxBR0 is the low bit, and the two are combined into a 16-bit word. For example: baud rate = 115200, clock source = 8MHz, external crystal oscillator N = 8000000/115200 = 69.44. Obviously: UxBR1+UxBR0 = 13, that is, UxBR1 = 0, UxBR0 = 0x45, first round the fractional part 0.44×8, that is, 3.52, to 3. This 3 means that there must be 3 1s in the 8 bits in UxMCTL, and UxMCTL is divided into First Stage Modulation and Second Stage Modulation, that is, the former is the high 4 bits, with a value range of 0-F, and the latter is the low 4 bits. Note that the last 4 bits are preferably even numbers. The decimal part of the previous step is rounded to the integer value and distributed to the high and low bits. For example, 3 can be written as 0x16.
This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list