I want to generate Complementary PWM signals on S32K144 and change the duty cycle

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I want to generate Complementary PWM signals on S32K144 and change the duty cycle

974件の閲覧回数
gkunalupta
Contributor III

I am using S32K144 MCU and i want to generate the Complementary PWM signals. I am able to do so but when i am trying to change the duty cycle of my complementary signals, it is not happening. 

My PWM FTM settings are: using FTM instance 0, channel 2 and 3 as complementary PWM mode in inverted mode:

 

gkunalupta_0-1726823073203.png

 

gkunalupta_1-1726823089358.png

 

In my application code, i am using these API's:

Pwm_Init(&Pwm_Config_BOARD_InitPeripherals);


	    //When we want to use the Interrupts, so that call back function can be hit on every time PWM signal edge changes
	    //Pwm_EnableNotification(channel0, PWM_FALLING_EDGE);

		Pwm_SetDutyCycle(channel2, 000);
		TestDelay(700000);

		Pwm_SetDutyCycle_NoUpdate(channel2, 13000);

	    Pwm_SyncUpdate(instance0);


	    Pwm_SetPeriodAndDuty(channel2,23000,11384);
	    TestDelay(700000);

 

But my Complementary PWM signal duty cycle is not varying, after initialising.

 

I further debugged also and what i found that (in my case as i am using channel 2 and 3). Channel 3 CnV register value is not getting updated even after it does so in code:

gkunalupta_2-1726823255005.png

 

In above figure, in text editor you can see it is writing value of 0x541f in CnV register of channel 3. But still in EmbSys Register View my CnV regsiter value of Channel 3 is not getting updated.

 

Why is it so????

 

How can i do duty cycle variation of Complementary PWM signal 

0 件の賞賛
返信
2 返答(返信)

968件の閲覧回数
gkunalupta
Contributor III

But my Complementary PWM signal duty cycle is not varying, after initialising. Though Complementary signals are generated after pwm_Init() api, as shown in below figure: 

gkunalupta_0-1726823515187.png

 

But am not able to change the duty cycle, after pwm_init () on using mentioned API's

0 件の賞賛
返信

934件の閲覧回数
_Leo_
NXP TechSupport
NXP TechSupport

Hi,

Thank you so much for your interest in our products and for using our community.

You could refer to the demo in the following link, which also implement the complementary mode:

https://community.nxp.com/t5/S32-SDK/phase-shifted-pwm-channels-in-s32k144/td-p/1894512

Hope it helps you.

Have a nice day!

0 件の賞賛
返信