2020-10-05 07:32 PM
I assume I would use DMA and have gone some way to (unsuccessfully) sample values in 4 channels in ADC1 and 3 channels in ADC2. However all the sample values seem unchanging for each ADC and obviously don't contain data for all the channels.
I can't find a ADC-DMA example in the corresponding Firmware (STM32Cube_FW_G4) projects directories and wondered if there was an example project that might go some way to assist.
I'm very aware that I could read several hundred pages but I value a few words from anyone who can point me in the right direction.
Solved! Go to Solution.
2020-10-05 07:55 PM
This one does ADC DMA:
You could also go off of an example from another family, such as the F4. They aren't too different.
2020-10-05 07:55 PM
This one does ADC DMA:
You could also go off of an example from another family, such as the F4. They aren't too different.
2020-10-05 11:20 PM
Reading the hundreds of pages is not that hard - in fact, you pay attention to the first few and then quickly skim through those chapters which are obviously unrelated. It's much like reading Victor Hugo - the pages describing lengthily streets and features of medieval Paris aren't that much entertaining, are they. I personally find reading the registers' description especially enlightening.
Polling implementation works?
JW
2020-10-06 05:21 AM
TDK: Many thanks. I am new to the G series and so appreciate any assistance. I've done a lot of work with the F103 which uses streams rather than channels. The ADC is a different beast too.
waclawek.jan: That's not very helpful when all I wanted was a steer. It's not obvious how the DMA can inrement through the ADC channels or run in contionuous mode with the help of DMA. I can only assume from your post that you don't know either.
2020-10-06 03:41 PM
> It's not obvious how the DMA can increment through the ADC channels
DMA increments nothing. DMA does not care at all what's at the addresses it picks from or stores to. It's the ADC itself which increments through the channels. This can be most easily observed while manually triggering the ADC and polling - or just simply observing its registers in the debugger. No DMA needed at this point.
Next step is to have still manually triggered ADC, but tied to DMA (through DMAMUX - that's the real difference to 'F103 as DMA itself is the same); observing DMA registers (I don't recommend observing ADC registers beyond this point while the process is running, as it may be intrusive) and the target memory.
Then follows timer-triggered not-continuous ADC, then the continuous case.
JW