Skip to main content
budde2
Associate III
October 27, 2008
Question

I2C: Real World Example

  • October 27, 2008
  • 3 replies
  • 702 views
Posted on October 27, 2008 at 16:56

I2C: Real World Example

    This topic has been closed for replies.

    3 replies

    budde2
    budde2Author
    Associate III
    May 17, 2011
    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?

    16-32micros
    Associate III
    May 17, 2011
    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.

    st3
    Associate III
    May 17, 2011
    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.