Skip to main content
ambrose
Associate II
October 27, 2020
Solved

Is there a way to overcome "pausing" during DMA Circular transfer?

  • October 27, 2020
  • 11 replies
  • 3455 views

Hello I am using the STM32F334 for Lighting and I have had to use the DMA to transfer duty cycle data to the PWM duty register. The DMA is set up in circular mode and there is no interrupt. The priority it set to High. But i notice this pauses between the packets. I would have expected it to have no pauses. Please how can I get rid of this? Please see the image of actual light intensity. Hope to hear from you. thanks

This topic has been closed for replies.
Best answer by Uwe Bonnes

Maybe an off-by-one error in your DMA data.

11 replies

waclawek.jan
Super User
October 27, 2020

There are no pictures. Note, that this wreck of software does not support pasting pictures, even if it appears to do so - you need to upload it as file, after clicking on the picture icon below.

Read out and post content of relevant TIM and DMA registers.

JW

Uwe Bonnes
Uwe BonnesBest answer
Chief
October 27, 2020

Maybe an off-by-one error in your DMA data.

ambrose
ambroseAuthor
Associate II
October 28, 2020

Ok I will add the image. My switching frequency is 120kHz, so 8.33µs period, it will need to be off by 66. Here is the image. I also cannot upload more than 1 file.

ambrose
ambroseAuthor
Associate II
October 28, 2020

Another image

waclawek.jan
Super User
October 28, 2020

Read out and post content of relevant TIM and DMA registers.

Also read out and post content of relevant data array.

JW

gregstm
Senior II
October 28, 2020

Maybe it would be helpful to implement the DMA interrupt handler and toggle pins (at half/complete transfer) so you can understand the timing of things better - and toggle different pins where you poll/send data. That way you can use an oscilloscope/analyser to view the actual timings (and maybe figure out what is going wrong). If you write direct to the BSRR register it only uses a few assembler instructions to set/reset a line/led (GPIOA->BSRR = ....)

ambrose
ambroseAuthor
Associate II
October 28, 2020

@Community member​  I have images below. @Community member​ I will do the test thanks everyone.

DMA Registers. I am using Channel 5

ambrose
ambroseAuthor
Associate II
October 28, 2020

Timer register

ambrose
ambroseAuthor
Associate II
October 28, 2020

Thanks i think there is an issue with the data.

ambrose
ambroseAuthor
Associate II
October 28, 2020

@Uwe Bonnes​ You were right; It was off by 64. thanks