1744 views|0 replies

1140

Posts

0

Resources
The OP
 

Calculation and setting of baud rate of msp430 microcontroller [Copy link]

By setting three baud rate related registers, namely the baud rate integer UxBR1, UxBR0, and the baud rate trim register UxMCTL, the baud rate control parameters are calculated using the following formula: Baud rate parameter (UxBR0, UxBR1) = baud rate clock source frequency/required baud rate. (Take the integer part of the result) For example: the baud rate clock source frequency = 8MHz, the required baud rate = 115200, then the baud rate parameters UxBR0, UxBR1 are 8000KHz/115.2KHz = 69.444444444, which is rounded to 69. The decimal part 0.444444444 is used as the parameter in the trimming register, and is calculated using the following formula: Baud rate trimming parameter (UxMCTL) = 8 x decimal part (take the integer part of the result) So, it should be 8 x 0.444444444=3.5, so we can take 3 or 4 here, here we take 4. Therefore, 4 pulse interpolation bits are required. In the UxMCTL register, after selecting 4 bits at random, UxMCTL=0x55. Note that the interpolation pulses should be dispersed among the 8 bits of UxMCTL as much as possible. At this point, the serial port baud rate parameter setting is completed.

This post is from Microcontroller MCU
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

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