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

Shutdown: Put device into low powered state #10

Open
Jatoxo opened this issue May 16, 2021 · 0 comments
Open

Shutdown: Put device into low powered state #10

Jatoxo opened this issue May 16, 2021 · 0 comments

Comments

@Jatoxo
Copy link
Collaborator

Jatoxo commented May 16, 2021

Information

The Atmel 2560 has several lower powered modes which you can use to when you don't need the processor at full throttle.

Currently when OS is shut down, all it does is set a variable which allows entering the logic loop to false, leaving it looping through the main loop until any button is pressed. This consumes a fair amount of power when it really doesn't need to.

Description

Looking at the datasheet, the lowest powered mode (power down) can be awoken by any interrupt from INT0 to INT7. The mega doesn't actually implement two of these, but luckily we only need one.
We will need to have a separate button that can wake up OS. It might be possible to connect the keypad to the interrupt pins and some other HIGH pins so that an interrupt will be triggered when any keypad button is pressed, but we won't be doing this right away.
When we shut down OS, we'll attach an interrupt on the shutdown button that will wake it up again, simple as that. To trigger the shutdown we can use another interrupt that sets a globally accessible shutDown variable which should be checked in any longer loop to request that it exits (For example in lists or programs).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant