I2C Wire Library not working with G2553 LP #486

Closed
mringwal opened this Issue Oct 7, 2014 · 57 comments

Comments

Projects
None yet
@mringwal

mringwal commented Oct 7, 2014

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)

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Oct 7, 2014

Member

How surprising! Can you share the code?
Don't forget about external pull-up resistors. 10 kΩ are fine.

Member

rei-vilo commented Oct 7, 2014

How surprising! Can you share the code?
Don't forget about external pull-up resistors. 10 kΩ are fine.

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 7, 2014

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

mringwal commented Oct 7, 2014

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

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Oct 7, 2014

Member

The I²C bus on pins 9/10 isn't available for the MSP430G2553.

You need to use the software I²C library instead.

Member

rei-vilo commented Oct 7, 2014

The I²C bus on pins 9/10 isn't available for the MSP430G2553.

You need to use the software I²C library instead.

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 7, 2014

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.

mringwal commented Oct 7, 2014

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.

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Oct 7, 2014

Member

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.

Member

rei-vilo commented Oct 7, 2014

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.

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 7, 2014

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

mringwal commented Oct 7, 2014

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

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Oct 7, 2014

Member

Ok, now try the very same sketch with the previous release of Energia 0101E0012.

Member

rei-vilo commented Oct 7, 2014

Ok, now try the very same sketch with the previous release of Energia 0101E0012.

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 7, 2014

Energia 12, same behavior -> nothing happens.
Can I use the twi implementation directly?

mringwal commented Oct 7, 2014

Energia 12, same behavior -> nothing happens.
Can I use the twi implementation directly?

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 8, 2014

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 commented Oct 8, 2014

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).

@robertinant

This comment has been minimized.

Show comment
Hide comment
@robertinant

robertinant Oct 11, 2014

Member

@mringwal were you able to get this working?

Member

robertinant commented Oct 11, 2014

@mringwal were you able to get this working?

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 11, 2014

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.

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.

@robertinant

This comment has been minimized.

Show comment
Hide comment
@robertinant

robertinant Oct 11, 2014

Member

Will try reproduce on monday.

Member

robertinant commented Oct 11, 2014

Will try reproduce on monday.

@robertinant

This comment has been minimized.

Show comment
Hide comment
@robertinant

robertinant Oct 15, 2014

Member

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.

Member

robertinant commented Oct 15, 2014

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.

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 16, 2014

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:

  • I2C is on 14/15 and not on 9/10 as indicated on the LaunchPad pin outs
  • I have to remove JP5 to get it working?

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.

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:

  • I2C is on 14/15 and not on 9/10 as indicated on the LaunchPad pin outs
  • I have to remove JP5 to get it working?

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.

@mringwal mringwal closed this Oct 16, 2014

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Oct 16, 2014

Member

Please refer to the pins maps specifically designed for Energia.

for MSP430G2, http://energia.nu/pin-maps/guide_msp430g2launchpad/

Member

rei-vilo commented Oct 16, 2014

Please refer to the pins maps specifically designed for Energia.

for MSP430G2, http://energia.nu/pin-maps/guide_msp430g2launchpad/

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 16, 2014

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".
Can we add a short paragraph on i2c there? Like..

== Wire interface, I2C ==
Please note that the I2C peripheral is on pins 14/15 instead of pin 9/10 as indicated on newer LaunchPad BoosterPack Pinouts. Please refer to the pin mapping here.
Also, LED2 is controlled via P1.6, which is used for I2C SCL. too. To use I2C, please remove jumper JP 5/P1.6

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".
Can we add a short paragraph on i2c there? Like..

== Wire interface, I2C ==
Please note that the I2C peripheral is on pins 14/15 instead of pin 9/10 as indicated on newer LaunchPad BoosterPack Pinouts. Please refer to the pin mapping here.
Also, LED2 is controlled via P1.6, which is used for I2C SCL. too. To use I2C, please remove jumper JP 5/P1.6

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Oct 16, 2014

Member

Unfortunately, I don't have access to the wiki section. But everything is clearly stated on the map:

capture 2014-10-16 a 12 52 35

Member

rei-vilo commented Oct 16, 2014

Unfortunately, I don't have access to the wiki section. But everything is clearly stated on the map:

capture 2014-10-16 a 12 52 35

@mringwal

This comment has been minimized.

Show comment
Hide comment
@mringwal

mringwal Oct 16, 2014

Robert has :0)

I'm not saying the map is incorrect. It is correct.

Robert has :0)

I'm not saying the map is incorrect. It is correct.

@spirilis

This comment has been minimized.

Show comment
Hide comment
@spirilis

spirilis Oct 16, 2014

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

  • All G2 LaunchPads - If you want to use Hardware I2C (Wire library) with SCL on P1.6 and SDA on P1.7, you need to supply external pullup resistors between P1.6-Vcc and P1.7-Vcc. Values under 10K ohm typically work; 4.7K is often quoted as a default. Note you should remove the P1.6 jumper down below (GREEN LED) so the LED doesn't interfere with the I2C SCL signal.

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

  • All G2 LaunchPads - If you want to use Hardware I2C (Wire library) with SCL on P1.6 and SDA on P1.7, you need to supply external pullup resistors between P1.6-Vcc and P1.7-Vcc. Values under 10K ohm typically work; 4.7K is often quoted as a default. Note you should remove the P1.6 jumper down below (GREEN LED) so the LED doesn't interfere with the I2C SCL signal.
@robertinant

This comment has been minimized.

Show comment
Hide comment
@robertinant

robertinant Oct 16, 2014

Member

Website has been updated with a note on I2C.

Member

robertinant commented Oct 16, 2014

Website has been updated with a note on I2C.

@mringwal

This comment has been minimized.

Show comment
Hide comment

Thanks!

@martin43211

This comment has been minimized.

Show comment
Hide comment
@martin43211

martin43211 Mar 23, 2016

Hey guys,
sorry to warm up this post again but I experience a problem with the I2C device addresses ALTHOUGH I took the jumper from Pin 1.6 to the LED out. I connected a GY-521 gyrosensor to Pin1.6 (SCA) and Pin1.7 (SCL). Pin AD0 is going to GND. VCC to VCC. I use the I2C scanner code from: http://playground.arduino.cc/Main/I2cScanner

I get this output in the Serial Monitor:
Scanning...Found Address 0x01,
Scanning...
I2C device found at address 0x01 !
I2C device found at address 0x02 !
I2C device found at address 0x03 !
I2C device found at address 0x04 !
I2C device found at address 0x05 !
I2C device found at address 0x06 !
I2C device found at address 0x07 !
I2C device found at address 0x08 !
I2C device found at address 0x09 !
I2C device found at address 0x0A !
I2C device found at address 0x0B !
I2C device found at address 0x0C !
I2C device found at address 0x0D !
I2C device found at address 0x0E !
I2C device found at address 0x0F !
I2C device found at address 0x10 !
I2C device found at address 0x11 !
I2C device found at address 0x12 !
I2C device found at address 0x13 !
I2C device found at address 0x14 !
I2C device found at address 0x15 !
I2C device found at address 0x16 !
I2C device found at address 0x17 !
I2C device found at address 0x18 !
I2C device found at address 0x19 !
I2C device found at address 0x1A !
I2C device found at address 0x1B !
I2C device found at address 0x1C !
I2C device found at address 0x1D !
I2C device found at address 0x1E !
I2C device found at address 0x1F !
I2C device found at address 0x20 !
I2C device found at address 0x21 !
I2C device found at address 0x22 !
I2C device found at address 0x23 !
I2C device found at address 0x24 !
I2C device found at address 0x25 !
I2C device found at address 0x26 !
I2C device found at address 0x27 !
I2C device found at address 0x28 !
I2C device found at address 0x29 !
I2C device found at address 0x2A !
I2C device found at address 0x2B !
I2C device found at address 0x2C !
I2C device found at address 0x2D !
I2C device found at address 0x2E !
I2C device found at address 0x2F !
I2C device found at address 0x30 !
I2C device found at address 0x31 !
I2C device found at address 0x32 !
I2C device found at address 0x33 !
I2C device found at address 0x34 !
I2C device found at address 0x35 !
I2C device found at address 0x36 !
I2C device found at address 0x37 !
I2C device found at address 0x38 !
I2C device found at address 0x39 !
I2C device found at address 0x3A !
I2C device found at address 0x3B !
I2C device found at address 0x3C !
I2C device found at address 0x3D !
I2C device found at address 0x3E !
I2C device found at address 0x3F !
I2C device found at address 0x40 !
I2C device found at address 0x41 !
I2C device found at address 0x42 !
I2C device found at address 0x43 !
I2C device found at address 0x44 !
I2C device found at address 0x45 !
I2C device found at address 0x46 !
I2C device found at address 0x47 !
I2C device found at address 0x48 !
I2C device found at address 0x49 !
I2C device found at address 0x4A !
I2C device found at address 0x4B !
I2C device found at address 0x4C !
I2C device found at address 0x4D !
I2C device found at address 0x4E !
I2C device found at address 0x4F !
I2C device found at address 0x50 !
I2C device found at address 0x51 !
I2C device found at address 0x52 !
I2C device found at address 0x53 !
I2C device found at address 0x54 !
I2C device found at address 0x55 !
I2C device found at address 0x56 !
I2C device found at address 0x57 !
I2C device found at address 0x58 !
I2C device found at address 0x59 !
I2C device found at address 0x5A !
I2C device found at address 0x5B !
I2C device found at address 0x5C !
I2C device found at address 0x5D !
I2C device found at address 0x5E !
I2C device found at address 0x5F !
I2C device found at address 0x60 !
I2C device found at address 0x61 !
I2C device found at address 0x62 !
I2C device found at address 0x63 !
I2C device found at address 0x64 !
I2C device found at address 0x65 !
I2C device found at address 0x66 !
I2C device found at address 0x67 !
I2C device found at address 0x68 !
I2C device found at address 0x69 !
I2C device found at address 0x6A !
I2C device found at address 0x6B !
I2C device found at address 0x6C !
I2C device found at address 0x6D !
I2C device found at address 0x6E !
I2C device found at address 0x6F !
I2C device found at address 0x70 !
I2C device found at address 0x71 !
I2C device found at address 0x72 !
I2C device found at address 0x73 !
I2C device found at address 0x74 !
I2C device found at address 0x75 !
I2C device found at address 0x76 !
I2C device found at address 0x77 !
I2C device found at address 0x78 !
I2C device found at address 0x79 !
I2C device found at address 0x7A !
I2C device found at address 0x7B !
I2C device found at address 0x7C !
I2C device found at address 0x7D !
I2C device found at address 0x7E !
done

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?
Cheers and thanks in advance,
M

Hey guys,
sorry to warm up this post again but I experience a problem with the I2C device addresses ALTHOUGH I took the jumper from Pin 1.6 to the LED out. I connected a GY-521 gyrosensor to Pin1.6 (SCA) and Pin1.7 (SCL). Pin AD0 is going to GND. VCC to VCC. I use the I2C scanner code from: http://playground.arduino.cc/Main/I2cScanner

I get this output in the Serial Monitor:
Scanning...Found Address 0x01,
Scanning...
I2C device found at address 0x01 !
I2C device found at address 0x02 !
I2C device found at address 0x03 !
I2C device found at address 0x04 !
I2C device found at address 0x05 !
I2C device found at address 0x06 !
I2C device found at address 0x07 !
I2C device found at address 0x08 !
I2C device found at address 0x09 !
I2C device found at address 0x0A !
I2C device found at address 0x0B !
I2C device found at address 0x0C !
I2C device found at address 0x0D !
I2C device found at address 0x0E !
I2C device found at address 0x0F !
I2C device found at address 0x10 !
I2C device found at address 0x11 !
I2C device found at address 0x12 !
I2C device found at address 0x13 !
I2C device found at address 0x14 !
I2C device found at address 0x15 !
I2C device found at address 0x16 !
I2C device found at address 0x17 !
I2C device found at address 0x18 !
I2C device found at address 0x19 !
I2C device found at address 0x1A !
I2C device found at address 0x1B !
I2C device found at address 0x1C !
I2C device found at address 0x1D !
I2C device found at address 0x1E !
I2C device found at address 0x1F !
I2C device found at address 0x20 !
I2C device found at address 0x21 !
I2C device found at address 0x22 !
I2C device found at address 0x23 !
I2C device found at address 0x24 !
I2C device found at address 0x25 !
I2C device found at address 0x26 !
I2C device found at address 0x27 !
I2C device found at address 0x28 !
I2C device found at address 0x29 !
I2C device found at address 0x2A !
I2C device found at address 0x2B !
I2C device found at address 0x2C !
I2C device found at address 0x2D !
I2C device found at address 0x2E !
I2C device found at address 0x2F !
I2C device found at address 0x30 !
I2C device found at address 0x31 !
I2C device found at address 0x32 !
I2C device found at address 0x33 !
I2C device found at address 0x34 !
I2C device found at address 0x35 !
I2C device found at address 0x36 !
I2C device found at address 0x37 !
I2C device found at address 0x38 !
I2C device found at address 0x39 !
I2C device found at address 0x3A !
I2C device found at address 0x3B !
I2C device found at address 0x3C !
I2C device found at address 0x3D !
I2C device found at address 0x3E !
I2C device found at address 0x3F !
I2C device found at address 0x40 !
I2C device found at address 0x41 !
I2C device found at address 0x42 !
I2C device found at address 0x43 !
I2C device found at address 0x44 !
I2C device found at address 0x45 !
I2C device found at address 0x46 !
I2C device found at address 0x47 !
I2C device found at address 0x48 !
I2C device found at address 0x49 !
I2C device found at address 0x4A !
I2C device found at address 0x4B !
I2C device found at address 0x4C !
I2C device found at address 0x4D !
I2C device found at address 0x4E !
I2C device found at address 0x4F !
I2C device found at address 0x50 !
I2C device found at address 0x51 !
I2C device found at address 0x52 !
I2C device found at address 0x53 !
I2C device found at address 0x54 !
I2C device found at address 0x55 !
I2C device found at address 0x56 !
I2C device found at address 0x57 !
I2C device found at address 0x58 !
I2C device found at address 0x59 !
I2C device found at address 0x5A !
I2C device found at address 0x5B !
I2C device found at address 0x5C !
I2C device found at address 0x5D !
I2C device found at address 0x5E !
I2C device found at address 0x5F !
I2C device found at address 0x60 !
I2C device found at address 0x61 !
I2C device found at address 0x62 !
I2C device found at address 0x63 !
I2C device found at address 0x64 !
I2C device found at address 0x65 !
I2C device found at address 0x66 !
I2C device found at address 0x67 !
I2C device found at address 0x68 !
I2C device found at address 0x69 !
I2C device found at address 0x6A !
I2C device found at address 0x6B !
I2C device found at address 0x6C !
I2C device found at address 0x6D !
I2C device found at address 0x6E !
I2C device found at address 0x6F !
I2C device found at address 0x70 !
I2C device found at address 0x71 !
I2C device found at address 0x72 !
I2C device found at address 0x73 !
I2C device found at address 0x74 !
I2C device found at address 0x75 !
I2C device found at address 0x76 !
I2C device found at address 0x77 !
I2C device found at address 0x78 !
I2C device found at address 0x79 !
I2C device found at address 0x7A !
I2C device found at address 0x7B !
I2C device found at address 0x7C !
I2C device found at address 0x7D !
I2C device found at address 0x7E !
done

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?
Cheers and thanks in advance,
M

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Mar 24, 2016

Hi,
with Energia17 the default pins for the I2C have been changed to pin 9 and 10 so that it is consistent for all Launchpads. Unfortunately the pin map picture for this Launchpad have not been updated so far.
So either connect to the pins 9 and 10 or switch to the alternate I2C bus with
Wire.begin(0); // join i2c bus (address optional for master)
or
setModule(0);

Hi,
with Energia17 the default pins for the I2C have been changed to pin 9 and 10 so that it is consistent for all Launchpads. Unfortunately the pin map picture for this Launchpad have not been updated so far.
So either connect to the pins 9 and 10 or switch to the alternate I2C bus with
Wire.begin(0); // join i2c bus (address optional for master)
or
setModule(0);

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Mar 24, 2016

Member

I've updated the pins map some time ago but it hasn't been published.

launchpads msp430g2 pins maps

Member

rei-vilo commented Mar 24, 2016

I've updated the pins map some time ago but it hasn't been published.

launchpads msp430g2 pins maps

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Mar 24, 2016

Yes, I just sent a note again and requested the update.

Yes, I just sent a note again and requested the update.

@martin43211

This comment has been minimized.

Show comment
Hide comment
@martin43211

martin43211 Mar 25, 2016

Hi Stefan and rei-vilo,
thanks for your fast replies and inputs. So I tried switching the SDA and SCL ports from pins 1.7 and 1.6, respectively to pins 2.2 and 2.1 and did NOT change the Wire.begin(); in the example from:
http://playground.arduino.cc/Main/I2cScanner
Then the I2C scanner gives out this:

I2C Scanner
Scanning...
Unknow error at address 0x01
Unknow error at address 0x02
Unknow error at address 0x03
Unknow error at address 0x04
Unknow error at address 0x05
Unknow error at address 0x06
Unknow error at address 0x07
Unknow error at address 0x08
Unknow error at address 0x09
Unknow error at address 0x0A
Unknow error at address 0x0B
Unknow error at address 0x0C
Unknow error at address 0x0D
Unknow error at address 0x0E
Unknow error at address 0x0F
Unknow error at address 0x10
Unknow error at address 0x11
Unknow error at address 0x12
Unknow error at address 0x13
Unknow error at address 0x14
Unknow error at address 0x15
Unknow error at address 0x16
Unknow error at address 0x17
Unknow error at address 0x18
Unknow error at address 0x19
Unknow error at address 0x1A
Unknow error at address 0x1B
Unknow error at address 0x1C
Unknow error at address 0x1D
Unknow error at address 0x1E
Unknow error at address 0x1F
Unknow error at address 0x20
Unknow error at address 0x21
Unknow error at address 0x22
Unknow error at address 0x23
Unknow error at address 0x24
Unknow error at address 0x25
Unknow error at address 0x26
Unknow error at address 0x27
Unknow error at address 0x28
Unknow error at address 0x29
Unknow error at address 0x2A
Unknow error at address 0x2B
Unknow error at address 0x2C
Unknow error at address 0x2D
Unknow error at address 0x2E
Unknow error at address 0x2F
Unknow error at address 0x30
Unknow error at address 0x31
Unknow error at address 0x32
Unknow error at address 0x33
Unknow error at address 0x34
Unknow error at address 0x35
Unknow error at address 0x36
Unknow error at address 0x37
Unknow error at address 0x38
Unknow error at address 0x39
Unknow error at address 0x3A
Unknow error at address 0x3B
Unknow error at address 0x3C
Unknow error at address 0x3D
Unknow error at address 0x3E
Unknow error at address 0x3F
Unknow error at address 0x40
Unknow error at address 0x41
Unknow error at address 0x42
Unknow error at address 0x43
Unknow error at address 0x44
Unknow error at address 0x45
Unknow error at address 0x46
Unknow error at address 0x47
Unknow error at address 0x48
Unknow error at address 0x49
Unknow error at address 0x4A
Unknow error at address 0x4B
Unknow error at address 0x4C
Unknow error at address 0x4D
Unknow error at address 0x4E
Unknow error at address 0x4F
Unknow error at address 0x50
Unknow error at address 0x51
Unknow error at address 0x52
Unknow error at address 0x53
Unknow error at address 0x54
Unknow error at address 0x55
Unknow error at address 0x56
Unknow error at address 0x57
Unknow error at address 0x58
Unknow error at address 0x59
Unknow error at address 0x5A
Unknow error at address 0x5B
Unknow error at address 0x5C
Unknow error at address 0x5D
Unknow error at address 0x5E
Unknow error at address 0x5F
Unknow error at address 0x60
Unknow error at address 0x61
Unknow error at address 0x62
Unknow error at address 0x63
Unknow error at address 0x64
Unknow error at address 0x65
Unknow error at address 0x66
Unknow error at address 0x67
Unknow error at address 0x68
Unknow error at address 0x69
Unknow error at address 0x6A
Unknow error at address 0x6B
Unknow error at address 0x6C
Unknow error at address 0x6D
Unknow error at address 0x6E
Unknow error at address 0x6F
Unknow error at address 0x70
Unknow error at address 0x71
Unknow error at address 0x72
Unknow error at address 0x73
Unknow error at address 0x74
Unknow error at address 0x75
Unknow error at address 0x76
Unknow error at address 0x77
Unknow error at address 0x78
Unknow error at address 0x79
Unknow error at address 0x7A
Unknow error at address 0x7B
Unknow error at address 0x7C
Unknow error at address 0x7D
Unknow error at address 0x7E
No I2C devices found

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...
I2C device found at address 0x01 !
...you get the picture.

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

Hi Stefan and rei-vilo,
thanks for your fast replies and inputs. So I tried switching the SDA and SCL ports from pins 1.7 and 1.6, respectively to pins 2.2 and 2.1 and did NOT change the Wire.begin(); in the example from:
http://playground.arduino.cc/Main/I2cScanner
Then the I2C scanner gives out this:

I2C Scanner
Scanning...
Unknow error at address 0x01
Unknow error at address 0x02
Unknow error at address 0x03
Unknow error at address 0x04
Unknow error at address 0x05
Unknow error at address 0x06
Unknow error at address 0x07
Unknow error at address 0x08
Unknow error at address 0x09
Unknow error at address 0x0A
Unknow error at address 0x0B
Unknow error at address 0x0C
Unknow error at address 0x0D
Unknow error at address 0x0E
Unknow error at address 0x0F
Unknow error at address 0x10
Unknow error at address 0x11
Unknow error at address 0x12
Unknow error at address 0x13
Unknow error at address 0x14
Unknow error at address 0x15
Unknow error at address 0x16
Unknow error at address 0x17
Unknow error at address 0x18
Unknow error at address 0x19
Unknow error at address 0x1A
Unknow error at address 0x1B
Unknow error at address 0x1C
Unknow error at address 0x1D
Unknow error at address 0x1E
Unknow error at address 0x1F
Unknow error at address 0x20
Unknow error at address 0x21
Unknow error at address 0x22
Unknow error at address 0x23
Unknow error at address 0x24
Unknow error at address 0x25
Unknow error at address 0x26
Unknow error at address 0x27
Unknow error at address 0x28
Unknow error at address 0x29
Unknow error at address 0x2A
Unknow error at address 0x2B
Unknow error at address 0x2C
Unknow error at address 0x2D
Unknow error at address 0x2E
Unknow error at address 0x2F
Unknow error at address 0x30
Unknow error at address 0x31
Unknow error at address 0x32
Unknow error at address 0x33
Unknow error at address 0x34
Unknow error at address 0x35
Unknow error at address 0x36
Unknow error at address 0x37
Unknow error at address 0x38
Unknow error at address 0x39
Unknow error at address 0x3A
Unknow error at address 0x3B
Unknow error at address 0x3C
Unknow error at address 0x3D
Unknow error at address 0x3E
Unknow error at address 0x3F
Unknow error at address 0x40
Unknow error at address 0x41
Unknow error at address 0x42
Unknow error at address 0x43
Unknow error at address 0x44
Unknow error at address 0x45
Unknow error at address 0x46
Unknow error at address 0x47
Unknow error at address 0x48
Unknow error at address 0x49
Unknow error at address 0x4A
Unknow error at address 0x4B
Unknow error at address 0x4C
Unknow error at address 0x4D
Unknow error at address 0x4E
Unknow error at address 0x4F
Unknow error at address 0x50
Unknow error at address 0x51
Unknow error at address 0x52
Unknow error at address 0x53
Unknow error at address 0x54
Unknow error at address 0x55
Unknow error at address 0x56
Unknow error at address 0x57
Unknow error at address 0x58
Unknow error at address 0x59
Unknow error at address 0x5A
Unknow error at address 0x5B
Unknow error at address 0x5C
Unknow error at address 0x5D
Unknow error at address 0x5E
Unknow error at address 0x5F
Unknow error at address 0x60
Unknow error at address 0x61
Unknow error at address 0x62
Unknow error at address 0x63
Unknow error at address 0x64
Unknow error at address 0x65
Unknow error at address 0x66
Unknow error at address 0x67
Unknow error at address 0x68
Unknow error at address 0x69
Unknow error at address 0x6A
Unknow error at address 0x6B
Unknow error at address 0x6C
Unknow error at address 0x6D
Unknow error at address 0x6E
Unknow error at address 0x6F
Unknow error at address 0x70
Unknow error at address 0x71
Unknow error at address 0x72
Unknow error at address 0x73
Unknow error at address 0x74
Unknow error at address 0x75
Unknow error at address 0x76
Unknow error at address 0x77
Unknow error at address 0x78
Unknow error at address 0x79
Unknow error at address 0x7A
Unknow error at address 0x7B
Unknow error at address 0x7C
Unknow error at address 0x7D
Unknow error at address 0x7E
No I2C devices found

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...
I2C device found at address 0x01 !
...you get the picture.

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

@martin43211

This comment has been minimized.

Show comment
Hide comment
@martin43211

martin43211 Mar 25, 2016

Even if I directly ground the SCL and SDA pins, there should at least, no I2C device should be found but I still get the message, that all addresses are ocupied with I2C devices (same message as in my first post)

Even if I directly ground the SCL and SDA pins, there should at least, no I2C device should be found but I still get the message, that all addresses are ocupied with I2C devices (same message as in my first post)

@simseve

This comment has been minimized.

Show comment
Hide comment
@simseve

simseve Mar 27, 2016

Hi Martin,
did you solve? I have same exact issue. I2C scanner works in Arduino but not on the MSP430 and behaves exactly like you described.

simseve commented Mar 27, 2016

Hi Martin,
did you solve? I have same exact issue. I2C scanner works in Arduino but not on the MSP430 and behaves exactly like you described.

@martin43211

This comment has been minimized.

Show comment
Hide comment
@martin43211

martin43211 Mar 27, 2016

Hi simseve,
unfortunately no. I could not figure it out. Did you try to attach the MSP to the Arduino and use the I2C scanner? I tried but the arduino does not 'see' the MSP when they are connected via I²C. Does anybody else have an idea

Hi simseve,
unfortunately no. I could not figure it out. Did you try to attach the MSP to the Arduino and use the I2C scanner? I tried but the arduino does not 'see' the MSP when they are connected via I²C. Does anybody else have an idea

@simseve

This comment has been minimized.

Show comment
Hide comment
@simseve

simseve Mar 27, 2016

Hi,
I just saw that Wire library folder was empty on my Mac. I'm downloading the library again.

simseve commented Mar 27, 2016

Hi,
I just saw that Wire library folder was empty on my Mac. I'm downloading the library again.

@martin43211

This comment has been minimized.

Show comment
Hide comment
@martin43211

martin43211 Mar 27, 2016

Hey,
the Wire.h and Wire.cpp are in the MPS430/cores/ folder and I found that this should not be a problem. Moved them to MSP430/libraries/Wire and still there is no effect except that I can now add the Wire.h library in Energia via Sketch -> Import Libraries which was not possible before.
Unfortunately I have no idea anymore and will use the Arduino for now since I just started with µCs and don't want to frustrate myself right from the start. Would be interested though if you find a solution.

Hey,
the Wire.h and Wire.cpp are in the MPS430/cores/ folder and I found that this should not be a problem. Moved them to MSP430/libraries/Wire and still there is no effect except that I can now add the Wire.h library in Energia via Sketch -> Import Libraries which was not possible before.
Unfortunately I have no idea anymore and will use the Arduino for now since I just started with µCs and don't want to frustrate myself right from the start. Would be interested though if you find a solution.

@martin43211

This comment has been minimized.

Show comment
Hide comment
@martin43211

martin43211 Mar 27, 2016

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)

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)

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Apr 6, 2016

Did some more test and found that this might never has worked.
Just commited a version which does support the scanning of the I2C slaves:
https://github.com/energia/Energia/pull/868/files

Did some more test and found that this might never has worked.
Just commited a version which does support the scanning of the I2C slaves:
https://github.com/energia/Energia/pull/868/files

@StefanSch StefanSch reopened this Apr 6, 2016

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Apr 7, 2016

fix is available with pull request #868

fix is available with pull request #868

@StefanSch StefanSch closed this Apr 7, 2016

@simseve

This comment has been minimized.

Show comment
Hide comment
@simseve

simseve Apr 7, 2016

Thanks StefanSch. How can I try your mods on my side (procedure to include your changes)?thanks

simseve commented Apr 7, 2016

Thanks StefanSch. How can I try your mods on my side (procedure to include your changes)?thanks

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Apr 7, 2016

You can download the raw file from git hub and replace it within your energia system:
https://raw.githubusercontent.com/energia/Energia/issue_486/hardware/msp430/cores/msp430/twi.c
https://raw.githubusercontent.com/energia/Energia/issue_486/hardware/msp430/cores/msp430/twi_sw.c

They are located in this path:
.../hardware/msp430/cores/msp430

You can download the raw file from git hub and replace it within your energia system:
https://raw.githubusercontent.com/energia/Energia/issue_486/hardware/msp430/cores/msp430/twi.c
https://raw.githubusercontent.com/energia/Energia/issue_486/hardware/msp430/cores/msp430/twi_sw.c

They are located in this path:
.../hardware/msp430/cores/msp430

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 8, 2016

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.

curtis63 commented Apr 8, 2016

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.

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Apr 8, 2016

Member

Which I²C port are you using?

Default I²C port uses pins 9 and 10 now.

Member

rei-vilo commented Apr 8, 2016

Which I²C port are you using?

Default I²C port uses pins 9 and 10 now.

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
Member

rei-vilo commented Apr 8, 2016

msp430g2553

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 8, 2016

Pins 14/15. Aka P1.6/P1.7.

Unable to communicate with my sensor and get valid data however the scanner
program does not work. It shows something at every address.

curtis63 commented Apr 8, 2016

Pins 14/15. Aka P1.6/P1.7.

Unable to communicate with my sensor and get valid data however the scanner
program does not work. It shows something at every address.

@rei-vilo

This comment has been minimized.

Show comment
Hide comment
@rei-vilo

rei-vilo Apr 8, 2016

Member

Use default port.

Member

rei-vilo commented Apr 8, 2016

Use default port.

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 11, 2016

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...

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...

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Apr 11, 2016

add a
Wire.setModule(0); // 0: indicates the bus as shown in the pin map
before the
Wire.begin(); // join i2c bus (address optional for master)

add a
Wire.setModule(0); // 0: indicates the bus as shown in the pin map
before the
Wire.begin(); // join i2c bus (address optional for master)

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 11, 2016

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 !!!

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 !!!

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 11, 2016

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.
P1.4 is pin 6 and P1.5 is pin 7 on both the 20 pin and the 28 pin MPS430G2553 chip.

Is this going to cause problems using the library with Wire.setModule(0); specified?

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.
P1.4 is pin 6 and P1.5 is pin 7 on both the 20 pin and the 28 pin MPS430G2553 chip.

Is this going to cause problems using the library with Wire.setModule(0); specified?

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Apr 12, 2016

If you go to the 28 pin device the I2C should work as well as the I2C is on the same port pins.
And this is set in the
....\hardware\msp430\variants\launchpad\pins_energia.h
file.
But you will get a lot of issues on the other pins as the mapping of the pin assigned to the Launchpad and the device will not map.
So you may should consider to generate a own pins_energia.h if this is required.

If you go to the 28 pin device the I2C should work as well as the I2C is on the same port pins.
And this is set in the
....\hardware\msp430\variants\launchpad\pins_energia.h
file.
But you will get a lot of issues on the other pins as the mapping of the pin assigned to the Launchpad and the device will not map.
So you may should consider to generate a own pins_energia.h if this is required.

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 12, 2016

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.

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.

@StefanSch

This comment has been minimized.

Show comment
Hide comment
@StefanSch

StefanSch Apr 13, 2016

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.
I am sure we could have a discussion over a whole evening with some beers.
... and it could also become very philosophic.....

Finally let me try go give you an answer which expresses my opinion:
If you need to have a code which is optimized to the final line of code for either execution speed or energy consumption Energia is the wrong tool.
If you would like to have a fast prototype or if you not have the time, passion and technical understanding to go down to each configuration bit of a microcontroller energia is a perfect tool.
Anything between is up to the user.
If you look for efficiency and battery power you can also with Energia build systems which are highly efficient and working for a very long time. But there are some considerations and limitations you may need to be aware of. If you ratio of active time to low power mode time is very high - means you are long time in low power modes, then you will most properly not see a big difference.
If you have to wake up very often the it depends if the wake up is mainly handled in an interrupt service routine / handler then it also depends only on your programming skills and on how you have configured the systems.
If you wake up very often and always have to go through the loop function then you can might see a higher current consumption in energia.
But keep in mind this always depends on how well you know the microcontroller and your skills to optimize your application code for the lowest power consumption base on this device and your use case.

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.
It makes so many things so easy..... just do it .....

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.
I am sure we could have a discussion over a whole evening with some beers.
... and it could also become very philosophic.....

Finally let me try go give you an answer which expresses my opinion:
If you need to have a code which is optimized to the final line of code for either execution speed or energy consumption Energia is the wrong tool.
If you would like to have a fast prototype or if you not have the time, passion and technical understanding to go down to each configuration bit of a microcontroller energia is a perfect tool.
Anything between is up to the user.
If you look for efficiency and battery power you can also with Energia build systems which are highly efficient and working for a very long time. But there are some considerations and limitations you may need to be aware of. If you ratio of active time to low power mode time is very high - means you are long time in low power modes, then you will most properly not see a big difference.
If you have to wake up very often the it depends if the wake up is mainly handled in an interrupt service routine / handler then it also depends only on your programming skills and on how you have configured the systems.
If you wake up very often and always have to go through the loop function then you can might see a higher current consumption in energia.
But keep in mind this always depends on how well you know the microcontroller and your skills to optimize your application code for the lowest power consumption base on this device and your use case.

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.
It makes so many things so easy..... just do it .....

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 13, 2016

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();
and
LPM4;

Both of the above statements make my code LOCK up when I attempt to use Serial or delay();
Do you know a good work-around for this?
I want to be in low power mode most of the time, and wake up when a sensor interrupts on a port.
Where should I look for Energia support functions for this?

curtis63 commented Apr 13, 2016

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();
and
LPM4;

Both of the above statements make my code LOCK up when I attempt to use Serial or delay();
Do you know a good work-around for this?
I want to be in low power mode most of the time, and wake up when a sensor interrupts on a port.
Where should I look for Energia support functions for this?

@spirilis

This comment has been minimized.

Show comment
Hide comment
@spirilis

spirilis Apr 13, 2016

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.

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.

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 13, 2016

I wish I could download your brain... Thanks so much for your help!!
On Apr 13, 2016 11:07 AM, "Eric" notifications@github.com wrote:

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() before using sleep/sleepSeconds/suspend.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#486 (comment)

I wish I could download your brain... Thanks so much for your help!!
On Apr 13, 2016 11:07 AM, "Eric" notifications@github.com wrote:

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() before using sleep/sleepSeconds/suspend.


You are receiving this because you commented.
Reply to this email directly or view it on GitHub
#486 (comment)

@walber000

This comment has been minimized.

Show comment
Hide comment
@walber000

walber000 Apr 23, 2016

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 =/
May anyone help me?
P.S: when I read it, it only gives 0's or -1's

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 =/
May anyone help me?
P.S: when I read it, it only gives 0's or -1's

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Apr 23, 2016

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,
Curtis

On Apr 23, 2016, at 10:15 AM, walber000 notifications@github.com wrote:

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 =/
May anyone help me?
P.S: when I read it, it only gives 0's or -1's


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

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,
Curtis

On Apr 23, 2016, at 10:15 AM, walber000 notifications@github.com wrote:

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 =/
May anyone help me?
P.S: when I read it, it only gives 0's or -1's


You are receiving this because you commented.
Reply to this email directly or view it on GitHub

@adnion adnion referenced this issue in jrowberg/i2cdevlib Dec 7, 2016

Open

msp430_i2c.c: cannot open source file "i2c.h" #74

@SunYongshuai

This comment has been minimized.

Show comment
Hide comment
@SunYongshuai

SunYongshuai Jan 16, 2017

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!
code as follow :

slaver receiver

#include <Wire.h>

void setup()
{
pinMode(2,OUTPUT);
pinMode(14, INPUT_PULLUP);
pinMode(15, INPUT_PULLUP);
digitalWrite(2,LOW); //pin 2 is a LED
Wire.begin(4); // join i2c bus with address #4
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}

void loop()
{
delay(100);
}

// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany)
{
while(Wire.available()) // loop through all but the last
{
int x = Wire.read(); // receive byte as a int
if(x == 1)
digitalWrite(2 , HIGH);
else
digitalWrite(2 , LOW);

Serial.print("Wire!\t");
Serial.println(x);         // print the integer

}
}

Master Write:

#include <Wire.h>
int x = 0;

void setup()
{
Serial.begin(9600);
Wire.begin(); // join i2c bus (address optional for master)
pinMode(2,OUTPUT);
digitalWrite(2,LOW);
}

void loop()
{
Wire.beginTransmission(4); // transmit to device #4
Wire.write(x); // sends one byte
Wire.endTransmission(); // stop transmitting
Serial.print("Send: light is :");
Serial.println(x);
x++;
if(x == 2)
x = 0;
if(x == 0)
digitalWrite(2,HIGH);
if(x == 1)
digitalWrite(2,LOW);
delay(1000);
}

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!
code as follow :

slaver receiver

#include <Wire.h>

void setup()
{
pinMode(2,OUTPUT);
pinMode(14, INPUT_PULLUP);
pinMode(15, INPUT_PULLUP);
digitalWrite(2,LOW); //pin 2 is a LED
Wire.begin(4); // join i2c bus with address #4
Wire.onReceive(receiveEvent); // register event
Serial.begin(9600); // start serial for output
}

void loop()
{
delay(100);
}

// function that executes whenever data is received from master
// this function is registered as an event, see setup()
void receiveEvent(int howMany)
{
while(Wire.available()) // loop through all but the last
{
int x = Wire.read(); // receive byte as a int
if(x == 1)
digitalWrite(2 , HIGH);
else
digitalWrite(2 , LOW);

Serial.print("Wire!\t");
Serial.println(x);         // print the integer

}
}

Master Write:

#include <Wire.h>
int x = 0;

void setup()
{
Serial.begin(9600);
Wire.begin(); // join i2c bus (address optional for master)
pinMode(2,OUTPUT);
digitalWrite(2,LOW);
}

void loop()
{
Wire.beginTransmission(4); // transmit to device #4
Wire.write(x); // sends one byte
Wire.endTransmission(); // stop transmitting
Serial.print("Send: light is :");
Serial.println(x);
x++;
if(x == 2)
x = 0;
if(x == 0)
digitalWrite(2,HIGH);
if(x == 1)
digitalWrite(2,LOW);
delay(1000);
}

@buihoangan

This comment has been minimized.

Show comment
Hide comment
@buihoangan

buihoangan Nov 29, 2017

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.

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.

@AB2203

This comment has been minimized.

Show comment
Hide comment
@AB2203

AB2203 Feb 24, 2018

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.

AB2203 commented Feb 24, 2018

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.

@curtis63

This comment has been minimized.

Show comment
Hide comment
@curtis63

curtis63 Feb 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment