PIC12(L)F1612/16(L)F1613 microcontrollers deliver
on-chip features that are unique to the design for
embedded control of small motors and general purpose
applications in 8 and 14-pin count packages. Features
like 10-bit A/D, CCP, 24-bit SMT and Zero-Cross
Detection offer an excellent solution to a variety of
applications. The CRC and Window WDT are provided
to support safety-critical applications in home
appliances and white goods.
Core Features:
• C Compiler Optimized RISC Architecture
• Only 49 Instructions
• Operating Speed:
- 0-32 MHz clock input
- 125 ns minimum instruction cycle
• Interrupt Capability with Automatic Context
Saving
• 16-Level Deep Hardware Stack with Optional
Overflow/Underflow Reset
• Direct, Indirect and Relative Addressing modes:
- Two full 16-bit File Select Registers (FSRs)
- FSRs can read program and data memory
• Power-on Reset (POR)
• Power-up Timer (PWRT)
• Brown-out Reset (BOR) with Selectable Trip Point
• Windowed Watchdog Timer (WWDT):
- Variable prescaler selection
- Variable window size selection
- All sources configurable in hardware or
software
Memory:
• Up to 2 Kwords Flash Program Memory
• Up to 256 Bytes Data SRAM Memory
• Direct, Indirect and Relative Addressing modes
Operating Characteristics:
• In-Circuit Serial Programming™ (ICSP™) via Two
Pins
• Enhanced Low-Voltage Programming (LVP)
• Operating Voltage Range:
- 1.8V to 3.6V (PIC12LF1612/16LF1613)
- 2.3V to 5.5V (PIC12F1612/16F1613)
• Programmable Code Protection
• Self-Programmable under Software Control
Clocking Structure:
• Precision Internal Oscillator:
- Factory calibrated to ±1%, typical
- Software-selectable frequency range from
32 MHz to 31 kHz
Enhanced Mid-Range CPU ................................................................................................................................................................. 13
Flash Program Memory Control.......................................................................................................................................................... 99
Fixed Voltage Reference (FVR)........................................................................................................................................................ 146
Temperature Indicator Module.......................................................................................................................................................... 149
Timer1 Module with Gate Control ..................................................................................................................................................... 184
Signal Measurement Timer (SMTx) .................................................................................................................................................. 255
In-Circuit Serial Programming™ (ICSP™) ........................................................................................................................................ 299
Instruction Set Summary................................................................................................................................................................... 301
DC and AC Characteristics Graphs and Charts................................................................................................................................ 339
Development Support ....................................................................................................................................................................... 357
Packaging Information ...................................................................................................................................................................... 361
Appendix A: Data Sheet Revision History......................................................................................................................................... 380
The Microchip Web Site.................................................................................................................................................................... 381
Customer Change Notification Service ............................................................................................................................................. 381
Customer Support ............................................................................................................................................................................. 381
Product Identification System ........................................................................................................................................................... 382
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We
welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.
DS40001737A-page 6Preliminary 2014 Microchip Technology Inc.
PIC12(L)F1612/16(L)F1613
1.0DEVICE OVERVIEW
The PIC12(L)F1612/16(L)F1613 are described within this
data sheet. The block diagram of these devices are
shown in Figure 1-1, the available peripherals are shown
in Table 1-1, and the pin out descriptions are shown in
Tables 1-2 and 1-3.
RC4/C2OUT/CWG1BRC4TTL/ST CMOS/OD General purpose I/O.
RC5/CCP1/CWG1ARC5TTL/ST CMOS/OD General purpose I/O.
DDVDDPower—Positive supply.
V
SSVSSPower—Ground reference.
V
Legend: AN = Analog input or output CMOS = CMOS compatible input or outputOD =Open-Drain
Note 1:Alternate pin function selected with the APFCON register (Register 12-1).
TTL = TTL compatible input ST= Schmitt Trigger input with CMOS levels I
HV = High VoltageXTAL = Crystal levels
RC1TTL/ST CMOS/OD General purpose I/O.
AN5AN—ADC Channel input.
C1IN1-AN—Comparator negative input.
C2IN1-AN—Comparator negative input.
T4INTTL/ST—Timer4 input.
SMTSIG2TTL/ST—SMT2 signal input.
RC2TTL/ST CMOS/OD General purpose I/O.
AN6AN—ADC Channel input.
C1IN2-AN—Comparator negative input.
C2IN2-AN—Comparator negative input.
CWG1D—CMOS/OD CWG complementary output D.
RC3TTL/ST—General purpose input with IOC and WPU.
AN7AN—ADC Channel input.
C1IN3-AN—Comparator negative input.
C2IN3-AN—Comparator negative input.
CCP2TTL/ST CMOS/OD Capture/Compare/PWM2.
CWG1C—CMOS/OD CWG complementary output C.
C2OUT—CMOS/OD Comparator output.
CWG1B—CMOS/OD CWG complementary output B.
CCP1TTL/ST CMOS/OD Capture/Compare/PWM1.
CWG1A—CMOS/OD CWG complementary output A.
Input
Typ e
Output
Typ e
Description
2
C™ = Schmitt Trigger input with I2C™
DS40001737A-page 12Preliminary 2014 Microchip Technology Inc.
PIC12(L)F1612/16(L)F1613
15
15
15
15
8
8
8
12
14
7
5
3
Program Counter
MUX
Addr MUX
16-Level Stack
(15-bit)
Program Memory
Read (PMR)
Instruction Reg
Configuration
FSR0 Reg
FSR1 Reg
BSR Reg
STATUS Reg
RAM
WReg
Power-up
Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
Instruction
Decode and
Control
Timing
Generation
Internal
Oscillator
Block
ALU
Flash
Program
Memory
MUX
Data Bus
Program
Bus
Direct Addr
Indirect
Addr
RAM Addr
CLKIN
CLKOUT
V
DDVSS
Rev. 10-000055A
7/30/2013
12
12
2.0ENHANCED MID-RANGE CPU
This family of devices contain an enhanced mid-range
8-bit CPU core. The CPU has 49 instructions. Interrupt
capability includes automatic context saving. The
hardware stack is 16 levels deep and has Overflow and
Underflow Reset capability. Direct, Indirect, and
Relative addressing modes are available. Two File
Select Registers (FSRs) provide the ability to read
program and data memory.
During interrupts, certain registers are automatically
saved in shadow registers and restored when returning
from the interrupt. This saves stack space and user
code. See Section 7.5 “Automatic Context Saving”,
for more information.
2.216-Level Stack with Overflow and
Underflow
These devices have a hardware stack memory 15 bits
wide and 16 words deep. A Stack Overflow or Underflow will set the appropriate bit (STKOVF or STKUNF)
in the PCON register, and if enabled, will cause a software Reset. See section Section 3.4 “Stack” for more
details.
2.3File Select Registers
There are two 16-bit File Select Registers (FSR). FSRs
can access all file registers and program memory,
which allows one Data Pointer for all memory. When an
FSR points to program memory, there is one additional
instruction cycle in instructions using INDF to allow the
data to be fetched. General purpose memory can now
also be addressed linearly, providing the ability to
access contiguous data larger than 80 bytes. There are
also new instructions to support the FSRs. See
Section 3.5 “Indirect Addressing” for more details.
2.4Instruction Set
There are 49 instructions for the enhanced mid-range
CPU to support the features of the CPU. See
Section 27.0 “Instruction Set Summary” for more
details.
DS40001737A-page 14Preliminary 2014 Microchip Technology Inc.
PIC12(L)F1612/16(L)F1613
3.0MEMORY ORGANIZATION
These devices contain the following types of memory:
• Program Memory
- Configuration Words
- Device ID
-User ID
- Flash Program Memory
• Data Memory
- Core Registers
- Special Function Registers
- General Purpose RAM
- Common RAM
The following features are associated with access and
control of program memory and data memory:
• PCL and PCLATH
•Stack
• Indirect Addressing
3.1Program Memory Organization
The enhanced mid-range core has a 15-bit program
counter capable of addressing a 32K x 14 program
memory space. Table 3-1 shows the memory sizes
implemented. Accessing a location above these
boundaries will cause a wrap-around within the
implemented memory space. The Reset vector is at
0000h and the interrupt vector is at 0004h (See
Figure 3-1).
TABLE 3-1:DEVICE SIZES AND ADDRESSES
DeviceProgram Memory Space (Words)Last Program Memory Address
;select data
RETLW DATA0;Index0 data
RETLW DATA1;Index1 data
RETLW DATA2
RETLW DATA3
my_function
;… LOTS OF CODE…
MOVLWDATA_INDEX
call constants
;… THE CONSTANT IS IN W
FIGURE 3-1:PROGRAM MEMORY MAP
AND STACK FOR
PIC12(L)F1612/16(L)F1613
3.1.1READING PROGRAM MEMORY AS
DATA
There are two methods of accessing constants in program memory. The first method is to use tables of
RETLW instructions. The second method is to set an
FSR to point to the program memory.
3.1.1.1RETLW Instruction
The RETLW instruction can be used to provide access
to tables of constants. The recommended way to create
such a table is shown in Example 3-1.
EXAMPLE 3-1:RETLW INSTRUCTION
The BRW instruction makes this type of table very simple to implement. If your code must remain portable
with previous generations of microcontrollers, then the
BRW instruction is not available, so the older table read
method must be used.
DS40001737A-page 16Preliminary 2014 Microchip Technology Inc.
PIC12(L)F1612/16(L)F1613
constants
RETLW DATA0;Index0 data
RETLW DATA1;Index1 data
RETLW DATA2
RETLW DATA3
The program memory can be accessed as data by setting bit 7 of the FSRxH register and reading the matching INDFx register. The MOVIW instruction will place the
lower eight bits of the addressed word in the W register.
Writes to the program memory cannot be performed via
the INDF registers. Instructions that access the program memory via the FSR require one extra instruction
cycle to complete. Example 3-2 demonstrates accessing the program memory via an FSR.
The HIGH operator will set bit<7> if a label points to a
location in program memory.
x00h or x80hINDF0
x01h or x81hINDF1
x02h or x82hPCL
x03h or x83hSTATUS
x04h or x84hFSR0L
x05h or x85hFSR0H
x06h or x86hFSR1L
x07h or x87hFSR1H
x08h or x88hBSR
x09h or x89hWREG
x0Ah or x8AhPCLATH
x0Bh or x8BhINTCON
3.2Data Memory Organization
The data memory is partitioned in 32 memory banks
with 128 bytes in a bank. Each bank consists of
(Figure 3-2):
• 12 core registers
• 20 Special Function Registers (SFR)
• Up to 80 bytes of General Purpose RAM (GPR)
• 16 bytes of common RAM
The active bank is selected by writing the bank number
into the Bank Select Register (BSR). Unimplemented
memory will read as ‘0’. All data memory can be
accessed either directly (via instructions that use the
file registers) or indirectly via the two File Select
Registers (FSR). See Section 3.5 “Indirect
Addressing” for more information.
Data memory uses a 12-bit address. The upper five bits
of the address define the Bank address and the lower
seven bits select the registers/RAM in that bank.
3.2.1CORE REGISTERS
The core registers contain the registers that directly
affect the basic operation. The core registers occupy
the first 12 addresses of every data memory bank
(addresses x00h/x08h through x0Bh/x8Bh). These
registers are listed below in Ta b l e 3 -2 . For detailed
information, see Tab le 3 -9 .
TABLE 3-2:CORE REGISTERS
DS40001737A-page 18Preliminary 2014 Microchip Technology Inc.
PIC12(L)F1612/16(L)F1613
3.2.1.1STATUS Register
The STATUS register, shown in Register 3-1, contains:
• the arithmetic status of the ALU
• the Reset status
The STATUS register can be the destination for any
instruction, like any other register. If the STATUS
register is the destination for an instruction that affects
the Z, DC or C bits, then the write to these three bits is
disabled. These bits are set or cleared according to the
device logic. Furthermore, the TO
writable. Therefore, the result of an instruction with the
STATUS register as destination may be different than
intended.
and PD bits are not
For example, CLRF STATUS will clear the upper three
bits and set the Z bit. This leaves the STATUS register
as ‘000u u1uu’ (where u = unchanged).
It is recommended, therefore, that only BCF, BSF,SWAPF and MOVWF instructions are used to alter the
STATUS register, because these instructions do not
affect any Status bits. For other instructions not
affecting any Status bits (Refer to Section 27.0
“Instruction Set Summary”).
Note 1: The C and DC bits operate as Borrow
and Digit Borrow out bits, respectively, in
subtraction.
REGISTER 3-1:STATUS: STATUS REGISTER
U-0U-0U-0R-1/qR-1/qR/W-0/uR/W-0/uR/W-0/u
———
bit 7bit 0
Legend:
R = Readable bitW = Writable bitU = Unimplemented bit, read as ‘0’
u = Bit is unchangedx = Bit is unknown-n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set‘0’ = Bit is clearedq = Value depends on condition
TO
PDZDC
(1)
(1)
C
bit 7-5Unimplemented: Read as ‘0’
bit 4TO
bit 3PD
bit 2Z: Zero bit
bit 1DC: Digit Carry/Digit Borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
bit 0C: Carry/Borrow
Note 1: For Borrow, the polarity is reversed. A subtraction is executed by adding the two’s complement of the
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or low-order
bit of the source register.
: Time-Out bit
1 = After power-up, CLRWDT instruction or SLEEP instruction
0 = A WDT time-out occurred
: Power-Down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
1 = A carry-out from the 4th low-order bit of the result occurred
0 = No carry-out from the 4th low-order bit of the result
(1)
bit
(ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
The Special Function Registers are registers used by
the application to control the desired operation of
peripheral functions in the device. The Special Function
Registers occupy the 20 bytes after the core registers of
every data memory bank (addresses x0Ch/x8Ch
through x1Fh/x9Fh). The registers associated with the
operation of the peripherals are described in the appropriate peripheral chapter of this data sheet.
3.2.3GENERAL PURPOSE RAM
There are up to 80 bytes of GPR in each data memory
bank. The Special Function Registers occupy the 20
bytes after the core registers of every data memory
bank (addresses x0Ch/x8Ch through x1Fh/x9Fh).
3.2.3.1Linear Access to GPR
The general purpose RAM can be accessed in a
non-banked method via the FSRs. This can simplify
access to large memory structures. See Section 3.5.2
“Linear Data Memory” for more information.
3.2.4COMMON RAM
There are 16 bytes of common RAM accessible from all
banks.
FIGURE 3-2:BANKED MEMORY
PARTITIONING
3.2.5DEVICE MEMORY MAPS
The memory maps for PIC12(L)F1612/16(L)F1613 are
as shown in Ta bl e 3 -5 through Tab l e 3 - 8.
DS40001737A-page 20Preliminary 2014 Microchip Technology Inc.
015hTMR0Holding Register for the 8-bit Timer0 Countxxxx xxxx uuuu uuuu
016hTMR1LHolding Register for the Least Significant Byte of the 16-bit TMR1 Countxxxx xxxx uuuu uuuu
017hTMR1HHolding Register for the Most Significant Byte of the 16-bit TMR1 Countxxxx xxxx uuuu uuuu
018hT1CONTMR1CS<1:0>T1CKPS<1:0>
019hT1GCONTMR1GET1GPOLT1GTMT1GSPMT1GGO/
01AhTMR2Timer2 Module Register0000 0000 0000 0000
01BhPR2Timer2 Period Register1111 1111 1111 1111
01ChT2CONONCKPS<2:0>OUTPS<3:0>0000 0000 0000 0000
01DhT2HLTPSYNCCKPOLCKSYNC
01EhT2CLKCON
01FhT2RST
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1612/16F1613 only.
—Unimplemented——
(4)
—Unimplemented——
—Unimplemented——
2:Unimplemented, read as ‘1’.
3:PIC12(L)F1612 only.
4:PIC16(L)F1613 only.
——RA5RA4RA3RA2RA1RA0--xx xxxx --xx xxxx
——RC5RC4RC3RC2RC1RC0--xx xxxx --xx xxxx
—C2IF
——CWGIFZCDIF ————--00 ---- --00 ----
—————T2CS<2:0>---- -000 ---- -000
————RSEL<3:0>---- 0000 ---- 0000
(4)
———CCP1IFTMR2IFTMR1IF00-- -000 00-- -000
C1IF——TMR6IFTMR4IFCCP2IF-00- -000 -00- -000
—T1SYNC—TMR1ON0000 -0-0 uuuu -u-u
T1GVALT1GSS<1:0>0000 0x00 uuuu uxuu
DONE
—MODE<3:0>000- 0000 000- 0000
Val ue o n
POR, BOR
Value on all
other Resets
PIC12(L)F1612/16(L)F1613
DS40001737A-page 28Preliminary 2014 Microchip Technology Inc.
TABLE 3-10:SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
09BhADRESLADC Result Register Lowxxxx xxxx uuuu uuuu
09ChADRESHADC Result Register Highxxxx xxxx uuuu uuuu
09DhADCON0
09EhADCON1ADFMADCS<2:0>
09FhADCON2TRIGSEL<3:0>
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1612/16F1613 only.
—Unimplemented——
(4)
—Unimplemented——
—Unimplemented——
—Unimplemented——
2:Unimplemented, read as ‘1’.
3:PIC12(L)F1612 only.
4:PIC16(L)F1613 only.
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1612/16F1613 only.
—Unimplemented——
(4)
—Unimplemented——
—Unimplemented——
(4)
(4)
—Unimplemented——
—Unimplemented——
—Unimplemented——
—Unimplemented——
2:Unimplemented, read as ‘1’.
3:PIC12(L)F1612 only.
4:PIC16(L)F1613 only.
DS40001737A-page 30Preliminary 2014 Microchip Technology Inc.
TABLE 3-10:SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
AddrNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0
Bank 3
18ChANSELA
18Dh
18EhANSELC
18Fh
190h
191hPMADRLFlash Program Memory Address Register Low Byte0000 0000 0000 0000
192hPMADRH
193hPMDATLFlash Program Memory Read Data Register Low Bytexxxx xxxx uuuu uuuu
194hPMDATH
195hPMCON1
196hPMCON2Flash Program Memory Control Register 2 0000 0000 0000 0000
197hVREGCON
Bank 4
20ChWPUA
20Dh
20EhWPUC
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1612/16F1613 only.
—Unimplemented——
—Unimplemented——
—Unimplemented——
198h
—Unimplemented——
to
19Fh
—Unimplemented——
20Fh
—Unimplemented——
to
21Fh
2:Unimplemented, read as ‘1’.
3:PIC12(L)F1612 only.
4:PIC16(L)F1613 only.
(4)
(1)
(4)
———ANSA4—ANSA2ANSA1ANSA0---1 -111 ---1 -111
————ANSC3ANSC2ANSC1ANSC0---- 1111 ---- 1111
(2)
—
——Flash Program Memory Read Data Register High Byte--xx xxxx --uu uuuu