user2947: NOTE: this code was working perfectly fine in another program.
I have a simple piece of code that puts the Arduino to sleep. When it is finished and intergrated into my project, it will only wake the processor up when an alarm from an external RTC triggers one of the hardware interrupts.
#include <avr/sleep.h>
#include <avr/power.h>

void setup(){
    Serial.begin(9600);
}

void loop(){
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);        //deep sleep mode
    Serial.println("Device is going to sleep...");
    sleep_enable();        //put device to sleep

    sleep_disable();        //Device restarts here on wake
    Serial.println("Device is awake...");        
    delay(1000);        //to slow down serial output
}

In theory, the program should shut down the processor indefinitely because there is nothing available to wake it up.
However, the device continues waking itself up immediately after shutting down.
I have tried attaching the interrupts hoping it was some kind of anomalous watch-dog function. I have tried tying the interrupt pins to +5V and also (in a separate attempt) to GND. Nothing has helped.
What is causing the processor (and/or program) to constantly wake itself up?

user368: sleep_enable() allows the MCU to sleep, but it does not cause it to sleep. Call sleep_cpu() after enabling.

2947: <p>NOTE: this code was working perfectly fine in another program.</p>

<p>I have a simple piece of code that puts the Arduino to sleep. When it is finished and intergrated into my project, it will only wake the processor up when an alarm from an external RTC triggers one of the hardware interrupts.</p>

<pre><code>#include &lt;avr/sleep.h&gt;
#include &lt;avr/power.h&gt;

void setup(){
    Serial.begin(9600);
}

void loop(){
    set_sleep_mode(SLEEP_MODE_PWR_DOWN);        //deep sleep mode
    Serial.println("Device is going to sleep...");
    sleep_enable();        //put device to sleep

    sleep_disable();        //Device restarts here on wake
    Serial.println("Device is awake...");        
    delay(1000);        //to slow down serial output
}
</code></pre>

<p>In theory, the program should shut down the processor indefinitely because there is nothing available to wake it up.</p>

<p>However, the device continues waking itself up immediately after shutting down.</p>

<p>I have tried attaching the interrupts hoping it was some kind of anomalous watch-dog function. I have tried tying the interrupt pins to +5V and also (in a separate attempt) to GND. Nothing has helped.</p>

<p>What is causing the processor (and/or program) to constantly wake itself up?</p>
 368: <p><code>sleep_enable()</code> <em>allows</em> the MCU to sleep, but it does not <em>cause</em> it to sleep. Call <code>sleep_cpu()</code> after enabling.</p>
