打印
[技术求助]

cc1101寄存器设置请教

[复制链接]
3565|7
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
gzbkey|  楼主 | 2014-8-12 17:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 gzbkey 于 2014-8-13 14:02 编辑

用的代码也是网上找来的,发数据没有问题,收数据是检查寄存器的,想改为中断接收,IOCFG2设置为0x06,发送端发出数据,接收端没反应,设置成0x3f可以输出方波。谁能指教一下,设置成接收中断需要哪些操作啊,只要接收到数据是,GDO2电平能变化提示就可以。单片机中断代码是没有问题的。

寄存器搞的一头雾水,看说明看得眼花缭乱









下边是重新调整的设置
用示波器看到中断脉冲了,但是一定要在while中 运行 CC1101_SendPacket(buff,sizeof(buff));  怎么回事啊
cc1101的寄存器 实在..................

CC1101_SPI_WriteReg(CC1101_IOCFG2,0x46);  //GDO2 Output Pin Configuration
CC1101_SPI_WriteReg(CC1101_IOCFG1,0x2E);  //GDO1 Output Pin Configuration
CC1101_SPI_WriteReg(CC1101_IOCFG0,0x06);  //GDO0 Output Pin Configuration
//CC1101_SPI_WriteReg(CC1101_FIFOTHR,0x47); //RX FIFO and TX FIFO Thresholds
//CC1101_SPI_WriteReg(CC1101_SYNC1,0xD3);   //Sync Word, High Byte
//CC1101_SPI_WriteReg(CC1101_SYNC0,0x91);   //Sync Word, Low Byte
CC1101_SPI_WriteReg(CC1101_PKTLEN,0x0c);  //Packet Length
CC1101_SPI_WriteReg(CC1101_PKTCTRL1,0x04);//Packet Automation Control
CC1101_SPI_WriteReg(CC1101_PKTCTRL0,0x45);//Packet Automation Control
CC1101_SPI_WriteReg(CC1101_ADDR,0x00);    //Device Address
CC1101_SPI_WriteReg(CC1101_CHANNR,0x00);  //Channel Number
CC1101_SPI_WriteReg(CC1101_FSCTRL1,0x06); //Frequency Synthesizer Control
CC1101_SPI_WriteReg(CC1101_FSCTRL0,0x00); //Frequency Synthesizer Control
CC1101_SPI_WriteReg(CC1101_FREQ2,0x10);   //Frequency Control Word, High Byte
CC1101_SPI_WriteReg(CC1101_FREQ1,0xB1);   //Frequency Control Word, Middle Byte
CC1101_SPI_WriteReg(CC1101_FREQ0,0x3B);   //Frequency Control Word, Low Byte
CC1101_SPI_WriteReg(CC1101_MDMCFG4,0xF6); //Modem Configuration
CC1101_SPI_WriteReg(CC1101_MDMCFG3,0x83); //Modem Configuration
CC1101_SPI_WriteReg(CC1101_MDMCFG2,0x13); //Modem Configuration
CC1101_SPI_WriteReg(CC1101_MDMCFG1,0x22); //Modem Configuration
CC1101_SPI_WriteReg(CC1101_MDMCFG0,0xF8); //Modem Configuration
CC1101_SPI_WriteReg(CC1101_DEVIATN,0x15); //Modem Deviation Setting
CC1101_SPI_WriteReg(CC1101_MCSM2,0x07);   //Main Radio Control State Machine Configuration
CC1101_SPI_WriteReg(CC1101_MCSM1,0x30);   //Main Radio Control State Machine Configuration
CC1101_SPI_WriteReg(CC1101_MCSM0,0x18);   //Main Radio Control State Machine Configuration
CC1101_SPI_WriteReg(CC1101_FOCCFG,0x16);  //Frequency Offset Compensation Configuration
CC1101_SPI_WriteReg(CC1101_BSCFG,0x6C);   //Bit Synchronization Configuration
CC1101_SPI_WriteReg(CC1101_AGCCTRL2,0x03);//AGC Control
CC1101_SPI_WriteReg(CC1101_AGCCTRL1,0x40);//AGC Control
CC1101_SPI_WriteReg(CC1101_AGCCTRL0,0x91);//AGC Control
CC1101_SPI_WriteReg(CC1101_WORCTRL,0xFB); //Wake On Radio Control
CC1101_SPI_WriteReg(CC1101_FSCAL3,0xE9);  //Frequency Synthesizer Calibration
CC1101_SPI_WriteReg(CC1101_FSCAL2,0x2A);  //Frequency Synthesizer Calibration
CC1101_SPI_WriteReg(CC1101_FSCAL1,0x00);  //Frequency Synthesizer Calibration
CC1101_SPI_WriteReg(CC1101_FSCAL0,0x1F);  //Frequency Synthesizer Calibration
CC1101_SPI_WriteReg(CC1101_TEST2,0x81);   //Various Test Settings
CC1101_SPI_WriteReg(CC1101_TEST1,0x35);   //Various Test Settings
CC1101_SPI_WriteReg(CC1101_TEST0,0x09);   //Various Test Settings


相关帖子

沙发
mmuuss586| | 2014-8-12 18:46 | 只看该作者
没接触过,你可以问问TI的FAE看看;

使用特权

评论回复
板凳
airwill| | 2014-8-12 19:39 | 只看该作者
也让人看得一头雾水, 居然什么 MCU 也不说, 什么连接控制方式也没有.

使用特权

评论回复
地板
xyz549040622| | 2014-8-13 09:22 | 只看该作者
:lol

使用特权

评论回复
5
武力戡乱| | 2014-12-18 22:30 | 只看该作者
0x06是对的

使用特权

评论回复
6
hugo0chen| | 2015-4-23 15:38 | 只看该作者
http://bbs.csdn.net/topics/390494060?page=1
我在淘宝上买的开发板,用的cc1101,经常出现不稳定啊异常等卡死。卖家给的示例里边的发送函数有问题,
进入发送模式发送数据之前,加入这个
halSpiStrobe(CC1101_SIDLE);   //进入IDLE状态
然后就不卡在那了。

使用特权

评论回复
7
可可球| | 2015-5-27 20:17 | 只看该作者
学习,帮顶

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

5

主题

30

帖子

1

粉丝