PIC18FXX8 Data Sheet 28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module
Total Page:16
File Type:pdf, Size:1020Kb
PIC18FXX8 Data Sheet 28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN Module 2004 Microchip Technology Inc. DS41159D 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 Trademarks applications and the like is provided only for your convenience The Microchip name and logo, the Microchip logo, Accuron, and may be superseded by updates. It is your responsibility to dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, ensure that your application meets with your specifications. PRO MATE, PowerSmart, rfPIC, and SmartShunt are MICROCHIP MAKES NO REPRESENTATIONS OR WAR- registered trademarks of Microchip Technology Incorporated RANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, in the U.S.A. and other countries. WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT AmpLab, FilterLab, MXDEV, MXLAB, PICMASTER, SEEVAL, LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, SmartSensor and The Embedded Control Solutions Company MERCHANTABILITY OR FITNESS FOR PURPOSE. are registered trademarks of Microchip Technology Microchip disclaims all liability arising from this information and Incorporated in the U.S.A. its use. Use of Microchip’s products as critical components in Analog-for-the-Digital Age, Application Maestro, dsPICDEM, life support systems is not authorized except with express dsPICDEM.net, dsPICworks, ECAN, ECONOMONITOR, written approval by Microchip. No licenses are conveyed, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial implicitly or otherwise, under any Microchip intellectual property Programming, ICSP, ICEPIC, Migratable Memory, MPASM, rights. MPLIB, MPLINK, MPSIM, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial, SmartTel and Total Endurance 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. © 2004, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved. Printed on recycled paper. Microchip received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Company’s quality system processes and procedures are for its PICmicro® 8-bit MCUs, KEELOQ® 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. DS41159D-page ii 2004 Microchip Technology Inc. PIC18FXX8 28/40-Pin High-Performance, Enhanced Flash Microcontrollers with CAN High-Performance RISC CPU: Advanced Analog Features: • Linear program memory addressing up to • 10-bit, up to 8-channel Analog-to-Digital Converter 2Mbytes module (A/D) with: • Linear data memory addressing to 4 Kbytes - Conversion available during Sleep • Up to 10 MIPS operation - Up to 8 channels available • DC – 40 MHz clock input • Analog Comparator module: • 4 MHz-10 MHz oscillator/clock input with - Programmable input and output multiplexing PLL active • Comparator Voltage Reference module • 16-bit wide instructions, 8-bit wide data path • Programmable Low-Voltage Detection (LVD) module: • Priority levels for interrupts - Supports interrupt-on-Low-Voltage Detection • 8 x 8 Single-Cycle Hardware Multiplier • Programmable Brown-out Reset (BOR) Peripheral Features: CAN bus Module Features: • High current sink/source 25 mA/25 mA • Complies with ISO CAN Conformance Test • Three external interrupt pins • Message bit rates up to 1 Mbps •Timer0 module: 8-bit/16-bit timer/counter with • Conforms to CAN 2.0B Active Spec with: 8-bit programmable prescaler - 29-bit Identifier Fields •Timer1 module: 16-bit timer/counter - 8-byte message length •Timer2 module: 8-bit timer/counter with 8-bit - 3 Transmit Message Buffers with prioritization period register (time base for PWM) - 2 Receive Message Buffers •Timer3 module: 16-bit timer/counter - 6 full, 29-bit Acceptance Filters • Secondary oscillator clock option – Timer1/Timer3 - Prioritization of Acceptance Filters • Capture/Compare/PWM (CCP) modules; - Multiple Receive Buffers for High Priority CCP pins can be configured as: Messages to prevent loss due to overflow - Capture input: 16-bit, max resolution 6.25 ns - Advanced Error Management Features - Compare: 16-bit, max resolution 100 ns (TCY) - PWM output: PWM resolution is 1 to 10-bit Special Microcontroller Features: Max. PWM freq. @:8-bit resolution = 156 kHz • Power-on Reset (POR), Power-up Timer (PWRT) 10-bit resolution = 39 kHz and Oscillator Start-up Timer (OST) • Enhanced CCP module which has all the features • Watchdog Timer (WDT) with its own on-chip RC of the standard CCP module, but also has the oscillator following features for advanced motor control: • Programmable code protection - 1, 2 or 4 PWM outputs • Power-saving Sleep mode - Selectable PWM polarity • Selectable oscillator options, including: - Programmable PWM dead time - 4x Phase Lock Loop (PLL) of primary oscillator • Master Synchronous Serial Port (MSSP) with two - Secondary Oscillator (32 kHz) clock input modes of operation: • In-Circuit Serial ProgrammingTM (ICSPTM) via two pins - 3-wire SPI™ (Supports all 4 SPI modes) 2 -IC™ Master and Slave mode Flash Technology: • Addressable USART module: • Low-power, high-speed Enhanced Flash technology - Supports interrupt-on-address bit • Fully static design • Wide operating voltage range (2.0V to 5.5V) • Industrial and Extended temperature ranges 2004 Microchip Technology Inc. DS41159D-page 1 PIC18FXX8 Program Memory Data Memory MSSP 10-bit CCP/ Timers Device Flash # Single-Word SRAM EEPROM I/O A/D ECCP Master USART SPI™ 8/16-bit (bytes) Instructions (bytes) (bytes) (ch) (PWM) I2C™ Comparators PIC18F248 16K 8192 768 256 22 5 — 1/0 Y Y Y 1/3 PIC18F258 32K 16384 1536 256 22 5 — 1/0 Y Y Y 1/3 PIC18F448 16K 8192 768 256 33 8 2 1/1 Y Y Y 1/3 PIC18F458 32K 16384 1536 256 33 8 2 1/1 Y Y Y 1/3 Pin Diagrams PDIP MCLR/VPP 1 40 RB7/PGD RA0/AN0/CVREF 2 39 RB6/PGC RA1/AN1 3 38 RB5/PGM RA2/AN2/VREF- 4 37 RB4 RA3/AN3/VREF+ 5 36 RB3/CANRX RA4/T0CKI 6 35 RB2/CANTX/INT2 RA5/AN4/SS/LVDIN 7 PIC18F458 PIC18F448 34 RB1/INT1 RE0/AN5/RD 8 33 RB0/INT0 RE1/AN6/WR/C1OUT 9 32 VDD RE2/AN7/CS/C2OUT 10 31 VSS VDD 11 30 RD7/PSP7/P1D VSS 12 29 RD6/PSP6/P1C OSC1/CLKI 13 28 RD5/PSP5/P1B OSC2/CLKO/RA6 14 27 RD4/PSP4/ECCP1/P1A RC0/T1OSO/T1CKI 15 26 RC7/RX/DT RC1/T1OSI 16 25 RC6/TX/CK RC2/CCP1 17 24 RC5/SDO RC3/SCK/SCL 18 23 RC4/SDI/SDA RD0/PSP0/C1IN+ 19 22 RD3/PSP3/C2IN- RD1/PSP1/C1IN- 20 21 RD2/PSP2/C2IN+ - PLCC + REF REF REF PP /V RB4 RB7/PGD RA2/AN2/V NC RB6/PGC RB5/PGM RA3/AN3/V MCLR NC RA0/AN0/CV RA1/AN1 1 6 5 4 3 2 44 43 42 41 40 RA4/T0CKI 7 39 RB3/CANRX RA5/AN4/SS/LVDIN 8 38 RB2/CANTX/INT2 RE0/AN5/RD 9 37 RB1/INT1 RE1/AN6/WR/C1OUT 10 36 RB0/INT0 RE2/AN7/CS/C2OUT 11 PIC18F448 35 VDD VDD 12 34 VSS VSS 13 PIC18F458 33 RD7/PSP7/P1D OSC1/CLKI 14 32 RD6/PSP6/P1C OSC2/CLKO/RA6 15 31 RD5/PSP5/P1B RC0/T1OSO/T1CK1 16 30 RD4/PSP4/ECCP1/P1A NC 17 29 RC7/RX/DT 20 21 22 26 23 27 24 28 25 18 19 NC RC5/SDO RC2/CCP1 RC1/T1OSI RC6/TX/CK RC4/SDI/SDA RC3/SCK/SCL RD1/PSP1/C1IN- RD3/PSP3/C2IN- RD0/PSP0/C1IN+ RD2/PSP2/C2IN+ DS41159D-page 2 2004 Microchip Technology Inc. PIC18FXX8 Pin Diagrams (Continued) TQFP RC5/SDO RC4/SDI/SDA RD2/PSP2/C2IN+ RD1/PSP1/C1IN- RC2/CCP1 RC1/T1OSI NC RC6/TX/CK RD3/PSP3/C2IN- RD0/PSP0/C1IN+ RC3/SCK/SCL 44 43 42 41 40 39 38 37 36 35 34 RC7/RX/DT 1 33 NC RD4/PSP4/ECCP1/P1A 2 32 RC0/T1OSO/T1CKI RD5/PSP5/P1B 3 31 OSC2/CLKO/RA6 RD6/PSP6/P1C 4 30 OSC1/CLKI RD7/PSP7/P1D 5 PIC18F448 29 VSS VSS 6 DD PIC18F458 28 V VDD 7 27 RE2/AN7/CS/C2OUT RB0/INT0 8 26 RE1/AN6/WR/C1OUT RB1/INT1 9 25 RE0//AN5/RD RB2/CANTX/INT2 10 24 RA5/AN4/SS/LVDIN RB3/CANRX 11 23 RA4/T0CKI 21 22 15 20 13 14 16 17 12 18 19 - + PP NC NC REF REF RB4 /V REF RA1/AN1 RB6/PGC RB7/PGD RB5/PGM MCLR RA3/AN3/V RA2/AN2/V RA0/AN0/CV SPDIP, SOIC MCLR/VPP 1 28 RB7/PGD RA0/AN0/CVREF 2 27 RB6/PGC RA1/AN1 3 26 RB5/PGM RA2/AN2/VREF- 4 25 RB4 RA3/AN3/VREF+ 5 PIC18F258 PIC18F248 24 RB3/CANRX RA4/T0CKI 6 23 RB2/CANTX/INT2 RA5/AN4/SS/LVDIN 7 22 RB1/INT1 VSS 8 21 RB0/INT0 OSC1/CLKI 9 20 VDD OSC2/CLKO/RA6 10 19 VSS RC0/T1OSO/T1CKI 11 18 RC7/RX/DT RC1/T1OSI 12 17 RC6/TX/CK RC2/CCP1 13 16 RC5/SDO RC3/SCK/SCL 14 15 RC4/SDI/SDA 2004 Microchip Technology Inc.