cancel
Showing results for 
Search instead for 
Did you mean: 

I2C: Real World Example

budde2
Associate II
Posted on October 27, 2008 at 16:56

I2C: Real World Example

3 REPLIES 3
budde2
Associate II
Posted on May 17, 2011 at 12:49

I am trying to use the I2C core of the STM32 evaluation board using the firmware library.

The examples, which are part of the library, work as long as no error occurs. The examples do not contain any error handling (address NACK, data NACK, PEC error, bus error, ...).

If there is an error, the examples simply hang forever.

Are there any real world examples for the I2C core including the complete necessary error handling?

st3
Associate II
Posted on May 17, 2011 at 12:49

Quote:

The examples, which are part of the library, work as long as no error occurs. The examples do not contain any error handling

I think you will find that this is generally true of example code!

In real life, handling the ''normal'' execution is only a very small part of the project - it's covering all the ''exceptions'' that takes 90% of the effort.

To include all this in ''example'' code would just obscure it.

16-32micros
Associate III
Posted on May 17, 2011 at 12:49

Hi,

You can have a look at our ''AN2824'' : STM32F101xx and STM32F103xx medium- and high-density devices: advanced I²C examples :

http://www.st.com/stonline/products/literature/an/15021.pdf

http://www.st.com/stonline/products/support/micro/files/an2824.zip

Cheers,

STOne-32.