PWM calculation period and duty in LPC546

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

PWM calculation period and duty in LPC546

676 Views
k_sunilgupta
Contributor II

Is there any calculation for generating the PWM of 20KHz.

my core clock is 180MHz.

i am using LPC54606J512BD100 micro controller.

 

If anyone know this please reply.

 

@mgnxp @nxp16 

0 Kudos
1 Reply

669 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Do you use CTimer module or SCTimer/PWM module to generate the PWM signal? If you use CTimer to generate the PWM signal, as you know that the PWM Reset match register will be

180MHz/20KHz=9K

so it is okay to set the match register as 9000 which reset the counter.

If you use SCTimer/PWM module, you can set the limit register as 9000, which sets up the PWM frequency.

Hope it can help you

BR'

XiangJun Rong

 

 

0 Kudos