Generating PWM frequency of QN908x

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

Generating PWM frequency of QN908x

Jump to solution
980 Views
roem
Contributor II

What is the PWM frequency that can be generated on QN908x?

I need 62.5 Hz PWM at QN908x.

However, frequencies below 125 Hz are not produced.

The code uses "qn908xcdk_driver_examples_sctimer_simple_pwm".
I tried to change the divider value shown in BOARD_BootClockRUN in clock_config.c but failed.

How can we generate 62.5 Hz?
Or what's the lowest Hz?

Tags (3)
0 Kudos
1 Solution
974 Views
nxf56274
NXP Employee
NXP Employee

Hi,

1 The parameter frequency is always uint. You can't generate the float pwm.

2 If you want to generate the pwm lower than 125, you should modify the function 'SCTIMER_CreateAndScheduleEvent'.

Refer the picture.

2.PNG

Have a great day,
TIC

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

- We are following threads for 7 days 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.
-------------------------------------------------------------------------------

View solution in original post

3 Replies
975 Views
nxf56274
NXP Employee
NXP Employee

Hi,

1 The parameter frequency is always uint. You can't generate the float pwm.

2 If you want to generate the pwm lower than 125, you should modify the function 'SCTIMER_CreateAndScheduleEvent'.

Refer the picture.

2.PNG

Have a great day,
TIC

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

- We are following threads for 7 days 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.
-------------------------------------------------------------------------------

968 Views
roem
Contributor II

Oh, as you say, it's created.

So why can't I generate frequencies lower than 125 Hz if I don't modify that part?

0 Kudos
963 Views
nxf56274
NXP Employee
NXP Employee

Hi,

Due to the macro 'SCT_SCTMATCH_MATCHn_L' , only low 16 bit will give to the SCTMATCH.

So the high 16 bit will miss. When your frequency is lower than 125hz, we should use high 16 bit. But the code use macro to ignore it. That's why you should modify it.

Have a great day,
TIC

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

- We are following threads for 7 days 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.
-------------------------------------------------------------------------------