This is a guest blog post by Bart Basile. Bart is a systems and applications engineer in the Texas Instruments' Smart Grid and Energy Solutions Team, focusing on renewables and distributed generation.
The new FRAM based MSP430FR5969 LaunchPad (MSP-EXP430FR5969) has a lot of great technology to help enable ultra-low-power applications. However, the stock 8MHz enabled in Energia (the software prototyping platform for TI's LaunchPads), can be limiting for some applications, despite the energy consumption benefits. While the FRAM technology itself is limited to an 8MHz read speed, it is rare that you will be clocking data out at this full rate, so to enable the faster core clock, a buffer was added to the memory so the two can operate asynchronously.
In Energia, we are used to the handful of board options available out of the box. We see that the other LaunchPads have various clock speed options, but the MSP430FR5969 microcontroller currently lists 1 8MHz option. While this is useful for many applications, there are occasions where we need 16MHz. A simple example is the usage of WS28xx addressable LEDs that are very popular in the community. In fact, there is already a library supporting them on the MSP430, it just requires a 16MHz core clock since the timing is so critical. We know that 16MHz is supported in hardware, so let’s go ahead and enable it in Energia!
In your Energia directory, navigate to /hardware/msp430/. Here you’ll find the “boards.txt” file which defines all the support MSP430 LaunchPads. Go ahead and open it in your favorite text editor. If you scroll to the bottom, you’ll find the section for the FR5969 MCU, titled “lpmsp430fr5969.name=LaunchPad w/ msp430fr5969 (V2.0 and higher only!).” There are two f_cpu defined there:
The octalthorpe in front of the first line is a comment, so only the 8MHz line is active. A simple solution would be to just uncomment the 16MHz line, and comment the 8MHz line, but we don’t want to have to re-edit this file if we want 8MHz in the future. Another solution is to create a new board entry to support 16MHz.
You’ll notice that each line is prefixed with “lpmps430fr5969,” which is the name of the board that Energia uses to populate its lists. What we’ll do here, is rename the board to denote that it’s 8MHz on each line. Here’s an example:
lpmsp430fr5969_8.name=LaunchPad w/ msp430fr5969 (8MHz)
So the board’s technical name is lpmsp430fr5969_8, and the name in Energia will be marked as 8MHz. Go ahead and change the other technical names in the entry to match.
Now, we can copy this block to create a new board entry, and change it to 16MHz. The name I used is:
lpmsp430fr5969_16.name=LaunchPad w/ msp430fr5969 (16MHz)
We also need to be sure to rename all of the lines in this new block, uncomment the 16MHz cpu clock line, and then comment or delete the 8MHz line. Here’s the final two board entries that I have in my list:
Now, when we open Energia, we can see both board entries in the list. To test this out, I used the WS2811 driver library available here: http://forum.43oh.com/topic/2882-energia-library-ws2811driver-led-controller-class/
This library checks the CPU speed of the selected MSP430 microcontroller, and uses an appropriate assembly library for the timing critical elements, so if the CPU was running at 8MHz it wouldn’t work. Just loading the example that comes with the library, and connecting the LED strand however, shows that we are indeed running at 16MHz.
It should be noted though, that this has not been tested for all functions in the Energia libraries, and some things might not work 100% of the time, but it should work for most things, especially adding LEDs to your microcontroller projects!
Does not work with Energia 1.6.10E18 and this library for NeoPixel Ring github.com/.../WS2811Driver
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. 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.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.