cancel
Showing results for 
Search instead for 
Did you mean: 

Multi-channel ADC reading in continuous mode.

Gil1
Associate II

Using an STM32H757-EVAL (don't use CM4) with CubeMX. Configured my ADC1 as follows:


_legacyfs_online_stmicro_images_0693W00000bjjM0QAI.pngDMA is:


_legacyfs_online_stmicro_images_0693W00000bjjMAQAY.pngStart the process as follows (both calls return HAL_OK):


_legacyfs_online_stmicro_images_0693W00000bjjMFQAY.pngI allow the code to run for 10 seconds and break. The m_hv_status_values buffer still has the initial values:

My expectation is that after the call to the HAL_ADC_Start_DMA, the ADC should scan all 6 channels continuously and put resulting conversions into the m_hv_status_values circular buffer sequentially. Any suggestions would be appreciated.

Gil

2 REPLIES 2
S.Ma
Principal

The analog ADC IP is a fast changeling among the STM32 families, what is learnt from one may not work on another one. Some have list sequence of channels, some have injected channels, some have differential channels, some have one trigger input pin or many.

If you are in luck maybe there is an ADC example for the corresponding Nucleo board in Cube SW project. Otherwise use a debug probe, put a breakpoint just before SW activating the conversion, look at the ADC/DMA HW register values, possibly modify them, and let the code kick in the ADC, put a second breakpoint after 100 msec SW delay and check the result. Rinse and repeat.

Check the DR is non zero (maybe the DMA programming is wrong). Rinse and repeat and let us know how long did it take overall to get the job done for our community info.

Gil1
Associate II

Thanks S.Ma, it works now. I changed the RAM location from this:


_legacyfs_online_stmicro_images_0693W00000bjoKEQAY.pngTo this:


_legacyfs_online_stmicro_images_0693W00000bjoJzQAI.png 

Not sure why this change is needed. If you understand why this is needed, please let me know.

Gil