This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need help for CC2430 Power Mode 2

Other Parts Discussed in Thread: CC2430

Hello!

I am here again to ask for help with my CC2430!

I am building a wireless sensor network, in which, CC2430(master) sends UART command to sensor(slaver), receives the data from sensor and transmits it out by OTA. The chip is supposed to wake up and send UART command every 5 secends, then keep awake till the OTA packet is done.

The project is SerialApp from Zstack.

What I did to this project:1. #define RFD_RCVC_ALWAYS_ON FALSE

                                    2. POWER_SAVING

                                    3. #define HAL_KEY_INTERRUPT_ENABLE

                                    4. Change INT_HEAP_LEN  from 4096() default setting to 1890

                                    5. Change POLL_RATE to 0

                                    6. Block NWK_AUTO_POLL

                                    7. Change linker command file to f8w2430pm.xcl

Now the current during sleep time is about 6mA, which is 10000 times of 0.5uA specified in datasheet! Could you please give me some suggestion what else I should think about! Thanks!

 

  • Hi,

    I understood so that you want to work on PM2 mode for CC2430 sleeping period. And so, the chip will wake up by Timer interrupt or external interrupt.

    You are right that the chip should consum near 0,5 µA.

    While you don't validate Key_interrupt you have Polling_key which is validtate and wake up chip every 100 ms to poll for key state.

    When you say in your 3 part #define HAL_KEY_INTERRUPT_ENABLE what you mean?

    You should modify in Onboard.c file (function InitBoard(byte level), OnboardKeyIntEnable equal to HAL_KEY_INTERRUPT_ENABLE and not HAL_KEY_INTERRUPT_DISABLE.

    You said too that POLL_RATE is set to 0. Also your end_device never poll its's parent for data. Is it correct?

    I'm waiting for your response.

    Launix.

     

     

  • Hi Shu, I was thinking about your problem and can remember something what was once an issue with my project:

     

    Although you declared HAL_KEY_INTERRUPT_ENABLE there is also another line which needs to be changed. i will soucre for the thread about that issue and find it in my code.

    If I get it I'll post it here. If you come to the office before that, please contact me on MSN again and we will do it together again =)

     

    EDIT:

    Pls check in your according target if the ZStack still jumps regularly into HalKeyPoll() in hal_key.c.

     

    I deleted this part already from my original code, but I thought you have to comment out this line besides declaring HAL_KEY_INTERRUPT_ENABLE:

    hal_drivers.c => Hal_ProcessEvent():

    /**************************************************************************************************
     * @fn      Hal_ProcessEvent
     *
     * @brief   Hal Process Event
     *
     * @param   task_id - Hal TaskId
     *          events - events
     *
     * @return  None
     **************************************************************************************************/
    uint16 Hal_ProcessEvent( uint8 task_id, uint16 events )
    {

    //.....

    #if (defined HAL_KEY) && (HAL_KEY == TRUE)
        /* Check for keys */
        //HalKeyPoll();   //Comment this out


        /* if interrupt disabled, do next polling */
        if (!Hal_KeyIntEnable)
        {
          osal_start_timerEx( Hal_TaskID, HAL_KEY_EVENT, 100);
        }
    #endif // HAL_KEY

     

    other possibility:

    /**************************************************************************************************
     * @fn      Hal_ProcessEvent
     *
     * @brief   Hal Process Event
     *
     * @param   task_id - Hal TaskId
     *          events - events
     *
     * @return  None
     **************************************************************************************************/
    uint16 Hal_ProcessEvent( uint8 task_id, uint16 events )
    {

    //......

    #if (defined HAL_KEY) && (HAL_KEY == TRUE)
        /* Check for keys */
          //HalKeyPoll();
          HalKeyRead();   // I replaced it with this line


        /* if interrupt disabled, do next polling */
        if (!Hal_KeyIntEnable)
        {
          osal_start_timerEx( Hal_TaskID, HAL_KEY_EVENT, 100);
        }
    #endif // HAL_KEY

  • Hi!

    Thanks for your attention!

    Sorry for my expression and yes I modified in Onboard.c as :   OnboardKeyIntEnable = HAL_KEY_INTERRUPT_ENABLE;

    For polling, my device never poll for data, which I got to know from Oscilloscope.

    My result is an sleep consumption at 5mA level and peaks every 10 seconds.

    What else should I do?

    Please help me!

    Xielili

  • In my situation it helped when I did a step debugging and check if the code goes into the routine halSleep(), hal_sleep.c, and that it reached this part of the code:

              /* set CC2430 power mode */
              HAL_SLEEP_SET_POWER_MODE(halPwrMgtMode);
              /* wake up from sleep */ 

     If it does gets here and still your consumption is still too big, you can check what your PIO settings are. Basically you should set PIO which are not connect to output low. Also for those GPIOS that are connected you should set them properly so that they will not drain power when  you are in sleep mode.