cancel
Showing results for 
Search instead for 
Did you mean: 

how to configure ADC using just LL library please ?

elmzaiti youssef
Associate II
Posted on August 16, 2017 at 11:40

how to configure ADC using just LL library please ? 

1 ACCEPTED SOLUTION

Accepted Solutions
Posted on August 16, 2017 at 13:46

If you still don't have it installed then install The latest STM32CubeF7 library in

http://www.st.com/en/development-tools/stm32cubemx.html

using Help -> Install New Libraries (BTW, ST, why is it under the Help menu?). Find out your repository folder by opening Help -> Updater Settings in the menu, then navigate into that folder, then into STM32Cube_FW_F7_V1.7.0/Projects/STM32F767ZI-Nucleo/Examples_LL to find many examples (ADC too) using the LL drivers.

View solution in original post

8 REPLIES 8
Tilen MAJERLE
ST Employee
Posted on August 16, 2017 at 12:08

Hello

youssef.elmzaiti

‌,

we have many STM32 devices. In which one you are interested?

Best regards,

Tilen

Amel NASRI
ST Employee
Posted on August 16, 2017 at 12:18

Hi

youssef.elmzaiti

‌,

You didn't precised the STM32 product you are using.

For STM32L4, you find some examples ADC based on LL driver, you can get them as a strt point.

Look underSTM32Cube_FW_L4_V1.8.0\Projects\STM32L476RG-Nucleo\Examples_LL\ADC.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on August 16, 2017 at 13:11

Hello

Majerle.Tilen

we want to migrate from stm32f4 to stm32f7 , the problem is in stm32f4 we use SPL lib and in the stm32f7 there'snt a SPL lib , for this we use SPL2LL to migrate from stm32f4_SPL to STM32F7_LL ,

To migrate from SPL to LL there's some execption like ADC ,NVIC Configuration , this configuration is not compatible betwen SPL and LL .

Best regards,

Youssef

Posted on August 16, 2017 at 13:20

Hi

st.mcu

,

we want to migrate from stm32f4 to stm32f7 , the problem is in stm32f4 we use SPL lib and in the stm32f7 there'snt a SPL lib , for this we use SPL2LL to migrate from stm32f4_SPL to STM32F7_LL ,

To migrate from SPL to LL using SPL2LL there's some execption like ADC ,NVIC Configuration , this configuration is not compatible betwen SPL and LL ,

example :

- for NVIC configuration :

In SPL

static NVIC_InitTypeDef NVIC_InitStructure_TIM9;

NVIC_InitStructure_TIM9.NVIC_IRQChannel = TIM1_BRK_TIM9_IRQn;

NVIC_InitStructure_TIM9.NVIC_IRQChannelPreemptionPriority = 1;

NVIC_InitStructure_TIM9.NVIC_IRQChannelSubPriority = 0;

NVIC_InitStructure_TIM9.NVIC_IRQChannelCmd = ENABLE;

NVIC_Init(&NVIC_InitStructure_TIM9);

in LL , i put this equvalent !

NVIC_SetPriority((TIM1_BRK_TIM9_IRQn,NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1,0));

NVIC_EnableIRQ(TIM1_BRK_TIM9_IRQn );

but in ADC i don't how i can put the equivalent , for exemple

in SPL we have :

ADC_InitTypeDef Loc_ADC_InitStructure_init_periph_moteur;

/* ADC1 Configuration (ADC1CLK = 15 MHZ) -----------------------------------*/

Loc_ADC_InitStructure_init_periph_moteur.ADC_Resolution = ADC_Resolution_12b ;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ScanConvMode = ENABLE;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ContinuousConvMode = DISABLE;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Rising ;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T2_CC2;

Loc_ADC_InitStructure_init_periph_moteur.ADC_DataAlign = ADC_DataAlign_Right;

Loc_ADC_InitStructure_init_periph_moteur.ADC_NbrOfConversion = NBR_DE_REGULAR_CHANNEL_ADC1;

ADC_Init( ADC1, &Loc_ADC_InitStructure_init_periph_moteur );

so in LL what's the equivalent

best regards ,

Youssef

Posted on August 16, 2017 at 13:21

example of equivalence 

         - 

 for NVIC configuration  :

    In SPL  

static NVIC_InitTypeDef NVIC_InitStructure_TIM9;

NVIC_InitStructure_TIM9.NVIC_IRQChannel = TIM1_BRK_TIM9_IRQn;

NVIC_InitStructure_TIM9.NVIC_IRQChannelPreemptionPriority = 1;

NVIC_InitStructure_TIM9.NVIC_IRQChannelSubPriority = 0;

NVIC_InitStructure_TIM9.NVIC_IRQChannelCmd = ENABLE;

NVIC_Init(&NVIC_InitStructure_TIM9);

in LL , i put this equvalent !

NVIC_SetPriority((TIM1_BRK_TIM9_IRQn,NVIC_EncodePriority(NVIC_GetPriorityGrouping(),1,0));

NVIC_EnableIRQ(TIM1_BRK_TIM9_IRQn );

but in ADC i don't how i can put the equivalent , for exemple 

  in SPL we have : 

LEGACY_ADC_InitTypeDef Loc_ADC_InitStructure_init_periph_moteur;

/* ADC1 Configuration (ADC1CLK = 15 MHZ) -----------------------------------*/

Loc_ADC_InitStructure_init_periph_moteur.ADC_Resolution = ADC_Resolution_12b ;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ScanConvMode = ENABLE;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ContinuousConvMode = DISABLE;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ExternalTrigConvEdge = ADC_ExternalTrigConvEdge_Rising ;

Loc_ADC_InitStructure_init_periph_moteur.ADC_ExternalTrigConv = ADC_ExternalTrigConv_T2_CC2;

Loc_ADC_InitStructure_init_periph_moteur.ADC_DataAlign = ADC_DataAlign_Right;

Loc_ADC_InitStructure_init_periph_moteur.ADC_NbrOfConversion = NBR_DE_REGULAR_CHANNEL_ADC1;

ADC_Init( ADC1, &Loc_ADC_InitStructure_init_periph_moteur );

so in LL what's the equivalent 

Posted on August 16, 2017 at 13:22

and there's a example of project using just LL library for stm32f7xx ? 

Posted on August 16, 2017 at 13:46

If you still don't have it installed then install The latest STM32CubeF7 library in

http://www.st.com/en/development-tools/stm32cubemx.html

using Help -> Install New Libraries (BTW, ST, why is it under the Help menu?). Find out your repository folder by opening Help -> Updater Settings in the menu, then navigate into that folder, then into STM32Cube_FW_F7_V1.7.0/Projects/STM32F767ZI-Nucleo/Examples_LL to find many examples (ADC too) using the LL drivers.
Posted on August 16, 2017 at 13:51

thank you