AnsweredAssumed Answered

Does anyone have a quick and dirty i2c example?

Question asked by PaulLeicester on Nov 22, 2011
Latest reply on Jul 21, 2012 by kilinc.bekir
Hi all,

I am very new to the STM32, currently using the STM32L..

As I am new to developing on this platform (Never touched anything ARM before), I am overwhelmed by the amount of documentation although trying to dig out the bits that are useful is a little confusing to me right now. While there is lots of information about i2c, it is very application specific (EEPROM etc). Some times I think simple is best.

I am wondering if anyone would be able to take the time to help me? I am using the standard lib and using TrueStudio.

I would like to see if anyone could create or already has an example of the following:

Setting up i2c, Setting the micro as the master, checking the presense of the device at address 0x40 and verifying the ACK and sending data to it, and maybe as a brucie bonus being able to do the same for a second device on the same bus. The actual slave is an IO extender device that I am using to test i2c.

Now I could go and read through the documentation again lots of times and try and get the bits I need. I have tried and failed to break bits out of the ST help files.

Your efforts are most apreciated :)

Many Thanks

Paul

Outcomes