2024-12-15 06:43 PM - last edited on 2024-12-15 11:59 PM by SofLit
I want to do ADC with 5 channels using STM32 Nucleo-144 development board with STM32F722ZE MCU.
I can collect data by DMA, but I can only get data from in0~in2.
Finally, I want to get ADC data from 5 channels at 1kHz using timer interrupt.
This is my first time using an MCU and I am not very familiar with it, so I need your help.
Attached is the main.c file.
(I am using a translator)
2024-12-16 08:06 AM
Hello,
here I am sending a similar example for STM32C0, you should find the right settings for your purpose here. This example code periodically (1kHz) read all analog inputs and each values writes to memory by DMA and periodically print read values from memory to usart.
ADC was configured:
- All inputs except IN2, IN3 (pins used by usart), Temperature sensor, Vrefint Channel, VDDA Channel, VSSA Channel
- 8 bit resolution
- DMA Continuous Requests Enabled
- External trigger conversion source as Timer 3 Trigger Out event
- Other configurations stay as defaults
- DMA mode circular, Peripheral to memory, Data Width as Byte
TIM3 is configured as:
- Clock Source as Internal Clock
- Counter Period to 47 999
- Trigger Event Selection TRGO as Update Event
SYSCLK was configured to 48 MHz
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.