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 transmitting

Other Parts Discussed in Thread: CC1101

I wrote my own SPI interface to return the status byte with every read/write to the CC1101 registers.  I can write and verify the registers no problem.  I then used the fantastic SmartRF Studio to generate my register settings for operation at 433.92MHz and variable length packets.  Here is my init sequence:  

writeCC1101register(0x30, 0x00, &status);//reset STROBE (wait for SO to go low after CS low...)

writeCC1101register(0x02, 0x06, &status);//GDO0 output pin config
writeCC1101register(0x03, 0x47, &status);//RX/TX FIFO Thresholds
writeCC1101register(0x06, 0xFF, &status);//RX/TX FIFO Thresholds
writeCC1101register(0x08, 0x05, &status);//Packet Automation Control
writeCC1101register(0x0B, 0x06, &status);//Freq Synth Control
writeCC1101register(0x0D, 0x10, &status);//Freq Cont word, high byte
writeCC1101register(0x0E, 0xB0, &status);//Freq Cont word, mid byte
writeCC1101register(0x0F, 0x71, &status);//Freq Cont word, low byte
writeCC1101register(0x10, 0xF6, &status);//Modem config
writeCC1101register(0x11, 0x83, &status);//Modem config
writeCC1101register(0x12, 0x13, &status);//Modem config
writeCC1101register(0x13, 0x00, &status);//Modem config
writeCC1101register(0x15, 0x15, &status);//Modem Deviation Setting
writeCC1101register(0x18, 0x18, &status);//Main Radio Control State Machine Configuration
writeCC1101register(0x19, 0x16, &status);//Frequency Offset Compensation Configuration
writeCC1101register(0x20, 0xFB, &status);//Wake On Radio Control
writeCC1101register(0x22, 0x17, &status);// Front End TX Configuration
writeCC1101register(0x23, 0xE9, &status);//Frequency Synthesizer Calibration
writeCC1101register(0x24, 0x2A, &status);//Frequency Synthesizer Calibration
writeCC1101register(0x25, 0x00, &status);//Frequency Synthesizer Calibration
writeCC1101register(0x26, 0x1F, &status);//Frequency Synthesizer Calibration
writeCC1101register(0x2C, 0x81, &status);//Various Test Settings
writeCC1101register(0x2D, 0x35, &status);//Various Test Settings
writeCC1101register(0x2E, 0x09, &status);//Various Test Settings

I then load 5 bytes to the TX FIFO:

writeCC1101register(0x3F, 0x05, &status);//5 byte packet
writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO

Then request a synthesizer calibration which happens almost immediately instead of taking ~750uS:
writeCC1101register(0x31, 0x00, &status);//cal synth - does not take 750+uS!!

This I want to see something on my spectrum analyzer:

for(x=0; x<2500; x++)   //transmit many times so can see it on spectrum analyzer
  writeCC1101register(0x35, 0x00, &status);//does not transmit!!

It does not appear I'm transmitting at all.  Any ideas from the gurus?  

  • Sorry for the repeat post.  I forgot to select tags...

    I wrote my own SPI interface to return the status byte with every read/write to the CC1101 registers.  I can write and verify the registers no problem.  I then used the fantastic SmartRF Studio to generate my register settings for operation at 433.92MHz and variable length packets.  Here is my init sequence:  

    writeCC1101register(0x30, 0x00, &status);//reset STROBE (wait for SO to go low after CS low...)

    writeCC1101register(0x02, 0x06, &status);//GDO0 output pin config
    writeCC1101register(0x03, 0x47, &status);//RX/TX FIFO Thresholds
    writeCC1101register(0x06, 0xFF, &status);//RX/TX FIFO Thresholds
    writeCC1101register(0x08, 0x05, &status);//Packet Automation Control
    writeCC1101register(0x0B, 0x06, &status);//Freq Synth Control
    writeCC1101register(0x0D, 0x10, &status);//Freq Cont word, high byte
    writeCC1101register(0x0E, 0xB0, &status);//Freq Cont word, mid byte
    writeCC1101register(0x0F, 0x71, &status);//Freq Cont word, low byte
    writeCC1101register(0x10, 0xF6, &status);//Modem config
    writeCC1101register(0x11, 0x83, &status);//Modem config
    writeCC1101register(0x12, 0x13, &status);//Modem config
    writeCC1101register(0x13, 0x00, &status);//Modem config
    writeCC1101register(0x15, 0x15, &status);//Modem Deviation Setting
    writeCC1101register(0x18, 0x18, &status);//Main Radio Control State Machine Configuration
    writeCC1101register(0x19, 0x16, &status);//Frequency Offset Compensation Configuration
    writeCC1101register(0x20, 0xFB, &status);//Wake On Radio Control
    writeCC1101register(0x22, 0x17, &status);// Front End TX Configuration
    writeCC1101register(0x23, 0xE9, &status);//Frequency Synthesizer Calibration
    writeCC1101register(0x24, 0x2A, &status);//Frequency Synthesizer Calibration
    writeCC1101register(0x25, 0x00, &status);//Frequency Synthesizer Calibration
    writeCC1101register(0x26, 0x1F, &status);//Frequency Synthesizer Calibration
    writeCC1101register(0x2C, 0x81, &status);//Various Test Settings
    writeCC1101register(0x2D, 0x35, &status);//Various Test Settings
    writeCC1101register(0x2E, 0x09, &status);//Various Test Settings

    I then load 5 bytes to the TX FIFO:

    writeCC1101register(0x3F, 0x05, &status);//5 byte packet
    writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
    writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
    writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
    writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO
    writeCC1101register(0x3F, 0x55, &status);//write to TX FIFO

    Then request a synthesizer calibration which happens almost immediately instead of taking ~750uS:
    writeCC1101register(0x31, 0x00, &status);//cal synth - does not take 750+uS!!

    This I want to see something on my spectrum analyzer:

    for(x=0; x<2500; x++)   //transmit many times so can see it on spectrum analyzer
      writeCC1101register(0x35, 0x00, &status);//does not transmit!!

    It does not appear I'm transmitting at all.  Any ideas from the gurus?  

  • Hi

    As far as I can see, you are not writing to the PATABLE. You set PA_POWER to 7 without setting the power levels.

    Also, you should only send one STX per packet. Strobing STX over and over again without writing the TXFIFO in between strobes will only make the radio transmit preamble (since the FIFO is empty).

    BR

    Siri

     

  • Thanks for the reply.

    I now have PA_POWER set to 0, PA_TABLE[0] set to 0x60.  My loop is now writing a 5 and 5 bytes of data to the TX FIFO buffer but I'm still not transmitting.  Any ideas?

    init_CC1101();

    writeCC1101register(0x31, 0x00, &status);//cal synth

    for(x=0; x<2500; x++)

    {

    writeCC1101register(0x3F, 0x05, &status);//5 byte packet

    writeCC1101register(0x3F, 0x55, &status);//

    writeCC1101register(0x3F, 0x55, &status);//

    writeCC1101register(0x3F, 0x55, &status);//

    writeCC1101register(0x3F, 0x55, &status);//

    writeCC1101register(0x3F, 0x55, &status);//

    writeCC1101register(0x35, 0x00, &status);//transmit

    }

  • Hi

    How do you know that you are not transmitting? Do you use a spectrum analyzer to see if you are sending anything on the air or are you simply not receiving anything? Can the problem just as well being on the RX side?

    In your loop you must wait for a packet to be sent before sending the next packet. With the code above you will fill the TX FIFO too fast and then get problems with your FIFO pointers. Use one of the GDO signals programmed as IOCFGx = 0x06 to check when a packet has been sent.

    SIri

  • I am using a spectrum analyzer to monitor for RF at 433.92MHz with a 1 MHz span and 30mS sweep rate.  I am reasonably sure the CC1101 is not transmitting.

    I added a long delay after sending the TX strobe before initiating the next packet transmission.  I also write 0x06 to address 0x02 so GDO0 is set up to assert when sync word has been sent.  Upon writing the data to the FIFO and writing the strobe to address 0x35, GSO0 goes high exactly at the same time as when CS goes high.  My logic analyzer has about 1nS resolution.  This seems unlikely. Shouldn't there be some delay? 

  • SIri,

    Are you the only one at TI that can provide assistance with the CC1101?  I need to make some progress today if possible.

  • Hi

    Hi

    I did a test with your setting and the EasyLink example found here:

    http://processors.wiki.ti.com/index.php/Category:Sub-1GHz#EasyLink_Versions

    The runTX function was modified as shown below:

    static void runTX(void) {

       

        // Connect ISR function to GPIO2

        ioPinIntRegister(IO_PIN_PORT_1, GPIO0, &radioTxISR);

       

        // Interrupt on falling edge

        ioPinIntTypeSet(IO_PIN_PORT_1, GPIO0, IO_PIN_FALLING_EDGE);

       

        // Clear ISR flag

        ioPinIntClear(IO_PIN_PORT_1, GPIO0);

     

        // Enable interrupt

        ioPinIntEnable(IO_PIN_PORT_1, GPIO0);

     

        // Update LCD

        updateLcd();

     

        // Infinite loop

        while(TRUE) {

       

            // Wait for button push

            if(bspKeyPushed(BSP_KEY_ALL)) {

         

                // Continiously sent packets until button is pressed

                do {

                 

                    uint8 writeByte;

           

                    // update packet counter

                    packetCounter++;

                   

                    writeByte = 5; cc1101SpiWriteReg(0x3F, &writeByte, 1);

                    writeByte = 0x55; cc1101SpiWriteReg(0x3F, &writeByte, 1);

                    writeByte = 0x55; cc1101SpiWriteReg(0x3F, &writeByte, 1);

                    writeByte = 0x55; cc1101SpiWriteReg(0x3F, &writeByte, 1);

                    writeByte = 0x55; cc1101SpiWriteReg(0x3F, &writeByte, 1);

                    writeByte = 0x55; cc1101SpiWriteReg(0x3F, &writeByte, 1);

     

                    // Strobe TX to send packet

                    trxSpiCmdStrobe(CC1101_STX);

     

                    // Wait for interrupt that packet has been sent.

                    // (Assumes the GPIO connected to the radioRxTxISR function is

                    // set to GPIOx_CFG = 0x06)

                    while(packetSemaphore != ISR_ACTION_REQUIRED);

     

                    // Clear semaphore flag

                    packetSemaphore = ISR_IDLE;

     

                    // Update LCD

                    updateLcd();

                } while (!bspKeyPushed(BSP_KEY_ALL));

            }

        }

    }

     

    The code works fine and I am able to receive all packets with SmartRF Studio.

    The attachment shows a logic analyzer plot on how the timing looks like when packets are transmitted.

     

    It takes 20.86 ms from sending the TX strobe until GDO0 goes high:

     

    IDLE to TX with cal: 750 us

    Transmitting 2 bytes preamble and 4 bytes sync at 2.4 kbps: (2+4)*8/2400 = 20 ms

    1273.plot.docx

    What HW are you running on? It would probably be a good idea to test your SW on known good HW (our EMs) before testing your own HW. This way it is easier to determine if the problem is HW or SW related.

    I also recommend that you monitor your SPI traffic to make sure that it is according to spec.

    Siri

  • I am using my own hardware as shown here:

    The bottom layer of the PCB is solid ground plane.  The logic analyzer confirms I'm writing and reading the registers correctly in the CC1101. 

    My logic analyzer shows a 434.05MHz transmitter over on the other side of my house that is transmitting as expected so I believe my analyzer is working.

    I feel like I'm not initializing the CC1101 correctly, or perhaps there is another step to making it transmit that I'm leaving out of my code.  I have not found any app notes that talk about transmitting packets beyond the CC1101 datasheet.

    Do you have an email address you would be willing to share and I could send you my source code project?

    Don

  • Hi

    What you are using is a spectrum analyzer. What I was asking is if you have a logic analyzer so that you can monitor your SPI traffic. A plot of you init routine would be nice to confirm that your SPI is OK. Have you tested to write registers and then read them back? Have you read the MARCSTATE register after strobing STX to confirm that the radio is in the correct state?

    The code example I sent you yesterday contains all the necessary steps to get the radio to transmit.

    • Init MCU
    • Reset radio (use the manual reset sequence as described in the data sheet and also used in the code example)
    • Configure radio with settings from SmartRF Studio
    • Strobe STX

    For testing you do not need to write any data to the TXFIFO. Simply strobe STX with an empty FIFO and the radio will transmit preamble until you fill the FIFO or issue an IDLE strobe.

    From a HW perspective, a picture of the HW is not telling me much. Have you followed our reference design when making your HW? Can you share your design files?

    I do not know how useful it is for me to look at your code when it is not running on the MCU used on our kit (Hard for me to confirm that your SPI etc is OK). It is better if you send me some pseudo code explaining the steps you are doing and also some plots of all the SPI traffic: Reset, configure, strobing STX.

    BR

    Siri

  • Are you measuring conducted or radiated? If radiated, do it conducted. Do you know if your board works as expected from a RF perspective? Eq try to connect the radio to the CCDebugger and do some initial testing with SmartRF Studio, now it could be that you have issues both with hardware and software.

  • Thanks for your response.

    I'm bringing up a second board now to try to rule out the hardware.  Will also try direct connection to the analyzer instead of using the antenna.

    Don

  • I am much further down this path now.  I have working hardware and mostly working firmware.  I can send and receive packets and understand the packet structure.  The problem I have now is that while and can send from one CC1101 and receive valid/expected packets on a different CC1101, I am not able to transmit a packet and then immediately thereafter receive a packet on the same CC1101.

    This receive code works perfectly:

    //RECEIVE

    writeCC1101register(0x36, 0x00, &status);//force to idle mode
    writeCC1101register(0x3A, 0x00, &status);//flush the RX FIFO buffer-must be in idle state
    writeCC1101register(0x3B, 0x00, &status);//flush the TX FIFO buffer-must be in idle state
    writeCC1101register(0x31, 0x00, &status);//cal synth
    writeCC1101register(0x34, 0x00, &status);//enable receive

    //wait for incoming byte

    //wait for high
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    while(GDO0state==0) //while P6.5 GDO0 is low...
    {
       GDO0state = P6IN; //read port
       GDO0state &= BIT5; //mask off other port bits BIT2 = 0x0004
    }

    //wait for low
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    while(GDO0state>0) //while P6.5 GDO0 is high...
    {
       GDO0state = P6IN; //read port
       GDO0state &= BIT5; //mask off other port bits BIT2 = 0x0004
    }

    readCC1101register(0x3D, &status); // GET NUM BYTES IN RX BUFFER
    packetlength = status & 0x7F;//mask overflow bit

    //read the data from the FIFO buffer.
    for(x=0; x<packetlength; x++) //this will read 2 additional status bytes
       rxbuf[x] = readCC1101register(0xBF, &status);

    Shortly after starting this code I send a packet from my other CC1101 and the packet is received as expected.

    However, if I first send a packet and then turn on the receiver, the GDO0 status line never goes high even though my other CC1101 is being manually triggered to send a packet.    

    //TRANSMIT

    writeCC1101register(0x36, 0x00, &status);//force to idle mode
    writeCC1101register(0x3A, 0x00, &status);//flush the RX FIFO buffer-must be in idle state
    writeCC1101register(0x3B, 0x00, &status);//flush the TX FIFO buffer-must be in idle state
    writeCC1101register(0x31, 0x00, &status);//cal synthesizer

    //loadTX FIFO buffer and transmit
    writeCC1101register(0x3F, 0x02, &status);//3 byte packet
    writeCC1101register(0x3F, 0x30, &status);//write data byte to tx buffer
    writeCC1101register(0x3F, 0x20, &status);//write data byte to tx buffer
    writeCC1101register(0x35, 0x00, &status);//transmit:GDO0 is low for 20mS, then high for 17mS

    //wait for transmit to finish
    //wait for high
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    while(GDO0state==0) //while P6.5 GDO0 is low...     
    {
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits BIT2 = 0x0004
    }

    //wait for low
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    while(GDO0state>0) //while P6.5 GDO0 is high...
    {
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits BIT2 = 0x0004
    }

    //RECEIVE

    writeCC1101register(0x36, 0x00, &status);//force to idle mode
    writeCC1101register(0x3A, 0x00, &status);//flush the RX FIFO buffer-must be in idle state
    writeCC1101register(0x3B, 0x00, &status);//flush the TX FIFO buffer-must be in idle state
    writeCC1101register(0x31, 0x00, &status);//cal synth
    writeCC1101register(0x34, 0x00, &status);//enable receive

    //__delay_cycles(4000000); //didn't help...

    //wait for incoming packet
    //wait for high
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    while(GDO0state==0) //while P6.5 GDO0 is low...       ******* program hangs here waiting for indication of packet arrival **************
    {
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits BIT2 = 0x0004
    }

    //wait for low
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    while(GDO0state>0) //while P6.5 GDO0 is high...
    {
    GDO0state = P6IN; //read port
    GDO0state &= BIT5; //mask off other port bits
    }

    readCC1101register(0x3D, &status); // GET NUM BYTES IN RX BUFFER
    packetlength = status & 0x7F;//mask overflow bit

    //read the data from the FIFO buffer.
    for(x=0; x<packetlength; x++) //this will read 2 additional status bytes
    rxbuf[x] = readCC1101register(0xBF, &status);

    Any ideas why working receive code fails immediately after transmitting?  Either the CC1101 is not entering the receive mode or the GDO0 line is not functioning.  

    Thanks for the help...

    Don

  • After reading some of the other posts on this topic I added code to read MARCSTATE. When in the loop waiting for GDOstate to go high (see previous post) MARCSTATE returns 0x0D which should be IDLE state. If this is the current state then my questions remains: why doesn't my command to go to receive mode work after transmitting a packet?

    Don
  • Hi Don

    There is no reason for the radio not to receive properly after transmitting. I cannot see anything wrong in your code, so what I recommend you to do is to monitor your SPI traffic and GDO pins to try to figure out what is going on. I cannot see from your register settings that you are writing to the PATABLE registers, setting the output power. Also, it is not necessary to do a SCAL strobe as long as you have autocal enabled.

    BR

    Siri