cancel
Showing results for 
Search instead for 
Did you mean: 

Changing ADC configuration in STM32WB55

Borja Herranz
Associate

Hi,

I recently acquired a STM32WB55 nucleo board and I would like to read various analog values through the ADC. My initial idea is to use Multi-Channel Scan conversion mode but i'm unable to enable it in the CubeMX.

All peripherals are enabled in the default configuration for the board provided by the CubeMX but still, no luck.

I attach various screen shots of the ADC configuration screen and the CLK configuration screen.

Any help would be highly appreciated.

Thanks in advance.

0690X0000088NhLQAU.png

0690X0000088NiOQAU.png

0690X0000088NhaQAE.png

2 REPLIES 2
Le Corre Pierre
Associate III

You can use the STM32Cube_FW_WB_V1.0.0 (https://www.st.com/stm32cubewb) to help you on this ADC subject.

All the projects in this package are all available for IAR, KEIL or GCC.

In addition you have also the exact STM32CubeMx configuration available with each of them.

For the nucleo board the reference name is P-NUCLEO-WB55.Nucleo inside the STM32Cube_FW_WB_V1.0.0.

For your specific point of "Multi-Channel Scan conversion mode", you can have a look to this specific one:

Projects\NUCLEO-WB55.Nucleo\Examples\ADC\ADC_MultiChannelSingleConversion

  • The channels converted are one external channel and two internal channels (VrefInt and temperature sensors)

For generic introduction to ADC, you can have a look at the following projects:

If you prefer the Hardware Abstraction Layer (HAL) you can refer to the following examples projects (under Projects\NUCLEO-WB55.Nucleo\Examples\ADC):

  •  ADC_AnalogWatchdog

  How to use the ADC peripheral to perform conversions with an analog watchdog and out-of-window interrupts enabled.

  •  ADC_MultiChannelSingleConversion

  Use ADC to convert a several channels using sequencer in discontinuous mode, conversion data are transferred by DMA into an array, indefinitely (circular mode).

  •  ADC_Oversampling

  Use ADC to convert a single channel but using oversampling feature to increase resolution.

  •  ADC_SingleConversion_TriggerSW_IT

 Use ADC to convert a single channel at each SW start, conversion performed using programming model: interrupt Example configuration: ADC is configured to convert a single channel, in single conversion mode, from SW trigger.

  •  ADC_SingleConversion_TriggerTimer_DMA

  Use ADC to convert a single channel at each trig from timer, conversion data are transferred by DMA into an array, indefinitely (circular mode).

If you prefer the Low Layer (LL), you can refer to the following examples projects (Projects\NUCLEO-WB55.Nucleo\Examples_LL\ADC):

The project without "_init" are created manually to achieve some very specific task. There are no .ioc(STM32CubeMx project file) associated.

  • ADC_AnalogWatchdog_Init

 How to use an ADC peripheral with an ADC analog watchdog to monitor a channel and detect when the corresponding conversion data is outside the window thresholds.

  • ADC_ContinuousConversion_TriggerSW

 How to use an ADC peripheral to perform continuous ADC conversions on a channel, from a software start.

  • ADC_ContinuousConversion_TriggerSW_Init

 How to use an ADC peripheral to perform continuous ADC conversions on a channel, from a software start.

  • ADC_ContinuousConversion_TriggerSW_LowPower_Init

 How to use an ADC peripheral with ADC low-power features.

  • ADC_GroupsRegularInjected_Init

 How to use an ADC peripheral with both ADC groups (regular and injected) in their intended use cases.

  • ADC_Oversampling_Init

 How to use an ADC peripheral with ADC oversampling.

  • ADC_SingleConversion_TriggerSW_DMA_Init

 How to use an ADC peripheral to perform a single ADC conversion on a channel, at each software start. This example uses the DMA programming model (for polling or interrupt programming models, refer to other examples).

  • ADC_SingleConversion_TriggerSW_IT_Init

 How to use an ADC peripheral to perform a single ADC conversion on a channel, at each software start. This example uses the interrupt programming model (for polling or DMA programming models, please refer to other examples).

  • ADC_SingleConversion_TriggerSW_Init

 How to use an ADC peripheral to perform a single ADC conversion on a channel at each software start. This example uses the polling programming model (for interrupt or DMA programming models, please refer to other examples).

  • ADC_SingleConversion_TriggerTimer_DMA_Init

 How to use an ADC peripheral to perform a single ADC conversion on a channel at each trigger event from a timer. Converted data is indefinitely transferred by DMA into a table (circular mode).

  • ADC_TemperatureSensor

 How to use an ADC peripheral to perform a single ADC conversion on the internal temperature sensor and calculate the temperature in degrees Celsius.

  

If you don't know if you prefer HAL or LL driver, you should use HAL drivers to start.

Pierre.

  

  

leonardo.santoro
Associate

It is counter-intuitive:

first: modify the "Number of conversion", if you want to use 3 channel, put "3"

second: enable the "Scan conversion mode".

This is working for me.