I am having a atmega328p for my home project. Consider the pins

Pin B2 - connected to LDO enable. Output Pin D7 - MUX s0 Pin B0 - MUX s1 Pin B1 - MUX s2 Pin B4 - MUX s3 Pin c3 - MUX enable

Pin B3 and B4 - It is taken out of the board and not connected anything. But in the program, giving a pulse. I can test the pulse by connecting a LED. But actually nothing is connected. These are output pins

I need to know how to configure these pins to consume lower power while sleeping the atmega. From the datasheet, unconnected pins should be configured as input with internal pull up enabled. Refer : 13.2.6 Unconnected Pins

Is this statement suited for the above pins?

  • \$\begingroup\$ "Also can we consider PB3 and PB4 as unconnected pins?" - Well are they connected to something? \$\endgroup\$ Commented Jan 6, 2020 at 13:33
  • \$\begingroup\$ No it just taken as a two legs on board. \$\endgroup\$
    – mcv
    Commented Jan 7, 2020 at 3:47
  • \$\begingroup\$ So they are unconnected, and you are asking if they are unconnected? \$\endgroup\$ Commented Jan 7, 2020 at 10:22
  • \$\begingroup\$ Ok i re arranged the question. Help me to reduce the power \$\endgroup\$
    – mcv
    Commented Jan 9, 2020 at 7:10
  • \$\begingroup\$ What is this 'MUX' and how is it powered? Which LDO? "From the datasheet, unconnected pins should be configured as input" - where does it say that? \$\endgroup\$ Commented Jan 9, 2020 at 8:36

1 Answer 1


'328P datasheet: "14.11.6 Port Pins When entering a sleep mode, all port pins should be configured to use minimum power. The most important is then to ensure that no pins drive resistive loads. In sleep modes where both the I/O clock (clkI/O) and the ADC clock (clkADC) are stopped, the input buffers of the device will be disabled. This ensures that no power is consumed by the input logic when not needed. In some cases, the input logic is needed for detecting wake-up conditions, and it will then be enabled. Refer to the section Digital Input Enable and Sleep Modes for details on which pins are enabled. If the input buffer is enabled and the input signal is left floating or have an analog signal level close to VCC/2, the input buffer will use excessive power."

So connect unused inputs to Gnd, to VCC, or use the internal pullup, so the pin is connected to some non-switching level.

  • \$\begingroup\$ In the sleep the input buffers will be disabled. So is it required to maintain the input pins to a defined level in the code? \$\endgroup\$
    – mcv
    Commented Jan 14, 2020 at 5:26
  • \$\begingroup\$ Turn on the pullup resistors, using pinMode (pinX, INPUT_PULLUP); let it go into sleep mode, and then measure the pins. Are they sitting solidly at ~5V? If yes, then nothing else is needed. If not, add an external 10K pullup. \$\endgroup\$
    – CrossRoads
    Commented Jan 14, 2020 at 13:07
  • \$\begingroup\$ From the figure FIgure. when SLEEP line is active, the Pxn will be grounded. is that right? If so connecting the pullup will drain current , right? \$\endgroup\$
    – mcv
    Commented Jan 15, 2020 at 3:45
  • \$\begingroup\$ Read 13.2.5 and 13.2.6 and see what you think. \$\endgroup\$
    – CrossRoads
    Commented Jan 15, 2020 at 4:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.