PSoC4100SP : PWM_Left align_100% Duty

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RyYo_1406951
Level 5
Level 5
100 replies posted 50 replies posted 25 replies posted

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%設定はできないという認識でよろしいでしょうか?

無題.png

・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設定可能という認識でよろしいでしょうか?

0 Likes
1 Solution

こちらでも確認しました。

pastedImage_0.png

上記GUI設定、Period = 10、Compare = 10で

Copy_201942121932.bmp

GUI設定、Period = 10、Compare = 11はエラーとなるのでAPIにてPeriod = 10、Compare = 11を設定。

Copy_201942122219.bmp

100% Dutyが確認。

PSoC Creator Component Datasheet "PSoC 4 Timer Counter Pulse Width Modulator (TCPWM)"のOutputのセクションに下記記述があります。

pastedImage_2.png

GUIでは現在Compare値をPeriod値より1大きくするとエラーとなるので、現状APIにて設定してください。

View solution in original post

3 Replies
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

I also gave a try with attached project for CY8CKIT-044.

興味があったので、私も添付のCY8CKIT-044プロジェクトで実験をしてみました。

PWM_TEST_190326.JPG

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 の場合です。

TEK0001.jpg

But when I set compare = 11, as you mentioned it gives 100% duty.

しかしコンペア = 11 とすると、ご指摘のように 100% duty となりました。

TEK0002.jpg

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

TEK0003.jpg

and period = 10, compare = 0.

周期 = 10, コンペア = 0

TEK0004.jpg

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

こちらでも確認しました。

pastedImage_0.png

上記GUI設定、Period = 10、Compare = 10で

Copy_201942121932.bmp

GUI設定、Period = 10、Compare = 11はエラーとなるのでAPIにてPeriod = 10、Compare = 11を設定。

Copy_201942122219.bmp

100% Dutyが確認。

PSoC Creator Component Datasheet "PSoC 4 Timer Counter Pulse Width Modulator (TCPWM)"のOutputのセクションに下記記述があります。

pastedImage_2.png

GUIでは現在Compare値をPeriod値より1大きくするとエラーとなるので、現状APIにて設定してください。

回答ありがとうございました。

0 Likes