Skip to content

Power saving #5

@SukkoPera

Description

@SukkoPera

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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestfirmwareIssue in the firmware

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions