CC1101的ASK模式下的收发程序
正在调试CC1101的程序。在2-FSK同步模式下可以正常收发数据,但设成ASK模式,就不能收发了。(我们的项目必须用ASK模式)
已经根据Smart RF Studio更改过寄存器,也阅读“DN022_CC110x_CC111x_OOK_ASK_Register_Settings”文档修改过寄存器,但一直就是不能收发。
哪位TX有完整的ASK模式的寄存器配置及接受发送程序,能给我参考一下吗?搞了2星期了,一点进展也没有。
不胜感激!
SmartRF Studio里面直接设置ASK模式收发也没法成功吗?原则上你用用SmartRF Studio设置成FSK能够收发,直接改成ASK是能够收发的,不知道出了调制模式你还有没有修改其他设置
Hi Mike,
现在解决了吗?若问题还存在,请把发送端和接受端设置的截图发上来以帮助诊断。你是直接通过SmartRF Studio控制还是把Code便宜下载到Flash控制发送的?
你好,我的问题还是没有解决。
2-FSK的FIFO模式收发的代码我是网上Down的,数据发射能正确发射,接收端能正确解出发射端的数据。
修改寄存器,使CC1101工作在ASK模式的FIFO模式下,通过示波器时抓发射端天线的信号,可以看到有数据脉冲。当接收端读FIFO一直读不到数据。
我又尝试了ASK的串口异步方式,发现ASK串口异步的在data rate 高于40kbps时,接收端会有很强的干扰,MCU的负载就很大了。
我需要的帮助:
1. ASK的FIFO模式下,能提供收发例程吗?
2. ASK串口异步方式,在高速率下怎么消除噪音。
(1).ASK的FIFO模式下的寄存器配置。
halSpiWriteReg(CCxxx0_IOCFG2,0x0d);
halSpiWriteReg(CCxxx0_IOCFG1,0x2e);
halSpiWriteReg(CCxxx0_IOCFG0,0x08);
// halSpiWriteReg(CCxxx0_FIFOTHR,0x0F);
// halSpiWriteReg(CCxxx0_FIFOTHR,0x07); //DN022 RX filter bandwidth > 325 kHz
halSpiWriteReg(CCxxx0_FIFOTHR,0x47); //DN022 RX filter bandwidth ≤ 325 kHz
halSpiWriteReg(CCxxx0_SYNC1,0xD3);
halSpiWriteReg(CCxxx0_SYNC0,0x91);
halSpiWriteReg(CCxxx0_PKTLEN,0x20);
halSpiWriteReg(CCxxx0_ADDR,0x00);
halSpiWriteReg(CCxxx0_CHANNR,0x00);
halSpiWriteReg(CCxxx0_PKTCTRL0,0x32);
halSpiWriteReg(CCxxx0_FSCTRL1,0x06);
halSpiWriteReg(CCxxx0_FSCTRL0,0x00);
halSpiWriteReg(CCxxx0_FREQ2,0x10); //433.92MHz
halSpiWriteReg(CCxxx0_FREQ1,0xB0);
halSpiWriteReg(CCxxx0_FREQ0,0x71);
halSpiWriteReg(CCxxx0_MDMCFG4,0xbB);
halSpiWriteReg(CCxxx0_MDMCFG3,0x83); //76K RX filter bandwidth = 203 kHz
// halSpiWriteReg(CCxxx0_MDMCFG4,0x26);
// halSpiWriteReg(CCxxx0_MDMCFG3,0x46);
// halSpiWriteReg(CCxxx0_MDMCFG2,0x35);
halSpiWriteReg(CCxxx0_MDMCFG2,0x30);
halSpiWriteReg(CCxxx0_MDMCFG1,0x42);
halSpiWriteReg(CCxxx0_MDMCFG0,0xf8);
halSpiWriteReg(CCxxx0_DEVIATN,0x15);
halSpiWriteReg(CCxxx0_MCSM2,0x07);
halSpiWriteReg(CCxxx0_MCSM1,0x30);
halSpiWriteReg(CCxxx0_MCSM0,0x18);
halSpiWriteReg(CCxxx0_FOCCFG,0x14);
halSpiWriteReg(CCxxx0_BSCFG,0x6C);
halSpiWriteReg(CCxxx0_AGCCTRL2, 0xff);
halSpiWriteReg(CCxxx0_AGCCTRL1, 0x00); //add mike
halSpiWriteReg(CCxxx0_AGCCTRL0, 0x91);
halSpiWriteReg(CCxxx0_WOREVT1, 0x43);
halSpiWriteReg(CCxxx0_WOREVT0, 0xB5); //add mike
halSpiWriteReg(CCxxx0_WORCTRL,0x68);
// halSpiWriteReg(CCxxx0_FREND1,0x56);
halSpiWriteReg(CCxxx0_FREND1,0xB6); //DN022 RX filter bandwidth > 101 kHz
// halSpiWriteReg(CCxxx0_FREND1,0x56); //DN022 RX filter bandwidth ≤ 101 kHz
halSpiWriteReg(CCxxx0_FREND0,0x11);
halSpiWriteReg(CCxxx0_FSCAL3,0xE9);
halSpiWriteReg(CCxxx0_FSCAL2,0x2A);
halSpiWriteReg(CCxxx0_FSCAL1,0x00);
halSpiWriteReg(CCxxx0_FSCAL0,0x1F);
// halSpiWriteReg(CCxxx0_TEST2,0x81);
// halSpiWriteReg(CCxxx0_TEST2,0x88); //DN022 RX filter bandwidth > 325 kHz
halSpiWriteReg(CCxxx0_TEST2,0x81); //DN022 RX filter bandwidth ≤ 325 kHz
// halSpiWriteReg(CCxxx0_TEST1,0x35);
// halSpiWriteReg(CCxxx0_TEST1,0x31); //DN022 RX filter bandwidth > 325 kHz
halSpiWriteReg(CCxxx0_TEST1,0x35); //DN022 RX filter bandwidth ≤ 325 kHz
halSpiWriteReg(CCxxx0_TEST0,0x09);
halSpiWriteReg(CCxxx0_RCCTRL1,0x41);
halSpiWriteReg(CCxxx0_RCCTRL0,0x00);
halSpiWriteReg(CCxxx0_FSTEST,0x59);
halSpiWriteReg(CCxxx0_PTEST,0x7F);
读Buffer的数据
if(halRfReceivePacket(RxBuffer_CC1101, RFRXBUFLEN)) //是否收到数据?
{
。。。。。。
}
(2).ASK的异步串行下的寄存器配置。
halSpiWriteReg(CCxxx0_IOCFG2,0x0d);
halSpiWriteReg(CCxxx0_IOCFG1,0x2e);
halSpiWriteReg(CCxxx0_IOCFG0,0x08);
// halSpiWriteReg(CCxxx0_FIFOTHR,0x0F);
// halSpiWriteReg(CCxxx0_FIFOTHR,0x07); //DN022 RX filter bandwidth > 325 kHz
halSpiWriteReg(CCxxx0_FIFOTHR,0x47); //DN022 RX filter bandwidth ≤ 325 kHz
halSpiWriteReg(CCxxx0_SYNC1,0xD3);
halSpiWriteReg(CCxxx0_SYNC0,0x91);
halSpiWriteReg(CCxxx0_PKTLEN,0x20);
halSpiWriteReg(CCxxx0_ADDR,0x00);
halSpiWriteReg(CCxxx0_CHANNR,0x00);
halSpiWriteReg(CCxxx0_PKTCTRL0,0x32);
halSpiWriteReg(CCxxx0_FSCTRL1,0x06);
halSpiWriteReg(CCxxx0_FSCTRL0,0x00);
halSpiWriteReg(CCxxx0_FREQ2,0x10); //433.92MHz
halSpiWriteReg(CCxxx0_FREQ1,0xB0);
halSpiWriteReg(CCxxx0_FREQ0,0x71);
halSpiWriteReg(CCxxx0_MDMCFG4,0xbB);
halSpiWriteReg(CCxxx0_MDMCFG3,0x83); //76K RX filter bandwidth = 203 kHz
// halSpiWriteReg(CCxxx0_MDMCFG4,0x26);
// halSpiWriteReg(CCxxx0_MDMCFG3,0x46);
// halSpiWriteReg(CCxxx0_MDMCFG2,0x35);
halSpiWriteReg(CCxxx0_MDMCFG2,0x30);
halSpiWriteReg(CCxxx0_MDMCFG1,0x42);
halSpiWriteReg(CCxxx0_MDMCFG0,0xf8);
halSpiWriteReg(CCxxx0_DEVIATN,0x15);
halSpiWriteReg(CCxxx0_MCSM2,0x07);
halSpiWriteReg(CCxxx0_MCSM1,0x30);
halSpiWriteReg(CCxxx0_MCSM0,0x18);
halSpiWriteReg(CCxxx0_FOCCFG,0x14);
halSpiWriteReg(CCxxx0_BSCFG,0x6C);
halSpiWriteReg(CCxxx0_AGCCTRL2, 0xff);
halSpiWriteReg(CCxxx0_AGCCTRL1, 0x00); //add mike
halSpiWriteReg(CCxxx0_AGCCTRL0, 0x91);
halSpiWriteReg(CCxxx0_WOREVT1, 0x43);
halSpiWriteReg(CCxxx0_WOREVT0, 0xB5); //add mike
halSpiWriteReg(CCxxx0_WORCTRL,0x68);
// halSpiWriteReg(CCxxx0_FREND1,0x56);
halSpiWriteReg(CCxxx0_FREND1,0xB6); //DN022 RX filter bandwidth > 101 kHz
// halSpiWriteReg(CCxxx0_FREND1,0x56); //DN022 RX filter bandwidth ≤ 101 kHz
halSpiWriteReg(CCxxx0_FREND0,0x11);
halSpiWriteReg(CCxxx0_FSCAL3,0xE9);
halSpiWriteReg(CCxxx0_FSCAL2,0x2A);
halSpiWriteReg(CCxxx0_FSCAL1,0x00);
halSpiWriteReg(CCxxx0_FSCAL0,0x1F);
// halSpiWriteReg(CCxxx0_TEST2,0x81);
// halSpiWriteReg(CCxxx0_TEST2,0x88); //DN022 RX filter bandwidth > 325 kHz
halSpiWriteReg(CCxxx0_TEST2,0x81); //DN022 RX filter bandwidth ≤ 325 kHz
// halSpiWriteReg(CCxxx0_TEST1,0x35);
// halSpiWriteReg(CCxxx0_TEST1,0x31); //DN022 RX filter bandwidth > 325 kHz
halSpiWriteReg(CCxxx0_TEST1,0x35); //DN022 RX filter bandwidth ≤ 325 kHz
halSpiWriteReg(CCxxx0_TEST0,0x09);
halSpiWriteReg(CCxxx0_RCCTRL1,0x41);
halSpiWriteReg(CCxxx0_RCCTRL0,0x00);
halSpiWriteReg(CCxxx0_FSTEST,0x59);
halSpiWriteReg(CCxxx0_PTEST,0x7F);
同求此答案,我是用来接收遥控器,频率 433M ,编码为 百万组 EV1527 的 OOK 编码,不知道 CC1101 能否进行解码? 以前的方案是通过接收板+MCU进行软件解码的
以下是一个成功的ASK Modulation Mode通讯的寄存器配置供参考。
# Sync word qualifier mode = 30/32 sync word bits detected
# CRC autoflush = false
# Channel spacing = 199.951172
# Data format = Normal mode
# Data rate = 249.939
# RX filter BW = 541.666667
# PA ramping = false
# Preamble count = 4
# Whitening = false
# Address config = No address check
# Carrier frequency = 433.919830
# Device address = 0
# TX power = -15
# Manchester enable = true
# CRC enable = true
# Deviation = 126.953125
# Packet length mode = Variable packet length mode. Packet length configured by the first byte after sync word
# Packet length = 255
# Modulation format = ASK/OOK
# Base frequency = 433.919830
# Channel number = 0
# PA table
#define PA_TABLE {0x00,0x1d,0x00,0x00,0x00,0x00,0x00,0x00,}
void config2()
{
cc1101.writeReg(CC1101_IOCFG0,0x06);
cc1101.writeReg(CC1101_PKTCTRL0,0x05);
cc1101.writeReg(CC1101_FSCTRL1,0x0C);
cc1101.writeReg(CC1101_FREQ2,0x10);
cc1101.writeReg(CC1101_FREQ1,0xB0);
cc1101.writeReg(CC1101_FREQ0,0x71);
cc1101.writeReg(CC1101_MDMCFG4,0x2D);
cc1101.writeReg(CC1101_MDMCFG3,0x3B);
cc1101.writeReg(CC1101_MDMCFG2,0x3B);
cc1101.writeReg(CC1101_DEVIATN,0x62);
cc1101.writeReg(CC1101_MCSM0,0x18);
cc1101.writeReg(CC1101_FOCCFG,0x1D);
cc1101.writeReg(CC1101_BSCFG,0x1C);
cc1101.writeReg(CC1101_AGCCTRL2,0x04);
cc1101.writeReg(CC1101_AGCCTRL1,0x00);
cc1101.writeReg(CC1101_AGCCTRL0,0x92);
cc1101.writeReg(CC1101_WORCTRL,0xFB);
cc1101.writeReg(CC1101_FREND1,0xB6);
cc1101.writeReg(CC1101_FREND0,0x11);
cc1101.writeReg(CC1101_FSCAL3,0xEA);
cc1101.writeReg(CC1101_FSCAL2,0x2A);
cc1101.writeReg(CC1101_FSCAL1,0x00);
cc1101.writeReg(CC1101_FSCAL0,0x1F);
cc1101.writeReg(CC1101_TEST0,0x09);
}
CC1101 不具有解码功能,需要MCU。
感谢回复。
我知道CC1101不具备MCU功能,但是我的方案中,是使用 CC430F6137 ,因此无需要加MCU的。
我的应用中,代码格式如下
A: 为448uS
BIT H: 3A (高) + 1A (低) BIT L: 1A (高) + 3A (低)
同步头 + 地址 高字节 + 地址低字节 + 数据字节
同步头 : 1A 高 + 31A 低
因此,要解码必须检测脉冲的宽度,也就是使用软件解码
由此可见: 若CC1101 能够有直接模式,而与数据格式等等无关,简单来说,空间有相同频率的射频信号,则输出1,无,则输出0,并且通过1个引脚输出给MCU解码,就有可能实现此功能。
格式 EV1527 和 SC2262 SC2240 等格式,在安防系统中经常使用,希望 TI 工程师可以考虑,
期盼答复,有问题可以 E-MAIL 给我,论坛能发布的东西有限
请老大解答,谢谢支持,对此,我很关心
试了可以用,但是通信距离很短,我用软件配置使用的是INT8U PaTabel[8] = {0xC0 ,0xC0 ,0xC0 ,0xC0 ,0xC0 ,0xC0 ,0xC0 ,0xC0}; 但是发不出去。你推荐的这个我在软件推荐配置里也没有看到,请教一下怎么配置10dbm的参数
你好!我碰到了和你一模一样的问题,请问你解决了吗?非常感谢啊
海尔集成半导体推出了个芯片型号HW3000,用量巨大,距离有2.5公里双向,与si4463差不多,比si4432 si4438远,比A7108 和A7139好很多,如果是10kpbs,比sx1278 远。LoRa没办法快速率,可了解,推荐!HW3000超低双向无线fsk模块完美替代CC1101、CC1120、A7139、A7108、si4432、si4438、si4463