This post if related to the TI Educational Boosterpack MK II road test
As you put the hands on the Educational boosterpack MKII (and the launchpad micro controller board MSP432 from TI few minutes are needed to enjoy of this product. Well done and well assembled, very appreciable that the word Educational is well adopted. You can download from the TI site all what you need, including the schematics and circuit layout to hack, change, update, redo as well.
After the first minutes of happiness it's time to see how it works, so the immediately next step if the Software Installation.
Development IDE Alternatives
The MSP430 and MSP432 launchpad boards and a number of stackable boosterpacks creates a real hardware ecosystem. TI offers several development options giving compatibility with commercial IDEs like Keil, Mentor Graphics and others. Beside these development tools there are two interesting options in the world of the open source software with no limitations to the kind of development and applications you can create.
The most complex is Code Composer Studio (aka CCS), an Eclipse-based IDE downloadable for free from the TI launchpad site; it is not needed to install the widely diffused Eclipse IDE as it is part of the installation; package. CCS is supported in both the Windows and Linux environments with an interesting option for the development on-the-go: the cloud version (also available for free registering on the site).
CCS is also distributed in a packaged (with a box) commercial version for company development applications.
What does the image remembers? Yes! It's just the well-known friendly Arduino development IDE. The TI restyled version names Energiahttp://energia.nu/ and is the official launchpad and boosterpack development environment available to all. If some doubt exists the TI launchpad site link reports Energia for Arduino users.
This is a great news! This means that despite the known limits of this IDE this development option gives access to an incredible potential number of users already used to manage and develop their sketches under the TI platform and launchpads.
What's the next step?
Obviously, trying the examples.
First of all I have tried to install the Energia IDE on the three supported platforms (Mac OSX, Linux Ubuntu and Windows 7) just to have some comparison reference.
The installation is almost simple and follows the classical setup method that the Arduino users already know so well. The first tests have been tried with the MSP432 launchpad only and all seems working fine.
In my opinion it was possible to do something more in the porting for the documentation but the general approach is good and the online documentation gives the essential information updated for the features of the launchpad boards, far to be present (or imagined) on the Arduinos. The IDE support most of the TI boards so we can consider it almost efficient doing what we expect.
I appreciated the Energia language referencehttp://energia.nu/reference/ pages including in a single page the links to almost all the programming knowledge you need. The IDE covers all the available launchpads and boosterpacks available at the date with a well organised series of reference links to the hardware libraries, part of the core libraries and included during the installation process.
Another very useful information is a organised series of links to all the launchpad and boosterpack pin mapping; users does not become crazy to see the pinout of their componentes like I remember it was (and it is) with the ton of Arduino devices, clones etc. The following are the links to the MSP432 launchpad and the Educational Boosterpack MKII.
Energia issues with the Educational Boosterpack MKII
Probably the most important added value of this boosterpack is che colour LCD device (with a resolution of 128x128 pix) together with so many components at a so valuable. Unfortunately as I have tried to run one of the examples involving the LCD all what I got was an incredible series of compilation errors. Probably this may depend on the new hardware and not all issues are already known and documented. What I suggest below is a systematic approach after the IDE installation applying the changes to see the hardware working fine. The described patches are also available in attach to this post.
Focusing the main issue
The main issue is the impossibility to recognize the LCD as a supported peripheral creating a series of domino effect errors during the compilation and linking of the applications. The problem is in the screen library file Screen_HC8353E.cpp
Patching the screen recognition problem
In the file Screen_HC8353E.cpp starting from line 77 there is a preprocessor control that should be removed. The original code
#if defined(__LM4F120H5QR__) || defined(__MSP430F5529__) || defined(__TM4C123GH6PM__) || defined(__TM4C1294NCPDT__) || defined(__TM4C1294XNCZAD__) _pinReset = 17; _pinDataCommand = 31; _pinChipSelect = 13; _pinBacklight = NULL; #else #error Platform not supported #endif}
should be changed in
//#if defined(__LM4F120H5QR__) || defined(__MSP430F5529__) || defined(__TM4C123GH6PM__) || defined(__TM4C1294NCPDT__) || defined(__TM4C1294XNCZAD__) _pinReset = 17; _pinDataCommand = 31; _pinChipSelect = 13; _pinBacklight = NULL; //#else //#error Platform not supported //#endif
There is another minor issue that occurs in some programs only. It is related to a mismatched definition of the symbol NULL somewhere in the code; the NULL preprocessor define should be 0. Also this error is located in the same file of the boosterpack library at line 72. To avoid using the bare 0 value instead of the symbolic NULL value I have added the following lines:
// e.m. Oct, 31, 2015 // Avoid the following error : // .... /Screen_HX8353E.cpp:93:20: warning: NULL used in arithmetic [-Wpointer-arith] // ... if (_pinReset!=NULL) pinMode(_pinReset, OUTPUT); #ifdef NULL #undef NULL #define NULL 0 #endif
To makes things simple you can download the already patched file from this post and replace it in your copy of installed Energia IDE. The file is located under the energia installation path in the following folder: <installation path>/hardware/msp432/libraries/EduBPMKII_Screen.
LCD Life Game issue
After applying these two patches the screen worked perfectly in almost all the provided examples. Why almost? Because a similar problem occurs with this example. At line 127 of the library examples sketch LCD_LifeGame.ino you can see the following lines of code:
#if defined(__MSP430F5529__) #define ROWS 32 // max 80 #define COLS 32 // max 60 #elif defined(__LM4F120H5QR__) #define ROWS 64 // max 80 #define COLS 64 // max 60 #else #error Board not supported #endif #else // general case #define ROWS 128 #define COLS 128 #endif
That has been replace by the following (forcing the effective LCD resolution to 128x128 instead of the 80x60 wrong default values)
/* e.m. Oct, 31, 2015 Wrong definition of the number of colums */ // Beware of RAM limitations //#if defined(HX8353E) // Educational BoosterPack MKII //#if defined(__MSP430F5529__) //#define ROWS 32 // max 80 //#define COLS 32 // max 60 //#elif defined(__LM4F120H5QR__) //#define ROWS 64 // max 80 //#define COLS 64 // max 60 //#else //#error Board not supported //#endif // //#else // general case #define ROWS 128 #define COLS 128 // //#endif
The working patched game (file LCD_LifeGame.zip) is attached to the bottom of this post. The image below shows the LifeGame while running.