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

Power saving #5

Open
SukkoPera opened this issue Oct 31, 2019 · 0 comments
Open

Power saving #5

SukkoPera opened this issue Oct 31, 2019 · 0 comments
Assignees
Labels
enhancement New feature or request firmware Issue in the firmware

Comments

@SukkoPera
Copy link
Owner

SukkoPera commented Oct 31, 2019

The following lines should turn off a few unused AVR peripherals, helping us save some power. I don't know how effective the saving will be, but I think it's a good idea to try and minimize our current draw, as some PSX controllers might already be quite demanding:

ADCSRA &= ~(1 << ADEN);  // Turn off ADC
ACSR |= (1 << ACD); // Turn off Analog Comparator
DIDR1 |= (1 << AIN1D) | (1 << AIN0D); // Turn off AIN digital input buffer
PRR |= (1 << PRTWI) | \  // Turn off TWI/I2C Interface
       (1 << PRTIM2) | \  // Turn off Timer 2
       (1 << PRTIM1) | \  // Turn off Timer 1
       (1 << PRSPI) | \  // Turn off SPI Interface
#ifndef ENABLE_SERIAL_DEBUG
       (1 << PRUSART0) | \  // Turn off Serial Port
#endif
       (1 << PRADC);   // Turn off ADC

The last command might make the others redundant. I guess we should take some measures.

@SukkoPera SukkoPera self-assigned this Oct 31, 2019
@SukkoPera SukkoPera added the enhancement New feature or request label Oct 31, 2019
@SukkoPera SukkoPera added the firmware Issue in the firmware label Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request firmware Issue in the firmware
Projects
None yet
Development

No branches or pull requests

1 participant