Why does cc2530 have crystal oscillator and RC oscillator, etc.

The system clock system clock of CC2530 can choose an external 32MHz crystal oscillator, or the built-in 16MHz RC oscillator, but the 32MHz crystal oscillator must be selected when RF is working.

In addition, the 32KHZ Clock of CC2530 can choose the external 32.768KHz, or the internal 32-KHz RC Oscillator. The 32KHz clock is mainly used in Sleep Timer and Watchdog Timer.

The clock source can be used alternately between a high-precision crystal oscillator and a low-power RC oscillator. Note that the RF transceiver operation is based on a 32MHz crystal oscillator as the clock source.

Two high frequency oscillators present in the device:

* 32MHz crystal oscillator

* 16MHz RC oscillator

The 32MHz crystal oscillator start-up time may be too long for some applications; therefore the device can run on the 16MHz RC oscillator until the crystal oscillator is stable and then use the 32MHz crystal oscillator. 16MHz RC oscillator

The oscillator has low power consumption but is not very accurate, so it cannot provide services for the RF module, and can only use a 32MHz crystal oscillator.

Two LFOs present in the device:

* 32 KHz crystal oscillator

* 32 KHz RC oscillator

The 32KHz XOSC is designed to operate at a frequency of 32.768KHz and can provide a stable clock signal for some subsystems that require clock accuracy. The 32KHz RCOSC can run at 32.753KHz after calibration. calibration

Only occurs when the 32MHz XOSC is enabled, calibration can be turned off by enabling the SLEEPCMD.OSC32K_CALDIS bit. Compared with the 32KHz XOSC crystal oscillator, the 32KHz RC oscillator consumes less power and should be used in

at low cost. Two oscillators cannot operate at the same time.

system clock

The system clock is driven by two clock sources, 32MHz XOSC or 16MHz RCOSC. The CLKCONCMD.OSC bits are used to select the system clock source. Note: When using the RF module, the 32MHz crystal oscillator must be selected and run stably.

注意:改变CLKCONCMD.OSC位并不能立即导致系统时钟源的改变。当CLKCONSTA.OSC = CLKCONCMD.OSC时时钟源的改变才会发挥作用。这是因为设备在实际改变时钟源之前

需要稳定的时钟。还有就是注意CLKCONCMD.CLKSPD位反应着系统时钟频率,因此是CLKACONCMD.OSC位的镜子。一旦32MHz的XOSC被选中和稳定,例如,当CLKCONSTA.OSC

位从1切换到0时。

注意:从16MHz到32MHz时钟源的改变符合CLKCONCMD.TICKSPD设置。CLKCONCMD.TICKSPD设置的缓慢一些的话,当CLKCONCMD.OSC改变的话会导致实际的时钟源起作用的

时间会很长。当CLKCONCMD.TICKSPD

等于000时会获得最快的切换速度。

32KHz的振荡器

默认的或者复位后32KHz RCOSC使能并且被设置作为32KHz的时钟源。其功耗低,但是相对于32KHz晶体振荡器而言精度不高,32KHz时钟源用来驱动睡眠定时器,产生看门狗的滴答值

和作为timer 2计算睡眠定时器的一个闸门。32KHz时钟源被寄存器CLKCONCMD.OSC32K位用来作为选择振荡器。CLKCONCMD.OSC32K寄存器可以在任意时间写入,但是在16MHz RC

振荡器是活跃的系统时钟源之前是不会起作用的。当系统时钟从16MHz改变为32MHz的晶体振荡器(CLKCONCMD.OSC从1到0)一旦32KHz RC振荡器被选中了它的的校验就启动了并且被执行。在校准期间,32MHz晶体振荡器的一个分频量会被使用。32KHzRCOSC振荡器校准后的结果是它会工作在32.753kHz上。32kHz RC振荡器校准时间可能要2ms时间来完成。可以设置SLEEPCMD.OSC32K_CALDIS位设置为1的话,会关闭校准。在校准结束时,会在32KHz时钟源上产生一个额外的脉冲,会导致睡眠定时器增加1。

注意:当切换到32KHz晶体振荡器后和从32KHz晶体振荡器被设置的PM3模式唤醒时,振荡器稳定到准确频率的时间在500 ms以上。睡眠定时器、看门狗定时器和时钟损失探测器在32KHz

晶体振荡器稳定之前不能使用。

振荡器和时钟寄存器

下面是振荡器和时钟寄存器的描述,所有寄存器的位会在进入PM2和PM3时保持不变,除非有异常情况发生。

定时器滴答值产生器

CLKCONCMD.TICKSPD寄存器控制timer1、timer3和timer4的全局预分频。预分频的值设置范围在0.25MHz和32MHz之间。

需要注意的是如果CLKCONCMD.TICKSPD显示的频率高于系统时钟,则在CLKCONSTA.TICKSPD中的实际的预分频值表明是和系统时钟的值是一样的。

数据滞留

在PM2和PM3电源模式中,绝大多数的内部电路关闭了,然而,SRAM中任保留它的内容,内部寄存器的值也会保留。

保留数据的寄存器是CPU的寄存器、外部寄存器和RF寄存器,除非另一些位域值设置的比较特殊。切换到PM2和PM3模式的现象对于软件而已是透明的。

注意在PM3模式下睡眠定时器的值不会保存。

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325809196&siteId=291194637