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.

Problem porting the EZ430-RF2500 Sensor Demo code to CCE

Other Parts Discussed in Thread: SIMPLICITI, MSP430F2274, CC2500, CC1100

The build dies on the following lines:

__no_init volatile char Flash_Addr[4] @ 0x10F0; // Flash address set randomly
__no_init volatile int tempOffset @ 0x10F4; // Temperature offset set at production

So what is the CCE equivalent of these lines? Do I just remove the "__no_init" part since CCE does not init variables by default?? It also looks like it does not like the @ 0x10F4 and @ 0x10F0 which I assume are assigning hw locations for these "variables". What is the proper way to set HW locations in CCE?

  • The Demo code has already been ported. Please check this forum post for more information.

    Forum Post

    Download Link for demo code

    SimpliciTI 1.0.6 CCE Port

  • I already have the SimpliciTI 1.0.6 CCE port files on my system. What I am trying to do is port the EZ430-RF2500 Sensor Demo app to CCE, which is not included as demo code in SimpliciTI. After following the porting instructions, I still get an error (see my previous post) because CCE has a different method of setting HW locations for variables( vs IAR). What would be nice would be to have a document that shows what the differences are between CCE and IAR compilers and what you need to do to port code between them..

  • Following porting instructions, I was able to port EZ430-RF2500 Sensor Demo app to CEE with SimpliciTI 1.0.6. I add oversampling to ED and AP ADC values in order to have more stable

    temperature values.

    Concerning the line :

    __no_init volatile char Flash_Addr[4] @ 0x10F0; // Flash address set randomly

    I translate it with :

     

     

     

     

     

     

     

    char

     

     

    char

     

     

    Flash_Addr[4];
    *PtrFlash;

    PtrFlash = (

    char *)0x10F0;

     

    Flash_Addr[0] = (

    char)(*PtrFlash++);

    Flash_Addr[1] = (

    char)(*PtrFlash++);

    Flash_Addr[2] = (

    char)(*PtrFlash++);

    Flash_Addr[3] = (

    char)(*PtrFlash);

    and line :

    __no_init volatile int tempOffset @ 0x10F4; // Temperature offset set at production

    with :

    int

     

    *PtrIntFlash;

    PtrIntFlash = (

    int *)0x10F4;

    tempOffset = (

    signed char)(*PtrIntFlash);

    There is certainly another way to do it under CCE, but at least it is OK.

    Jean-Pierre

     

  • Sorry, it is my first post and it looks really ugly!

    Jean-Pierre

  • Like this, right?

    char *PtrFlash;
    char Flash_Addr[4];

    PtrFlash = (char *)0x10F0;
     
    Flash_Addr[0] = (char)(*PtrFlash++);
    Flash_Addr[1] = (char)(*PtrFlash++);
    Flash_Addr[2] = (char)(*PtrFlash++);
    Flash_Addr[3] = (char)(*PtrFlash);

    int *PtrIntFlash;

    PtrIntFlash = (int *)0x10F4;
    tempOffset = (signed char)(*PtrIntFlash);

    Thanks Jean, I figured I would have to use pointers somehow.

    jpbusb said:

    Sorry, it is my first post and it looks really ugly!

    Jean-Pierre

    Yeah, I found the forum has problems with cutting and pasting directly from the C-editor. I ended up cutting and pasting into notepad first to strip all the formatting and then cutting and pasting from notepad into the forum.

  • Yes, it was exactly what I wrote with cutting and pasting from eclipse editor! Thanks a lot for your formatting.

    Jean-Pierre

  • im curious. How did you oversample with the code u used? Sorry, i just started programming on embedded chips.

  • Found what looks like a simpler way to do this:

      volatile char *Flash_Addr[4]= {(char *)(0x10F4),(char *)(0x10F5),(char *)(0x10F6),(char *)(0x10F7)} ;
      volatile unsigned int *tempOffset = (unsigned int *)(0x10F0);

    and then add a pointer dereference '*' to the names in the code like this:

    Addr.addr[0]= *Flash_Addr[0];

    It compiles, at least. And I don't have to waste code space initializing the pointers.

    But now I am having trouble with the vlo_rand.h and vlo_rand.s43 files. These are IAR formatted assembly language files, and I can't seem to find any information on how to port IAR compatible assembly files to CCE.

  • Hello Alfred, here is how I did it in ED :

    I defined an array of 20  int (named results) and I fill this array each time MSP430 wakes up. When this array is full, I wake-up radio, average values and send result to AP.

    Here is my modified linkTo function :

    void linkTo(void)
    {
          linkID_t linkID1;
          uint8_t  msg[3];
        unsigned char index = 0;
       
      // keep trying to link...
      while (SMPL_SUCCESS != SMPL_Link(&linkID1))
      {
        __bis_SR_register(LPM3_bits + GIE);     // LPM3 with interrupts enabled
        BSP_TOGGLE_LED1();
        BSP_TOGGLE_LED2();
      }
      
      // Turn off all LEDs
      if (BSP_LED1_IS_ON())
      {
        BSP_TOGGLE_LED1();
      }
      if (BSP_LED2_IS_ON())
      {
        BSP_TOGGLE_LED2();
      }
     
        SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SLEEP, "" );
       
      while (1)
      {
        volatile long temp;
        int degC, volt;
        int results[20];
       
        __bis_SR_register(LPM3_bits+GIE);       // LPM3 with interrupts enabled
      
    //    BSP_TOGGLE_LED2();
        ADC10CTL1 = INCH_10 + ADC10DIV_4;       // Temp Sensor ADC10CLK/5
        ADC10CTL0 = SREF_1 + ADC10SHT_3 + REFON + ADC10ON + ADC10IE + ADC10SR;
        for( degC = 240; degC > 0; degC-- );    // delay to allow reference to settle
        ADC10CTL0 |= ENC + ADC10SC;             // Sampling and conversion start
        __bis_SR_register(CPUOFF + GIE);        // LPM0 with interrupts enabled
        results[index++] = ADC10MEM;
       
        ADC10CTL0 &= ~ENC;
       
        ADC10CTL1 = INCH_11;                     // AVcc/2
        ADC10CTL0 = SREF_1 + ADC10SHT_2 + REFON + ADC10ON + ADC10IE + REF2_5V;
        for( degC = 240; degC > 0; degC-- );    // delay to allow reference to settle
        ADC10CTL0 |= ENC + ADC10SC;             // Sampling and conversion start
        __bis_SR_register(CPUOFF + GIE);        // LPM0 with interrupts enabled
        results[index++] = ADC10MEM;
        ADC10CTL0 &= ~ENC;
        ADC10CTL0 &= ~(REFON + ADC10ON);        // turn off A/D to save power
       
        if (index == 20) {
             BSP_TURN_ON_LED2();
            SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_AWAKE, "" );
     
            // oC = ((A10/1024)*1500mV)-986mV)*1/3.55mV = A10*423/1024 - 278
            // the temperature is transmitted as an integer where 32.1 = 321
            // hence 4230 instead of 423
            temp = 0;
              for (index = 0; index<20; index += 2) temp += results[index];
              degC = (((temp - 10*673) * 423) / 1024);
            if( tempOffset != 0xFFFF )
            {
              degC += tempOffset;
            }
            /*message format,  UB = upper Byte, LB = lower Byte
            -------------------------------
            |degC LB | degC UB |  volt LB |
            -------------------------------
               0         1          2
            */
           
            temp = 0;
              for (index = 1; index<20; index += 2) temp += results[index];
            volt = (temp*5)/1024;
            msg[0] = degC&0xFF;
            msg[1] = (degC>>8)&0xFF;
            msg[2] = volt;
       
            if (SMPL_SUCCESS == SMPL_Send(linkID1, msg, sizeof(msg)))
            {
                    BSP_TURN_OFF_LED2();
              //BSP_TOGGLE_LED2();
            }
            else
            {
              BSP_TOGGLE_LED2();
              BSP_TOGGLE_LED1();
            }
              index = 0;
             SMPL_Ioctl( IOCTL_OBJ_RADIO, IOCTL_ACT_RADIO_SLEEP, "" );
           }
        }
    }

     

    Jean-Pierre

  • Hi,

    I am also trying to port the tez430-rf2500 temp sensor demo code from iar to cce. I came across this forum and am assuming you must have already ported the code long ago :-) . The problem I am having is with the timer_AO interrupt. Somehow after enabling the interrupt, the program just stops there and does not enter the interrupt every 1 second as it should. Can you help me??

     

     

     

    #pragma vector=TIMERA0_VECTOR
    __interrupt void Timer_A(void)
    {
      sSelfMeasureSem = 1;
    }

     

     

     

     

    Falingtrea said:

    Found what looks like a simpler way to do this:

      volatile char *Flash_Addr[4]= {(char *)(0x10F4),(char *)(0x10F5),(char *)(0x10F6),(char *)(0x10F7)} ;
      volatile unsigned int *tempOffset = (unsigned int *)(0x10F0);

    and then add a pointer dereference '*' to the names in the code like this:

    Addr.addr[0]= *Flash_Addr[0];

    It compiles, at least. And I don't have to waste code space initializing the pointers.

    But now I am having trouble with the vlo_rand.h and vlo_rand.s43 files. These are IAR formatted assembly language files, and I can't seem to find any information on how to port IAR compatible assembly files to CCE.

     

     

     

  • Earlier today, TI announce the new eZ430-RF2500-SEH Solar Energy Harvester kit which includes an enhanced version of the Sensor Monitor Demo for both IAR and CCE.  You can use the project as-is with the existing eZ430-RF2500 or you could replace the main application file with the one from the old tool.  Hope this helps.

     

  • Thanks adrian!! That code release had what I needed to get my ported code to compile. I'm going to need to look at the vlo_rand.asm file and see what is different in it, from the original vlo_rand.s43 file.

    Looks like they included the C source code for the PC side as well. I don't remember seeing that source code in the original sensor package.

  • porting the asm files was relatively straight forward.  the majority of the changes were in the top of the file.  assembly instructions are assembly instructions so they don't need to be altered.  if you compare any two ASM code examples, the differences should be apparent.

    Falingtrea said:
    Looks like they included the C source code for the PC side as well. I don't remember seeing that source code in the original sensor package.

    that's right!  this is the first time that we've released the source code and documentation on how to rebuild the project.  it was build entirely out of open source components so everyone can reuse the code.

  • Hi,

    Thanks a lot for your help! My ported code is finally working! Apparentely the only problem with my code was that I was using TImer_A instead of Timer_B for the interrupts. After changing to Timer_B, it started working immediately.  However, I am not sure why this is so. Why can't Timer_A be used instead (just like in IAR)??

    -Komal

  • komal said:
    Why can't Timer_A be used instead (just like in IAR)??

    The MSP430 peripherals, including the timers, can be used the asme way in both IDEs.  If one timer worked instead of another, it is most likely a configuration problem.

  • komal said:

    Hi,

    Thanks a lot for your help! My ported code is finally working! Apparentely the only problem with my code was that I was using TImer_A instead of Timer_B for the interrupts. After changing to Timer_B, it started working immediately.  However, I am not sure why this is so. Why can't Timer_A be used instead (just like in IAR)??

    -Komal

    I think the vlo_rand code uses timerA, so that may be why you were having problems.

     

  • Given that the vlo_rand function should only be called at the beginning of the app to get the random address, I cannot see how using Timer_A then affects the later code.

    However, I do know that SimpliciTI also uses Timer_A for its NWK_DELAY macro. NWK_DELAY is a wrapper for the MRFI_DelayMs function which calls the Mrfi_DelayUsecSem function, which in turn calls the BSP_DELAY_USECS macro, a wrapper for the BSP_Delay function found in bsp_board.c (in the case of the EZ430RF and EXP461x boards) and it is this function that uses Timer_A. This delay code is used in SMPL_LinkListen in nwk_api.c.

    As for the question, why does it work in IAR and not in CCE? I presume there is a bug in the port, just like the one I found that hardwired SimpliciTI to the MSP430F2274 used in the eZ430. Anyone want to track it down?

    Bottom line: don't use Timer_A for your own code, use Timer_B!

    I know that either the AP or the ED worked using Timer_A in my own port of the demo code, but I cannot remember which. In my own code I now use Timer_B to avoid problems with NWK_DELAY (which I also use).

    Derek

  • Just a quick post to thank you all for starting this thread, for mentioning the port of SimpliciTi to CCE, for the help with the TimerB instead of TimerA issue and for all the other ideas. I started looking into the CCE port a couple days ago and after reading this thread (and some of adrian and Brandon's posts in other threads that helped me with the upgrade to CCE v3.1) now I have a working AccessPoint (using the code in the new SEH project) and EndDevice (using the old code in the IAR demo that I changed by myself following the helpul hints in these posts).

    I apologize for not naming each one of you but really, all posts were great. You guys rock! Thank you!

  • glad we could help! [Y]

  • Hey everybody,

     

    i'am also trying to port the demo sensor application to the CCE - environement. I already implemented the sourced
    simpliciTI-code.

    But i'am also having still a few problems with the vlo.s43 and vlo_rand.h. On this forum, they said it could be solved
    by reading this post but i don't see it. This is only the code used for the application running on my PC(sensor monitor). It's not like
    source-code in C. Can anybody bring me on the right way?

    Kind Regards

  • I was also confused at first when I downloaded slac219 and found C++ code inside for the PC app. Then I dug a little more and I discovered the port inside SEH-firmware-install.exe (I hope I remember correctly the name of the executable). Install this one and you should get the SimpliciTi port and also the access point and end point code. I hope this helps.

  • Hey Beginner,

    thanks a lot for responding so fast. And indeed, your where right. I first had to execute the
    installer where you remember the name correctly:-)

    But now, i have the ported simpliciTI-code and the ported sensor-application code. How do i bring
    these two with each other? Or do i just have to open the sensor-application workspace?

    Thanks in advance

    Best Regards

  • What I did was to open the sensor code in a new workspace and then I added my own c source files to it. The other alternative is to follow the steps in this forum post.

  • Hey,

    that's exactly what i also did. But the readme writes the following lines:

    1) |- Extract these files to 'c:\Texas Instruments' or run the Sensor Monitor setup program (SLAC219)
    2) |- Open CCE v3
    3) |- Open the workspace
    3a)|-- If the files are located at 'c:\Texas Instruments\', select
             'C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.3\CCE_Source\Projects\Examples\peer_applications\eZ430RF' as your workspace.  
         |--Skip to step 5.
    3b) Select the <extract location>\Projects\Examples\peer_applications\eZ430RF" as your workspace
         |-- When prompted for the workspace directory, find the 'eZ430RF' folder.
       |-- This will be referred to in this documentation as your SimpliciTI root directory, or your "DEV_ROOT" directory
       |-- Select the "DEV_ROOT\Projects\Examples\peer_applications\eZ430RF" directory
       |-- Click "OK"

    But there are a lot of files that don't get linked in the CCE-workbench. For example: my directory's under components are empty(bsp, mrfi,...). Is this normal and should i link them manually? This would be possible but strange if the readme doesn't say anything about this.

    Best Regards

  • There is indeed an error in the document and it took me a while to figure it out, luckily the original steps (in the forum post I referred to) were correct and that helped. Where it says:

    Select the <extract location>\Projects\Examples\peer_applications\eZ430RF" as your workspace
         |-- When prompted for the workspace directory, find the 'eZ430RF' folder. 
       |-- This will be referred to in this documentation as your SimpliciTI root directory, or your "DEV_ROOT" directory 

    the correct text in my opinion should be like in the original steps, something like 'the <extract location> will be referred as DEV_ROOT' and not the entire path all the way down to the 'eZ430RF' folder. So, if you installed in a different folder, you may have problems with the DEV_ROOT.

    Anyway, I have the same as you, some empty directories I guess because they are linked. The real directories are under the Includes.

    However, even with emtpy directories it should work. What I did, if I remember all the steps was:

    a) install the firmware under the suggested dir C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.3
    b) opened Eclipse (CCE I mean) and chose the workspace as being 'C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.3\CCE_Source\Projects\Examples\peer_applications\eZ430RF'
    c) nothing worked :-(

    Then I downloaded CCE v3.1 and after messing about a lot with installing it / uninstalling it / cleaning up the old CCE v3.0 installation / reinstalling it, I followed the same a) and b) steps and it finally worked fine. After that, I messed around with the settings of the project because I added the old IAR source files in the new CCE structure and made it work.

    Basically what I mean is that if you have a clean installation of CCE v3.1 and you install the firmware in the suggested dir, you should be able to compile the code that comes with the project without problems. Do you get any errors at compile or link time?

  • beginner said:
    hen I downloaded CCE v3.1 and after messing about a lot with installing it / uninstalling it / cleaning up the old CCE v3.0 installation / reinstalling it, I followed the same a) and b) steps and it finally worked fine. After that, I messed around with the settings of the project because I added the old IAR source files in the new CCE structure and made it work.

    we didn't realize it at the time the user guide was created but the SEH demo code only works with CCE v3.1 or higher.  the user guide is being updated to reflect that.  the new version should be online shortly.

    beginner said:
    There is indeed an error in the document and it took me a while to figure it out, luckily the original steps (in the forum post I referred to) were correct and that helped.

    we've also change the whole process to import a project.  opening an existing Eclipse/CCE workspace is bad practice.  it's similar to trying to import the windows registry from one PC and expecting it to work an another computer.   the correct way to open the project is to import the project  (Project > Open Existing Project). 

    the new steps in the user guide will read:

    1.       Open Code Composer Essentials v3.1

    2.       Open any available Workspace

    3.       Import the project to your workspace

    a.       Click on Project > Open Existing Project > Browse

    b.       Navigate to the source code location.  The default location is C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.5\CCE_Source

    c.        Make sure “SEH Sensor Monitor” is selected under Projects

    d.       Click Finish

    4.       Set up the  Linked Resources

    a.       Navigate to "Window > Preferences... > General > Workspace > Linked Resources.”

    b.       Click on New…

    c.        In the Name field enter “DEV_ROOT”

    d.       Click on the “Folder…” button and navigate to your source code installation root.  The default location is “C:\Texas Instruments\eZ430-RF2500-SEH_Sensor_Monitor-v1.5\CCE_Source”. 

    Please note that if you upgrade to a newer version of the Sensor Monitor demo, the version number must be reflected in the DEV_ROOT location.

    e.       Click "OK" twice until you are back at the original CCE screen.

     

     

     

     

     

  • The new steps sound great and they will save a lot of time to newcomers. If you don't mind and have a moment, please let us know when the new guide will be up. I already have the code working but I'd like to give it a try following the new steps. Thanks, adrian!

  • Hey,

    you guys are wonderfull!! Thanks for the explenation beginner and thanks for the golden tip Adrian;-)

    I could implement the project in no time into my CCE. After doing this, i still have one question:

    if i change the code back to the sensor demo code that i used in IAR, i got some errors about this line:

    __no_init volatile char Flash_Addr[4] @ 0x10F0; // Flash address set randomly

    In the post above, there's a little discussion about it but it's not complete clear for me?
    Can i just copy the code out of IAR and play with the settings like you said beginner or do i have to do something else before?

    Best Regards

  • To solve this one, either use the code posted at the beginning of this thread by jpbusb and Falingtrea, or you could look at the way it's done in the new SEH demo code. For the Flash_Addr you could use at the beginning of the main() function:

      char *Flash_Addr;
      addr_t lAddr;
      Flash_Addr = (char *)0x10F0;

    instead of just the   addr_t lAddr; line.. Also, same this in createRandomAddress() function, add the same 2 new lines before and after   unsigned int rand, rand2;:

      char *Flash_Addr;
      unsigned int rand, rand2;
      Flash_Addr = (char *)0x10F0; 

    For the tempOffset, I added these 2 new lines at the beginning of the while (1) loop in linkTo() function, after the declaration of     int results[2];:
        int *tempOffset;                      // Initialize temperature offset
        tempOffset = (int *)0x10F4;           // coefficient
     and later change the tempOffset with *tempOffset, like:
        if( *tempOffset != 0xFFFF )
        {
          degC += *tempOffset;
        }
    Last thing you'll need to do is to use TimerB instead of TimerA as suggested by several posters in this thread.
    I hope I didn't forget any other changes.

  • Hi,

    thanks for replying again. What i did was the following:

    I change this line: __no_init volatile char Flash_Addr[4] @ 0x10F0; // Flash address set randomly
    by: volatile char *Flash_Addr[4]= {(char *)(0x10F4),(char *)(0x10F5),(char *)(0x10F6),(char *)(0x10F7)} ;

    These lines: if( Flash_Addr[0] == 0xFF &&
          Flash_Addr[1] == 0xFF &&
          Flash_Addr[2] == 0xFF &&
          Flash_Addr[3] == 0xFF )
      {
        createRandomAddress();                  // set Random device address at initial startup
      }

    I changed like this: if( Flash_Addr[0] == (char *)0xFF &&
          Flash_Addr[1] == (char *)0xFF &&
          Flash_Addr[2] == (char *)0xFF &&
          Flash_Addr[3] == (char *)0xFF )
      {
        createRandomAddress();                  // set Random device address at initial startup
      }

    I changed this lines:lAddr.addr[0]=Flash_Addr[0];
      lAddr.addr[1]=Flash_Addr[1];
      lAddr.addr[2]=Flash_Addr[2];
      lAddr.addr[3]=Flash_Addr[3];

    by: lAddr.addr[0]=*Flash_Addr[0];
      lAddr.addr[1]=*Flash_Addr[1];
      lAddr.addr[2]=*Flash_Addr[2];
      lAddr.addr[3]=*Flash_Addr[3];

    And at least i changed:

    Flash_Addr[0]=(rand>>8) & 0xFF;
      Flash_Addr[1]=(rand & 0xFF;
      Flash_Addr[2]=(rand2>>8) & 0xFF;
      Flash_Addr[3]=rand2 & 0xFF;

    by:

    Flash_Addr[0]=(char *)((rand>>8) & 0xFF);
      Flash_Addr[1]=(char *)(rand & 0xFF);
      Flash_Addr[2]=(char *)((rand2>>8) & 0xFF);
      Flash_Addr[3]=(char *)(rand2 & 0xFF);

    For the rest, i copied the ED_SensorApplication from IAR to the CCE end file. When i compile, i don't have errors but i can only read something that the AP sends on the com-port. It seems like the ED doesn't connect. Is my changing correct or do i still have to change something?

    Best Regards

  • I had the same problem at some point, everything seemed to be fine but it didn't work. Did you make the change from TimerA to TimerB? There was a discussion in this thread about this and DerekC explained why TimerB has to be used instead of TimerA, otherwise it won't work.

  • Hey beginner,

    before i readed you last post, i was able to port everything. I changed the timerA but i didn't changed the interrupt.

    Very important as well:-). Now everything works perfectly!!! Thanks a lot for you patience.

    Is it necessary to post my ED_file on this forum? I'am willing to do this because the support is SUPER here on this forum.

    Regards

  • Glad I could help. You are right: the guys helping in these forum are awesome, I received tons of great help from Brandon, adrian and many more I apologize for not naming. As a side note, I tried to learn other microcontrollers before and I couldn't find such great advice and especially patience for my questions.

    I don't know what the rules about posting the code are, probably adrian will be able to answer that.

  • beginner said:
    I don't know what the rules about posting the code are, probably adrian will be able to answer that.

    right now, only moderators can attached code directly to posts, but you should be able to add files to your user profile  under "My Files" and then link to the file in the post.  If you click on your user name, then "My files" you should get to the screen to upload content.   make sense?

    for example, there is nothing in there right now but this is beginner's Files.

     

  • Hey Adrian,

    thanks for responding. I did make sense. Everybody can take the completly working sensor demo-code ported tot CCE from my personal files at this link: driesione's Files

    This code is programmed with two buffers and with a payload of 50 bytes. I will also upload only the working ported ED-file without changing anything else

    Kind Regards

     

  • Hello Everyone!!

     

     

    I have been reading this thread and it has been very helpful.  My code already compiles sucessfully on CCE. I adapted my code from IAR with your suggestions.

    Already did the changes for the absolute directions that addr uses.. 

    However, when I try to run the code it just freezes. On the debugger the application is running but on the ez430RF2500 it is frozen. I suppose my mistake is in the change from timer A to B: what I did was..

     

    from:

     

      BCSCTL3 |= LFXT1S_2;                      // LFXT1 = VLO

      TACCTL0 = CCIE;                           // TACCR0 interrupt enabled

      TACCR0 = contador_normal;

      TACTL = TBSSEL_1 + MC_1;                  // ACLK, upmode

     

    to:

     

      BCSCTL3 |= LFXT1S_2;                      // LFXT1 = VLO

      TBCCTL0 = CCIE;                           // TACCR0 interrupt enabled

      TBCCR0 = contador_normal;

      TBCTL = TBSSEL_1 + MC_1;                  // ACLK, upmode

     

     


    and from:

     

     

    #pragma vector=TIMERA0_VECTOR

    __interrupt void Timer_A (void)

    {

      __bic_SR_register_on_exit(LPM3_bits);        // Clear LPM3 bit from 0(SR)

    }

     

    to:

     

    #pragma vector=TIMERB0_VECTOR

    __interrupt void Timer_B (void)

    {

      __bic_SR_register_on_exit(LPM3_bits);        // Clear LPM3 bit from 0(SR)

    }

     

     

     

     

     

     

     

     

    Is this ok? am I missing something? I assume these changes must be made for the AP as well as the ED. Perhaps I am missing something. I checked driesione's code (thank you!) and it seems like everything's ok..  if the timer is correctly configured then I don't know what could be the problem.

     

    Any help will be much appreciated.

     

    Regards,

     

    Francisco

  • UPDATE!

     

     

    So I managed to run correctly the AP, it was only a small detail with the sSelfMeasurement Flag. There it goes!

     

    Now I have another problem. The ED is not linking correctly to a network. Could this be a problem of Addresses?  I recall reading somewhere that one must change the hardware address (?) in some file. I don't remember having to do this in IAR, but perhaps CCE has to. Could anybody help me with this?

     

    In the debugger, the ED stays forever in this line:

     while (SMPL_SUCCESS != SMPL_Link(&linkID1))

      {

        __bis_SR_register(LPM3_bits + GIE);     // LPM3 with interrupts enabled

        BSP_TOGGLE_LED2();

      }

     

    Like waiting for the AP to respond and grant access to the network? I will continue trying. If anyone has a suggestion it will be very helpful...

     

    Regards, 

     

    Francisco

  • Hi,

    I got the same problem. My ED is not connecting. I can compile the code without any error though.
    I'm using  the SEH Sensor Monitor 1.5 demo project but with the ported and corrected demo AP and  demo ED files of an older IAR demo (with minor changes in the code which shouldn't affect the linking of the ED)).
    The AP is sending messages to the COM port but the ED is not lionking

    Did anybody solve this problem?

     

    cheers

    Chris

     

  • Hello CP,

     

     

    A couple of things to try:

     

     

    1) Did you check that the hardware addresses were different for each device. I believe this is within the smpl_nwk_config file for every device. If its not there, check in smpl_config, but I'm pretty sure it's in the first one. 

     

    2)In the "Project" Menu try cleaning the project and rebuilding all between devices. Just to make sure the addresses are different.

     

  • Hi Francisco,

    the cleaning didn't help and in the smpl_nwk_config and smpl_config I don't where i can set the hardware adresses

    any ideas?

    Thanks Chris

  • Hello Chris, 

     

    below is a sample of the section you need to change. I found it in "smpl_config.dat"

     

    /* This device's address. The first byte is used as a filter on the CC1100/CC2500

     * radios so THE FIRST BYTE MUST NOT BE either 0x00 or 0xFF. Also, for these radios

     * on End Devices the first byte should be the least significant byte so the filtering

     * is maximally effective. Otherwise the frame has to be processed by the MCU before it

     * is recognized as not intended for the device. APs and REs run in promiscuous mode so

     * the filtering is not done. This macro intializes a static const array of unsigned

     * characters of length NET_ADDR_SIZE (found in nwk_types.h). The quotes (") are

     * necessary below unless the spaces are removed.

     */

    -DTHIS_DEVICE_ADDRESS="{0x60, 0x56, 0x34, 0x12}"

     

     

     

    Make sure each device has a different address. You need to clean an rebuild the whole project for each device just to make sure each one of them changes address. 

     

    Hope this helps

  • In my project it's like that

    smpl_nwk of the AP:

    --define=THIS_DEVICE_ADDRESS="{0x78, 0x56, 0x34, 0x12}"

    smpl_nwk of the ED:

    --define=THIS_DEVICE_ADDRESS="{0x79, 0x56, 0x34, 0x12}"

    the addresse are different so i guess that's OK?

     

     

     

  • Hello Chris. 

    Did you start modifying from the Solar HArvesting DEmo? Or were you working with a previous version of it, and changed to a newer compiler/code?

    Also, what compiler are you using? CCE or IAR?

     

    Regards

     

  • Hi all,

    in my personal files, i included the ported project.

    You just have to download it and change the code to your own needs.

    Ciao

  • Hi Francisco,

     

    I'm working with the Solar Harvesting Demo v.1.5 as the basis and the CCEv3.1 compiler. But I don't have the Solar kit just  the AP and some battery packs.What i wanted to do is take this project (because i need CCE because of the code size limitations of IAR)  and change the AP.c and ED.c  files with my modified files---> ED didn't connect.Now I tried the code that comes with the demo (SEH_AP_v1.5.c and SEH_ED_v1.5.c), but it's still the same problem the ED doesn't connect. I didn't change anything just loaded the code  on the AP and  the respective one on the ED.....what am i doing wrong?

    Regards

**Attention** This is a public forum