Jump to content
Sign in to follow this  
Johann

Using HW (not SW) I2C

Recommended Posts

I recently tried upgrading to Energia 17. I am using MSP430G2553 rev 1.5 with an existing PCB that maps SCL/SDA to pins 14 and 15 respectively. I know that by default Energia 17 uses a new SW I2C mode that maps SCL/SDA to pins 9 and 10 respectively. I would like to use the old HW I2C mode that maps to SCL/SDA to pins 14 and 15, but I have been unable to do so. I tried using the new Wire.setModule method to specify module 0. I also tried modifying the pins_energia.h file to specify #define DEFAULT_I2C 0. Neither option seems to work.

If I run my exact same I2C slave source code with Energia 16, then it works as expected. 

Share this post


Link to post
Share on other sites

That does not seem to be the problem. The I2C slave receives a few bytes and then no more. I modified the shipping examples, master_sender and slave_receiver, and am unable to receive data on the slave using Energia 17. Using the same hardware and running the examples from Energia 16 works as expected.

Share this post


Link to post
Share on other sites

Initially I did not know how to invoke a new constructor. Some trial and error resulted in the following code in setup(). Hopefully this is useful for other users:

// Re-initialize the I2C library to use the USCI hardware
Wire = TwoWire(0);

@@Johann,

There appears to be a bug introduced in Energia 17 wrt I2C, Serial comms and MSP devices with USCI hardware. Itserik created a pull-request to fix this.

Share this post


Link to post
Share on other sites

What the F@#$#$

Why change the SDA and SCL?

I installed the new 17 version.

Programmed a new sensor and I did get a lot of rubbish on my screen.

Did a lot of debugging. Nothing.

 

Now I am reading that they changed SDA and SCL.

Are they out of their minds?

 

Got back to 16 and my code is OK.

 

Stupid thing to do, this change.

Share this post


Link to post
Share on other sites

@@hmjswt Just as a reminder, Energia isn't a TI product, it is an open source, community effort. I, for one, appreciate the folks who volunteer their time to bring a very useful tool to the TI Launchpad ecosystem.

 

Version 17 has only been out for about a week so I am sure there are bugs and/or feature issues that will need to be resolved/clarified, as there is with any new software release.

 

43oh is great forum with a lot of very knowledgeable people who are willing to share their expertise. I am sure as you spend more time here you will find this forum as valuable as I do.

Share this post


Link to post
Share on other sites

It would be nice if development actually took place on github so that people would be able to try out the next release to warn the core team when there are problems with the upcoming release. However, it seem most of the development happens on some secret TI server and then at the last minute appears on github without getting much testing.

 

-rick

Share this post


Link to post
Share on other sites

@@dubnet,

 

I find this forum very valuable.

And I am very grateful for Energia.

I have learned my lessen, again.

Don't, really DON'T go for the latest release.

Specially when there are no release notes on the website.

But the real question is: why the change.

This makes all the boards I have made not programmable with 17.

You can hear me protesting clear to IJsselstein.

( I live in Maarssen...) ;-)

Share this post


Link to post
Share on other sites

@hmjswt  I need to apologize for the reference to Energia being open source, non TI.  I misunderstood the dynamics of the situation and am embarrassed that I posted misinformation. :unsure:   Thanks to @@Rickta59 for the clarification.

 

hmjswt, I totally agree with you on dragging your feet on new releases.  Never fun to be the early adopter, banging your head against the wall battling the new release bugs.

Share this post


Link to post
Share on other sites

@Rickta59  I did understand but didn't do a good job conveying that in my second post.  I need to slow down and reread my posts for clarity before hitting the post button. :(

Share this post


Link to post
Share on other sites

@Rickta59  I did understand but didn't do a good job conveying that in my second post.  I need to slow down and reread my posts for clarity before hitting the post button. :(

Basically (having some experience with the team as has Rickta59), Energia in its present form is technically open-source in terms of released code, but a sparsely-community-contributed TI-driven project.  Some community contributions are accepted over github but many are not, and many features "just appear" with no real discussion with the community, developed in private more or less.  Much of this is because initial development has to happen within TI due to the secret, non-public status of many chips, a testament to TI taking the project seriously enough to make Energia development an early part of the release process.

 

However there are risks and downsides to having this "quasi-open-source" or what I like to call "open source in name only" development approach .... the lack of early scrutiny by "many eyes" being a significant one.  By the time public Energia releases happen especially with new chips, the codebase that has been produced or modified is so big and complex nobody in the "community" outside of TI corporate knows where to start when deconstructing and analyzing the code to find bugs, or the amount of time required to "catch up" is absurd and unreasonable for community folks who have other jobs and family and engagements where the most optimal way to contribute is "a little at a time", as would be possible if we could watch the development process unfold day-by-day.

 

This sounds like a possible example of the latter; some sweeping changes to the I2C implementation supposedly were made between Energia 16 and 17, and I can't recall if I saw the discussion on github about this.  Maybe it was there and I wasn't paying attention...

Share this post


Link to post
Share on other sites

At the very least, the pull requests I do see in Energia's github aren't elaborately documented.  I used to write a darned book with most pullreqs I produced ... and possibly include links to Saleae Logic16 analysis files and/or snapshots illustrating such.

 

In terms of community contributions, @@Rei Vilo is the most prolific non-TI contributor I think... I personally can't justify the time for it anymore.

Share this post


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.

Sign in to follow this  

×
×
  • Create New...