pic16f628a

Click here to load reader

download pic16f628a

of 178

  • date post

    01-Nov-2014
  • Category

    Documents

  • view

    19
  • download

    0

Embed Size (px)

Transcript of pic16f628a

PIC16F627A/628A/648A Data SheetFlash-Based, 8-Bit CMOS Microcontrollers with nanoWatt Technology

2007 Microchip Technology Inc.

DS40044F

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 Microchips 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 Microchips 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 buyers 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, KEELOQ, KEELOQ logo, 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, Linear Active Thermistor, Migratable Memory, MXDEV, MXLAB, PS logo, 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, Mindi, MiWi, MPASM, MPLAB Certified logo, 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. 2007, 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 Companys quality system processes and procedures are for its PIC MCUs and dsPIC DSCs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchips quality system for the design and manufacture of development systems is ISO 9001:2000 certified.

DS40044F-page ii

2007 Microchip Technology Inc.

PIC16F627A/628A/648A18-pin Flash-Based, 8-Bit CMOS Microcontrollers with nanoWatt TechnologyHigh-Performance RISC CPU: Operating speeds from DC 20 MHz Interrupt capability 8-level deep hardware stack Direct, Indirect and Relative Addressing modes 35 single-word instructions: - All instructions single cycle except branches

Low-Power Features: Standby Current: - 100 nA @ 2.0V, typical Operating Current: - 12 A @ 32 kHz, 2.0V, typical - 120 A @ 1 MHz, 2.0V, typical Watchdog Timer Current: - 1 A @ 2.0V, typical Timer1 Oscillator Current: - 1.2 A @ 32 kHz, 2.0V, typical Dual-speed Internal Oscillator: - Run-time selectable between 4 MHz and 48 kHz - 4 s wake-up from Sleep, 3.0V, typical

Special Microcontroller Features: Internal and external oscillator options: - Precision internal 4 MHz oscillator factory calibrated to 1% - Low-power internal 48 kHz oscillator - External Oscillator support for crystals and resonators Power-saving Sleep mode Programmable weak pull-ups on PORTB Multiplexed Master Clear/Input-pin Watchdog Timer with independent oscillator for reliable operation Low-voltage programming In-Circuit Serial Programming (via two pins) Programmable code protection Brown-out Reset Power-on Reset Power-up Timer and Oscillator Start-up Timer Wide operating voltage range (2.0-5.5V) Industrial and extended temperature range High-Endurance Flash/EEPROM cell: - 100,000 write Flash endurance - 1,000,000 write EEPROM endurance - 40 year data retention

Peripheral Features: 16 I/O pins with individual direction control High current sink/source for direct LED drive Analog comparator module with: - Two analog comparators - Programmable on-chip voltage reference (VREF) module - Selectable internal or external reference - Comparator outputs are externally accessible Timer0: 8-bit timer/counter with 8-bit programmable prescaler Timer1: 16-bit timer/counter with external crystal/ clock capability Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler Capture, Compare, PWM module: - 16-bit Capture/Compare - 10-bit PWM Addressable Universal Synchronous/Asynchronous Receiver/Transmitter USART/SCI

Device

Program Memory Flash (words) 1024 2048 4096

Data Memory SRAM (bytes) 224 224 256 EEPROM (bytes) 128 128 256 I/O

CCP (PWM) 1 1 1

USART Comparators

Timers 8/16-bit 2/1 2/1 2/1

PIC16F627A PIC16F628A PIC16F648A

16 16 16

Y Y Y

2 2 2

2007 Microchip Technology Inc.

DS40044F-page 1

PIC16F627A/628A/648APin DiagramsPDIP, SOIC

RA2/AN2/VREF RA3/AN3/CMP1 RA4/T0CKI/CMP2 RA5/MCLR/VPP VSS RB0/INT RB1/RX/DT RB2/TX/CK RB3/CCP1

1 PIC16F627A/628A/648A 2 3 4 5 6 7 8 9 27A/628A/648A

18 17 16 15 14 13 12 11 10

RA1/AN1 RA0/AN0 RA7/OSC1/CLKIN RA6/OSC2/CLKOUT VDD RB7/T1OSI/PGD RB6/T1OSO/T1CKI/PGC RB5 RB4/PGM

RA1/AN1 RA0/AN0 RA7/OSC1/CLKIN RA6/OSC2/CLKOUT VDD VDD RB7/T1OSI/PGD RB6/T1OSO/T1CKI/PGC RB5 RB4/PGM

SSOP

28-Pin QFN

RA4/T0CKI/CMP2 RA3/AN3/CMP1 RA2/AN2/VREF RA5/MCLR/VPP

PIC16F627A/628A/648A

RA2/AN2/VREF RA3/AN3/CMP1 RA4/T0CKI/CMP2 RA5/MCLR/VPP VSS VSS RB0/INT RB1/RX/DT RB2/TX/CK RB3/CCP1

RB1/RX/DT RB2/TX/CK RB3/CCP1

8 9 10 NC 11 12 RB4/PGM 13 RB5 NC 14

1 21 NC 2 20 VSS 3 19 NC 4 PIC16F627A/628A 18 NC PIC16F648A VSS 17 5 NC 6 16 RB0/INT 7 15

28 27 26 25 NC 24 23 22 NC

20 19 18 17 16 15 14 13 12 11

RA1/AN1 RA0/AN0

RA7/OSC1/CLKIN RA6/OSC2/CLKOUT VDD VDD RB7/T1OSI/PGD RB6/T1OSO/T1CKI/PGC

1 2 3 4 5 6 7 8 9 10

DS40044F-page 2

2007 Microchip Technology Inc.

PIC16F627A/628A/648ATable of Contents1.0 General Description..................................................................................................................................................................... 5 2.0 PIC16F627A/628A/648A Device Varieties .................................................................................................................................. 7 3.0 Architectural Overview ................................................................................................................................................................ 9 4.0 Memory Organization ................................................................................................................................................................ 15 5.0 I/O Ports .................................................................................................................................................................................... 31 6.0 Timer0 Module .......................................................................................................................................................................... 45 7.0 Timer1 Module .......................................................................................................................................................................... 48 8.0 Timer2 Module .......................................................................................................................................................................... 52 9.0 Capture/Compare/PWM (CCP) Module .................................................................................................................................... 55 10.0 Comparator Module...........................................................................................................................................