Jump to content

I2C basic functions on f5529

Recommended Posts

I'm really frustrated. I need to talk to some I2C sensors with my f5529, from an existing program that uses the TI compiler and CCS6. There are lots of libraries out there that work in slightly different configurations. (Energia wire library, on a G2553, etc.) The TI driverlib included with mspware is buggy, and doesn't even do basic things like handle NACKs.


At this point, I've tried so many things that aren't working, I'm lost on what direction to spend my time. (IOW, what library and code patterns should I be using with the F5529/CCS/ti compiler)


There are 4 main "unit tests" I need to have working to get back on track.


1) Master send 1 or more bytes to a slave

2) Master read 1 or more bytes from a slave with the pattern of MASTER sends START, SlaveAddr, Register to read from, (repeated) START, SlaveAddr, master reads 1 or more bytes from slave.

3) A routine to test if a functioning slave is responding on a given address.

Other info:

My F5523 is talking to a lot of sensors (Joysticks, head tracker, etc.) and ultimately generating signals that power the servos on an RC helicopter. Timing is important, so using LPM0 and interrupts as much as possible to play nicely with all the other interrupts going on is important. (Iow, preventing the other interrupts from happening in a timely manner would be bad)



Can anyone point me in a good direction? (Code would be appreciated, but I most importantly need a strategy that somebody can confirm will actually work if I put time into it.)

Link to post
Share on other sites

That code looks awesome. I skimmed through the docs, and saw you thought it might work with the newer ti compilers. Any guess on how long it would take for me to get BSP430 to work with the Ti compiler?

Or, conversely, how hard it would be to move my application to the open source compiler? (It uses Timers A&B, ADC, GPIO, and acts as a USB client)


Fwiw, I'm a professional . NET developer, and have been working with the MSP430 for home projects for the last couple of years. (IOW, I'm still a bit rusty with the detailed intricacies of compilers and the C/C++ tool chain.

Link to post
Share on other sites

If you have an existing application, converting it to BSP430's architecture might not be worth the pain. If you use the CCS IDE or develop under Windows, BSP430 is probably not the right solution.


For completeness: BSP430 is supposed to support the TI compiler in a Linux command-line environment, by using WITH_CCS=1 when building and possibly correcting the CCS_INSTALL_ROOT path. See make/Makefile.common for details. However, last serious testing was done with CCS5 and a basic check of CCS6 just now didn't work. From within the IDE and/or on Windows, I have no idea how long it might take. BSP430 pretty heavily depends on GNU Make infrastructure to simplify the (Linux) developer's life.


mspgcc support should be solid, but mspgcc is defunct so I can't recommend switching to it. msp430-elf (the TI version of gcc) support is mostly there (use the "next" branch to work around a bug in msp430-elf's "intrinsics"), but is not actively tested either.


Depending on your needs, using BSP430 as example code and continuing to work within your current development environment may be the most effective solution.

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.

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