cancel
Showing results for 
Search instead for 
Did you mean: 

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

ambrose
Associate II

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

1 ACCEPTED SOLUTION

Accepted Solutions
Uwe Bonnes
Principal III

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

View solution in original post

11 REPLIES 11

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
Principal III

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

ambrose
Associate II

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
Associate II

Another image

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

Also read out and post content of relevant data array.

JW

gregstm
Senior III

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
Associate II

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

DMA Registers. I am using Channel 5

ambrose
Associate II

Timer register

ambrose
Associate II

Thanks i think there is an issue with the data.