Question about DMA #12468
Replies: 6 comments 6 replies
-
I should RTFM :o/
|
Beta Was this translation helpful? Give feedback.
-
Here is a version which seems to work fine:
|
Beta Was this translation helpful? Give feedback.
-
I'm now working on the stop command: I need to cancel the DMA, restart the State Machine, ensure the output is off, send a new deceleration sequence... Fun ;o) |
Beta Was this translation helpful? Give feedback.
-
When the DMA sends values to the PIO FIFO, is it possible to use shorts (16 bits), or should I always use words (32 bits)? |
Beta Was this translation helpful? Give feedback.
-
If I set pull_tresh=16, and ask the DMA to send a buffer of array('I'), with data_size=1, it does not work: it seems that the SM code freezee on the pull()... |
Beta Was this translation helpful? Give feedback.
-
My bad, I was using 'H'... |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I started to write a stepper module which handles accelerations in both moveto and jog modes. At first, I used a simple PWM, and an ISR to regularly compute the speed and position on the fly tp update the PWM, but it was not very accurate, and I often overshoot the position in moveto mode.
I then used a PIO and a DMA to pre-compute the entire pulses sequence, which works fine (I still have a little overshoot, but I guess the problem is in my acceleration generator). You can see the discussion and the help I got to implement this here: https://github.com/orgs/micropython/discussions/12448. I repost the main code here:
My first problem is that getting the speed on the fly messes up the DMA: the pulses are not sent correctly, and the DMA seems to stop too soon. Any idea what can happen here?
Beta Was this translation helpful? Give feedback.
All reactions