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.

sending data from CC430 to CC1111 via SimpliciTI

Other Parts Discussed in Thread: SIMPLICITI, CC1101, CC430F6137

Hello,

Our team is on a time crunch (two weeks) and our goal is to send data collected from a gyroscope and accelerometer on a PCB to a computer for post-processing. Our scheme is as follows: the accelerometer and gyroscope communicate via I2C with the CC430, which sends the data over radio frequency to a transceiver that is plugged in via USB to our laptop. I believe the transceiver is called the CC1111, it is the one that comes with the EZ-430 Chronos Watch Development Kit.  

I have a feeling that the solution should actually be quite short and simple, but due to an extremely limited background we just need some guidance with respect to the following:

I am looking at the sample code that comes with SimpliciTI-IAR (we are using IAR) called Simple Peer-to-Peer in the CC430F5137-LinkListen folder; it seems similar to the task on our hands. This program involves the periodic sending of a 2-byte message from a designated "talker" device to a "listener device." In the C code file main_LinkTo.c it seems like this is where most of the data transmission takes place. I want to know if I can simply modify this code to accommodate our needs. Specifically, how does the function linkto() find the device to link to?  Does it have a pre-determined address or does it search within the range of the antenna for a receiver? Why is createRandomAddress() used? I believe that we will also be able to use SMPL_Send(sLinkID1, msg, sizeof(msg));, as this is the function used to send the message, but how is sLinkID1 established to begin with? What will we need to change for our application? 

I also noticed a library of radio functions (eg open_radio() close_radio() reset_radio) in the code for the EZ-430. Will CC430 connect automatically to the antenna, or will we need to write separate code (or just a line or so) for this?

I have read through the SimpliciTI API pdf file but due to my limited background in RF transmission, I still only have a very rudimentary understanding of the fundamentals.

thank you in advance for your time!

 

 

  • Dillon,

    Due to your time constraints, I think you would be more interested in using the eZ430 Chronos sample code as it models continuous transmission from an accelerometer through the CC430F6137 to the CC1101 receiver.  You shouldn't have to reprogram the receiver, and loading this code onto your device and modifying the I2C should be simpler than trying to modify the RF network protocol and transmission code.

     

    Find the code and project details/documentation at www.ti.com/chronoswiki.

    Thanks,

    Jacob

    PS. I will stay tuned to this thread if you run into different problems.  Again, tweaking I2C to communicate with your sensor instead of the built-in watch sensors should be much easier than adjusting the whole project to work with SimpliciTI.

  • To answer your questions regarding SimpliciTI, the linkTo and the linkListen functions complete the connection in the top of each function via calls to SMPL_Link() and SMPL_LinkListen().  The two functions stall here until the link is completed.  Note that you must first push a button (as managed in the main function) tto initiate the calls to the functions and initiate the connection.  Pressing the button on each device causing the linking process to begin is known as commissioning the network.  You may choose another scheme to accomplish this such as simply sending out a broad cast packet to start the link process or simply start the link process as soon as you power up (i.e. comment out the button press code in main) and merely wait until the link is established.

    The linkID is returned by the calls to SMPL_Link and SMPL_LinkListen.  Actually a pointer to where you want the link ID placed is passed and the functions populate the link ID there.  This link ID is much like a pointer in C as it is a reference to the communications link established.  All calls to SMPL_Send and SMPL_Receive use the link ID to manage access to the communications link and packets passed.  Note that the link ID may not be the same on both ends of the link but usually in the referenced sample application they are.

    The createRandomAddress function doesn't actually exist.  It is merely code placed there (wrapped in a conditional statement) to show you where you would change the address if you wanted to.  In the sample application you must make sure the listener and talker have different addresses otherwise the radios will assume the packet is an echo and will toss it out.  You can change these address in the .dat configuration files.  You can find them in the solution explorer window under the applications folder.

    Jim Noxon

     

  • Thanks for your reply, Jacob! I have also been examining the EZ-430 Chronos code in IAR, and have some questions as to how it works. First, a question as to how priority is given to which task to run in IAR. When I download a project with multiple c-files, how does IAR determine which to give priority? 

     

    I have examined the source code for a good amount of time and I see that the most relevant file seems to be rfsimpliciti.c - it contains the following block of code: 

     

    // Prepare radio for RF communication

    open_radio();

     

    // Set SimpliciTI mode

    sRFsmpl.mode = mode;

    // Set SimpliciTI timeout to save battery power

    sRFsmpl.timeout = SIMPLICITI_TIMEOUT; 

    // Start SimpliciTI stack. Try to link to access point.

    // Exit with timeout or by a S2 button press.

    if (simpliciti_link())

    {

    if (mode == SIMPLICITI_ACCELERATION)

    {

    // Start acceleration sensor

    as_start();

    }

     

    // Enter TX only routine. This will transfer button events and/or acceleration data to access point.

    simpliciti_main_tx_only();

    }

     

    // Set SimpliciTI state to OFF

    sRFsmpl.mode = SIMPLICITI_OFF;

     

    // Stop acceleration sensor

    as_stop();

     

    // Powerdown radio

    close_radio();

     

    This seems the most relevant for our purposes. My interpretation of the above block is that the radio is opened, the mode is set, and the acceleration is recorded and then transmitted continuously until the mode is taken out of acceleration. SimpliciTI is then closed, and the radio stops transmitting. Is this a correct interpretation?

     

    My guess is that as_start  reads in the acceleration data, and simpliciti_main_tx_only() transmits the data. Is this correct? If so, how does simpliciti_main_tx_only() know to transmit the correct data without taking any arguments?

     

    Before we get the I2C working I just want to test that I can transmit some sort of data from our chip to the computer, such as a stream of 1's. Will this be possible with the given code or will I need to write some I2C code to establish a link between the CC430 and the antenna on our PCB? Also, once this is done, will simpliciti_link() automatically set up the link between the two devices, and will the code from rfsimpliciti be sufficient along with the header files identified in the pre-amble will I need to download onto the chip for a test run?

     

    simpliciti_main_tx_only is an external variable declared in simpliciti.h, so where can I find out how it works? Is this what is used to transmit the stream of data to the access point, and can I use it to send a stream of 1's as I described above? Also, where can I find out how as_start works?

     

    Thank you very much for your time!

  • actually, please disregard the previous post. We've managed to write some rudimentary code based off of the rfsimpliciti.c code to transmit some dummy data, however it is still not working. The current problem is with IAR itself - I include simpliciti.h at the top, but what library files are necessary for simpliciti.h? I have already added ez430_chronos_ISM_EU.d43 and ez430_chronos_ISM_US.d43, but I get the following errors when trying to call simpliciti_link:

    Error[e46]: Undefined external "simpliciti_link" referred in main (C:\...\IAR Embedded Workbench\projects\Debug\Obj\main.r43

    Tried adding main.r43 but then it had a redeclaration error

    thanks

    Dillon

  • Dillon,

    It always gets really tricky when you start adding large library files to the code.  Do you have the full version of IAR, or are you code size limited?   this might be causing problems.  I always recommend to start with the example code and change as little as possible to get your code running stead of pulling and copying from several different sources. 

     

    I am not too familiar with the intricacies of simpliciti libraries, so I am moving this post into that forum.  You should also be able to get more details there.  Sorry to be slow to respond, but I have been out of the country on travel.

     

    Thanks,

    Jacob

  • Hi,

    I would like to send acceleration data from ez430 to CC1101, but I have some problems setting the connection...

    My Access point is CC1101 programmed with project AP as Data Hub, it means it initiates it's radio and listens for a device to connect, so I don't have to make big changes in this code, I suppose if I start simpliciTI stack correctly in EZ430 code, it should connect automatically? 

    Can you help me with the correct protocol I need to use to connect Chronos to CC1101? I first tried this:

    BSP_Init();
    SMPL_Init (0);
    simpliciti_link();, in this order, in the function acceleration.c, but it doesn't work.

    If I have to send acceleration data to PC, which is the best place to start simpliciTI data sending? Any information would help, I am really confused why this isn't working.

    Thank you in advanced,

    Lara