PIC18F45K20-E/ML Microchip Technology, PIC18F45K20-E/ML Datasheet - Page 75

32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 44 QFN 8x8x0.9mm TU

PIC18F45K20-E/ML

Manufacturer Part Number
PIC18F45K20-E/ML
Description
32KB, Flash, 1536bytes-RAM, 36I/O, 8-bit Family,nanowatt XLP 44 QFN 8x8x0.9mm TU
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-E/ML

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
44-QFN
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-61:
© 2009 Microchip Technology Inc.
CCPXCON: CCPX CONTROL REGISTER
For more information on Timer2 see Section 13.0 “Timer2 Module” of the
PIC18F45K20 Data Sheet (DS41303). More info on the CCP module PWM
functionality can be found in Section 15.0 “Capture/Compare/PWM (CCP) Module”,
and Section 15.4 “PWM Mode”.
3.12.3
The PWM signal from the CCP1 module is normally output on the CCP1/RC2 pin.
However, this pin is not connected to any demo board LEDs. To output a signal on an
LED pin, the Enhanced CCP module (ECCP) on the PIC18F45K20 is utilized. This
functionality is selected in the upper 2 bits of CCP1CON (P1Mx), which are set to 0b01
so the modulated PWM signal appears on the P1D/RD7 which drives LED 7. No other
aspect of the enhanced PWM functionality is used; for more information see Section
16.0 “Enhanced Capture/Compare/Pwm (ECCP) Module”.
The first thing done in the lesson source code is to set PWM pin RD7 to an output.
Timer2 is then configured to generate the PWM period of 16 ms as discussed
previously in this lesson.
TRISDbits.TRISD7 = 0;
T2CON
PR2
=
Exploring the Lesson 12 Source Code
=
249;//
0b00000111;//
PICkit™ 3 Debug Express Lessons
Timer
2
Prescale
Period
Register
=
1:16,
=
timer on
250 counts
DS41370C-page 71

Related parts for PIC18F45K20-E/ML