- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Below, the same sentences are written in English and Japanese.
・English
I want to output 100% Duty from the line terminal with the "Left align" setting of PWM.
As shown below, an error will occur if Period = "9", Compare = "10".
Can not set Duty 100% on the component initial value setting screen?
・Japanese(日本語)
PWMを"Left align"設定で、line端子から100%Dutyを出力したいです。
以下の様に、Period="9",Compare="10"に設定した場合エラーになります。
コンポネント初期値設定画面ではDuty100%設定はできないという認識でよろしいでしょうか?
・English
However, in the program statement (main.c), it is possible to set the Period value to "9" using the API.
※ In the component initial value setting screen, Period = "10", Compare = "10" are set.
Is 100% duty configurable when using the API?
・Japanese(日本語)
しかし、プログラム文(main.c)で、APIを使用しPeriod値を"9"を設定することは可能です。
※コンポネント初期値設定画面では、Period="10",Compare="10"に設定しております。
APIを使用したら、100%Duty設定可能という認識でよろしいでしょうか?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
こちらでも確認しました。
上記GUI設定、Period = 10、Compare = 10で
GUI設定、Period = 10、Compare = 11はエラーとなるのでAPIにてPeriod = 10、Compare = 11を設定。
100% Dutyが確認。
PSoC Creator Component Datasheet "PSoC 4 Timer Counter Pulse Width Modulator (TCPWM)"のOutputのセクションに下記記述があります。
GUIでは現在Compare値をPeriod値より1大きくするとエラーとなるので、現状APIにて設定してください。
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I also gave a try with attached project for CY8CKIT-044.
興味があったので、私も添付のCY8CKIT-044プロジェクトで実験をしてみました。
As you mentioned when the period value and compare value are same,
it does not give us 100%. The sample below is period = 10 compare = 10.
ご指摘のように周期の値とコンペアの値が同じ場合には duty は 100%になりませんでした。
下記オシロ画面は周期 = 10, コンペア = 10 の場合です。
But when I set compare = 11, as you mentioned it gives 100% duty.
しかしコンペア = 11 とすると、ご指摘のように 100% duty となりました。
So I suppose that the PWM component's compare is greater or equal.
現象から、PWM はコンペアを >= で比較しているのだと推測します。
Just to check I test with
period = 10, compare = 1
念の為に下記の設定も試しました。
周期 = 10, コンペア = 1
and period = 10, compare = 0.
周期 = 10, コンペア = 0
So, I think that to get 100% duty for left aligned PWM we need to set the compare value > period,
but the PSoC Creator GUI does not allow us to do so.
以上から Left Aligned の PWM コンポーネントで 100% duty を得るのには
コンペア > 周期 に設定してやる必要がありそうですが、
PSoC Creator のユーザーインターフェースではその設定を許してくれません。
And as also you mentioned we can set compare value greater than the period from API.
そして、これもご指摘のようにプログラムの API からであればそのような設定が可能でした。
IMHO, since the width of the counter is 16bit, it must be legal to set the compare value greater than the period as far as it is within the 16bit width. At least API is allowing us to do so it a good news.
PWMのカウンタの幅が 16bit なのですから、コンペア値も 16bit の範囲に入っているものであれば周期を超えた値も設定可能であるべきと思います。 少なくとも API から設定出来るのは有難いですが。
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
こちらでも確認しました。
上記GUI設定、Period = 10、Compare = 10で
GUI設定、Period = 10、Compare = 11はエラーとなるのでAPIにてPeriod = 10、Compare = 11を設定。
100% Dutyが確認。
PSoC Creator Component Datasheet "PSoC 4 Timer Counter Pulse Width Modulator (TCPWM)"のOutputのセクションに下記記述があります。
GUIでは現在Compare値をPeriod値より1大きくするとエラーとなるので、現状APIにて設定してください。
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
回答ありがとうございました。