0

I2C Issues with a few different Adafruit Sensors on MSP430
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

I2C Issues with a few different Adafruit Sensors on MSP430

by anygard on Tue Jun 15, 2021 4:04 pm

I've recently bought a few different Adafruit sensors (SCD-30, DPS310, and the Seesaw I2C Soil Sensor) and I'm trying to communicate with these via I2C on an MSP430FR2355. I have tested all the sensors with the example Arduino code via an Arduino Uno - they all respond. However, when trying to use I2C via the EUSCI bus on the MSP430, I can't get any response. I'm using I2C at 100kHz with the proper addresses/commands drawn out via the example code on the github .cpp and .h files. Does anyone know of anything specifically that Adafruit sensors/ MSP430 needs in order to communicate properly, or is something else going on in this situation?

anygard
 
Posts: 5
Joined: Tue Jun 15, 2021 3:58 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by mikeysklar on Wed Jun 16, 2021 7:23 pm

I'm guessing your MSP430 is a 3v3 device so be sure you are not connecting to any 5v lines when hooking up the i2c.

I'd start with a i2c scanner to see if the addresses are being seen. If they are not being detected than you probably have a wiring issue. Go ahead and post a photo of your wiring.

mikeysklar
 
Posts: 4966
Joined: Mon Aug 01, 2016 8:10 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by anygard on Thu Jun 17, 2021 2:20 pm

Here's my wiring along with the pinout description for the i2c bus. I've copied over a lot of the code from the Arduino github pages and used this to reimplement from C++ to C. The addresses (from what I've read on the oscilloscope running on arduino) are correct in my code, I just can't get anything out of the board as soon as I hook these up.

Image Grey hooked to P1.3 and SCL, White hooked to P1.2 and SDA. Note that the DPS310's SCK and SDI pins are the SCL and SDA pins of its I2C operating mode.

Image Here's the pin description from the datasheet.

anygard
 
Posts: 5
Joined: Tue Jun 15, 2021 3:58 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by mikeysklar on Thu Jun 17, 2021 5:08 pm

Does this setup work when you just run SPI or i2c? Right now you are mixing the two as if they are on the same bus. I suspect USCI let's you do that to some degree, but you should start by testing them separately.

Start with one device at a time and use some i2c scanner code just to verify it finds the device before getting fancy with communication.

mikeysklar
 
Posts: 4966
Joined: Mon Aug 01, 2016 8:10 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by anygard on Fri Jun 18, 2021 2:43 pm

Image

The I2C scanner recognizes all devices. The SPI bus you're talking about doesn't exist in this context - EUSCIB0 is set up for I2C mode, and the DPS310 is a dual function SPI and I2C communication path, hence the little caption under the image in the previous post. My problem is that the i2c bus on the MSP is always busy no matter what when I hook these things up, or some miscellaneous error. I don't know if there's a voltage dividing problem among resistors in the sensors vs MSP that's causing issues or what. I just want to know should I be able to plug these sensors into I2C and work as intended if the MSP is set up normally for I2C, or is there something special I have to take care of that I wouldn't normally think to do in the setup of I2C?

anygard
 
Posts: 5
Joined: Tue Jun 15, 2021 3:58 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by mikeysklar on Mon Jun 21, 2021 3:39 pm

Seeing the i2c addresses is a good confirmation that you have the wiring correct. The voltages are probably all fine the way you have it wired for 3v.

The only thing that tends to get people on some of our sensors is i2c clock speed. The two sensors you are using should work fine at at the typical 100kHz or 400kHz range. Do you know what the MSP430 is running by default? It could be 1MHz or something higher.

mikeysklar
 
Posts: 4966
Joined: Mon Aug 01, 2016 8:10 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by anygard on Mon Jun 21, 2021 4:05 pm

My MSP is running at 16Mhz with a 160 prescalar division on the I2C clock - giving it 100Khz clock speed. The issue I'm currently having is that SDA is floating at ~1.4V while SCK is 3.3V at idle. I'm fairly certain the issue is similar to this post after a lot of looking around- viewtopic.php?f=8&t=173169&p=844624&hilit=msp430#p844624. The sensors are being powered at 3.3V directly, so I'm wondering if the voltage regulators are screwing things up, in which case I would need to modify the power source.

anygard
 
Posts: 5
Joined: Tue Jun 15, 2021 3:58 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by mikeysklar on Mon Jun 21, 2021 5:20 pm

The soldering in the post you linked to looks highly questionable to me, but I see your point about power concerns. That is odd to see the 1.4v and sounds like a power issue. I suppose you could get into using a scope to record the i2c bus signals or verify everything works with Arduino/Feather or related type board.

mikeysklar
 
Posts: 4966
Joined: Mon Aug 01, 2016 8:10 pm

Re: I2C Issues with a few different Adafruit Sensors on MSP4

by anygard on Mon Jun 21, 2021 5:30 pm

I have used an oscilloscope with an Arduino Uno, everything checks out. My guess is that some internal resistor inside the MSP is voltage dividing with the onboard pullup on the sensors, leading to the awkward voltage.

anygard
 
Posts: 5
Joined: Tue Jun 15, 2021 3:58 pm

Please be positive and constructive with your questions and comments.