Grace Quick Start Guide
From Texas Instruments Embedded Processors Wiki
Welcome
| |
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. 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. |
How do I get Grace?
|
OPTION 1 (Recommended) - Get the latest version of CCSv5!
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 | |
How do I configure MSP430 peripherals with Grace?
|
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
| | | |
| 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 |
| |
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.
| |
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:
| |
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:
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
|
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
2. Enter the name of the interrupt handler function you want to provide. Do not add the function type or parameters here.
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.
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:
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. |
Comments
Comments on Grace Quick Start Guide
Scbrass said ...
Mikemyti said ...
When will Grace support FRAM devices?
--Mikemyti 00:10, 30 August 2011 (CDT)

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)