pwm WS2811

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

pwm WS2811

1,606 次查看
mswd
Contributor I

hi 

i have a problem that i haven't solved yet.

mswd_0-1716867053876.png

mswd_1-1716867064419.png

failed to generate the above waveform.

through searching i found out a few things.

one of them is that control is possible through overinterrupt.

but i don't know how to use it.

ex) how do you set the overinterrupt to 0.5ns?

i need an example for k146.

please help me. thanks.

 

this is the source code i referenced.

https://community.nxp.com/t5/S32K/S32K144-FTM-Output-Compare-for-Single-Pulse/m-p/844006

0 项奖励
回复
3 回复数

1,557 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi

I did not go through the s32k144_OneShot.zip and their reply completely. Please correct me if I understand it wrong.
I saw that the FTM is configured in Output Compare mode, and it is recommended to modify CnV and MOD to meet your needs (0.5us or 1.2us high pulse  ,  2.5us period )

Also I don't understand why you want to set overinterrupt to 0.5ns? Shouldn't you set overinterrupt to 0.5us and 1.2us?

s32k144_OneShot Output Compare mode.png

Sorry, this example is based on S32K144. It is recommended that you create a new S32K146 project and then add the relevant codes.


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

1,542 次查看
mswd
Contributor I

how do i set MOD and CnV to set it to 1.2us?

sorry, but i don't understand pwm settings.

0 项奖励
回复

1,492 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

That example, configure FTM_SC_CLKS(2)=10b - Fixed frequency clock = SIM_LPOCLKS[RTCCLKSEL]=00b - SOSCDIV1_CLK = 8MHz

And FTM_SC_PS(7) means the FTM counter clock = 8MHz/128. This frequency is too low to generate 0.5us and 1.2us. It is recommended to modify the frequency division(FTM_SC_PS(1) ) or select a higher FTM Clock such as 48MHz FIRC.

If you configure FTM_SC_PS(1), then each FTM counter takes 1/8MHz=0.125us
If you want to get 1.2us, then oneshot0 = 1.2/0.125=9.6≈10;

 

Sorry I am not familiar with s32k144_OneShot.zip. If you don't understand how to use it, I suggest you refer to other MCU examples to use DMA or FlexIO.

NeoShield: WS2812 RGB LED Shield with DMA and nRF24L01+

NXP FlexIO Generator for the WS2812B LED Stripe Protocol

0 项奖励
回复