Hi all,
I have two set of CC1101s.
i try to test the distance compare with the datarate.
i set the power to 0xC0(10db), frequence 866M
with datarate below 38.4kbps, it can works well with >200m.
However, once i increase the datarate to
76.8kbps // 60m line of sight
150kbps // 10m line of sight
can anyone spot out my error or problem, many thanks
Below is the basic setting of the register:
RF_SETTINGS rfSettings = { 0x06, // FSCTRL1 Frequency synthesizer control. 0x00, // FSCTRL0 Frequency synthesizer control. // 0x21, // FREQ2 Frequency control word, high byte. // 0x65, // FREQ1 Frequency control word, middle byte. // 0x6A, // FREQ0 Frequency control word, low byte. 0x21, // FREQ2 Frequency control word, high byte. 0x4A, // FREQ1 Frequency control word, middle byte. 0xD4, // FREQ0 Frequency control word, low byte. 0xF5, // MDMCFG4 Modem configuration. 0x83, // MDMCFG3 Modem configuration. 0x13, // MDMCFG2 Modem configuration. //ook // 0x72, // MDMCFG1 Modem configuration. **** 7 = 24preamble byte 0x22, // MDMCFG1 Modem configuration. **** 7 = 24preamble byte 0xF8, // MDMCFG0 Modem configuration. 0x00, // CHANNR Channel number. // 0x9F //default 0x35, // DEVIATN Modem deviation setting (when FSK modulation is enabled). 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. 0x6C, // BSCFG Bit synchronization Configuration. 0x03, // AGCCTRL2 AGC control. 0x40, // AGCCTRL1 AGC control. 0x91, // AGCCTRL0 AGC control. 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. 0x29, // IOCFG2 GDO2 output pin configuration. 0x06, // IOCFG0 GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed pseudo register explanation. 0x05, // PKTCTRL1 Packet automation control. 0x04, // PKTCTRL0 Packet automation control. 77, // ADDR Device address. 'M' 0x02 // PKTLEN Packet length. };
//========
datarate change setting:
if(datarate>7)
{
datarate = 0;
}
ccxxx0_Write(CCxxx0_MDMCFG4,0xF5+datarate); //F5 = 12 F6 = 24 F7 =48 F8 = 96 F9 = 192
//======================================================
For RX side:
RF_SETTINGS rfSettings = { 0x06, // FSCTRL1 Frequency synthesizer control. 0x00, // FSCTRL0 Frequency synthesizer control. 0x21, // FREQ2 Frequency control word, high byte. 0x4A, // FREQ1 Frequency control word, middle byte. 0xD4, // FREQ0 Frequency control word, low byte. // 0xF5, // MDMCFG4 Modem configuration. //58 // 0xA5, // MDMCFG4 Modem configuration. //for crystal ppm 58 to 135 Channel filter BW 09020214 // 0xA5, // MDMCFG4 Modem configuration. //for crystal ppm 58 to 135 Channel filter BW 09020214 0xA5, // MDMCFG4 Modem configuration. //for crystal ppm 58 to 135 Channel filter BW 09020214 0x83, // MDMCFG3 Modem configuration. 0x13, // MDMCFG2 Modem configuration. 0x22, // MDMCFG1 Modem configuration. 0xF8, // MDMCFG0 Modem configuration. 0x00, // CHANNR Channel number. 0x35, // DEVIATN Modem deviation setting (when FSK modulation is enabled). // 0x35 20K 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. 0x6C, // BSCFG Bit synchronization Configuration. 0x03, // AGCCTRL2 AGC control. 0x40, // AGCCTRL1 AGC control. 0x91, // AGCCTRL0 AGC control. 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. 0x29, // IOCFG2 GDO2 output pin configuration. 0x06, // IOCFG0 GDO0 output pin configuration. Refer to SmartRF?Studio User Manual for detailed pseudo register explanation. 0x05, // PKTCTRL1 Packet automation control. // 0x04, 0x04, // PKTCTRL0 Packet automation control. 77, // ADDR Device address. 'M' 0x02 // PKTLEN Packet length. };
//=================================
datarate++;
if(datarate>7)
{
datarate = 0; //1.2k
comb = 0xA5;
}
if(datarate == 1)
{
comb = 0xA6; //2.4k
}
if(datarate == 2)
{
comb = 0xA7; //4.8k
}
if(datarate == 3)
{
comb = 0xA8; //9.6k
}
if(datarate == 4)
{
comb = 0xA9; //19.2k
}
if(datarate == 5)
{
comb = 0xAA; //38.4k
}
if(datarate == 6)
{
comb = 0xAB; //76.8k //270 bad //203 bad
}
if(datarate == 7)
{
comb = 0x8C; //152.4k 9 nook 8bad 7 bad
}
ccxxx0_Write(CCxxx0_MDMCFG4,comb); //F5 = 12 F6 = 24 F7 =48 F8 = 96 F9 = 192