Multi Channel ADC with DMA transfer on NUCLEO U575ZI-Q
Hello,
I'm trying to configure my NUCLEO-U575ZI-Q to read multiple channels of ADC at once. I will describe the settings in the following and then raise my questions:
1- I use IN1 and IN2 on ADC4 which corresponds to PC0 and PC1 on the EVB
2- I set scan conversion mode to Forward (which I guess it means read first PC0 and then PC1 right?)
3- Continuous conversion mode is disabled
4- DMA continuous requests is Enabled (the strange part is that this option doesn't exist for ADC1. Will appreciate if someone can explain the reason and the meaning of it)
5- End of Conversion selection is set to End of Sequence of conversion (not single conversion) which should mean the EoC is True only after the two channels are converted (right?)
6- SamplingTime common 1&2 are set to 7.5 (I'm not sure why there are two)
7- Trigger Frequency is set to Low
8- I'd like to use Regular Conversion Launched by SW at the beginning and later use a Timer to automate this process. But this means that every time I need fresh transfers I need to call HAL_ADC_Start_DMA(&hadc4, (uint32_t*)adcResultsDMA, 2); or only once suffices?
9- I used DMA channel1 from GPDMA1 in Standard Request Mode
10- Circular mode is enabled and Port 0 is selected
11- Request is set to ADC4. Data Width is set to HalfWord (12 bit adc, hence 16 bits of FIFO) for both the source and the destination and by ST recommendation the Burst Length is set to 1
12- In the end, GPDMA1 Channel 1 global interrupt is enabled
I have the following questions and issues:
- I can't find a __weak implementation of DMAxferComplete to customize in another file
- I don't see the updates in adcResultsDMA which is my buffer to get the data from ADC
(uint16_t adcResultsDMA[2];
while (1){HAL_ADC_Start_DMA(&hadc4, (uint32_t*)adcResultsDMA, 2);})
- I'm connecting 3v3 from board to PC1 to hopefully see the result in the buffer but I don't
I have found ST examples for U5 series but none of them were corresponding to my case.
In general it's very challenging to gather information from all manuals for a simple task as such. Any help, comments and insights are greatly appreciated. Sorry if I was verbose but I'm stuck for a while. Please check the screenshots as the reference.
Best regards,
Reza
