• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Low Power RF & Wireless Connectivity » Low Power RF Proprietary Software & SimpliciTI Forum » Bi Directional Data Transfer using the e430RF2500 Demo
Share
Low Power RF & Wireless Connectivity
  • Forums
  • Announcements
  • Files
  • E2E Wiki
Options
  • Subscribe via RSS

Forums

Bi Directional Data Transfer using the e430RF2500 Demo

This question has suggested answer(s)
Sharwari Kulkarni
Posted by Sharwari Kulkarni
on May 09 2009 02:55 AM
Intellectual490 points

Hello,

I am working on a project based on the Sensor Monitor Demo.  I need bi directional data transfer i.e both the ED and the AP should be able to transmit and receive. I want the ED to respond to various commands from the AP. I implemented SMPL_Send in the AP and SMPL_Receive in the ED but my ED is not receving any thing. 

I'm a bit confused about the linkIDs here. I am implementing an SMPL_Send from the AP in the following manner

SMPL_SUCCESS!=SMPL_Send(sLID[sNumCurrentPeers],msgTx,sizeof(msgTx))

When I implement a corresponding SMPL_Receive on the ED, what is the linkID that I have to supply at that time?  I am making a connection between AP and ED using SMPL_Link and SMPL_LinkListen before and the AP is providing an incremental linkID to the ED. Do I have to use the same linkID when I implement SMPL_Receive at the ED?

Also do I have to implement a call back function at the ED to service the retrieved frames?

I would really appreciate help in this matter.

Regards,

Sharwari

CC2500 SimpliciTI eZ430-RF2500 Link ED End device AP to ED AP access point
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • BrandonAzbell
    Posted by BrandonAzbell
    on May 11 2009 22:50 PM
    Suggested Answer
    Guru54880 points

    Sharwari Mavalankar

    I am working on a project based on the Sensor Monitor Demo.  I need bi directional data transfer i.e both the ED and the AP should be able to transmit and receive. I want the ED to respond to various commands from the AP. I implemented SMPL_Send in the AP and SMPL_Receive in the ED but my ED is not receving any thing. 

    I'm a bit confused about the linkIDs here. I am implementing an SMPL_Send from the AP in the following manner

    SMPL_SUCCESS!=SMPL_Send(sLID[sNumCurrentPeers],msgTx,sizeof(msgTx))

    When I implement a corresponding SMPL_Receive on the ED, what is the linkID that I have to supply at that time?  I am making a connection between AP and ED using SMPL_Link and SMPL_LinkListen before and the AP is providing an incremental linkID to the ED. Do I have to use the same linkID when I implement SMPL_Receive at the ED?

    A link connection, specified by a linkID, is bi-directional.  Therefore you should be able to use the established linkID to send messages from the AP to the ED.

     

    Sharwari Mavalankar

    Also do I have to implement a call back function at the ED to service the retrieved frames?

    Yes, it would be necessary to implement the call back function in the ED such that you can then call the SMPL_Receive() for that linkID.

     

    Brandon

    CC2500 SimpliciTI eZ430-RF2500 Link ED End device AP to ED AP access point
    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • virendra jadav
    Posted by virendra jadav
    on May 19 2009 09:25 AM
    Prodigy15 points

    i have problem  can you solve it....

        Hello,

                       I am jadav virendra . I am studying in BE (electronics and communication). I make a project named wireless process control in my BE  last year. In this project for wireless communication I used two ez430-RF2500 kit. I give description of my project then I tell u a problem. In my project there are two station one is master and second is slave which are located in different locations. I attach the circuit diagram of master and slave unit in attachments.

                     In slave unit microcontroller 8051 read the temperature with help of temperature sensor LM35 and ADC 0808. Then send the data of temperature to the master unit via simpliciTI kit. master unit receive the data of temperature and send appropriate controlling command back to slave unit. Then slave unit receive this data and do action to increase or decrease the temp. with using fan .

                    Here slave unit  microcontroller 8051 give data to simpliciTI  kit using UART (Tx-Rx pins ) I connect this pins to UART port of msp430f2274.same connection is made for master unit.

                    Now  my problem is there I cant made program for msp430f2274 which both transmit and receive the data from or to the  8051 UART and then give or take it to cc2500 which connected with it via spi. And I also cant create protocol for my wireless protocol..

                   I kindly request you to send a mail to  me  this transmit and receive program for ez430-rf2500 kit . this program is very necessary to complete my project so please help me. My e-mail address is jadavvirendra@yahoo.com.                                                          

                                                                                                                                                                                                                                                  Yours faithfully

                                                                                                                                                                                  Jadav virendra                                                                                                          

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Francisco Heredia
    Posted by Francisco Heredia
    on May 28 2009 19:17 PM
    Intellectual325 points

    Hello, 

     

    I don't know if you've managed to solve this problem but here are a few suggestions:

     

    When I implement a corresponding SMPL_Receive on the ED, what is the linkID that I have to supply at that time? 

    On the ED, there is only one linkID, I belioeve it is called LinkID1... that is the one you should use in SMPL_Receive in the ED code.

     

    I am making a connection between AP and ED using SMPL_Link and SMPL_LinkListen before and the AP is providing an incremental linkID to the ED. Do I have to use the same linkID when I implement SMPL_Receive at the ED?  Duh, didn't see it before, yes you use the same on the ED. On the AP, there is an array of LinkID's called sLID

    Also do I have to implement a call back function at the ED to service the retrieved frames?

    Yes, you have to implement the callback function just as in tha AP

    SMPL_SUCCESS!=SMPL_Send(sLID[sNumCurrentPeers],msgTx,sizeof(msgTx))

    if you use sNumCurrentPeers you will not send data to all the users that are connected to the Access Point. What you should do is a loop where you use each of the numbers in sLID, which contains every linkID for the current users.

    for i= 0:sNumCurrentPeers -1  // check the syntax for correct C language

    {

    SMPL_SUCCESS!=SMPL_Send(sLID[sNumCurrentPeers],msgTx,sizeof(msgTx))

    }

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • CP13052
    Posted by CP13052
    on Jul 10 2009 02:59 AM
    Prodigy220 points

    Hi

    i have the same problem, it doesn't seem so hard to solve but I'm pretty new to MCU programming:

    On the AP I implemented

          for (i=0; i<sNumCurrentPeers; ++i)
          {
            SMPL_SUCCESS == SMPL_Send(sLID[i],timeRef,sizeof(timeRef));
          }

    On the ED:

        if (SMPL_Receive(linkID1, msg, &len) == SMPL_SUCCESS)
        {
          TI_hour   =  msg[0];
          TI_minute =  msg[1];
          TI_second =  msg[2];
        }

    I don't know where the best place is to put the code (AP and ED)?
    so far i placed the AP code in the sjoin Semaphore and the ED code in the main workflow
    and also i don't know how to im implement the sCB callback function

    static uint8_t sCB(linkID_t lid)
    {
    ????????????
    }

    As you see i'm only trying to send the refernce time from the AP ot the ED...with my code like it isn't working, although the demo is running

    Any help is appreciated

    thanks
    Chris

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kjetil
    Posted by Kjetil
    on Jul 10 2009 03:23 AM
    Genius17795 points

    Hi.

    Does not matter where in the AP you put your code as long as the ED is in receive mode at the time on the SMPL_Send(). This leads me to the next thing. In the end device in the sensor demo, the ED is never in receive mode and will never receive what you try to send.  You set the ED in receive mode with the SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXON, "" );

    Remember that the SMPL_Receive function does not actually receive anything RF wise..it's just a matter of getting a already received message from the receive buffer. The callback function is a means in which you can make the application aware that a message was received and awaits being 'collected' by the SMPL_Receive function. This is similar to the callback function and how it is used in the AP (as a means for either notify that a device joined or that the AP received a message). You can see that the AP only does a SMPL_Receive when the sPeerFrameSem semaphore is set.

    In the end device you need a callback function that looks similar to the AP one..kind of like this:

    [code]
    /*******************************************************************************
    * Runs in ISR context. Reading the frame should be done in the
    * application thread not in the ISR thread.
    *******************************************************************************/
    static uint8_t sCB(linkID_t lid)
    {
      if (lid)
      {
        sPeerFrameSem++;
      }
      // leave frame to be read by application.
      return 0;
    }
    [/code]

     

    Hope this helps.
    Kjetil

    --
    PS. Thank you for clicking  Verify Answer  if this answered your question!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • CP13052
    Posted by CP13052
    on Jul 10 2009 04:24 AM
    Prodigy220 points

    Hi Kjetil,

    thanks for the quick answer.
    That's exactly my problem. How do i guarantee that the E Dis in receive mode when the AP is sending the message. I don't know how to do it?
    Is it possible for the ED to be in LPM§ mode and Receive mode?
    Also IAR doesn't recognize the IOCTL_ACT_RADIO_RXON identifier-->error.

    Perhaps you can give me some more detailed code.

    I would really appreciate that

    Thanks Chris

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kjetil
    Posted by Kjetil
    on Jul 10 2009 04:34 AM
    Genius17795 points

    What version of the temp sensor demo are you using?

    --
    PS. Thank you for clicking  Verify Answer  if this answered your question!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • CP13052
    Posted by CP13052
    on Jul 10 2009 04:45 AM
    Prodigy220 points

    Version    1.02

    i also read somewhere else that i have to change the ED in a polling device in  smpl_config.dat :    -DRX_POLLS 

    is that right?

    Chris

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kjetil
    Posted by Kjetil
    on Jul 10 2009 05:25 AM
    Genius17795 points

    Could not find a temp sensor demo that was based on 1.02, so i used the one located here:
    http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=slaa378b

    In the AP code, i added the following:

    [code]
        if (sPeerFrameSem)
        {
          uint8_t     msg[MAX_APP_PAYLOAD], len, i;

          // process all frames waiting
          for (i=0; i<sNumCurrentPeers; ++i)
          {
            if (SMPL_Receive(sLID[i], msg, &len) == SMPL_SUCCESS)
            {
              ioctlRadioSiginfo_t sigInfo;
              sigInfo.lid = sLID[i];
              SMPL_Ioctl(IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SIGINFO, (void *)&sigInfo);
              transmitData( i, (signed char)sigInfo.sigInfo.rssi, (char*)msg );
              BSP_TOGGLE_LED2();
              BSP_ENTER_CRITICAL_SECTION(intState);
              sPeerFrameSem--;
              BSP_EXIT_CRITICAL_SECTION(intState);
              SMPL_Send(sLID[i], msg, sizeof(msg));
            }
          }
        }
    [/code]

    This ensures that whenever a end device reports something, the access point will return a reply and thus the ED know that a answer is expected when it has sent something.

    The end device i modify to the following:
    [code]
          if (SMPL_SUCCESS == SMPL_Send(linkID1, msg, sizeof(msg)))
          {
            BSP_TOGGLE_LED2();
            SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXON, "");
            NWK_DELAY(1000);
            if (sPeerFrameSem )
            {
              SMPL_Receive(linkID1, rMsg, &len);
            }         
            SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXIDLE, "");

          }

    [/code]

    This turns the radio in receive mode after it has transmitted, waits 1000 msec and then check if it has received anything. If it has, it retrieves this message.

    You will also need the following:

    [code]
    /*------------------------------------------------------------------------------
    * Runs in ISR context. Reading the frame should be done in the
    * application thread not in the ISR thread.
    ------------------------------------------------------------------------------*/
    static uint8_t sCB(linkID_t lid)
    {
      if (lid)
      {
        sPeerFrameSem++;
      }
      // leave frame to be read by application.
      return 0;
    }
    [/code]

    Modify you SMPL_Init function to while (SMPL_NO_JOIN == SMPL_Init(sCB)) and declare all variables / functions and you should have a crude way of doing what you want to achieve.
    There is not need to enable the polling receiver. In the scenario of a polling receiver, the AP stores any message for this receiver and when the SMPL_Receive function is called at the receiver, this actually sends a request to the AP to return the next stored message if any.

    Please also not that the SimpliciTI is now in v1.1.0 which has even more functionality. Not sure of the temp sensor demo for this kit has been updated yet.

     

    --
    PS. Thank you for clicking  Verify Answer  if this answered your question!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • CP13052
    Posted by CP13052
    on Jul 10 2009 06:48 AM
    Prodigy220 points

    Hi Kjetil,

    it's still the same problem ...IAR doesn't know "IOCTL_ACT_RADIO_RXON"....

    and where/how in the ED code do i have to put the " while (SMPL_NO_JOIN == SMPL_Init(sCB)" ?

    The SMPL_Init (sCB) in the AP code should stay the same,right?

    Thanks a lot

    Chris

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Kjetil
    Posted by Kjetil
    on Jul 10 2009 06:54 AM
    Genius17795 points

    Well download the sensor demo from the link i posted. The old v1.02 did probably not support this IOCTL.
    In the downloaded code you replace the existing SMPL_Init code which does not provide a callback to the one i posted which does.

    No need to change anything in the AP.

    --
    PS. Thank you for clicking  Verify Answer  if this answered your question!

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Yuri Todorov
    Posted by Yuri Todorov
    on Aug 31 2009 13:41 PM
    Prodigy20 points

    Hi Kjetil,

     

    I find your posts very helpful but it's the first time I write here.

    I tried to run the new version 1.03 of the Sensor Monitor on the IAR Embedded Workbench Kickstart - Free 4KB IDE with the current v.5.20 of FET430 but the following message appeared:

    "The project file 'SimpliciTI Access Point.ewp' was created by a newer version of the product and can not be opened."

    I couldn't find a newer version of the IAR Embedded Workbench.

    Trying to use the previous Sensor Monitor v1.02 leads me to the same problem as Chris experienced -  not recognizing IOCTL_ACT_RADIO_RXON and IOCTL_ACT_RADIO_RXIDLE.

    Could you please advise what version of the software I should use or I should change the code you provided?

    Thanks,

    Yuri

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Yuri Todorov
    Posted by Yuri Todorov
    on Sep 07 2009 16:38 PM
    Suggested Answer
    Prodigy20 points

    Hey, I found out solution for the IOCTL_ACT_RADIO_RXON and IOCTL_ACT_RADIO_RXIDLE - you just have to put them in the nwk_types.h header file under "enum ioctlAction".

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Francisco Heredia
    Posted by Francisco Heredia
    on Oct 04 2009 03:05 AM
    Intellectual325 points

    Hello all,

     

    I lost my programas when my computer died! I am trying to reconstruct the bidirectional communication between AP and ED.

     

    What I have donde so far is:

     

    1.- Create a callback function in the ED, and SMPL_init(sCB)

    while (SMPL_NO_JOIN == SMPL_Init(sCB))

     

    //////////////////////Callback function service routine/////////////////////////

    static uint8_t sCB(linkID_t lid)
    {
     
     if (lid == linkID1)
     {

      bandera_recepcion = 1;
     }
       
     
     return 0; 
    }

     

    2.- Enable RADIO_RXON in the ED (not only radio awake, but in receive mode)

    SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_AWAKE, "" );
    SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_RXON, "" );
    while(1){ //infinite loop

    3.- SMPL_Send Message in the AP using SLID with a FOR cycle to send to every ED.

     for(i=0;i<sNumCurrentPeers;i++) 

          {
      
            while(!( SMPL_SUCCESS==SMPL_Send(sLID[i], mod ,sizeof mod) ) )
            {
            TXString("\n not yet",9);
            };   

    }   

    But whenever I try to send a message to the end devices, the message is not sent. even when the EDs are not sending anything.  It says "not yet" forever. I tried to check which was the mistake and the radio keeps saying the CCa has failed, but as I mention, no other radios are emitting. In fact, there is only one sensor, and the AP. Communication from the ED to the AP works correctly.

     

    Any help will be greatly appreciated

    Thanks

     

    Francisco

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Joel Parga
    Posted by Joel Parga
    on May 02 2012 13:12 PM
    Prodigy75 points

    Hello everyone,

    Do anyone got this multi ED to one AP working both ways?

    I follow this post steps by steps and still is not working.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use