PIC18F45K20-I/ML Microchip Technology, PIC18F45K20-I/ML Datasheet - Page 55

IC PIC MCU FLASH 16KX16 44QFN

PIC18F45K20-I/ML

Manufacturer Part Number
PIC18F45K20-I/ML
Description
IC PIC MCU FLASH 16KX16 44QFN
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr

Specifications of PIC18F45K20-I/ML

Program Memory Type
FLASH
Program Memory Size
32KB (16K x 16)
Package / Case
44-QFN
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
44QFN EP
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 PIC18F4XK20AC164322 - MODULE SOCKET MPLAB PM3 28/44QFN
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
FIGURE 3-41:
© 2009 Microchip Technology Inc.
/**
//----------------------------------------------------------------------------
//
#pragma code InterruptVectorHigh = 0x08
void InterruptVectorHigh (void)
{
}
//----------------------------------------------------------------------------
//
#pragma code InterruptVectorLow =
0x18 void InterruptVectorLow (void)
{
}
_asm
_endasm
_asm
High
goto InterruptServiceHigh //jump to interrupt routine
Low
goto InterruptServiceLow //jump to interrupt routine _endasm
I
N
priority
priority
T
E
R
DEFINE INTERRUPT VECTORS
interrupt
The Interrupt Service Routine functions themselves are then declared with the
#pragma interrupt directive for the high priority vector, and #pragma
interruptlow for the low priority. Note the names must match between the vector
GOTO argument, the #pragma attribute, and the function declaration name. The
interrupt functions may call other functions defined elsewhere in the source, though the
lesson source code does not do this.
FIGURE 3-42:
As all interrupts of the same priority vector to the same function, it is necessary in the
function to examine which of the enabled interrupt flags caused the interrupt. Once the
flag is found so that peripheral or event may be serviced, the software must clear the
interrupt flag bit to reset the interrupt. In the lesson source code, the high priority
interrupt routine looks for the INT0 pin interrupt INT0IF flag bit. Examples are shown in
the source code of how it might check for other enabled interrupts, such as Timer1
TMR1IF and the ADC ADIF although neither of these interrupts are enabled in the
lesson code. Similarly, the low priority vector checks for the Timer0 flag TMR0IF.
Setting Up Interrupts
Now that the source code has defined the interrupt vectors, and has functions to deal
with the interrupts, it must properly setup and configure the interrupting logic and
enable the individual interrupts it wants to use.
Timer0 and external pin interrupts are set up using the INTCONx Special Function
Registers. Other interrupts are setup through a number set of peripheral interrupt
SFRs: PIRx, PIEx and IPRx. The PIRx registers contain the interrupt flags. The
R
interrupt
//
#pragma
void
{
}
#pragma interruptlow InterruptServiceLow // "interruptlow" pragma for low priority
void InterruptServiceLow(void)
{
}
U
P
//function
//
//function
//
InterruptServiceHigh(void)
T
vector
interrupt
return
return
vector
S
***********************************************/
statements
from
statements
from
PICkit™ 3 Debug Express Lessons
INTERRUPT SERVICE FUNCTIONS
Iterrupt
InterruptServiceHigh//
high-priority
low-priority
Service
interrupt
interrupt
Routines
"interrupt"
pragma
for
high
DS41370C-page 51
priority

Related parts for PIC18F45K20-I/ML