PIC18F45K20-I/PT Microchip Technology, PIC18F45K20-I/PT Datasheet - Page 29
![IC PIC MCU FLASH 16KX16 44TQFP](/photos/6/82/68251/c04-076_pt_sml.jpg)
PIC18F45K20-I/PT
Manufacturer Part Number
PIC18F45K20-I/PT
Description
IC PIC MCU FLASH 16KX16 44TQFP
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr
Datasheets
1.PIC18F25K20T-ISS.pdf
(42 pages)
2.PIC18F25K20T-ISS.pdf
(12 pages)
3.PIC18F25K20T-ISS.pdf
(14 pages)
4.PIC18F25K20T-ISS.pdf
(456 pages)
5.PIC18F45K20-IPT.pdf
(78 pages)
6.PIC18F26K20-ISO.pdf
(430 pages)
Specifications of PIC18F45K20-I/PT
Program Memory Type
FLASH
Program Memory Size
32KB (16K x 16)
Package / Case
44-TQFP, 44-VQFP
Core Processor
PIC
Core Size
8-Bit
Speed
64MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
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 ~ 85°C
Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
1.5 KB
Interface Type
CCP/ECCP/EUSART/I2C/MSSP/SPI
Maximum Clock Frequency
64 MHz
Number Of Programmable I/os
36
Number Of Timers
4
Maximum Operating Temperature
+ 85 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734, 52712-325, EWPIC18
Development Tools By Supplier
PG164130, DV164035, DV244005, DV164005, PG164120, DV164136
Minimum Operating Temperature
- 40 C
On-chip Adc
14-ch x 10-bit
Package
44TQFP
Device Core
PIC
Family Name
PIC18
Maximum Speed
64 MHz
Operating Supply Voltage
2.5|3.3 V
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 PIC18F4XK20AC164305 - MODULE SKT FOR PM3 44TQFP
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
PIC18F45K20-I/PT
Manufacturer:
SIEMENS
Quantity:
32
Company:
Part Number:
PIC18F45K20-I/PT
Manufacturer:
MICROCHI
Quantity:
18 600
Company:
Part Number:
PIC18F45K20-I/PT
Manufacturer:
Microchip Technology
Quantity:
10 000
Part Number:
PIC18F45K20-I/PT
Manufacturer:
MICR0CHIP
Quantity:
20 000
3.3
© 2009 Microchip Technology Inc.
LESSON 3: ROTATE LED
This lesson builds on the previous two lessons to introduce defining global variables
and code sections, and to add rotation to the LED display. It will light up LED 0, then
shift it to LED 1, then to LED 2 and on up to LED 7, and back to LED 0.
In this and following lessons, please open the lesson workspace in the MPLAB IDE
upon starting the lesson.
3.3.1
In the source code file 03 Rotate LED.c for Lesson 3 the global variable,
LED_Number, is declared as in Figure 3-16.
FIGURE 3-16:
The directive #pragma udata is used prior to declaring the variable LED_Number to
indicate to the compiler that the following declarations are data variables that should be
placed in the PIC18FXXXX file registers. This differs from PC compilers where
instructions and variables share the same memory space due to the Harvard
architecture of the PIC18FXXXX as discussed in Section 2.1 of this document.
There are two directives for use with #pragma when defining variables:
Data declarations can also be given a section name. The section name may be used
with a Linker Script SECTION entry to place it in a particular area of memory. See
Section 2.9 of the “MPLAB C18 C Compiler User’s Guide” (DS51288) for more
information on using sections with Linker Scripts. Even without a Linker Script section,
the #pragma udata directive may be used to specify the starting address of the data
in the file registers. For example, to place LED_Number at the start of file register Bank
3 declare the udata section as:
Other variables declared in a udata or idata section will be placed at subsequent
addresses. For instance, the 16-bit integer
address 0x301 and 0x302
Note that function local variables will be placed on the software stack.
Key Concepts
/**
#pragma udata // declare statically allocated uninitialized variables
unsigned char LED_Number; // 8-bit variable
- The directives #pragma udata and #pragma idata are used to allocate
- The directive #pragma code is used to indicate a section of instructions to
- The directive #pragma romdata is used for constant (read-only) data
- Constant data can be stored in program memory so as not to use up file
udata
idata
#pragma udata mysection = 0x300 unsigned char
LED_Number; // 8-bit variable unsigned int
AnotherVariable;
memory for static variables in the file registers.
be compiled into the program memory of the PIC18FXXXX.
stored in the program memory. This is used with the keyword rom.
register RAM.
V
A
Allocating File Register Memory
R
Uninitialized data. The following data is stored uninitialized in the file register
space.
Initialized data. The following data is stored in the file register space. The initial-
ization values are stored in program memory, and then moved by the start-up
initialization code into file registers before program execution begins.
I
A
PICkit™ 3 Debug Express Lessons
B
LESSON 3 GLOBAL VARIABLE DECLARATION
L
E
.
S
*************************************************/
AnotherVariable above would occupy
DS41370C-page 25