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.

SimpliciTI Online Materials

Other Parts Discussed in Thread: SIMPLICITI, CC1120, MSP430F5509, CC1101

Hi all,

for those who are starting to work SimpliciTI and having some questions, we would like to encourage you first searching whether the question has been asked before by using the search engine of E2E forum, or refer for the following online materials:

- SimpliciTI wiki landing page:

http://processors.wiki.ti.com/index.php/Category:SimpliciTI

- SimpliciTI FAQ:

http://processors.wiki.ti.com/index.php/SimpliciTI_FAQ

- SimpliciTI v.1.2.1 Beta Release (CC1120 support):

http://e2e.ti.com/support/low_power_rf/f/156/t/207308.aspx

- MSP430 SimpliciTI porting guide:

http://processors.wiki.ti.com/index.php/MSP430_SimpliciTI_Porting_Guidelines

- SimpliciTI Guide for Configuring RF Setting:

http://processors.wiki.ti.com/index.php/SimpliciTI_-_Configuring_RF_Setting

If not, then please post a new thread.

Thanks

  • Hi,

    thank you for your tutorial.

    I need to port SimpliciTI to EZ430 white PCB board. There are MSP430F5509 and CC1101 on in.

    Please tell me how to do it.

    Thank you.

  • Hi,

    thank you for your replay.

    I asked wrong question, sorry.

    I have USB-based MSP430F5509/CC1101 board (I got it with my TI watch) and I want to put SimpliciTI and my simple code to it. There is some code (for watch) so I want to edit it. For test I need just simple peer-to-peer aplication.

    On other side I'm using cc1110. I put example "Link To" from Simplicity folder I got.

    Here is the code from MSP430F5509 (just Simpliciti part, in main function I call simplicitiMain):

    5344.MSPCode.txt
    /**********************************************************************************************
      Copyright 2004-2007 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.
    **************************************************************************************************/
    
    
    // *************************************************************************************************
    // Include section
    #include <string.h>
    #include "bsp.h"
    #include "mrfi.h"
    #include "bsp_leds.h"
    //#include "bsp_buttons.h"
    #include "nwk_types.h"
    #include "nwk_api.h"
    #include "nwk_frame.h"
    #include "nwk.h"
    #include "simpliciti.h"
    #include "project.h"
    
    
    
    
    // *************************************************************************************************
    // Defines section
    #define BIT0                   (0x0001)
    #define BIT1                   (0x0002)
    #define BIT2                   (0x0004)
    #define BIT3                   (0x0008)
    #define BIT4                   (0x0010)
    #define BIT5                   (0x0020)
    #define BIT6                   (0x0040)
    #define BIT7                   (0x0080)
    #define BIT8                   (0x0100)
    #define BIT9                   (0x0200)
    #define BITA                   (0x0400)
    #define BITB                   (0x0800)
    #define BITC                   (0x1000)
    #define BITD                   (0x2000)
    #define BITE                   (0x4000)
    #define BITF                   (0x8000)
    
    // *************************************************************************************************
    // Prototypes section
    
    /* callback handler */
    uint8_t sCB(linkID_t);
    
    
    // *************************************************************************************************
    // Extern section
    extern uint8_t sInit_done;
    
    
    // *************************************************************************************************
    // Global Variable section
    
    /* reserve space for the maximum possible peer Link IDs */
    
    void toggleLED(uint8_t);
    
    static          uint8_t  sRxTid = 0;
    static          linkID_t sLinkID2 = 0;
    static volatile uint8_t  sSemaphore = 0;
    
    /* Rx callback handler */
    static uint8_t sRxCallback(linkID_t);
    
    
    
    
    /* work loop semaphores */
    static volatile uint8_t sPeerFrameSem = 0;
    static volatile uint8_t sJoinSem = 0;
    
    volatile unsigned char simpliciti_flag;
    unsigned char simpliciti_data[SIMPLICITI_MAX_PAYLOAD_LENGTH];
    unsigned char ed_data[SIMPLICITI_MAX_PAYLOAD_LENGTH];
    
    // AP main routine
    void simpliciti_main(void)
    {
      uint8_t   pwr;
    
      // Init variables  
      simpliciti_flag = SIMPLICITI_STATUS_LINKING;
      
      // Initialize Timer A1 
      BSP_Init();
      
      // Init SimpliciTI
      SMPL_Init(sCB);
      
      // Set output power to +1.1dBm (868MHz) / +1.3dBm (915MHz)
      pwr = IOCTL_LEVEL_2;
      SMPL_Ioctl(IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SETPWR, &pwr);
      
       // LED off
      BSP_TURN_OFF_LED1();
        
      /* main work loop */
      while (1)
      {
    	  uint8_t     msg[2], tid = 0;
    	  toggleLED(1);
    	  /* listen for link forever... */
    	    while (1)
    	    {
    	      /* SMPL_LinkListen handles FHSS implicittly */
    	      if (SMPL_SUCCESS == SMPL_LinkListen(&sLinkID2))
    	      {
    	        break;
    	      }
    	      /* Implement fail-to-link policy here. otherwise, listen again. */
    	    }
    
    	     /* turn on LED1 on the peer in response to receiving a frame. */
    	     *msg = 0x01;
    
    	     /* turn on RX. default is RX off. */
    	     SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXON, 0);
    
    	     while (1)
    	     {
    	      //FHSS_ACTIVE( nwk_pllBackgrounder(FALSE) ); /* manage FHSS */
    
    	       /* Wait for a frame to be received. The Rx handler, which is running in
    	        * ISR thread, will post to this semaphore allowing the application to
    	        * send the reply message in the user thread.
    	        */
    	       if (sSemaphore)
    	       {
    	         *(msg+1) = ++tid;
    	         SMPL_Send(sLinkID2, msg, 2);
    
    	         /* Reset semaphore. This is not properly protected and there is a race
    	          * here. In theory we could miss a message. Good enough for a demo, though.
    	          */
    	         sSemaphore = 0;
    	       }
    	     }
      	  }
    	}
    
    void toggleLED(uint8_t which)
    {
      if (1 == which)
      {
        BSP_TOGGLE_LED1();
      }
      else if (2 == which)
      {
        BSP_TOGGLE_LED2();
      }
      return;
    }
    
    /* handle received messages */
    static uint8_t sRxCallback(linkID_t port)
    {
      uint8_t msg[2], len, tid;
    
      /* is the callback for the link ID we want to handle? */
      if (port == sLinkID2)
      {
        /* yes. go get the frame. we know this call will succeed. */
         if ((SMPL_SUCCESS == SMPL_Receive(sLinkID2, msg, &len)) && len)
         {
           /* Check the application sequence number to detect
            * late or missing frames...
            */
           tid = *(msg+1);
           if (tid)
           {
             if (tid > sRxTid)
             {
               /* we're good. toggle LED */
               toggleLED(*msg);
               sRxTid = tid;
             }
           }
           else
           {
             /* wrap case... */
             if (sRxTid)
             {
               /* we're good. toggle LED */
               toggleLED(*msg);
               sRxTid = tid;
             }
           }
           /* Post to the semaphore to let application know so it sends
            * the reply
            */
           sSemaphore = 1;
           /* drop frame. we're done with it. */
           return 1;
         }
      }
      /* keep frame for later handling */
      return 0;
    }
    
    /* Runs in ISR context. Reading the frame should be done in the */
    /* application thread not in the ISR thread. */
    uint8_t sCB(linkID_t lid)
    {
      if (lid)
      {
        sPeerFrameSem++;
      }
      else
      {
        sJoinSem++;
      }
    
      /* leave frame to be read by application. */
      return 0;
    }