PIC18FXX8
Data Sheet
28/40-Pin High-Performance,
Enhanced Flash Microcontrollers
with CAN Module
©
2006 Microchip Technology Inc.
DS41159E
Note the following details of the code protection feature on Microchip devices:
•
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
•
•
•
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron,
dsPIC, K
EE
L
OQ
, microID, MPLAB, PIC, PICmicro, PICSTART,
PRO MATE, PowerSmart, rfPIC and SmartShunt are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
AmpLab, FilterLab, Migratable Memory, MXDEV, MXLAB,
SEEVAL, SmartSensor and The Embedded Control Solutions
Company are registered trademarks of Microchip Technology
Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, ECAN,
ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, Linear Active
Thermistor, Mindi, MiWi, MPASM, MPLIB, MPLINK, PICkit,
PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal,
PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB,
rfPICDEM, Select Mode, Smart Serial, SmartTel, Total
Endurance, UNI/O, WiperLock and ZENA are trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2006, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona, Gresham, Oregon and Mountain View, California. The
Company’s quality system processes and procedures are for its
PICmicro
®
8-bit MCUs, K
EE
L
OQ
®
code hopping devices, Serial
EEPROMs, microperipherals, nonvolatile memory and analog
products. In addition, Microchip’s quality system for the design and
manufacture of development systems is ISO 9001:2000 certified.
DS41159E-page ii
©
2006 Microchip Technology Inc.
PIC18FXX8
28/40-Pin High-Performance, Enhanced Flash
Microcontrollers with CAN
High-Performance RISC CPU:
• Linear program memory addressing up to
2 Mbytes
• Linear data memory addressing to 4 Kbytes
• Up to 10 MIPS operation
• DC – 40 MHz clock input
• 4 MHz-10 MHz oscillator/clock input with
PLL active
• 16-bit wide instructions, 8-bit wide data path
• Priority levels for interrupts
• 8 x 8 Single-Cycle Hardware Multiplier
Advanced Analog Features:
• 10-bit, up to 8-channel Analog-to-Digital Converter
module (A/D) with:
- Conversion available during Sleep
- Up to 8 channels available
• Analog Comparator module:
- Programmable input and output multiplexing
• Comparator Voltage Reference module
• Programmable Low-Voltage Detection (LVD) module:
- Supports interrupt-on-Low-Voltage Detection
• Programmable Brown-out Reset (BOR)
Peripheral Features:
• High current sink/source 25 mA/25 mA
• Three external interrupt pins
• Timer0 module: 8-bit/16-bit timer/counter with
8-bit programmable prescaler
• Timer1 module: 16-bit timer/counter
• Timer2 module: 8-bit timer/counter with 8-bit
period register (time base for PWM)
• Timer3 module: 16-bit timer/counter
• Secondary oscillator clock option – Timer1/Timer3
• Capture/Compare/PWM (CCP) modules;
CCP pins can be configured as:
- Capture input: 16-bit, max resolution 6.25 ns
- Compare: 16-bit, max resolution 100 ns (T
CY
)
- PWM output: PWM resolution is 1 to 10-bit
Max. PWM freq. @:8-bit resolution = 156 kHz
10-bit resolution = 39 kHz
• Enhanced CCP module which has all the features
of the standard CCP module, but also has the
following features for advanced motor control:
- 1, 2 or 4 PWM outputs
- Selectable PWM polarity
- Programmable PWM dead time
• Master Synchronous Serial Port (MSSP) with two
modes of operation:
- 3-wire SPI™ (Supports all 4 SPI modes)
- I
2
C™ Master and Slave mode
• Addressable USART module:
- Supports interrupt-on-address bit
CAN bus Module Features:
• Complies with ISO CAN Conformance Test
• Message bit rates up to 1 Mbps
• Conforms to CAN 2.0B Active Spec with:
- 29-bit Identifier Fields
- 8-byte message length
- 3 Transmit Message Buffers with prioritization
- 2 Receive Message Buffers
- 6 full, 29-bit Acceptance Filters
- Prioritization of Acceptance Filters
- Multiple Receive Buffers for High Priority
Messages to prevent loss due to overflow
- Advanced Error Management Features
Special Microcontroller Features:
• Power-on Reset (POR), Power-up Timer (PWRT)
and Oscillator Start-up Timer (OST)
• Watchdog Timer (WDT) with its own on-chip RC
oscillator
• Programmable code protection
• Power-saving Sleep mode
• Selectable oscillator options, including:
- 4x Phase Lock Loop (PLL) of primary oscillator
- Secondary Oscillator (32 kHz) clock input
• In-Circuit Serial Programming
TM
(ICSP
TM
) via two pins
Flash Technology:
•
•
•
•
Low-power, high-speed Enhanced Flash technology
Fully static design
Wide operating voltage range (2.0V to 5.5V)
Industrial and Extended temperature ranges
©
2006 Microchip Technology Inc.
DS41159E-page 1
PIC18FXX8
Program Memory
Device
Data Memory
I/O
10-bit
A/D
(ch)
5
5
8
8
Comparators
MSSP
CCP/
ECCP
(PWM)
1/0
1/0
1/1
1/1
SPI™
Y
Y
Y
Y
Master
I
2
C™
Y
Y
Y
Y
USART
Timers
8/16-bit
Flash # Single-Word SRAM EEPROM
(bytes) Instructions (bytes) (bytes)
16K
32K
16K
32K
8192
16384
8192
16384
768
1536
768
1536
256
256
256
256
PIC18F248
PIC18F258
PIC18F448
PIC18F458
22
22
33
33
—
—
2
2
Y
Y
Y
Y
1/3
1/3
1/3
1/3
Pin Diagrams
PDIP
MCLR/V
PP
RA0/AN0/C
VREF
RA1/AN1
RA2/AN2/V
REF
-
RA3/AN3/V
REF
+
RA4/T0CKI
RA5/AN4/SS/LVDIN
RE0/AN5/RD
RE1/AN6/WR/C1OUT
RE2/AN7/CS/C2OUT
V
DD
V
SS
OSC1/CLKI
OSC2/CLKO/RA6
RC0/T1OSO/T1CKI
RC1/T1OSI
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0/C1IN+
RD1/PSP1/C1IN-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
22
21
RB7/PGD
RB6/PGC
RB5/PGM
RB4
RB3/CANRX
RB2/CANTX/INT2
RB1/INT1
RB0/INT0
V
DD
V
SS
RD7/PSP7/P1D
RD6/PSP6/P1C
RD5/PSP5/P1B
RD4/PSP4/ECCP1/P1A
RC7/RX/DT
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3/C2IN-
RD2/PSP2/C2IN+
PLCC
RA4/T0CKI
RA5/AN4/SS/LVDIN
RE0/AN5/RD
RE1/AN6/WR/C1OUT
RE2/AN7/CS/C2OUT
V
DD
V
SS
OSC1/CLKI
OSC2/CLKO/RA6
RC0/T1OSO/T1CK1
NC
7
8
9
10
11
12
13
14
15
16
17
6
5
4
3
2
1
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
RA3/AN3/V
REF
+
RA2/AN2/V
REF
-
RA1/AN1
RA0/AN0/CV
REF
MCLR/V
PP
NC
RB7/PGD
RB6/PGC
RB5/PGM
RB4
NC
PIC18F448
PIC18F458
RC1/T1OSI
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0/C1IN+
RD1/PSP1/C1IN-
RD2/PSP2/C2IN+
RD3/PSP3/C2IN-
RC4/SDI/SDA
RC5/SDO
RC6/TX/CK
NC
18
19
20
21
22
23
24
25
26
27
28
PIC18F458
PIC18F448
RB3/CANRX
RB2/CANTX/INT2
RB1/INT1
RB0/INT0
V
DD
V
SS
RD7/PSP7/P1D
RD6/PSP6/P1C
RD5/PSP5/P1B
RD4/PSP4/ECCP1/P1A
RC7/RX/DT
DS41159E-page 2
©
2006 Microchip Technology Inc.
PIC18FXX8
Pin Diagrams (Continued)
TQFP
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
RD3/PSP3/C2IN-
RD2/PSP2/C2IN+
RD1/PSP1/C1IN-
RD0/PSP0/C1IN+
RC3/SCK/SCL
RC2/CCP1
RC1/T1OSI
NC
RC7/RX/DT
RD4/PSP4/ECCP1/P1A
RD5/PSP5/P1B
RD6/PSP6/P1C
RD7/PSP7/P1D
V
SS
V
DD
RB0/INT0
RB1/INT1
RB2/CANTX/INT2
RB3/CANRX
1
2
3
4
5
6
7
8
9
10
11
44
43
42
41
40
39
38
37
36
35
34
33
32
31
30
29
28
27
26
25
24
23
PIC18F448
PIC18F458
SPDIP, SOIC
MCLR/V
PP
RA0/AN0/CV
REF
RA1/AN1
RA2/AN2/V
REF
-
RA3/AN3/V
REF
+
RA4/T0CKI
RA5/AN4/SS/LVDIN
V
SS
OSC1/CLKI
OSC2/CLKO/RA6
RC0/T1OSO/T1CKI
RC1/T1OSI
RC2/CCP1
RC3/SCK/SCL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
RA0/AN0/CV
REF
RA1/AN1
RA2/AN2/V
REF
-
RA3/AN3/V
REF
+
NC
NC
RB4
RB5/PGM
RB6/PGC
RB7/PGD
MCLR/V
PP
12
13
14
15
16
17
18
19
20
21
22
NC
RC0/T1OSO/T1CKI
OSC2/CLKO/RA6
OSC1/CLKI
V
SS
V
DD
RE2/AN7/CS/C2OUT
RE1/AN6/WR/C1OUT
RE0//AN5/RD
RA5/AN4/SS/LVDIN
RA4/T0CKI
28
27
26
25
24
23
22
21
20
19
18
17
16
15
RB7/PGD
RB6/PGC
RB5/PGM
RB4
RB3/CANRX
RB2/CANTX/INT2
RB1/INT1
RB0/INT0
V
DD
V
SS
RC7/RX/DT
RC6/TX/CK
RC5/SDO
RC4/SDI/SDA
PIC18F248
PIC18F258
©
2006 Microchip Technology Inc.
DS41159E-page 3