Are these power saving lines correct?

I'm trying to bring down the power consumption on a 328P. Before I add this to my sketch and upload to my 328P is the code correct? I'm already running the 8 MHz internal.

void setup() {
 
 // disable ADC for power savings
  ADCSRA = 0;
    // turn off brown-out enable in software
  MCUCR = bit (BODS) | bit (BODSE);  // turn on brown-out enable select
  MCUCR = bit (BODS);        // this must be done within 4 clock cycles of above
  interrupts ();             // guarantees next instruction executed
  sleep_cpu ();              // sleep within 3 clock cycles of above

  power_adc_disable(); // ADC converter
  power_spi_disable(); // SPI
  power_usart0_disable();// Serial (USART)
}

void loop() {
  // put your main code here, to run repeatedly:

}

Went ahead and uploaded it anyway. Made absolutely zero difference in power consumption (draws 94 Ma doing nothing) and I actually lost some functionality in the sketch. My i2c keypad quit working.

This guide is full of useful information. Study it carefully!

HI
What have you got your controller doing, what are its inputs and what are its outputs.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom..... :slight_smile:

jremington:
This guide is full of useful information. Study it carefully!

I've gone through that several times and nothing brings down the draw on the chip expect replacing it with a different one. I think it's a dud personally. I'm just waiting for my new 328's to arrive to see.

TomGeorge:
HI
What have you got your controller doing, what are its inputs and what are its outputs.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Tom… :slight_smile:

Pretty sure it isn’t the circuit causing the problems. If I swap out a chip from a Uno I have lying around the draw drops to 20mA using the same code. Just waiting on some new 328’s to come in to test out.