1
\$\begingroup\$

I try to setup STM32F407ZGT6 chip to work with ADC throught DMA, currently I'm using HAL lib for fast prototype but have some problem. I set up ADC as 3 chanel Scan Continous mode using DMA in circular mode with Peripheral-to-Memory mode with length Word. I checked max freq for ADC (36MHz) and divide my CoreFreq (72MHz) by 4. ADC HAL Setup

ADC DMA Setup

In code I create variable uint32_t adc_value[3] And run ADC HAL_ADC_Start_DMA(&hadc1, (uint32_t *)&adc_value, 3); before main loop. For voltage adjustments and tests I use 1kOhm potentiometer, but while I change resistance nothing happeng, and values jump randomly between 2047, 4096 (2 values, I mean I can see only 2 values).

Whats interesting I used the same setup in STM32F103 (BluePill) and all works fine. Maybe I missed something, because F4 chip has more wider settings. Thanks

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Check system frequencies. F407 is capable of running at 168MHz system clock, APB2 prescaler should be 2 in this case. If it is a custom board, check power on all inputs, connection of the decoupling capacitors. Perhaps try higher values of ADC prescaler. \$\endgroup\$
    – Flexz
    Commented Jan 30, 2023 at 6:02
  • \$\begingroup\$ Thanks to @Flexz! I checked all params and hardware part and decade to resolder chip and all strange parts. And aftrer that all works as expected! So problem was on bad PCB asembly \$\endgroup\$
    – Alexey
    Commented Jan 30, 2023 at 17:12

1 Answer 1

0
\$\begingroup\$

Prablem was on hardware, after resolder chip and some problem parts all works fine. In my case i use that board from Ali enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.