Hardware pulses burst #12448
Replies: 8 comments 4 replies
-
Frédéric, have you considered / explored the rather unique PIO capabilities of the RP2040 ? There are quite some neat usecases around showing how PIO can be exactly programmed, essentially with clock_cycle accuracy. |
Beta Was this translation helpful? Give feedback.
-
My first idea was to find a solution based on standard PWM, Timer..., which would be more universal, but I post here as I'm mainly using RPi Pico boards, and, yes, I think it could be done using the PIOs. But even if I wrote a few things with PIO, I'm not sure how to deal with this case :o/ Maybe a combination of PIO, PWM...? Or even DMA? As my goal is to generate pulses for a stepper motor (with acceleration/deceleration), this is maybe the way to go, as the DMA could automatically load the values to the PWM (or PIO program)? But I never wrote anything using DMA... |
Beta Was this translation helpful? Give feedback.
-
As an exercise I wrot a little module for PIO once which sends a sequence of pulses using the PIO and also captures them. https://github.com/robert-hh/RP2040-Examples/tree/master/pulses |
Beta Was this translation helpful? Give feedback.
-
Interesting! I'll dig into your code to try to adapt it... Thanks! |
Beta Was this translation helpful? Give feedback.
-
Ok, I have a working version :o) Question: is it possible to append some new data to the DMA, even if it is still feeding the state machine with the previous data? |
Beta Was this translation helpful? Give feedback.
-
Ok, it works! But I have a little issue. Here is my code:
The problem is when I get the value, it seems to freeze the PIO code (or DMA?). Any idea why? |
Beta Was this translation helpful? Give feedback.
-
I will start another thread, as I have several questions about the DMA... |
Beta Was this translation helpful? Give feedback.
-
I hooked up my pulse generator to a real stepper driver and a motor, and I have an issue: the motor makes a bad noise. I checked the signal with an oscilloscope, and it seems I have some jitter! The code involved is the one above. The generation of the pulses is done by this part:
Any idea what can cause that? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
Is there a way to generate a hardware pulses burst, with a precise frequency and number of pulses?
Thanks,
Frédéric
Beta Was this translation helpful? Give feedback.
All reactions