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.

How to interface CC1101 with MSP430, without Smartrf04 EB Board?

Other Parts Discussed in Thread: CC1101, MSP430G2553, CC110L, MSP430G2452, CC1120

Hi,

Currently I'm working on a project and part of it is effectively transmitting with transceivers (in this case CC1101). I have the CC1101's with the antennas and I'm trying to interface them with the MSP430G2553. I'm looking at the resources online but unfortunately all of them tell me I need a SmartRF04 EB  Evaluation Board to connect the transceivers to the computer and use SmartRFStudio to configure them. Is there any way I can configure the CC1101's without the use of this board and initialize them with the use of only the microcontroller? Right now getting the evaluation board is not really an option because of price and time constraints. 

Please, any help you can give me will be good. Also, sorry if I didn't use the technical terms correctly... I'm clearly not an expert in the subject. 

Thank you in advance. 

  • Hi Cecilia

    You do not need to have the CC1101 connected to SmartRF Studio to configure the radio. You can use SmartRF Studio to find the register settings you need based on your rf parameter input and then export these settings to a c file that you can use in your own program.

    If you look at this post;

    http://e2e.ti.com/support/low_power_rf/f/155/p/251144/878771.aspx#878771

    I have posted an example code which interface a MSP430G2553 (MSP Launchpad) with a CC110L, The CC110L is based on the CC1101 so the SPI interface is exactly the same. This code shows how to set up the radio and establish a simple one way link between two devices.

  • Also, if you replace the CC110L_SPI .c and .h file in the example code with these corresponding spi files for the CC1101. You have all you need for a rf link with CC1101 and MSP430G2553

     

    /******************************************************************************
        Filename: cc1101_spi.c  
        
        Description: implementation file for a minimum set of neccessary functions
                     to communicate with CC1101 over SPI
                     
    *******************************************************************************/
    
    
    /******************************************************************************
     * INCLUDES
     */
    #include "hal_types.h"
    #include "hal_spi_rf_trxeb.h"
    #include "cc1101_spi.h"
    
    
    /******************************************************************************
     * @fn          cc1101SpiReadReg
     *
     * @brief       Reads register(s). If len  = 1: one byte is read
     *                                 if len != 1: len bytes are read in burst 
     *                                              mode
     * input parameters
     *
     * @param       addr   - address to read
     * @param       *pData - pointer to data array where read data is stored
     * @param       len    - numbers of bytes to read starting from addr
     *
     * output parameters 
     *
     * @return      rfStatus_t
     */
    rfStatus_t cc1101SpiReadReg(uint8 addr, uint8 *pData, uint8 len)
    {
      uint8 rc;
      rc = trx8BitRegAccess((RADIO_BURST_ACCESS|RADIO_READ_ACCESS), addr, pData, len);
      return (rc);
    }  
    
    /******************************************************************************
     * @fn          cc1101SpiWriteReg
     *
     * @brief       writes register(s). If len  = 1: one byte is written
     *                                  if len != 1: len bytes at *data is written 
     *                                               in burst mode.
     * input parameters
     *
     * @param       addr   - register address to write
     * @param       *pData - pointer to data array that is written
     * @param       len    - number of bytes written
     *
     * output parameters
     *
     * @return      rfStatus_t
     */
    rfStatus_t cc1101SpiWriteReg(uint8 addr, uint8 *pData, uint8 len)
    {
      uint8 rc;
      rc = trx8BitRegAccess((RADIO_BURST_ACCESS|RADIO_WRITE_ACCESS),addr, pData, len);
      return (rc);
    }
    
    /******************************************************************************
     * @fn          cc1101SpiWriteTxFifo
     *
     * @brief       Writes provided data to TX FIFO
     *              
     * input parameters
     *
     * @param       *pData - pointer to data array that is written to TX FIFO
     * @param       len    - Length of data array to be written
     *
     * output parameters
     *
     * @return      rfStatus_t
     */
    rfStatus_t cc1101SpiWriteTxFifo(uint8 *pData, uint8 len)
    {
      uint8 rc;
      rc = trx8BitRegAccess((RADIO_BURST_ACCESS|RADIO_WRITE_ACCESS),CC1101_FIFO, pData, len);
      return (rc);
    }
    
    
    /******************************************************************************
     * @fn          cc1101SpiReadRxFifo
     *
     * @brief       Reads RX FIFO values to pData array
     *              
     * input parameters
     *
     * @param       *pData - pointer to data array where RX FIFO bytes are saved
     * @param       len    - number of bytes to read from the RX FIFO
     *
     * output parameters
     *
     * @return      rfStatus_t
     */
    rfStatus_t cc1101SpiReadRxFifo(uint8 *pData, uint8 len)
    {
      uint8 rc;
      rc = trx8BitRegAccess((RADIO_BURST_ACCESS|RADIO_READ_ACCESS),CC1101_FIFO, pData, len);
      return (rc);
    }  
    
    /******************************************************************************
     * @fn      cc1101GetTxStatus(void)
     *          
     * @brief   This function transmits a No Operation Strobe (SNOP) to get the 
     *          status of the radio and the number of free bytes in the TX FIFO.
     *          
     *          Status byte:
     *          
     *          ---------------------------------------------------------------------------
     *          |          |            |                                                 |
     *          | CHIP_RDY | STATE[2:0] | FIFO_BYTES_AVAILABLE (free bytes in the TX FIFO |
     *          |          |            |                                                 |
     *          ---------------------------------------------------------------------------
     *
     *          NOTE:
     *          When reading a status register over the SPI interface while the 
     *          register is updated by the radio hardware, there is a small, but 
     *          finite, probability that the result is corrupt. This also applies 
     *          to the chip status byte. The CC1100 and CC1101 errata notes explain 
     *          the problem and propose several work arounds. 
     *
     * input parameters
     *
     * @param   none
     *
     * output parameters
     *         
     * @return  rfStatus_t 
     *
     */
    rfStatus_t cc1101GetTxStatus(void)
    {
        return(trxSpiCmdStrobe(CC1101_SNOP));
    }
    
    /******************************************************************************
     *
     *  @fn       cc1101GetRxStatus(void)
     *
     *  @brief   
     *            This function transmits a No Operation Strobe (SNOP) with the 
     *            read bit set to get the status of the radio and the number of 
     *            available bytes in the RXFIFO.
     *            
     *            Status byte:
     *            
     *            --------------------------------------------------------------------------------
     *            |          |            |                                                      |
     *            | CHIP_RDY | STATE[2:0] | FIFO_BYTES_AVAILABLE (available bytes in the RX FIFO |
     *            |          |            |                                                      |
     *            --------------------------------------------------------------------------------
     *
     *            NOTE:
     *            When reading a status register over the SPI interface while the
     *            register is updated by the radio hardware, there is a small, but 
     *            finite, probability that the result is corrupt. This also applies 
     *            to the chip status byte. The CC1100 and CC1101 errata notes explain 
     *            the problem and propose several work arounds. 
     *
     * input parameters
     *
     * @param     none
     *
     * output parameters
     *         
     * @return    rfStatus_t 
     *
     */
    rfStatus_t cc1101GetRxStatus(void)
    {
        return(trxSpiCmdStrobe(CC1101_SNOP | RADIO_READ_ACCESS));
    }
    
    /******************************************************************************
      Copyright 2010 Texas Instruments Incorporated. All rights reserved.
    
      IMPORTANT: Your use of this Software is limited to those specific rights
      granted under the terms of a software license agreement between the user
      who downloaded the software, his/her employer (which must be your employer)
      and Texas Instruments Incorporated (the "License").  You may not use this
      Software unless you agree to abide by the terms of the License. The License
      limits your use, and you acknowledge, that the Software may not be modified,
      copied or distributed unless embedded on a Texas Instruments microcontroller
      or used solely and exclusively in conjunction with a Texas Instruments radio
      frequency transceiver, which is integrated into your product.  Other than for
      the foregoing purpose, you may not use, reproduce, copy, prepare derivative
      works of, modify, distribute, perform, display or sell this Software and/or
      its documentation for any purpose.
    
      YOU FURTHER ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE
      PROVIDED �AS IS� WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,
      INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE,
      NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL
      TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT,
      NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER
      LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
      INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE
      OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT
      OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
      (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
    
      Should you have any questions regarding your right to use this Software,
      contact Texas Instruments Incorporated at www.TI.com.
    *******************************************************************************/

    1362.cc1101_spi.h

  • Hello Martin,

    I am in Senior Projects Design with Cecilia. However, I'm finding many issues with compiling the code to CC1101 with the files you sent. For example, this 

    Error[Pe256]: invalid redeclaration of type name "registerSetting_t" (declared at line 50 of "C:\Users\Gabriel\Downloads\hal_spi_rf_trxeb.h") C:\Users\Gabriel\Downloads\hal_msp_exp430g2_spi.h 60

    Would you know why that would be? These errors are on the libraries you sent so the errors seem to be some kind of error on the way its set up?

  • Hi Gabriel

    That is because the project is build for CC110L and the MSP430 Launchpad and the CC101_spi.c files is made for the trxEB evaluation board. I have modified the example sw so the it complies with the cc1101_spi.c file. Keep in mind that I haven't changed all name reference to CC110L in the code.

    4377.cc110L_easy_link_msp_exp430g2_modified_for_cc1101.zip

  • Dear Martin,

        I'm testing your code but i interfaced cc1101 with MSP430G2452 and i cant configured the SPI interface correctly. Can you help me to change this?

  • Hi Jose

    From the datasheets it appears that the MOSI/SDO and MISO/SDI are swapped between the MSP430G2452 and the MSP430G2553 which the code are written for.

    So for the MSP430G2452 the MOSI/SDO is on P1.6 and the MISO/SDI is on P1.7. SCLK is the same for both MCU at pin P1.5. CSn can be on any I/O (set to P2.7 in the example code) as this is controlled by the spi driver.

    Table 17 in the MSP430G2452 datasheet shows you how the control bits for the designated pins should be set to enable SPI on the MCU.

  • Hi Cecilia,

    I am a fresher here, but  I found my problem exactly like yours,I you can help me on this It would be great.

    I have achieved MSP430 fullduplex communication using SPI,
    my aim is to have a star/Mesh network using MSP430g 2553  and CC1101 in master slave configuration without using any development  board.

    could you please tell us how you sloved your earlier problem and did you created a Master slave configuration.

    Any help is important here or on my id sureshrai89@gmail.com.

    -Regards 
    Suresh Rai

  • HI martin i'm using your code example but i need the code in ccs. I used the link how to convert a iar project from ccs but i don't have a sucsess with it. do you can show me one example code in ccs?

  • We have one example that uses CCS with CC1120 here: processors.wiki.ti.com/.../Perf_value_line_easylink

    CC1120 uses the same SPI interface as CC1101 so using this as a start point and copy in the CC1101 files should be a good start point.