Skip to main content
John Hite
Associate III
April 10, 2017
Question

STM32F437 ADC GPIO pin config

  • April 10, 2017
  • 2 replies
  • 508 views
Posted on April 10, 2017 at 21:07

We want to use ADC2 but it is not listed as an altenate function but as an additional function in RM0090. So I was wondering how I should configure the pins.

This is what I am guessing is correct:

GPIO_StructInit(&GPIO_InitStruct);

GPIO_InitStruct.GPIO_Pin = GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6;

GPIO_InitStruct.GPIO_Mode = GPIO_Mode_AN;

GPIO_InitStruct.GPIO_PuPd = GPIO_PuPd_NOPULL; GPIO_Init(GPIOA, &GPIO_InitStruct);

Thanks,

JH

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    April 10, 2017
    Posted on April 10, 2017 at 21:19

    Select them as AN pins as shown.

    Then select channels on each ADC based on ADC123_IN12 naming, ie ADC1_IN4 wouldn't work on ADC2 or ADC3, but ADC12_IN5 would work on all but ADC3 as channel 5. 

    NOTE Names made up for illustration purposes, review Data Sheet for specifics.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    John Hite
    John HiteAuthor
    Associate III
    April 11, 2017
    Posted on April 11, 2017 at 14:39

    Thanks.

    jh