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

Low power / low noise #13

Open
laurb9 opened this issue Feb 22, 2015 · 1 comment
Open

Low power / low noise #13

laurb9 opened this issue Feb 22, 2015 · 1 comment

Comments

@laurb9
Copy link
Owner

laurb9 commented Feb 22, 2015

Enter CPU sleep modes instead of busy waiting or delay(), to reduce power usage.

Use ADC Noise Canceler mode on AVR.
From the Atmega328P docs:

24.6 ADC Noise Canceler

The ADC features a noise canceler that enables conversion during sleep mode to reduce noise induced from the CPU core and other I/O peripherals. The noise canceler can be used with ADC Noise Reduction and Idle mode. To make use of this feature, the following procedure should be used:
a. Make sure that the ADC is enabled and is not busy converting. Single Conversion mode must be selected and the ADC conversion complete interrupt must be enabled.
b. Enter ADC Noise Reduction mode (or Idle mode). The ADC will start a conversion once the CPU has been halted.
c. If no other interrupts occur before the ADC conversion completes, the ADC interrupt will wake up the CPU and execute the ADC Conversion Complete interrupt routine. If another interrupt wakes up the CPU before the ADC conversion is complete, that interrupt will be executed, and an ADC Conversion Complete interrupt request will be generated when the ADC conversion completes. The CPU will remain in active mode until a new sleep command is executed.

Note that the ADC will not be automatically turned off when entering other sleep modes than Idle mode and ADC Noise Reduction mode. The user is advised to write zero to ADEN before entering such sleep modes to avoid excessive power consumption.

@laurb9
Copy link
Owner Author

laurb9 commented Feb 22, 2015

The noise canceler mode does not seem to work well with free-running mode. Maybe because the CPU has to wake up and read the data in the ISR while the ADC is already running the fetch phase of the next conversion.

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

No branches or pull requests

1 participant