PIC18F45K20-E/P Microchip Technology, PIC18F45K20-E/P Datasheet - Page 74

32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 40 PDIP .600in TUBE

PIC18F45K20-E/P

Manufacturer Part Number
PIC18F45K20-E/P
Description
32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 40 PDIP .600in TUBE
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-E/P

Core Processor
PIC
Core Size
8-Bit
Speed
48MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
Program Memory Size
32KB (16K x 16)
Program Memory Type
FLASH
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 ~ 125°C
Package / Case
40-DIP (0.600", 15.24mm)
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 PIC18F4XK20
Lead Free Status / RoHS Status
Lead free / RoHS Compliant

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18F45K20-E/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
PICkit™ 3 Debug Express
FIGURE 3-60:
DS41370C-page 70
SIMPLIFIED PWM BLOCK DIAGRAM
Now that the frequency has been determined, it is necessary to set up the CCP1
module for PWM using the CCP1CON register. Bits CCP1Mx determine the module
mode; there is only one value to select for PWM, CCP1Mx = 0b11xx where the ‘x’ bits
are “don’t care”, so 0b1100 will work. The two DC1Bx bits in CCP1CON are the 2 Least
Significant bits of the 10-bit PWM duty cycle value. The 8 Most Significant of the 10 bits
are written to CCPR1L.
The duty cycle value is determined by the duty cycle percentage (DC%) times the 10-bit
time base (PR2 * 4). DCValue = DC% * (PR2 * 4). For example, to get a duty cycle of
50%, the value would be 50% * (250 * 4) = 500. 500 decimal is 0x1F4 hex or 0b01 1111
0100 binary. The 8 Most Significant bits, 0b01 1111 01 or 0x7D, are written to CCPR1L,
and the 2 LSbs are written to the DC1B1 and DC1B0 bits in CCP1CON.
© 2009 Microchip Technology Inc.

Related parts for PIC18F45K20-E/P