CC2530 GPIO 口输出配置说明
第一章原理图分析
CC2530 核心板上带有两颗晶振:第一颗频率为 32MHZ,第二颗频率为 32.768KHZCC250 正常运行的时候,需要一个高频的时钟信号和一个低频的时钟信号。
高频时钟信号,主要供给 CPU,保证程序的运行。
低频时钟信号,主要供给看门狗、睡眠定时器等片上外设。


按键 IO 口接线(按键是接在底板上的)


LED 灯接线(LED 是接在底板上的)


第二章输出模式配置





第三章配置 LED 灯代码示例
代码示例:
IAR 软件跳转功能


第四章延时函数生成
注意:默认使用内部晶振为 16MHZ。

第五章 CC2530 时钟介绍
1,CC250 正常运行的时候,需要一个高频的时钟信号和一个低频的时钟信号。
高频时钟信号,主要供给 CPU,保证程序的运行
低频时钟信号,主要供给看门狗、睡眠定时器等片上外设
2,高频时钟信号有两个来源:芯片内部的 16M RC 电路,另外一个是外接一个 32M 的石英晶振
低频时钟信息也有两个来源:一个是芯片内部的 32K RC 电路,另外一个是外接的 32.768K 的石英晶振
3,CC2530 芯片默认上电的时候,是内部的 2 个 RC 电路作为高频和低频的时钟来源。
4,如果我们在用串口,特别是无线通信的时候,必须要用 32M 的石英晶振,作为高频时钟来源
在协议栈中,需要从 16M 切换到 32M 晶振!!
5,高频时钟源特点:
2 个高频时钟源可以同时起振产生高频时钟信号
而 2 个低频时钟源,某一时刻只能有一个时钟源起振,并且起振的这个时钟源供给 CC2530
系统高频时钟源切换的步骤:
1,让 2 个高频时钟源起振
2,等待目标时钟源振荡稳定
3,延时一小段时间 63us
4,不分频输出
5,选中目标高频时钟源作为系统主时钟
6,确认一下当前工作的系统时钟是不是所选的高频时钟,涉及的寄存器:SLEEPCMD SLEEPSTA CLKCONCMD CLKCONSTA
Chipcon 公司,推出了 CC2430/1,TI 将其收购,发展出了 CC2530
1,让 SLEEPCMD 的第 2 位为 0
2,SLEPPSIA 寄存器的第 6 位为 1 表示时钟源稳定
3,超过 63us 延时
4,不分频输出:把寄存器 CLKCONCMD 第三位设置成 000
5,把寄存器 CLKCONCMD 的第六位清 0,设置 32M 做为系统的主时钟
6,读寄存器 CLKCONSTA 的第六位为 0,表示当前 32M 的时钟源已经做为了当前的系统主时钟,程序可以向下运行了
版权声明: 本文为 InfoQ 作者【DS小龙哥】的原创文章。
原文链接:【http://xie.infoq.cn/article/6815b3f3c62d727a466de131e】。文章转载请联系作者。
评论