PIC24HJ32GP202-I/SP Microchip Technology, PIC24HJ32GP202-I/SP Datasheet - Page 130

IC PIC MCU FLASH 32K 28DIP

PIC24HJ32GP202-I/SP

Manufacturer Part Number
PIC24HJ32GP202-I/SP
Description
IC PIC MCU FLASH 32K 28DIP
Manufacturer
Microchip Technology
Series
PIC® 24Hr

Specifications of PIC24HJ32GP202-I/SP

Program Memory Type
FLASH
Program Memory Size
32KB (11K x 24)
Package / Case
28-DIP (0.300", 7.62mm)
Core Processor
PIC
Core Size
16-Bit
Speed
40 MIPs
Connectivity
I²C, IrDA, LIN, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
21
Ram Size
2K x 8
Voltage - Supply (vcc/vdd)
3 V ~ 3.6 V
Data Converters
A/D 10x10b/12b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Processor Series
PIC24HJ
Core
PIC
Data Bus Width
16 bit
Data Ram Size
2 KB
Interface Type
I2C/SPI/UART
Maximum Clock Frequency
40 MHz
Number Of Programmable I/os
21
Number Of Timers
3
Maximum Operating Temperature
+ 85 C
Mounting Style
Through Hole
3rd Party Development Tools
52713-733, 52714-737, 53276-922, EWDSPIC
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, DM300027
Minimum Operating Temperature
- 40 C
On-chip Adc
10-ch x 12-bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
AC164337 - MODULE SOCKET FOR PM3 40DIP
Eeprom Size
-
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
PIC24HJ32GP202/204 and PIC24HJ16GP304
13.3
Use the following steps 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:
DS70289A-page 128
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 OxCR 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
the two PWM operation modes by writing to the
Output Compare Mode bits, OCM<2:0> and
(OCxCON<2:0>).
Set the TMRy prescale value and enable the
time base by setting TON = 1 (TxCON<15>)
Pulse-Width Modulation Mode
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
Secondary register, OCxRS, will not be
transferred into OCxR until a time base
period match occurs.
PWM PERIOD
CALCULATION FOR MAXIMUM PWM RESOLUTION
Maximum PWM Resolution (bits) =
Preliminary
EQUATION 13-1:
13.3.2
Specify the PWM duty cycle 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 glitchless PWM
operation. In the PWM mode, OCxR is a read-only reg-
ister.
Some important boundary parameters of the PWM duty
cycle include:
• If the Output Compare register, OCxR, is loaded
• If OCxR is greater than PRy (Timer Period register),
• 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 an example of PWM frequencies and
resolutions for a device operating at 10 MIPS.
PWM Period = [(PRy) + 1] • T
where:
PWM Frequency = 1/[PWM Period]
with 0000h, the OCx pin will remain low (0% duty
cycle).
the pin will remain high (100% duty cycle).
for one time base count value and high for all
other count values.
Note:
log
10
log
(
10
F
F
(2)
PWM
PWM DUTY CYCLE
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
eight time base cycles.
CY
)
bits
CALCULATING THE PWM
PERIOD
© 2007 Microchip Technology Inc.
CY
• (Timer Prescale Value)

Related parts for PIC24HJ32GP202-I/SP