RobLewis 7 Posted May 3, 2015 Share Posted May 3, 2015 Reflecting on this a bit more, I wonder if one of the later Energia updates somehow broke the I2C driver when the F5529 (and possibly other boards) is run at 16 MHz. And of course that 8-bit patch needs to be mainlined, eh? bogdanvisan20 1 Quote Link to post Share on other sites
bogdanvisan20 0 Posted October 9, 2015 Share Posted October 9, 2015 Hi RobLewis, I have the same problem, reading 0.0C and 2hPa. Did you find any solution in the mean time? Quote Link to post Share on other sites
bogdanvisan20 0 Posted October 10, 2015 Share Posted October 10, 2015 I tried it with Energia 0101E0010 and it works. But the DHT22 libraries don't work with this Eenergia version. Does anyone know how to adapt it for the last Energia version? Quote Link to post Share on other sites
RobLewis 7 Posted October 11, 2015 Share Posted October 11, 2015 Everything I know about this issue is contained in my previous posts, particularly those from last May 3. I don't know whether @@chicken might have any additional insights, or whether Energia has been patched to fix the apparent timing problem. Quote Link to post Share on other sites
chicken 630 Posted October 11, 2015 Author Share Posted October 11, 2015 I haven't played with this for a long time. I see that there are several recent I2C related commits for Energia on Github, so maybe worth to clone the project and copying the hardware/msp430 tree into an Energia 16 tree. Maybe I will spend this Sunday afternoon trying it myself. Quote Link to post Share on other sites
chicken 630 Posted October 11, 2015 Author Share Posted October 11, 2015 @@RobLewis @@bogdanvisan20 Ok, I rewrote the I2C part of the library so that it properly uses beginTransmission and endTransmission() and it now seems to work with Energia 16 and the G2 launchpad. I remember that I had to fudge with begin/endTransmission originally to work around oddities of the Energia I2C implementation. It looks like Energia is fixed now and my workarounds are broken. Below the corrected bit of code (towards the bottom of BMP085_t.h). I will update it on GitHub shortly. // send command to BMP085 void m_sendCmd(uint8_t cmd) { Wire.beginTransmission(i2caddress); Wire.write(byte(BMP085_REG_CTRL)); Wire.write(byte(cmd)); Wire.endTransmission(); } // read 8 bits from I2C uint8_t m_read8(uint8_t addr) { uint8_t ret; Wire.beginTransmission(i2caddress); Wire.write(addr); Wire.endTransmission(); Wire.beginTransmission(i2caddress); Wire.requestFrom(i2caddress, (uint8_t)1); // need to cast int to avoid compiler warnings ret = Wire.read(); Wire.endTransmission(); return ret; }; // read 16 bits from I2C uint16_t m_read16(uint8_t addr) { uint16_t ret; Wire.beginTransmission(i2caddress); Wire.write(addr); Wire.endTransmission(); Wire.beginTransmission(i2caddress); Wire.requestFrom(i2caddress, (uint8_t)2); // need to cast int to avoid compiler warnings ret = (Wire.read() << 8) | Wire.read(); Wire.endTransmission(); return ret; }; Fmilburn 1 Quote Link to post Share on other sites
RobLewis 7 Posted October 15, 2015 Share Posted October 15, 2015 Very cool, thanks @@chicken! Do you have any idea whether this may restore the routine's ability to work at a 16MHz clock rate in the F5529? (I found that in later versions of Energia even the patched code would only work at 25 MHz). Quote Link to post Share on other sites
Towhid 2 Posted December 19, 2015 Share Posted December 19, 2015 hello ...i am very new to this world...i have to interface bosch bme280 with msp432 launchpad...i have done 12c interface and have been able to see the output in serial monitor of energia ...i have a sharp lcd boosterpack and have to show the sensor output there but dont know how ..can anyone help ?? Quote Link to post Share on other sites
chicken 630 Posted December 19, 2015 Author Share Posted December 19, 2015 @@Towhid you could try my Energia library for the same LCD https://github.com/astuder/MSP430-sharp-LS013B4DN02-memory-display Quote Link to post Share on other sites
hyte 0 Posted January 10, 2016 Share Posted January 10, 2016 1 Thanks for this library, very useful 2 I have been struggling for a long time to get this to work. I tried energia v17 and it wouldn't work but the cause wasn't obvious to me. So i tried many things and wories I'd fried something. Changing to energia v16 it worked immediately I have an msp430g2553 with msp-exp430g2 rev1.3. I have also removed c24 and r34 (I can't remember why) and have txd and rxd cross jumpered. I am running a BMP85 chip that I've soldered myself with 5k pullups and decoupling cap. Hope this helps someone Quote Link to post Share on other sites
chicken 630 Posted January 10, 2016 Author Share Posted January 10, 2016 I haven't tried Energia 17 myself yet. I've read somewhere that I2C was moved to different pins, but not sure if that also applies to the G2553 LP. Quote Link to post Share on other sites
Martaet 0 Posted September 1, 2016 Share Posted September 1, 2016 in my NSpace demos renders and fills polygons too, even in different states of flipping and rotation. Not sure how that library compares but it would be interesting to find out. Quote Link to post Share on other sites
denzel 0 Posted April 18, 2017 Share Posted April 18, 2017 On 12/19/2015 at 2:58 PM, Towhid said: hello ...i am very new to this world...i have to interface bosch bme280 with msp432 launchpad...i have done 12c interface and have been able to see the output in serial monitor of energia ...i have a sharp lcd boosterpack and have to show the sensor output there but dont know how ..can anyone help ?? Could you share the code for this? Quote Link to post Share on other sites
TranVinhPhuc 0 Posted December 10, 2017 Share Posted December 10, 2017 Hello @chicken im using your Library with Energia 0101E0017 and it not work with MSP430G2253 . Cant you help me !!! Quote Link to post Share on other sites
Rei Vilo 695 Posted December 10, 2017 Share Posted December 10, 2017 See 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.