Dear Community,
I present a problem that seems to have frustrated more than a few of us. I am trying to get the GenericApp example program that comes with Z-stack 2.4.0-1.4.0 to run in TIMER SLEEP mode. I am using a CC2530, which means the nominal current draw for should be 1 uA in this state.
I have taken the following steps:
1. Commented out ZDO_COORDINATOR and RTR_NWK in f8wCoord.cfg to specify an end device as a target.
2. Set POLL_RATE=0 and RFD_RCVC_ALWAYS_ON=FALSE in f8wConfig.cfg
3. Set POWER_SAVING in the preprocessor (using IAR EW for 8051).
4. Hardcoded Hal_KeyIntEnable = HAL_KEY_INTERRUPT_ENABLE in hal_key.c
5. The only OSAL timer running is the send "Hello World" event, which is running at the maximum allowed OSAL interval (65 s).
After downloading and debugging this application, I have noticed a few things:
1. Nominal current consumption between OSAL events is 1.7 mA (much higher than timer sleep mode).
2. The following code segment in osal_pwrmgr_powerconserve always has "next" values of either 600 or 1000, which means some process has events scheduled
every 600 or 1000 ms, despite my attempts to turn everything off except the send message OSAL event in the GenericApp.
// Hold off interrupts.
HAL_ENTER_CRITICAL_SECTION( intState );
// Get next time-out
next = osal_next_timeout();
// Re-enable interrupts.
HAL_EXIT_CRITICAL_SECTION( intState );
// Put the processor into sleep mode
OSAL_SET_CPU_INTO_SLEEP( next );
This leads me to two questions:
1. What further steps are needed to achieve power mode 2?
2. What are these events and how do I turn them off? If these events are due to some debug process, how do I turn them off in IAR?
Thanks.
---Stu
