-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C Wire Library not working with G2553 LP #486
Comments
How surprising! Can you share the code? |
It's just the master_write code from the examples. I have the pull ups and the same "booster pack" works (at least there's an i2c signal) with the 5529 LP |
The I²C bus on pins 9/10 isn't available for the MSP430G2553. You need to use the software I²C library instead. |
I understand that i2c isn't available on 9/10. On the 5529LP it is available (without additional config) on 14/15. I assumed that it would also be available on 14/15 on the G2553. |
Yes, that's the case. The I²C bus uses pins 14/15 on the MSP430G2553 and I'm using them on a daily basis. |
Ok, so that's what's not working. I don't see any data on 14/15 on the MSP-EXP430G2 with G2553 chip using Energia 13 |
Ok, now try the very same sketch with the previous release of Energia 0101E0012. |
Energia 12, same behavior -> nothing happens. |
I just realized that there also might be a hardware problem with this particular LP. I'll try once more with a second board (should be still be packaged up). |
@mringwal were you able to get this working? |
Thanks for reminding. So, I've just unwrapped another 430G2 and uploaded the master_writer example. Same result: I don't see anything on 14/15 yet. I did solve my actual problem using Rei's Software I2C, but using the lower level i2c routines directly. My I2c chip requires to check ACK/NACK after writing the address. I didn't see how to do that with the original Wire interface. So, if somebody has a few minutes of time and two extra pull-ups to VCC, please check i2c on a G2 board. .. and/or.. add the I2C docu from Arduino.cc plus mention where/how it can be used. |
Will try reproduce on monday. |
I just tried to reproduce but it's working for me. Make sure that you remove J5 (P1.6) to disable the connection to LED2 which interferes with SCL. |
Hi. Confirmed to be working after removing JP (P1.6), thanks for this little detail! So the new "issue" is: where/how should have I read that:
While technically obvious/trivial, almost everyone that will try to use i2c will just fail and be at the mercy of an issue tracker (filing non-issues) or the 430oh IRC channel (very helpful), or just complain on their favorite communication channel. |
Please refer to the pins maps specifically designed for Energia. for MSP430G2, http://energia.nu/pin-maps/guide_msp430g2launchpad/ |
Thank you! I remember that I was directed to this page after I couldn't get UART debut output as the jumpers had to be "rotated". == Wire interface, I2C == |
Robert has :0) I'm not saying the map is incorrect. It is correct. |
Yeah, probably worth a footnote on the Energia page. paging @robertinant ... Right under the "Serial port communication, Hardware UART" section near the bottom, something like this- I2C support
|
Website has been updated with a note on I2C. |
Thanks! |
Hey guys, I get this output in the Serial Monitor: The GY-521 has pull-up resistors on-board which I measured: The voltage from SDA-GND and SDL-GND is 3.3V. Does anybody have a suggestion how to find my mistake? |
Hi, |
Yes, I just sent a note again and requested the update. |
Hi Stefan and rei-vilo, I2C Scanner When I switch back to the old configuration (Pin1.7 -> SDA and Pin 1.6 -> SCL, and Jumper from Pin 1.6 to LED2 removed ) and include change the Wire.begin() to Wire.begin(0), I get the same output as in my first post: Scanning... Do you have any other suggestions? I have a GY-521 connected to the MSP430. The AD0 pin is connected to ground (then the device should have the address 0x68) and there are pull-up resistors on-board. It perfectly works with an Arduino Uno |
Hey, |
The only last thing I found is that, when I connect the SCL and SDA pins to GND and VCC, respectively, I get different outputs of the I2C scanner. For the connection to GND, I get: Unknown error at address ... (a long list with all addresses) and when I connect them both to VCC: I2C device found at address ... (a long list with all addresses) |
Did some more test and found that this might never has worked. |
fix is available with pull request #868 |
Thanks StefanSch. How can I try your mods on my side (procedure to include your changes)?thanks |
You can download the raw file from git hub and replace it within your energia system: They are located in this path: |
I am having the same problem as above. Just purchased a brand new Launchpad for G2 from TI. I attached a sensor to it. I am able to successfully communicate with the sensor and get data from it, however, when I run the scanner, I get a device found at all addresses, even though there is only a single sensor. |
Which I²C port are you using? Default I²C port uses pins 9 and 10 now. |
Pins 14/15. Aka P1.6/P1.7. Unable to communicate with my sensor and get valid data however the scanner |
Use default port. |
Excellent !! It does work when I use Pins 9 and 10. I was using pins 14 and 15. We have already built a circuit board based on the older spec from 2012. It showed pins 14 and 15 as the SCL/SDA pins. Where would I change the code to switch to pins 14 and 15 instead of the defaults. Surely it's configurable... |
add a |
YAY !!! It works !! I was having grief with it and then pulled my brain out and removed the Jumper that was attaching the LED to P1.6, and all things work correctly now. Thank you for your assistence !!! |
So, my Launchpad uses a 20 pin MPS430G2553 chip. On it, P1.6 is pin 14 and P1.7 is pin 15. However, TI makes a 28 pin MPS430G2553 chip. On it, P1.6 is pin 22 and P1.7 is pin 23. Is this going to cause problems using the library with Wire.setModule(0); specified? |
If you go to the 28 pin device the I2C should work as well as the I2C is on the same port pins. |
Sounds good. My colleague will be testing this on the 28 pin chip tomorrow. I have heard people express concerns about the efficiency of using Energia vs standard C code when programming the MSP430G2553 controller. They are worried about efficiency and about battery power. What is your opinion about the pros and cons of using Energia vs standard C code ? I LOVE the ease of use of the language and libraries. Nice to have a layer of abstraction over the direct calls that standard C requires. |
Thanks for the info - it always helps to get the confirmation that a fix is working. It is a good question to ask about the pros and cons of Energia vs standard c code. Finally let me try go give you an answer which expresses my opinion: Finally - even as i know the msp430 very well for many, many years i am contributing to this tool as i am convinced from the easy of use, the fast way of building applications and the ecosystem of launchpads and boosterpacks where it is build around. |
I really appreciate your help. I’m a 20 year Software Engineer, but have never worked with controllers and firmware before. This is a big learning curve, but Energia makes it MUCH easier.. This may not be the place for technical questions, but I’m trying to get Low Power Mode implemented and saw a couple postings where they use: disableWatchDog(); Both of the above statements make my code LOCK up when I attempt to use Serial or delay(); |
See sleep, sleepSeconds, suspend, and wakeup (the latter is meant for running inside ISRs). Note you can't use Serial port I/O in low power mode, so you should Serial.flush() (to flush any pending output) before using sleep/sleepSeconds/suspend. |
I wish I could download your brain... Thanks so much for your help!!
|
Hello guys, I'm currently trying to use my GY-521 but I'm having this i2c problem too, the scanner either founds devices everywhere or found nothing. I already replaced the twi files from the git hub solution above, and already tried pins 9/10 and 14/15, wire.setmodule(0) and everything else =/ |
Did you accidentally swap SCL with SDA? Did you add pull-up resisters? Did you remove the LED jumper from P1.6? The TWI files exist in more than one place. Did you replace them in all the places they exist on your machine? Thanks,
|
I am a lover of MSP430 launchPad! I have a problem with it. I use a MSP430G2553 as master write,and use another MSP430G2553 as slaver receiver , but slaver may receive none when writer send data to it. Where is Wrong? Thanks !Thanks!Thanks a lot! slaver receiver #include <Wire.h> void setup() void loop() // function that executes whenever data is received from master
} Master Write: #include <Wire.h> void setup() void loop() |
Many thanks to Stefansch, I struggled this problem for few days before read this topic. On launchpadg2553 just one I2C module and the default i2c pins are 9 and 10, not change to pin 14 and 15. |
I'm trying to use the BH1750 light sensor with the MSP430 G2553 void setup() { Serial.begin(9600); I cant get the sensors to work |
Use P1.7 for SDA and P1.8 for SCL. Google the particular board you are using and you should easily find a pinout for it indicating which pins to use. I’m not familiar with the sensor you’re trying to use, or its interface. Just make sure you’ve got the pins of your sensor on the correct pins of the Launchpad you are using. Again, google the board pinout and there should be several images to point you in the right direction.
Hope this helps,
Curtis
From: AB2203 [mailto:notifications@github.com]
Sent: Saturday, February 24, 2018 4:56 AM
To: energia/Energia <Energia@noreply.github.com>
Cc: curtis63 <curtiscode@gmail.com>; Comment <comment@noreply.github.com>
Subject: Re: [energia/Energia] I2C Wire Library not working with G2553 LP (#486)
I'm trying to use the BH1750 light sensor with the MSP430 G2553
I'm new to using the launchpad and microcontrollers.
This is the code:
#include <BH1750FVI.h> // Sensor Library
#include <Wire.h> // I2C Library
uint16_t Light_Intensity=0;
BH1750FVI LightSensor;
void setup() {
Serial.begin(9600);
LightSensor.begin();
LightSensor.SetAddress(Device_Address_H); //Address 0x5C
LightSensor.SetMode(Continuous_H_resolution_Mode);
Serial.println("Running...");
}
void loop()
{
Light_Intensity = LightSensor.GetLightIntensity();
Serial.print ("lux=");
Serial.print (Light_Intensity);
delay(1000);
}
I cant get the sensors to work
I'm confused about giving the connections and which pins to use for SCL and SDA
Any help will be great.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#486 (comment)> , or mute the thread <https://github.com/notifications/unsubscribe-auth/AQNhVD3yhwhZb1wgsVFt7si3-MdTpYGOks5tX_jIgaJpZM4Cr_Xy> . <https://github.com/notifications/beacon/AQNhVFn_Kw0CfVNUl6HxYyQFMo4XrDkmks5tX_jIgaJpZM4Cr_Xy.gif>
|
I don't see anything happen on pins 9/10 (p2.1/p2.2) or 14/15 (p1.6/p1.7) when running the master_write example from the Wire library.
Same example with the 5529LP has a working I2C on 14/15 (p3.0/p3.1).
It would be great, if the details of the Wire lib (it's not on the 9/10 as shown on the Booster Pack docu) could be added somewhere.
(I've connected a Logic16 to check the output)
The text was updated successfully, but these errors were encountered: