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

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
3.12
FIGURE 3-58:
DS41370C-page 68
LESSON 12: USING THE CCP MODULE PWM
This lesson gives a brief introduction to using the Pulse Width Modulation (PWM)
functionality of the Capture/Compare/PWM (CCP) peripheral of the PIC18F45K20.
3.12.1
In short, Pulse Width Modulation is a square wave of a given frequency where the duty
cycle of the period is varied. The duty cycle is a ratio of how long the signal is high to
the total length of the period. For example, a waveform with a frequency of 250 Hz has
a period of 4ms. For a PWM signal with a 25% duty cycle, the waveform would be high
for 1ms and low for 3ms (and then repeat). A PWM signal with 50% duty is high for 2ms
and low for 2ms, while a 75% duty cycle would be high for 3ms and low for 1ms.
EXAMPLE PWM DUTY CYCLES
Pulse Width modulation is used in a variety of applications, including communications,
motor control, audio and analog outputs, and lighting. In this lesson, the brightness of
a demo board LED will be controlled with the output of the PWM. The LED is only on
during the high portion of the PWM period, and is off during the low period. As the duty
cycle is decreased, the LED is on for a shorter and shorter portion of the PWM period,
so it appears dimmer. The frequency is set high enough that the human eye cannot
detect the individual blinks of each period, but sees the LED light as continuously on.
3.12.2
Timer2 is used to set the period, or frequency, of the PWM waveform. Timer2 operation
is very similar to Timer0 discussed in Lesson 5, with a few differences. Namely, Timer2
is always an 8-bit timer.
Key Concepts
- The PWM time base (frequency) is determined by Timer2 and the PR2
- PWM operation of the CCP module is selected in the CCPxCON SFR.
- Up to 10 bits of resolution are possible, with the 8 MSbs of the duty cycle in
- The actual amount of duty cycle resolution depends on the value of the PR2
Special Function Register.
CCPRxL, and the 2 LSBs in CCPxCON.
register.
PWM Overview
Using the CCP Module
© 2009 Microchip Technology Inc.

Related parts for PIC18F45K20-E/P