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.

关于cc2530的工作模式

Other Parts Discussed in Thread: CC2530, Z-STACK

各位好,最近在研究cc2530,请问怎么使cc2530运行在不同的功耗模式下,上电后,默认工作在什么模式下呢?怎么改变工作模式呢? 在程序里只是选择了高低频振荡源来自RC振荡器或者晶振,怎么让晶振起震呢?谢谢!

  • 默认工作模式Active/idle mode

    请下载Z-STACK,参考hal_sleep.c与HAL_BOARD_INIT(),了解工作模式改变和晶振的操作

    /************************************************************** 
    * mode   0   1  2 3
    *   PM0 PM1 PM2 PM3   
    ****************************************************************/

    #define SET_POWER_MODE(mode)                   \
       do {                                        \
          SLEEPCMD &= ~0X03;                          \
          if(mode == 0)        { SLEEPCMD &= ~0x03; } \
          else if (mode == 3)  { SLEEPCMD |= 0x03;  } \
          else { SLEEPCMD &= ~0x03; SLEEPCMD |= mode;  } \
          PCON |= 0x01;                            \
          asm("NOP");                              \
       }while (0)