The reason I wanted to use the PRU was that we need to send a fixed number of pulses to the servo motors. We tried it with the usual PWM channels on the beaglebone and by the time we are done counting the number and disabling the PWM, the servo ends up receiving a few extra pulses and overshooting. Maybe comparing it in a while loop is not such a great idea. If there is a better way that does not involve the use of PRUs, I would readily switch to that.

Also, Mark, a small part I didn’t understand in |pru-pwm.asm|. Once you load the period and duty cycle in |channel|, only some should get either enabled or disabled each cycle. How do you decide which ones to set high and low?

Adwait

On Thursday 08 June 2017 06:55 AM, Mark A. Yoder wrote:

Last summer I did a project where I programmed the PRUs to provide an 18 channel PWM (12 on one PRU and 6 on the other). Each could have it's own frequency and duty cycle.

The details are here[1].

Though I think using the PRUs may be overkill for what you need to do. There are several hardware PWM channels on the Bone that don't need the PRUs.

--Mark

[1] https://github.com/MarkAYoder/BeagleBoard-exercises/tree/master/pru/examples/pwm

On Wednesday, June 7, 2017 at 12:24:08 PM UTC-4, Adwait wrote:

    Sorry, forgot to mention that. I'll be running 2 servo motors and
    2 brush-less dc motors.
    I am concerned about the fact that all of them will be running at
    different frequencies and in parallel. So far I can only think of
    running them one after the other. Is there a way to thread in a PRU?

    I'll have a look at the link you mentioned and see if it helps.

    Thanks


    On Wednesday 07 June 2017 08:51 PM, TJF wrote:
    Hi Adwait!

    Don't you think you should give us an idea of what kind of motors
    you're talking about (stepper, serve, ???).

    For bit-banging you don't need the PRU at all. Several modules
    can generate PWM output, like PWM modules and CAP modules in the
    PWMSS, or the TIMER subsystems. libpruio
    <http://beagleboard.org/project/libpruio/> offers easy (but also
    the most flexible) acces to that capabilities.

    Regards

​

--
For more options, visit http://beagleboard.org/discuss
--- You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/cafffa64-d543-9cd4-c78b-00ca33c97b19%40endlessrobotics.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to