mcuconf.h - STM32 port

2010-10-30
2013-04-06
  • Ingo Brauns

    Ingo Brauns - 2010-10-30

    Today, i try to understand the stm32 clock tree and i'm stucking at the adc clock. I would be very thankful for a small hint:

    In the STM Specs is mentioned, that the ADC input clock must not exceed 14 MHz.

    my mcuconf.h from the STM32 demo shows:

    /*
     * HAL driver system settings.
     */
    #define STM32_SW                    STM32_SW_PLL
    #define STM32_PLLSRC                STM32_PLLSRC_HSE
    #define STM32_PLLXTPRE              STM32_PLLXTPRE_DIV1
    #define STM32_PLLMUL_VALUE          9
    #define STM32_HPRE                  STM32_HPRE_DIV1
    #define STM32_PPRE1                 STM32_PPRE1_DIV2
    #define STM32_PPRE2                 STM32_PPRE2_DIV2
    #define STM32_ADCPRE                STM32_ADCPRE_DIV4
    #define STM32_MCO                   STM32_MCO_NOCLOCK
    

    So the sytem clock after the AHB Prescaler is 72MHz and i calculated for ADC clock

    72Mhz / 4 = 18 MHz

    Am i making a mistake or is something wrong with STM32_ADCPRE of the mcuconf.h? OK, i use an 8MHz crystal witch seems to be the most common value.

    best greetings from germany and thank you!

     
  • Ingo Brauns

    Ingo Brauns - 2010-10-30

    sorry for that. I can answer myself: forgotten the APB2 Prescaler.

    The correct value is 72MHz / 2 /4 = 9MHz

     
  • Giovanni Di Sirio

    No problems, that clock tree is quite complicated.

    Giovanni

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks