3

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.)

  • 1
    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. – Some Hardware Guy Feb 03 '15 at 16:47
  • 1
    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. – John U Feb 03 '15 at 16:50
  • 1
    It's funny I feel like I heard these same arguments about using assembly language vs C many years ago. – Some Hardware Guy Feb 03 '15 at 17:07
  • 2
    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. – Chris Stratton Feb 03 '15 at 17:31
  • 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. – tcrosley Feb 03 '15 at 18:44

1 Answers1

4

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.

Roger C.
  • 2,205
  • 1
  • 9
  • 12
  • 1
    Code composer studio now lets you use energia sketches inside of it and debug into them. – Curtis Apr 13 '16 at 14:19
  • 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. – Curtis Apr 17 '16 at 02:32