I have a stm32f407vgt. I would like to use all TIM2 input compare for DMA trigger. I don't understand that the TIM2_CH4 is at two dma streams, and one of them with CH2, so how can i use all 4 channels at the same time?
do you need all 4 PWM channels...?
this is easily configured inside cubeMX.
Yes I need all 4 channels. But I don't get it. TIM2_CH4 is at 2 streams at the same time, will there be a problem?
I am not an expert with the ST lineup, but I have been working on it for more than 12 months now.
Yes, you can use one or the other DMA if you want to.
did you want the 4 channels PWM to trigger 4 DMA streams ?
your request is not clear.
Input compare is usually externally triggered by a pin, is this what you want ?
therefore any external trigger can be set as an interrupt and the software can invoke any DMA stream...
I want 4 chanells input capture. I use 'Both edge mode'. When the input chanes its value, I want to save the timer value with dma. But I don't know that if TIM2_CH4 is at 2 streams at the same time, when TIM2_CH4 input change occurs which stream will request dma, because TIM2_CH4 are in stream7 and stream6 with TIM2_CH2.
And also I don't have time for interrupt, because the change could be very fast.
I think they all look routable
TIM2_CH1 DMA1 Stream 5 Channel 3
TIM2_CH2 DMA1 Stream 6 Channel 3
TIM2_CH3 DMA1 Stream 1 Channel 3
TIM2_CH4 DMA1 Stream 7 Channel 3
Stream 6 Channel 3 is said to be triggered by both CH2 and CH4.
Do you know how exactly is this implemented?
I don't know. But I hope that the priority settings solves the problem
Sounds like a plan and we all are waiting for you to report back with the results, but... hey, it's two hours since you last post, why does it take you so long? :-D
PS. Had been experimenting with SPI-triggered interrupts on an 'F40x back then. When I enabled both streams triggered from the same SPI-Rx, after a trigger happened, one of them continued to work normally, the other went to a weird state - not functioning, but could not been disabled either, CR.EN remained set no matter what was written to CR... Just saying.
I will try, but i have a lot of other homework.
OK so I tried and you appear to be out of luck.
When both CH4 triggered streams (i.e. 6 and 7) are enabled, a trigger from CH4 triggers transfers only on stream 6, and stream 7 remains in the frozen-and-CR.EN-could-not-be-cleared state exactly as in my experiment I described above. (The same applies for stream 1 and 7 if I enable the triggers from update in DIER).
When both CH2 and CH4 fired, both triggered a transfer on stream6 if they were not overlapping, otherwise there was only one transfer.
There may be ways to gear up 2 timers as master-slave to achieve 32-bit resolution and externally connect their CHn pins to achieve simultaneous capture, but it does not sound to be quite a trivial task - look around in the examples provided by ST (these days, within Cube).
Thank you for trying out. I will try to chain two 16 bit timers together
I will give a try. thanks
how long do you have between pulses ?
I don't know. It depends on the user. But the maximum frequence would be 10Mhz.
do you know about this high resolution timer ?
TIM5 doesn't appear to suffer from this particular problem...
TIM5 is allready in use. I want 8 input captures with 32 bitt resolution.
Retrieving data ...