Several question regarding STM32Fx (TIMx,DMA,ADC)
Hello,
I have few questions regarding the TIMER capabilities confgured as input capture. According to the reference manual, the direct input capture of TIMxCH1 in conjunction with a TMxCH2 which is configured as "indirect input capture mode" along with some slave controller reset settings, I am able to read for example on the CCR1 the period and on CCR2 the pulse witdh for pwm measurement. Is this approach only applicable for CH1 and CH2 when taking a global look on CH1,2,3,4 of a timer? On CubeMx I don't see any options to extend it to CH3 and CH4 as there is only one trigger source. Is this a limitation of the timer architecture or just a feature not provided by CubeMx as you can configure that manually in SW? According to the timer block diagram, it looks like out of 4 channels in total for one timer, you can use CH1 and CH2 as a pair (same to CH3 and CH4) in direct and indirect input caputre mode. Is that possible?
Is it possible to use this functionality without any interrupt or DMA overhead? According to the manual, it claims that the overrun flag is set, when reading the content out of the CCR registers is too slow. But anyhow I am able to get the "latest" values available when I just read that CCR register taking into account that depending on each reading cycle some data packages which could change inbetween are probably missed? Is it possible to use it in such a way or is the functionality automatically disabled when you don't manage to read the overrun flag fast enough?
When talking about "direct input capture mode" for only one channel, is it possible to achieve the same behaviour like 2 timer Channles in direct and indirect mode confgiuration" (as described above) when I attach a DMA only on one "direct input capture mode" timer channel? Here I could configure the DMA in circular mode and fill the content on both polarities (rising as well as falling edges). From time to time the application could read the buffer in RAM from the DMA and recalculate the period and pulse width. Is this approach possible?
Is the accuracy degenerated when using the internal clock for the input measurement?
I would like to know when using the ADC along with the DMA, I guess in circular mode, whether it is possible to start a ADC conversion only on specific selected channels from a bigger ADC channel group? Samples are stored in a RAM buffer from the DMA and later on, depending on application context a new ADC conversion group is triggered till the whole buffer is full. For example, I am using 12 ADC channels from ADC1 and I would like to split them into 4 groups (3 ADC channels per group). So depending on the application context, I start with group 1 conversions. When the sampling finished for those dedicated ADC inputs, the buffer contains the first three hald words in the buffer. Later on (+100ms), I continue and start with group 2 ADC conversions. Again, after some time, I start with group 3 and group 4 which will fill the buffer completly in the RAM (12 x half word elements). Is it possilbe to implement such a behavoir as I would like to avoid blocking polling mode as well as pure interrupt routines.
