SCT applicaion - count PWM pluse number

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

SCT applicaion - count PWM pluse number

2,097 Views
yansinli
Contributor III

how to count PWM  pulse  by SCT ?

for example . sent 200K 100pulse(duty 50~40%) to SCT。

SCT can count 100 pulse(can not use SCTinterupt) 

please give me example.thanks.

------------------------------------------------------------------

如何使用SCT計算PWM脈波數

例如,送200K 100個PLUSE (duty50~40%) 到SCT

SCT 能計數到100個脈波數(不能使用SCT中斷)

請麻煩提供範例 謝謝

-------------------------------------------------------------------------

0 Kudos
Reply
5 Replies

1,837 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello,

Could you please specify which MCU you are using?

Best Regards,

Sabina

0 Kudos
Reply

1,837 Views
yansinli
Contributor III

LPC1519

0 Kudos
Reply

1,837 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello,

I apologize for the delayed response. You can find much detail in the SCTimer/PWM Cookbook application note. I recommend checking section 7 of the application note. Here you will find sample code on how to initalize your module in order to count up or down. 

You may find example projects in the following path of your PC if you have download MCUXpresso as your IDE.

C:\nxp\MCUXpressoIDE_11.0.0_2516\ide\Examples\LPCOpen\lpcopen_2_20_lpcxpresso_nxp_lpcxpresso_1549.zip\periph_sct_pwm

Best Regards,

Sabina

0 Kudos
Reply

1,837 Views
yansinli
Contributor III

this section7 example is output PWM.  I neee  to count PWM.  

0 Kudos
Reply

1,837 Views
Sabina_Bruce
NXP Employee
NXP Employee

You can find further information regarding how to configure the SCTimer as a counter. In the reference manual the register and configurations choices are described in Section 15.7.10 to 15.7.12. Unfortunately there is not an example made using this configuration. However, if you have begun working on it and are having trouble. Please provide your configuration so that I may review it. 

Best Regards,

Sabina

0 Kudos
Reply