Other Parts Discussed in Thread: CC1101,
So first YES this is to match an existing product:
Currently I am attempting to match the following configuration for the CC1101:
/* CRC autoflush = false */ /* Whitening = false */ /* Data rate = 249.939 */ /* Device address = 0 */ /* Carrier frequency = 904.149841 */ /* Deviation = 126.953125 */ /* Channel spacing = 231.689453 */ /* Preamble count = 4 */ /* RX filter BW = 541.666667 */ /* Modulated = true */ /* PA ramping = false */ /* Packet length mode = Variable packet length mode. Packet length configured by the first byte after sync word */ /* Sync word qualifier mode = 30/32 sync word bits detected */ /* Packet length = 255 */ /* TX power = 0 */ /* Address config = No address check */ /* CRC enable = true */ /* Data format = Normal mode */ /* Channel number = 0 */ /* Manchester enable = false */ /* Modulation format = GFSK */ /* Base frequency = 904.149841 */ /*************************************************************** * SmartRF Studio(tm) Export * * Radio register settings specified with C-code * compatible #define statements. * * RF device: CC1101 * ***************************************************************/ #ifndef SMARTRF_CC1101_H #define SMARTRF_CC1101_H #define SMARTRF_RADIO_CC1101 #define SMARTRF_SETTING_IOCFG2 0x29 #define SMARTRF_SETTING_IOCFG0 0x06 #define SMARTRF_SETTING_FIFOTHR 0x07 #define SMARTRF_SETTING_PKTLEN 0xFF #define SMARTRF_SETTING_PKTCTRL1 0x04 #define SMARTRF_SETTING_PKTCTRL0 0x05 #define SMARTRF_SETTING_ADDR 0x00 #define SMARTRF_SETTING_CHANNR 0x00 #define SMARTRF_SETTING_FSCTRL1 0x12 #define SMARTRF_SETTING_FSCTRL0 0x00 #define SMARTRF_SETTING_FREQ2 0x22 #define SMARTRF_SETTING_FREQ1 0xC6 #define SMARTRF_SETTING_FREQ0 0x66 #define SMARTRF_SETTING_MDMCFG4 0x2D #define SMARTRF_SETTING_MDMCFG3 0x3B #define SMARTRF_SETTING_MDMCFG2 0x93 #define SMARTRF_SETTING_MDMCFG1 0x23 #define SMARTRF_SETTING_MDMCFG0 0x24 #define SMARTRF_SETTING_DEVIATN 0x62 #define SMARTRF_SETTING_MCSM0 0x18 #define SMARTRF_SETTING_FOCCFG 0x1D #define SMARTRF_SETTING_BSCFG 0x1C #define SMARTRF_SETTING_AGCCTRL2 0xC7 #define SMARTRF_SETTING_AGCCTRL1 0x00 #define SMARTRF_SETTING_AGCCTRL0 0xB0 //#define SMARTRF_SETTING_WORCTRL 0xFB #define SMARTRF_SETTING_FREND1 0xB6 #define SMARTRF_SETTING_FREND0 0x10 #define SMARTRF_SETTING_FSCAL3 0xEA #define SMARTRF_SETTING_FSCAL2 0x2A #define SMARTRF_SETTING_FSCAL1 0x00 #define SMARTRF_SETTING_FSCAL0 0x1F #define SMARTRF_SETTING_TEST2 0x88 #define SMARTRF_SETTING_TEST1 0x31 #define SMARTRF_SETTING_TEST0 0x09 #define SMARTRF_SETTING_FSTEST 0x59 #endif //SMARTRF_CC1101_H
And here is what I have (that currently doesn't work of course):
// CMD_PROP_RADIO_DIV_SETUP
// Proprietary Mode Radio Setup Command for All Frequency Bands
rfc_CMD_PROP_RADIO_DIV_SETUP_t RF_cmdPropRadioDivSetup =
{
.commandNo = 0x3807,
.status = 0x0000,
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.modulation.modType = 0x1,
.modulation.deviation = 0x1FC,
.symbolRate.preScale = 0x5,
.symbolRate.rateWord = 0xD555,
.rxBw = 0x2C,
.preamConf.nPreamBytes = 0x4,
.preamConf.preamMode = 0x1,
.formatConf.nSwBits = 0x20,
.formatConf.bBitReversal = 0x0,
.formatConf.bMsbFirst = 0x1,
.formatConf.fecMode = 0x0,
.formatConf.whitenMode = 0x1,
.config.frontEndMode = 0x0,
.config.biasMode = 0x1,
.config.analogCfgMode = 0x0,
.config.bNoFsPowerUp = 0x0,
.txPower = 0x0041,
.pRegOverride = pOverrides,
.centerFreq = 0x0388,
.intFreq = 0x8000,
.loDivider = 0x05,
};
// CMD_FS
// Frequency Synthesizer Programming Command
rfc_CMD_FS_t RF_cmdFs =
{
.commandNo = 0x0803,
.status = 0x0000,
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.frequency = 0x0388,
.fractFreq = 0x2667,
.synthConf.bTxMode = 0x0,
.synthConf.refFreq = 0x0,
.__dummy0 = 0x00,
.__dummy1 = 0x00,
.__dummy2 = 0x00,
.__dummy3 = 0x0000,
};
// CMD_PROP_TX
// Proprietary Mode Transmit Command
rfc_CMD_PROP_TX_t RF_cmdPropTx =
{
.commandNo = 0x3801,
.status = 0x0000,
.pNextOp = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
.startTime = 0x00000000,
.startTrigger.triggerType = 0x0,
.startTrigger.bEnaCmd = 0x0,
.startTrigger.triggerNo = 0x0,
.startTrigger.pastTrig = 0x0,
.condition.rule = 0x1,
.condition.nSkip = 0x0,
.pktConf.bFsOff = 0x0,
.pktConf.bUseCrc = 0x1,
.pktConf.bVarLen = 0x1,
.pktLen = 0x1C,
.syncWord = 0xD391D391,
.pPkt = 0, // INSERT APPLICABLE POINTER: (uint8_t*)&xxx
};
Using the rfPacketTx_CC1310_LAUNCHXL_tirtos_ccs from LaunchPad TI Drivers (seemed good to match what I am doing).
I am using the packet sniffers configured to receive the smartrf configuration from the CC1101 packet source to verify communication.
The result is kind of mangled I can see the following data:
packet len: 238 packet data: 000|EB1EE265 124FD803 4445F23B 7178E9A7 010|8A82D227 92AB3DB8 002B4190 84612D1E 020|4821CF0E 302632A4 2CA492DA FE19D810 030|8504DA49 4546DB19 0C0A6140 8C3E1241 040|6500DB61 4CF4A407 6CA15A94 0026C074 050|609027A4 27CA4C0A 1F97CD8D 0F0603E3 060|1C790982 7221B834 8E4AF900 96D7A028 070|BCE00216 D0598603 6B375941 80C55A51 080|422DA780 4DBC8D80 6C422B40 85401C44 090|5C3C3003 68BDF62E 0C149CBF 37E64158 0A0|FA3039B8 0E821965 2437C71A 7FF0028F 0B0|9C737645 9516F2E4 12A6C028 9024D49A 0C0|90817084 FE81D555 555569C8 E9C8F58F 0D0|71328927 EC01A222 F91D38BC 74D3C541 0E0|6913C925 955C2001 07903EC4 4231
Which is not exactly what I was sending (really):
here is what I was sending (almost this is from a CC1101 device sending the same data with different TID):
packet len: 23 packet data: 000|14FFFFFF FFCAEB27 AE3F20AF 01EFBEAD 010|DEFFFFFF FF39B1
I thought I had messed up the sync or preamble but what I have appears correct.
Any thoughts would be appreciated.