Jump to content
energia

New Energia release 0101E0013 - 09/05/2014

Recommended Posts

I am happy to announce that release 0101E0013 just went up on http://energia.nu. This release adds support for the awesome CC3200 WiFi LaunchPad and CC3100 BoosterPack for MSP430 and TivaC.

 

I want to thank everybody for their support and contributions. Energia would not have been possible without such an awesome community!

 

Details of the release can be found on http://energia.nu

Share this post


Link to post
Share on other sites

CC3200 users: Don't forget to visit http://energia.nu/cc3200guide/ and follow the directions there; this firmware update can only be done on Windows at the moment unfortunately, but it's important for this Energia release to work.

 

Sent from my Galaxy Note II with Tapatalk 4

Share this post


Link to post
Share on other sites

NEW FEATURE folks will want to be aware of!

 

For msp430 and lm4f (Tiva/Stellaris), there are three new ways to pause or halt the CPU-

 

void sleep(uint32_t milliseconds);

void sleepSeconds(uint32_t seconds);

void suspend();

 

and a complementary function: wakeup()

 

For the lm4f/tm4c platform, these are mostly just placeholders that do not consume any less power than usual; in the future I'd like to explore the ARM's low-power features to make them workable.

 

For msp430 though, the first two use LPM3 modes, and the third enters LPM4.

Energia tests XT1 osc. fault on reset to see if a 32.768KHz XTAL is present; if so, ACLK is set to that and it's noted that ACLK is being driven at 32.768KHz.  If not, VLOCLK is used and its nominal frequency is assumed to be its speed.

 

When sleep() is called, the WDT is reworked to fire every ~1.9ms (varies XT1 vs VLO) using WDT_ADLY_1_9 while incrementing millis() and micros() as accurately as it can (which isn't always accurate... particularly with VLOCLK).  Alas, it does give you true LPM3 mode!

 

sleepSeconds() uses WDT_ADLY_250, which is a much more coarse sleep interval but allows the chip to spend a whole lot more time asleep.

 

suspend() just runs LPM4.

 

The catch here is that normally IRQs firing won't wake up the chip permanently, and since Energia occupies the ISRs with its own routines, it's not possible for a user's ISR (registered via attachInterrupt() or similar) to run __bic_SR_register_on_exit to cancel the LPM mode.

 

Enter wakeup().  The wakeup() function sets a volatile global flag which signals to the sleep(), sleepSeconds() or suspend() function that sleep mode should be aborted.  Moreover, many of the ISRs have been reworked to check for a change in this flag after it executes the user's ISR in order to determine if it should run __bic_SR_register_on_exit(LPM4_bits) itself.  This allows the user's ISR to cancel LPM mode.

 

These functions (sleep(), sleepSeconds(), suspend() and wakeup()) also exist on the lm4f/tm4c platform, they just don't use any particularly low-power modes yet.  But still, the code should port over, and it does give you as a programmer a simple way to "halt" the CPU or pause with the option of aborting it early.

 

Also note, LPM3/LPM4 will cause any Serial input to be corrupt, since the SMCLK isn't running for the UART module to correctly detect the bits.  This isn't the case for the Tiva/Stellaris yet, but will be once we implement true low power modes over there.

 

The wakeup() handler has been added to the I2C ISR handler too, so it is (in theory) possible to configure the chip as an I2C slave with the Wire library and then suspend() to enter LPM4, then wakeup() upon receiving a request, since I2C is clocked externally.  (I haven't actually tested this yet...)

 

I never got around to adding these functions to the cc3200 port, but will do so by the next release (or maybe offer a patch for it in between).

(I just added the suspend() and wakeup() stuff, all props go to @@energia for the sleep/sleepSeconds/ACLK implementation :D )

Share this post


Link to post
Share on other sites

Very very cool. I'm glad to see Energia supporting deeper sleep modes. That was something I was missing. I'd worked around it by repurposing the WDT, sleeping, then setting the WDT back to how it was, but that does bad things to millis and such.

 

Thanks for the features and the heads up!

Share this post


Link to post
Share on other sites

Another thing I discovered, not about Energia but noteworthy for folks using the new CC3200 - ADC inputs are measured against a 1.46V reference, the analog input buffers are only supposedly tolerant up to 1.8V.  That could be a problem if you have some 3.3V-level analog inputs.

 

This doesn't seem to apply with digital I/O mode for these pins, but as the datasheet cautions, having the digital I/O output buffers enabled & set high while the ADC mode is configured for the pin could cause the MCU to blow up its own ADC buffers.  Since Energia uses the CC3200 driverlib I assume there's no risk of that here...

Share this post


Link to post
Share on other sites

Wow!

 

I have been waiting in anticipation for this version of Energia. I am very impressed with the work done!

 

Let the tinkering begin!

 

Kind regards, Eelco

Share this post


Link to post
Share on other sites

Just downloaded this much anticipated upgrade as have a cc3200 launchpad. Got caught out straight away when trying my very first example using the liquidcrystal library - I literally just opened up "hello world" without even attaching my board just to see if it would compile. I then went and selected the cc3200 as my board in Energia (under tools menu) and the compile routine bombed. The reason being is that I selected the example from the examples menu before selecting the board under tools menu and therefore the compile error was that it could not find the liquidcrystal library. 

 

I thought most odd! Looking beneath the hood I see that the standard libraries are filed in the hardware directory with each hardware platform having its own "libraries" directory. Somewhat different to what you would find with Arduino IDE. Hence if I had selected my cc3200 under the tools menu and then tried to select the liquidcrystal libraries it would not have shown up in the examples menu as it does not exist for the cc3200 as yet. 

 

Of course this makes sense due to each platform having unique characteristics. Now question. As you may know, with Arduino IDE, I can download and store my own libraries in my own workspace inside a libraries folder rather than download my libraries and store inside the Arduino program libraries folder. How does this work with Energia especially now that we have separate libraries for each hardware platform. Does Energia look inside its workspace folder for a libraries folder and then search for a hardware folder (or vice versa) or does it not do this at all.

Share this post


Link to post
Share on other sites

Thanks for good job.

Is it possible to add support for 2230/2210 8pin uP with correct initialization unused pins?

 

PS. Why don't upgrade repository with new rxtxSerial.dll? Old verions make a lot of problems when You use PC Bluetooth interface (long startup, crashes etc.)

http://forum.arduino.cc/index.php?PHPSESSID=adocda7ptvtdma9c0fnms2qgo3&topic=136173.msg1023542#msg1023542

Share this post


Link to post
Share on other sites

I'm unsure of the proper place to list problems, please excuse me if this post is out of place.

 

When trying the ScanNetworks example program, it would not compile due to a missing #endif

 

I added it as shown here:

 

#ifndef __CC3200R1M1RGC__
// Do not include SPI for CC3200 LaunchPad
#include <SPI.h>
#endif

Share this post


Link to post
Share on other sites

 

I'm unsure of the proper place to list problems, please excuse me if this post is out of place.

 

When trying the ScanNetworks example program, it would not compile due to a missing #endif

 

I added it as shown here:

 

#ifndef __CC3200R1M1RGC__
// Do not include SPI for CC3200 LaunchPad
#include <SPI.h>
#endif

 

Thanks ... yep this is a known issue, a fix for it went into the github master repo but just shortly after the release was out I think.

Share this post


Link to post
Share on other sites

Of course this makes sense due to each platform having unique characteristics. Now question. As you may know, with Arduino IDE, I can download and store my own libraries in my own workspace inside a libraries folder rather than download my libraries and store inside the Arduino program libraries folder. How does this work with Energia especially now that we have separate libraries for each hardware platform. Does Energia look inside its workspace folder for a libraries folder and then search for a hardware folder (or vice versa) or does it not do this at all.

 

It looks like it looks in the [workspace]/libraries folder first, and then in the [energia]/hardware/[platform]/libraries folder.  In Arduino (1.5.2 at least) it looks in 3 places - the [workplace]/libraries, [arduino]/libraries, and [arduino]/hardware/arduino/[platform]/libraries.

 

It looks like users are supposed to put libraries in the workspace folder.  I don't see any provision for distinguishing user installed libraries by platform (so if you use CC3200 and Tiva, you may just have to remember which libraries work with which device).  [Edit: I should clarify - that is in Energia, or for Arduino 1.0 libraries.  The draft Arduino 1.5 library specifications do have ways to specify what platform a library supports.]

 

It would be helpful if Energia (or Arduino) gave a warning about duplicate libraries installed in the workspace and the hardware libraries folder.  While there are reasons one might want to do this (to override a system supplied library), there are also cases where it could cause considerable angst.  (e.g. if one has different versions of a library in the workspace folder and the hardware folder, or one has a user installed library for a Tiva that happens to have the same name as a system library for an MSP430.)

Share this post


Link to post
Share on other sites

If you find what you think is an error in Energia, or have a suggestion for an improvement, you may want to check through the list of issues at the Energia github repository: https://github.com/energia/Energia/issues

(You may find that somebody has already reported the issue, or that a fix is available.)

Likewise, for issues involving the Energia programming environment, the Arduino issues section may be helpful https://github.com/arduino/Arduino/issues (since Energia is an offshoot of Arduino, they share many of the same features and problems).

Share this post


Link to post
Share on other sites

@@energia

 

Thanks for your hard working.

But I think energia-0101E0013 is having a small bug in Serial Communication

In ASCII Table Example:

when I upload code in version 0101E0013 the response of the msp430 is slower 3 seconds when I press reset button.

The similar thing does not happen in older version 0101E0012. Whenever I press reset button It clears and give me a new response.

MSP430G2553.

Please fix this.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×