From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4E698924.70406@domain.hid> Date: Thu, 08 Sep 2011 20:33:56 -0700 From: Bob Feretich MIME-Version: 1.0 References: <4E68226E.2000208@domain.hid> <4E68873B.6080204@domain.hid> In-Reply-To: <4E68873B.6080204@domain.hid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-help] PWM generation with GPIO List-Id: Help regarding installation and common use of Xenomai List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gilles Chanteperdrix Cc: Xenomai help The advantage of using a hardware PWM timer (like OMAP3 GPTimer8-11) is that there is no interrupt load on the system. (The PWM signals are completely generated by the hardware.) PWM outputs controlled by interrupts require one interrupt for each edge transition of the output signal. The disadvantage of using a hardware PWM timer is that there are only 4 PWM timers on the OMAP3 chip (3 accessible on the BeagleBoard). Once you have used all 4, than you must use the method Gilles describes. Regards, Bob Feretich On 9/8/2011 2:13 AM, Gilles Chanteperdrix wrote: > On 09/08/2011 10:21 AM, Andrey Nechypurenko wrote: >>> So I wrote >>> a RTDM driver to use the three that were pinned out, and used real time >>> limit and overflow interrupts to to wiggle a GPIO for the fourth PWM output. >> It seams to me that you are using different implementation approach >> then suggested by Gilles in this thread: "I was talking >> about a Xenomai driver, using the RTDM skin using for instance two >> timers, a periodic timer which handler would set the gpio to 1 and >> launch the second timer, a one shot time which handler would set the >> gpio to 0." > If I understand correctly, the difference is that Bob proposes you to > dedicate a hardware timer to the PWM, whereas I propose you to use the > software timers, which ultimately, also depend on a dmtimer. I would not > expect big differences between the two approaches, neither in terms of > jitter, nor in terms of code. > >> Could you please say a few words about the reasons why you chose this >> particular way? >> >>> The Linux version of this driver made the 4th servomotor growl. There is no >>> growl using the RTDM version. I asked a lab technician to probe the four >>> servo PWM signals and tell me which was software GPIO generated. He could >>> not tell. >> timing. So there might be fundamental difference between periodic task >> launched in user-space with rt_task_start/rt_task_set_periodic and >> similar periodic task running as RTDM driver which I do not >> understand. If this assumption is true, I would really appreciate any >> pointers to the documentation which explains what are the differences >> and why RTDM driver can deliver better rt performance then Xenomai >> thread from user-space. > As suggested in the previous mail I sent you, compare the differences in > latencies with latency -t 2 between user-space task and kernel-space > timer. You will see that a timer handler has much less jitter. Switch to > user-space, and context switch time explain the difference. >