cpu/msp430/perriph_usci: fix prescaler values for ACLK #20623
Merged
+4
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
For super low symbol rates the auxiliary clock (ACLK) is used to conserve power. But with only 32,678 Hz clock just prescaling will result in poor bit timing, hence correct modulation control settings to compensate are needed. Since computing this is too expensive, a look-up table (as switch statement) for the four most common symbol rates was used.
The datasheet gave the prescaler values ordered by ascending symbol rate, the switch statement was ordered descending. This changes the order to match the datasheets order and matches the correct prescaler setting to the corresponding symbol rate.
Testing procedure
UART on MSP430F2xx is now working for symbol rates of 9600 Bd.
Issues/PRs references
Fixes #20620