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

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.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-E/P