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

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
DS41370C-page 24
Headers for the libraries can be found in the MCC18 header directory C:\MCC18\h.
The source code for most of the libraries can be found in C:\MCC18\src, and the
libraries themselves are in C:\MCC18\lib. For more detailed information on the
included library functions see the “MPLAB C18 C Compiler Libraries” document
(DS51297).
The other new line of special interest is a function call to a function in the delays library:
This function creates a time delay with a software of 1000 (1k) instruction cycles (TCY)
times the argument value. In this case, the argument is 50 so this function will delay for
50 x 1,000 = 50,000 instruction cycles. The instruction rate on PIC18FXXXX
microcontrollers is equal to 1/4
execute an instruction. In this case the clock is the internal oscillator at 1 MHz, so the
instruction rate is 250 kHz, or TCY = 4us per instruction. The total delay is 50,000 x 4us
= 200 ms, which is slow enough for the human eye to see the LED turning on and off.
The Lesson 2 program runs this delay inside an indefinite while loop, which sets the
RD7 I/O pin to the complement of its current value (the effect is to switch it back and
forth between high and low) with a 200 ms delay in between each RD7 output level
change. This blinks the demo board LED 7.
3.2.4
Select MPLAB IDE menu, build the Lesson 2 project and program the code into the
demo board PIC18F45K20 using the PICkit 3 Programmer as we did in Lesson 1.
The demo board LED 7 will blink continuously at 200 ms on and 200 ms off.
Delay1KTCYx(50);
Build and Program the Lesson 2 Code
th
the oscillator clock; in other words, it takes 4 clocks to
© 2009 Microchip Technology Inc.

Related parts for PIC18F45K20-E/P