I want to implement real-time PWM duty cycle change with DMA, Is there any demo you can give me for

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I want to implement real-time PWM duty cycle change with DMA, Is there any demo you can give me for

1,010 Views
Zhuang
Contributor I

I have tried to configure myself, but have failed, NXP can give me some reference

0 Kudos
Reply
11 Replies

977 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Zhuang

you can refer to this article which is all i can find for your topic.

https://community.nxp.com/t5/S32K-Knowledge-Base/Example-S32K118-FTM-PWM-DMA-S32DS-2-2/ta-p/1342183

0 Kudos
Reply

968 Views
Zhuang
Contributor I

I tried to follow this routine, but in the process I ran into a problem: I was passing data through DMA 10 10 10 0. Here in the figure, it should be 0 but it appears 1, I do not know whether the DMA did not transmit the number or the PWM did not update, how to check this?

0 Kudos
Reply

961 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@zhuang

I don't know how you get the picture you provided and you can take a look at the chapter

Senlent_1-1703496738143.png

 

 

0 Kudos
Reply

956 Views
Zhuang
Contributor I

This is my configuration

0 Kudos
Reply

953 Views
Senlent
NXP TechSupport
NXP TechSupport

HI@zhuang

This is no different from the demo configuration I provided to you.
I suggest you create a separate project to test this feature. You can add some flag bits for DMA transfer completion and PWM synchronization completion, and use a logic analyzer to analyze these timings.

0 Kudos
Reply

899 Views
Zhuang
Contributor I

Hi Senlent,

I want to confirm, how to confirm the completion of PWM synchronization?

0 Kudos
Reply

888 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@Zhuang

I read the relevant content, and there seems to be no flag bit when the hardware triggers synchronization completion.

Senlent_1-1703571868475.png

 

 

0 Kudos
Reply

884 Views
Zhuang
Contributor I

In addition to increasing the flag bit after the completion of DMA transfer, what other feasible measures?

0 Kudos
Reply

951 Views
Zhuang
Contributor I

I have now made some DMA complete transfer flag, only the flag set will allow the next send.
Now I want to confirm, how to confirm the completion of PWM synchronization?

0 Kudos
Reply

959 Views
Zhuang
Contributor I

I use Init_trig (CNT set 0) to trigger FTM output waveform change, FTM has waveform change, CHF set, trigger DMA so.

0 Kudos
Reply

1,008 Views
Zhuang
Contributor I

I used an S32K148

0 Kudos
Reply