Narcoleptic keeps resetting and once in a while freezing on my atmega1284p.
I double checked my fuse settings and they appear to all be correct.
Has anyone else had this problem,
Thanks,
Donald
I have the following code:
#include "Arduino.h"
/*****************************************************************
- The information for naroleptic sleep
*/
#include "Narcoleptic/Narcoleptic.h"
#include <SoftwareSerial.h>
// XBee's DOUT (TX) is connected to pin 6 (Arduino's Software RX)
// XBee's DIN (RX) is connected to pin 7 (Arduino's Software TX)
SoftwareSerial DebugSerial(1,0); // RX, TX
#define XBEE_SLEEP_PIN 2 // The pin that is used to put the xbee to sleep
#define XBEE_RESET_PIN 12
void setup()
{
DebugSerial.begin(9600);
DebugSerial.println("Starting");
// Set up xbee reset pin goes LOW to reset
pinMode(XBEE_RESET_PIN,OUTPUT);
digitalWrite(XBEE_RESET_PIN,LOW);
// We have to delay after setting the reset by 1000 millis, nothing shorter works
delay(2000);
// Set up the pin for the xbee to be awake
pinMode(XBEE_SLEEP_PIN,OUTPUT);
// Set the xbee awake
digitalWrite(XBEE_SLEEP_PIN,LOW);
pinMode(25,OUTPUT);
// Set the xbee awake
digitalWrite(25,HIGH);
delay(5000);
DebugSerial.println("Started");
// Add your initialization code here
}
// The loop function is called in an endless loop
void loop()
{
DebugSerial.println("Sleeping");
delay(1000);
digitalWrite(XBEE_SLEEP_PIN,HIGH);
digitalWrite(25,HIGH);
Narcoleptic.delay(5000);
digitalWrite(25,LOW);
// Set the xbee awake
digitalWrite(XBEE_SLEEP_PIN,LOW);
delay(1000);
DebugSerial.println("Awake");
delay(1000);
}