TIM Interrupt to DMA TC365

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User20530
Level 3
Level 3
25 sign-ins 25 replies posted 10 sign-ins
Hello everyone,

I am trying to configure a hardware interrupt from a TIM module to a DMA.

I already have something running, I just need some guidance on the hardware trigger configuration.

What I have till now is:



In the screenshot you can see my destination buffer of my dma. I have programmed the TIM to issue an interrupt which then triggers one DMA Transaction concisting of one DMA Transfer of 2 DMA Moves. So the Period and the DutyCycle of my PWM Signal are being transfered to my destination buffer.

Now here comes my question. For the screenshot I have the DMA working in continous mode DMA_CHCFGR001.CHMODE = 1. But this keeps filling up my whole destination buffer with the same data as you can see on the first byte of the data as it contains the edge counter. What I am looking for is to have the data like this:
01XXXXXX 01YYYYYY
02XXXXXX 02YYYYYY
03XXXXXX 03YYYYYY
04XXXXXX 04YYYYYY
05XXXXXX 05YYYYYY
where the X is the period value and y is the DutyCycle. And you can see that the EdgeCounter is counting up with every transfered data.

So my goal is to have every conversion on the TIM module to trigger 1 DMA Transaction.

So I went to the TIM Module and tried every of the 4 IRQ_MODES of the GTM_TIM0_CH0_IRQ_MODE Register. But I do not see any change in the behaviour. When changing the DMA_CHCFGR001.CHMODE = 0 I see what I would like to see but only for one Transaction. Afterwards I have to set the DMA_TSR001.ECH bit manually to get the next DMA Transaction triggered.

Is there a way to configure the DMA_TSR001.ECH bit to be triggered by a finished conversion of the TIM. Or is there a way to configure the DMA to be in continous mode but only do one Transaction consisting of 2 DMA moves and not filling up the complete buffer? By the way it does not even matter how big the buffer is, its getting filled up all the time.

Thanks for your support.
0 Likes
2 Replies
User20530
Level 3
Level 3
25 sign-ins 25 replies posted 10 sign-ins
Hello everyone,

I just figured out, that I had an issue in my configuration.
The DMA is working in continous operation mode and I use the pulse notify from the TIM. The issue was that I have created follow up interrupts of the DMA which also started the DMA (like an endless loop).
0 Likes
User20530
Level 3
Level 3
25 sign-ins 25 replies posted 10 sign-ins
Just one follow up question.
As I understand from Chapter 18.3.4.6.3 of the AURIX_TC3XX_PArt1_USER_MANUAL it is not possible to have the DMA timestamp to be integrated inside the Destination Circular Buffer. Please correct me if I am wrong.
When using the TC223 controller it was still possible. But I found the ErrataSheet https://www.infineon.com/dgdl/Infineon-TC21x-TC22x_AC-step-ErrataSheet-v01_02-EN.pdf?fileId=5546d462... Chapter DMA_TC.034. So I believe it was not intended as a feature in the TC223 and so in the new controller it is not possible anymore to have the timestamp to be appended to each transaction inside of the Destination Circular Buffer.

Thanks for clarifying!
0 Likes