mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Roland Stigge <stigge@antcom.de>
To: Alban Bedel <alban.bedel@avionic-design.de>
Cc: Thierry Reding <thierry.reding@avionic-design.de>,
	LKML <linux-kernel@vger.kernel.org>,
	Alexandre Pereira da Silva <aletes.xgr@gmail.com>
Subject: Re: [PATCH] pwm: lpc32xx - Fix the PWM polarity
Date: Thu, 08 Nov 2012 14:12:25 +0100	[thread overview]
Message-ID: <509BAFB9.6090801@antcom.de> (raw)
In-Reply-To: <20121108122345.72aa0f6c@avionic-0020.adnet.avionic-design.de>

On 08/11/12 12:23, Alban Bedel wrote:
>>> It is intended, the formular for duty value in the register is:
>>>
>>> duty = (256 - 256*duty_ns/period_ns) % 256
>>
>> Where does this modulo defined? In the Manual, there is sth. like this
>> defined for RELOADV (tables 606+607), but not for DUTY.
>>
>> Maybe I missed sth. in the manual. Link or hint appreciated!
> 
> The manual doesn't mention this explicitly but you can see that without
> the modulo when duty_ns==0 DUTY would be 256, but the register is only
> 8 bits wide (ie. modulo 256). I made a few test and looked at the PWM
> output on a scope they confirm this:
> 
>  DUTY     HIGH LEVEL
>   1         99.9%
>   25        90.0%
>   128       50.0%
>   220       10.0%
>   255        0.1%
>   0          0.0%
> 
> I'll resubmit the patch with the clamping in the correct order.

Thanks for measuring. With this, your resubmitted patch make much more
sense now.

Roland

  parent reply	other threads:[~2012-11-08 13:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-05 16:48 Alban Bedel
2012-11-05 21:03 ` Thierry Reding
2012-11-06  9:36   ` Roland Stigge
     [not found]     ` <CAAAP30HwBzYFpy942UyiQX2SkzV4naBbhwichp201bvfEm2mxA@mail.gmail.com>
2012-11-06 17:19       ` Alban Bedel
2012-11-07 15:25         ` Alban Bedel
2012-11-07 15:58           ` Alexandre Pereira da Silva
2012-11-08  9:51           ` Roland Stigge
2012-11-08 10:33             ` Alban Bedel
2012-11-08 10:44               ` Roland Stigge
2012-11-08 11:23                 ` Alban Bedel
2012-11-08 11:46                   ` Alban Bedel
2012-11-08 13:12                   ` Roland Stigge [this message]
2012-11-08 13:49                     ` Alexandre Pereira da Silva

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=509BAFB9.6090801@antcom.de \
    --to=stigge@antcom.de \
    --cc=alban.bedel@avionic-design.de \
    --cc=aletes.xgr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thierry.reding@avionic-design.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®