Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpu/msp430/perriph_usci: fix prescaler values for ACLK #20623

Merged

Conversation

maribu
Copy link
Member

@maribu maribu commented Apr 25, 2024

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

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.

Fixes RIOT-OS#20620
@github-actions github-actions bot added Platform: MSP Platform: This PR/issue effects MSP-based platforms Area: cpu Area: CPU/MCU ports labels Apr 25, 2024
@maribu maribu added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed Platform: MSP Platform: This PR/issue effects MSP-based platforms Area: cpu Area: CPU/MCU ports labels Apr 25, 2024
@riot-ci
Copy link

riot-ci commented Apr 26, 2024

Murdock results

✔️ PASSED

4c0d6f8 cpu/msp430/perriph_usci: fix prescaler values for ACLK

Success Failures Total Runtime
10066 0 10066 22m:13s

Artifacts

@benpicco benpicco enabled auto-merge April 26, 2024 09:42
@benpicco benpicco added this pull request to the merge queue Apr 26, 2024
Merged via the queue into RIOT-OS:master with commit 70c70e2 Apr 26, 2024
31 checks passed
@maribu maribu deleted the cpu/msp430/periph_usci/fix-prescaler branch April 26, 2024 12:48
@maribu
Copy link
Member Author

maribu commented Apr 26, 2024

Thx a lot :)

@mguetschow mguetschow added this to the Release 2024.07 milestone Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Impact: minor The PR is small in size and might only require a quick look of a knowledgeable reviewer Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cpu/msp430: USCI not working with auxiliary clock
4 participants