• 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 » Microcontrollers » MSP430™ Microcontrollers » MSP430 Ultra-Low Power 16-bit Microcontroller Forum » IAR build for different MSP430s
Share
MSP430™ Microcontrollers
  • Forum
  • Announcements
  • E2E Wiki
Options
  • Subscribe via RSS
MSP430 Resources
  • MSP430 Product Folder
  • MSP-EXP430G2 - MSP430 LaunchPad Value Line Development kit
  • MSP430 Getting Started Guide
  • MSP430 Microcontroller Projects
  • More Resources >
  • IAR build for different MSP430s

    IAR build for different MSP430s

    This question is not answered
    Leonardo Estevez
    Posted by Leonardo Estevez
    on Apr 30 2012 10:23 AM
    Prodigy130 points

    Hi,

    I'm new to MSP430 and IAR development and I want to port an EXP5438 project to EXP5529. I noticed there are two files: a .sfr and a .ddf file which seem to be specific to the processor along with various .h files specific to the board's peripherals. Where (or in what file) do I tell IAR to use the 5529 versions of these files?

    BR,
    Leo

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    All Replies
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on Apr 30 2012 12:23 PM
      Guru139970 points

      IMHO it's best to open a new project and copy just the plain source code into it.

      Keep in mind that teh new processor doesn't have all the peripherals the 5438 had (especially not the USCI 2+3).

      You'll need to change the included header file name in your source code to match these changes (and maybe have to sort out any compilaiton errors due to no longer existing or renamed registers).

      The board-specific header files usually belong to board-specific code files (and won't work on a different board at all) or a board-specific library (which also won't work ona different board).

      So depending on what MSP-internal and board-external features your original project used, this migration might be a larger project.
      And you're the only one who knows the details.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Leonardo Estevez
      Posted by Leonardo Estevez
      on May 02 2012 16:03 PM
      Prodigy130 points

      Hi,

      My initialization code is quite simple for exp5438(see below).  When I try to build the project for 5529, it complains about not having the definition of  XT1LFOFFG. Should this code be the same for 5438 versus 5529? When I try to go to the declaration, CCS opens the msp5438a.h include file instead of msp5529.h - but there is no reference to including these files in any of my code - is this a CCS problem?  How would I need to change below code to properly initialize the 5529?

      /*******************************************************************************
      * @brief  Setup all the peripherals of the MSP. This is for TI sensors
      The DCO is set at 8MHz, the 32KHz is started and the WDT is at 1 sec.
      *         (MSP430F5438 version)
      * @param  none
      *
      * @return none
      *******************************************************************************/
      void MSP_Setup(void) {
       
        // Enable the interupts on port 2 to catch the user button (TRXEB)
        //P2DIR &= ~BIT3;                         // Set P2.7 to output direction
        //P2OUT =   BIT3;                         // Set P2.7 to output direction
        //P2IE  |=  BIT3;                         // P2.7 interrupt enabled
        //P2IES |=  BIT3;                         // P2.7 Hi/lo edge
        //P2REN |=  BIT3;                         // P2.7 Pull up resistor
        //P2IFG &= ~BIT3;                         // P1.2 IFG cleared

        // Enable the interupts on port 2 to catch the user button (Exp5438)
        P2DIR &= ~BIT7;                         // Set P2.7 to output direction
        P2OUT =   BIT7;                         // Set P2.7 to output direction
        P2IE  |=  BIT7;                         // P2.7 interrupt enabled
        P2IES |=  BIT7;                         // P2.7 Hi/lo edge
        P2REN |=  BIT7;                         // P2.7 Pull up resistor
        P2IFG &= ~BIT7;                         // P1.2 IFG cleared

       
        // Setup the XTAL ports to use the external 32K oscillilator 
        P7SEL |= 0x03;                            // Select XT1
        UCSCTL6 |= XCAP_3;                        // Internal load cap
       
        // Loop until XT1,XT2 & DCO stabilizes
        do  {
          UCSCTL7 &= ~(XT2OFFG + XT1LFOFFG + XT1HFOFFG + DCOFFG);
          // Clear XT2,XT1,DCO fault flags
          SFRIFG1 &= ~OFIFG;                      // Clear fault flags
        } while (SFRIFG1&OFIFG);                  // Test oscillator fault flag
        UCSCTL6 &= ~(XT1DRIVE_3);                 // Xtal is now stable, reduce drive
       
        // Set up clock system on MCU to fit your system
        // Target specific implementation
        UCSCTL0 = 0x00;                           // Set lowest possible DCOx, MODx
        UCSCTL1 = DCORSEL_4;                      // Select suitable range 
        UCSCTL2 = 244 ;                           // DCO = 244 * 32768Hz ~= 8MHz
        UCSCTL4 = SELA__XT1CLK | SELS__DCOCLK | SELM__DCOCLK ;
       
        // Setup Watch dog timer for 1 second tick using 32Khz XTAL on CC430
        WDTCTL = WDT_ADLY_1000;                    // WDT 15.6ms, ACLK, interval timer
        SFRIE1 |= WDTIE;                           // Enable WDT interrupt
      }
      #endif

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

      Hi Leonardo,

      The compiler should be complaining about XT1HFOFFG instead of the LF flag, since the MSP430F5529 does not have HF support on XT1. You should remove the test for that flag for the part of your code which targets the F5529.

      Tony

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Leonardo Estevez
      Posted by Leonardo Estevez
      on May 03 2012 10:30 AM
      Prodigy130 points

      Hi Tony,

      Yes - that's what I meant - I deleted it - but it didn't help - I need the 32K clock running - any suggestions or code on how to get it running for 5529?

      BR,
      Leo

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on May 04 2012 07:42 AM
      Guru139970 points

      Leonardo Estevez
        UCSCTL1 = DCORSEL_4;                      // Select suitable range 

      Have you checked whether DCORSEL_4 is the proper range for 8MHz on the new MSP? the rnges differe between different MSPs.

      However,

      Leonardo Estevez
      Should this code be the same for 5438 versus 5529? When I try to go to the declaration, CCS opens the msp5438a.h include file instead of msp5529.h
      That is what 's really puzzling me. Did you change the project target to the new processor? Maybe your project still ahs 'internal' references to the original target processor.
      That's why I suggested creating a new, empty project for the 5529, then importing the old code into it.

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Leonardo Estevez
      Posted by Leonardo Estevez
      on May 04 2012 12:33 PM
      Prodigy130 points

      Hi Jens-Michael,

      I copied and pasted the relevant code from the MSP430 example for LPM and it works now - it looks like an extra inline _nop is required for 5529.  On another more important note. I am looking at porting Contiki to 5529 and found some blogs in 2010 about some students doing this but running into tool chain issues.  Do you know if there is a port somewhere or if these gcc issues have been resolved? http://comments.gmane.org/gmane.os.contiki.devel/5247

      BR,
      Leo

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    • Jens-Michael Gross
      Posted by Jens-Michael Gross
      on May 04 2012 18:05 PM
      Guru139970 points

      Leonardo Estevez
      Do you know if there is a port somewhere or if these gcc issues have been resolved?

      These weren't actually GCC issues.

      MSPGCC is a separate compiler based on GCC. To do its job, it has to know the target processor, whether it has a 32bit or 16 bit or no hardware multiplier, the memory layout etc. At the time they tried to port the project, the 5529 was unknown to MSPGCC and therefore the compiler didn't know what to do.
      There have been some rather generic commandline switches which would have allowed compiling for the 5529 anyway, provided that someone had written the required include files and linker scripts. Those guys just didn't know that in case of an unknown MSP (to the compiler version they used), defining 'target=MSP430F5529" wasn't enough.

      However, the recent uniarch version of MSPGCC AFAIK supports the 5529 and almost all other MSPs (not the FR57xx and maybe a few others)

      _____________________________________
      Before posting bug reports or ask for help, do at least quick scan over this article. It applies to any kind of problem reporting. On any forum. And/or look here.
      If you cannot discuss your problem in the public, feel free to start a private conversation: click on my name and then 'start conversation'. But please do so only if you really cannot do it in a public thread, as I usually read all threads. And I prefer to answer where others can profit from it (or contribute to it) too.

      Report Abuse
      • Reply
      You have posted to a forum that requires a moderator to approve posts before they are publicly available.
    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