chicken 630 Posted April 29, 2013 Share Posted April 29, 2013 I finished up my first Energia project, a template library for the Bosch BMP085 temperature and pressure sensor. It uses I2C and supports temperature in Celsius and pressure in Pascal. https://github.com/astuder/BMP085-template-library-Energia I connected the GY-80 breakout commonly found on eBay, but it should also work with most other BMP085 breakouts, like the ones from Adafruit or Sparkfun. Note that I had to patch Energia to make 1-byte read work on MSP430G2553 with Rev1.5 LaunchPad. I also had to remove the LED2 jumper, probably due to too weak I2C pull-up. Update: Tested on LaunchPad 1.5 with MSP430G2553, StellarPad Rev A and Arduino R3. Energia requires patches 226 and 235 in twi.c for I2C to work properly on MSP430G2553https://github.com/energia/Energia/pull/226/fileshttps://github.com/energia/Energia/pull/235/files Updates:- Tested with Energia 0101E0010 with MSP430G2553 and F5529, no more I2C patches needed.- Tested with BMP180 and Software I2C http://forum.43oh.com/topic/3777-energia-library-bosch-bmp085-template-library/?p=44410 - Fixed I2C for Energia 0101E0016 by removing ugly hacks from the past from the library code. Tested only with MSP430G2553 energia and Serginho 2 Quote Link to post Share on other sites
bluehash 1,581 Posted April 29, 2013 Share Posted April 29, 2013 Moving to Energia Libraries. Thanks Chicken! Quote Link to post Share on other sites
chicken 630 Posted May 14, 2013 Author Share Posted May 14, 2013 Now tested on StellarPad and Arduino. bluehash 1 Quote Link to post Share on other sites
bluehash 1,581 Posted May 14, 2013 Share Posted May 14, 2013 Now tested on StellarPad and Arduino. Thanks! Quote Link to post Share on other sites
RobLewis 7 Posted October 27, 2013 Share Posted October 27, 2013 I'm new at all this, but will this work with the MSP430F5529 LaunchPad? If not, any guidelines for patching it? Quote Link to post Share on other sites
bluehash 1,581 Posted October 27, 2013 Share Posted October 27, 2013 I'm new at all this, but will this work with the MSP430F5529 LaunchPad? If not, any guidelines for patching it? @@chicken Quote Link to post Share on other sites
RobLewis 7 Posted October 28, 2013 Share Posted October 28, 2013 @@chicken If this is a joke, it's lost on me. Quote Link to post Share on other sites
Rickta59 589 Posted October 28, 2013 Share Posted October 28, 2013 If this is a joke, it's lost on me. if you use the '@' and a user's nickname it sends them an alert. bluehash was alerting chicken to look at your question. Quote Link to post Share on other sites
chicken 630 Posted October 28, 2013 Author Share Posted October 28, 2013 here as summoned I got the new LaunchPad this week and installed Energia 0010 a while ago, but hadn't time yet to test this library. As my I2C fixes to Energia 0009 were accepted into the main branch, in theory the library and example should work as provided without any patching. Please let me know if you run into issues - or even better, if it worked. Quote Link to post Share on other sites
RobLewis 7 Posted October 28, 2013 Share Posted October 28, 2013 I've ordered the sensor so when it arrives I will test and report. Also ordered the AM2302 temp/humidity sensor so we'll see how that goes, too. Quote Link to post Share on other sites
chicken 630 Posted November 5, 2013 Author Share Posted November 5, 2013 Tested with Energia 0101E0010 and the new F5529 LaunchPad. It works as expected if SDA/SCL are connected to pins P3.0 / P3.1, i.e. the same pins as with the G2553. The source of confusion is likely the F5529 quick start guide which shows I2C on pins P4.1 / P4.2, while Energia sticks to the backward compatible pin layout. Quote Link to post Share on other sites
abecedarian 330 Posted November 5, 2013 Share Posted November 5, 2013 @@chicken - any way to force MISO(1) / MOSI(1) / SCK(1) / CS(1) to the F5529 pins? P4.2/P4.1/P4.3/P4.0, respectively? Quote Link to post Share on other sites
RobLewis 7 Posted November 5, 2013 Share Posted November 5, 2013 Got the sensor, and with chicken's help got his demo example running. The only gotcha I encountered was that, according to the quick start guide, the F5529 LaunchPad defaults the I2C Clock and Data lines to pins 4.2 and 4.1, respectively. Who knows why? When I moved them to 3.1 and 3.0, it worked. (On this version of the LaunchPad, these latter pins are by default the SPI signals MISO and MOSI.) I also wired up an input pin to the optional EOC (end of conversion) signal from the sensor, and presumably that's working too to speed things up a bit. Quote Link to post Share on other sites
chicken 630 Posted November 5, 2013 Author Share Posted November 5, 2013 @@abecedarian From a quick glance at the source, Energia does only check whether USCI is present and then uses UCB0, which is wired to the same pins for G2553 and F5529. 4.2/4.1 would be UCB1. IMO, this makes sense as it maintains backward compatibility with the MSP430 LaunchPad. Too bad the quick start guide does not reflect this. Unlike for Stellaris/Tiva, the MSP430 implementation of Wire does not yet allow to set an alternative I2C module. PS: On the Tiva LaunchPad, the pins in question are actually connected with 0-ohm resistors (R9/R10), which caused its own set of confusion abecedarian 1 Quote Link to post Share on other sites
abecedarian 330 Posted November 11, 2013 Share Posted November 11, 2013 Would be nice to be able to access other peripherals with similar functionality though. ;-) As in, it would be nice to be able to mix I2C and SPI devices together, easily. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.