The MSP432p manual, on page 915, explains how to take a reference clock frequency and baudrate target and compute the baudrate register values.
To verify that I understand the instructions correct, I figured I would work through the table in the uartecho's hardware setup to make sure I get the same values.
For the 115200 baud config at 12MHz, I would expect the following:
{
.outputBaudrate = 115200,
.inputClockFreq = 12000000,
.prescalar = 6,
.hwRegUCBRFx = 8,
.hwRegUCBRSx = 0x11, // 17
.oversampling = 1
},
The Sx field, per the documentation, is a lookup in table 24-4 for the remainder of F/baud which is 0.1666 in this case.
What is odd is the value in the uart echo sample for Sx is 32. At a 24MHz reference clock, I would expect that the Sx value would be 0x49, but the sample code uses 37.
Can you help me see where I'm misunderstanding the baudrate configuration computation?
Cheers
