All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] Using hardware PWM generators with Xenomai
@ 2013-08-08 13:36 Sagar Behere
  2013-08-08 13:58 ` Lennart Sorensen
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Sagar Behere @ 2013-08-08 13:36 UTC (permalink / raw)
  To: xenomai

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


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2013-08-10 15:23 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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.