This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC1101 not sending a packet ?

Other Parts Discussed in Thread: CC1101

Hey All,

I can receive a packet sent by SmartRF, but not by my firmware.  I'm really confused on why.  I use an Atmel Xmega for the main processor.

Here are some code snippits:

// Initial settings on CC1101 Init:

CC1101_RF_SETTINGS.IOCFG0 = 0x06;
CC1101_RF_SETTINGS.PKTCTRL0 = 0x05;
CC1101_RF_SETTINGS.FSCTRL1 = 0x06;
CC1101_RF_SETTINGS.FREQ2 = 0x21;
CC1101_RF_SETTINGS.FREQ1 = 0x62;
CC1101_RF_SETTINGS.FREQ0 = 0x76;
CC1101_RF_SETTINGS.MDMCFG4 = 0xF5;
CC1101_RF_SETTINGS.MDMCFG3 = 0x83;
CC1101_RF_SETTINGS.MDMCFG2 = 0x13;
CC1101_RF_SETTINGS.DEVIATN = 0x15;
CC1101_RF_SETTINGS.MCSM0 = 0x18;
CC1101_RF_SETTINGS.FOCCFG = 0x16;
CC1101_RF_SETTINGS.WORCTRL = 0xFB;
CC1101_RF_SETTINGS.FSCAL3 = 0xE9;
CC1101_RF_SETTINGS.FSCAL2 = 0x2A;
CC1101_RF_SETTINGS.FSCAL1 = 0x00;
CC1101_RF_SETTINGS.FSCAL0 = 0x1F;
CC1101_RF_SETTINGS.TEST2 = 0x81;
CC1101_RF_SETTINGS.TEST1 = 0x35;
CC1101_RF_SETTINGS.TEST0 = 0x09;
CC1101_RF_SETTINGS.LQI = 0x80;
CC1101_RF_SETTINGS.RSSI = 0x80;

// Place CC1101 in TX mode.

void ccxxx0_TxMode(void)
{
char regStatus =0;
ccxxx0_Strobe(CCxxx0_SIDLE);
while (regStatus != 0)
{
regStatus = ccxxx0_ReadStatus(CCxxx0_MARCSTATE);
}
ccxxx0_Strobe(CCxxx0_SFTX); // flush Tx buff

}
void send_RF_msg(char message_type, char *msg, char length_lessThan59, char destination)
{
unsigned char tx_msg[64];
unsigned char msg_len;
 unsigned char source =1;
char index;

  

if (length_lessThan59 > MAX_MSG_LENGTH) {
length_lessThan59 = MAX_MSG_LENGTH;
}

msg_len=1;
tx_msg[msg_len++]= destination;
tx_msg[msg_len++]= source;
tx_msg[msg_len++]= message_type;
tx_msg[msg_len++]= length_lessThan59;
for (index=0; index<length_lessThan59; index++) {
tx_msg[msg_len++] = msg[index];
}

tx_msg[0]=msg_len;
 ccxxx0_TxMode();
ccxxx0_WriteBurst(CCxxx0_TXFIFO, tx_msg, msg_len); // addr= 1 byte, payload= bytes, PKTLEN= addr + payload
ccxxx0_Strobe(CCxxx0_STX); // activate Tx!
 while (gpio_pin_is_high(CC1101_GDO0)); // wait for GDO0 to be cleared -> end of packet.

I can see the CC1101 draw the power and it seems like it's transmitting something, but the SmartRF and my Receiver is not picking it up.

Any ideas what might be wrong?
 
  • I'm checking my states right after I send the STX 

    and see the following on MarcState:

    0x0f

    0x2f ........many times, then last one 

    0xdc

    When i try to send data via Burst Write

    I get :

    0x0f

    0x0f

    0x7f ... Many times

    Then last one

    0x27

    Most of these don't seem to match the table located in http://www.ti.com/lit/ds/symlink/cc1101.pdf page 93, unless I am reading it wrong...??

    Any help I can get would be great.

    My register settings are now:

    RF_SETTINGS rfSettings = {
    0x0B, // IOCFG2 GDO2 Output Pin Configuration
    0x06, // IOCFG0 GDO0 Output Pin Configuration
    0x47, // FIFOTHR RX FIFO and TX FIFO Thresholds
    0x05, // PKTCTRL0 Packet Automation Control
    0x06, // FSCTRL1 Frequency Synthesizer Control
    0x23, // FREQ2 Frequency Control Word, High Byte
    0x31, // FREQ1 Frequency Control Word, Middle Byte
    0x3B, // FREQ0 Frequency Control Word, Low Byte
    0xF8, // MDMCFG4 Modem Configuration
    0x83, // MDMCFG3 Modem Configuration
    0x13, // MDMCFG2 Modem Configuration
    0x14, // DEVIATN Modem Deviation Setting
    0x18, // MCSM0 Main Radio Control State Machine Configuration
    0x16, // FOCCFG Frequency Offset Compensation Configuration
    0x43, // AGCCTRL2 AGC Control
    0xFB, // WORCTRL Wake On Radio Control
    0x17, // FREND0 Front End TX Configuration
    0xE9, // FSCAL3 Frequency Synthesizer Calibration
    0x2A, // FSCAL2 Frequency Synthesizer Calibration
    0x00, // FSCAL1 Frequency Synthesizer Calibration
    0x1F, // FSCAL0 Frequency Synthesizer Calibration
    0x81, // TEST2 Various Test Settings
    0x35, // TEST1 Various Test Settings
    0x09, // TEST0 Various Test Settings
    0x80, // RSSI Received Signal Strength Indication
    0x01, // MARCSTATE Main Radio Control State Machine State
    0x94, // VCO_VC_DAC Current Setting from PLL Calibration Module
    };
    
    
    My debug program is 
    void debug_cc_state(void){
    unsigned char marcstate_table[1024];
    unsigned int ii;

    for(ii=0;ii<1023;ii++) {
    CC1101_ReadRegister(CC1101_MARCSTATE, &marcstate_table[ii]);
    for (int i=0; i<1000; i++); // delay cycles
    }
    // implment an arbitrary manipulation of "marcstate_table" so the compiler
    // does not remove all the results during optimization.
    marcstate_table[0] = marcstate_table[1023]+1;
    }
    
    
    I rewrote some code as well.
    
    
    Any ideas what could be the problem, or why my MARCSTATE values are not as I am expecting?
    
    
    Best Regards,
    
    
    Mike
    
    

  • I'm still trying to debug this problem.

    It seems like (to me and I'm not an expert) that the CC1101 is Transmitting, maybe, at very low power?

    Here is the chart from the Spectrum Analyizer.

    Any feedback would be great, I really need help!

    Also attached is my SmartRF config.  

    1884.cc1101_432012.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE configuration SYSTEM "C:/Program Files (x86)/Texas Instruments/SmartRF Tools/SmartRF Studio 7/config/xml/configdata.dtd"[]>
    <dcpanelconfiguration>
        <Devicename>CC1101</Devicename>
        <Description>Saved configuration data</Description>
        <registersettings>
            <Register>
                <Name>ADDR</Name>
                <Value>0x01</Value>
            </Register>
            <Register>
                <Name>AGCCTRL2</Name>
                <Value>0x43</Value>
            </Register>
            <Register>
                <Name>CHANNR</Name>
                <Value>0x01</Value>
            </Register>
            <Register>
                <Name>DEVIATN</Name>
                <Value>0x14</Value>
            </Register>
            <Register>
                <Name>FIFOTHR</Name>
                <Value>0x66f2</Value>
            </Register>
            <Register>
                <Name>FOCCFG</Name>
                <Value>0x16</Value>
            </Register>
            <Register>
                <Name>FREQ0</Name>
                <Value>0x3b</Value>
            </Register>
            <Register>
                <Name>FREQ1</Name>
                <Value>0x31</Value>
            </Register>
            <Register>
                <Name>FREQ2</Name>
                <Value>0x23</Value>
            </Register>
            <Register>
                <Name>FSCAL0</Name>
                <Value>0x1f</Value>
            </Register>
            <Register>
                <Name>FSCAL1</Name>
                <Value>0x00</Value>
            </Register>
            <Register>
                <Name>FSCAL2</Name>
                <Value>0x2a</Value>
            </Register>
            <Register>
                <Name>FSCAL3</Name>
                <Value>0xe9</Value>
            </Register>
            <Register>
                <Name>FSCTRL1</Name>
                <Value>0x06</Value>
            </Register>
            <Register>
                <Name>IOCFG0</Name>
                <Value>0x06</Value>
            </Register>
            <Register>
                <Name>MARCSTATE</Name>
                <Value>0x01</Value>
            </Register>
            <Register>
                <Name>MCSM0</Name>
                <Value>0x18</Value>
            </Register>
            <Register>
                <Name>MDMCFG2</Name>
                <Value>0x13</Value>
            </Register>
            <Register>
                <Name>MDMCFG3</Name>
                <Value>0x83</Value>
            </Register>
            <Register>
                <Name>MDMCFG4</Name>
                <Value>0xf8</Value>
            </Register>
            <Register>
                <Name>PA_TABLE0</Name>
                <Value>0x8e</Value>
            </Register>
            <Register>
                <Name>PKTCTRL0</Name>
                <Value>0x05</Value>
            </Register>
            <Register>
                <Name>PKTCTRL1</Name>
                <Value>0x06</Value>
            </Register>
            <Register>
                <Name>RSSI</Name>
                <Value>0x80</Value>
            </Register>
            <Register>
                <Name>TEST0</Name>
                <Value>0x09</Value>
            </Register>
            <Register>
                <Name>TEST1</Name>
                <Value>0x35</Value>
            </Register>
            <Register>
                <Name>TEST2</Name>
                <Value>0x81</Value>
            </Register>
            <Register>
                <Name>VCO_VC_DAC</Name>
                <Value>0x94</Value>
            </Register>
            <Register>
                <Name>WORCTRL</Name>
                <Value>0xfb</Value>
            </Register>
        </registersettings>
        <dcpanel>
            <Property role="44" name="m_chkRegView">2</Property>
            <Property role="44" name="m_chkRfParameters">2</Property>
            <Property role="37" name="m_tabUserMode">1</Property>
            <Property role="33" name="m_easyModeSettings">-1</Property>
            <Property role="33" name="m_typicalSettings">-1</Property>
            <Property role="37" name="m_testFuncPanel">3</Property>
        </dcpanel>
        <rfparameters>
            <Property role="46" name="m_cmbFrontends">0</Property>
            <Property role="44" name="m_chkHGM">2</Property>
            <Property role="46" name="m_cmbEmRevs">-1</Property>
            <Property role="46" name="m_cmbAntList">-1</Property>
            <Property role="46" name="Xtal frequency">26.000000</Property>
        </rfparameters>
        <conttx>
            <Property role="45" name="m_rbtModulated">1</Property>
            <Property role="45" name="m_rbtUnmodulated">0</Property>
            <Property role="46" name="m_cmbDataFormat">-1</Property>
            <Property role="44" name="m_chkFreqSweep">0</Property>
            <Property role="44" name="m_chkChanSweep">0</Property>
        </conttx>
        <contrx>
            <Property role="46" name="m_cmbDataFormat">-1</Property>
            <Property role="44" name="m_chkAutoScroll">2</Property>
        </contrx>
        <packettx>
            <Property role="42" name="m_edtPayloadSize">30</Property>
            <Property role="42" name="m_edtPacketCount">100</Property>
            <Property role="42" name="m_edtPacketCountEsy">100</Property>
            <Property role="42" name="m_edtRandomPacketData">13 0d 89 0a 1c db ae 32 20 9a 50 ee 40 78 36 fd 12 49 32 f6 9e 7d 49 dc ad 4f 14 f2 </Property>
            <Property role="42" name="m_edtPacketData"></Property>
            <Property role="42" name="m_edtAccessAddress"></Property>
            <Property role="44" name="m_chkAddSeqNbr">2</Property>
            <Property role="44" name="m_chkInfinite">0</Property>
            <Property role="44" name="m_chkInfiniteEsy">0</Property>
            <Property role="45" name="m_rbtRandom">1</Property>
            <Property role="45" name="m_rbtText">0</Property>
            <Property role="45" name="m_rbtHex">0</Property>
            <Property role="44" name="m_chkAdvanced">2</Property>
            <Property role="46" name="m_cmbSyncWord">3</Property>
            <Property role="46" name="m_cmbPreambleCount">2</Property>
            <Property role="44" name="m_chkAddress">0</Property>
            <Property role="42" name="m_edtAddress"></Property>
            <Property role="46" name="m_cmbLengthConfig">-1</Property>
            <Property role="42" name="m_edtLengthConfig"></Property>
            <Property role="52" name="m_spnPktInterval">150</Property>
            <Property role="44" name="m_chkDefPktInterval">2</Property>
        </packettx>
        <packetrx>
            <Property role="42" name="m_edtPacketCount">100</Property>
            <Property role="42" name="m_edtPacketCountEsy">100</Property>
            <Property role="42" name="m_edtAccessAddress"></Property>
            <Property role="44" name="m_chkInfinite">0</Property>
            <Property role="44" name="m_chkInfiniteEsy">0</Property>
            <Property role="46" name="m_cmbViewFormat">0</Property>
            <Property role="44" name="m_chkSeqNbrIncluded">0</Property>
            <Property role="42" name="m_edtDumpFile"></Property>
            <Property role="44" name="m_chkAdvanced">2</Property>
            <Property role="46" name="m_cmbSyncWord">3</Property>
            <Property role="46" name="m_cmbAddressConfig">2</Property>
            <Property role="44" name="m_chkAddress">0</Property>
            <Property role="44" name="m_chkFifoAutoFlush">0</Property>
            <Property role="42" name="m_edtAddress">1</Property>
            <Property role="46" name="m_cmbLengthConfig">-1</Property>
            <Property role="42" name="m_edtLengthConfig"></Property>
        </packetrx>
        <commandpanel>
            <Property role="44" name="m_chkInsertLength">0</Property>
            <Property role="42" name="m_edtTxFifo"></Property>
            <Property role="42" name="m_edtRxFifo"></Property>
            <Property role="46" name="m_cmbInstrInput">-1</Property>
        </commandpanel>
    </dcpanelconfiguration>
    

  • After trying different configurations, this CC1101 is not transmitting. 

  • So, I used another function to read the MARCSTATE right after entering TX mode and I get:

    0x00.......for about 1016 array counts, then i get 

    0xc2  -- Unknown

    0x16 -- TXFIFO_Undeflow

    0x00 -  Sleep

    0x02 - XOFF

    0x30 - Unknown

    0x20 -  TX_END

    0xdd - Unknown.

    Perhaps, I need to write to TXFIFO before activating TX?

  • So I added an Extra STX after a Burst Write to TXFIFO.

    My MARCSTATE array points are now like this:

    before point 987; 0x00.

    from point 987;

    		[987]	0x06	unsigned char{data}@0x272b  ... -- VCOON
    [988] 0x54 unsigned char{data}@0x272c -- Unknown
    [989] 0x06 unsigned char{data}@0x272d
    [990] 0x54 unsigned char{data}@0x272e
    [991] 0x00 unsigned char{data}@0x272f
    [992] 0x06 unsigned char{data}@0x2730
    [993] 0x54 unsigned char{data}@0x2731
    [994] 0x06 unsigned char{data}@0x2732
    [995] 0x54 unsigned char{data}@0x2733
    [996] 0x06 unsigned char{data}@0x2734
    [997] 0x54 unsigned char{data}@0x2735
    [998] 0x00 unsigned char{data}@0x2736
    [999] 0x00 unsigned char{data}@0x2737 - Sleep
    [1000] 0x01 unsigned char{data}@0x2738 - IDLE
    [1001] 0x4d unsigned char{data}@0x2739 - unkown
    [1002] 0x00 unsigned char{data}@0x273a - Slee
    [1003] 0x00 unsigned char{data}@0x273b
    [1004] 0x01 unsigned char{data}@0x273c - idle
    [1005] 0x4d unsigned char{data}@0x273d -- unkown
    [1006] 0x00 unsigned char{data}@0x273e
    [1007] 0x00 unsigned char{data}@0x273f
    [1008] 0x00 unsigned char{data}@0x2740
    [1009] 0x00 unsigned char{data}@0x2741
    [1010] 0xc2 unsigned char{data}@0x2742
    [1011] 0x16 unsigned char{data}@0x2743
    [1012] 0x00 unsigned char{data}@0x2744 - sleep
    [1013] 0x02 unsigned char{data}@0x2745 - Xoff
    [1014] 0x30 unsigned char{data}@0x2746 - unknown
    [1015] 0x20 unsigned char{data}@0x2747 - unkown
    [1016] 0xdd unsigned char{data}@0x2748 - ??
    [1017] 0x52 unsigned char{data}@0x2749
    [1018] 0x27 unsigned char{data}@0x274a
    [1019] 0x00 unsigned char{data}@0x274b
    [1020] 0x00 unsigned char{data}@0x274c
    [1021] 0x00 unsigned char{data}@0x274d
    [1022] 0x00 unsigned char{data}@0x274e
    [1023] 0x00 unsigned char{data}@0x274f
    So .. nothing useful that I can find with a Burst Write.
  • After a single write of 16 bytes :

    		[992]	0x00	unsigned char{data}@0x272a
    [993] 0x06 unsigned char{data}@0x272b
    [994] 0x20 unsigned char{data}@0x272c
    [995] 0x06 unsigned char{data}@0x272d
    [996] 0x20 unsigned char{data}@0x272e
    [997] 0x00 unsigned char{data}@0x272f
    [998] 0x06 unsigned char{data}@0x2730
    [999] 0x20 unsigned char{data}@0x2731
    [1000] 0x06 unsigned char{data}@0x2732
    [1001] 0x20 unsigned char{data}@0x2733
    [1002] 0x00 unsigned char{data}@0x2734
    [1003] 0x00 unsigned char{data}@0x2735
    [1004] 0x01 unsigned char{data}@0x2736
    [1005] 0x4d unsigned char{data}@0x2737
    [1006] 0x00 unsigned char{data}@0x2738
    [1007] 0x00 unsigned char{data}@0x2739
    [1008] 0x01 unsigned char{data}@0x273a
    [1009] 0x4d unsigned char{data}@0x273b
    [1010] 0x00 unsigned char{data}@0x273c
    [1011] 0x00 unsigned char{data}@0x273d
    [1012] 0x00 unsigned char{data}@0x273e
    [1013] 0x1f unsigned char{data}@0x273f
    [1014] 0xe0 unsigned char{data}@0x2740
    [1015] 0x16 unsigned char{data}@0x2741
    [1016] 0x00 unsigned char{data}@0x2742
    [1017] 0x01 unsigned char{data}@0x2743
    [1018] 0xbe unsigned char{data}@0x2744
    [1019] 0x02 unsigned char{data}@0x2745
    [1020] 0x30 unsigned char{data}@0x2746
    [1021] 0x20 unsigned char{data}@0x2747
    [1022] 0xdd unsigned char{data}@0x2748
    [1023] 0x52 unsigned char{data}@0x2749