PIC18F45K20-I/ML Microchip Technology, PIC18F45K20-I/ML Datasheet - Page 73

IC PIC MCU FLASH 16KX16 44QFN

PIC18F45K20-I/ML

Manufacturer Part Number
PIC18F45K20-I/ML
Description
IC PIC MCU FLASH 16KX16 44QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-I/ML

Program Memory Type
FLASH
Program Memory Size
32KB (16K x 16)
Package / Case
44-QFN
Core Processor
PIC
Core Size
8-Bit
Speed
64MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
Eeprom Size
256 x 8
Ram Size
1.5K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 3.6 V
Data Converters
A/D 14x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
1.5 KB
Interface Type
CCP/ECCP/EUSART/I2C/MSSP/SPI
Maximum Clock Frequency
64 MHz
Number Of Programmable I/os
36
Number Of Timers
4
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734, 52712-325, EWPIC18
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, DV164136
Minimum Operating Temperature
- 40 C
On-chip Adc
14-ch x 10-bit
Package
44QFN EP
Device Core
PIC
Family Name
PIC18
Maximum Speed
64 MHz
Operating Supply Voltage
2.5|3.3 V
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
For Use With
DM240313 - BOARD DEMO 8BIT XLPAC164112 - VOLTAGE LIMITER MPLAB ICD2 VPPDM164124 - KIT STARTER FOR PIC18F4XK20AC164322 - MODULE SOCKET MPLAB PM3 28/44QFN
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
FIGURE 3-59:
© 2009 Microchip Technology Inc.
Timer2 also has a postscaler, but the postscaler does not affect the CPP module
operation PWM time base, so its settings are “don’t care.” The Timer2 module also has
a Period Register, known as PR2. This Special Function Register is the maximum to
which Timer2 can count before being reset to 0.
Normally, an 8-bit timer would count up to 255 before resetting to 0 and beginning to
count again. With the PR2 register, the timer counts up to the value in PR2. When it
reaches this value, the timer is reset to 0. For example if PR2 = 3, then Timer2 would
count 0-1-2-3-0-1-2-3-0-1-2-3- etc.
The count cycle from zero up until Timer2 reaches the PR2 in conjunction with the timer
prescaler (which determines how long each timer count takes) determines the PWM
frequency. The time between each reset to 0 in Timer2 is the PWM period. For
example, assume we want a PWM frequency of 62.5 Hz, which has a period of 16 ms.
Our clock is the internal oscillator block default, 1 MHz, which gives a 250 kHz
instruction rate. 250,000 Hz/62.5 Hz = 4000. Thus, we need to count 4000 times at 250
kHz before each Timer2 Reset. However, Timer2 is 8 bits and can count to a maximum
of 255. So we must use the prescaler to slow down the counting. Timer2 has 3
prescaler options: 1:1, 1:4, or 1:16 (Figure 3-59). 4000/256 = 15.6 so it requires a
prescaler of 1:16.
With the prescaler set to 1:16, the count frequency of Timer2 is 250,000 Hz/16 = 15625
Hz. To get our PWM frequency of 62.5 Hz, Timer 2 must count 15625/62.5 = 250 times.
Since Timer2 starts at 0, we set PR2 = 249, so it counts 0-249 (250 counts), resets to
zero, and counts back to 249. A simplified diagram of the PWM module is shown in
Figure 3-60.
T2CON: TIMER2 CONTROL REGISTER
PICkit™ 3 Debug Express Lessons
DS41370C-page 69

Related parts for PIC18F45K20-I/ML