Вы находитесь на странице: 1из 2

Sheet1

F
OSC
8 MHz PIC master oscillator frequency
T
OSC
0.125 s Time for one cycle of F
OSC
TMR2 pre-scaler 1 Pre-scaler ratio assigned to timer 2
PWM frequency 31250 Hz Desired PWM output frequency
PWM period 32 s
PR2 63
TMR2 pre-scaler 1 Pre-scaler ratio assigned to timer 2
PR2 63 Timer 2 reload value
PWM period 32 s
PWM frequency 31250 Hz
Duty cycle value 24 (CCPR1L:CCPCON<5:4>)
TMR2 pre-scaler 1 Pre-scaler ratio assigned to timer 2
High time 3 s Length of time PWM output is high
Low time 29 s Length of time PWM output is low
Duty cycle 9.375 % PWM output duty cycle
Resolution 8 bits Theoretical duty cycle resolution
Usable resolution 8 bits Usable duty cycle resolution
Maximum Resolution
Created by Philip Pemberton: philpem@dsl.pipex.com / www.philpem.me.uk
PIC PWM Value Calculator
PWM Period Calculations
Solve for PR2
Solve for PWM period
PWM Duty Cycle Note: period taken from Solve for PWM
Page 1
Sheet1
Created by Philip Pemberton: philpem@dsl.pipex.com / www.philpem.me.uk
PIC PWM Value Calculator
Page 2

Вам также может понравиться