cpu/msp430: implement power management#20613
Merged
maribu merged 3 commits intoRIOT-OS:masterfrom May 7, 2024
Merged
Conversation
Member
Author
|
Now with low symbol rates working on the MSP430 F2xx, it turned out that the auxiliary clock will not be auto-acquired by the USCI. (The datasheet indeed does only claim that the SMCLK will be acquired as needed by the UART peripheral, so this does check out.) Anyway, fixed :) |
The register r2 is the status register, which has the SR alias. Using SR is a lot more readable than r2.
This implements `pm_set_lowest()` for the MSP430. Unlike most other platforms, it intentionally does not use pm_layered. It is pretty similar to `pm_layered` in that is does use reference counters, but it uses them for two independent clock sources. The main difference is that the low frequency clock domain can be disabled even when the high frequency clock is still active. With the layers, disabling layer n-1 while layer n is still blocked would not work.
Member
Author
|
rebased on top of #20623 |
benpicco
approved these changes
May 6, 2024
Member
Author
|
Thx a bunch :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
This implements power management for the MSP430.
Testing procedure
Flash this on any MSP430 board. No regressions should occur, but power consumption should drop. Your mileage may wary, though:
Benchmarks
I attached a power monitor in-between the USB connection to our Olimex MSP430Hxxx breakout board and monitored the power consumption in the following scenarios:
/dev/ttyUSB0open). This is the baseline, as this power is used even without the MCU actually attachedexmaples/defaultfrommasterflashed, and firsthelpthenpsrunexmaples/defaultfrom this PR flashed, and firsthelpthenpsrunBenchmark on the
olimex-msp430h1611Benchmark on the
olimex-msp430h2618Conclusion
The power consumption goes down pretty much to the base line for each MCU family while the MCU is not in use, but spikes when there is activity. It looks pretty much like one would expect.
Issues/PRs references