本帖最后由 MaxYin 于 2015-8-7 09:07 编辑
大家好,我第一次用CC1101,工作在433Mhz频率下,我用SmartRf Studio 7产生的参数设置 250K波特率 发送接收正常,同样用SmartRf Studio 7 产生2.4K波特率发送不正常,发送数据的时候GDO0引脚没有变化,以下分别是2.4K和250K的波特率参数设置程序,请高手们帮我看看是哪里出了问题?谢谢!
:)
// Smart studio 7 生成的2.4K 波特率参数设置,发送数据的时候GDO0引脚没有变化。
halSpiWriteReg(CCxxx0_IOCFG0, 0x06); // GDO0 output pin config. halSpiWriteReg(CCxxx0_FIFOTHR, 0x47);
halSpiWriteReg(CCxxx0_PKTCTRL0, 0x05);
halSpiWriteReg(CCxxx0_FSCTRL1, 0x06); // Freq synthesizer control. 0X0B
halSpiWriteReg(CCxxx0_FREQ2, 0x10); // Freq control word, high byte 0X10
halSpiWriteReg(CCxxx0_FREQ1, 0xB1); // Freq control word, mid byte. 0XA7
halSpiWriteReg(CCxxx0_FREQ0, 0x3B); // Freq control word, low byte. 0X62
halSpiWriteReg(CCxxx0_MDMCFG4, 0xF6); // Modem configuration. 0X2D
halSpiWriteReg(CCxxx0_MDMCFG3, 0x83); // Modem configuration. 0X3B
halSpiWriteReg(CCxxx0_MDMCFG2, 0x13); // Modem configuration. 0X73
halSpiWriteReg(CCxxx0_DEVIATN, 0x15); // Modem dev (when FSK mod en)0X00 ???
halSpiWriteReg(CCxxx0_MCSM0 , 0x18); //MainRadio Cntrl State Machine 0X18 ??? ʵ¼ÊÅäÖÃ0x18
halSpiWriteReg(CCxxx0_FOCCFG, 0x16); // Freq Offset Compens. Config 0X1D
halSpiWriteReg(CCxxx0_WORCTRL, 0XFB);
halSpiWriteReg(CCxxx0_FSCAL3, 0xE9); // Frequency synthesizer cal. 0XEA
halSpiWriteReg(CCxxx0_FSCAL2, 0x2A); // Frequency synthesizer cal. 0X0A
halSpiWriteReg(CCxxx0_FSCAL1, 0x00); // Frequency synthesizer cal. 0X00
halSpiWriteReg(CCxxx0_FSCAL0, 0x1F); // Frequency synthesizer cal. 0X11
halSpiWriteReg(CCxxx0_TEST2, 0x81); // Various test settings. 0X88
halSpiWriteReg(CCxxx0_TEST1, 0x35); // Various test settings. 0X31
halSpiWriteReg(CCxxx0_TEST0, 0x09); // Various test settings. 0X0B
// Smart studio 7 250k GFSK 参数设置收发数据正常
halSpiWriteReg(CCxxx0_IOCFG2, 0x0B); // GDO2 output pin config.
halSpiWriteReg(CCxxx0_IOCFG0, 0x06); // GDO0 output pin config.
halSpiWriteReg(CCxxx0_PKTLEN, 0xFF); // Packet length.
halSpiWriteReg(CCxxx0_PKTCTRL1, 0x04); // Packet automation control.
halSpiWriteReg(CCxxx0_PKTCTRL0, 0x05); // Packet automation control.
halSpiWriteReg(CCxxx0_ADDR, 0x01); // Device address.
halSpiWriteReg(CCxxx0_CHANNR, 0x00); // Channel number.
halSpiWriteReg(CCxxx0_FSCTRL1, 0x06); // Freq synthesizer control. 0X0B
halSpiWriteReg(CCxxx0_FSCTRL0, 0x00); // Freq synthesizer control. 0X00
halSpiWriteReg(CCxxx0_FREQ2, 0x10); // Freq control word, high byte 0X10
halSpiWriteReg(CCxxx0_FREQ1, 0xB1); // Freq control word, mid byte. 0XA7
halSpiWriteReg(CCxxx0_FREQ0, 0x3B); // Freq control word, low byte. 0X62
halSpiWriteReg(CCxxx0_MDMCFG4, 0x2D); // Modem configuration. 0X2D
halSpiWriteReg(CCxxx0_MDMCFG3, 0x3B); // Modem configuration. 0X3B
halSpiWriteReg(CCxxx0_MDMCFG2, 0x13); // Modem configuration. 0X73
halSpiWriteReg(CCxxx0_MDMCFG1, 0x22); // Modem configuration. 0X22
halSpiWriteReg(CCxxx0_MDMCFG0, 0xF8); // Modem configuration. 0XF8
halSpiWriteReg(CCxxx0_DEVIATN, 0x62); // Modem dev (when FSK mod en)0X00 ???
halSpiWriteReg(CCxxx0_MCSM1 , 0x3F); //MainRadio Cntrl State Machine 0X3F ??? 实际配置0x30
halSpiWriteReg(CCxxx0_MCSM0 , 0x18); //MainRadio Cntrl State Machine 0X18 ??? 实际配置0x18
halSpiWriteReg(CCxxx0_FOCCFG, 0x1D); // Freq Offset Compens. Config 0X1D
halSpiWriteReg(CCxxx0_BSCFG, 0x1C); // Bit synchronization config.0X1C
halSpiWriteReg(CCxxx0_AGCCTRL2, 0xC7); // AGC control. 0XC7
halSpiWriteReg(CCxxx0_AGCCTRL1, 0x00); // AGC control. 0X00
halSpiWriteReg(CCxxx0_AGCCTRL0, 0xB0); // AGC control. 0XB2
halSpiWriteReg(CCxxx0_FREND1, 0xB6); // Front end RX configuration. 0XB6
halSpiWriteReg(CCxxx0_FREND0, 0x10); // Front end RX configuration. 0X10
halSpiWriteReg(CCxxx0_FSCAL3, 0xEA); // Frequency synthesizer cal. 0XEA
halSpiWriteReg(CCxxx0_FSCAL2, 0x2A); // Frequency synthesizer cal. 0X0A
halSpiWriteReg(CCxxx0_FSCAL1, 0x00); // Frequency synthesizer cal. 0X00
halSpiWriteReg(CCxxx0_FSCAL0, 0x1F); // Frequency synthesizer cal. 0X11
halSpiWriteReg(CCxxx0_FSTEST, 0x59); // Frequency synthesizer cal. 0X59
halSpiWriteReg(CCxxx0_TEST2, 0x88); // Various test settings. 0X88
halSpiWriteReg(CCxxx0_TEST1, 0x31); // Various test settings. 0X31
halSpiWriteReg(CCxxx0_TEST0, 0x09); // Various test settings. 0X0B
*/
|