pic32mx320f064h Microchip Technology Inc., pic32mx320f064h Datasheet - Page 314

no-image

pic32mx320f064h

Manufacturer Part Number
pic32mx320f064h
Description
64/100-pin General Purpose, 32-bit Flash Microcontrollers
Manufacturer
Microchip Technology Inc.
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-40I/PT
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
pic32mx320f064h-40V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064h-80V/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
pic32mx320f064hT-40I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PIC32MX FAMILY
16.4.1
The PWM period is specified by writing to PR, the
Timer Period register. The PWM period can be
calculated using Equation 16-1.
EQUATION 16-1:
EQUATION 16-2:
EXAMPLE 16-2:
DS61143A-page 312
PWM Frequency = 1/[PWM Period]
PWM Period = [(PRy) + 1> • T
Desired PWM frequency is 52.08 kHz,
F
Timer 2 prescale setting: 1:1
Find the maximum resolution of the duty cycle that can be used with a 52.08 kHz PWM frequency
and a 10 MHz peripheral bus clock rate.
Note:
Note:
PB
1/52.08 kHz
19.20 μs
PR2
1/52.08 kHz
19.20 μs
192
PWM Resolution= 7.6 bits
= 10 MHz
log
10
(192)
A PRy value of N will produce a PWM
period of N + 1 time base count cycles. For
example, a value of 7 written into the PRy
register will yield a period consisting of
8 time base cycles.
PWM PERIOD
If the PR value exceeds 16-bits the module must be used in 32-bit mode to maintain the calculated PWM
resolution. If reduced resolution is acceptable the Timer prescaler may be increased and the calculation
repeated until the result is a 16-bit value. Increasing the Timer prescaler to allow operation in 16-bit mode
may result in reduced PWM resolution.
= (PR2 + 1) • F
= (PR2 + 1) • 0.1 μs • (1)
= 191
= 2
= 2
= 2
= (PWM Resolution) • log
CALCULATING THE PWM
PERIOD
CALCULATION FOR MAXIMUM PWM RESOLUTION
PWM PERIOD AND DUTY CYCLE CALCULATION
Maximum PWM Resolution (bits) =
PWM RESOLUTION
PWM RESOLUTION
PWM RESOLUTION
PB
• (TMRy Prescale Value)]
BP
• 100 ns • 1
• 1/10 MHz • 1
• (Timer2 prescale value)
Advance Information
10
(2)
log
10
16.4.2
The PWM duty cycle is specified by writing to the
OCxRS register. The OCxRS register can be written to
at any time, but the duty cycle value is not latched into
OCxR until a match between the PR and timer occurs
(i.e., the period is complete). This provides a double
buffer for the PWM duty cycle and is essential for glitch-
less PWM operation. In the PWM mode, OCxR is a
read-only register.
Some important boundary parameters of the PWM duty
cycle include:
• If the Duty Cycle register, OCxR, is loaded with
• If OCxR is greater than PR (Timer Period register),
• If OCxR is equal to PR, the OCx pin will be low for
See Example 16-2 for PWM mode timing details.
Table 16-2 shows example PWM frequencies and
resolutions for a device peripheral bus operating at
10 MHz.
(
0000h, the OCx pin will remain low (0% duty cycle).
the pin will remain high (100% duty cycle).
one time base count value and high for all other
count values.
F
PWM
• TMRy • Prescaler
log
PWM DUTY CYCLE
F
10
PB
(2)
© 2007 Microchip Technology Inc.
)
bits

Related parts for pic32mx320f064h