S32K344: How to set deadtime for a PWM in S32DS?

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

S32K344: How to set deadtime for a PWM in S32DS?

5,602件の閲覧回数
cranes
Contributor IV

Hello,

I am trying to set deadtime for a PWM. 

When configuring the channel, I got this error:

cranes_0-1700694312213.png

What does this mean? All prescalers are set DIV_1. 

cranes_1-1700694366660.png

cranes_2-1700694411030.png

Thanks!

Crane

 

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

5,581件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

I have reproduced the problem and reported it to the responsible team.

The response time will be very slow. Thank you for your understanding.


You can try to use the eMIOS+TRGMUX+LCU module to achieve complementary PWM output and dead time insertion.

you can take a look at this post and have a try to test the demo in the attachment.

https://community.nxp.com/t5/S32K/LCU-out-PWM/td-p/1759686 

0 件の賞賛
返信

5,567件の閲覧回数
cranes
Contributor IV

Hi Senlent,

Thank you for your sharing.

The demo works and I am able to generate a complementary PWMs with deadtime, through controlling LCU which takes one eMIOS channel output as an input.

Now I generated another PWM which has a phase shift to the first eMIOS channel. I am trying to use this channel as another input to LCU to generate another pair of complementary PWMs. But it seems not working. 

Now my question is, do I need to use the LCU's another logic cell, or the same logic cell is fine? Either way, how to control the logic cell to generate the output PWMs I want? Is there any other example or document to explain this? I found the reference manual is not written from the application point of view and couldn't find how it matches the controls in the Configuration Tool in S32DS.

Thanks!

Crane

0 件の賞賛
返信

5,493件の閲覧回数
cranes
Contributor IV

Hi Selent,

I am using LCU0 LC2 to generate another pair of PWMs coming from eMIOS0 channel 2. It works, but I still don't understand how Mux select and the value of Output LUT Control works. 

Now I am trying to generate two more PWMs which come from eMIOS0 channel 3 and channle4 respectively. I use LCU0 LC2 to generate the one from eMIOS0 channel 3, but failed to generate the one from eMIOS channel 4.

If I use LCU0 LC2 another hardware input, it always generates the same PWM from eMIOS0 channel2 even I set another hardware input from LC2 as the input like this:

cranes_0-1701139001600.png

cranes_1-1701139071365.pngcranes_2-1701139086684.png

If I use LCU1 LC0, set eMIOS channel4 as LCU1 LC0 hardware input 0, LC0 hardware output0 as output, LCU1_out0 as output pin,  it doesn't generate anything at LCU output. Mux select is chosen as LU_IN_0. An tried different selections and got the same result.

What do you think might go wrong?

Thanks!

Crane

0 件の賞賛
返信

5,472件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

I spend some time making a demo according to your setting, you can test it.

 

 

 

0 件の賞賛
返信

5,457件の閲覧回数
cranes
Contributor IV

Yes, it works. Thank you!

It looks the value of Output LUT Control makes the difference.

But LCU0_9 with value 0x5555 and LCU0_11 with the value of 0x3333 don't generate anything. 

Regards,

Crane

0 件の賞賛
返信

5,446件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

It works fine on myside, I guess maybe the hardware problem, please double-check the pin of LCU0_9 and LCU0_11 of your hardware.

0 件の賞賛
返信

5,444件の閲覧回数
cranes
Contributor IV

That's weird. After I change the Output LUT Control value of LCU0_09 from 0x5555 to 0xCCCC, it outputs the signal on LCU0_09. So I think the hardware should be ok.

0 件の賞賛
返信

5,433件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

Let me confirm again. You used the demo I sent you and you did not make any modifications. The PIN corresponding to LCU0_9 and LCU0_11 are not output?

0 件の賞賛
返信

5,408件の閲覧回数
cranes
Contributor IV

On the demo, I only changed the package to 172 pin package. Didn't change anything else.

I used the demo to create my own project. Then in my own project, I tried to change Output LUT Control value on Lcu0_9 from 0x5555 to 0xcccc, then both Lcu0_9 and lcu0_10 generate the same output.

Regards,

Crane

0 件の賞賛
返信

5,399件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

LCU0_9 ans LC0_10 have same LCU control value 0xcccc then the output is same,shouldn't this be correct?

0 件の賞賛
返信

5,396件の閲覧回数
cranes
Contributor IV

Yes, this is correct.

But you said the original demo gives 4 outputs from all of LCU0_8, LCU0_9, LCU_10, LCU0_11. In my setup, LCU0_9 and LCU0_11 don't output anything unless I change the Output LUT Control value to 0xCCCC, which was original 0x5555 in the demo.

Regards,

Crane

0 件の賞賛
返信

5,388件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

I tested the code I sent you again, you can see the output waveform is right on myside.

Senlent_0-1701325048939.png

so I think the demo is no problem,please double check the hardware(I'm using my own board,you can change the LCU pin according to your hardware)

 

0 件の賞賛
返信

5,368件の閲覧回数
cranes
Contributor IV

Hi Senlent,

That's why I feel it is weird as LUC0_09 outputs as long as I changed its Output LUT Control value from 0x5555 to 0xcccc. I haven't figured out what the difference between setting these two values is. 

But that's fine for me as long as it outputs, not matter which pin. You think there might be potential issue?

Any way, this issue is addressed for me.

In addition do you have any examples for UART, ADC and interrupt? The examples for UART and ADC from RTD don't work. 

Thanks!

Crane

0 件の賞賛
返信

5,361件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

please create a new topic for your new question

BR!

0 件の賞賛
返信

5,352件の閲覧回数
cranes
Contributor IV

Got it. Thanks Senlent for your help!

Regards,

Crane

0 件の賞賛
返信

5,519件の閲覧回数
Senlent
NXP TechSupport
NXP TechSupport

Hi@cranes

1.One logic cell can meet your needs, but you can use another logic cell which will make the calculation easier and and make it easier for you to understand the LCU module.

2.You can take a look at the Motor solution at this page.

https://www.nxp.com/design/development-boards/automotive-motor-control-solutions/s32k344-brushless-d... 

Senlent_0-1701050708927.png

AN13767->Chapter 4.2.3.3.LCU

0 件の賞賛
返信