PIC12(L)F1571/2 microcontrollers combine the capabilities of 16-bit PWMs with Analog to suit a variety of applications.
These devices deliver three 16-bit PWMs with independent timers for applications where high resolution is needed, such
as LED lighting, stepper motors, power supplies and other general purpose applications. The core independent
peripherals (16-bit PWMs, Complementary Waveform Generator), Enhanced Universal Synchronous Asynchronous
Receiver Transceiver (EUSART) and Analog (ADCs, Comparator and DAC) enable closed loop feedback and
communication for use in multiple market segments. The EUSART peripheral enables the communication for
applications such as LIN.
Core Features:
• C Compiler Optimized RISC Architecture
• Only 49 Instructions
• Operating Speed:
- DC – 32 MHz clock input
- 125 ns minimum instruction cycle
• Interrupt Capability
• 16-Level Deep Hardware Stack
• Two 8-Bit Timers
• One 16-Bit Timer
• Three additional 16-Bit Timers available using the
16-Bit PWMs
• 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 2 KW Flash Program Memory
• Up to 256 Bytes Data SRAM Memory
• Direct, Indirect and Relative Addressing modes
Operating Characteristics:
• Operating Voltage Range:
- 1.8V to 3.6V (PIC12LF1571/2)
- 2.3V to 5.5V (PIC12F1571/2)
• Temperature Range:
- Industrial: -40°C to 85°C
- Extended: -40°C to 125°C
• Internal Voltage Reference module
• In-Circuit Serial Programming™ (ICSP™) via Two
Pins
Digital Peripherals:
• 16-Bit PWM:
- Three 16-bit PWMs with independent timers
- Multiple output modes (standard, center
aligned, set and toggle on register match)
- User settings for phase, duty cycle, period,
offset and polarity
- 16-bit timer capability
- Interrupts generated based on timer matches
with offset, duty cycle, period and phase registers
2.0Enhanced Mid-Range CPU ........................................................................................................................................................ 10
10.0 Flash Program Memory Control ................................................................................................................................................. 84
27.0 DC and AC Characteristics Graphs and Charts ....................................................................................................................... 264
28.0 Development Support............................................................................................................................................................... 265
Appendix A: Data Sheet Revision History .......................................................................................................................................... 282
The Microchip Web Site..................................................................................................................................................................... 283
DS40001723B-page 4Preliminary 2013-2014 Microchip Technology Inc.
PIC12(L)F1571/2
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.
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.
FIGURE 2-1:CORE BLOCK DIAGRAM
• Automatic Interrupt Context Saving
• 16-level Stack with Overflow and Underflow
• File Select Registers
• Instruction Set
DS40001723B-page 10Preliminary 2013-2014 Microchip Technology Inc.
2.1Automatic Interrupt Context
Saving
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 Section7.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 Section3.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
Section3.5 “Indirect Addressing” for more details.
PIC12(L)F1571/2
2.4Instruction Set
There are 49 instructions for the enhanced mid-range
CPU to support the features of the CPU. See
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
PIC12(L)F15711,0243FFh
PIC12(L)F15722,0487FFh
DS40001723B-page 12Preliminary 2013-2014 Microchip Technology Inc.
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
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 operator will set bit<7> if a label points to a
location in program memory.
EXAMPLE 3-2:ACCESSING PROGRAM
MEMORY VIA FSR
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.
DS40001723B-page 14Preliminary 2013-2014 Microchip Technology Inc.
PIC12(L)F1571/2
AddressesBANKx
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-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 Section3.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 .
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
Section25.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 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
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
(1)
(1)
DS40001723B-page 16Preliminary 2013-2014 Microchip Technology Inc.
PIC12(L)F1571/2
Memory Region7-bit Bank Offset
00h
0Bh
0Ch
1Fh
20h
6Fh
7Fh
70h
Core Registers
(12 bytes)
Special Function Registers
(20 bytes maximum)
General Purpose RAM
(80 bytes maximum)
Common RAM
(16 bytes)
Rev. 10-000041A
7/30/2013
3.2.2SPECIAL FUNCTION REGISTER
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
Section3.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-3:BANKED MEMORY
PARTITIONING
3.2.5DEVICE MEMORY MAPS
The memory maps for PIC12(L)F1571/2 are as shown
in Table 3-3 through Tab l e 3 - 8 .
AddressNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0
Valu e o n
POR, BOR
Bank 0
00ChPORTA——RA5RA4RA3RA2RA1RA0--xx xxxx --xx xxxx
00Dh
00Eh
00Fh
010h
011hPIR1TMR1GIFADIFRCIF
012hPIR2
013hPIR3
014h
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>T1OSCENT1SYNC
019hT1GCONTMR1GET1GPOLT1GTMT1GSPMT1GGO/
01AhTMR2Timer2 Module Register0000 0000 0000 0000
01BhPR2Timer2 Period Register1111 1111 1111 1111
01ChT2CON
01Dh
01Eh
01Fh
—Unimplemented——
—Unimplemented——
—Unimplemented——
—Unimplemented——
——C1IF —————--0- ---- --0- ----
—PWM3IFPWM2IFPWM1IF————-000 ---- -000 ----
—Unimplemented——
—T2OUTPS<3:0>TMR2ONT2CKPS<1:0>-000 0000 -000 0000
—Unimplemented——
—Unimplemented——
—Unimplemented——
(2)
TXIF
(2)
——TMR2IFTMR1IF0000 --00 0000 --00
—TMR1ON0000 00-0 uuuu uu-u
DONE
T1GVALT1GSS<1:0>0000 0x00 uuuu uxuu
Bank 1
08ChTRISA——TRISA5TRISA4—
08Dh
08Eh
08Fh
090h
091hPIE1TMR1GIEADIERCIE
092hPIE2
093hPIE3
094h
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
—Unimplemented——
—Unimplemented——
—Unimplemented——
—Unimplemented——
——C1IE —————--0- ---- --0- ----
—PWM3IEPWM2IEPWM1IE————-000 ---- -000 ----
—Unimplemented——
2:PIC12(L)F1572 only.
3:Unimplemented, read as ‘1’.
(2)
TXIE
(2)
(2)
——TMR2IETMR1IE0000 --00 0000 --00
TRISA2TRISA1TRISA0--11 1111 --11 1111
Value on
all other
Resets
PIC12(L)F1571/2
DS40001723B-page 25Preliminary 2013-2014 Microchip Technology Inc.
TABLE 3-10:SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
AddressNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0
095h
096hPCONSTKOVFSTKUNF
097hWDTCON
098hOSCTUNE
099hOSCCONSPLLENIRCF<3:0>
09AhOSCSTAT
09BhADRESLADC Result Register Lowxxxx xxxx uuuu uuuu
09ChADRESHADC Result Register Highxxxx xxxx uuuu uuuu
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
—Unimplemented——
—Unimplemented——
—Unimplemented——
—Unimplemented——
—C1SPC1HYSC1SYNC0000 -100 0000 -100
—C1NCH<2:0>0000 -000 0000 -000
—Unimplemented——
—Unimplemented——
———————MC1OUT---- ---0 ---- ---0
—————BORRDY10-- ---q uu-- ---u
—DACPSS<1:0>——000- 00-- 000- 00--
———DACR<4:0>---0 0000 ---0 0000
to
—Unimplemented——
—T1GSELTXCKSELP2SELP1SEL000- 0000 000- 0000
—Unimplemented——
—Unimplemented——
2:PIC12(L)F1572 only.
3:Unimplemented, read as ‘1’.
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
—Unimplemented——
—Unimplemented——
—Unimplemented——
—Unimplemented——
(2)
—
Flash Program Memory Address Register High Byte1000 0000 1000 0000
——Flash Program Memory Read Data Register High Byte--xx xxxx --uu uuuu
(2)
—
(1)
—Unimplemented——
2:PIC12(L)F1572 only.
3:Unimplemented, read as ‘1’.
——— — — —VREGPMReserved---- --01 ---- --01
CFGSLWLOFREEWRERRWRENWRRD1000 x000 1000 q000
—SCKPBRG16—WUEABDEN01-0 0-00 01-0 0-00
Value on
all other
Resets
PIC12(L)F1571/2
DS40001723B-page 27Preliminary 2013-2014 Microchip Technology Inc.
TABLE 3-10:SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
AddressNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
—Unimplemented——
to
2:PIC12(L)F1572 only.
3:Unimplemented, read as ‘1’.
TABLE 3-10:SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
AddressNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0
Bank 10
50Ch
51Fh
—Unimplemented——
to
Bank 11
58Ch
to
59Fh
—Unimplemented——
Bank 12
60Ch
61Fh
—Unimplemented——
to
Bank 13
68Ch
to
690h
691hCWG1DBR
692hCWG1DBF
693hCWG1CON0G1ENG1OEBG1OEAG1POLBG1POLA
694hCWG1CON1G1ASDLB<1:0>G1ASDLA<1:0>
695hCWG1CON2G1ASEG1ARSEN
696h
69Fh
—Unimplemented——
——CWG1DBR<5:0>--00 0000 --00 0000
——CWG1DBF<5:0>--xx xxxx --xx xxxx
——G1CS00000 0--0 0000 0--0
—G1IS<2:0>0000 -000 0000 -000
———G1ASDC1G1ASDSFLT—00-- -00- 00-- -00-
to
—Unimplemented——
Banks 14-26
x0Ch/
x8Ch
—
x1Fh/
x9Fh
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
—Unimplemented——
2:PIC12(L)F1572 only.
3:Unimplemented, read as ‘1’.
Valu e o n
POR, BOR
Value on
all other
Resets
PIC12(L)F1571/2
DS40001723B-page 29Preliminary 2013-2014 Microchip Technology Inc.
TABLE 3-10:SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
AddressNameBit 7Bit 6Bit 5Bit 4Bit 3Bit 2 Bit 1Bit 0
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
Legend:x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1:PIC12F1571/2 only.
—Unimplemented——
to
2:PIC12(L)F1572 only.
3:Unimplemented, read as ‘1’.
Value on
all other
Resets
PIC12(L)F1571/2
Loading...
+ 256 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.