Jump to content
43oh

Easiest way to connect Launchpad to an Arduino?


Recommended Posts

MSP432 uses eUSCI for I2C, just like the FRAM MSP430's so it's no different in that regard. It didn't borrow much from Tiva beyond using the same CPU core (and configured slightly different too).

 

Sent from my Note 10.1 tablet using Tapatalk

Is eUSCI significantly better/easier to use than USCI?  I actually bought a Tiva Launchpad but I haven't played with its I2C.  If it is better, what should I expect?

Link to post
Share on other sites

Is eUSCI significantly better/easier to use than USCI? I actually bought a Tiva Launchpad but I haven't played with its I2C. If it is better, what should I expect?

eUSCI is an incremental improvement over USCI. MSP432 and the FRAM-based MSP430's use it.

 

Tiva does not use USCI or eUSCI. I haven't messed with it yet.

 

I suspect your USCI setup is salvageable, and @@Rei Vilo might have some pointers as he uses it a lot. I am thinking about writing a nice guide on I2C with USCI and eUSCI at some point here once I gain experience with it. That's low priority for me though.

 

Sent from my Galaxy Note II with Tapatalk 4

Link to post
Share on other sites
@@SvdSinner I'm trying to answer all your questions...

 

Are you using the TI compiler?

 

I'm using Energia with GCC.

 

 

What value of Pull-ups are you using (I've tried 2K, 4.7K, 10K and even none)?

 

10 k?

 

 

Is there a way to scan the I2C bus for slaves?  IOW, is there a way to do bool IsSlavePresent(uint8_t address) implementation?  (Easily done with Arduino, and I've done it on a G2553, but I've never gotten this to work on the F5529.)

 

As far as I remember for the MSP430, the standard scanning sketch lists all addresses, even if no corresponding slave is attached. 

 

 

Are you using any of these devices:  Tiny RTC module, HMC5883L, MPU-6050,  I2C to parallel convert for 16x2 LCD, Arduino slave, Different model MSP430 slave?

 

  • Tiny RTC module: don't know. But DS1307 doesn't work because it operates at 5V. I use the PCF2129A from NXP, 3.3V operated and built-in crystal.
  • HMC5883L: yes
  • MPU-6050: yes
  • I2C to parallel convert for 16x2 LCD: yes with MCP23017
  • Arduino slave: no
  • Different model MSP430 slave: yes with TM4C LaunchPad
 

Do you connect a logic analyzer?  If so do you change anything when you hook it up?  (IOW, does adding the logic analyzer require different pull-ups or anything similar?)

 

Yes, Saleae 8 and 16 logic analysers.

 

The logic analyser needs to be powered on, otherwise some interference may occur.

 

 

How do you regulate the power on the 3.3v line?  (My launchpads get very quirky if their 3.3V line isn't precisely the same voltage as other things on the I2C bus.)

 

I
Link to post
Share on other sites

@@SvdSinner I'm trying to answer all your questions...

 

And I can't say thanks enough. I've spent decades in software and hardware, and -nothing- has flummoxed me more than trying to get I2C working on my F5529.

Are you using the TI compiler?

 

I'm using Energia with GCC.

 

As I mentioned in my OP, the code base I need to integrate is built on the TI compiler. I've spent a day or so on trying to port the Energia Wire library to the TI compiler, and another day on trying to convert the code base to GCC. Neither day ended with functional code, and I shelved the effort. (FWIW, I've never done any porting before, so my first attempts certainly don't guarantee either of these isn't possible.)

 

It is maddening that TI can't support their own stuff with decent examples using their own compiler. And their "DriverLib" for F5529 is so bad it is laughable when it comes to I2C.

Are you using any of these devices:  Tiny RTC module, HMC5883L, MPU-6050,  I2C to parallel convert for 16x2 LCD, Arduino slave, Different model MSP430 slave?

  • Tiny RTC module: don't know. But DS1307 doesn't work because it operates at 5V. I use the PCF2129A from NXP, 3.3V operated and built-in crystal.
  • HMC5883L: yes
  • MPU-6050: yes
  • I2C to parallel convert for 16x2 LCD: yes with MCP23017
  • Arduino slave: no
  • Different model MSP430 slave: yes with TM4C LaunchPad
If we focused on, say, the HMC5883L, would you be game for either posting some demo code, or looking at my (failed) example code? If I could see with my own eyes that I2C will work under Energia/gcc, I would be willing to go back to spending time porting the code base to Energia/gcc. However, I can't justify more I2C effort when I can't get a reliable basic demo working (or even be able to solidly identify where the process it is going wrong.

 

If it is easier for me to post code, I can do that when I get home this evening.

Link to post
Share on other sites

My HMC5843 is embedded in a weather station so I couldn't test it.

 

However, here's a working Energia project for the HMC6352 that works fine. I've also included the library for the HMC5843.

***
18h HMC6352 2x Compass (sensor)
23.2  NE
25.1  NE
25.2  NE
25.3  NE
25.6  NE
25.3  NE
25.3  NE

Archive.zip

 

Energia uses plain C++. It just includes a hardware abstraction layer for all the peripherals.

 

Have a look at the Wire.h and Wire.cpp files for the I

Link to post
Share on other sites

Many, many thanks

 

You're welcome!

 

Most of the times, a fresh pair of eyes spots the culprit easily! That's the very reason of the 43oh forum and community.

 

The F5529 is powerful enough to acquire, filter and process data from the sensors.

 

For a complete IMU solution, have a look at the MPU6050 / MPU9150 / MPU9255 sensors that combine magnetometer + accelerometer + gyroscope + processing unit. The result is the sensor calculates the Euler angles and quaternions so the main MCU has almost nothing to do. I managed to get the code available in this very forum to work easily.

Link to post
Share on other sites

I've gotten started on the re-write, but have fallen right back into the same issues I was having before. The current roadblock is the 3.3V line. The G2553s run theirs at nearly 3.6V, two of my F5529s run theirs at 3.08v, and the last F5529 and the Tiva run at about 3.23V.

 

Alone, that isn't a problem, but it wrecks many debugging scenarios and makes launchpad to disparate launchpad I2C nearly impossible. The challenge is that I am running enough things in my project that none of the launchpads can supply the 3.3V line from their EX-FET voltage regulators. If I use external regulated 3.3V (running at 3.3v, with a shared ground and ), the launchpads start having problems communicating over USB. Loading and debugging fail quite often with "No USB FET found" in CCS. (The still show up properly in Device Manager.) Sometimes they'll work OK, but I haven't discovered the rhyme or reason why they work or fail on any particular attempt to upload code to them.

 

From that point, I'll get a failed test, and I'll have no idea if the wiring was bad, or if the launchpad didn't like the 3.3V rail, or if the device didn't like the 3.3V rail, or (if powering things with the launchpad) if the launchpad couldn't supply enough to make it work properly.

 

Any suggestions?

Link to post
Share on other sites

Well, of all the launchpads the F5529LP can haul the most current as it has a DC-DC converter rated up to 1A supplying 3.3V. That comes from the USB 5V line though so it may be limited by the available USB current of course.

A common voltage rail for all of them would be best. What value of pullups are you using? With all the nodes attached it might be best to use something like 2.2K ohm or maybe 1K. 4.7K is the typical spec for 100KHz @ 5V but I believe you need to go lower (e.g. 2.2K) for ideal slew rate at 3.3V. @@oPossum taught me that last tidbit.

 

Sent from my Galaxy Note II with Tapatalk 4

Link to post
Share on other sites

I have helped out a client to connect an msp430g2553 to his arduino. He uses a 3 to 5 volt translator on the I2C bus. He's got it talking to the msp430 just fine. He's using Processing on the arduino side. He's using my code on the msp430.

 

I echo the sentiment that working with the I2C master on the MSP is challenging. So much so that I wrote my own bit banged I2C master routines. 

 

I have had a lot of success using the I2C peripheral in interrupt driven slave mode though. That's a relief.

 

That being said, is it really a voltage mismatch that is causing the problems?

What does the logic analyzer show when you are having problems?

Is the slave in polled mode or interrupt I2C mode?

Do you have a schematic that you can share?

Are the grounds connected between the two boards?

 

I agree with @@spirilis that a common voltage on the I2C bus would be best.

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...