From: Robert <robert-km@o2.pl>
To: =?UTF-8?Q?xenomai@xenomai.org?=,
xenomai@xenomai.org, "Michael Haberler" <mail17@mah.priv.at>
Subject: Re: [Xenomai] Using hardware PWM generators with Xenomai
Date: Fri, 09 Aug 2013 19:28:04 +0200 [thread overview]
Message-ID: <68671d77.6ce2003b.520526a4.3e2c@o2.pl> (raw)
In-Reply-To: <2A0F278E-ED28-46CC-8727-DC97BB89A6D6@mah.priv.at>
I wrote this driver recently, and it generates stable pwm signal. Probably you will have to adapt it to beaglebone black.
It is written for Pandaboard and its hardware general purpose timer.
There are some ioctl interfaces for user space.
https://github.com/rkmiec/pandaboard-pwm-rtdm/tree/dc_engine
Do NOT use master branch now.
Dnia 8 sierpnia 2013 16:26 Michael Haberler <mail17@mah.priv.at> napisał(a):
> Sagar,
>
> you might want to study the LinuxCNC code, which does PWM - among other functions like a stepper generator - via the PRU
>
> http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=tree;f=src/hal/drivers/hal_pru_generic;h=5e7dc56c1891408833362fd7f480a9da20dcc31d;hb=refs/heads/unified-build-candidate-1
>
> - Michael
> Am 08.08.2013 um 15:36 schrieb Sagar Behere <sagar.behere@gmail.com>:
>
> > Hello,
> >
> > I wish to generate PWM signals from Xenomai, using the beaglebone black, kernel 3.8.13 patched with xenomai.
> >
> > There already exist linux kernel modules for the hardware PWM generator (eHRPWM) on the am335x chip in the beaglebone. The PWM generator can be configured and controlled via the /sysfs interface and the whole thing works very well.
> >
> > I understand that the /sysfs interface cannot be used by xenomai tasks without triggering a transition away from the primary xenomai (hard realtime) domain. So my question is: What is the least effort way to change the duty cycle of the hardware PWM generator, from a xenomai task?
> >
> > Does the following approach sound feasible?
> >
> > 1. Configure the PWM generator (freq, polarity etc.) from the /sysfs interface at application startup. This need not be realtime
> > 2. Assuming that the duty-cycle is controlled by the value of some memory-mapped register, use mmap()/ioremap() to map that register's address into the xenomai task's address space.
> > 3. Write the duty-cycle values to the mapped memory, from within the xenomai task
> >
> > So this is like a hybrid approach that uses the existing linux kernel module for initializing/configuring the hardware PWM and the xenomai task only changes the value of one register that affects the duty cycle of the output waveform.
> >
> > Thanks in advance,
> > Sagar
> >
> > _______________________________________________
> > Xenomai mailing list
> > Xenomai@xenomai.org
> > http://www.xenomai.org/mailman/listinfo/xenomai
>
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> http://www.xenomai.org/mailman/listinfo/xenomai
>
next prev parent reply other threads:[~2013-08-09 17:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-08 13:36 [Xenomai] Using hardware PWM generators with Xenomai Sagar Behere
2013-08-08 13:58 ` Lennart Sorensen
2013-08-08 14:26 ` Michael Haberler
2013-08-09 17:28 ` Robert [this message]
2013-08-10 9:15 ` Sagar Behere
2013-08-10 9:36 ` Andrey Nechypurenko
[not found] ` <52060B80.1080601@gmail.com>
2013-08-10 12:29 ` Robert
2013-08-10 12:42 ` Gilles Chanteperdrix
2013-08-10 12:55 ` Gilles Chanteperdrix
2013-08-10 15:14 ` Andrey Nechypurenko
2013-08-10 15:19 ` Andrey Nechypurenko
2013-08-10 15:23 ` Gilles Chanteperdrix
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=68671d77.6ce2003b.520526a4.3e2c@o2.pl \
--to=robert-km@o2.pl \
--cc==?UTF-8?Q?xenomai@xenomai.org?= \
--cc=mail17@mah.priv.at \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.