energia

New Energia release 0101E0013 - 09/05/2014

48 posts in this topic

On CC3200-LAUNCHXL is onboard I2C temperature sensor TMP006 chip and accelerometer BMA222 chip. They are used in Out-Of-the-Box demo. And in CCStudio examples there are files tmp006drv.c and tmp006drv.h. I have used these files in my CCStudio projects.

Hope that will be possible to read them in Energia.

Theres a lib for the accelerometer in the hardware folder

Share this post


Link to post
Share on other sites

Theres a lib for the accelerometer in the hardware folder

 

@@MORA99 Could you give a more specific location/file name?  I could not find TMP006 drivers in the CC3200 folders under hardware.

Share this post


Link to post
Share on other sites

@@MORA99 Could you give a more specific location/file name?  I could not find TMP006 drivers in the CC3200 folders under hardware.

I am fairly sure the accelerometer chip is named BMA222, I havent found one for the temperature sensor yet.

Path : \Energia\hardware\cc3200\libraries\BMA222.

BMA222 mySensor;
mySensor.begin();
//mySensor.readXData();
//mySensor.readYData();
//mySensor.readZData();


Share this post


Link to post
Share on other sites

 

I am fairly sure the accelerometer chip is named BMA222, I havent found one for the temperature sensor yet.

Path : \Energia\hardware\cc3200\libraries\BMA222.

BMA222 mySensor;
mySensor.begin();
//mySensor.readXData();
//mySensor.readYData();
//mySensor.readZData();

 

Thanks.  I actually misread your posting.  Since the original question had been about the TMP006 sensor, I didn't read closely enough and thought you had found a driver for that.  Sorry for the confusion.

Share this post


Link to post
Share on other sites

Seems I misread too :)

 

I managed to get the Adafruit code working with minor changes : https://github.com/adafruit/Adafruit_TMP006

 

in Adafruit_TMP006.h

add "#define ARDUINO 101"

comment out #include <Adafruit_Sensor.h>

 

in Adafruit_TMP006.cpp

comment out #include <util/delay.h>

 

To test it 

Adafruit_TMP006 tmp006(0x41);
  if (! tmp006.begin()) {
    Serial.println("No sensor found");
  }  
  //tmp006.wake();
  float objt = tmp006.readObjTempC();
  Serial.print("Object Temperature: "); Serial.print(objt); Serial.println("*C");
  float diet = tmp006.readDieTempC();
  Serial.print("Die Temperature: "); Serial.print(diet); Serial.println("*C");  
Object Temperature: 24.46*C
Die Temperature: 30.06*C

Share this post


Link to post
Share on other sites

Hi !

Same results for TMP006 and Adafruit lib (with same kind of 'patching')

....Of course 'Die temp' is 'PCB temp'  with TMP006 near LDO !

 

Tested with Launchpad rev 3.2 and 'out of the box' firmware (non updated as recommended)

Share this post


Link to post
Share on other sites

On the TMP006 - have you tried the Energia TMP006 driver with the CC3200?

You can find the driver in the [enegia]/hardware/lm4f/libraries/TMP006 the example code for it is under Educational boosterpack MKII.

(A quick glance suggests that it is similar to the Adafruit lib.)

Share this post


Link to post
Share on other sites

@@igor

 

In "tmp006.cpp" I replaced 3 occurences of "ADR1_0_ADR0_0" by "ADR1_0_ADR0_1"  on lines 191, 197 and 229 (cf Launchpad CC3200 schematic).

 

Compiling" QuickTMP006.ino"  gives this error :

*****\Documents\Energia\libraries\TMP006\tmp006.cpp: In function 'float Calculate_Temp(float*, float*)':
*****\Documents\Energia\libraries\TMP006\tmp006.cpp:312:8: error: expected unqualified-id before numeric constant

Share this post


Link to post
Share on other sites

 

In "tmp006.cpp" I replaced 3 occurences of "ADR1_0_ADR0_0" by "ADR1_0_ADR0_1"  on lines 191, 197 and 229 (cf Launchpad CC3200 schematic).

 

Compiling" QuickTMP006.ino"  gives this error :

*****\Documents\Energia\libraries\TMP006\tmp006.cpp: In function 'float Calculate_Temp(float*, float*)':
*****\Documents\Energia\libraries\TMP006\tmp006.cpp:312:8: error: expected unqualified-id before numeric constant

 

Looks like there was an unfortunate selection of macro names for the CC3200 ports in Energia.h (they are named S0, ...)  Simple names, which make them more likely to conflict with names in user code.  (As happens in this library.)

 

In tmp006.cpp, if you change the name of the variable S0 in Calculate_Temp then it will compile.  (Lines 312 and 322)

Share this post


Link to post
Share on other sites

Thank's igor

 

Compile is OK as suggested after renaming var S0 (lines 312 and 322) with more specific name !

Execution is not OK : gives around 396

Share this post


Link to post
Share on other sites

 

The function enableXtal() looks suspiciously like it may be what you want.

At one of the calls to it it says.

/* Attempt to enable the 32kHz XTAL */

 

Seems a little odd that this function is called twice for some parts.

(if __MSP430_HAS_BC2__ is defined, it is called up near the top of initClocks(), and then it is called again down at the end of initClocks().)

Not clear from the code why it needs to be called twice.

 

enableXtal is not present in previous version of Energia.

(I haven't tested it to be sure that it is the part you want, or to figure out how to bypass the timeout).

 

Might be nice if there was a user configurable way to turn the check off.

 

Sorry for late to the game...... I just updated to E13 and found the same delay issue during power up. Is that I just need to comment out all calls to enableXtal in wiring.c, to get rid of the delays during power up? My application needs to be start running once the device is powered up, and I don't have the external crystal in my design. Thanks.

Share this post


Link to post
Share on other sites

Sorry for late to the game...... I just updated to E13 and found the same delay issue during power up. Is that I just need to comment out all calls to enableXtal in wiring.c, to get rid of the delays during power up? My application needs to be start running once the device is powered up, and I don't have the external crystal in my design. Thanks.

 

Another solution would be to declare enableXtal() weak in wiring.c, then you could override it in your code by declaring your own enableXtal() function.  Then you could use a crystal for some projects, and not for others.

 

Specifically:

wiring.c add:
void enableXtal() __attribute__((weak));

Energia.h add:
extern void enableXtal(void) __attribute__((weak));

Then in a project/sketch where you want to get rid of the delay, include a function called enableXtal().

void enableXtal() {}

This makes the enableXtal function just a simple return statement.  A similar approach is used in HardwareSerial.cpp/.h to implement serialEvent().

 

The downside of this approach (vs. commenting out the calls to enableXtal) is that the (now empty) enableXtal function is still called (twice in succession) [so it costs 10 bytes of code plus the time to execute the calls and returns].  The upside is you can have some projects with boards that have crystals, and some that don't.

 

[Edit: Note, I have tested the above to be sure that it allows one to control whether enableXtal is called.  I have not tested it to verify all the ramifications of not calling enableXtal.  So if commenting out enableXtal breaks something, this will break it also.]

 

@@spirilis

 

It would be nice if something like that could be incorporated into Energia.

Share this post


Link to post
Share on other sites

Might be something to think about (paging @@energia )... we'd have to make sure the sleep/sleepSeconds stuff registers with the VLOCLK correctly.  So perhaps that could be reworked a bit, so the code calls enableXtal() and falls back to VLO if enableXtal() returns false or something.

Share this post


Link to post
Share on other sites

In Energia version 13, time function micros has problems on CC3200.  See 


http://forum.43oh.com/topic/5902-measure-short-amounts-of-time-with-micros/


 


[Thought it worth posting a brief note here so that those new to Energia 13 are more likely to see it.  The thread that points this out is now a bit buried.]


[Edit: Not as wide spread a problem as I thought.]


 


[Edit 2 Nov 2014]


The posting listed below has a patch which should fix this issue.


 


There was also an issue with the delay functions which were unreliable on both CC3200 and Tiva (in version 13 and 12).  That problem is also fixed by the patch in the post linked below.


 


http://forum.43oh.com/topic/6011-tiva-delaymicroseconds-unreliable/?p=52589

Share this post


Link to post
Share on other sites

The Energia Button Tutorial has a typo.

"If the buttonState is HIGH, it means that push button was pressed else it is not." This is wrong. When ButtonState is HIGH, the button was not pressed (using a pull-up setup). The arduino version of the tutorial uses a pull-down setup and this typo crept in on translation.

Share this post


Link to post
Share on other sites

Energia 13 for OS X does not work.

 

After installation, when I try to start the app, I only get an error message telling me that Energia is damaged.

I have attached the snapshot of the error message.

My computer is a Macbook Pro with Retina Display running OS X 10.0.3.

 

Energia 12 runs fine. The problem is only with the upgrade.

 

I tried to download a new install package with no success. Also I uninstalled Energia 12 before trying the version 13 without any change.

 

What can I do to get Energia 13 on OS X?

Do I need to upgrade to OS X 10.10 (Yosemite)?

 

Please help.

 

post-37768-0-52706500-1415412698_thumb.jpg

 

 

11/08/2014 PROBLEM SOLVED

 

I used the post reporting similar issue with Mountain Lion. I disabled the OS X protection to start Energia, and everything went OK.

After that I restored standard protection, and it is working now.

 

Thanks to the poster of the fix.

Share this post


Link to post
Share on other sites

There is an error in the definition of pgm_read_byte in Energia.h  in Energia version 13.

The error occurs on the CC3200, LM4F and MSP430 platforms

 

Currently it reads

#define pgm_read_byte(x) (*x)
#define pgm_read_dword(x) (*x)

This does not work if the argument is an expression (e.g. from AdafruitGFX 

https://github.com/adafruit/Adafruit-GFX-Library/blob/master/Adafruit_GFX.cpp

      line = pgm_read_byte(font+(c*5)+i);

with Energia's macro, this winds up being equivalent to font[0] + (c*5) + i, when it should be font[c*5+i].

 

(To demonstrate misbehavior, try using AdafruitGFX to display a character.  Actually AdafruitGFX has the macro done right, but if you do not make their version of the macro override the Energia one, it comes out with gibberish instead of characters.)

 

The macros in Energia.h should read

#define pgm_read_byte(x) (*(const unsigned char *)(x))
#define pgm_read_dword(x) (*(const unsigned long *)(x))

Share this post


Link to post
Share on other sites

Have just started with MSP430G2553.

 

Downloaded 0101E0013 correctly but I am missing the FIRMATA examples /code.

 

Any suggestions ?

 

Thanks

Share this post


Link to post
Share on other sites

hello all !! 

I need to test the TMP006 Anaren's temperature sensor. it's an a boosterpack with TIVA C. so how can i do this. i used the "adafruit TMP006" and "Educational BoosterPack MK II "code in energia V17.  but nothig showed in serial port. 
any help please !! 

 

med :).

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