Hi.

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

Hi.

1,435 Views
ranjithshanbhag
Contributor III

I am using LPC824 and trying to generate PWM with frequency modulation by using SCT timer. Datasheet is saying 'Up to six single-edge or dual-edge PWM outputs with independent duty cycle and common PWM cycle length'.

1. Whether different frequency can be configured?

2. If not, how frequency modulation can be achieved?

Carrier frequency = 500Hz and Modulated frequency = 100Khz.

Please guide me.

0 Kudos
9 Replies

815 Views
ranjithshanbhag
Contributor III

Hi jeremyzhou,

Thanks a lot for your quick reply.

Now both counters(COUNT_L and COUNT_H) are working. I am generating PWM using COUNT_L and normal timer using COUNT_H, But both are operating at same frequency. Can you tel me how to operate at different frequency?

0 Kudos

815 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ranjith Shanbhag,

The SCT module is clocked by setting the CLKMODE bits in SCT configuration register, so the identical per count cycle when SCT operates as two 16 bit counters, however it doesn't impact to generated differ frequency PWM.

As mentioned before, The SCT is able to generate complicated PWM as integrates the event and state features.

And you can find the SCT sample code in the LPC8xx family code example bundles:

LPC8xx family code example bundles 

Hope this is clear.
Have a great day,
Ping

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

0 Kudos

815 Views
ranjithshanbhag
Contributor III

Hi jeremyzhou,

Thanks for the information.

Can you tel me how to generate PWM or how to configure timer using COUNT_H counter?

any sample code available for this?

0 Kudos

815 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ranjith Shanbhag,

Please refer to LPC8xx family code example bundles: https://community.nxp.com/community/lpc/blog/2016/09/02/lpc8xx-family-code-example-bundles
Have a great day,
Ping

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

0 Kudos

815 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ranjith Shanbhag,

The SCT is able to make it with the event and state features, and you can learn the more information about these feature through the thread and please refer to it for details.

SCTimer implement traffic signal
Have a great day,
Ping

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

0 Kudos

815 Views
ranjithshanbhag
Contributor III

Hi jeremyzhou,

And I'd like to know what kind of the PWM wave you want, and the SCT is capable to generate some complicated PWM.

Two PWM's of 500Hz nad 100KHz

0 Kudos

815 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ranjith Shanbhag,

Whether it is possible to configure 2 different frequencies using two 16 bit counters?

From the perspective of the theory, the answer is yes.

And I'd like to know what kind of the PWM wave you want, and the SCT is capable to generate some complicated PWM.
Have a great day,
Ping

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

0 Kudos

815 Views
ranjithshanbhag
Contributor III

Hi jeremyzhou,

Thanks for your valuable reply.

There are 3 counters for SCT timer(one 32bit counter and two 16 bit counter). Whether it is possible to configure 2 different frequencies using two 16 bit counters?

815 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Ranjith Shanbhag,

1. Whether different frequency can be configured?

No, the period of all PWM are identical.

2. If not, how frequency modulation can be achieved?

I'd like to suggest you can refer to SCT demos for details, you can find the LPC8xx family code sample in following link.

LPC8xx family code example bundles 


Have a great day,
Ping

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

0 Kudos