2019-03-20 09:19 AM
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.
2019-03-21 04:06 AM
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
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):
How to use the ADC peripheral to perform conversions with an analog watchdog and out-of-window interrupts enabled.
Use ADC to convert a several channels using sequencer in discontinuous mode, conversion data are transferred by DMA into an array, indefinitely (circular mode).
Use ADC to convert a single channel but using oversampling feature to increase resolution.
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.
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.
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.
How to use an ADC peripheral to perform continuous ADC conversions on a channel, from a software start.
How to use an ADC peripheral to perform continuous ADC conversions on a channel, from a software start.
How to use an ADC peripheral with ADC low-power features.
How to use an ADC peripheral with both ADC groups (regular and injected) in their intended use cases.
How to use an ADC peripheral with ADC oversampling.
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).
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).
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).
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).
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.
2019-04-17 07:40 AM
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.