3
\$\begingroup\$

I'll start by saying I'm new to micro-controller programming. I've had some (ca. 30 years) experience programming, and some of that was writing C/C++ but those days are long behind me now.

Since I'm just starting, I want to know what benefits there are to coding my logic in C/C++ over the much simpler Energia language. I'm looking for specific features or instructions of the MSP430 that one can only program in C/C++ rather than code organisation (classes, enums, type safety, etc.)

\$\endgroup\$
  • 1
    \$\begingroup\$ Control, ability to do complex things not defined within that framework. I imagine (although don't know) that there is a code size and ram penalty for using the framework. Guess it depends on what you're trying to do. I view things like Energia as a hobbyists tool. \$\endgroup\$ – Some Hardware Guy Feb 3 '15 at 16:47
  • 1
    \$\begingroup\$ Generically, the benefits of a lower-level more universal language over a higher level more proprietary one. In embedded, using "plain" C gives you a good feeling for exactly what's going on as you're that much closer to the metal, as it were, without resorting to assembler. \$\endgroup\$ – John U Feb 3 '15 at 16:50
  • 1
    \$\begingroup\$ It's funny I feel like I heard these same arguments about using assembly language vs C many years ago. \$\endgroup\$ – Some Hardware Guy Feb 3 '15 at 17:07
  • 2
    \$\begingroup\$ Isn't Energia just Arduino-style libraries/abstractions in C++ ? That would make this basically the Arduino vs. direct question, with a side helping of the msp430 perhaps having capabilities not fully reflected in libraries/abstractions perhaps slightly influenced in design concept by the different ATmega chip. \$\endgroup\$ – Chris Stratton Feb 3 '15 at 17:31
  • \$\begingroup\$ By using C, you can make use of the thousands of lines of example C code written for the MSP430 that is already on the web. \$\endgroup\$ – tcrosley Feb 3 '15 at 18:44
4
\$\begingroup\$

I think that the main benefits on a full-fledged environnement (as Code composer) over Energia:

1) Able to program the whole family of MSP430 microcontrollers, and not only a few selected microcontrollers as in Energia.

2) Able to debug the applications by setting breakpoints, watching variables, step-by-step, etc.

3) Able to use a much more capable library (MSP430 Driver Library) in comparison with a limited arduino-clone Library. For example, I missed in "standard Energia" the possibility of setting a timer that triggers an interrupt; you might of course install a third party library for doing so or playing directly with registers (though you might interfere with Energia code, which might use this peripheral for some other purpose).

4) In contrast, using MSP430 Driver Library you can program every existing peripheral on the microcontroller; and you know what peripherals are being used (because you are programming all of them instead of relying on hidden code as in Energia).

That said Energia is great for quick prototype. Both environments are worth to learn.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Code composer studio now lets you use energia sketches inside of it and debug into them. \$\endgroup\$ – Curtis Apr 13 '16 at 14:19
  • \$\begingroup\$ Also, Energia has added void sleep(uint32_t milliseconds); void sleepSeconds(uint32_t seconds); and void suspend(); functions. On the MSP430G2553 controller, the sleep() functions use LPM3 mode, and suspend() enters LPM4. \$\endgroup\$ – Curtis Apr 17 '16 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.