Go Down

Topic: attiny85 trying to turn ADC off (Read 748 times) previous topic - next topic

pratto

in my quest to try to minimize power consumption, i have been reading about, and watching videos about, things to turn off in the tiny. well i decided to start with turning off the ADC. just the ADC. other things to come later. i inserted this code into a simple LED blink program :

#include <avr/sleep.h>

#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif

void goToSleep(void){
  ADCSRA &= ~_BV(ADEN);}

loaded it and ran it. the blink still works. but my current draw after is the same as before. my question is, how can i tell if i actually shut off the ADC ?

pratto

never mind. i found nick gammons paper about reducing power consumprion (http://www.gammon.com.au/power) and got it working. what a difference. thanks nick.

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy