PIC24FJ16GA MICROCHIP [Microchip Technology], PIC24FJ16GA Datasheet - Page 130

no-image

PIC24FJ16GA

Manufacturer Part Number
PIC24FJ16GA
Description
28/44-Pin General Purpose, 16-Bit Flash Microcontrollers
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC24FJ16GA002-E/ML
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC24FJ16GA002-E/ML
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC24FJ16GA002-E/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC24FJ16GA002-I/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Company:
Part Number:
PIC24FJ16GA002-I/SS
Quantity:
14
Part Number:
PIC24FJ16GA002T-I/SO
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC24FJ16GA004-E/ML
Manufacturer:
Microchip Technology
Quantity:
135
Part Number:
PIC24FJ16GA004-E/PT
Manufacturer:
IXYS
Quantity:
3 000
Part Number:
PIC24FJ16GA004-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC24FJ16GA004-I/ML
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC24FJ16GA004-I/PT
Manufacturer:
Microchip Technology
Quantity:
1 886
Part Number:
PIC24FJ16GA004-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC24FJ16GA004T-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PIC24FJ64GA004 FAMILY
13.3
The following steps should be taken when configuring
the output compare module for PWM operation:
1.
2.
3.
4.
5.
6.
13.3.1
The PWM period is specified by writing to PRy, the
Timer Period register. The PWM period can be
calculated using Equation 13-1.
EQUATION 13-2:
DS39881C-page 128
Note:
Note:
Set the PWM period by writing to the selected
Timer Period register (PRy).
Set the PWM duty cycle by writing to the OCxRS
register.
Write the OCxR register with the initial duty cycle.
Enable interrupts, if required, for the timer and
output compare modules. The output compare
interrupt is required for PWM Fault pin utilization.
Configure the output compare module for one of
two PWM Operation modes by writing to the
Output
(OCxCON<2:0>).
Set the TMRy prescale value and enable the time
base by setting TON (TxCON<15>) = 1.
Pulse-Width Modulation Mode
This peripheral contains input and output
functions that may need to be configured
by
Section 9.4 “Peripheral Pin Select” for
more information.
The OCxR register should be initialized
before the output compare module is first
enabled. The OCxR register becomes a
Read-Only Duty Cycle register when the
module is operated in the PWM modes.
The value held in OCxR will become the
PWM duty cycle for the first PWM period.
The contents of the Output Compare x
Secondary register, OCxRS, will not be
transferred into OCxR until a time base
period match occurs.
PWM PERIOD
Compare
the
Maximum PWM Resolution (bits) =
Note 1: Based on F
peripheral
CALCULATION FOR MAXIMUM PWM RESOLUTION
Mode
bits,
pin
select.
OCM<2:0>
CY
= F
OSC
See
Preliminary
/2, Doze mode and PLL are disabled.
log
10
(
F
PWM
EQUATION 13-1:
13.3.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 PRy and TMRy 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 Output Compare x register, OCxR, is loaded
• If OCxR is greater than PRy (Timer Period
• If OCxR is equal to PRy, the OCx pin will be low
See Example 13-1 for PWM mode timing details.
Table 13-1 shows example PWM frequencies and
resolutions for a device operating at 10 MIPS.
PWM Period = [(PRy) + 1] • T
where:
Note 1:
Note:
with 0000h, the OCx pin will remain low (0% duty
cycle).
register), the pin will remain high (100% duty
cycle).
for one time base count value and high for all
other count values.
PWM Frequency = 1/[PWM Period]
• (Timer Prescale Value)
log
10
F
CY
(2)
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 DUTY CYCLE
Based on T
and PLL are disabled.
(1)
CALCULATING THE PWM
PERIOD
CY
© 2008 Microchip Technology Inc.
)
= 2 * T
CY
bits
• (Timer Prescale Value)
(1)
OSC
, Doze mode

Related parts for PIC24FJ16GA