Skip to main content
elec_st
Associate III
Mar 16, 2017 2:05 PM UTC
Question

adc stm32f1 interleaved

Posted on March 16, 2017 at 15:05

i use stm32f103 mcu with adc1 adc2 adc3 and i want to use adc in interleaved to increase sample from 1msps to 3msps. i search on google and in all code example and i can't find how to use  adc in interleaved

    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    Mar 16, 2017 3:11 PM UTC
    Posted on March 16, 2017 at 16:11

    Are you tied to the F1? I don't think it supports a triple interleave mode.

    The interleave on the F1 pairs ADC1 and ADC2 with a 7 or 14-cycle slew between them, and a DMA from a 32-bit wide data register.

    Look at this for a template

    STM32F10x_StdPeriph_Lib_V3.5.0\Project\STM32F10x_StdPeriph_Examples\ADC\RegSimul_DualMode\main.c

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    ST Technical Moderator
    Mar 16, 2017 4:02 PM UTC
    Posted on March 16, 2017 at 17:02

    Hello,

    You can take a working

    ADC_Regular_injected_groups 

    example as start point to make required updates according to your needs, this can help you as an implementation example:

    STM32Cube_FW_F1_V1.4.0\Projects\STM3210C_EVAL\Examples\ADC\ADC_Regular_injected_groups

    Imen

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    elec_st
    elec_stAuthor
    Associate III
    Mar 17, 2017 11:24 AM UTC
    Posted on March 17, 2017 at 12:24

      i  have problem

    i select dual fast interleaved  delay between sample 7 clock

    and the STM32CubeMX give me this code

    MX_GPIO_Init();

    MX_DMA_Init();

     MX_ADC1_Init();

     MX_ADC2_Init();

      MX_UART4_Init();

    the problem in   MX_ADC2_Init(); it's make stm32f103 stop working and hang and mcu look like dead.

    elec_st
    elec_stAuthor
    Associate III
    Mar 21, 2017 6:27 PM UTC
    Posted on March 21, 2017 at 19:27

    i solve this probelm to use adc in  interleave mode .

    because stm32cube use  this two function

     MX_ADC1_Init();

     MX_ADC2_Init();

     and   MX_ADC2_Init(); return with error

    when i see examples code in STM32F10x_StdPeriph

    it use ADC_Config(); and this work fine with me

    so the problem in  stm32cube