Hello All,
The narcoleptic library for putting the micro into a low power mode has an example sketch whimsically titled MerlinTheCat. It complies OK with Arduino UNO and any other ATmega 328 boards I’ve tested but does NOT compile with a Mega 2560 or ATmega 1284P boards.
Is there something wrong with the board files or are the larger micros inherently incompatible with the narcoleptic library?
Probably just incompatibility with hardcoded port usage, something like that.
Have you tried contacting the library creator about it?
Got a link to the library, preferably to source code?
OldMicroGuy:
I am using Windows with Arduino 1.0.5
I am getting many errors all of the form of:
NarcoleptClass :: xx()
all followed by
error: 'PRR' was not declared in this scope.
Roger
PRR is the power reduction register. The larger MCUs have more peripherals and one register isn't enough, so they have PRR0 and PRR1 instead of just PRR.
PRR is the power reduction register. The larger MCUs have more peripherals and one register isn't enough, so they have PRR0 and PRR1 instead of just PRR.
Thanks Jack that explains why the Narcoleptic library doesn't work.
Can anyone recommend a sleep library for the ATmega1284P?
PRR is the power reduction register. The larger MCUs have more peripherals and one register isn't enough, so they have PRR0 and PRR1 instead of just PRR.
Thanks Jack that explains why the Narcoleptic library doesn't work.
Can anyone recommend a sleep library for the ATmega1284P?
Roger
What sort of sleeping do you want to do? Narcoleptic has a wide range of capabilities, sleep as well as power reduction while running.
What would you have it do every 20 S? Could it just wake on an interrupt instead?
I was only thinking of using a 1284p.
The app is a battery powered temperature and maybe humidity sensor. I wouldn't have any external device to generate an interrupt. Need to use internal timer.
Power-down mode is the deepest sleep mode, in which the MCU will only draw about 0.1µA. The watchdog timer (WDT) can be used to wake it. The WDT requires 4-5µA to run, which is still hardly anything. The watchdog is not terribly accurate, so if you want something very close to 20 sec, some calibration may be needed, which will be specific to each individual MCU chip. The watchdog is also not infinitely variable, it can generate interrupts (to wake the MCU) at roughly 8, 4, 2, 1 seconds, or at 500, 250, 125, 64, 32, 16ms. It's common to sleep for several WDT periods to effectively generate longer periods; this technique should add virtually nothing to power consumption. An external RTC can be used to generate interrupts more accurately at specified times but it doesn't sound like that's part of the plans.