jump to navigation

Micaz Platform Current Consumption with TinyOS 2.x Multiple Hop Radio and Power Management Agustus 6, 2007

Posted by kunilkuda in Uncategorized.
add a comment

TinyOS 2.0.1 CTP current consumptionTinyOS 2.0.1 CTP current consumption (zoom)

Testing condition:

  • Resistance that is used to measure: 23.4 Ohm
  • The radio is set to send the data each 1 second.
  • The radio is turned off for 1 second

Firmware that is used:

Makefile :
COMPONENT=EasyCollectionAppC
CFLAGS += -I$(TOSDIR)/lib/net \
-I$(TOSDIR)/lib/net/le \
-I$(TOSDIR)/lib/net/ctp \
-DACK_LOW_POWER_LISTENING \
-DCC2420_DEF_CHANNEL=15
include $(MAKERULES)
/////////////////////////////////////////////////////
#include <Timer.h>
module EasyCollectionC {
uses interface Boot;
uses interface SplitControl as RadioControl;
uses interface StdControl as RoutingControl;
uses interface Send;
uses interface Leds;
uses interface Timer<TMilli>;
uses interface RootControl;
uses interface Receive;
uses interface LowPowerListening;
provides interface McuPowerOverride;
}
implementation {
message_t packet;
bool sendBusy = FALSE;

    typedef nx_struct EasyCollectionMsg {
nx_uint16_t data;
} EasyCollectionMsg;

    event void Boot.booted() {
call LowPowerListening.setLocalSleepInterval(1024);
call RadioControl.start();
}

    event void RadioControl.startDone(error_t err) {
if (err != SUCCESS)
call RadioControl.start();
else {
call RoutingControl.start();
if (TOS_NODE_ID == 0) {
call RootControl.setRoot();
}
else {
call Timer.startPeriodic(1024);
}
}
}

    event void RadioControl.stopDone(error_t err) {}

    void sendMessage() {
EasyCollectionMsg* msg = (EasyCollectionMsg*)call Send.getPayload(&packet);
msg->data = 0xAAAA;
if (call Send.send(&packet, sizeof(EasyCollectionMsg)) != SUCCESS)
call Leds.led0On();
else
sendBusy = TRUE;
}

    event void Timer.fired() {
//call Leds.led2Toggle();
if (!sendBusy)
sendMessage();
}

    event void Send.sendDone(message_t* m, error_t err) {
if (err != SUCCESS)
call Leds.led0On();
sendBusy = FALSE;
}

    event message_t*
Receive.receive(message_t* msg, void* payload, uint8_t len) {
//call Leds.led1Toggle();
return msg;
}

    async command mcu_power_t McuPowerOverride.lowestState() {
return ATM128_POWER_DOWN;
}
}
///////////////////////////////////////////////////////////////
configuration EasyCollectionAppC {}
implementation {
components EasyCollectionC, MainC, LedsC, ActiveMessageC;
components CollectionC as Collector;
components new CollectionSenderC(0xee);
components new TimerMilliC();
EasyCollectionC.Boot -> MainC;
EasyCollectionC.RadioControl -> ActiveMessageC;
EasyCollectionC.RoutingControl -> Collector;
EasyCollectionC.Leds -> LedsC;
EasyCollectionC.Timer -> TimerMilliC;
EasyCollectionC.Send -> CollectionSenderC;
EasyCollectionC.RootControl -> Collector;
EasyCollectionC.Receive -> Collector.Receive[0xee];

    components McuSleepC;
McuSleepC.McuPowerOverride -> EasyCollectionC;

    components CC2420ActiveMessageC;
EasyCollectionC.LowPowerListening -> CC2420ActiveMessageC;
}