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

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
3.2
© 2009 Microchip Technology Inc.
LESSON 2: BLINK LED
This lesson discusses the Configuration bits of the PIC18FXXXX microcontrollers and
how to set them in an MPLAB C source file. It also presents using a library function and
shows how delays can be used to blink an LED on the demo board.
3.2.1
This and the remaining lessons already have a project and workspace defined. To open
the workspace for Lesson 2, select menu File > Open Workspace… in the MPLAB IDE.
Browse to the directory C:\Lessons\PICkit 3 Debug Express Lessons\02
Blink LED and open the 02 Blink LED.mcw file.
Before opening the new workspace, the MPLAB IDE will prompt you to save the current
workspace. It is generally a good idea to click Yes. Afterwards, the new workspace and
project for Lesson 2 will open.
3.2.2
Configuration bits are fuses in the PIC18FXXXX microcontrollers that are programmed
along with the application code to set up or “configure” different microcontroller
operating modes and enable or disable certain microcontroller features. For example,
in the PIC18F45K20 the Configuration bits select such features as which oscillator
option to use, whether the processor runs in Traditional or Extended mode; whether to
use the Brown-out Reset circuit and which voltage to trip at; whether the Watchdog
Timer is enabled or disabled and which options to use, and if the Flash memory
code-protect feature is enabled, among many other options.
Note that some features, such as the Watchdog Timer, can be configured so that it may
be enabled or disabled by software in the Special Function Registers while the
application code is executing. For detailed descriptions and information on the
PIC18F45K20 Configuration bits, see Section 23.1 “Configuration Bits” in the data
sheet, under the section heading 23.0 “Special Features of the CPU”.
In the Lesson 2 source code, all Configuration bits are defined at the top of the 02
Blink LED.c file, as shown in Figure 3-12.
Key Concepts
- Open existing project work spaces by selecting File > Open Workspace…
- Configuration bits are special purpose fuse bits that set PIC microcontroller
- A number of libraries are included with the MPLAB C compiler with
- Delays can be created to time events by using software loops.
in the MPLAB IDE.
modes of operation and enable or disable microcontroller features.
predefined and compiled functions. The “MPLAB C18 C Compiler Libraries”
document (DS51297) provides detailed information on all included libraries.
Opening the Lesson 2 Project and Workspace in the MPLAB
IDE
Defining Configuration Bit Settings in the Source Code
PICkit™ 3 Debug Express Lessons
DS41370C-page 21

Related parts for PIC18F45K20-E/P