Grace Quick Start Guide

From Texas Instruments Embedded Processors Wiki

Jump to: navigation, search
Translate this page to   


Welcome

Grace-Banner300.png 

DownloadGrace.png

#Meet_Grace

#How_do_I_get_Grace?

#How_do_I_configure_MSP430_peripherals_with_Grace?

#Which_MSP430_devices_work_with_Grace?

#How_do_I_create_a_Grace_project?

#How_to_use_interrupts_with_Grace

Meet Grace.

Grace is a tool that allows you as an MSP430 developer to generate the peripheral’s set up code within minutes. This will save you much of the work of poring through user guides and copying code examples and allow you to focus on the more important aspects of your application.
GraceOverview.PNG
Fully harness MSP430 MCUs integrated analog and digital peripherals with Grace Software
Enable and configure ADCs, DACs, timers, clocks, serial communication interfaces and more, by interacting with buttons, drop-down menus, and text fields. Navigate through the MSP430 MCUs highly integrated peripheral set with ease.

Grace software supports all MSP430F2xx and G2xx Value Line MCU devices

This means it supports the MSP430 MCUs most popular tools such as MSP-EXP430G2 LaunchPad, eZ430-F2013, eZ430-RF2500 and other tool kits.


Seamless integration into TI's eclipse-based Code Composer Studio software

Grace software generates easy-to-understand C code, which is directly inserted into your active project. This seamless integration into the integrated development environment (IDE) allows the Grace generated code to be debugged and downloaded into your MSP430 microcontroller just as if it was handwritten.
Grace is also available as a stand-alone tool to support other IDEs, such as IAR Embedded Workbench.

How do I get Grace?

OPTION 1 (Recommended) - Get the latest version of CCSv5!

  • Grace is a pre-installed plugin in CCS version 5.1 and later and is included by default with the MSP430 package. If you don't have it already, download and install Code Composer Studio 5.1 from here: http://www.ti.com/ccs
    Grace examples are included inside the MSP430Ware resource package. You can check which version of Grace you have by finding the Grace icon in the Help->About Code Composer Studio menu in CCS.
  • If you have an existing installation of CCSv5.1 and you are missing the Grace installation or want to install MSP430Ware for the examples: Please run the latest CCS installer again and select the components you want to have installed. You can also use the Install new software function of Eclipse.


OPTION 2 - Grace Standalone Tool


LEGACY - For those using Code Composer Studio 4.2

  • For users still using Code Composer Studio version 4.2, you can download the Grace 1.0 installer package here Please note that Grace 1.0 needs CCS 4.2 to work properly! Other versions of CCS are not supported. We highly recommend updating to the latest version of CCS as this version is deprecated.


Questions? Ask for help on the MSP430 section of the E2E forum at www.ti.com/gracefeedback.

You can find all 3 flavors of Grace @ the Grace Product Folder


How do I use Grace-generated files with IAR Embedded Workbench?

This QuickStart Guide briefly describes how to create an IAR Embedded Workbench® project that uses files generated with the code generation tool Grace from Texas Instruments.
>> http://files.iar.com/docs/IAR_Grace_Integration.pdf
IAR Logo.jpg




How do I configure MSP430 peripherals with Grace?

ViewPoints.png
Once you have created a Grace-enabled CCS project, Grace enables developers to interact with the MSP430 microcontroller like never before. Users are invited to interact with various elements such as buttons, drop down menus, and text fields. Each of the integrated peripherals provide several view points for developers to navigate through.


  • Overview. This view shows you the most important use cases of the peripheral.
  • Basic View. This view includes most of the configuration settings that most users will need.
  • Power User View. This view includes all the configuration settings of the peripheral.
  • Register View. This view depicts the peripheral's control registers and individual bit settings.


Note that you may freely move between the different views, and selecting options in one view will immediately update the other views' settings.

Copy user code from the Overview by right clicking the selected code. Paste this code in your own application.

You may return to the initial home view at any time by clicking on the Home icon in the upper right corner of the config tool window.

Note that various warnings about your configuration may appear in the CCS Problems window. If this window is not visible, you can make it so by selecting Window->Show View->Problems.


Get started quickly and learn as you go

DocumentLook.png
Tooltips.png
ProjectTemplates.png
Integrated documentation. Grace is based on existing MSP430 user guides and datasheets to provide a consistent look and feel between printed resources and Grace's virtual screen. This eliminates the need to thumb through hundreds of pages of documentation!

Helpful Tooltips. Hover-overs and popups are integrated into every interactive element of Grace, offering useful information to guide the peripheral configuration process.
Get started now. Example projects can be used to learn about Grace and the Code Composer Studio environment... or used as a starting point for your own application development. The examples are contained in MSP430Ware
PreventCollision.png

Prevents collisions & contradicting configurations.

As developers enable and configure the various peripherals, Grace will provide instant notifications of configuration errors. This ensures inter-peripheral configurations are consistent. 

Edits & changes in one peripheral can be compensated in other modules as well. For example, changing the CPU clock speed will not break a pre-configured baud rate in the Universal Serial Communication Interface module!


Grace generates human-readable C-code.

Once you're done enabling and configuring the various peripherals required for your application, Grace will generate fully-commented, easy-to-read C-code at build time.

Unlike other options that are available, which output cryptic assembly language, Grace generates C-code that is fully modular and is automatically inserted into the active project in Code Composer Studio.

This code can be debugged and downloaded to your MSP430 device just like traditionally written code.


Code.png


Which MSP430 devices work with Grace?

Grace supports all MSP430F2xx andMSP430G2xx Value Line Microcontrollers, and enables visual configuration of integrated peripherals such as ADCs, DACs, OpAmps, Comparators, Timers, Clocks, Serial Communication Modules and more... 


The full device support list includes:

  • MSP430G2xx1 Value Line Devices
  • MSP430G2xx2 Value Line Devices
  • MSP430G2xx3 Value Line Devices
  • MSP430F20xx Devices
  • MSP430F21x1 Devices
  • MSP430F21x2 Devices
  • MSP430F22x2 Devices
  • MSP430F22x4 Devices
  • MSP430F23x0 Devices
  • MSP430F23x/F24x/F24x1/F2410 Devices
  • MSP430F24xx/F26xx Devices
GraceWithPointer.png



How do I create a Grace project?

To leverage Grace, you must first create a project in Code Composer Studio that is configured with Grace. To do this:
  1. In Code Composer Studio, select File->New->CCS Project.
  2. Choose a name for your new project.
  3. Select MSP430 for the Device Family.
  4. Select the Device Variant being used. (note: only the MSP430F2xx and MSP430G2xx devices are currently supported).
  5. SelectEmpty Grace (MSP430) Project as project template.
  6. Click the Finish button.

Note that the new project wizard has created a new project and that some files specific to Grace are now listed -- most notably is the file with the .cfg name extension. You may also notice that after the project is built, a new directory, "./src/csl", is added containing the .c source files for each of the peripherals enabled, plus the addition of the source file containing the definition of CSL_init() which is called by your application's main() function.

Your Grace-enabled project is otherwise the same as any standard CCS project: building, running, and debugging the application will be done in the same way, and you can step through the peripheral initialization code called by CSL_init().

Additional Grace Project Templates are also delivered through the MSP430Ware resource suite | Learn more about MSP430Ware here 

Grace Overview & Tutorial video (Tutorial begins @ 9:45)


How to use interrupts with Grace

To enable your interrupts with Grace, perform the following steps:

      1. Enable the desired interrupt in the peripheral’s Basic User or Power User View

          GraceInterrupt.png

      2. Enter the name of the interrupt handler function you want to provide. Do not add the function type or parameters here.

          GraceInterruptHandle.png

      3. Write the interrupt function in one of your C-files. The function type and parameter is usually “void”. The exception of that is the “Manual Mode” described below.

      GraceInterruptFunction.png

      4. (Optional) Change the Operating Mode under the “After Interrupt:” dropdown box.

      Note: Grace low-power-mode setting does not support nested interrupts.

Changing the Operating Mode after the Interrupt

For maximum power efficiency you can set the MSP430 to a different low power mode after servicing the interrupt. This can be done by selecting one of the low power modes in the “After Interrupt:” dropdown menu. For details on the MSP430 low power modes, see your MSP430 device's User’s Guide.


To exit from the low power mode after servicing the interrupt, select “Active Mode” in the dropdown list.

Manual Mode for Interrupts

Manual mode is mainly used when the interrupt state needs to be changed based on a decision during runtime.
First set the "After Interrupt" to Manual Mode:

ManualMode.png


Then create your interrupt handler implementation in your main application as follow:

/*
* Timer0_A3 ISR. Set the timer interrupt to Manual on interrupt return.
*/
unsigned short Timer_ISR (void)
{
     // Initialize return status to not change state
     unsigned short status = 0;
     ...
     ...
     if ( Foo == 0)
     {
          // Clear LPM3 bits from 0(SR)
          status = LPM3_bits
     }
     return status;
}

Interrupts with Grace FAQ

Q: Why does my interrupt constantly executing and not returning back to my application code?


A: Some peripherals require the user to manually clear the interrupt flag before proceeding. Please see the device specific user’s guide to see which peripherals require the flag to be manually cleared. Some peripherals will automatically clear the interrupt flag.

To Allow Your Application to Utilize the Grace Generated Content

Your application must explicitly invoke the initialization code that you created with the Grace config tool. This will typically be done from main(). You must include the CSL header file:
 #include <ti/mcu/msp430/csl/CSL.h>

You must also call the CSL initialization function:

 CSL_init();

Note: CSL_init() will typically be invoked before interrupts are enabled.


Leave a Comment

Comments

Comments on Grace Quick Start Guide


Scbrass said ...

This is a good idea, I have been using something similar for the SiLabs 80C51 for years. However theirs is a stand alone program that can be used with any IDE. Are there any plans to support other IDE's such as IAR Workbench? - Steve

--Scbrass 17:09, 29 August 2011 (CDT)

Mikemyti said ...

When will Grace support FRAM devices?


--Mikemyti 00:10, 30 August 2011 (CDT)

Personal tools
Namespaces
Variants
Actions
Navigation
Print/export
Toolbox