完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
对主要配置寄存器的配置如下。现在的问题是,发送部分,在对CC1101初始化后,我在主函数中 halSpiStrobe(CCxxx0_STX); 使其为发送模式,然后读取halSpiReadReg(CCxxx0_TXBYTES),显示的值为0079,如果在这条语句之前加上halSpiStrobe(CCxxx0_SFTX);清空;则TXBYTES显示为0015,TXBYTES理论值应该是在0到64之间不是吗?这两个值很奇怪。 还有,如果在设置为发送模式之后,读取 num=halSpiReadReg(CCxxx0_MARCSTATE); 仍然显示0079,按照datasheet上,应该是显示0x13表明在TX模式,不符。 spi读写等子函数都是参照ti提供的例程。接收模块也有类似的问题。所以现在发送接收还不能正常工作。求指导! typedef struct S_RF_SETTINGS { INT8U FSCTRL1; // Frequency synthesizer control. INT8U FSCTRL0; // Frequency synthesizer control. INT8U FREQ2; // Frequency control word, high INT8U. INT8U FREQ1; // Frequency control word, middle INT8U. INT8U FREQ0; // Frequency control word, low INT8U. INT8U MDMCFG4; // Modem configuration. INT8U MDMCFG3; // Modem configuration. INT8U MDMCFG2; // Modem configuration. INT8U MDMCFG1; // Modem configuration. INT8U MDMCFG0; // Modem configuration. INT8U CHANNR; // Channel number. INT8U DEVIATN; // Modem deviation setting (when FSK modulation is enabled). INT8U FREND1; // Front end RX configuration. INT8U FREND0; // Front end RX configuration. INT8U MCSM0; // Main Radio Control State Machine configuration. INT8U FOCCFG; // Frequency Offset Compensation Configuration. INT8U BSCFG; // Bit synchronization Configuration. INT8U AGCCTRL2; // AGC control. INT8U AGCCTRL1; // AGC control. INT8U AGCCTRL0; // AGC control. INT8U FSCAL3; // Frequency synthesizer calibration. INT8U FSCAL2; // Frequency synthesizer calibration. INT8U FSCAL1; // Frequency synthesizer calibration. INT8U FSCAL0; // Frequency synthesizer calibration. INT8U FSTEST; // Frequency synthesizer calibration control INT8U TEST2; // Various test settings. INT8U TEST1; // Various test settings. INT8U TEST0; // Various test settings. INT8U IOCFG2; // GDO2 output pin configuration INT8U IOCFG0; // GDO0 output pin configuration INT8U PKTCTRL1; // Packet automation control. INT8U PKTCTRL0; // Packet automation control. INT8U ADDR; // Device address. INT8U PKTLEN; // Packet length. } RF_SETTINGS; const RF_SETTINGS rfSettings = { 0x06, // FSCTRL1 liu 0x00, // FSCTRL0 Frequency synthesizer control. 0x10, // FREQ2 Frequency control word, high byte. 0xB1, // FREQ1 Frequency control word, middle byte. 0x3B, // FREQ0 Frequency control word, low byte. 0xf6, // MDMCFG4, liu 0x83, // 2.398kbps---liu 0x13, // MDMCFG2 Modem configuration.GFSK Mode---liu 0x22, // MDMCFG1 Modem configuration. 0xF8, // MDMCFG0 Modem configuration. 0x00, // CHANNR Channel number. 0x15, // DEVIATN, liu 0x56, // FREND1 Front end RX configuration. 0x10, // FREND0 Front end RX configuration. 0x18, // MCSM0 Main Radio Control State Machine configuration. 0x16, // FOCCFG Frequency Offset Compensation Configuration.liu 0x6c, // BSCFG Bit synchronization Configuration.liu 0x03, // AGCCTRL2 AGC control.liu 0x40, // AGCCTRL1 AGC control.liu 0x91, // AGCCTRL0 AGC control.liu 0xE9, // FSCAL3 Frequency synthesizer calibration. 0x2A, // FSCAL2 Frequency synthesizer calibration. 0x00, // FSCAL1 Frequency synthesizer calibration. 0x1F, // FSCAL0 Frequency synthesizer calibration. 0x59, // FSTEST Frequency synthesizer calibration. 0x81, // TEST2 Various test settings. 0x35, // TEST1 Various test settings. 0x09, // TEST0 Various test settings. 0x0B, // IOCFG2 GDO2 output pin configuration. 0x06, // IOCFG0 GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed pseudo register explanation. 0x04, // PKTCTRL1 Packet automation control. 0x04, // PKTCTRL0 Variable packet length mode. Packet length configured by the first byte after sync word 0x00, // ADDR Device address. 0x04, // PKTLEN 4 bytes--liu }; |
|
相关推荐 |
|
只有小组成员才能发言,加入小组>>
物联网工程师必备:怎么选择不同的无线连接技术,本指南帮你忙!
3257 浏览 1 评论
【DFRobot TinkerNode NB-IoT 物联网开发板试用连载】WIFI功能测试
3904 浏览 0 评论
【DFRobot TinkerNode NB-IoT 物联网开发板试用连载】Arduino的替代SublimeText3+STino
3411 浏览 0 评论
使用端口扩展器轻松高效地向IIoT端点添加具有成本效益的子节点
3964 浏览 1 评论
20603 浏览 11 评论
模组有时候复位重启后输出日志为“REBOOT_CAUSE_SECURITY_PMU_POWER_ON_RESET”的原因?
737浏览 2评论
923浏览 2评论
953浏览 1评论
1079浏览 1评论
359浏览 1评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 15:16 , Processed in 0.819706 second(s), Total 45, Slave 38 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号