Skip to main content
mrblueblue
Associate II
August 9, 2016
Question

I2C Alternate Function Configuration

  • August 9, 2016
  • 2 replies
  • 1732 views
Posted on August 09, 2016 at 05:52

All,

I believe that I have all my registers configured correctly for my I2C interface on the  STM32F429ZIT6 but I have a question regarding the settings of the GPIO alternate function settings in GPIOx_AFRL and GPIOx_AFRH.

1.) I want to have the alternate function of I2C3 enabled for PA8 (pin 100) and PC9 (pin 99).

2.)  When I call the following functions using the standard peripheral drivers

    GPIO_PinAFConfig(GPIOA, GPIO_Pin_8, GPIO_AF_I2C3);

    GPIO_PinAFConfig(GPIOC, GPIO_Pin_9, GPIO_AF_I2C3);

I don't see the registers GPIOA_AFRL, GPIOA_AFRH, GPIOC_AFRL and GPIOC_AFRH get updated in the debugger. I just see all the bits remain zero's.  I am looking int the debugger in AC6.

Thanks for your thoughts.

 0690X00000605RCQAY.png

-Mike

 

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    August 9, 2016
    Posted on August 09, 2016 at 06:20

    You need to use GPIO_PinSourceX (an index) and not GPIO_Pin_X (a mask), as the parameter to GPIO_PinAFConfig()

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    mrblueblue
    Associate II
    August 10, 2016
    Posted on August 10, 2016 at 04:00

    Thank you clive1!  You were 100% correct! AF looks to be configured correctly now!

    You are the best!

    -Mike