cancel
Showing results for
Did you mean:

# PSoC 5, 3 & 1 MCU Anonymous
Not applicable

## PWM Duty and Period Calculation

Hi,

I need to 1.25 microsecond off and 21.0 microsecond on pulse using pwm and i have used PSoc 5LP cy8ckit - 059 . Could you please help me how to calculate the duty cycle and period for PWM. I am waiting for your reference.

Thanks,

MohanRaj R

1 Solution
Honored Contributor II

## Re: PWM Duty and Period Calculation

Bring it to round numbers first by multiplying x4:

1.25×4=5 (off)

21×4=84 (on)

Total period 84+5=89, PWM set to 89-1=88.

Set PWM compare=5-1=4, mode 'less then'.

Set external clock freq. 4MHz (5/1.25us)

Sounds like homework. Did I pass the test?

2 Replies
Honored Contributor II

## Re: PWM Duty and Period Calculation

Bring it to round numbers first by multiplying x4:

1.25×4=5 (off)

21×4=84 (on)

Total period 84+5=89, PWM set to 89-1=88.

Set PWM compare=5-1=4, mode 'less then'.

Set external clock freq. 4MHz (5/1.25us)

Sounds like homework. Did I pass the test? Anonymous
Not applicable

## Re: PWM Duty and Period Calculation 