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, CC2430, Z-STACK

CC2530的数据手册中关于SLLEEPCMD和SLEEPSTA寄存器的定义中有几个保留位,但是在Z-Stack的程序中,我找到的系统时钟初始化设置的代码中却对这几个保留位进行了设置,不知道这是为什么?好像这几个保留位在CC2430中是有定义的。

而系统时钟初始化的代码为:

SLEEPCMD &= ~OSC_PD;                 //OSC_PD=0x04                  /* turn on 16MHz RC and 32MHz XOSC */                \ 
  while (!(SLEEPSTA & XOSC_STB));       //XOSC_STB=0x40        /* wait for 32MHz XOSC stable */                     \
  asm("NOP");                                                                                    /* chip bug workaround */                            \
  for (i=0; i<504; i++) asm("NOP");                                                    /* Require 63us delay for all revs */                \
  CLKCONCMD = (CLKCONCMD_32MHZ | OSC_32KHZ);             /* Select 32MHz XOSC and the source for 32K clock */ \
  while (CLKCONSTA != (CLKCONCMD_32MHZ | OSC_32KHZ)); /* Wait for the change to be effective */   \
  SLEEPCMD |= OSC_PD;                                                               /* turn off 16MHz RC */