User Manual
Version 1.1
2011-07-15
deRFnode and deRFgateway
dresden elektronik
ingenieurtechnik gmbh
Enno-Heidebroek-Str. 12
12 7 Dr
n
rm  n
Tel.: +49 351 31 85 00
Fax: +49 351 3 18 50 10
wireless@dresden-elektronik.de
www. r
n- l k r nik.
Page 51 of 56
individual pull-ups. Be careful to left out the Pins connected to the transceiver or the USB
FIFO, as otherwise you would reactivate the devices powered down before (see above).
(9) Disable any unnecessary MCU-internal device. This includes running timers, transceivers
(UART, DBGU, TWI, SPI, native USB), ADC, watchdog.
On AVR MCUs, this may be achieved by writing to the Power Reduction Registers, like:
#include <avr/power.h>
PRR0 = (1<
// disable Timer 0
or using existing functions from power.h, such as power_timer1_disable().
On ARM MCUs the equivalent function call is PMC_DisablePeripheral(id) from pe-
ripheral/pmc/pmc.c where the peripheral IDs are to be found in the At91SAM7X-
datasheet.     If     you     desire     to     switch     off     all     devices     at     once,
PMC_DisableAllPeripherals() will do that.
The watchdog is configured slightly different. On AVR MCUs use:
#include <avr/wdt.h>
wdt_disable();
respective WD_Disable() from peripheral/wdt/wd.c on ARM MCUs.
If using native USB on ARM MCUs, the USB transceiver is disabled by invoking
UDP_DisableTransceiver() from usb/device/core/USBD_UDP.c.
(10)    Disable BOD:
Slight improvements may be achived by disabling the Brown-out-detection feature. On
ARM MCUs, the GPNVM Bit0 has to be cleared by writing to the internal flash memory:
EFC_PerformCommand(AT91C_BASE_EFC0, AT91C_MC_FCMD_CLR_GP_NVM,
AT91C_MC_GPNVM0);
On AVR MCUs this is done by clearing the BODLEVEL bits (2:0) in the Fuse Low Byte.
(11)    Slow down the MCU clock:
This differs depending on the radio module used. When it is deRFmega128 series based,
simply put the MCU to sleep mode by writing to the sleep mode control register followed
by executing the sleep instruction.
#include <avr/io.h> // MCU register definitions
#include <avr/sleep.h>
SMCR = (1<// go into power down mode
sleep_cpu(); // execute sleep instruction
If using an ARM based MCU, the AT91Lib usb-device-massstorage-project example pro-
vides functions for switching the MCU main clock back to 32kHz.
For waking up the device again you may e.g. leave a timer running or configure a exter-
nal interrupt trigger. The steps to be performed after wakeup include simplified the re-
verse procedure as described above, especially reinitialization of internal devices that
have been powered down.
If you bought a deRFdevelopment kit, the Kit-CD includes a deRFnative example which
demonstrates low-power modes.