Cost Effective 8-Bit Intelligent Analog Flash Microcontrollers
Description:
PIC16(L)F1713/6 microcontrollers combine Intelligent Analog integration with low cost and extreme low power (XLP) to
suit a variety of general purpose applications. These 28-pin devices deliver on-chip op amps, Core Independent Peripherals (CLC, NCO and COG), Peripheral Pin Select and Zero-Cross Detect, providing for increased design flexibility.
Core Features:
• C Compiler Optimized RISC Architecture
• Only 49 Instructions
• Operating Speed:
- 0-32 MHz clock input
- 125 ns minimum instruction cycle
• Interrupt Capability
• 16-Level Deep Hardware Stack
• Up to Four 8-bit Timers
• One 16-bit Timer
• Power-on Reset (POR)
• Power-up Timer (PWRT)
• Low-Power Brown-Out Reset (LPBOR)
• Programmable Watchdog Timer (WDT) up to
256s
• Programmable Code Protection
Memory:
• Up to 8 Kwords Flash Program Memory
• Up to 1024 Bytes Data SRAM Memory
• Direct, Indirect and Relative Addressing modes
Operating Characteristics:
• Operating Voltage Range:
- 1.8V to 3.6V (PIC16LF1713/6)
- 2.3V to 5.5V (PIC16F1713/6)
• Temperature Range:
- Industrial: -40°C to 85°C
- Extended: -40°C to 125°C
eXtreme Low-Power (XLP) Features:
• Sleep mode: 50 nA @ 1.8V, typical
• Watchdog Timer: 500 nA @ 1.8V, typical
• Secondary Oscillator: 500 nA @ 32 kHz
• Operating Current:
- 8 uA @ 32 kHz, 1.8V, typical
- 32 uA/MHz @ 1.8V, typical
Digital Peripherals:
• Configurable Logic Cell (CLC):
- Integrated combinational and sequential logic
• Complementary Output Generator (COG):
- Rising/falling edge dead-band control/
blanking
• Numerically Controlled Oscillator (NCO):
- Generates true linear frequency control and
increased frequency resolution
- Input Clock: 0Hz < F
- Resolution: F
• Capture/Compare/PWM (CCP) module
• PWM: Two 10-bit Pulse-Width Modulators
• Serial Communications:
- SPI, I
- Auto-Baud Detect, auto-wake-up on start
• Up to 35 I/O Pins and One Input Pin:
- Individually programmable pull-ups
- Slew rate control
- Interrupt-on-change with edge-select
• Peripheral Pin Select (PPS):
- Enables pin mapping of digital I/O
2
C™, RS-232, RS-485, LIN compatible
NCO < 32 MHz
NCO/220
Intelligent Analog Peripherals:
• Operational Amplifiers:
- Two configurable rail-to-rail op amps
- Selectable internal and external channels
- 2 MHz gain bandwidth product
• High-Speed Comparators:
- Up to two comparators
- 50 ns response time
- Rail-to-rail inputs
• 10-Bit Analog-to-Digital Converter (ADC):
- Up to 28 external channels
- Conversion available during Sleep
- Temperature indicator
• Zero-Cross Detector (ZCD):
- Detect when AC signal on pin crosses
ground
• 8-Bit Digital-to-Analog Converter (DAC):
- Output available externally
- Internal connections to comparators, op
amps, Fixed Voltage Reference (FVR) and
ADC
DS40001726B-page 4Preliminary 2013-2014 Microchip Technology Inc.
I/O
(2)
PDIP, SOIC,
SSOP
QFN, UQFN
ADC
Reference
Op Amp
DAC
Zero Cross
NCO
Interrupt
Pull-up
Basic
RA0227AN0
CLCIN0
(1)
IOCY
RA1328AN1OPA1OUT
CLCIN1
(1)
IOCY
RA241AN2 Vref-DAC1OUT1IOCY
RA352AN3 Vref+IOCY
RA463OPA1IN+
IOCY
RA574AN4OPA1IN- DAC2OUT1
RA6107IOCY
OSC2
CLKOUT
RA796IOCY
OSC1
CLKIN
RB02118AN12ZCD
INT
(1)
IOC
Y
RB12219AN10OPA2OUTIOCY
RB22320AN8OPA2IN-IOCY
RB32421AN9OPA2IN+IOCY
RB42522AN11IOCY
RB52623AN13
IOCY
RB62724
(1)
IOCY ICSPCLK
RB72825
DAC1OUT2
DAC2OUT2
CLCIN3
(1)
IOCY ICSPDAT
SOSCO
RC1129 SOSCIIOCY
RC21310AN14IOCY
RC31411AN15
Note 1: Default peripheral input. Alternate pins can be selected as the peripheral input with the PPS input selection registers.
2: All pin digital outputs default to PORT latch data. Alternate outputs can be selected as the peripheral digital output with the PPS output selection registers.
3: These peripheral functions are bidirectional. The output pin selections must be the same as the input pin selections.
4: Alternate outputs are excluded from solid shaded areas.
5: Alternate inputs are excluded from dot shaded areas.
Note 1: Default peripheral input. Alternate pins can be selected as the peripheral input with the PPS input selection registers.
2: All pin digital outputs default to PORT latch data. Alternate outputs can be selected as the peripheral digital output with the PPS output selection registers.
3: These peripheral functions are bidirectional. The output pin selections must be the same as the input pin selections.
4: Alternate outputs are excluded from solid shaded areas.
IOC
CK
RX
Vss
RC41512AN16
COG1IN
Comparator
Timers
CCP
PWM
COG
MSSP
EUSART
CLC
Y
SDI
SDA
(1)
(1)
(3)
(3)
5: Alternate inputs are excluded from dot shaded areas.
10.0 Flash Program Memory Control ................................................................................................................................................ 96
30.0 Master Synchronous Serial Port (MSSP) Module ................................................................................................................... 277
32.0 In-Circuit Serial Programming™ (ICSP™) .............................................................................................................................. 360
33.0 Instruction Set Summary......................................................................................................................................................... 362
35.0 DC and AC Characteristics Graphs and Charts ...................................................................................................................... 409
36.0 Development Support.............................................................................................................................................................. 423
The Microchip Web Site.................................................................................................................................................................... 441
Customer Change Notification Service ............................................................................................................................................. 442
Customer Support ............................................................................................................................................................................. 441
Worldwide Sales and Service ........................................................................................................................................................... 444
DS40001726B-page 6Preliminary 2013-2014 Microchip Technology Inc.
PIC16(L)F1713/6
TO OUR VALUED CUSTOMERS
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. 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., DS30000000A is version A of document DS30000000).
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.
The PIC16(L)F1713/6 are described within this data
sheet. They are available in 28-pin SPDIP, SSOP,
SOIC, QFN, and UQFN packages. Figure 1-1 shows a
block diagram of the PIC16(L)F1713/6 devices.
Table 1-2 shows the pinout descriptions.
Reference Table 1-1 for peripherals available per device.
TX/CKCMOS EUSART asynchronous TX data/synchronous clock out
(3)
DT
CLC1OUTCMOS Configurable logic cell 1 output
CLC2OUTCMOS Configurable logic cell 2 output
CLC3OUTCMOS Configurable logic cell 3 output
CLC4OUTCMOS Configurable logic cell 4 output
Legend: AN = Analog input or output CMOS= CMOS compatible input or outputOD = Open Drain
TTL = TTL compatible inputST= Schmitt Trigger input with CMOS levels I
HV = High VoltageXTAL = Crystal levels
Note 1:Default peripheral input. Alternate pins can be selected as the peripheral input with the PPS input selection registers.
2:All pin digital outputs default to PORT latch data. Alternate outputs can be selected as the peripheral digital output with
the PPS output selection registers.
3:These peripheral functions are bidirectional. The output pin selections must be the same as the input pin selections.
Output
Typ e
2
Typ e
C™—I2C Data input
ODI2C™ Data output
ODI2C™ clock output
CMOS EUSART synchronous data output
Description
2
C™ = Schmitt Trigger input with I2C
DS40001726B-page 12Preliminary 2013-2014 Microchip Technology Inc.
PIC16(L)F1713/6
Data Bus
8
14
Program
Bus
Instruction reg
Program Counter
8 LevelStack
(13-bit)
Direct Addr
7
12
Addr MUX
FSR reg
STATUS reg
MUX
ALU
Power-up
Timer
Oscillator
Start-up Timer
Power-on
Reset
Watchdog
Timer
InstructionDecode &
Control
Timing
Generation
OSC1/CLKIN
OSC2/CLKOUT
V
DD
8
8
Brown-out
Reset
12
3
VSS
Internal
Oscillator
Block
Data Bus
8
14
Program
Bus
Instruction reg
Program Counter
8 LevelStack
(13-bit)
Direct Addr
7
Addr MUX
FSR reg
STATUS reg
MUX
ALU
W reg
InstructionDecode &
Control
Timing
Generation
V
DD
8
8
3
VSS
Internal
Oscillator
Block
15
Data Bus
8
14
Program
Bus
Instruction Reg
Program Counter
16-Level Stack
(15-bit)
Direct Addr
7
RAM Addr
Addr MUX
Indirect
Addr
FSR0 Reg
STATUS Reg
MUX
ALU
Instruction
Decode and
Control
Timing
Generation
VDD
8
8
3
VSS
Internal
Oscillator
Block
RAM
FSR regFSR reg
FSR1 Reg
15
15
MUX
15
Program Memory
Read (PMR)
12
FSR regFSR reg
BSR Reg
5
ConfigurationConfigurationConfiguration
Flash
Program
Memory
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
FIGURE 2-1:CORE BLOCK DIAGRAM
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 3.5 “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.6 “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 33.0 “Instruction Set Summary” for more
details.
DS40001726B-page 14Preliminary 2013-2014 Microchip Technology Inc.
PIC16(L)F1713/6
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
Note 1: The method to access Flash memory
through the PMCON registers is described
in Section 10.0 “Flash Program Memory
Control”.
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 for the PIC16(L)F1713/6 family. 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
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.
3.1.1.2Indirect Read with FSR
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 directive will set bit<7> if a label points to a
location in program memory.
EXAMPLE 3-2:ACCESSING PROGRAM
MEMORY VIA FSR
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-3):
• 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.6 “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.
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.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 bl e 3 - 2. For detailed
information, see Ta bl e 3 -8 .
TABLE 3-2:CORE REGISTERS
DS40001726B-page 18Preliminary 2013-2014 Microchip Technology Inc.
PIC16(L)F1713/6
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 33.0
“Instruction Set Summary”).
Note:The C and DC bits operate as Borrow and
Digit Borrow
subtraction.
out bits, respectively, in
3.3Register Definitions: Status
REGISTER 3-1:STATUS: STATUS REGISTER
U-0U-0U-0R-1/qR-1/qR/W-0/uR/W-0/uR/W-0/u
———TOPDZDC
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
(1)
(1)
C
bit 7-5Unimplemented: Read as ‘0’
bit 4TO
bit 3PD
bit 2Z: Zero bit
bit 1DC: Digit Carry/Digit Borrow
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.
: 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
bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
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.3.2GENERAL 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.3.2.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.6.2
“Linear Data Memory” for more information.
3.3.3COMMON RAM
There are 16 bytes of common RAM accessible from all
banks.
FIGURE 3-3:BANKED MEMORY
PARTITIONING
DS40001726B-page 20Preliminary 2013-2014 Microchip Technology Inc.
3.3.4DEVICE MEMORY MAPS
The memory maps for the device family are as shown
in Tables 3-3 through 3-7.