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

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
3.8
© 2009 Microchip Technology Inc.
LESSON 8: INTERRUPTS
See Section 19.0 “10-Bit Analog-to-Digital Converter (A/D) Module” in the
PIC18F45K20 Data Sheet (DS41303) for more information on the ADC peripheral.
This lesson changes the Lesson 7 code to use interrupts to act on the switch press and
Timer0 events instead of polling them. The switch uses the RB0/INT0 external interrupt
capability.
3.8.1
When a peripheral requires attention or an event occurs, it sets an interrupt flag. Each
flag has an interrupt enable bit that determines whether it will generate an interrupt to
the microcontroller or not. In the previous lessons, interrupt flags such as TMR0IF were
polled, but did not create an interrupt as the enable bit was not set. The enable bits
allow only selected events to cause in interrupt. All interrupts are ORed together, and
then ANDed with a global interrupt enable.
FIGURE 3-39:
Key Concepts
Note:
- An interrupt is a hardware-based event that “interrupts” the program code to
- The PIC18FXXXX supports a single interrupt priority or two levels of inter-
- A Low Priority interrupt can interrupt the main program. A High Priority inter-
- The directives #pragma interruptlow and #pragma interrupt are
execute a special function. When the interrupt function exits, program exe-
cution returns to where it left off.
rupt priority.
rupt can interrupt the main program or a low priority interrupt.
used to define the interrupt functions.
TMR0H assignment statement, the MPLAB IDE will read the TMR0L
register to update the value in the Watch window. When TMR0L is read, the
upper byte of TMR0 is loaded into the TMR0H buffer, wiping out the value
written in the previous TMR0H assignment statement.
One workaround to be able to add TMR0L to the Watch window is to make
sure not to step from the TMR0H to the TMR0L statement. Set a breakpoint
on the TMR0L assignment statement, and Run from the TMR0H
assignment statement.
This is caused by the buffered nature of TMR0H. When “Stepping Over” the
PIC18FXXXX Interrupt Architecture
If TMR0L is added to the Watch window, it will cause incorrect operation
when stepping through the following 2 lines of code:
TMR0H = ADC_Convert();
TMR0L = 0;
PICkit™ 3 Debug Express Lessons
SIMPLIFIED INTERRUPT LOGIC
DS41370C-page 49

Related parts for PIC18F45K20-I/ML