其他配置不变,如果CRC_AUTOFLUSH不打开的话,接收是没有问题的,一打开就收不到数据。我用的板子就是淘宝上的那个“飞拓4000“的板子,可能各位大侠知道。
摸索中,我发现对于定长包和不定长包,用户能自主定义的数据是不同的,比如不定长下:第一个数据是包长,第二个是地址;而定长下,第一个是地址,第二个是包长。但是一旦涉及了CRC以及STATUS APPEND,我就又搞不清楚了,尤其是TX和RX处是不是一样的。
0x08, // FSCTRL1 Frequency synthesizer control.
0x00, // FSCTRL0 Frequency synthesizer control.
0x0f, // FREQ2 Frequency control word, high byte.
0xc4, // FREQ1 Frequency control word, middle byte.
0xec, // FREQ0 Frequency control word, low byte.
0x2d, // MDMCFG4 Modem configuration.
0x3b, // MDMCFG3 Modem configuration.
0x73, // MDMCFG2 Modem configuration.
0xa2, // MDMCFG1 Modem configuration.
0xF8, // MDMCFG0 Modem configuration.
0x61, // CHANNR Channel number.
0x00, // DEVIATN Modem deviation setting (when FSK modulation is enabled).
0xB6, // FREND1 Front end RX configuration.
0x10, // FREND0 Front end RX configuration.
0x18, // MCSM0 Main Radio Control State Machine configuration.
0x1D, // FOCCFG Frequency Offset Compensation Configuration.
0x1C, // BSCFG Bit synchronization Configuration.
0xC7, // AGCCTRL2 AGC control.
0x00, // AGCCTRL1 AGC control.
0xB2, // AGCCTRL0 AGC control.
0xEA, // 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, // IOCFG0D GDO0 output pin configuration.
0x0e, // PKTCTRL1 Packet automation control. 这里的0x0e打开了crc_autoflush,如果不打开的话,改为0x06,接收就正常了。
0x44, // PKTCTRL0 Packet automation control.
0xcc, // ADDR Device address.
0x21 // PKTLEN Packet length.