Using the QN9090's PWM function to ring the buzzer

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

Using the QN9090's PWM function to ring the buzzer

跳至解决方案
2,611 次查看
Jose7
Contributor I

Hello.

I want to use the QN9090's PWM function to make a buzzer sound.

I believe the PWM frequency can be set from "pwm_setup_t" in "fsl_pwm.h".

However, I don't know how "prescaler_val", "period_val", and "comp_val" affect the PWM. Please let me know if there is a formula for calculating the PWM frequency from these three values.

Kind regards.

0 项奖励
回复
1 解答
2,532 次查看
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Jose7 

Hope below information is helpful for you:

18.6.1 Prescaler
There are eleven 10-bit prescalers. The frequency of the scaled clock enable is calculated
as follows.
F
scaled = Fclk / (pscl +1)
Where F
clk is the frequency of the AHB clock, pscl is the prescaler setting for the PWM
channel.

And also we have QN9090's User Manual in below link, you can find more details in Chapter 18: Pulse Width Modulation (PWM).

QN9090(T)/QN9030(T) User Manual

Please let me know whether you have any other concerns on this thread. If no, please do not hesitate to mark this reply as a solution.

Best regards,

Christine.

在原帖中查看解决方案

标记 (1)
0 项奖励
回复
5 回复数
2,581 次查看
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Jose7 

Thanks for creating case to us.

May I ask what is your SDK version and what IDE version are you using?

Are you using MCUXpresso? or other IDE?

Let's sync these basic information so that I can check the source code on my side for you.

 

Best regards,

Christine.

标记 (1)
0 项奖励
回复
2,547 次查看
Jose7
Contributor I

Hello.

Thank you for your reply.

I will state the version of the SDK and IDE I am using.

SDK :    SDK_2_6_4_QN9090DK6

IDE :    MCUXpresso IDE v11.8.0

Kind regard.

0 项奖励
回复
2,534 次查看
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Jose7 

Thanks for your feedback.

I will check it and reply to you soon.

At the same time, would you mind to checkout to our latest release: SDK_2.6.14_QN9090DK6?

 

Best regards,

Christine.

标记 (1)
0 项奖励
回复
2,533 次查看
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Jose7 

Sorry, forgot to ask your SDK example.

Which example did you import to your workspace?

I have downloaded QN9090's SDK, and trying to check your issue now.

 

Best regards,

Christine.

标记 (1)
0 项奖励
回复
2,533 次查看
Christine_Li
NXP TechSupport
NXP TechSupport

Hi, @Jose7 

Hope below information is helpful for you:

18.6.1 Prescaler
There are eleven 10-bit prescalers. The frequency of the scaled clock enable is calculated
as follows.
F
scaled = Fclk / (pscl +1)
Where F
clk is the frequency of the AHB clock, pscl is the prescaler setting for the PWM
channel.

And also we have QN9090's User Manual in below link, you can find more details in Chapter 18: Pulse Width Modulation (PWM).

QN9090(T)/QN9030(T) User Manual

Please let me know whether you have any other concerns on this thread. If no, please do not hesitate to mark this reply as a solution.

Best regards,

Christine.

标记 (1)
0 项奖励
回复
%3CLINGO-SUB%20id%3D%22lingo-sub-1910864%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%E4%BD%BF%E7%94%A8QN9090%E7%9A%84PWM%E5%8A%9F%E8%83%BD%E6%9D%A5%E4%BD%BF%E8%9C%82%E9%B8%A3%E5%99%A8%E5%93%8D%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1910864%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3E%E6%82%A8%E5%A5%BD%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E6%83%B3%E4%BD%BF%E7%94%A8QN9090%E7%9A%84PWM%E5%8A%9F%E8%83%BD%E6%9D%A5%E5%8F%91%E5%87%BA%E8%9C%82%E9%B8%A3%E5%99%A8%E7%9A%84%E5%A3%B0%E9%9F%B3%E3%80%82%3C%2FP%3E%3CP%3E%E6%88%91%E7%9B%B8%E4%BF%A1%E5%8F%AF%E4%BB%A5%E4%BB%8E%E2%80%9Cfsl_pwm.h%E2%80%9D%E4%B8%AD%E7%9A%84%E2%80%9Cpwm_setup_t%E2%80%9D%E8%AE%BE%E7%BD%AEPWM%E9%A2%91%E7%8E%87%E3%80%82%3C%2FP%3E%3CP%3E%E4%BD%86%E6%98%AF%EF%BC%8C%E6%88%91%E4%B8%8D%E7%9F%A5%E9%81%93%E2%80%9Cprescaler_val%E2%80%9D%E3%80%81%E2%80%9Cperiod_val%E2%80%9D%E5%92%8C%E2%80%9Ccomp_val%E2%80%9D%E5%A6%82%E4%BD%95%E5%BD%B1%E5%93%8DPWM%E3%80%82%E8%AF%B7%E5%91%8A%E8%AF%89%E6%88%91%E6%98%AF%E5%90%A6%E6%9C%89%E4%B8%80%E4%B8%AA%E5%85%AC%E5%BC%8F%E5%8F%AF%E4%BB%A5%E6%A0%B9%E6%8D%AE%E8%BF%99%E4%B8%89%E4%B8%AA%E5%80%BC%E8%AE%A1%E7%AE%97%20PWM%20%E9%A2%91%E7%8E%87%E3%80%82%3C%2FP%3E%3CP%3E%E4%BA%B2%E5%88%87%E7%9A%84%E9%97%AE%E5%80%99%E3%80%82%3C%2FP%3E%3C%2FLINGO-BODY%3E