Académique Documents
Professionnel Documents
Culture Documents
Core Features:
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
Complementary Waveform Generator (CWG):
- Rising and falling edge dead-band control
- Multiple signal sources
Enhanced Universal Synchronous Asynchronous
Receiver Transceiver (EUSART):
- Supports LIN applications
Memory:
Six I/Os
Individually Selectable Weak Pull-ups
Interrupt-on-Change Pins Option with EdgeSelectable Option
Operating Characteristics:
Operating Voltage Range:
- 1.8V to 3.6V (PIC12LF1571/2)
- 2.3V to 5.5V (PIC12F1571/2)
Temperature Range:
- Industrial: -40C to 85C
- Extended: -40C to 125C
Internal Voltage Reference module
In-Circuit Serial Programming (ICSP) via Two
Pins
Low-Power Features:
Sleep mode: 20 nA @ 1.8V, typical
Watchdog Timer: 260 nA @ 1.8V, typical
Operating Current:
- 30 uA/MHz @ 1.8V, typical
DS40001723C-page 1
PIC12(L)F1571/2
Analog Peripherals:
Clocking Structure:
Device
I/O Pins
8-Bit/16-Bit Timers
Comparators
16-Bit PWM
5-Bit DAC
CWG
EUSART
Debug(1)
PIC12(L)F1571
128
2/4(2)
PIC12(L)F1572
256
2/4(2)
Note 1:
2:
DS40001723
DS40001723C-page 2
PIC12(L)F1571/2 Data Sheet, 8-Pin Flash, 8-bit MCU with High-Precision 16-bit PWM.
PIC12(L)F1571/2
PIN DIAGRAMS
RA5
RA4
RA3/MCLR/VPP
PIC12(L)F1572
VDD
PIC12(L)F1571
VSS
RA0/ICSPDAT
RA1/ICSPCLK
RA2
8-Pin PDIP/SOIC/MSOP/DFN
ADC
Reference
Comparator
Timers
PWM
EUSART(2)
CWG
Interrupt
Pull-up
Basic
I/O
TABLE 1:
RA0
AN0
DAC1OUT
C1IN+
PWM2
TX(2)
CK(2)
CWG1B
IOC
ICSPDAT
ICDDAT
RA1
AN1
VREF+
C1IN0-
PWM1
RX(2)
DT(2)
IOC
ICSPCLK
ICDCLK
RA2
AN2
C1OUT
T0CKI
PWM3
CWG1FLT
CWG1A
IOC
INT
RA3
T1G(1)
IOC
MCLR
VPP
RA4
AN3
C1IN1-
T1G
PWM2(1)
TX(1,2)
CK(1,2)
CWG1B(1)
IOC
CLKOUT
RA5
T1CKI
PWM1(1)
RX(1,2)
DT(1,2)
CWG1A(1)
IOC
CLKIN
VDD
VDD
Vss
VSS
Note 1:
2:
Alternate pin function selected with the APFCON (Register 11-1) register.
PIC12(L)F1572 only.
DS40001723C-page 3
PIC12(L)F1571/2
TABLE OF CONTENTS
1.0 Device Overview .......................................................................................................................................................................... 6
2.0 Enhanced Mid-Range CPU ........................................................................................................................................................ 11
3.0 Memory Organization ................................................................................................................................................................. 13
4.0 Device Configuration .................................................................................................................................................................. 40
5.0 Oscillator Module........................................................................................................................................................................ 45
6.0 Resets ........................................................................................................................................................................................ 57
7.0 Interrupts .................................................................................................................................................................................... 65
8.0 Power-Down Mode (Sleep) ........................................................................................................................................................ 78
9.0 Watchdog Timer (WDT) ............................................................................................................................................................. 81
10.0 Flash Program Memory Control ................................................................................................................................................. 85
11.0 I/O Ports ................................................................................................................................................................................... 101
12.0 Interrupt-On-Change ................................................................................................................................................................ 110
13.0 Fixed Voltage Reference (FVR) ............................................................................................................................................... 114
14.0 Temperature Indicator Module ................................................................................................................................................. 117
15.0 Analog-to-Digital Converter (ADC) Module .............................................................................................................................. 119
16.0 5-Bit Digital-to-Analog Converter (DAC) Module ...................................................................................................................... 133
17.0 Comparator Module.................................................................................................................................................................. 136
18.0 Timer0 Module ......................................................................................................................................................................... 143
19.0 Timer1 Module with Gate Control............................................................................................................................................. 146
20.0 Timer2 Module ......................................................................................................................................................................... 157
21.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ............................................................... 160
22.0 16-bit Pulse Width Modulation (PWM) Module......................................................................................................................... 188
23.0 Complementary Waveform Generator (CWG) Module ............................................................................................................ 214
24.0 In-Circuit Serial Programming (ICSP) ............................................................................................................................... 226
25.0 Instruction Set Summary .......................................................................................................................................................... 228
26.0 Electrical Specifications............................................................................................................................................................ 242
27.0 DC and AC Characteristics Graphs and Charts ....................................................................................................................... 266
28.0 Development Support............................................................................................................................................................... 287
29.0 Packaging Information.............................................................................................................................................................. 291
Appendix A: Data Sheet Revision History.......................................................................................................................................... 304
The Microchip Web Site ..................................................................................................................................................................... 305
Customer Change Notification Service .............................................................................................................................................. 305
Customer Support .............................................................................................................................................................................. 305
Product Identification System............................................................................................................................................................. 306
DS40001723C-page 4
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.
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:
Microchips 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.
DS40001723C-page 5
PIC12(L)F1571/2
1.0
DEVICE OVERVIEW
Peripheral
PIC12(L)F1572
DEVICE PERIPHERAL
SUMMARY
PIC12(L)F1571
TABLE 1-1:
Enhanced Universal
Synchronous/Asynchronous
Receiver/Transmitter (EUSART)
Temperature Indicator
C1
PWM1
PWM2
PWM3
Timer0
Timer1
Timer2
Comparators
PWM Modules
Timers
DS40001723C-page 6
PIC12(L)F1571/2
1.1
1.1.1
1.1.2
BIT NAMES
1.1.2.1
1.1.2.2
1.1.2.3
Bit Fields
~(1<<G1MD1)
COG1CON0,F
1<<G1MD2 | 1<<G1MD0
COG1CON0,F
Example 2:
BSF
BCF
BSF
COG1CON0,G1MD2
COG1CON0,G1MD1
COG1CON0,G1MD0
1.1.3
1.1.3.1
1.1.3.2
Legacy Peripherals
DS40001723C-page 7
PIC12(L)F1571/2
FIGURE 1-1:
Program
Flash Memory
RAM
PORTA
CLKOUT
Timing
Generation
CPU
CLKIN
INTRC
Oscillator
(Note 3)
MCLR
TMR2
CWG1
Note 1:
2:
3:
4:
DS40001723C-page 8
TMR1
TMR0
C1
Temp
Indicator
ADC
10-bit
PWM3
DAC
PWM2
FVR
PWM1
EUSART(4)
PIC12(L)F1571/2
TABLE 1-2:
Name
Function
RA0/AN0/C1IN+/DACOUT/
TX(2)/CK(2)/CWG1B/PWM2/
ICSPDAT/ICDDAT
Input
Type
Output
Type
RA0
AN0
C1IN+
DACOUT
TX
(4)
CK
PWM2
PWM output.
ICSPDAT
ICDDAT
RA1
AN1
VREF+
C1IN0-
RX
(3)
(4)
DT
PWM output.
ICSPCLK
ICDCLK
RA2
AN2
C1OUT
Comparator output.
T0CKI
(3)
(4)
CWG1A
PWM3
PWM output.
INT
External interrupt.
RA3
VPP
(3)
(4)
T1G
RA4/AN3/C1IN1-/T1G/TX
/
CK(1,2)/CWG1B(1)/PWM2(1)/
CLKOUT
Programming voltage.
Timer1 Gate input.
Master Clear with internal pull-up.
MCLR
(1,2)
CWG1FLT
RA3/VPP/T1G(1)/MCLR
PWM1
RA2/AN2/C1OUT/T0CKI/
CWG1FLT/CWG1A/PWM3/INT
CWG1B
RA1/AN1/VREF+/C1IN0-/RX(2)/
DT(2)/PWM1/ICSPCLK/ICDCLK
Description
RA4
AN3
C1IN1-
T1G
TX
CK
CWG1B
PWM2
CLKOUT
(4)
DS40001723C-page 9
PIC12(L)F1571/2
TABLE 1-2:
Name
RA5/T1CKI/RX(1,2)/DT(1,2)/
CWG1A(1)/PWM1(1)/CLKIN
Function
Input
Type
Output
Type
RA5
T1CKI
RX
DT
Description
(4)
CWG1A
PWM1
PWM output.
CLKIN
VDD
VDD
Power
Positive supply.
VSS
VSS
Power
Ground reference.
DS40001723C-page 10
PIC12(L)F1571/2
2.0
FIGURE 2-1:
15
Configuration
15
MUX
Flash
Program
Memory
Data Bus
16-Level Stack
(15-bit)
RAM
14
Program
Bus
Program Counter
12
Program Memory
Read (PMR)
RAM Addr
Addr MUX
Instruction Reg
Direct Addr
7
5
Indirect
Addr
12
12
BSR Reg
15
FSR0 Reg
15
FSR1 Reg
STATUS Reg
Instruction
Decode and
Control
CLKIN
CLKOUT
Timing
Generation
Internal
Oscillator
Block
Power-up
Timer
Power-on
Reset
Watchdog
Timer
Brown-out
Reset
VDD
MUX
ALU
W Reg
VSS
DS40001723C-page 11
PIC12(L)F1571/2
2.1
2.2
2.3
2.4
Instruction Set
DS40001723C-page 12
PIC12(L)F1571/2
3.0
MEMORY ORGANIZATION
TABLE 3-1:
3.1
High-Endurance Flash
Memory Address Range (1)
PIC12(L)F1571
1,024
03FFh
0380h-03FFh
PIC12(L)F1572
2,048
07FFh
0780h-07FFh
Device
Note 1: High-endurance Flash applies to low byte of each address in the range.
DS40001723C-page 13
PIC12(L)F1571/2
FIGURE 3-1:
FIGURE 3-2:
Rev. 10-000040D
7/30/2013
PC<14:0>
CALL, CALLW
RETURN, RETLW
Interrupt, RETFIE
PC<14:0>
CALL, CALLW
RETURN, RETLW
Interrupt, RETFIE
15
Stack Level 0
Stack Level 0
Stack Level 1
Stack Level 1
Stack Level 15
Stack Level 15
Reset Vector
0000h
Interrupt Vector
0004h
0005h
On-chip
Program
Memory
Page 0
Rollover to Page 0
03FFh
0400h
Rollover to Page 0
7FFFh
DS40001723C-page 14
15
On-chip
Program
Memory
Reset Vector
0000h
Interrupt Vector
0004h
0005h
Page 0
Rollover to Page 0
07FFh
0800h
Rollover to Page 0
7FFFh
PIC12(L)F1571/2
3.1.1
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.1
RETLW Instruction
EXAMPLE 3-1:
constants
BRW
RETLW
RETLW
RETLW
RETLW
DATA0
DATA1
DATA2
DATA3
RETLW INSTRUCTION
;Add Index in W to
;program counter to
;select data
;Index0 data
;Index1 data
my_function
; LOTS OF CODE
MOVLW
DATA_INDEX
call constants
; THE CONSTANT IS IN W
3.1.1.2
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
constants
RETLW DATA0
;Index0 data
RETLW DATA1
;Index1 data
RETLW DATA2
RETLW DATA3
my_function
; LOTS OF CODE
MOVLW
LOW constants
MOVWF
FSR1L
MOVLW
HIGH constants
MOVWF
FSR1H
MOVIW
0[FSR1]
;THE PROGRAM MEMORY IS IN W
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.
DS40001723C-page 15
PIC12(L)F1571/2
3.2
12 core registers
20 Special Function Registers (SFR)
Up to 80 bytes of General Purpose RAM (GPR)
16 bytes of common RAM
DS40001723C-page 16
3.2.1
CORE REGISTERS
TABLE 3-2:
CORE REGISTERS
Addresses
BANKx
x00h or x80h
x01h or x81h
x02h or x82h
x03h or x83h
x04h or x84h
x05h or x85h
x06h or x86h
x07h or x87h
x08h or x88h
x09h or x89h
x0Ah or x8Ah
x0Bh or x8Bh
INDF0
INDF1
PCL
STATUS
FSR0L
FSR0H
FSR1L
FSR1H
BSR
WREG
PCLATH
INTCON
PIC12(L)F1571/2
3.2.1.1
STATUS Register
REGISTER 3-1:
U-0
U-0
R-1/q
TO
R-1/q
PD
R/W-0/u
Z
R/W-0/u
(1)
DC
bit 7
R/W-0/u
C(1)
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1
DC: Digit Carry/Digit Borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)(1)
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
bit 0
Note 1:
For Borrow, the polarity is reversed. A subtraction is executed by adding the twos 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.
DS40001723C-page 17
PIC12(L)F1571/2
3.2.2
3.2.3
3.2.3.1
FIGURE 3-3:
Rev. 10-000041A
7/30/2013
Memory Region
00h
Core Registers
(12 bytes)
0Bh
0Ch
Special Function Registers
(20 bytes maximum)
1Fh
20h
3.2.4
BANKED MEMORY
PARTITIONING
COMMON RAM
3.2.5
6Fh
70h
Common RAM
(16 bytes)
7Fh
DS40001723C-page 18
TABLE 3-3:
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
01Fh
020h
PORTA
PIR1
PIR2
PIR3
TMR0
TMR1L
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
General
Purpose
Register
80 Bytes
Core Registers
(Table 3-2)
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
097h
098h
099h
09Ah
09Bh
09Ch
0C0h
Legend:
0FFh
Unimplemented
Read as 0
Common RAM
(Accesses
70h 7Fh)
BANK 3
180h
Core Registers
(Table 3-2)
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
120h
LATA
CM1CON0
CM1CON1
CMOUT
BORCON
FVRCON
DACCON0
DACCON1
APFCON
Core Registers
(Table 3-2)
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
Unimplemented
Read as 0
16Fh
170h
17Fh
Common RAM
(Accesses
70h 7Fh)
BANK 4
200h
ANSELA
PMADRL
PMADRH
PMDATL
PMDATH
PMCON1
PMCON2
VREGCON
Core Registers
(Table 3-2)
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
21Fh
220h
Unimplemented
Read as 0
1EFh
1F0h
1FFh
Common RAM
(Accesses
70h 7Fh)
BANK 5
280h
WPUA
Core Registers
(Table 3-2)
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
29Fh
2A0h
Unimplemented
Read as 0
26Fh
270h
27Fh
Common RAM
(Accesses
70h 7Fh)
BANK 6
300h
ODCONA
Core Registers
(Table 3-2)
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
31Fh
320h
Unimplemented
Read as 0
2EFh
2F0h
2FFh
Common RAM
(Accesses
70h 7Fh)
BANK 7
380h
SLRCONA
Core Registers
(Table 3-2)
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
39Fh
3A0h
Unimplemented
Read as 0
36Fh
370h
37Fh
Common RAM
(Accesses
70h 7Fh)
INLVLA
IOCAP
IOCAN
IOCAF
Unimplemented
Read as 0
3EFh
3F0h
3FFh
Common RAM
(Accesses
70h 7Fh)
DS40001723C-page 19
PIC12(L)F1571/2
Common RAM
07Fh
TRISA
PIE1
PIE2
PIE3
OPTION_REG
PCON
WDTCON
OSCTUN E
OSCCON
OSCSTAT
ADRESL
ADRESH
09Dh
ADCON0
09Eh
ADCON1
09Fh
ADCON2
0A0h General Purpose
Register
48 Bytes
0BFh
0EFh
0F0h
06Fh
070h
BANK 2
100h
BANK 0
000h
BANK 1
080h
Core Registers
(Table 3-2)
00Bh
00Ch
00Dh
00Eh
00Fh
010h
011h
012h
013h
014h
015h
016h
017h
018h
019h
01Ah
01Bh
01Ch
01Dh
01Eh
01Fh
020h
PORTA
PIR1
PIR2
PIR3
TMR0
TMR1L
TMR1H
T1CON
T1GCON
TMR2
PR2
T2CON
Core Registers
(Table 3-2)
08Bh
08Ch
08Dh
08Eh
08Fh
090h
091h
092h
093h
094h
095h
096h
097h
098h
099h
09Ah
09Bh
09Ch
09Dh
09Eh
09Fh
0A0h
General
Purpose
Register
80 Bytes
07Fh
ADCON0
ADCON1
ADCON2
10Bh
10Ch
10Dh
10Eh
10Fh
110h
111h
112h
113h
114h
115h
116h
117h
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
11Fh
120h
LATA
CM1CON0
CM1CON1
CMOUT
BORCON
FVRCON
DACCON0
DACCON1
APFCON
16Fh
170h
18Bh
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
1A0h
ANSELA
PMADRL
PMADRH
PMDATL
PMDATH
PMCON1
PMCON2
VREGCON
RCREG
TXREG
SPBRG
SPBRGH
RCSTA
TXSTA
BAUDCON
Accesses
70h 7Fh
17Fh
20Bh
20Ch
20Dh
20Eh
20Fh
210h
211h
212h
213h
214h
215h
216h
217h
218h
219h
21Ah
21Bh
21Ch
21Dh
21Eh
21Fh
220h
WPUA
26Fh
270h
28Bh
28Ch
28Dh
28Eh
28Fh
290h
291h
292h
293h
294h
295h
296h
297h
298h
299h
29Ah
29Bh
29Ch
29Dh
29Eh
29Fh
2A0h
ODCONA
30Bh
30Ch
30Dh
30Eh
30Fh
310h
311h
312h
313h
314h
315h
316h
317h
318h
319h
31Ah
31Bh
31Ch
31Dh
31Eh
31Fh
320h
Core Registers
(Table 3-2)
38Bh
38Ch
38Dh
38Eh
38Fh
390h
391h
392h
393h
394h
395h
396h
397h
398h
399h
39Ah
39Bh
39Ch
39Dh
39Eh
39Fh
3A0h
Unimplemented
Read as 0
Accesses
70h 7Fh
2FFh
SLRCONA
36Fh
370h
2EFh
2F0h
BANK 7
380h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Accesses
70h 7Fh
27Fh
BANK 6
300h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Accesses
70h 7Fh
1FFh
BANK 5
280h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
1EFh
1F0h
BANK 4
200h
Core Registers
(Table 3-2)
General
Purpose
Register
80 Bytes
Accesses
70h 7Fh
0FFh
BANK 3
180h
Core Registers
(Table 3-2)
General
Purpose
Register
80 Bytes
Common RAM
Legend:
TRISA
PIE1
PIE2
PIE3
OPTION_REG
PCON
WDTCON
OSCTUNE
OSCCON
OSCSTAT
ADRESL
ADRESH
0EFh
0F0h
06Fh
070h
BANK 2
100h
Unimplemented
Read as 0
3EFh
3F0h
Accesses
70h 7Fh
37Fh
INLVLA
IOCAP
IOCAN
IOCAF
Accesses
70h 7Fh
3FFh
PIC12(L)F1571/2
DS40001723C-page 20
TABLE 3-4:
TABLE 3-5:
BANK 8
400h
Core Registers
(Table 3-2)
40Bh
40Ch
40Dh
40Eh
40Fh
410h
411h
412h
413h
414h
415h
416h
417h
418h
419h
41Ah
41Bh
41Ch
41Dh
41Eh
41Fh
420h
BANK 9
480h
48Bh
48Ch
48Dh
48Eh
48Fh
490h
491h
492h
493h
494h
495h
496h
497h
498h
499h
49Ah
49Bh
49Ch
49Dh
49Eh
49Fh
4A0h
Unimplemented
Read as 0
46Fh
470h
Core Registers
(Table 3-2)
Accesses
70h 7Fh
Core Registers
(Table 3-2)
88Bh
88Ch
DS40001723C-page 21
Unimplemented
Read as 0
86Fh
870h
Unimplemented
Read as 0
8EFh
8F0h
Accesses
70h 7Fh
87Fh
Legend:
90Bh
90Ch
Unimplemented
Read as 0
8FFh
9EFh
9F0h
96Fh
970h
Accesses
70h 7Fh
Unimplemented
Read as 0
Accesses
70h 7Fh
97Fh
Unimplemented
Read as 0
Accesses
70h 7Fh
9FFh
Core Registers
(Table 3-2)
B8Bh
B8Ch
Unimplemented
Read as 0
Unimplemented
Read as 0
BEFh
BF0h
B6Fh
B70h
Accesses
70h 7Fh
AFFh
BANK 23
B80h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Accesses
70h 7Fh
A7Fh
BANK 22
B0Bh
B0Ch
AEFh
AF0h
A6Fh
A70h
Accesses
70h 7Fh
7FFh
B00h
Core Registers
(Table 3-2)
Accesses
70h 7Fh
B7Fh
Unimplemented
Read as 0
Accesses
70h 7Fh
BANK 21
A8Bh
A8Ch
78Bh
78Ch
78Dh
78Eh
78Fh
790h
791h
792h
793h
794h
795h
796h
797h
798h
799h
79Ah
79Bh
79Ch
79Dh
79Eh
79Fh
7A0h
Core Registers
(Table 3-2)
7EFh
7F0h
77Fh
A80h
Core Registers
(Table 3-2)
BANK 15
780h
Unimplemented
Read as 0
Accesses
70h 7Fh
BANK 20
A0Bh
A0Ch
70Bh
70Ch
70Dh
70Eh
70Fh
710h
711h
712h
713h
714h
715h
716h
717h
718h
719h
71Ah
71Bh
71Ch
71Dh
71Eh
71Fh
720h
Core Registers
(Table 3-2)
76Fh
770h
6FFh
A00h
Core Registers
(Table 3-2)
CWG1DBR
CWG1DBF
CWG1CON0
CWG1CON1
CWG1CON2
BANK 14
700h
Unimplemented
Read as 0
Accesses
70h 7Fh
BANK 19
98Bh
98Ch
68Bh
68Ch
68Dh
68Eh
68Fh
690h
691h
692h
693h
694h
695h
696h
697h
698h
699h
69Ah
69Bh
69Ch
69Dh
69Eh
69Fh
6A0h
Core Registers
(Table 3-2)
6EFh
6F0h
67Fh
980h
Core Registers
(Table 3-2)
BANK 13
680h
Unimplemented
Read as 0
Accesses
70h 7Fh
BANK 18
Core Registers
(Table 3-2)
66Fh
670h
5FFh
900h
60Bh
60Ch
60Dh
60Eh
60Fh
610h
611h
612h
613h
614h
615h
616h
617h
618h
619h
61Ah
61Bh
61Ch
61Dh
61Eh
61Fh
620h
Unimplemented
Read as 0
Accesses
70h 7Fh
BANK 17
BANK 12
600h
Accesses
70h 7Fh
BFFh
PIC12(L)F1571/2
80Bh
80Ch
58Bh
58Ch
58Dh
58Eh
58Fh
590h
591h
592h
593h
594h
595h
596h
597h
598h
599h
59Ah
59Bh
59Ch
59Dh
59Eh
59Fh
5A0h
Core Registers
(Table 3-2)
5EFh
5F0h
57Fh
880h
Core Registers
(Table 3-2 )
BANK 11
580h
Unimplemented
Read as 0
Accesses
70h 7Fh
BANK 16
Core Registers
(Table 3-2)
56Fh
570h
4FFh
800h
50Bh
50Ch
50Dh
50Eh
50Fh
510h
511h
512h
513h
514h
515h
516h
517h
518h
519h
51Ah
51Bh
51Ch
51Dh
51Eh
51Fh
520h
Unimplemented
Read as 0
4EFh
4F0h
47Fh
BANK 10
500h
TABLE 3-6:
BANK 24
C00h
BANK 25
C80h
Core Registers
(Table 3-2)
C0Bh
C0Ch
C0Dh
C0Eh
C0Fh
C10h
C11h
C12h
C13h
C14h
C15h
C16h
C17h
C18h
C19h
C1Ah
C1Bh
C1Ch
C1Dh
C1Eh
C1Fh
C20h
Core Registers
(Table 3-2)
C8Bh
C8Ch
C8Dh
C8Eh
C8Fh
C90h
C91h
C92h
C93h
C94h
C95h
C96h
C97h
C98h
C99h
C9Ah
C9Bh
C9Ch
C9Dh
C9Eh
C9Fh
CA0h
Unimplemented
Read as 0
CFFh
Core Registers
(Table 3-2)
D0Bh
D0Ch
D0Dh
D0Eh
D0Fh
D10h
D11h
D12h
D13h
D14h
D15h
D16h
D17h
D18h
D19h
D1Ah
D1Bh
D1Ch
D1Dh
D1Eh
D1Fh
D20h
Unimplemented
Read as 0
CEFh
CF0h
Accesses
70h 7Fh
Legend:
BANK 28
E00h
Core Registers
(Table 3-2)
D8Bh
D8Ch
D6Fh
D70h
E0Bh
E0Ch
E0Dh
E0Eh
E0Fh
E10h
E11h
E12h
E13h
E14h
E15h
E16h
E17h
See Table 3-7 for
register mapping E18h
E19h
details
E1Ah
E1Bh
E1Ch
E1Dh
E1Eh
E1Fh
E20h
Accesses
70h 7Fh
D7Fh
E6Fh
E70h
Accesses
70h 7Fh
DFFh
E8Bh
E8Ch
E8Dh
E8Eh
E8Fh
E90h
E91h
E92h
E93h
E94h
E95h
E96h
E97h
E98h
E99h
E9Ah
E9Bh
E9Ch
E9Dh
E9Eh
E9Fh
EA0h
EEFh
EF0h
F0Bh
F0Ch
F0Dh
F0Eh
F0Fh
F10h
F11h
F12h
F13h
F14h
F15h
F16h
F17h
F18h
F19h
F1Ah
F1Bh
F1Ch
F1Dh
F1Eh
F1Fh
F20h
Core Registers
(Table 3-2)
F8Bh
F8Ch
Unimplemented
Read as 0
F6Fh
F70h
Accesses
70h 7Fh
EFFh
BANK 31
F80h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Accesses
70h 7Fh
E7Fh
BANK 30
F00h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
DEFh
DF0h
BANK 29
E80h
Core Registers
(Table 3-2)
Unimplemented
Read as 0
Accesses
70h 7Fh
CFFh
BANK 27
D80h
FEFh
FF0h
Accesses
70h 7Fh
F7Fh
Accesses
70h 7Fh
FFFh
DS40001723C-page 22
PIC12(L)F1571/2
C6Fh
C70h
BANK 26
D00h
PIC12(L)F1571/2
TABLE 3-7:
PIC12(L)F1571/2 MEMORY
MAP, BANK 27
TABLE 3-8:
PIC12(L)F1571/2 MEMORY
MAP, BANK 31
Bank 31
D8Ch
D8Dh
D8Eh
D8Fh
D90h
D91h
D92h
D93h
D94h
D95h
D96h
D97h
D98h
D99h
D9Ah
D9Bh
D9Ch
D9Dh
D9Eh
D9Fh
DA0h
DA1h
DA2h
DA3h
DA4h
DA5h
DA6h
DA7h
DA8h
DA9h
DAAh
DABh
DACh
DADh
DAEh
DAFh
DB0h
DB1h
DB2h
DB3h
DB4h
DB5h
DB6h
DB7h
DB8h
DB9h
DBAh
DBBh
DBCh
DBDh
DBEh
DBFh
DC0h
DC1h
PWMEN
PWMLD
PWMOUT
PWM1PHL
PWM1PHH
PWM1DCL
PWM1DCH
PWM1PRL
PWM1PRH
PWM1OFL
PWM1OFH
PWM1TMRL
PWM1TMRH
PWM1CON
PWM1INTE
PWM1INTF
PWM1CLKCON
PWM1LDCON
PWM1OFCON
PWM2PHL
PWM2PHH
PWM2DCL
PWM2DCH
PWM2PRL
PWM2PRH
PWM2OFL
PWM2OFH
PWM2TMRL
PWM2TMRH
PWM2CON
PWM2INTE
PWM2INTF
PWM2CLKCON
PWM2LDCON
PWM2OFCON
PWM3PHL
PWM3PHH
PWM3DCL
PWM3DCH
PWM2PRL
PWM3PRH
PWM3OFL
PWM3OFH
PWM3TMRL
PWM3TMRH
PWM3CON
PWM3INTE
PWM3INTF
PWM3CLKCON
PWM3LDCON
PWM3OFCON
Bank 31
F8Ch
Unimplemented
Read as 0
FE3h
FE4h
FE5h
FE6h
FE7h
FE8h
FE9h
FEAh
FEBh
FECh
FEDh
Legend:
STATUS_SHAD
WREG_SHAD
BSR_SHAD
PCLATH_SHAD
FSR0L_SHAD
FSR0H_SHAD
FSR1L_SHAD
FSR1H_SHAD
STKPTR
FEEh
TOSL
FEFh
TOSH
DEFh
Legend:
DS40001723C-page 23
PIC12(L)F1571/2
3.2.6
TABLE 3-9:
Addr
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on all
other Resets
Bank 0-31
x00h or
INDF0
x80h
xxxx xxxx
uuuu uuuu
x01h or
INDF1
x81h
xxxx xxxx
uuuu uuuu
x02h or
PCL
x82h
0000 0000
0000 0000
---1 1000
---q quuu
x03h or
STATUS
x83h
TO
PD
DC
x04h or
FSR0L
x84h
0000 0000
uuuu uuuu
x05h or
FSR0H
x85h
0000 0000
0000 0000
x06h or
FSR1L
x86h
0000 0000
uuuu uuuu
x07h or
FSR1H
x87h
0000 0000
0000 0000
---0 0000
---0 0000
0000 0000
uuuu uuuu
-000 0000
-000 0000
0000 0000
0000 0000
x08h or
BSR
x88h
x09h or
WREG
x89h
BSR<4:0>
Working Register
x0Ah or
PCLATH
x8Ah
x0Bh or
INTCON
x8Bh
GIE
Legend:
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
DS40001723C-page 24
Address
Value on
all other
Resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
RA5
RA4
RA3
RA2
RA1
RA0
Bank 0
00Ch
PORTA
00Dh
Unimplemented
00Eh
Unimplemented
00Fh
Unimplemented
010h
Unimplemented
011h
PIR1
TMR1GIF
012h
PIR2
013h
PIR3
PWM3IF
014h
Unimplemented
015h
TMR0
016h
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Count
017h
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Count
018h
T1CON
019h
T1GCON
01Ah
TMR2
01Bh
PR2
01Ch
T2CON
01Dh
Unimplemented
01Eh
Unimplemented
01Fh
Unimplemented
ADIF
TXIF(2)
TMR2IF
TMR1IF
C1IF
PWM2IF
PWM1IF
TMR1CS<1:0>
TMR1GE
RCIF(2)
T1GPOL
T1CKPS<1:0>
T1GTM
T1GSPM
T1OSCEN
T1SYNC
T1GGO/
DONE
T1GVAL
TMR1ON
T1GSS<1:0>
T2OUTPS<3:0>
TMR2ON
T2CKPS<1:0>
Bank 1
TRISA
08Dh
Unimplemented
08Eh
Unimplemented
08Fh
Unimplemented
090h
Unimplemented
091h
PIE1
TMR1GIE
092h
PIE2
093h
PIE3
PWM3IE
094h
ADIE
Unimplemented
TRISA5
RCIE(2)
TRISA4
(2)
08Ch
TRISA2
TRISA1
TRISA0
TXIE(2)
TMR2IE
TMR1IE
C1IE
PWM2IE
PWM1IE
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
DS40001723C-page 25
TABLE 3-10:
TABLE 3-10:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Value on
all other
Resets
Bit 0
Value on
POR, BOR
BOR
SWDTEN
Bit 1
Bank 1 (Continued)
095h
OPTION_REG
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
096h
PCON
STKOVF
STKUNF
RWDT
RMCLR
097h
WDTCON
098h
OSCTUNE
099h
OSCCON
SPLLEN
09Ah
OSCSTAT
09Bh
ADRESL
09Ch
ADRESH
09Dh
ADCON0
09Eh
ADCON1
ADFM
09Fh
ADCON2
PS<2:0>
RI
WDTPS<4:0>
TUN<5:0>
IRCF<3:0>
PLLR
POR
OSTS
HFIOFR
HFIOFL
MFIOFR
SCS<1:0>
LFIOFR
HFIOFS
CHS<4:0>
ADCS<2:0>
TRIGSEL<3:0>
GO/DONE
ADON
ADPREF<1:0>
LATA2
LATA1
LATA0
Bank 2
10Ch
LATA
10Dh
Unimplemented
10Eh
Unimplemented
10Fh
Unimplemented
110h
Unimplemented
111h
CM1CON0
C1ON
C1OUT
C1INTP
C1INTN
LATA5
C1OE
LATA4
C1POL
C1SP
C1HYS
C1SYNC
112h
CM1CON1
113h
Unimplemented
114h
Unimplemented
115h
CMOUT
C1NCH<2:0>
116h
BORCON
SBOREN
BORFS
117h
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
CDAFVR<1:0>
118h
DACCON0
DACEN
DACLPS
DACOE
DACPSS<1:0>
119h
DACCON1
DS40001723C-page 26
11Ah
to
11Ch
MC1OUT
BORRDY
ADFVR<1:0>
DACR<4:0>
Unimplemented
11Dh
APFCON
11Eh
Unimplemented
11Fh
Unimplemented
T1GSEL
TXCKSEL
P2SEL
P1SEL
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
C1PCH<1:0>
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
ANSA4
ANSA2
ANSA1
ANSA0
Value on
POR, BOR
Value on
all other
Resets
Bank 3
18Ch
ANSELA
18Dh
Unimplemented
18Eh
Unimplemented
18Fh
Unimplemented
190h
Unimplemented
191h
PMADRL
192h
PMADRH
193h
PMDATL
194h
PMDATH
195h
PMCON1
(3)
CFGS
196h
PMCON2
197h
VREGCON(1)
(3)
FREE
WRERR
WREN
WR
RD
VREGPM
Reserved
198h
Unimplemented
199h
RCREG
19Ah
TXREG
19Bh
SPBRGL
19Ch
SPBRGH
19Dh
RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
19Eh
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
19Fh
BAUDCON
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
DS40001723C-page 27
TABLE 3-10:
TABLE 3-10:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
Value on
POR, BOR
Value on
all other
Resets
Bank 4
20Ch
WPUA
20Dh
Unimplemented
Unimplemented
20Eh
to
21Fh
Bank 5
28Ch
28Dh
to
29Fh
ODCONA
ODA5
ODA4
ODA2
ODA1
ODA0
Unimplemented
Bank 6
30Ch
30Dh
to
31Fh
SLRCONA
SLRA5
SLRA4
SLRA2
ODAA1
ODAA0
Unimplemented
Bank 7
38Ch
38Dh
to
390h
INLVLA
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
Unimplemented
391h
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
392h
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
393h
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
Unimplemented
Unimplemented
Unimplemented
Bank 8
40Ch
to
41Fh
Bank 9
DS40001723C-page 28
48Ch
to
49Fh
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
394h
to
39Fh
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
Bank 10
50Ch
to
51Fh
Unimplemented
Unimplemented
Unimplemented
Unimplemented
Bank 11
58Ch
to
59Fh
Bank 12
60Ch
to
61Fh
Bank 13
68Ch
to
690h
691h
CWG1DBR
CWG1DBR<5:0>
692h
CWG1DBF
CWG1DBF<5:0>
693h
CWG1CON0
G1EN
G1OEB
694h
CWG1CON1
695h
CWG1CON2
696h
to
69Fh
G1ASDLB<1:0>
G1ASE
G1ARSEN
G1OEA
G1POLB
G1POLA
G1ASDLA<1:0>
G1CS0
G1IS<2:0>
G1ASDC1
G1ASDSFLT
Unimplemented
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
DS40001723C-page 29
TABLE 3-10:
TABLE 3-10:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
Bank 27
D8Ch
Unimplemented
D8Dh
Unimplemented
D8Eh
PWMEN
D8Fh
PWMLD
D90h
PWMOUT
PWM3EN_A
PWM2EN_A
PWM1EN_A
D91h
PWM1PHL
PH<7:0>
D92h
PWM1PHH
PH<15:8>
D93h
PWM1DCL
DC<7:0>
D94h
PWM1DCH
DC<15:8>
D95h
PWM1PRL
PR<7:0>
D96h
PWM1PRH
PR<15:8>
D97h
PWM1OFL
OF<7:0>
D98h
PWM1OFH
OF<15:8>
D99h
PWM1TMRL
TMR<7:0>
D9Ah
PWM1TMRH
TMR<15:8>
D9Bh
PWM1CON
PWM1EN
D9Ch
PWM1INTE
PWM1OFIE
D9Dh
PWM1INTF
D9Eh
PWM1CLKCON
PWM1OE PWM1OUT
PWM1POL
PWM1PHIE
PWM1DCIE
PWM1PRIE
---- 000
---- 000
PWM1OFIF
PWM1PHIF
PWM1DCIF
PWM1PRIF
---- 000
---- 000
PWM1OFO
PWM1PS<2:0>
PWM1LDA PWM1LDT
PWM1MODE<1:0>
PWM1CS<1:0>
PWM1LDS<1:0>
PWM1OFS<1:0>
PWM1LDCON
DA0h
PWM1OFCON
DA1h
PWM2PHL
PH<7:0>
DA2h
PWM2PHH
PH<15:8>
DA3h
PWM2DCL
DC<7:0>
DA4h
PWM2DCH
DC<15:8>
DA5h
PWM2PRL
PR<7:0>
DA6h
PWM2PRH
PR<15:8>
DA7h
PWM2OFL
OF<7:0>
DA8h
PWM2OFH
OF<15:8>
DA9h
PWM2TMRL
TMR<7:0>
DAAh
PWM2TMRH
TMR<15:8>
PWM1OFM<1: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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
DS40001723C-page 30
D9Fh
TABLE 3-10:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
all other
Resets
Value on
POR, BOR
Bank 27 (Continued)
DABh
PWM2CON
PWM2EN
DACh
PWM2INTE
PWM2OE PWM2OUT
PWM2POL
PWM2OFIE
PWM2MODE<1:0>
PWM2PHIE
PWM2DCIE
PWM2PRIE
---- 000
---- 000
DADh
PWM2INTF
PWM2OFIF
PWM2PHIF
PWM2DCIF
PWM2PRIF
---- 000
---- 000
DAEh
PWM2CLKCON
PWM2OFO
PWM2PS<2:0>
PWM2LDA PWM2LDT
PWM2CS<1:0>
PWM2LDS<1:0>
PWM2OFS<1:0>
DAFh
PWM2LDCON
DB0h
PWM2OFCON
DB1h
PWM3PHL
PH<7:0>
DB2h
PWM3PHH
PH<15:8>
DB3h
PWM3DCL
DC<7:0>
DB4h
PWM3DCH
DC<15:8>
DB5h
PWM3PRL
PR<7:0>
DB6h
PWM3PRH
PR<15:8>
DB7h
PWM3OFL
OF<7:0>
DA8h
PWM3OFH
OF<15:8>
DA9h
PWM3TMRL
TMR<7:0>
DBAh
PWM3TMRH
TMR<15:8>
DBBh
PWM3CON
PWM3EN
DBCh
PWM3INTE
PWM3OFIE
DBDh
PWM3INTF
DBEh
PWM3CLKCON
DBFh
PWM3LDCON
DC0h
PWM3OFCON
PWM2OFM<1:0>
PWM3OE PWM3OUT
PWM3PHIE
PWM3DCIE
PWM3PRIE
---- 000
---- 000
PWM3OFIF
PWM3PHIF
PWM3DCIF
PWM3PRIF
---- 000
---- 000
PWM3OFO
PWM3CS<1:0>
PWM3LDS<1:0>
PWM3OFS<1:0>
Bank 28-30
58Ch
to
59Fh
Unimplemented
DS40001723C-page 31
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
PWM3OFM<1:0>
PWM3MODE<1:0>
PWM3PS<2:0>
PWM3LDA PWM3LDT
PWM3POL
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
Resets
Bank 31
F8Ch
FE3h
FE4h
STATUS_
Unimplemented
Z_SHAD
DC_SHAD
C_SHAD
SHAD
FE5h
WREG_
SHAD
FE6h
BSR_
SHAD
FE7h
PCLATH_
SHAD
FE8h
FSR0L_
SHAD
FE9h
FSR0H_
SHAD
FEAh
FSR1L_
SHAD
FEBh
FSR1H_
SHAD
FECh
FEDh
STKPTR
FEEh
TOSL
FEFh
TOSH
Unimplemented
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.
2:
PIC12(L)F1572 only.
3:
Unimplemented, read as 1.
PIC12(L)F1571/2
DS40001723C-page 32
TABLE 3-10:
PIC12(L)F1571/2
3.3
3.3.2
FIGURE 3-4:
LOADING OF PC IN
DIFFERENT SITUATIONS
Rev. 10-000042A
7/30/2013
14
PCH
PCL
PC
7
Instruction
with PCL as
Destination
14
PCH
PCL
PC
6
PCLATH
PCL
8
W
PC
6
PCLATH
14
PCH
PCL
PCL
PC
CALLW
3.3.4
BRW
15
PC + W
14
PCH
PC
BRA
15
PC + OPCODE <8:0>
3.3.1
The CALLW instruction enables computed calls by combining PCLATH and W to form the destination address.
A computed CALLW is accomplished by loading the W
register with the desired address and executing CALLW.
The PCL register is loaded with the value of W and
PCH is loaded with PCLATH.
11
PCH
3.3.3
GOTO,
CALL
OPCODE <10:0>
14
ALU result
PCLATH
COMPUTED GOTO
BRANCHING
MODIFYING PCL
DS40001723C-page 33
PIC12(L)F1571/2
3.4
Stack
3.4.1
FIGURE 3-5:
TOSH:TOSL
0x0F
STKPTR = 0x1F
0x0E
0x0D
0x0C
0x0B
0x0A
After Reset, the stack is empty. The
empty stack is initialized so the Stack
Pointer is pointing at 0x1F. If the Stack
Overflow/Underflow Reset is enabled, the
TOSH/TOSL register will return 0. If the
Stack Overflow/Underflow Reset is
disabled, the TOSH/TOSL register will
return the contents of stack address
0x0F.
0x09
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
0x00
TOSH:TOSL
DS40001723C-page 34
0x1F
0x0000
STKPTR = 0x1F
PIC12(L)F1571/2
FIGURE 3-6:
0x0F
0x0E
0x0D
0x0C
0x0B
0x0A
This figure shows the stack configuration
after the first CALL or a single interrupt.
If a RETURN instruction is executed, the
return address will be placed in the
Program Counter and the Stack Pointer
decremented to the empty state (0x1F).
0x09
0x08
0x07
0x06
0x05
0x04
0x03
0x02
0x01
TOSH:TOSL
FIGURE 3-7:
0x00
Return Address
STKPTR = 0x00
0x0F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09
0x08
0x07
TOSH:TOSL
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
STKPTR = 0x06
DS40001723C-page 35
PIC12(L)F1571/2
FIGURE 3-8:
TOSH:TOSL
3.4.2
0x0F
Return Address
0x0E
Return Address
0x0D
Return Address
0x0C
Return Address
0x0B
Return Address
0x0A
Return Address
0x09
Return Address
0x08
Return Address
0x07
Return Address
0x06
Return Address
0x05
Return Address
0x04
Return Address
0x03
Return Address
0x02
Return Address
0x01
Return Address
0x00
Return Address
STKPTR = 0x10
OVERFLOW/UNDERFLOW RESET
3.5
Indirect Addressing
DS40001723C-page 36
PIC12(L)F1571/2
FIGURE 3-9:
INDIRECT ADDRESSING
Rev. 10-000044A
7/30/2013
0x0000
0x0000
Traditional
Data Memory
0x0FFF
0x1000
0x0FFF
Reserved
0x1FFF
0x2000
Linear
Data Memory
0x29AF
0x29B0
Reserved
FSR
Address
Range
0x7FFF
0x8000
0x0000
Program
Flash Memory
0xFFFF
Note:
0x7FFF
Not all memory regions are completely implemented. Consult device memory tables for memory limits.
DS40001723C-page 37
PIC12(L)F1571/2
3.5.1
FIGURE 3-10:
Direct Addressing
4 BSR 0
Indirect Addressing
From Opcode
6
0
Bank Select
7
FSRxH
0 0 0 0
Location Select
0x00
00000
Bank Select
00001
00010
11111
Bank 0 Bank 1
Bank 2
Bank 31
0 7
FSRxL
Location Select
0x7F
DS40001723C-page 38
PIC12(L)F1571/2
3.5.2
FIGURE 3-11:
3.5.3
FIGURE 3-12:
PROGRAM FLASH
MEMORY MAP
Rev. 10-000057A
7/31/2013
7
FSRnH
0 0 1
FSRnL
Rev. 10-000058A
7/31/2013
7
1
FSRnH
Location Select
Location Select
0x2000
FSRnL
0x8000
0x0A0
Bank 1
0x0EF
Program
Flash
Memory
(low 8 bits)
0x120
Bank 2
0x16F
0x29AF
0x0000
0x020
Bank 0
0x06F
0xF20
Bank 30
0xF6F
0xFFFF
0x7FFF
DS40001723C-page 39
PIC12(L)F1571/2
4.0
DEVICE CONFIGURATION
4.1
Configuration Words
DS40001723C-page 40
PIC12(L)F1571/2
4.2
REGISTER 4-1:
CONFIGURATION WORD 1
U-1
U-1
R/P-1
R/P-1
CLKOUTEN
R/P-1
U-1
BOREN<1:0>(1)
bit 13
R/P-1
R/P-1
(2)
CP
MCLRE
bit 8
R/P-1
PWRTE
R/P-1
(1)
R/P-1
WDTE<1:0>
U-1
R/P-1
R/P-1
FOSC<1:0>
bit 7
bit 0
Legend:
R = Readable bit
P = Programmable bit
0 = Bit is cleared
1 = Bit is set
bit 13-12
Unimplemented: Read as 1
bit 11
bit 10-9
bit 8
Unimplemented: Read as 1
bit 7
bit 6
bit 5
bit 4-3
bit 2
Unimplemented: Read as 1
bit 1-0
Note 1:
2:
DS40001723C-page 41
PIC12(L)F1571/2
REGISTER 4-2:
CONFIGURATION WORD 2
R/P-1
R/P-1
R/P-1
R/P-1
R/P-1
R/P-1
LVP(1)
DEBUG(2)
LPBOREN
BORV(3)
STVREN
PLLEN
bit 13
bit 8
U-1
U-1
U-1
U-1
U-1
U-1
R/P-1
R/P-1
WRT<1:0>
bit 7
bit 0
Legend:
R = Readable bit
P = Programmable bit
0 = Bit is cleared
1 = Bit is set
bit 13
bit 12
bit 11
bit 10
bit 9
bit 8
bit 7-2
Unimplemented: Read as 1
bit 1-0
Note 1:
2:
3:
This bit cannot be programmed to 0 when programming mode is entered via LVP.
The DEBUG bit in Configuration Words is managed automatically by device development tools including
debuggers and programmers. For normal device operation, this bit should be maintained as a 1.
See VBOR parameter for specific trip point voltages.
DS40001723C-page 42
PIC12(L)F1571/2
4.3
Code Protection
4.3.1
4.4
Write Protection
4.5
User ID
4.6
DS40001723C-page 43
PIC12(L)F1571/2
4.7
REGISTER 4-3:
DEV<13:8>
bit 13
R
bit 8
R
DEV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
0 = Bit is cleared
bit 13-0
x = Bit is unknown
1 = Bit is set
Note 1:
REGISTER 4-4:
REV<13:8>
bit 13
R
bit 8
R
REV<7:0>
bit 7
bit 0
Legend:
R = Readable bit
0 = Bit is cleared
bit 13-0
1 = Bit is set
x = Bit is unknown
TABLE 4-1:
DEVICE ID VALUES
DEVICE
Device ID
Revision ID
PIC12F1571
3051h
2xxxh
PIC12LF1571
3053h
2xxxh
PIC12F1572
3050h
2xxxh
PIC12LF1572
3052h
2xxxh
DS40001723C-page 44
PIC12(L)F1571/2
5.0
OSCILLATOR MODULE
5.1
Overview
1.
2.
3.
4.
DS40001723C-page 45
PIC12(L)F1571/2
SIMPLIFIED PIC MCU CLOCK SOURCE BLOCK DIAGRAM
FIGURE 5-1:
Rev. 10-000155A
10/11/2013
FOSC<1:0>
01
Reserved
CLKIN
INTOSC
PLLEN
FOSC(1)
00
4x PLL(2)
Sleep
to CPU and
Peripherals
1x
SPLLEN
2
16 MHz
SCS<1:0>
8 MHz
4 MHz
(1)
2 MHz
MFINTOSC(1)
500 kHz
Oscillator
Prescaler
HFINTOSC
HFPLL
16 MHz
1 MHz
*500 kHz
*250 kHz
*125 kHz
62.5 kHz
*31.25 kHz
*31 kHz
Internal Oscillator
Block
4
IRCF<3:0>
31 kHz
Oscillator
600 kHz
Oscillator
LFINTOSC(1)
FRC(1)
Note 1:
2:
3:
DS40001723C-page 46
PIC12(L)F1571/2
5.2
5.2.1
FIGURE 5-2:
Clock from
Ext. System
FOSC/4 or I/O(1)
Note 1:
5.2.1.1
EC Mode
DS40001723C-page 47
PIC12(L)F1571/2
5.2.2
The device may be configured to use the internal oscillator block as the system clock by performing one of the
following actions:
Program the FOSC<1:0> bits in Configuration
Words to select the INTOSC clock source, which
will be used as the default system clock upon a
device Reset.
Write the SCS<1:0> bits in the OSCCON register
to switch the system clock source to the internal
oscillator during run-time. See Section5.3 Clock
Switchingfor more information.
In INTOSC mode, CLKIN is available for general
purpose I/O. CLKOUT is available for general purpose
I/O or CLKOUT.
The function of the OSC2/CLKOUT pin is determined
by the CLKOUTEN bit in Configuration Words.
The internal oscillator block has two independent
oscillators and a dedicated Phase-Lock Loop, HFPLL
that can produce one of three internal system clock
sources.
1.
2.
3.
5.2.2.1
HFINTOSC
5.2.2.2
MFINTOSC
The
Medium-Frequency
Internal
Oscillator
(MFINTOSC) is a factory calibrated 500 kHz internal
clock source. The frequency of the MFINTOSC can be
altered via software using the OSCTUNE register
(Register 5-3).
The output of the MFINTOSC connects to a postscaler
and multiplexer (see Figure 5-1). One of nine
frequencies derived from the MFINTOSC can be
selected via software using the IRCF<3:0> bits of the
OSCCON register. See Section5.2.2.8 Internal
Oscillator Clock Switch Timing for more information.
The MFINTOSC is enabled by:
Configure the IRCF<3:0> bits of the OSCCON
register for the desired HF frequency, and
FOSC<1:0> = 00, or
Set the System Clock Source (SCS) bits of the
OSCCON register to 1x
The Medium-Frequency Internal Oscillator Ready bit
(MFIOFR) of the OSCSTAT register indicates when the
MFINTOSC is running.
DS40001723C-page 48
PIC12(L)F1571/2
5.2.2.3
5.2.2.4
LFINTOSC
DS40001723C-page 49
PIC12(L)F1571/2
5.2.2.5
FRC
5.2.2.6
Note:
DS40001723C-page 50
PIC12(L)F1571/2
5.2.2.7
5.2.2.8
5.
6.
7.
DS40001723C-page 51
PIC12(L)F1571/2
FIGURE 5-3:
HFINTOSC/
MFINTOSC
HFINTOSC/
MFINTOSC
Oscillator Delay(1)
2-cycle Sync
Running
2-cycle Sync
Running
LFINTOSC
0
IRCF <3:0>
System Clock
HFINTOSC/
MFINTOSC
HFINTOSC/
MFINTOSC
LFINTOSC
IRCF <3:0>
System Clock
LFINTOSC
HFINTOSC/MFINTOSC
LFINTOSC
Oscillator Delay(1) 2-cycle Sync
Running
HFINTOSC/
MFINTOSC
IRCF <3:0>
=0
System Clock
Note 1:
DS40001723C-page 52
PIC12(L)F1571/2
5.3
Clock Switching
5.3.1
TABLE 5-1:
Switch From
Switch To
(1)
Frequency
Oscillator Delay
Sleep/POR
LFINTOSC
MFINTOSC(1)
HFINTOSC(1)
31 kHz
31.25 kHz-500 kHz
31.25 kHz-16 MHz
Sleep/POR
EC(1)
DC 32 MHz
2 cycles
LFINTOSC
(1)
EC
DC 32 MHz
1 cycle of each
MFINTOSC(1)
HFINTOSC(1)
2 s (approx.)
LFINTOSC(1)
31 kHz
1 cycle of each
PLL inactive
PLL active
16-32 MHz
2 ms (approx.)
Note 1:
PLL inactive.
DS40001723C-page 53
PIC12(L)F1571/2
5.4
REGISTER 5-1:
R/W-0/0
SPLLEN
R/W-1/1
R/W-1/1
R/W-1/1
IRCF<3:0>
U-0
R/W-0/0
R/W-0/0
SCS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-3
bit 2
Unimplemented: Read as 0
bit 1-0
Note 1:
DS40001723C-page 54
PIC12(L)F1571/2
REGISTER 5-2:
U-0
R-0/q
R-q/q
R-0/q
R-0/q
R-q/q
R-0/q
R-0/q
PLLR
OSTS
HFIOFR
HFIOFL
MFIOFR
LFIOFR
HFIOFS
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
q = Conditional
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
REGISTER 5-3:
U-0
U-0
R/W-0/0
bit 7
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TUN<5:0>
bit 0
Legend:
DS40001723C-page 55
PIC12(L)F1571/2
REGISTER 5-3:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
111111 =
000000 = Oscillator module is running at the factory-calibrated frequency.
000001 =
011110 =
011111 = Maximum frequency
TABLE 5-2:
Name
Bit 7
Bit 6
Bit 5
OSTS
OSCCON
SPLLEN
OSCSTAT
PLLR
OSCTUNE
T1CON
TMR1CS<1:0>
Bit 4
Bit 3
Bit 2
Bit 1
HFIOFL
MFIOFR
IRCF<3:0>
HFIOFR
Bit 0
SCS<1:0>
LFIOFR
54
HFIOFS
TUN<5:0>
T1CKPS<1:0>
T1OSCEN
Register
on Page
55
55
T1SYNC
TMR1ON
154
Legend: = unimplemented location, read as 0. Shaded cells are not used by clock sources.
TABLE 5-3:
Name
CONFIG1
Legend:
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
CLKOUTEN
13:8
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
Bit 8/0
FOSC<1:0>
Register
on Page
41
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
DS40001723C-page 56
PIC12(L)F1571/2
6.0
RESETS
FIGURE 6-1:
MCLRE
VPP/MCLR
Sleep
WDT
Time-out
Device
Reset
Power-on
Reset
VDD
BOR
Active(1)
Brown-out
Reset
LPBOR
Reset
Note 1:
LFINTOSC
Power-up
Timer
PWRTE
DS40001723C-page 57
PIC12(L)F1571/2
6.1
6.2
The POR circuit holds the device in Reset until VDD has
reached an acceptable level for minimum operation.
Slow rising VDD, fast operating speeds or analog
performance may require greater than minimum VDD.
The PWRT, BOR or MCLR features can be used to
extend the start-up period until all device operation
conditions have been met.
6.1.1
TABLE 6-1:
BOREN<1:0>
SBOREN
Device Mode
BOR Mode
11
Active
Awake
Active
10
Sleep
Disabled
Active
Disabled
Disabled
Begins immediately
(BORRDY = x)
0
X
01
00
Note 1: In these specific cases, release of POR and wake-up from Sleep, there is no delay in start-up. The BOR
ready flag, (BORRDY = 1), will be set before the CPU is ready to execute instructions because the BOR
circuit is forced on by the BOREN<1:0> bits.
6.2.1
BOR IS ALWAYS ON
When the BOREN bits of Configuration Words are programmed to 11, the BOR is always on. The device
start-up will be delayed until the BOR is ready and VDD
is higher than the BOR threshold.
BOR protection is active during Sleep. The BOR does
not delay wake-up from Sleep.
6.2.2
When the BOREN bits of Configuration Words are programmed to 10, the BOR is on, except in Sleep. The
device start-up will be delayed until the BOR is ready
and VDD is higher than the BOR threshold.
DS40001723C-page 58
6.2.3
PIC12(L)F1571/2
FIGURE 6-2:
BROWN-OUT SITUATIONS
VDD
VBOR
Internal
Reset
TPWRT(1)
VDD
VBOR
Internal
Reset
< TPWRT
TPWRT(1)
VDD
VBOR
Internal
Reset
Note 1:
6.3
TPWRT(1)
REGISTER 6-1:
R/W-1/u
R/W-0/u
U-0
U-0
U-0
U-0
U-0
R-q/u
SBOREN
BORFS
BORRDY
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-1
Unimplemented: Read as 0
bit 0
Note 1:
DS40001723C-page 59
PIC12(L)F1571/2
6.4
6.4.1
ENABLING LPBOR
6.5
MCLR CONFIGURATION
MCLRE
LVP
MCLR
Disabled
Enabled
Enabled
6.5.1
MCLR ENABLED
6.5.2
6.7
RESET Instruction
6.8
6.9
MCLR
TABLE 6-2:
6.6
MCLR DISABLED
DS40001723C-page 60
6.10
Power-Up Timer
6.11
Start-up Sequence
The total time-out will vary based on oscillator configuration and Power-up Timer configuration. See
Section5.0 Oscillator Module for more information.
The Power-up Timer runs independently of MCLR
Reset. If MCLR is kept low long enough, the Power-up
Timer will expire. Upon bringing MCLR high, the device
will begin execution after 10 FOSC cycles (see
Figure 6-3). This is useful for testing purposes or to
synchronize more than one device operating in parallel.
PIC12(L)F1571/2
FIGURE 6-3:
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
Internal RESET
Int. Oscillator
FOSC
Begin Execution
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
Internal RESET
Ext. Clock (EC)
FOSC
Begin Execution
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
Internal RESET
TOST
TOST
code
execution (1)
code
execution (1)
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
Internal RESET
TOST
TOST
Code execution begins 10 FOSC cycles after the FOSC clock is released.
DS40001723C-page 61
PIC12(L)F1571/2
6.12
TABLE 6-3:
RMCLR
RI
POR
BOR
TO
PD
Condition
Power-on Reset
Brown-out Reset
WDT Reset
TABLE 6-4:
STATUS
Register
PCON
Register
Power-on Reset
0000h
---1 1000
00-- 110x
0000h
---u uuuu
uu-- 0uuu
0000h
---1 0uuu
uu-- 0uuu
WDT Reset
0000h
---0 uuuu
uu-- uuuu
PC + 1
---0 0uuu
uu-- uuuu
Brown-out Reset
0000h
---1 1uuu
00-- 11u0
---1 0uuu
uu-- uuuu
Condition
PC + 1
(1)
0000h
---u uuuu
uu-- u0uu
0000h
---u uuuu
1u-- uuuu
0000h
---u uuuu
u1-- uuuu
DS40001723C-page 62
PIC12(L)F1571/2
6.13
6.14
REGISTER 6-2:
R/W/HS-0/q
R/W/HS-0/q
U-0
STKOVF
STKUNF
R/W/HC-1/q R/W/HC-1/q
RWDT
R/W/HC-1/q
R/W/HC-q/u
R/W/HC-q/u
RI
POR
BOR
RMCLR
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001723C-page 63
PIC12(L)F1571/2
TABLE 6-5:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
BORCON
SBOREN
BORFS
BORRDY
59
PCON
STKOVF
STKUNF
RWDT
RMCLR
RI
POR
BOR
63
STATUS
TO
PD
DC
WDTCON
WDTPS<4:0>
17
SWDTEN
83
Legend: = unimplemented bit, reads as 0. Shaded cells are not used by Resets.
Note 1: Other (non Power-up) Resets include MCLR Reset and Watchdog Timer Reset during normal operation.
TABLE 6-6:
Name
CONFIG1
CONFIG2
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
CLKOUTEN
7:0
CP
13:8
LVP
DEBUG
LPBOR
BORV
7:0
MCLRE PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
Bit 8/0
FOSC<1:0>
STVREN
PLLEN
WRT<1:0>
Register
on Page
41
42
Legend: = unimplemented location, read as 0. Shaded cells are not used by Resets.
DS40001723C-page 64
PIC12(L)F1571/2
7.0
INTERRUPTS
Operation
Interrupt Latency
Interrupts During Sleep
INT Pin
Automatic Context Saving
FIGURE 7-1:
INTERRUPT LOGIC
Rev. 10-000010A
1/13/2014
TMR0IF
TMR0IE
Peripheral Interrupts
(TMR1IF) PIR1<0>
(TMR1IE) PIE1<0>
Wake-up
(If in Sleep mode)
INTF
INTE
IOCIF
IOCIE
Interrupt
to CPU
PEIE
PIRn<7>
PIEn<7>
GIE
DS40001723C-page 65
PIC12(L)F1571/2
7.1
Operation
7.2
Interrupt Latency
DS40001723C-page 66
PIC12(L)F1571/2
FIGURE 7-2:
INTERRUPT LATENCY
Fosc
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CLKR
Interrupt Sampled
during Q1
Interrupt
GIE
PC
Execute
PC-1
PC
1-Cycle Instruction at PC
PC+1
0004h
0005h
NOP
NOP
Inst(0004h)
PC+1/FSR
ADDR
New PC/
PC+1
0004h
0005h
Inst(PC)
NOP
NOP
Inst(0004h)
FSR ADDR
PC+1
PC+2
0004h
0005h
INST(PC)
NOP
NOP
NOP
Inst(0004h)
Inst(0005h)
FSR ADDR
PC+1
0004h
0005h
INST(PC)
NOP
NOP
Inst(0004h)
Inst(PC)
Interrupt
GIE
PC
Execute
PC-1
PC
2-Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3-Cycle Instruction at PC
Interrupt
GIE
PC
Execute
PC-1
PC
3-Cycle Instruction at PC
PC+2
NOP
NOP
DS40001723C-page 67
PIC12(L)F1571/2
FIGURE 7-3:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
FOSC
CLKOUT
(3)
INT pin
(1)
(1)
INTF
(4)
GIE
INSTRUCTION FLOW
PC
Instruction
Fetched
Instruction
Executed
Note 1:
PC
Inst (PC)
Inst (PC 1)
PC + 1
Inst (PC + 1)
Inst (PC)
PC + 1
Forced NOP
0004h
0005h
Inst (0004h)
Inst (0005h)
Forced NOP
Inst (0004h)
2:
Asynchronous interrupt latency = 3-5 TCY. Synchronous latency = 3-4 TCY, where TCY = instruction cycle time.
Latency is the same whether Inst (PC) is a single cycle or a 2-cycle instruction.
3:
For minimum width of INT pulse, refer to AC specifications in Section26.0 Electrical Specifications.
4:
DS40001723C-page 68
PIC12(L)F1571/2
7.3
7.4
INT Pin
7.5
W register
STATUS register (except for TO and PD)
BSR register
FSR registers
PCLATH register
Upon exiting the Interrupt Service Routine, these registers are automatically restored. Any modifications to
these registers during the ISR will be lost. If modifications to any of these registers are desired, the corresponding shadow register should be modified and the
value will be restored when exiting the ISR. The
shadow registers are available in Bank 31 and are
readable and writable. Depending on the users application, other registers may also need to be saved.
DS40001723C-page 69
PIC12(L)F1571/2
7.6
REGISTER 7-1:
R/W-0/0
(1)
GIE
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
(2)
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF(3)
PEIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding
enable bit or the Global Interrupt Enable bit, GIE of the INTCON register. User software should ensure the
appropriate interrupt flag bits are clear prior to enabling an interrupt.
2: Bit PEIE of the INTCON register must be set to enable any peripheral interrupt.
3: The IOCIF Flag bit is read-only and cleared when all the interrupt-on-change flags in the IOCxF registers
have been cleared by software.
DS40001723C-page 70
PIC12(L)F1571/2
REGISTER 7-2:
R/W-0/0
TMR1GIE
ADIE
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
(1)
TXIE(1)
TMR2IE
TMR1IE
RCIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1
bit 0
Note:
DS40001723C-page 71
PIC12(L)F1571/2
REGISTER 7-3:
U-0
U-0
R/W-0/0
U-0
U-0
U-0
U-0
U-0
C1IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5
bit 4-0
Unimplemented: Read as 0
Note:
DS40001723C-page 72
PIC12(L)F1571/2
REGISTER 7-4:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
PWM3IE
PWM2IE
PWM1IE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3-0
Unimplemented: Read as 0
Note:
DS40001723C-page 73
PIC12(L)F1571/2
REGISTER 7-5:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
R/W-0/0
TMR1GIF
ADIF
RCIF(1)
TXIF(1)
TMR2IF
TMR1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1
bit 0
Note:
DS40001723C-page 74
PIC12(L)F1571/2
REGISTER 7-6:
U-0
U-0
R/W-0/0
U-0
U-0
U-0
U-0
U-0
C1IF
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5
bit 4-0
Unimplemented: Read as 0
Note:
DS40001723C-page 75
PIC12(L)F1571/2
REGISTER 7-7:
U-0
PWM3IF
R-0/0
(1)
R-0/0
(1)
PWM2IF
PWM1IF
(1)
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6
bit 5
bit 4
bit 3-0
Unimplemented: Read as 0
Note 1:
2:
These bits are read-only. They must be cleared by addressing the Flag registers inside the module.
Interrupt flag bits are set when an interrupt condition occurs, regardless of the state of its corresponding
enable bit or the Global Enable bit, GIE of the INTCON register. User software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt.
DS40001723C-page 76
PIC12(L)F1571/2
TABLE 7-1:
Name
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
OPTION_REG WPUEN
PIE1
TMR1GIE
PIE2
PIE3
PSA
ADIE
RCIE(1)
TXIE(1)
TMR2IE
TMR1IE
71
C1IE
72
PS<2:0>
145
73
TXIF(1)
PIR1
TMR1GIF
ADIF
TMR2IF
TMR1IF
74
PIR2
C1IF
75
PIR3
PWM3IF
PWM2IF
PWM1IF
76
RCIF
Legend: = unimplemented location, read as 0. Shaded cells are not used by interrupts.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 77
PIC12(L)F1571/2
8.0
2.
3.
4.
5.
6.
7.
8.
9.
8.1
8.1.1
DS40001723C-page 78
PIC12(L)F1571/2
FIGURE 8-1:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CLKIN(1)
T1OSC(3)
CLKOUT(2)
Interrupt flag
GIE bit
(INTCON reg.)
Instruction Flow
PC
Instruction
Fetched
Instruction
Executed
Note
8.2
1:
2:
3:
4:
Processor in
Sleep
PC
Inst(PC) = Sleep
Inst(PC - 1)
PC + 1
PC + 2
PC + 2
Inst(PC + 1)
Inst(PC + 2)
Sleep
Inst(PC + 1)
PC + 2
Forced NOP
0004h
0005h
Inst(0004h)
Inst(0005h)
Forced NOP
Inst(0004h)
8.2.2
8.2.1
DS40001723C-page 79
PIC12(L)F1571/2
8.3
REGISTER 8-1:
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0/0
R/W-1/1
VREGPM
Reserved
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
Unimplemented: Read as 0
bit 1
bit 0
Note 1:
TABLE 8-1:
Name
Bit 7
Bit 6
Bit 5
INTCON
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
112
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
112
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
112
(1)
TXIE(1)
PIE1
TMR1GIE
ADIE
TMR2IE
TMR1IE
71
PIE2
C1IE
72
PIE3
PWM3IE
PWM2IE
PWM1IE
73
TXIF(1)
TMR2IF
TMR1IF
74
ADIF
RCIE
(1)
PIR1
TMR1GIF
RCIF
PIR2
C1IF
75
PIR3
PWM3IF
PWM2IF
PWM1IF
76
STATUS
TO
PD
DC
17
WDTCON
SWDTEN
83
WDTPS<4:0>
Legend: = unimplemented, read as 0. Shaded cells are not used in Power-Down mode.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 80
PIC12(L)F1571/2
9.0
FIGURE 9-1:
WDTE<1:0> = 01
SWDTEN
WDTE<1:0> = 11
LFINTOSC
23-bit Programmable
Prescaler WDT
WDT
Time-out
WDTE<1:0> = 10
Sleep
WDTPS<4:0>
DS40001723C-page 81
PIC12(L)F1571/2
9.1
9.3
9.2
9.2.1
WDT IS ALWAYS ON
9.2.2
TABLE 9-1:
WDTE<1:0>
SWDTEN
Device
Mode
WDT
Mode
11
Active
Awake
Active
10
Sleep
Disabled
Active
Disabled
Disabled
01
00
TABLE 9-2:
Any Reset
CLRWDT instruction is executed
Device enters Sleep
Device wakes up from Sleep
Oscillator fail
WDT is disabled
Oscillator Start-up Timer (OST) is running
9.2.3
9.4
Time-Out Period
9.5
WDT
WDTE<1:0> = 00
WDTE<1:0> = 01 and SWDTEN = 0
WDTE<1:0> = 10 and enter Sleep
CLRWDT Command
Cleared
DS40001723C-page 82
PIC12(L)F1571/2
9.6
REGISTER 9-1:
U-0
U-0
R/W-0/0
R/W-1/1
R/W-0/0
R/W-1/1
R/W-1/1
WDTPS<4:0>
bit 7
R/W-0/0
SWDTEN
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-1
bit 0
Note 1:
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
=
DS40001723C-page 83
PIC12(L)F1571/2
TABLE 9-3:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 1
Bit 0
Register
on Page
OSCCON
SPLLEN
PCON
STKOVF
STKUNF
RWDT
RMCLR
RI
POR
BOR
STATUS
TO
PD
DC
17
WDTCON
SWDTEN
83
Legend:
CONFIG1
Legend:
SCS<1:0>
WDTPS<4:0>
54
63
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by Watchdog Timer.
TABLE 9-4:
Name
IRCF<3:0>
Bit 2
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
CLKOUTEN
13:8
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
Bit 8/0
FOSC<1:0>
Register
on Page
41
= unimplemented location, read as 0. Shaded cells are not used by Watchdog Timer.
DS40001723C-page 84
PIC12(L)F1571/2
10.0
PMCON1
PMCON2
PMDATL
PMDATH
PMADRL
PMADRH
10.1
10.1.1
10.2
DS40001723C-page 85
PIC12(L)F1571/2
See Table 10-1 for Erase Row size and the number of
write latches for Flash program memory.
TABLE 10-1:
FLASH MEMORY
ORGANIZATION BY DEVICE
Device
PIC12(L)F1571
PIC12(L)F1572
10.2.1
Row Erase
(words)
Write
Latches
(words)
16
16
Write
the
desired
address
to
the
PMADRH:PMADRL register pair.
Clear the CFGS bit of the PMCON1 register.
Then, set control bit RD of the PMCON1 register.
FIGURE 10-1:
FLASH PROGRAM
MEMORY READ
FLOWCHART
Rev. 10-000046A
7/30/2013
Start
Read Operation
Select
Program or Configuration Memory
(CFGS)
Select
Word Address
(PMADRH:PMADRL)
End
Read Operation
DS40001723C-page 86
PIC12(L)F1571/2
FIGURE 10-2:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
PC
Flash ADDR
Flash Data
PC + 1
INSTR (PC)
INSTR(PC - 1)
executed here
PMADRH,PMADRL
INSTR (PC + 1)
BSF PMCON1,RD
executed here
PC
+3
PC+3
PMDATH,PMDATL
INSTR(PC + 1)
instruction ignored
Forced NOP
executed here
PC + 5
PC + 4
INSTR (PC + 3)
INSTR(PC + 2)
instruction ignored
Forced NOP
executed here
INSTR (PC + 4)
INSTR(PC + 3)
executed here
INSTR(PC + 4)
executed here
RD bit
PMDATH
PMDATL
Register
EXAMPLE 10-1:
PMADRL
PROG_ADDR_LO
PMADRL
PROG_ADDR_HI
PMADRH
BCF
BSF
NOP
NOP
PMCON1,CFGS
PMCON1,RD
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS40001723C-page 87
PIC12(L)F1571/2
10.2.2
FIGURE 10-3:
FLASH PROGRAM
MEMORY UNLOCK
SEQUENCE FLOWCHART
Rev. 10-000047A
7/30/2013
Start
Unlock Sequence
Write 0x55 to
PMCON2
Write 0xAA to
PMCON2
DS40001723C-page 88
Initiate
Write or Erase operation
(WR = 1)
End
Unlock Sequence
PIC12(L)F1571/2
10.2.3
FIGURE 10-4:
FLASH PROGRAM
MEMORY ERASE
FLOWCHART
Rev. 10-000048A
7/30/2013
Start
Erase Operation
Disable Interrupts
(GIE = 0)
Select
Program or Configuration Memory
(CFGS)
Unlock Sequence
(See Note 1)
Re-enable Interrupts
(GIE = 1)
End
Erase Operation
DS40001723C-page 89
PIC12(L)F1571/2
EXAMPLE 10-2:
Required
Sequence
BCF
BANKSEL
MOVF
MOVWF
MOVF
MOVWF
BCF
BSF
BSF
INTCON,GIE
PMADRL
ADDRL,W
PMADRL
ADDRH,W
PMADRH
PMCON1,CFGS
PMCON1,FREE
PMCON1,WREN
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
BCF
BSF
DS40001723C-page 90
PMCON1,WREN
INTCON,GIE
; Disable writes
; Enable interrupts
PIC12(L)F1571/2
10.2.4
1.
2.
3.
DS40001723C-page 91
0 7
PMADRH
-
rA
r9
r8
r7
r6
PMADRL
r5
r4
r3
r2
r1
r0
c3
c2
c1
5
-
PMDATH
PMDATL
c0
Rev. 10-000004B
7/25/2013
0
8
14
11
14
Write Latch #0
00h
14
14
14
Write Latch #1
01h
PMADRL<3:0>
14
CFGS = 0
PMADRH<6:0>:
PMADRL<7:4>
Row
Address
Decode
14
14
14
Row
Addr
Addr
Addr
Addr
000h
0000h
0001h
000Eh
000Fh
001h
0010h
0011h
001Eh
001Fh
002h
0020h
0021h
002Eh
002Fh
7FEh
7FE0h
7FE1h
7FEEh
7FEFh
7FFh
7FF0h
7FF1h
7FFEh
7FFFh
800h
CFGS = 1
8000h - 8003h
8004h 8005h
8006h
8007h 8008h
8009h - 801Fh
USER ID 0 - 3
reserved
DEVICE ID
Dev / Rev
Configuration
Words
reserved
Configuration Memory
PIC12(L)F1571/2
DS40001723C-page 92
FIGURE 10-5:
PIC12(L)F1571/2
FIGURE 10-6:
Start
Write Operation
Disable Interrupts
(GIE = 0)
Select
Program or Config. Memory
(CFGS)
Enable Write/Erase
Operation (WREN = 1)
Last word to
write ?
Yes
No
Unlock Sequence
(Figure10-3
x-x)
Figure
Increment Address
(PMADRH:PMADRL++)
Unlock Sequence
(Figure10-3
x-x)
Figure
Disable
Write/Erase Operation
(WREN = 0)
Re-enable Interrupts
(GIE = 1)
End
Write Operation
DS40001723C-page 93
PIC12(L)F1571/2
EXAMPLE 10-3:
;
;
;
;
;
;
;
INTCON,GIE
PMADRH
ADDRH,W
PMADRH
ADDRL,W
PMADRL
LOW DATA_ADDR
FSR0L
HIGH DATA_ADDR
FSR0H
PMCON1,CFGS
PMCON1,WREN
PMCON1,LWLO
;
;
;
;
;
;
;
;
;
;
;
;
;
MOVIW
MOVWF
MOVIW
MOVWF
FSR0++
PMDATL
FSR0++
PMDATH
MOVF
XORLW
ANDLW
BTFSC
GOTO
PMADRL,W
0x1F
0x1F
STATUS,Z
START_WRITE
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
;
;
;
;
;
;
;
;
PMADRL,F
LOOP
PMCON1,LWLO
55h
PMCON2
0AAh
PMCON2
PMCON1,WR
;
;
;
;
;
;
;
;
;
;
;
;
;
Required
Sequence
LOOP
NOP
INCF
GOTO
Required
Sequence
START_WRITE
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
NOP
NOP
BCF
BSF
DS40001723C-page 94
PMCON1,WREN
INTCON,GIE
PIC12(L)F1571/2
10.3
FIGURE 10-7:
FLASH PROGRAM
MEMORY MODIFY
FLOWCHART
Rev. 10-000050A
7/30/2013
Start
Modify Operation
Read Operation
(See Note 1)
Modify Image
The words to be modified are
changed in the RAM image
Erase Operation
(See Note 2)
Write Operation
Use RAM image
(See Note 3)
End
Modify Operation
DS40001723C-page 95
PIC12(L)F1571/2
10.4
TABLE 10-2:
Address
Function
8000h-8003h
8006h/8005h
8007h-8008h
Read Access
Write Access
Yes
Yes
Yes
Yes
No
No
User IDs
Device ID/Revision ID
Configuration Words 1 and 2
EXAMPLE 10-4:
* This code block will read 1 word of program memory at the memory address:
*
PROG_ADDR_LO (must be 00h-08h) data will be returned in the variables;
*
PROG_DATA_HI, PROG_DATA_LO
BANKSEL
MOVLW
MOVWF
CLRF
PMADRL
PROG_ADDR_LO
PMADRL
PMADRH
BSF
BCF
BSF
NOP
NOP
BSF
PMCON1,CFGS
INTCON,GIE
PMCON1,RD
INTCON,GIE
;
;
;
;
;
;
MOVF
MOVWF
MOVF
MOVWF
PMDATL,W
PROG_DATA_LO
PMDATH,W
PROG_DATA_HI
;
;
;
;
DS40001723C-page 96
PIC12(L)F1571/2
10.5
Write Verify
FIGURE 10-8:
FLASH PROGRAM
MEMORY VERIFY
FLOWCHART
Rev. 10-000051A
7/30/2013
Start
Verify Operation
Read Operation
(See Note 1)
PMDAT =
RAM image ?
No
Yes
Fail
Verify Operation
No
Last word ?
Yes
End
Verify Operation
DS40001723C-page 97
PIC12(L)F1571/2
10.6
REGISTER 10-1:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDAT<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 10-2:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PMDAT<13:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 10-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADR<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
PMADR<7:0>: Specifies the Least Significant bits for program memory address
REGISTER 10-4:
U-1
R/W-0/0
(1)
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
PMADR<14:8>
bit 0
bit 7
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 1
bit 6-0
PMADR<14:8>: Specifies the Most Significant bits for program memory address
Note
1:
Unimplemented, read as 1.
DS40001723C-page 98
PIC12(L)F1571/2
REGISTER 10-5:
U-1
(1)
CFGS
R/W-0/0
LWLO
R/W/HC-0/0
R/W/HC-x/q(2)
R/W-0/0
R/S/HC-0/0
R/S/HC-0/0
FREE
WRERR
WREN
WR
RD
(3)
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 1
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
2:
3:
DS40001723C-page 99
PIC12(L)F1571/2
REGISTER 10-6:
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
W-0/0
bit 0
Legend:
R = Readable bit
W = Writable bit
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
TABLE 10-3:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register on
Page
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
CFGS
LWLO
FREE
WRERR
WREN
WR
RD
(1)
PMCON1
PMCON2
PMADRL
Legend:
98
PMDATH<5:0>
98
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
Unimplemented, read as 1.
TABLE 10-4:
CONFIG2
98
PMDATL<7:0>
PMDATH
CONFIG1
98
PMADRH<6:0>
PMDATL
Name
100
PMADRL<7:0>
(1)
PMADRH
Legend:
Note 1:
99
Bits
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
CLKOUTEN
Bit 10/2
13:8
7:0
CP
MCLRE
PWRTE
13:8
LVP
DEBUG
LPBOR
BORV
7:0
WDTE<1:0>
Bit 9/1
Bit 8/0
BOREN<1:0>
FOSC<1:0>
STVREN
PLLEN
WRT<1:0>
Register
on Page
41
42
= unimplemented location, read as 0. Shaded cells are not used by Flash program memory.
DS40001723C-page 100
PIC12(L)F1571/2
11.0
I/O PORTS
FIGURE 11-1:
Read LATx
TRISx
D
Write LATx
Write PORTx
VDD
CK
Data Register
Data bus
I/O pin
Read PORTx
Device
PORTA
TABLE 11-1:
Rev. 10-000052A
7/30/2013
PIC12(L)F1571
PIC12(L)F1572
To digital peripherals
ANSELx
To analog peripherals
VSS
DS40001723C-page 101
PIC12(L)F1571/2
11.1
RX/DT
TX/CK
CWGOUTA
CWGOUTB
PWM2
PWM1
11.2
REGISTER 11-1:
R/W-0/0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
RXDTSEL
CWGASEL
CWGBSEL
T1GSEL
TXCKSEL
P2SEL
P1SEL
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 24
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
DS40001723C-page 102
PIC12(L)F1571/2
11.3
11.3.1
PORTA Registers
DATA REGISTER
11.3.2
DIRECTION CONTROL
11.3.3
OPEN-DRAIN CONTROL
11.3.4
11.3.5
11.3.6
ANALOG CONTROL
EXAMPLE 11-1:
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
CLRF
BANKSEL
MOVLW
MOVWF
INITIALIZING PORTA
PORTA
PORTA
LATA
LATA
ANSELA
ANSELA
TRISA
B'00111000'
TRISA
;
;Init PORTA
;Data Latch
;
;
;digital I/O
;
;Set RA<5:3> as inputs
;and set RA<2:0> as
;outputs
DS40001723C-page 103
PIC12(L)F1571/2
11.3.7
TABLE 11-2:
Pin Name
RA0
ICSPDAT
CWG1B(3)
DAC1OUT
TX(2,3)
PWM2(3)
RA0
RA1
PWM1(3)
RA1
RA2
CWG1A
CWG1FLT
C1OUT
PWM3
RA2
RA3
None
RA4
CLKOUT
CWG1B
TX(2)
PWM2
RA4
RA5
CWG1A
PWM1
RA5
Note 1:
2:
3:
DS40001723C-page 104
PIC12(L)F1571/2
11.4
REGISTER 11-2:
U-0
U-0
R/W-x/x
R/W-x/x
R-x/x
R/W-x/x
R/W-x/x
R/W-x/x
RA5
RA4
RA3
RA2
RA1
RA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
Note 1:
Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
REGISTER 11-3:
U-0
R/W-1/1
TRISA5
R/W-1/1
U-1
R/W-1/1
R/W-1/1
R/W-1/1
TRISA4
(1)
TRISA2
TRISA1
TRISA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 1
bit 2-0
Note 1:
Unimplemented, read as 1.
DS40001723C-page 105
PIC12(L)F1571/2
REGISTER 11-4:
U-0
U-0
R/W-x/u
R/W-x/u
U-0
R/W-x/u
R/W-x/u
R/W-x/u
LATA5
LATA4
LATA2
LATA1
LATA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
Note 1:
Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
REGISTER 11-5:
U-0
U-0
U-0
R/W-1/1
U-0
R/W-1/1
R/W-1/1
R/W-1/1
ANSA4
ANSA2
ANSA1
ANSA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4
ANSA4: Analog Select between Analog or Digital Function on pins RA4, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
bit 3
Unimplemented: Read as 0
bit 2-0
ANSA<2:0>: Analog Select between Analog or Digital Function on pins RA<2:0>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
Note 1:
When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
DS40001723C-page 106
PIC12(L)F1571/2
REGISTER 11-6:
U-0
U-0
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
Note 1:
2:
3:
Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
The weak pull-up device is automatically disabled if the pin is configured as an output.
For the WPUA3 bit, when MCLRE = 1, weak pull-up is internally enabled, but not reported here.
REGISTER 11-7:
U-0
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
ODA5
ODA4
ODA2
ODA1
ODA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
DS40001723C-page 107
PIC12(L)F1571/2
REGISTER 11-8:
U-0
U-0
R/W-1/1
R/W-1/1
U-0
R/W-1/1
R/W-1/1
R/W-1/1
SLRA5
SLRA4
SLRA2
SLRA1
SLRA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
REGISTER 11-9:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS40001723C-page 108
PIC12(L)F1571/2
TABLE 11-3:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
106
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
APFCON
RXDTSEL
CWGASEL
CWGBSEL
T1GSEL
TXCKSEL
P2SEL
P1SEL
102
INLVLA5
INLVLA4
INLVLA3
INLVLA2
INLVLA1
INLVLA0
108
INLVLA
LATA
LATA5
LATA4
LATA2
LATA1
LATA0
106
ODCONA
ODA5
ODA4
ODA2
ODA1
ODA0
107
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
PORTA
OPTION_REG
RA5
RA4
RA3
RA2
RA1
RA0
105
SLRCONA
SLRA5
SLRA4
SLRA2
SLRA1
SLRA0
108
TRISA
TRISA5
TRISA4
WPUA
WPUA5
WPUA4
Legend:
Note 1:
CONFIG1
Legend:
WPUA3
145
TRISA2
TRISA1
TRISA0
105
WPUA2
WPUA1
WPUA0
107
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by PORTA.
Unimplemented, read as 1.
TABLE 11-4:
Name
(1)
PS<2:0>
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
FCMEN
IESO
CLKOUTEN
7:0
CP
MCLRE
PWRTE
Bit 10/2
WDTE<1:0>
Bit 9/1
Bit 8/0
BOREN<1:0>
FOSC<2:0>
Register
on Page
41
DS40001723C-page 109
PIC12(L)F1571/2
12.0
INTERRUPT-ON-CHANGE
12.1
12.3
Interrupt Flags
12.4
12.2
EXAMPLE 12-1:
MOVLW
XORWF
ANDWF
12.5
CLEARING INTERRUPT
FLAGS
(PORTA EXAMPLE)
0xff
IOCAF, W
IOCAF, F
Operation in Sleep
DS40001723C-page 110
PIC12(L)F1571/2
FIGURE 12-1:
IOCANx
Q4Q1
edge
detect
RAx
IOCAPx
data bus =
0 or 1
to data bus
IOCAFx
write IOCAFx
IOCIE
Q2
IOC interrupt
to CPU core
from all other
IOCnFx individual
pin detectors
FOSC
Q1
Q1
Q1
Q3
Q3
Q4
Q4Q1
Q2
Q2
Q2
Q3
Q4
Q4Q1
Q4
Q4Q1
Q4Q1
DS40001723C-page 111
PIC12(L)F1571/2
12.6
REGISTER 12-1:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 12-2:
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 12-3:
U-0
U-0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS40001723C-page 112
PIC12(L)F1571/2
TABLE 12-1:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
106
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
IOCAF
IOCAF5
IOCAF4
IOCAF3
IOCAF2
IOCAF1
IOCAF0
112
IOCAN
IOCAN5
IOCAN4
IOCAN3
IOCAN2
IOCAN1
IOCAN0
112
IOCAP
IOCAP5
IOCAP4
IOCAP3
IOCAP2
IOCAP1
IOCAP0
112
TRISA
TRISA5
TRISA4
(1)
TRISA2
TRISA1
TRISA0
105
Legend:
Note 1:
DS40001723C-page 113
PIC12(L)F1571/2
13.0
13.1
13.2
FIGURE 13-1:
ADFVR<1:0>
CDAFVR<1:0>
FVREN
Note 1
2
1x
2x
4x
FVR_buffer1
(To ADC Module)
1x
2x
4x
FVR_buffer2
(To Comparators)
+
_
FVRRDY
Note 1: Any peripheral requiring the Fixed Reference (See Table 13-1)
DS40001723C-page 114
PIC12(L)F1571/2
TABLE 13-1:
Peripheral
Description
HFINTOSC
BOR
LDO
DS40001723C-page 115
PIC12(L)F1571/2
13.3
REGISTER 13-1:
R/W-0/0
(1)
FVREN
R/W-0/0
(2)
FVRRDY
TSEN
(3)
R/W-0/0
TSRNG
R/W-0/0
(3)
R/W-0/0
R/W-0/0
(1)
R/W-0/0
ADFVR<1:0>(1)
CDAFVR<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
bit 1-0
Note 1:
2:
3:
4:
To minimize current consumption when the FVR is disabled, the FVR buffers should be turned off by clearing the Buffer Gain Selection bits.
FVRRDY is always 1 for the PIC12F1571/2 devices.
See Section 14.0 Temperature Indicator Module for additional information.
Fixed Voltage Reference output cannot exceed VDD.
TABLE 13-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
FVREN
FVRRDY
TSEN
TSRNG
Bit 3
Bit 2
CDAFVR>1:0>
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
116
DS40001723C-page 116
PIC12(L)F1571/2
14.0
TEMPERATURE INDICATOR
MODULE
FIGURE 14-1:
Rev. 10-000069A
7/31/2013
VDD
TSEN
14.1
TEMPERATURE CIRCUIT
DIAGRAM
TSRNG
VOUT
Temp. Indicator
To ADC
Circuit Operation
EQUATION 14-1:
VOUT RANGES
14.2
TABLE 14-1:
The temperature sense circuit is integrated with the
Fixed Voltage Reference (FVR) module. See
Section13.0 Fixed Voltage Reference (FVR) for
more information.
The circuit is enabled by setting the TSEN bit of the
FVRCON register. When disabled, the circuit draws no
current.
The circuit operates in either high or low range. The high
range, selected by setting the TSRNG bit of the
FVRCON register, provides a wider output voltage. This
provides more resolution over the temperature range,
but may be less consistent from part to part. This range
requires a higher bias voltage to operate and thus, a
higher VDD is needed.
The low range is selected by clearing the TSRNG bit of
the FVRCON register. The low range generates a lower
voltage drop and thus, a lower bias voltage is needed to
operate the circuit. The low range is provided for low
voltage operation.
3.6V
1.8V
14.3
Temperature Output
14.4
DS40001723C-page 117
PIC12(L)F1571/2
TABLE 14-2:
Name
FVRCON
Legend:
Bit 6
Bit 5
Bit 4
FVREN
FVRRDY
TSEN
TSRNG
Bit 3
Bit 2
CDAFVR<1:0>
Bit 1
Bit 0
ADFVR<1:0>
Register
on page
118
DS40001723C-page 118
PIC12(L)F1571/2
15.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
FIGURE 15-1:
ADPREF
Rev. 10-000033A
7/30/2013
Positive
Reference
Select
VDD
VREF+ pin
External
Channel
Inputs
ANa
VRNEG VRPOS
.
.
.
ADC_clk
sampled
input
ANz
Internal
Channel
Inputs
ADCS<2:0>
VSS
AN0
ADC
Clock
Select
FOSC/n Fosc
Divider
FRC
FOSC
FRC
Temp Indicator
DACx_output
FVR_buffer1
ADC
Sample Circuit
CHS<4:0>
ADFM
Write to bit
GO/DONE
10-bit Result
GO/DONE
Q1
Q4
16
start
ADRESH
Q2
TRIGSEL<3:0>
10
complete
ADRESL
Enable
Trigger Select
ADON
. . .
VSS
Trigger Sources
AUTO CONVERSION
TRIGGER
DS40001723C-page 119
PIC12(L)F1571/2
15.1
ADC Configuration
Port configuration
Channel selection
ADC voltage reference selection
ADC conversion clock source
Interrupt control
Result formatting
15.1.1
PORT CONFIGURATION
15.1.2
CHANNEL SELECTION
AN<3:0> pins
Temperature Indicator
DAC1_output
FVR_buffer1
15.1.4
CONVERSION CLOCK
The source of the conversion clock is software selectable via the ADCS bits of the ADCON1 register. There
are seven possible clock options:
FOSC/2
FOSC/4
FOSC/8
FOSC/16
FOSC/32
FOSC/64
FRC (internal RC oscillator)
15.1.3
DS40001723C-page 120
PIC12(L)F1571/2
TABLE 15-1:
ADCS<2:0
>
20 MHz
16 MHz
8 MHz
4 MHz
1 MHz
Fosc/2
000
100 ns
125 ns
250 ns
500 ns
2.0 s
Fosc/4
100
200 ns
250 ns
500 ns
1.0 s
4.0 s
Fosc/8
001
400 ns
500 ns
1.0 s
2.0 s
8.0 s
Fosc/16
101
800 ns
1.0 s
2.0 s
4.0 s
16.0 s
Fosc/32
010
1.6 s
2.0 s
4.0 s
8.0 s
32.0 s
Fosc/64
110
3.2 s
4.0 s
8.0 s
16.0 s
64.0 s
FRC
x11
1.0-6.0 s
1.0-6.0 s
1.0-6.0 s
1.0-6.0 s
1.0-6.0 s
The TAD period when using the FRC clock source can fall within a specified range, (see TAD parameter).
The TAD period when using the FOSC-based clock source can be configured for a more precise TAD period.
However, the FRC clock source must be used when conversions are to be performed with the device in
Sleep mode.
FIGURE 15-2:
TAD1
TAD2
TAD3
TAD4
TAD5
TAD6
TAD7
TAD8
TAD9
TAD10
TAD11
b9
b8
b7
b6
b5
b4
b3
b2
b1
b0
THCD
Conversion Starts
TACQ
DS40001723C-page 121
PIC12(L)F1571/2
15.1.5
INTERRUPTS
15.1.6
RESULT FORMATTING
FIGURE 15-3:
Rev. 10-000054A
7/30/2013
ADRESH
ADRESL
(ADFM = 0) MSB
LSB
bit 7
bit 0
bit 7
(ADFM = 1)
bit 0
Unimplemented: Read as 0
MSB
bit 7
Unimplemented: Read as 0
DS40001723C-page 122
LSB
bit 0
bit 7
bit 0
10-bit ADC Result
PIC12(L)F1571/2
15.2
15.2.1
ADC Operation
STARTING A CONVERSION
15.2.2
FIGURE 15-4:
COMPLETION OF A CONVERSION
Rev. 10-000154A
10/24/2013
OFx_match
PWMxOFIE
15.2.3
15.2.4
PHx_match
PWMxPHIE
PWMx_interrupt
DCx_match
PWMxDCIE
PRx_match
PWMxPRIE
TERMINATING A CONVERSION
TABLE 15-2:
AUTO-CONVERSION
SOURCES
Source Peripheral
Signal Name
Timer0
T0_overflow
Timer1
T1_overflow
Timer2
T2_match
Comparator C1
C1OUT_sync
PWM1
PWM1_OF_match
PWM1
PWM1_interrupt
PWM2
PWM2_OF_match
PWM2
PWM2_interrupt
PWM3
PWM3_OF_match
PWM3
PWM3_interrupt
15.2.5
AUTO-CONVERSION TRIGGER
The auto-conversion trigger allows periodic ADC measurements without software intervention. When a rising
edge of the selected source occurs, the GO/DONE bit
is set by hardware.
The auto-conversion trigger source is selected with the
TRIGSEL<3:0> bits of the ADCON2 register.
Using the auto-conversion trigger does not assure
proper ADC timing. It is the users responsibility to
ensure that the ADC timing requirements are met.
DS40001723C-page 123
PIC12(L)F1571/2
15.2.6
2.
3.
4.
5.
6.
7.
8.
Configure Port:
Disable pin output driver (Refer to the TRIS
register)
Configure pin as analog (Refer to the ANSEL
register)
Configure the ADC module:
Select ADC conversion clock
Configure voltage reference
Select ADC input channel
Turn on ADC module
Configure ADC interrupt (optional):
Clear ADC interrupt flag
Enable ADC interrupt
Enable peripheral interrupt
Enable global interrupt(1)
Wait the required acquisition time(2).
Start conversion by setting the GO/DONE bit.
Wait for ADC conversion to complete by one of
the following:
Polling the GO/DONE bit
Waiting for the ADC interrupt (interrupts
enabled)
Read ADC Result.
Clear the ADC interrupt flag (required if interrupt
is enabled).
EXAMPLE 15-1:
ADC CONVERSION
DS40001723C-page 124
PIC12(L)F1571/2
15.3
REGISTER 15-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
CHS<4:0>
R/W-0/0
R/W-0/0
R/W-0/0
GO/DONE
ADON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-2
bit 1
bit 0
Note 1:
2:
3:
DS40001723C-page 125
PIC12(L)F1571/2
REGISTER 15-2:
R/W-0/0
R/W-0/0
ADFM
R/W-0/0
R/W-0/0
ADCS<2:0>
U-0
U-0
R/W-0/0
bit 7
R/W-0/0
ADPREF<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6-4
bit 3-2
Unimplemented: Read as 0
bit 1-0
Note 1:
When selecting the VREF+ pin as the source of the positive reference, be aware that a minimum voltage
specification exists. See Section26.0 Electrical Specifications for details.
DS40001723C-page 126
PIC12(L)F1571/2
REGISTER 15-3:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
TRIGSEL<3:0>(1)
U-0
U-0
U-0
U-0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
bit 3-0
Unimplemented: Read as 0
Note 1:
2:
DS40001723C-page 127
PIC12(L)F1571/2
REGISTER 15-4:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<9:2>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 15-5:
R/W-x/u
R/W-x/u
ADRES<1:0>
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-0
DS40001723C-page 128
PIC12(L)F1571/2
REGISTER 15-6:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<9:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-2
bit 1-0
REGISTER 15-7:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
ADRES<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001723C-page 129
PIC12(L)F1571/2
15.4
EQUATION 15-1:
Assumptions:
T ACQ = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient
= T AMP + T C + T COFF
= 2s + T C + Temperature - 25C 0.05s/C
The value for TC can be approximated with the following equations:
1
= V CHOLD
V AP P LI ED 1 -------------------------n+1
2
1
TC
----------
RC
V AP P LI ED 1 e = V CHOLD
Tc
---------
1
RC
;combining [1] and [2]
V AP P LI ED 1 e = V A PP LIE D 1 -------------------------n+1
2
1
T C = C HOLD R IC + R SS + R S ln(1/2047)
= 12.5pF 1k + 7k + 10k ln(0.0004885)
= 1.715 s
Therefore:
T AC Q = 2s + 1.715 s + 50C- 25C 0.05 s/C
= 4.96s
Note 1: The reference voltage (VRPOS) has no effect on the equation, since it cancels itself out.
2: The charge holding capacitor (CHOLD) is not discharged after each conversion.
3: The maximum recommended impedance for analog sources is 10 k. This is required to meet the pin
leakage specification.
DS40001723C-page 130
PIC12(L)F1571/2
FIGURE 15-5:
VDD
RS
Analog
Input pin
VT 0.6V
RIC 1K
Sampling
switch
SS
RSS
ILEAKAGE(1)
VA
Legend: CHOLD
CPIN
ILEAKAGE
RIC
RSS
SS
VT
Note 1:
FIGURE 15-6:
CPIN
5pF
CHOLD = 12.5 pF
VT 0.6V
Ref-
= Sample/Hold Capacitance
= Input Capacitance
= Leakage Current at the pin due to varies injunctions
= Interconnect Resistance
= Resistance of Sampling switch
= Sampling Switch
= Threshold Voltage
VDD
6V
5V
4V
3V
2V
RSS
5 6 7 8 9 10 11
Sampling Switch
(k )
Full-Scale Range
3FFh
3FEh
3FDh
3FCh
3FBh
03h
02h
01h
00h
Ref-
Zero-Scale
Transition
1.5 LSB
Full-Scale
Transition
Ref+
DS40001723C-page 131
PIC12(L)F1571/2
TABLE 15-3:
Name
ADCON0
ADCON1
ADFM
ADCON2
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
CHS<4:0>
ADCS<2:0>
TRIGSEL<3:0>
Bit 1
Bit 0
Register
on Page
GO/DONE
ADON
125
ADPREF<1:0>
126
127
ADRESH
128, 129
ADRESL
128, 129
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
106
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
(2)
(2)
PIE1
TMR1GIE
ADIE
RCIE
TXIE
TMR2IE
TMR1IE
71
PIR1
TMR1GIF
ADIF
RCIF(2)
TXIF(2)
TMR2IF
TMR1IF
74
TRISA5
TRISA4
(1)
TRISA2
TRISA1
TRISA0
105
FVREN
FVRRDY
TSEN
TSRNG
TRISA
FVRCON
Legend:
Note 1:
2:
CDAFVR<1:0>
ADFVR<1:0>
116
x = unknown, u = unchanged, = unimplemented read as 0, q = value depends on condition. Shaded cells are not
used for ADC module.
Unimplemented, read as 1.
PIC12(L)F1572 only.
DS40001723C-page 132
PIC12(L)F1571/2
16.0
5-BIT DIGITAL-TO-ANALOG
CONVERTER (DAC) MODULE
FIGURE 16-1:
VDD
00
01
VREF+
FVR_buffer2
10
Reserved
11
VSOURCE+
5
DACR<4:0>
DACPSS
DACEN
32-to-1 MUX
32
Steps
DACx_output
To Peripherals
DACxOUT1 (1)
DACOE1
R
VSS
VSOURCE-
DS40001723C-page 133
PIC12(L)F1571/2
16.1
16.2
16.3
EQUATION 16-1:
16.4
16.5
Effects of a Reset
IF DACEN = 1
DACR 4:0
DACx_output = VSOURCE+ VSOURCE- ----------------------------+ VSOURCE5
2
Note:
See the DACxCON0 register for the available VSOURCE+ and VSOURCE- selections.
DS40001723C-page 134
PIC12(L)F1571/2
16.6
REGISTER 16-1:
R/W-0/0
U-0
R/W-0/0
U-0
DACEN
DACOE
R/W-0/0
R/W-0/0
U-0
U-0
DACPSS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
Unimplemented: Read as 0
bit 5
bit 4
Unimplemented: Read as 0
bit 3-2
bit 1-0
Unimplemented: Read as 0
REGISTER 16-2:
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
DACR<4:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-5
Unimplemented: Read as 0
bit 4-0
TABLE 16-1:
Name
Bit 6
Bit 5
Bit 4
DACCON0
DACEN
DACLPS
DACOE
DACCON1
Legend:
Bit 3
Bit 2
DACPSS<1:0>
Bit 1
Bit 0
DACR<4:0>
Register
on page
135
135
= Unimplemented location, read as 0. Shaded cells are not used with the DAC module.
DS40001723C-page 135
PIC12(L)F1571/2
17.0
COMPARATOR MODULE
17.1
Comparator Overview
FIGURE 17-1:
TABLE 17-1:
AVAILABLE COMPARATORS
Device
C1
PIC12(L)F1571
PIC12(L)F1572
CxNCH<2:0>
CxON(1)
CxIN0-
000
CxIN1-
001
Reserved
010
Reserved
011
Reserved
100
Reserved
101
FVR_buffer2
110
CxON(1)
CxVN
00
DAC_out
01
FVR_buffer2
10
CxVP
Note 1:
CxINTN
CxOUT
MCxOUT
Q1
CxSP CxHYS
CxPOL
CxOUT_async
to
peripherals
CxOUT_sync
to
peripherals
CxSYNC
CxOE
0
TRIS bit
CxOUT
CxON(1)
Interrupt
Falling
Edge
set bit
CxIF
11
CxPCH<1:0>
CxINTP
Cx
111
CxIN+
Interrupt
Rising
Edge
When CxON = 0, all multiplexer inputs are disconnected and the Comparator will produce a 0 at the output.
DS40001723C-page 136
PIC12(L)F1571/2
FIGURE 17-2:
SINGLE COMPARATOR
VIN+
VIN-
Output
VINVIN+
Output
17.2.3
Note:
17.2
Comparator Control
Enable
Output selection
Output polarity
Speed/Power selection
Hysteresis enable
Output synchronization
Interrupt enable
Interrupt edge polarity
Positive input channel selection
Negative input channel selection
17.2.1
COMPARATOR ENABLE
17.2.2
Note:
17.2.4
COMPARATOR OUTPUT
SELECTION
DS40001723C-page 137
PIC12(L)F1571/2
17.2.5
TABLE 17-2:
COMPARATOR OUTPUT
STATE VS. INPUT CONDITIONS
Input Condition
CxPOL
CxOUT
17.2.6
17.3
COMPARATOR SPEED/POWER
SELECTION
The trade-off between speed or power can be optimized during program execution with the CxSP control
bit. The default state for this bit is 1 which selects the
Normal-Speed mode. Device power consumption can
be optimized at the cost of slower comparator propagation delay by clearing the CxSP bit to 0.
FIGURE 17-3:
VDD
RS < 10K
Analog
Input pin
VT 0.6V
RIC
To Comparator
ILEAKAGE(1)
CPIN
5pF
VA
VT 0.6V
VSS
Legend: CPIN
ILEAKAGE
RIC
RS
VA
VT
Note 1:
DS40001723C-page 138
= Input Capacitance
= Leakage Current at the pin due to various junctions
= Interconnect Resistance
= Source Impedance
= Analog Voltage
= Threshold Voltage
PIC12(L)F1571/2
17.4
Comparator Hysteresis
17.5
Specifications
Note:
for
17.5.1
COMPARATOR OUTPUT
SYNCHRONIZATION
17.7
17.6
Comparator Interrupt
DS40001723C-page 139
PIC12(L)F1571/2
17.8
REGISTER 17-1:
R/W-0/0
R-0/0
R/W-0/0
R/W-0/0
CxON
CxOUT
CxOE
CxPOL
U-0
R/W-0/0
R/W-0/0
R/W-0/0
CxSP
CxHYS
CxSYNC
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
DS40001723C-page 140
PIC12(L)F1571/2
REGISTER 17-2:
R/W-0/0
R/W-0/0
CxINTP
CxINTN
R/W-0/0
R/W-0/0
CxPCH<1:0>
U-0
R/W-0/0
R/W-0/0
R/W-0/0
CxNCH<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
REGISTER 17-3:
U-0
U-0
U-0
U-0
U-0
U-0
U-0
R-0/0
MC1OUT
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-1
Unimplemented: Read as 0
bit 0
DS40001723C-page 141
PIC12(L)F1571/2
TABLE 17-3:
Name
ANSELA
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA4
ANSA2
ANSA1
ANSA0
106
CM1CON0
C1ON
C1OUT
C1OE
C1POL
C1SP
C1HYS
C1SYNC
140
CM1CON1
C1NTP
C1INTN
MC1OUT
141
DACCON0
DACEN
DACLPS
DACOE
DACPSS<1:0>
135
DACCON1
FVRCON
FVREN
FVRRDY
TSEN
TSRNG
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
PIE2
C1IE
72
PIR2
C1IF
75
PORTA
RA5
RA4
RA3
RA2
RA1
RA0
105
LATA
LATA5
LATA4
LATA2
LATA1
LATA0
106
TRISA
TRISA5
TRISA4
(1)
TRISA2
TRISA1
TRISA0
105
CMOUT
Legend:
Note 1:
C1PCH<1:0>
C1NCH<2:0>
141
DACR<4:0>
CDAFVR<1:0>
135
ADFVR<1:0>
116
= unimplemented location, read as 0. Shaded cells are unused by the comparator module.
Unimplemented, read as 1.
DS40001723C-page 142
PIC12(L)F1571/2
18.0
TIMER0 MODULE
18.1.2
18.1
Timer0 Operation
18.1.1
FIGURE 18-1:
TMR0CS
Fosc/4
T0CKI(1)
PSA
0
1
TMR0SE
1
write
to
TMR0
Prescaler
R
0 FOSC/2
T0CKI
Sync Circuit
PS<2:0>
T0_overflow
TMR0
Q1
set bit
TMR0IF
Note 1: The T0CKI prescale output frequency should not exceed FOSC/8.
DS40001723C-page 143
PIC12(L)F1571/2
18.1.3
SOFTWARE PROGRAMMABLE
PRESCALER
There are eight prescaler options for the Timer0 module ranging from 1:2 to 1:256. The prescale values are
selectable via the PS<2:0> bits of the OPTION_REG
register. In order to have a 1:1 prescaler value for the
Timer0 module, the prescaler must be disabled by setting the PSA bit of the OPTION_REG register.
The prescaler is not readable or writable. All instructions
writing to the TMR0 register will clear the prescaler.
18.1.4
TIMER0 INTERRUPT
18.1.5
18.1.6
DS40001723C-page 144
PIC12(L)F1571/2
18.2
REGISTER 18-1:
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
R/W-1/1
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
R/W-1/1
R/W-1/1
R/W-1/1
PS<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
TABLE 18-1:
Name
Bit 7
INTCON
Legend:
*
Note 1:
000
001
010
011
100
101
110
111
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
1 : 256
Bit 6
Bit 5
Bit 4
TRIGSEL<3:0>
OPTION_REG
TRISA
Timer0 Rate
ADCON2
TMR0
Bit Value
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
127
TMR0IF
INTF
IOCIF
GIE
PEIE
TMR0IE
INTE
IOCIE
WPUEN
INTEDG
TMR0CS
TMR0SE
PSA
PS<2:0>
TRISA5
TRISA4
70
145
143*
(1)
TRISA2
TRISA1
TRISA0
105
= Unimplemented location, read as 0. Shaded cells are not used by the Timer0 module.
Page provides register information.
Unimplemented, read as 1.
DS40001723C-page 145
PIC12(L)F1571/2
19.0
FIGURE 19-1:
T1GSS<1:0>
Rev. 10-000018D
8/5/2013
T1G
00
T0_overflow
01
C1OUT_sync
10
Reserved
11
T1GSPM
0
1
D
1
Single Pulse
Acq. Control
T1GVAL
Q1
T1GGO/DONE
T1GPOL
CK
Interrupt
TMR1ON
R
set bit
TMR1GIF
det
T1GTM
TMR1GE
set flag bit
TMR1IF
TMR1ON
EN
T1_overflow
TMR1
TMR1H
(2)
TMR1L
T1CLK
T1SYNC
TMR1CS<1:0>
LFINTOSC
(1)
11
10
T1CKI
Fosc
Internal Clock
01
00
Fosc/4
Internal Clock
Prescaler
1,2,4,8
Synchronize(3)
det
2
T1CKPS<1:0>
Fosc/2
Internal
Clock
Sleep
Input
DS40001723C-page 146
PIC12(L)F1571/2
19.1
Timer1 Operation
19.2
TABLE 19-1:
TIMER1 ENABLE
SELECTIONS
19.2.1
Timer1
Operation
TMR1ON
TMR1GE
Off
Off
19.2.2
Always On
Count Enabled
Note:
TABLE 19-2:
TMR1CS<1:0>
Clock Source
11
LFINTOSC
10
01
00
DS40001723C-page 147
PIC12(L)F1571/2
19.3
Timer1 Prescaler
19.4
Timer1 Operation in
Asynchronous Counter Mode
19.4.1
TABLE 19-3:
T1CLK
T1GPOL
T1G
Counts
Holds Count
Holds Count
Counts
19.5.2
Timer1 Operation
TABLE 19-4:
T1GSS
00
01
10
11
Reserved
Note 1:
19.5
Timer1 Gate
19.5.1
DS40001723C-page 148
PIC12(L)F1571/2
19.5.2.1
19.5.2.2
When Timer0 increments from FFh to 00h, a low-tohigh pulse will automatically be generated and internally supplied to the Timer1 gate circuitry.
19.5.3
When Timer1 Gate Toggle mode is enabled, it is possible to measure the full-cycle length of a Timer1 gate
signal, as opposed to the duration of a single level
pulse.
The Timer1 gate source is routed through a flip-flop that
changes state on every incrementing edge of the signal. See Figure 19-4 for timing details.
19.5.5
19.5.6
When Timer1 Gate Event Interrupt is enabled, it is possible to generate an interrupt upon the completion of a
gate event. When the falling edge of T1GVAL occurs,
the TMR1GIF flag bit in the PIR1 register will be set. If
the TMR1GIE bit in the PIE1 register is set, then an
interrupt will be recognized.
The TMR1GIF flag bit operates even when the Timer1
gate is not enabled (TMR1GE bit is cleared).
19.5.4
DS40001723C-page 149
PIC12(L)F1571/2
19.6
Timer1 Interrupt
19.7.1
19.7
FIGURE 19-2:
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
Note 1:
2:
DS40001723C-page 150
PIC12(L)F1571/2
FIGURE 19-3:
TMR1GE
T1GPOL
t1g_in
T1CKI
T1GVAL
Timer1
FIGURE 19-4:
N+1
N+2
N+3
N+4
TMR1GE
T1GPOL
T1GTM
t1g_in
T1CKI
T1GVAL
Timer1
N+4
N+8
DS40001723C-page 151
PIC12(L)F1571/2
FIGURE 19-5:
TMR1GE
T1GPOL
T1GSPM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Timer1
TMR1GIF
DS40001723C-page 152
Cleared by software
N+1
N+2
Set by hardware on
falling edge of T1GVAL
Cleared by
software
PIC12(L)F1571/2
FIGURE 19-6:
TMR1GE
T1GPOL
T1GSPM
T1GTM
T1GGO/
Cleared by hardware on
falling edge of T1GVAL
Set by software
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Timer1
TMR1GIF
Cleared by software
N+1
N+2
N+3
Set by hardware on
falling edge of T1GVAL
N+4
Cleared by
software
DS40001723C-page 153
PIC12(L)F1571/2
19.8
REGISTER 19-1:
R/W-0/u
R/W-0/u
TMR1CS<1:0>
R/W-0/u
R/W-0/u
T1CKPS<1:0>
U-0
R/W-0/u
U-0
R/W-0/u
T1SYNC
TMR1ON
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
Unimplemented: Read as 0
bit 0
DS40001723C-page 154
PIC12(L)F1571/2
REGISTER 19-2:
R/W-0/u
R/W-0/u
R/W-0/u
R/W-0/u
R/W/HC-0/u
R-x/x
TMR1GE
T1GPOL
T1GTM
T1GSPM
T1GGO/
DONE
T1GVAL
R/W-0/u
R/W-0/u
T1GSS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1-0
DS40001723C-page 155
PIC12(L)F1571/2
TABLE 19-5:
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSELA
ANSA4
ANSA2
ANSA1
ANSA0
106
APFCON
RXDTSEL
CWGASEL
CWGBSEL
T1GSEL
TXCKSEL
P2SEL
P1SEL
102
INTCON
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
PLLR
OSTS
HFIOFR
HFIOFL
MFIOFR
LFIOFR
HFIOFS
55
TMR1GIE
ADIE
RCIE(2)
TXIE(2)
TMR2IE
TMR1IE
71
ADIF
(2)
(2)
TMR2IF
TMR1IF
OSCSTAT
PIE1
PIR1
TMR1GIF
RCIF
TXIF
TMR1H
Holding Register for the Most Significant Byte of the 16-bit TMR1 Count
TMR1L
Holding Register for the Least Significant Byte of the 16-bit TMR1 Count
TRISA
T1CON
TMR1CS<1:0>
T1GCON
Legend:
Note
*
1:
2:
TMR1GE
T1GPOL
TRISA5
TRISA4
T1CKPS<1:0>
T1GTM
T1GSPM
75
150*
150*
(1)
TRISA2
TRISA1
TRISA0
105
T1OSCEN
T1SYNC
TMR1ON
154
T1GGO/
DONE
T1GVAL
T1GSS<1:0>
155
= unimplemented location, read as 0. Shaded cells are not used by the Timer1 module.
Page provides register information.
Unimplemented, read as 1.
PIC12(L)F1572 only.
DS40001723C-page 156
PIC12(L)F1571/2
20.0
TIMER2 MODULE
FIGURE 20-1:
T2_match
Prescaler
1:1, 1:4, 1:16, 1:64
Fosc/4
TMR2
To Peripherals
2
T2CKPS<1:0>
Postscaler
1:1 to 1:16
Comparator
set bit
TMR2IF
4
T2OUTPS<3:0>
PR2
FIGURE 20-2:
FOSC/4
1:4
Prescale
0x03
PR2
TMR2
0x00
0x01
0x02
0x03
0x00
0x01
0x02
Pulse Width(1)
T2_match
Note 1: The Pulse Width of T2_match is equal to the scaled input of TMR2.
DS40001723C-page 157
PIC12(L)F1571/2
20.1
Timer2 Operation
20.2
20.3
FIGURE 20-3:
T2_MATCH TIMING
DIAGRAM
Rev. 10-000021A
7/30/2013
Q1
Q2
Q3
Q4
Q1
FOSC
TCY1
FOSC/4
T2_match
TMR2 = 0
TMR2 = PR2
match
PRESCALE = 1:1
(T2CKPS<1:0> = 00)
TCY1
TCY2 ...
...
T2_match
TCYX
...
FOSC/4
Timer2 Interrupt
Timer2 Output
TMR2 = PR2
match
TMR2 = 0
PRESCALE = 1:X
(T2CKPS<1:0> = 01,10,11)
20.4
DS40001723C-page 158
PIC12(L)F1571/2
20.5
REGISTER 20-1:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
T2OUTPS<3:0>
R/W-0/0
R/W-0/0
TMR2ON
R/W-0/0
T2CKPS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-3
bit 2
bit 1-0
TABLE 20-1:
Name
INTCON
PIE1
PIR1
PR2
T2CON
TMR2
Legend:
*
Note 1:
Bit 6
Bit 5
GIE
PEIE
TMR1GIE
ADIE
ADIF
TMR1GIF
Bit 0
Register
on Page
INTF
IOCIF
70
TMR2IE
TMR1IE
71
Bit 4
Bit 3
Bit 2
TMR0IE
INTE
IOCIE
TMR0IF
RCIE(1)
TXIE(1)
(1)
(1)
TMR2IF
TMR1IF
RCIF
TXIF
Bit 1
T2OUTPS<3:0>
74
157*
TMR2ON
T2CKPS<1:0>
159
157*
= unimplemented location, read as 0. Shaded cells are not used for Timer2 module.
Page provides register information.
PIC12(L)F1572 only.
DS40001723C-page 159
PIC12(L)F1571/2
21.0
ENHANCED UNIVERSAL
SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (EUSART)
FIGURE 21-1:
Data bus
TXIE
Interrupt
TXREG register
TXIF
8
MSb
LSb
(8)
TX/CK
Pin Buffer
and Control
TXEN
Baud Rate Generator
TRMT
FOSC
TX9
BRG16
TX9D
+1
Multiplier
x4
x16
x64
SYNC
1 x 0 0
BRGH
x 1 1 0
BRG16
x 1 0 1
SPBRGH SPBRGL
DS40001723C-page 160
PIC12(L)F1571/2
FIGURE 21-2:
CREN
OERR
RCIDL
SPEN
RSR Register
MSb
RX/DT pin
Pin Buffer
and Control
Baud Rate Generator
Data
Recovery
FOSC
Stop (8)
LSb
1
Start
n
RX9
BRG16
+1
Multiplier
x4
x16
x64
SYNC
1 x 0 0
BRGH
x 1 1 0
BRG16
x 1 0 1
SPBRGH SPBRGL
FIFO
FERR
RX9D
RCREG Register
8
Data Bus
RCIF
RCIE
Interrupt
DS40001723C-page 161
PIC12(L)F1571/2
21.1
21.1.1.2
Transmitting Data
21.1.1.3
21.1.1
21.1.1.4
EUSART ASYNCHRONOUS
TRANSMITTER
21.1.1.1
DS40001723C-page 162
PIC12(L)F1571/2
21.1.1.5
TSR Status
21.1.1.7
21.1.1.6
1.
2.
3.
FIGURE 21-3:
Write to TXREG
BRG Output
(Shift Clock)
8.
Word 1
Start bit
bit 0
bit 1
bit 7/8
Stop bit
Word 1
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
FIGURE 21-4:
7.
ASYNCHRONOUS TRANSMISSION
TX/CK
pin
TRMT bit
(Transmit Shift
Reg. Empty Flag)
6.
1 TCY
Word 1
Transmit Shift Reg.
Write to TXREG
BRG Output
(Shift Clock)
Word 1
TX/CK
pin
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
TRMT bit
(Transmit Shift
Reg. Empty Flag)
Note:
Word 2
Start bit
bit 0
1 TCY
bit 1
Word 1
bit 7/8
Stop bit
Start bit
Word 2
bit 0
1 TCY
Word 1
Transmit Shift Reg.
Word 2
Transmit Shift Reg.
DS40001723C-page 163
PIC12(L)F1571/2
TABLE 21-1:
Name
BAUDCON
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
172
GIE
PEIE
TMR0IE
INTE
(1)
IOCIE
TMR0IF
INTF
IOCIF
70
(1)
71
PIE1
TMR1GIE
ADIE
RCIE
TXIE
TMR2IE
TMR1IE
PIR1
TMR1GIF
ADIF
RCIF(1)
TXIF(1)
TMR2IF
TMR1IF
74
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
171*
RCSTA
SPBRGL
BRG<7:0>
173*
SPBRGH
BRG<15:8>
173*
TXREG
TXSTA
TX9
TXEN
162
SYNC
SENDB
BRGH
TRMT
TX9D
170
Legend: = unimplemented location, read as 0. Shaded cells are not used for asynchronous transmission.
* Page provides register information.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 164
PIC12(L)F1571/2
21.1.2
EUSART ASYNCHRONOUS
RECEIVER
21.1.2.1
21.1.2.2
Receiving Data
21.1.2.3
Receive Interrupts
DS40001723C-page 165
PIC12(L)F1571/2
21.1.2.4
21.1.2.5
21.1.2.7
Address Detection
21.1.2.6
DS40001723C-page 166
PIC12(L)F1571/2
21.1.2.8
21.1.2.9
1.
FIGURE 21-5:
ASYNCHRONOUS RECEPTION
Start
bit
bit 0
RX/DT pin
bit 1
Rcv Shift
Reg
Rcv Buffer Reg.
RCIDL
Start
bit
Word 1
RCREG
bit 0
Start
bit
Word 2
RCREG
Read Rcv
Buffer Reg.
RCREG
RCIF
(Interrupt Flag)
OERR bit
CREN
Note:
This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word,
causing the OERR (overrun) bit to be set.
DS40001723C-page 167
PIC12(L)F1571/2
TABLE 21-2:
Name
BAUDCON
INTCON
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
172
GIE
PEIE
TMR0IE
INTE
(1)
IOCIE
TMR0IF
INTF
IOCIF
70
(1)
TMR2IE
TMR1IE
71
TMR2IF
TMR1IF
PIE1
TMR1GIE
ADIE
RCIE
TXIE
PIR1
TMR1GIF
ADIF
RCIF(1)
TXIF(1)
RCREG
RCSTA
RX9
SREN
SPBRGL
ADDEN
FERR
OERR
RX9D
BRG<7:0>
SPBRGH
TXSTA
CREN
TX9
TXEN
SYNC
SENDB
171*
173*
BRG<15:8>
CSRC
74
165*
173*
BRGH
TRMT
TX9D
170
Legend: = unimplemented location, read as 0. Shaded cells are not used for asynchronous reception.
* Page provides register information.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 168
PIC12(L)F1571/2
21.2
DS40001723C-page 169
PIC12(L)F1571/2
21.3
REGISTER 21-1:
R/W-/0
CSRC
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-1/1
R/W-0/0
TX9
TXEN(1)
SYNC
SENDB
BRGH
TRMT
TX9D
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Note 1:
DS40001723C-page 170
PIC12(L)F1571/2
REGISTER 21-2:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R-0/0
R-0/0
R-0/0
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
DS40001723C-page 171
PIC12(L)F1571/2
REGISTER 21-3:
R-0/0
R-1/1
U-0
R/W-0/0
R/W-0/0
U-0
R/W-0/0
R/W-0/0
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
Unimplemented: Read as 0
bit 4
bit 3
bit 2
Unimplemented: Read as 0
bit 1
bit 0
DS40001723C-page 172
PIC12(L)F1571/2
21.4
EXAMPLE 21-1:
CALCULATING BAUD
RATE ERROR
DS40001723C-page 173
PIC12(L)F1571/2
TABLE 21-3:
Configuration Bits
BRG/EUSART Mode
8-bit/Asynchronous
FOSC/[64 (n+1)]
SYNC
BRG16
BRGH
8-bit/Asynchronous
16-bit/Asynchronous
16-bit/Asynchronous
8-bit/Synchronous
16-bit/Synchronous
1
Legend:
FOSC/[4 (n+1)]
TABLE 21-4:
Name
BAUDCON
RCSTA
FOSC/[16 (n+1)]
Bit 6
Bit 5
Bit 4
Bit 3
ABDOVF
RCIDL
SCKP
BRG16
SPEN
RX9
SREN
CREN
ADDEN
Bit 1
Bit 0
Register
on Page
WUE
ABDEN
172
FERR
OERR
RX9D
Bit 2
171
SPBRGL
BRG<7:0>
173*
SPBRGH
BRG<15:8>
173*
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
170
Legend: = unimplemented location, read as 0. Shaded cells are not used for the Baud Rate Generator.
* Page provides register information.
DS40001723C-page 174
PIC12(L)F1571/2
TABLE 21-5:
BAUD
RATE
300
1200
Actual
Rate
%
Error
SPBRG
value
(decimal)
1221
1.73
255
1200
0.00
239
1202
0.16
207
1200
0.00
143
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
2400
2404
0.16
129
2400
0.00
119
2404
0.16
103
2400
0.00
71
9600
9470
-1.36
32
9600
0.00
29
9615
0.16
25
9600
0.00
17
10417
10417
0.00
29
10286
-1.26
27
10417
0.00
23
10165
-2.42
16
19.2k
19.53k
1.73
15
19.20k
0.00
14
19.23k
0.16
12
19.20k
0.00
57.6k
57.60k
0.00
57.60k
0.00
115.2k
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
1200
1202
0.16
103
300
1202
0.16
0.16
207
51
300
1200
0.00
191
47
300
1202
0.16
0.16
51
12
2400
2404
0.16
51
2404
0.16
25
2400
0.00
23
9600
9615
0.16
12
9600
0.00
10417
10417
0.00
11
10417
0.00
19.2k
19.20k
0.00
57.6k
0.00
115.2k
57.60k
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
0.00
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
300
1200
2400
9600
9615
0.16
129
9600
0.00
119
9615
0.16
103
9600
0.00
71
10417
10417
0.00
119
10378
-0.37
110
10417
0.00
95
10473
0.53
65
19.2k
19.23k
0.16
64
19.20k
0.00
59
19.23k
0.16
51
19.20k
0.00
35
57.6k
56.82k
-1.36
21
57.60k
0.00
19
58.82k
2.12
16
57.60k
0.00
11
115.2k
113.64k
-1.36
10
115.2k
0.00
111.1k
-3.55
115.2k
0.00
DS40001723C-page 175
PIC12(L)F1571/2
TABLE 21-5:
BAUD
RATE
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
207
300
300
0.16
1200
1202
0.16
207
1200
0.00
191
1202
0.16
51
2400
2404
0.16
207
2404
0.16
103
2400
0.00
95
2404
0.16
25
9600
9615
0.16
51
9615
0.16
25
9600
0.00
23
10417
10417
0.00
47
10417
0.00
23
10473
0.53
21
10417
0.00
19.2k
19231
0.16
25
19.23k
0.16
12
19.2k
0.00
11
57.6k
55556
-3.55
57.60k
0.00
115.2k
115.2k
0.00
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
300.0
-0.01
4166
300.0
0.00
3839
300.03
0.01
3332
300.0
0.00
2303
1200
1200
-0.03
1041
1200
0.00
959
1200.5
0.04
832
1200
0.00
575
2400
2399
-0.03
520
2400
0.00
479
2398
-0.08
416
2400
0.00
287
9600
9615
0.16
129
9600
0.00
119
9615
0.16
103
9600
0.00
71
10417
10417
0.00
119
10378
-0.37
110
10417
0.00
95
10473
0.53
65
19.2k
19.23k
0.16
64
19.20k
0.00
59
19.23k
0.16
51
19.20k
0.00
35
57.6k
56.818
-1.36
21
57.60k
0.00
19
58.82k
2.12
16
57.60k
0.00
11
115.2k
113.636
-1.36
10
115.2k
0.00
111.11k
-3.55
115.2k
0.00
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
1200
299.9
1199
-0.02
-0.08
1666
416
300.1
1202
0.04
0.16
832
207
300.0
1200
0.00
0.00
767
191
300.5
1202
0.16
0.16
207
51
2400
2404
0.16
207
2404
0.16
103
2400
0.00
95
2404
0.16
25
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
9600
9615
0.16
51
9615
0.16
25
9600
0.00
23
10417
10417
0.00
47
10417
0.00
23
10473
0.53
21
10417
0.00
19.2k
19.23k
0.16
25
19.23k
0.16
12
19.20k
0.00
11
57.6k
55556
-3.55
57.60k
0.00
115.2k
115.2k
0.00
%
Error
DS40001723C-page 176
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
%
Error
SPBRG
value
(decimal)
PIC12(L)F1571/2
TABLE 21-5:
300
300.0
0.00
16665
300.0
0.00
15359
300.0
0.00
13332
300.0
0.00
9215
1200
1200
-0.01
4166
1200
0.00
3839
1200.1
0.01
3332
1200
0.00
2303
1151
2400
2400
0.02
2082
2400
0.00
1919
2399.5
-0.02
1666
2400
0.00
9600
9597
-0.03
520
9600
0.00
479
9592
-0.08
416
9600
0.00
287
10417
10417
0.00
479
10425
0.08
441
10417
0.00
383
10433
0.16
264
143
19.2k
19.23k
0.16
259
19.20k
0.00
239
19.23k
0.16
207
19.20k
0.00
57.6k
57.47k
-0.22
86
57.60k
0.00
79
57.97k
0.64
68
57.60k
0.00
47
115.2k
116.3k
0.94
42
115.2k
0.00
39
114.29k
-0.79
34
115.2k
0.00
23
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
Actual
Rate
%
Error
SPBRG
value
(decimal)
300
300.0
0.00
6666
300.0
0.01
3332
300.0
0.00
3071
300.1
0.04
832
1200
1200
-0.02
1666
1200
0.04
832
1200
0.00
767
1202
0.16
207
2400
2401
0.04
832
2398
0.08
416
2400
0.00
383
2404
0.16
103
9600
9615
0.16
207
9615
0.16
103
9600
0.00
95
9615
0.16
25
10417
10417
191
10417
0.00
95
10473
0.53
87
10417
0.00
23
19.2k
19.23k
0.16
103
19.23k
0.16
51
19.20k
0.00
47
19.23k
0.16
12
57.6k
57.14k
-0.79
34
58.82k
2.12
16
57.60k
0.00
15
115.2k
117.6k
2.12
16
111.1k
-3.55
115.2k
0.00
DS40001723C-page 177
PIC12(L)F1571/2
21.4.1
AUTO-BAUD DETECT
TABLE 21-6:
FIGURE 21-6:
BRG16
BRGH
BRG Base
Clock
BRG ABD
Clock
FOSC/64
FOSC/512
FOSC/16
FOSC/128
FOSC/16
FOSC/128
FOSC/4
FOSC/32
1
Note:
BRG Value
RX pin
0000h
001Ch
Start
Edge #1
bit 1
bit 0
Edge #2
bit 3
bit 2
Edge #3
bit 5
bit 4
Edge #4
bit 7
bit 6
Edge #5
Stop bit
BRG Clock
Auto Cleared
Set by User
ABDEN bit
RCIDL
RCIF bit
(Interrupt)
Read
RCREG
SPBRGL
XXh
1Ch
SPBRGH
XXh
00h
Note 1:
The ABD sequence requires the EUSART module to be configured in Asynchronous mode.
DS40001723C-page 178
PIC12(L)F1571/2
21.4.2
AUTO-BAUD OVERFLOW
21.4.3
AUTO-WAKE-UP ON BREAK
21.4.3.1
Special Considerations
Break Character
To avoid character errors or character fragments during
a wake-up event, the wake-up character must be all
zeros.
When the wake-up is enabled the function works
independent of the low time on the data stream. If the
WUE bit is set and a valid non-zero character is
received, the low time from the Start bit to the first rising
edge will be interpreted as the wake-up event. The
remaining bits in the character will be received as a
fragmented character and subsequent characters can
result in framing or overrun errors.
Therefore, the initial character in the transmission must
be all 0s. This must be ten or more bit times, 13-bit
times recommended for LIN bus, or any number of bit
times for standard RS-232 devices.
Oscillator Start-up Time
Oscillator start-up time must be considered, especially
in applications using oscillators with longer start-up
intervals (i.e., LP, XT or HS/PLL mode). The Sync
Break (or wake-up signal) character must be of
sufficient length, and be followed by a sufficient
interval, to allow enough time for the selected oscillator
to start and provide proper initialization of the EUSART.
WUE Bit
The wake-up event causes a receive interrupt by
setting the RCIF bit. The WUE bit is cleared in
hardware by a rising edge on RX/DT. The interrupt
condition is then cleared in software by reading the
RCREG register and discarding its contents.
To ensure that no actual data is lost, check the RCIDL
bit to verify that a receive operation is not in process
before setting the WUE bit. If a receive operation is not
occurring, the WUE bit may then be set just prior to
entering the Sleep mode.
DS40001723C-page 179
PIC12(L)F1571/2
FIGURE 21-7:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Auto Cleared
WUE bit
RX/DT Line
RCIF
Note 1:
FIGURE 21-8:
Q1
Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1Q2 Q3 Q4
OSC1
Auto Cleared
Note 1
RCIF
Sleep Command Executed
Note 1:
2:
Sleep Ends
If the wake-up event requires long oscillator warm-up time, the automatic clearing of the WUE bit can occur while the stposc signal is
still active. This sequence should not depend on the presence of Q clocks.
The EUSART remains in Idle while the WUE bit is set.
DS40001723C-page 180
PIC12(L)F1571/2
21.4.4
21.4.4.1
21.4.5
FIGURE 21-9:
Write to TXREG
BRG Output
(Shift Clock)
TX (pin)
Start bit
bit 0
bit 1
bit 11
Stop bit
Break
TXIF bit
(Transmit
Interrupt Flag)
TRMT bit
(Transmit Shift
Empty Flag)
SENDB
(send Break
control bit)
Auto Cleared
DS40001723C-page 181
PIC12(L)F1571/2
21.5
21.5.1
Clearing the SCKP bit sets the Idle state as low. When
the SCKP bit is cleared, the data changes on the rising
edge of each clock.
21.5.1.3
21.5.1.4
SYNC = 1
CSRC = 1
SREN = 0 (for transmit); SREN = 1 (for receive)
CREN = 0 (for transmit); CREN = 1 (for receive)
SPEN = 1
21.5.1.1
21.5.1.2
1.
2.
3.
4.
5.
6.
Master Clock
7.
8.
Clock Polarity
DS40001723C-page 182
PIC12(L)F1571/2
FIGURE 21-10:
SYNCHRONOUS TRANSMISSION
RX/DT
pin
bit 0
bit 1
Word 1
bit 2
bit 7
bit 0
bit 1
Word 2
bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
TXREG Reg
Write Word 1
Write Word 2
TXIF bit
(Interrupt Flag)
TRMT bit
TXEN bit
Note:
1
Sync Master mode, SPBRGL = 0, continuous transmission of two 8-bit words.
FIGURE 21-11:
bit 0
bit 2
bit 1
bit 6
bit 7
TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
TABLE 21-7:
Name
Bit 6
ABDOVF
GIE
PIE1
PIR1
BAUDCON
INTCON
RCSTA
Bit 2
Bit 1
Bit 0
Register on
Page
BRG16
WUE
ABDEN
172
IOCIE
TMR0IF
INTF
IOCIF
70
TXIE(1)
TMR2IE
TMR1IE
71
RCIF(1)
TXIF(1)
TMR2IF
TMR1IF
74
SREN
CREN
ADDEN
FERR
OERR
RX9D
171
Bit 5
Bit 4
Bit 3
RCIDL
SCKP
PEIE
TMR0IE
INTE
TMR1GIE
ADIE
RCIE(1)
TMR1GIF
ADIF
SPEN
RX9
SPBRGL
BRG<7:0>
173*
SPBRGH
BRG<15:8>
173*
TXREG
TXSTA
CSRC
Legend:
*
Note 1:
TX9
TXEN
SYNC
SENDB
162*
BRGH
TRMT
TX9D
170
= unimplemented location, read as 0. Shaded cells are not used for synchronous master transmission.
Page provides register information.
PIC12(L)F1572 only.
DS40001723C-page 183
PIC12(L)F1571/2
21.5.1.5
21.5.1.6
Slave Clock
21.5.1.7
21.5.1.8
21.5.1.9
1.
DS40001723C-page 184
PIC12(L)F1571/2
FIGURE 21-12:
RX/DT
pin
bit 0
bit 1
bit 2
bit 3
bit 4
bit 5
bit 6
bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
bit SREN
SREN bit
CREN bit 0
RCIF bit
(Interrupt)
Read
RCREG
Note:
Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0.
TABLE 21-8:
Name
BAUDCON
INTCON
PIE1
PIR1
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
172
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
ADIE
RCIE(1)
TXIE(1)
TMR2IE
TMR1IE
71
ADIF
RCIF(1)
TXIF(1)
TMR2IF
TMR1IF
TMR1GIE
TMR1GIF
RCREG
RCSTA
RX9
SREN
SPBRGL
ADDEN
FERR
OERR
RX9D
BRG<7:0>
SPBRGH
TXSTA
CREN
TX9
TXEN
SYNC
SENDB
171
173*
BRG<15:8>
CSRC
74
165*
173*
BRGH
TRMT
TX9D
170
Legend: = unimplemented location, read as 0. Shaded cells are not used for synchronous master reception.
* Page provides register information.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 185
PIC12(L)F1571/2
21.5.2
SYNC = 1
CSRC = 0
SREN = 0 (for transmit); SREN = 1 (for receive)
CREN = 0 (for transmit); CREN = 1 (for receive)
SPEN = 1
1.
2.
3.
4.
21.5.2.1
5.
21.5.2.2
1.
2.
3.
4.
5.
6.
7.
8.
TABLE 21-9:
Name
BAUDCON
INTCON
PIE1
PIR1
RCSTA
Bit 1
Bit 0
Register
on Page
BRG16
WUE
ABDEN
172
IOCIE
TMR0IF
INTF
IOCIF
70
TXIE(1)
TMR2IE
TMR1IE
71
ADIF
RCIF(1)
TXIF(1)
TMR2IF
TMR1IF
74
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
171
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
ABDOVF
GIE
RCIDL
SCKP
PEIE
TMR0IE
INTE
TMR1GIE
ADIE
RCIE(1)
TMR1GIF
SPEN
TXREG
TXSTA
TX9
TXEN
SYNC
SENDB
BRGH
162*
TRMT
TX9D
170
Legend: = unimplemented location, read as 0. Shaded cells are not used for synchronous slave transmission.
* Page provides register information.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 186
PIC12(L)F1571/2
21.5.2.3
21.5.2.4
1.
2.
3.
4.
5.
6.
7.
8.
9.
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ABDOVF
RCIDL
SCKP
BRG16
WUE
ABDEN
172
GIE
PEIE
TMR0IE
INTE
IOCIE
TMR0IF
INTF
IOCIF
70
TXIE(1)
TMR2IE
TMR1IE
71
TXIF(1)
TMR2IF
TMR1IF
74
TMR1GIE
ADIE
RCIE(1)
TMR1GIF
ADIF
RCIF(1)
RCSTA
SPEN
RX9
SREN
CREN
ADDEN
FERR
OERR
RX9D
171
TXSTA
CSRC
TX9
TXEN
SYNC
SENDB
BRGH
TRMT
TX9D
170
PIR1
RCREG
165*
Legend: = unimplemented location, read as 0. Shaded cells are not used for synchronous slave reception.
* Page provides register information.
Note 1: PIC12(L)F1572 only.
DS40001723C-page 187
PIC12(L)F1571/2
22.0
16-BIT PULSE-WIDTH
MODULATION (PWM) MODULE
PWMxPH register
PWMxDC register
PWMxPR register
PWMxOF register
Every PWM module has a configurable reload operation to ensure all event count buffers change at the end
of a period thereby avoiding signal glitches.
Figure 22-2 shows a simplified block diagram of the
reload operation. For a more detailed description of the
reload operation, refer to Section Section 22.4
Reload Operation.
Independent Run
Slave Run with Synchronous Start
One-Shot Slave with Synchronous Start
Continuous Run Slave with Synchronous Start
and Timer Reset
Standard
Set On Match
Toggle On Match
Center Aligned
FIGURE 22-1:
PWM Control
Unit
DCx_match
OF3_match(1)
11
OF2_match(1)
10
OF1_match(1)
01
Reserved
00
Rev. 10-000152A
4/21/2014
Q4
PWMxOUT
CK
PWMxPOL
PWMx_output
OF_match
Offset
Control
PRx_match
To Peripherals
PWMxOE
PWMx
OFM<1:0>
E
OFS
Comparator
PWM_clock
PRx_match
set PRIF
PWMxPR
Comparator
Note 1:
DS40001723C-page 188
PHx_match
set PHIF
PWMxPH
U/D
PWMxTMR
TRIS Control
Comparator
OFx_match
set OFIF
PWMxOF
Comparator
DCx_match
set DCIF
PWMxDC
A PWM module cannot trigger from its own offset match event.
The input corresponding to a PWM modules own offset match is reserved.
PIC12(L)F1571/2
FIGURE 22-2:
LD3_trigger(1)
11
(1)
10
LD1_trigger(1)
01
Reserved
00
LD2_trigger
1
0
PWMxLDS
LDx_trigger
22.1
PWM_clock
Fundamental Operation
FIGURE 22-3:
PWMxCS<1:0>
Note:
PRx_match
PWMxLDT
Note
PWMxLDA(2)
22.1.1
FOSC
00
LFINTOSC
01
HFINTOSC
10
Reserved
11
PWMxPS<2:0>
Prescaler
PWMx_clock
22.1.2
DS40001723C-page 189
PIC12(L)F1571/2
22.2
PWM Modes
22.2.1
STANDARD MODE
EQUATION 22-1:
PWM PERIOD IN
STANDARD MODE
PWMxPR + 1 Prescale
Period = -------------------------------------------------------------------PWMxCLK
EQUATION 22-2:
PWMxDC PWMx PH
Duty Cycle = -----------------------------------------------------------------
PWMxPR + 1
22.2.2
The PWMxOUT bit can be used to set or clear the output of the PWM in this mode. Writes to this bit will take
place on the next rising edge of the PWM_clock after
the bit is written.
A detailed timing diagram for Set On Match is shown in
Figure 22-5.
22.2.3
22.2.4
EQUATION 22-3:
PWMxPR + 1 Prescale 2
Period = --------------------------------------------------------------------------PWMxCLK
Equation 22-4 is used to calculate the PWM duty cycle
ratio in Center Aligned mode
EQUATION 22-4:
PWMxDC 2
Duty Cycle = ------------------------------------------------ PWMx PR + 1 2
Writes to PWMxOUT will have no effect in this mode.
A detailed timing diagram for Center Aligned mode is
shown in Figure 22-7.
DS40001723C-page 190
FIGURE 22-4:
Period
Duty Cycle
Phase
PWMxCLK
PWMxPR
10
PWMxPH
PWMxDC
PWMxTMR
10
PWMxOUT
FIGURE 22-5:
Rev. 10-000143A
9/5/2013
Period
PWMxCLK
PWMxPR
10
PWMxPH
DS40001723C-page 191
PWMxTMR
PWMxOUT
10
PIC12(L)F1571/2
Phase
Rev. 10-000144A
9/5/2013
Period
Phase
PWMxCLK
PWMxPR
10
PWMxPH
PWMxTMR
10
PWMxOUT
FIGURE 22-7:
Period
Duty Cycle
PWMxCLK
PWMxPR
PWMxDC
PWMxTMR
PWMxOUT
PIC12(L)F1571/2
DS40001723C-page 192
FIGURE 22-6:
PIC12(L)F1571/2
22.3
Offset Modes
22.3.1
In Independent Run mode (OFM = 00), the PWM module is unaffected by the other PWM modules in the
device. The PWMxTMR associated with the PWM
module in this mode starts counting as soon as the EN
bit associated with this PWM module is set and continues counting until the EN bit is cleared. Period events
reset the PWMxTMR to zero after which the timer continues to count.
A detailed timing diagram of this mode used with
Standard PWM mode is shown in Figure 22-8.
22.3.2
22.3.3
22.3.5
22.3.4
DS40001723C-page 193
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR
10
PWM5PH
PWM5DC
PWM5OF
PWM5TMR
10
PWM5OUT
OF5_match
PH5_match
DC5_match
PR5_match
PWM6TMR
PWM6PR
PWM6PH
PWM6DC
PWM6OUT
PIC12(L)F1571/2
DS40001723C-page 194
FIGURE 22-8:
FIGURE 22-9:
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR
10
PWM5PH
PWM5DC
PWM5OF
PWM5TMR
10
PWM5OUT
OF5_match
PWM6TMR
PWM6PH
PWM6DC
PWM6OUT
DS40001723C-page 195
PIC12(L)F1571/2
PWM6PR
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR
10
PWM5PH
PWM5DC
PWM5OF
PWM5TMR
10
PWM5OUT
OF5_match
PWM6TMR
PWM6PR
PWM6PH
PWM6DC
PWM6OUT
PIC12(L)F1571/2
DS40001723C-page 196
FIGURE 22-10:
FIGURE 22-11:
CONTINUOUS SLAVE RUN MODE WITH IMMEDIATE RESET AND SYNC START TIMING DIAGRAM
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR
10
PWM5PH
PWM5DC
PWM5OF
PWM5TMR
10
PWM5OUT
OF5_match
PWM6TMR
PWM6PH
PWM6DC
PWM6OUT
DS40001723C-page 197
PIC12(L)F1571/2
PWM6PR
Period
Duty Cycle
Offset
PWM5CLK
PWM5PR
PWM5DC
PWM5OF
PWM5TMR
PWM5OUT
OF5_match
PH5_match
DC5_match
PR5_match
PWM6TMR
PWM6PR
PWM6DC
PWM6OUT
PIC12(L)F1571/2
DS40001723C-page 198
FIGURE 22-12:
FIGURE 22-13:
Period
Duty Cycle
Offset
PWM5CLK
PWM5PR
PWM5DC
PWM5OF
PWM5TMR
PWM5OUT
OF5_match
PH5_match
DC5_match
PR5_match
PWM6TMR
0
4
1
PWM6OUT
DS40001723C-page 199
PIC12(L)F1571/2
PWM6PR
PWM6DC
PIC12(L)F1571/2
22.4
Reload Operation
22.5
22.6
Interrupts
Immediate
Triggered
The LDT bit of the PWMxLDCON register controls the
arming method. Both methods require the LDA bit to be
set. All four buffer pairs will load simultaneously at the
loading event.
22.4.1
IMMEDIATE RELOAD
22.4.2
TRIGGERED RELOAD
DS40001723C-page 200
PIC12(L)F1571/2
22.7
PWM1
PWM1
PWM2
PWM2
PWM3
PWM3
REGISTER 22-1:
R/W-0/0
R/W-0/0
R/HS/HC-0/0
R/W-0/0
EN
OE
OUT
POL
R/W-0/0
R/W-0/0
U-0
U-0
MODE<1:0>
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3-2
bit 1-0
Unimplemented: Read as 0
DS40001723C-page 201
PIC12(L)F1571/2
REGISTER 22-2:
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
OFIE
PHIE
DCIE
PRIE
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
REGISTER 22-3:
U-0
U-0
U-0
U-0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
R/W/HS-0/0
OFIF
PHIF
DCIF
PRIF
bit 7
bit 0
Legend:
HC = Bit is cleared by hardware
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-4
Unimplemented: Read as 0
bit 3
bit 2
bit 1
bit 0
Note 1:
DS40001723C-page 202
PIC12(L)F1571/2
REGISTER 22-4:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
PS<2:0>
U-0
U-0
R/W-0/0
R/W-0/0
CS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-4
bit 3-2
Unimplemented: Read as 0
bit 1-0
DS40001723C-page 203
PIC12(L)F1571/2
REGISTER 22-5:
R/W-0/0
R/W-0/0
U-0
U-0
U-0
U-0
LDA(1)
LDT
R/W-0/0
bit 7
R/W-0/0
LDS<1:0>
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-2
Unimplemented: Read as 0
bit 1-0
Note 1:
2:
This bit is cleared by the module after a reload operation. It can be cleared in software to clear an existing
arming event.
The LD_trigger corresponding to the PWM used becomes reserved.
DS40001723C-page 204
PIC12(L)F1571/2
REGISTER 22-6:
U-0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
OFO(2)
OFM<1:0>
R/W-0/0
R/W-0/0
OFS<1:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
Unimplemented: Read as 0
bit 6-5
bit 4
bit 3-2
Unimplemented: Read as 0
bit 1-0
Note 1:
DS40001723C-page 205
PIC12(L)F1571/2
REGISTER 22-7:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PH<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
REGISTER 22-8:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PH<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001723C-page 206
PIC12(L)F1571/2
REGISTER 22-9:
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
DC<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
DC<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001723C-page 207
PIC12(L)F1571/2
REGISTER 22-11: PWMxPRH: PWMx PERIOD COUNT HIGH REGISTER
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PR<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
PR<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001723C-page 208
PIC12(L)F1571/2
REGISTER 22-13: PWMxOFH: PWMx OFFSET COUNT HIGH REGISTER
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
OF<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
OF<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001723C-page 209
PIC12(L)F1571/2
REGISTER 22-15: PWMxTMRH: PWMx TIMER HIGH REGISTER
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
TMR<15:8>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
TMR<7:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-0
DS40001723C-page 210
PIC12(L)F1571/2
Note:
There are no long and short bit name variants for the following three mirror registers
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
PWM3EN_A
PWM2EN_A
PWM1EN_A
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-3
Unimplemented: Read as 0
bit 2-0
U-0
U-0
U-0
U-0
R/W-0/0
PWM3LDA_A
R/W-0/0
R/W-0/0
PWM2LDA_A PWM1LDA_A
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-3
Unimplemented: Read as 0
bit 2-0
U-0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
R/W-0/0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-3
Unimplemented: Read as 0
bit 2-0
DS40001723C-page 211
PIC12(L)F1571/2
TABLE 22-2:
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
PWM3EN_A
IRCF<3:0>
Bit 0
Register
on Page
PWM2EN_A
PWM1EN_A
211
PWM2LDA_A
PWM1LDA_A
211
Bit 1
OSCCON
SPLLEN
PWMEN
SCS<1:0>
53
PWMLD
PWM3LDA_A
PWMOUT
211
PWM1PHL
PH<7:0>
206
PWM1PHH
PH<15:8>
206
PWM1DCL
DC<7:0>
207
PWM1DCH
DC<15:8>
207
PWM1PRH
PR<7:0>
208
PWM1PRL
PR<15:8>
208
PWM1OFH
OF<7:0>
209
PWM1OFL
OF<15:8>
209
PWM1TMRH
TMR<7:0>
210
PWM1TMRL
TMR<15:8>
210
201
PHIE
DCIE
PRIE
202
PHIF
DCIF
PRIF
PWM1CON
EN
OE
OUT
POL
PWM1INTE
OFIE
PWM1INTF
OFIF
PWM1CLKCON
OFO
PWM1LDCON
LDA
PWM1OFCON
PS<2:0>
LDT
OFM<1:0>
MODE<1:0>
202
CS<1:0>
203
LDS<1:0>
204
OFS<1:0>
205
PWM2PHL
PH<7:0>
206
PWM2PHH
PH<15:8>
206
PWM2DCL
DC<7:0>
207
PWM2DCH
DC<15:8>
207
PWM2PRL
PR<7:0>
208
PWM2PRH
PR<15:8>
208
PWM2OFL
OF<7:0>
209
PWM2OFH
OF<15:8>
209
PWM2TMRL
TMR<7:0>
210
PWM2TMRH
TMR<15:8>
210
201
PHIE
DCIE
PRIE
202
PHIF
DCIF
PRIF
PWM2CON
EN
OE
OUT
POL
PWM2INTE
OFIE
PWM2INTF
OFIF
PWM2CLKCON
OFO
PWM2LDCON
LDA
PWM2OFCON
PS<2:0>
LDT
OFM<1:0>
MODE<1:0>
202
CS<1:0>
203
LDS<1:0>
204
OFS<1:0>
205
PWM3PHL
PH<7:0>
206
PWM3PHH
PH<15:8>
206
PWM3DCL
DC<7:0>
207
PWM3DCH
DC<15:8>
207
PWM3PRL
PR<7:0>
208
PWM3PRH
PR<15:8>
208
PWM3OFL
OF<7:0>
209
PWM3OFH
OF<15:8>
209
PWM3TMRL
TMR<7:0>
210
PWM3TMRH
TMR<15:8>
210
201
PHIE
DCIE
PRIE
202
PHIF
DCIF
PRIF
PWM3CON
EN
OE
OUT
POL
PWM3INTE
OFIE
PWM3INTF
OFIF
PWM3CLKCON
OFO
PWM3LDCON
LDA
PWM3OFCON
Legend:
PS<2:0>
LDT
OFM<1:0>
MODE<1:0>
203
LDS<1:0>
204
OFS<1:0>
205
DS40001723C-page 212
202
CS<1:0>
PIC12(L)F1571/2
TABLE 22-3:
Name
CONFIG1
Legend:
Bits
Bit -/7
Bit -/6
Bit 13/5
Bit 12/4
Bit 11/3
13:8
CLKOUTEN
7:0
CP
MCLRE
PWRTE
WDTE<1:0>
Bit 10/2
Bit 9/1
BOREN<1:0>
Bit 8/0
FOSC<1:0>
Register
on Page
40
= unimplemented location, read as 0. Shaded cells are not used by clock sources.
DS40001723C-page 213
PIC12(L)F1571/2
23.0
COMPLEMENTARY WAVEFORM
GENERATOR (CWG) MODULE
23.3
TABLE 23-1:
23.1
Fundamental Operation
23.2
Clock Source
SELECTABLE INPUT
SOURCES
Source Peripheral
Signal Name
Comparator C1
C1OUT_sync
PWM1
PWM1_output
PWM2
PWM2_output
PWM3
PWM3_output
23.4
Output Control
23.4.1
OUTPUT ENABLES
23.4.2
POLARITY CONTROL
DS40001723C-page 214
Rev. 10-000123D
9/6/2013
GxASDLA
00
GxCS
FOSC
10
1'
11
GxASDLA = 01
CWGxDBR
cwg_clock
HFINTOSC
GxIS
0'
C1OUT_async
Reserved
PWM1_out
PWM2_out
PWM3_out
Reserved
Reserved
Reserved
R
S
TRISx
GxOEA
GxPOLA
Input Source
CWGxDBF
R
GxOEB
EN
GxPOLB
00
R
GxARSEN
10
1'
11
shutdown
Q
GxASDLB
0'
GxASE
Auto-Shutdown
Source
C1OUT_async
GxASDC1
CWGxA
EN
set dominate
2
GxASDLB = 01
TRISx
CWGxB
PIC12(L)F1571/2
DS40001723C-page 215
FIGURE 23-1:
PIC12(L)F1571/2
FIGURE 23-2:
cwg_clock
PWM1
CWGxA
Rising Edge
Dead Band
CWGxB
23.5
Dead-Band Control
23.6
23.7
The CWGxDBR register sets the duration of the deadband interval on the rising edge of the input source
signal. This duration is from 0 to 64 counts of dead band.
Dead band is always counted off the edge on the input
source signal. A count of 0 (zero), indicates that no
dead band is present.
If the input source signal is not present for enough time
for the count to be completed, no output will be seen on
the respective output.
DS40001723C-page 216
cwg_clock
Input Source
CWGxA
CWGxB
FIGURE 23-4:
DEAD-BAND OPERATION, CWGxDBR = 03H, CWGxDBF = 04H, SOURCE SHORTER THAN DEAD BAND
cwg_clock
Input Source
CWGxA
CWGxB
2013-2014 Microchip Technology Inc.
PIC12(L)F1571/2
DS40001723C-page 217
FIGURE 23-3:
PIC12(L)F1571/2
23.8
Dead-Band Uncertainty
23.9
Auto-Shutdown Control
EQUATION 23-1:
DEAD-BAND
UNCERTAINTY
1
TDEADBAND_UNCERTAINTY = ----------------------------Fcwg_clock
23.9.1
SHUTDOWN
Software generated
External Input
23.9.1.1
Example:
Fcwg_clock = 16 MHz
23.9.1.2
Therefore:
1
TDEADBAND_UNCERTAINTY = ----------------------------Fcwg_clock
1
= ------------------16 MHz
= 62.5ns
DS40001723C-page 218
PIC12(L)F1571/2
23.10 Operation During Sleep
The CWG module operates independently from the
system clock and will continue to run during Sleep,
provided that the clock and input sources selected
remain active.
The HFINTOSC remains active during Sleep, provided
that the CWG module is enabled, the input source is
active, and the HFINTOSC is selected as the clock
source, regardless of the system clock source
selected.
In other words, if the HFINTOSC is simultaneously
selected as the system clock and the CWG clock
source, when the CWG is enabled and the input
source is active, the CPU will go idle during Sleep, but
the CWG will continue to operate and the HFINTOSC
will remain active.
23.11.1
23.11.2
AUTO-SHUTDOWN RESTART
23.11.2.1
1.
2.
3.
4.
5.
6.
7.
8.
9.
Clearing the shutdown state requires all selected shutdown inputs to be low, otherwise the GxASE bit will
remain set. The overrides will remain in effect until the
first rising edge event after the GxASE bit is cleared.
The CWG will then resume operation.
23.11.2.2
Auto-Restart
DS40001723C-page 219
FIGURE 23-5:
CWG Input
Source
Shutdown Source
GxASE
CWG1A
CWG1B
Shutdown
FIGURE 23-6:
CWG Input
Source
GxASE
DS40001723C-page 220
CWG1A
CWG1B
Output Resumes
PIC12(L)F1571/2
Shutdown Source
PIC12(L)F1571/2
23.12 Register Definitions: CWG Control
REGISTER 23-1:
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
R/W-0/0
U-0
U-0
R/W-0/0
GxEN
GxOEB
GxOEA
GxPOLB
GxPOLA
GxCS0
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-1
Unimplemented: Read as 0
bit 0
DS40001723C-page 221
PIC12(L)F1571/2
REGISTER 23-2:
R/W-x/u
R/W-x/u
GxASDLB<1:0>
R/W-x/u
R/W-x/u
U-0
GxASDLA<1:0>
R/W-0/0
R/W-0/0
R/W-0/0
GxIS<2:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
bit 5-4
bit 3
Unimplemented: Read as 0
bit 2-0
DS40001723C-page 222
PIC12(L)F1571/2
REGISTER 23-3:
R/W-0/0
R/W-0/0
U-0
U-0
U-0
R/W-0/0
R/W-0/0
U-0
GxASE
GxARSEN
GxASDC1
GxASDFLT
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7
bit 6
bit 5-3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
Unimplemented: Read as 0
DS40001723C-page 223
PIC12(L)F1571/2
REGISTER 23-4:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
CWGxDBR<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
REGISTER 23-5:
U-0
U-0
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
R/W-x/u
CWGxDBF<5:0>
bit 7
bit 0
Legend:
R = Readable bit
W = Writable bit
u = Bit is unchanged
x = Bit is unknown
1 = Bit is set
0 = Bit is cleared
bit 7-6
Unimplemented: Read as 0
bit 5-0
DS40001723C-page 224
PIC12(L)F1571/2
TABLE 23-2:
Name
ANSELA
CWG1CON0
CWG1CON1
CWG1CON2
Bit 6
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Register
on Page
ANSA4
ANSA2
ANSA1
ANSA0
106
G1EN
G1OEB
G1OEA
G1POLB
G1POLA
G1CS0
221
G1ASDLB<1:0>
G1ASE
G1ARSEN
CWG1DBF
CWG1DBR
TRISA
Legend:
Note 1:
Bit 5
G1ASDLA<1:0>
G1ASDC1
G1IS<1:0>
G1ASDSFLT
222
CWG1DBF<5:0>
CWG1DBR<5:0>
TRISA5
TRISA4
(1)
TRISA2
223
224
224
TRISA1
TRISA0
105
x = unknown, u = unchanged, = unimplemented locations read as 0. Shaded cells are not used by CWG.
Unimplemented, read as 1.
DS40001723C-page 225
PIC12(L)F1571/2
24.0
IN-CIRCUIT SERIAL
PROGRAMMING (ICSP)
24.1
24.2
24.3
FIGURE 24-1:
VDD
ICSPDAT
NC
2 4 6
ICSPCLK
1 3 5
VPP/MCLR
VSS
Target
PC Board
Bottom Side
Pin Description*
1 = VPP/MCLR
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
DS40001723C-page 226
PIC12(L)F1571/2
FIGURE 24-2:
Pin 1 Indicator
Pin Description*
1 = VPP/MCLR
1
2
3
4
5
6
2 = VDD Target
3 = VSS (ground)
4 = ICSPDAT
5 = ICSPCLK
6 = No connect
FIGURE 24-3:
External
Programming
Signals
Device to be
Programmed
VDD
VDD
VDD
VPP
MCLR/VPP
VSS
VSS
Data
ICSPDAT
Clock
ICSPCLK
To Normal Connections
* Isolation devices (as required).
DS40001723C-page 227
PIC12(L)F1571/2
25.0
25.1
Read-Modify-Write Operations
Byte Oriented
Bit Oriented
Literal and Control
TABLE 25-1:
Each instruction is a 14-bit word containing the operation code (opcode) and all required operands. The
opcodes are broken into three broad categories.
OPCODE FIELD
DESCRIPTIONS
Field
f
Description
Register file address (0x00 to 0x7F)
mm
TABLE 25-2:
ABBREVIATION
DESCRIPTIONS
Field
PC
Program Counter
TO
Time-Out bit
C
DC
Z
PD
DS40001723C-page 228
Description
Carry bit
Digit Carry bit
Zero bit
Power-Down bit
PIC12(L)F1571/2
FIGURE 25-1:
d = 0 for destination W
d = 1 for destination f
f = 7-bit file register address
Bit-oriented file register operations
13
10 9
7 6
OPCODE
b (BIT #)
f (FILE #)
General
13
OPCODE
0
k (literal)
k (literal)
0
k (literal)
5 4
0
k (literal)
0
k (literal)
6
n
0
k (literal)
n = appropriate FSR
k = 6-bit immediate value
FSR Increment instructions
13
OPCODE
2 1
0
n m (mode)
n = appropriate FSR
m = 2-bit mode value
OPCODE only
13
0
OPCODE
DS40001723C-page 229
PIC12(L)F1571/2
TABLE 25-3:
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
MSb
LSb
Status
Affected
Notes
ADDWF
ADDWFC
ANDWF
ASRF
LSLF
LSRF
CLRF
CLRW
COMF
DECF
INCF
IORWF
MOVF
MOVWF
RLF
RRF
SUBWF
SUBWFB
SWAPF
XORWF
f, d
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f, d
Add W and f
Add with Carry W and f
AND W with f
Arithmetic Right Shift
Logical Left Shift
Logical Right Shift
Clear f
Clear W
Complement f
Decrement f
Increment f
Inclusive OR W with f
Move f
Move W to f
Rotate Left f through Carry
Rotate Right f through Carry
Subtract W from f
Subtract with Borrow W from f
Swap nibbles in f
Exclusive OR W with f
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
00
11
00
11
11
11
00
00
00
00
00
00
00
00
00
00
00
11
00
00
0111
1101
0101
0111
0101
0110
0001
0001
1001
0011
1010
0100
1000
0000
1101
1100
0010
1011
1110
0110
dfff
dfff
dfff
dfff
dfff
dfff
lfff
0000
dfff
dfff
dfff
dfff
dfff
1fff
dfff
dfff
dfff
dfff
dfff
dfff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
00xx
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
C, DC, Z
C, DC, Z
Z
C, Z
C, Z
C, Z
Z
Z
Z
Z
Z
Z
Z
C
C
C, DC, Z
C, DC, Z
Z
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
DECFSZ
INCFSZ
f, d
f, d
Decrement f, Skip if 0
Increment f, Skip if 0
BCF
BSF
f, b
f, b
Bit Clear f
Bit Set f
1(2)
1(2)
00
00
1, 2
1, 2
1
1
2
2
01
01
1, 2
1, 2
11
11
11
00
11
11
11
11
1110
1001
1000
0000
0001
0000
1100
1010
01
01
BTFSC
BTFSS
f, b
f, b
ADDLW
ANDLW
IORLW
MOVLB
MOVLP
MOVLW
SUBLW
XORLW
k
k
k
k
k
k
k
k
1 (2)
1 (2)
LITERAL OPERATIONS
1
1
1
1
1
1
1
1
kkkk
kkkk
kkkk
001k
1kkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
kkkk
C, DC, Z
Z
Z
C, DC, Z
Z
Note 1: If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second cycle
is executed as a NOP.
2: If this instruction addresses an INDF register and the MSb of the corresponding FSR is set, this instruction will require one
additional instruction cycle.
DS40001723C-page 230
PIC12(L)F1571/2
TABLE 25-3:
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
MSb
LSb
Status
Affected
Notes
CONTROL OPERATIONS
BRA
BRW
CALL
CALLW
GOTO
RETFIE
RETLW
RETURN
k
k
k
Relative Branch
Relative Branch with W
Call Subroutine
Call Subroutine with W
Go to address
Return from interrupt
Return with literal in W
Return from Subroutine
2
2
2
2
2
2
2
2
CLRWDT
NOP
OPTION
RESET
SLEEP
TRIS
ADDFSR
MOVIW
n, k
n mm
MOVWI
k[n]
n mm
11
00
10
00
10
00
11
00
001k
0000
0kkk
0000
1kkk
0000
0100
0000
kkkk
0000
kkkk
0000
kkkk
0000
kkkk
0000
kkkk
1011
kkkk
1010
kkkk
1001
kkkk
1000
00
00
00
00
00
00
0000
0000
0000
0000
0000
0000
0110
0000
0110
0000
0110
0110
0100 TO, PD
0000
0010
0001
0011 TO, PD
0fff
INHERENT OPERATIONS
1
1
1
1
1
1
C-COMPILER OPTIMIZED
k[n]
1
1
11
00
1
1
11
00
11
1111 1nkk
2, 3
2
2, 3
2
Note 1: If the Program Counter (PC) is modified, or a conditional test is true, the instruction requires two cycles. The second cycle
is executed as a NOP.
2: If this instruction addresses an INDF register and the MSb of the corresponding FSR is set, this instruction will require
one additional instruction cycle.
3: See Table in the MOVIW and MOVWI instruction descriptions.
DS40001723C-page 231
PIC12(L)F1571/2
25.2
Instruction Descriptions
ADDFSR
ANDLW
Syntax:
Syntax:
[ label ] ANDLW
Operands:
-32 k 31
n [ 0, 1]
Operands:
0 k 255
Operation:
Operation:
FSR(n) + k FSR(n)
Status Affected:
Status Affected:
None
Description:
Description:
ANDWF
AND W with f
FSRn is limited to the range 0000h FFFFh. Moving beyond these bounds
will cause the FSR to wrap-around.
ADDLW
Syntax:
[ label ] ADDLW
Operands:
0 k 255
Operation:
(W) + k (W)
Status Affected:
C, DC, Z
Description:
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d 0,1
f,d
Operation:
Status Affected:
Description:
ASRF
Syntax:
[ label ] ASRF
ADDWF
Add W and f
Syntax:
[ label ] ADDWF
Operands:
0 f 127
d 0,1
Operands:
0 f 127
d [0,1]
Operation:
Operation:
(f<7>) dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
Status Affected:
C, Z
Description:
f,d
Status Affected:
C, DC, Z
Description:
ADDWFC
Syntax:
[ label ] ADDWFC
Operands:
0 f 127
d [0,1]
Operation:
register f
f {,d}
Status Affected:
C, DC, Z
Description:
Add W, the Carry flag and data memory location f. If d is 0, the result is
placed in W. If d is 1, the result is
placed in data memory location f.
DS40001723C-page 232
f {,d}
PIC12(L)F1571/2
BCF
Bit Clear f
Syntax:
[ label ] BCF
BTFSC
f,b
Syntax:
Operands:
0 f 127
0b7
Operands:
Operation:
0 (f<b>)
Operation:
skip if (f<b>) = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
BRA
Relative Branch
BTFSS
Syntax:
Syntax:
Operands:
Operands:
0 f 127
0b<7
Operation:
skip if (f<b>) = 1
Operation:
(PC) + 1 + k PC
Status Affected:
None
Status Affected:
None
Description:
Description:
BRW
Syntax:
[ label ] BRW
Operands:
None
Operation:
(PC) + (W) PC
Status Affected:
None
Description:
BSF
Bit Set f
Syntax:
[ label ] BSF
Operands:
0 f 127
0b7
Operation:
1 (f<b>)
Status Affected:
None
Description:
f,b
DS40001723C-page 233
PIC12(L)F1571/2
CALL
Call Subroutine
CLRWDT
Syntax:
[ label ] CALL k
Syntax:
Operands:
0 k 2047
Operands:
None
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<6:3>) PC<14:11>
Operation:
Status Affected:
None
00h WDT
0 WDT prescaler,
1 TO
1 PD
Description:
Status Affected:
TO, PD
Description:
CLRWDT instruction resets the Watchdog Timer. It also resets the prescaler
of the WDT.
Status bits TO and PD are set.
CALLW
COMF
Complement f
Syntax:
[ label ] CALLW
Syntax:
[ label ] COMF
Operands:
None
Operands:
Operation:
(PC) +1 TOS,
(W) PC<7:0>,
(PCLATH<6:0>) PC<14:8>
0 f 127
d [0,1]
Operation:
(f) (destination)
Status Affected:
Description:
DECF
Decrement f
Status Affected:
None
Description:
CLRF
Clear f
Syntax:
[ label ] CLRF
f,d
Syntax:
Operands:
0 f 127
Operands:
Operation:
00h (f)
1Z
Operation:
(f) - 1 (destination)
Status Affected:
Description:
Description:
CLRW
Clear W
Status Affected:
Syntax:
[ label ] CLRW
Operands:
None
Operation:
00h (W)
1Z
Status Affected:
Description:
DS40001723C-page 234
PIC12(L)F1571/2
DECFSZ
Decrement f, Skip if 0
INCFSZ
Increment f, Skip if 0
Syntax:
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) - 1 (destination);
skip if result = 0
Operation:
(f) + 1 (destination),
skip if result = 0
Status Affected:
None
Status Affected:
None
Description:
Description:
GOTO
Unconditional Branch
IORLW
Syntax:
[ label ]
Syntax:
[ label ]
GOTO k
INCFSZ f,d
IORLW k
Operands:
0 k 2047
Operands:
0 k 255
Operation:
k PC<10:0>
PCLATH<6:3> PC<14:11>
Operation:
Status Affected:
Status Affected:
None
Description:
Description:
INCF
Increment f
IORWF
Inclusive OR W with f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
INCF f,d
Operation:
(f) + 1 (destination)
Operation:
Status Affected:
Status Affected:
Description:
Description:
IORWF
f,d
DS40001723C-page 235
PIC12(L)F1571/2
LSLF
MOVF
f {,d}
Move f
Syntax:
[ label ] LSLF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f<7>) C
(f<6:0>) dest<7:1>
0 dest<0>
Operation:
(f) (dest)
Status Affected:
C, Z
Description:
register f
Status Affected:
Description:
Words:
Cycles:
Example:
Syntax:
[ label ] LSRF
Operands:
0 f 127
d [0,1]
Operation:
0 dest<7>
(f<7:1>) dest<6:0>,
(f<0>) C,
Status Affected:
C, Z
Description:
DS40001723C-page 236
f {,d}
register f
MOVF
FSR, 0
After Instruction
W = value in FSR register
Z = 1
LSRF
MOVF f,d
PIC12(L)F1571/2
MOVIW
Move INDFn to W
Syntax:
Operands:
n [0,1]
mm [00,01, 10, 11]
-32 k 31
Operation:
INDFn W
Effective address is determined by
FSR + 1 (preincrement)
FSR - 1 (predecrement)
FSR + k (relative offset)
After the Move, the FSR value will be
either:
FSR + 1 (all increments)
FSR - 1 (all decrements)
Unchanged
Status Affected:
MOVLP
Syntax:
[ label ] MOVLP k
Operands:
0 k 127
Operation:
k PCLATH
Status Affected:
None
Description:
MOVLW
Move literal to W
Syntax:
[ label ]
Operands:
0 k 255
k (W)
Status Affected:
None
Description:
The 8-bit literal k is loaded into W register. The dont cares will assemble as
0s.
Words:
1
1
Mode
Syntax
mm
Cycles:
Preincrement
++FSRn
00
Example:
--FSRn
01
Postincrement
FSRn++
10
Postdecrement
FSRn--
11
Description:
MOVLB
MOVLW k
Operation:
Predecrement
MOVLW
0x5A
After Instruction
W =
MOVWF
Move W to f
Syntax:
[ label ]
MOVWF
Operands:
0 f 127
Operation:
(W) (f)
0x5A
Status Affected:
None
Description:
Words:
Cycles:
Example:
MOVWF
OPTION_REG
Before Instruction
OPTION_REG =
W
=
After Instruction
OPTION_REG =
W
=
0xFF
0x4F
0x4F
0x4F
Syntax:
[ label ] MOVLB k
Operands:
0 k 31
Operation:
k BSR
Status Affected:
None
Description:
DS40001723C-page 237
PIC12(L)F1571/2
MOVWI
Move W to INDFn
Syntax:
Operands:
Operation:
n [0,1]
mm [00,01, 10, 11]
-32 k 31
W INDFn
Effective address is determined by
FSR + 1 (preincrement)
FSR - 1 (predecrement)
FSR + k (relative offset)
After the Move, the FSR value will be
either:
FSR + 1 (all increments)
FSR - 1 (all decrements)
Unchanged
Status Affected:
None
Mode
Syntax
Preincrement
++FSRn
00
Predecrement
--FSRn
01
Postincrement
FSRn++
10
Postdecrement
FSRn--
11
Description:
mm
NOP
No Operation
Syntax:
[ label ]
Operands:
None
NOP
Operation:
No operation
Status Affected:
None
Description:
No operation.
Words:
Cycles:
Example:
NOP
OPTION
Syntax:
[ label ] OPTION
Operands:
None
Operation:
(W) OPTION_REG
Status Affected:
None
Description:
RESET
Software Reset
Syntax:
[ label ] RESET
Operands:
None
Operation:
Status Affected:
None
Description:
DS40001723C-page 238
PIC12(L)F1571/2
RETFIE
RETURN
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
None
Operation:
TOS PC,
1 GIE
Operation:
TOS PC
Status Affected:
None
Status Affected:
None
Description:
Description:
Words:
Cycles:
Example:
RETFIE
RETFIE
After Interrupt
PC =
GIE =
TOS
1
RETLW
Syntax:
[ label ]
Operands:
0 k 255
Operation:
k (W);
TOS PC
Status Affected:
None
Description:
Words:
Cycles:
Example:
TABLE
RETURN
RETLW k
RLF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
Description:
RLF
C
CALL TABLE;W contains table
;offset value
ADDWF PC ;W = offset
RETLW k1 ;Begin table
RETLW k2 ;
Before Instruction
W =
After Instruction
W =
Words:
Cycles:
Example:
RLF
f,d
Register f
REG1,0
Before Instruction
REG1
C
After Instruction
REG1
W
C
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
0x07
value of k8
DS40001723C-page 239
PIC12(L)F1571/2
RRF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
RRF f,d
SUBLW
Syntax:
[ label ]
Operands:
0 k 255
Operation:
k - (W) W)
C, DC, Z
The W register is subtracted (2s complement method) from the 8-bit literal
k. The result is placed in the W register.
Operation:
Status Affected:
Status Affected:
Description:
Description:
Register f
SUBLW k
C=0
Wk
C=1
Wk
DC = 0
W<3:0> k<3:0>
DC = 1
W<3:0> k<3:0>
SLEEP
SUBWF
Subtract W from f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
SLEEP
Operands:
None
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected:
TO, PD
Description:
DS40001723C-page 240
SUBWF f,d
Operation:
Status Affected:
C, DC, Z
Description:
C=0
Wf
C=1
Wf
DC = 0
W<3:0> f<3:0>
DC = 1
W<3:0> f<3:0>
SUBWFB
Syntax:
SUBWFB
Operands:
0 f 127
d [0,1]
Operation:
f {,d}
Status Affected:
C, DC, Z
Description:
PIC12(L)F1571/2
SWAPF
Swap Nibbles in f
SWAPF f,d
XORLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
(f<3:0>) (destination<7:4>),
(f<7:4>) (destination<3:0>)
Operation:
(W) .XOR. k W)
Operation:
Status Affected:
Status Affected:
None
Description:
Description:
TRIS
Syntax:
[ label ] TRIS f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
Operands:
5f7
Operation:
Status Affected:
None
Description:
XORWF
XORLW k
Exclusive OR W with f
XORWF
f,d
Status Affected:
Description:
DS40001723C-page 241
PIC12(L)F1571/2
26.0
ELECTRICAL SPECIFICATIONS
26.1
Maximum current rating requires even load distribution across I/O pins. Maximum current rating may be
limited by the device package power dissipation characterizations, see Table 26-6: Thermal
Characteristics to calculate device specifications.
NOTICE: Stresses above those listed under Absolute Maximum Ratings may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure above maximum rating conditions for
extended periods may affect device reliability.
DS40001723C-page 242
PIC12(L)F1571/2
26.2
The standard operating conditions for any device are defined as:
Operating Voltage:
Operating Temperature:
DS40001723C-page 243
PIC12(L)F1571/2
VOLTAGE FREQUENCY GRAPH, -40C TA +125C, PIC12F1571/2 ONLY
FIGURE 26-1:
Rev. 10-000130B
9/19/2013
VDD (V)
5.5
2.5
2.3
16
32
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 26-7 for each Oscillator modes supported frequencies.
FIGURE 26-2:
Rev. 10-000131B
9/19/2013
VDD (V)
3.6
2.5
1.8
0
16
32
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 26-7 for each Oscillator modes supported frequencies.
DS40001723C-page 244
PIC12(L)F1571/2
26.3
DC Characteristics
TABLE 26-1:
SUPPLY VOLTAGE
PIC12LF1571/2
PIC12F1571/2
Param.
No.
D001
Sym.
VDD
Characteristic
Min.
Typ
Max.
Units
VDDMIN
1.8
2.5
VDDMAX
3.6
3.6
V
V
FOSC 16 MHz
FOSC 32 MHz (Note 3)
2.3
2.5
5.5
5.5
V
V
FOSC 16 MHz
FOSC 32 MHz (Note 3)
1.5
1.7
1.6
1.6
0.8
Supply Voltage
D001
D002*
VDR
D002*
D002A* VPOR
D002A*
D002B* VPORR*
Conditions
D002B*
1.5
D003
VFVR
1.024
-40C TA +85C
D003A
VADFVR
-4
+4
D003B
-4
+4
D004*
SVDD
0.05
V/ms
DS40001723C-page 245
PIC12(L)F1571/2
FIGURE 26-3:
VDD
VPOR
VPORR
SVDD
VSS
NPOR(1)
POR REARM
VSS
TVLOW(2)
Note 1:
2:
3:
DS40001723C-page 246
TPOR(3)
PIC12(L)F1571/2
TABLE 26-2:
PIC12LF1571/2
PIC12F1571/2
Param.
No.
D013
D013
D014
D014
D015
D015
D016
D016
D017*
D017*
D018
D018
Device
Characteristics
Conditions
Min.
Typ
Max.
Units
35
44
1.8
60
69
3.0
68
93
2.3
91
120
3.0
131
160
5.0
116
132
1.8
203
233
3.0
174
221
2.3
234
286
3.0
299
374
5.0
5.5
11
1.8
7.3
12
3.0
13
21
2.3
15
24
3.0
17
25
5.0
Note
VDD
111
151
1.8
133
176
3.0
144
209
2.3
162
237
3.0
216
288
5.0
0.5
0.6
mA
1.8
0.7
0.9
mA
3.0
0.6
0.8
mA
2.3
0.8
0.9
mA
3.0
0.9
1.0
mA
5.0
0.7
0.8
mA
1.8
1.1
1.2
mA
3.0
0.9
1.1
mA
2.3
1.1
1.3
mA
3.0
1.3
1.5
mA
5.0
FOSC = 1 MHz,
External Clock (ECM),
Medium-Power mode
FOSC = 1 MHz,
External Clock (ECM),
Medium-Power mode
FOSC = 4 MHz,
External Clock (ECM),
Medium-Power mode
FOSC = 4 MHz,
External Clock (ECM),
Medium-Power mode
FOSC = 31 kHz,
LFINTOSC,
-40C TA +85C
FOSC = 31 kHz,
LFINTOSC,
-40C TA +85C
FOSC = 500 kHz,
MFINTOSC
FOSC = 500 kHz,
MFINTOSC
FOSC = 8 MHz,
HFINTOSC
FOSC = 8 MHz,
HFINTOSC
FOSC = 16 MHz,
HFINTOSC
FOSC = 16 MHz,
HFINTOSC
DS40001723C-page 247
PIC12(L)F1571/2
TABLE 26-2:
PIC12LF1571/2
PIC12F1571/2
Param.
No.
Device
Characteristics
Conditions
Min.
Typ
Max.
Units
D018A*
2.4
mA
3.0
FOSC = 32 MHz,
HFINTOSC (Note 3)
D018A*
2.1
2.5
mA
3.0
2.2
2.6
mA
5.0
FOSC = 32 MHz,
HFINTOSC (Note 3)
D019A
1.7
1.9
mA
3.0
FOSC = 32 MHz,
External Clock (ECH),
High-Power mode (Note 3)
D019A
1.8
mA
3.0
1.9
2.3
mA
5.0
FOSC = 32 MHz,
External Clock (ECH),
High-Power mode (Note 3)
2.2
5.9
1.8
4.3
8.3
3.0
12
20
2.3
15
25
3.0
17
26
5.0
18
25
1.8
30
38
3.0
29
40
2.3
37
51
3.0
42
53
5.0
D019B
D019B
D019C
D019C
VDD
Note
FOSC = 32 kHz,
External Clock (ECL),
Low-Power mode
FOSC = 32 kHz,
External Clock (ECL),
Low-Power mode
FOSC = 500 kHz,
External Clock (ECL),
Low-Power mode
FOSC = 500 kHz,
External Clock (ECL),
Low-Power mode
DS40001723C-page 248
PIC12(L)F1571/2
TABLE 26-3:
PIC12LF1571/2
PIC12F1571/2
Param.
No.
D022
Device Characteristics
Base IPD
D022
Base IPD
D022A
Base IPD
D023
D023
D023A
D023A
Min.
Typ
Max.
+85C
Max.
+125C
Units
Conditions
VDD
Note
0.020
0.6
2.6
1.8
0.025
0.8
2.9
3.0
0.2
0.9
2.8
2.3
0.3
3.0
3.8
3.0
0.4
3.6
4.5
5.0
14
15
2.3
11
19
21
3.0
12
21
22
5.0
0.3
0.8
2.9
1.8
0.5
1.1
3.5
3.0
0.5
1.7
4.1
2.3
0.6
1.9
4.4
3.0
0.7
2.1
4.7
5.0
13
18
20
1.8
22
28
29
3.0
16
24
25
2.3
19
30
31
3.0
FVR Current
FVR Current
20
33
35
5.0
D024
6.5
11
3.0
BOR Current
D024
7.0
10
11
3.0
BOR Current
8.0
12
13
5.0
D24A
0.2
3.0
LPBOR Current
D24A
0.4
3.0
LPBOR Current
0.5
5.0
D026
0.03
0.7
2.7
1.8
0.04
0.8
3.0
0.2
1.3
3.8
2.3
0.3
1.4
3.9
3.0
0.4
1.5
5.0
250
1.8
250
3.0
280
2.3
280
3.0
280
5.0
D026
D026A*
D026A*
Note 1:
2:
3:
DS40001723C-page 249
PIC12(L)F1571/2
TABLE 26-3:
PIC12LF1571/2
PIC12F1571/2
Param.
No.
Device Characteristics
D027
D027
D028A
D028A
Note 1:
2:
3:
Typ
Max.
+85C
4.2
Conditions
Max.
+125C
Units
1.8
10
3.0
13
20
21
2.3
14
23
25
3.0
16
24
26
5.0
20
35
36
1.8
21
36
38
3.0
28
47
48
2.3
29
51
52
3.0
31
52
53
5.0
Min.
VDD
Note
Comparator,
CxSP = 0
Comparator,
CxSP = 0
Comparator,
Normal Power, CxSP = 1
(Note 1)
Comparator,
Normal Power, CxSP = 1
VREGPM = 1 (Note 1)
DS40001723C-page 250
PIC12(L)F1571/2
TABLE 26-4:
I/O PORTS
Sym.
VIL
Characteristic
Min.
Typ
Max.
Units
Conditions
I/O PORT:
D030
D030A
D031
0.8
0.15 VDD
0.2 VDD
0.3 VDD
MCLR
VIH
0.8
0.2 VDD
I/O PORT:
D040
2.0
0.25 VDD +
0.8
0.8 VDD
0.7 VDD
D040A
D041
MCLR
IIL
D060
MCLR(2)
IPUR
D080
125
nA
1000
nA
50
200
nA
25
100
200
25
140
300
0.6
VDD - 0.7
50
pF
D070*
VOL
I/O Ports
D061
I/O Ports
VOH
D090
2.1
0.8 VDD
I/O Ports
D101A* CIO
DS40001723C-page 251
PIC12(L)F1571/2
TABLE 26-5:
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
Program Memory
Programming Specifications
D110
VIHH
8.0
9.0
D111
IDDP
10
mA
D112
VBE
D113
VPEW
D114
(Note 2)
2.7
VDDMAX
VDDMIN
VDDMAX
1.0
mA
D115
5.0
mA
D121
EP
Cell Endurance
10K
E/W
D122
VPRW
VDDMIN
VDDMAX
D123
TIW
2.5
ms
D124
TRETD
Characteristic Retention
40
Year
Provided no other
specifications are violated
D125
EHEFC
100K
E/W
0C TA +60C, lower
byte last 128 addresses
Data in Typ column is at 3.0V, 25C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: Self-write and Block Erase.
2: Required only if single-supply programming is disabled.
DS40001723C-page 252
PIC12(L)F1571/2
TABLE 26-6:
THERMAL CHARACTERISTICS
TH01
TH02
TH03
TH04
TH05
Sym.
Characteristic
JA
JC
TJMAX
PD
Typ.
Units
Conditions
56.7
C/W
89.3
C/W
149.5
C/W
9.0
C/W
43.1
C/W
39.9
C/W
150
PD = PINTERNAL + PI/O
TH06
PI/O
TH07
PDER
Derated Power
Note 1: IDD is current to run the chip alone without driving any load on the output pins.
2: TA = Ambient Temperature; TJ = Junction Temperature
DS40001723C-page 253
PIC12(L)F1571/2
26.4
AC Characteristics
Timing Parameter Symbology has been created with one of the following formats:
1. TppS2ppS
2. TppS
T
F
Frequency
Lowercase letters (pp) and their meanings:
pp
cc
CCP1
ck
CLKOUT
cs
CS
di
SDIx
do
SDO
dt
Data in
io
I/O PORT
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (High-impedance)
L
Low
FIGURE 26-4:
Time
osc
rd
rw
sc
ss
t0
t1
wr
CLKIN
RD
RD or WR
SCKx
SS
T0CKI
T1CKI
WR
P
R
V
Z
Period
Rise
Valid
High-impedance
LOAD CONDITIONS
Rev. 10-000133A
8/1/2013
Load Condition
Pin
CL
VSS
DS40001723C-page 254
PIC12(L)F1571/2
FIGURE 26-5:
CLOCK TIMING
Q4
Q1
Q2
Q3
Q4
Q1
CLKIN
OS02
OS04
OS04
OS03
CLKOUT
(CLKOUT Mode)
Note
1:
TABLE 26-7:
OS01
Sym.
FOSC
Characteristic
Min.
Typ
Max.
Units
Conditions
DC
0.5
MHz
DC
MHz
DC
20
MHz
OS02
TOSC
50
ns
OS03
TCY
200
TCY
DC
ns
TCY = 4/FOSC
DS40001723C-page 255
PIC12(L)F1571/2
TABLE 26-8:
OSCILLATOR PARAMETERS
Sym.
Characteristic
Freq.
Tolerance
Min.
Typ
Max.
Units
MHz
OS08
HFOSC
2%
16.0
OS09
LFOSC
31
kHz
OS10*
TIOSC ST
HFINTOSC
Wake-up from Sleep Start-up Time
15
0.5
ms
Conditions
-40C TA +125C
FIGURE 26-6:
125
5%
Temperature (C)
85
3%
60
2%
25
0
5%
-40
1.8
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
TABLE 26-9:
Param
No.
Sym.
Characteristic
Min.
Typ
Max.
Units
F10
MHz
F11
FSYS
16
32
MHz
F12
TRC
F13*
CLK
ms
-0.25%
+0.25%
Conditions
DS40001723C-page 256
PIC12(L)F1571/2
FIGURE 26-7:
Cycle
Fetch
Read
Execute
Q4
Q1
Q2
Q3
FOSC
OS12
OS11
OS20
OS21
CLKOUT
OS19
OS18
OS16
OS13
OS17
I/O pin
(Input)
OS14
OS15
I/O pin
(Output)
New Value
Old Value
OS18, OS19
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
TosH2ckL
FOSC to CLKOUT(1)
70
ns
OS12
TosH2ckH
FOSC to
CLKOUT(1)
72
ns
OS13
TckL2ioV
20
ns
OS14
TioV2ckH
TOSC + 200 ns
ns
OS15
TosH2ioV
50
70*
ns
OS16
TosH2ioI
50
ns
OS17
TioV2osH
20
ns
OS18*
TioR
40
15
72
32
ns
VDD = 1.8V
3.3V VDD 5.0V
OS19*
TioF
28
15
55
30
ns
VDD = 1.8V
3.3V VDD 5.0V
OS11
OS20*
Tinp
25
ns
OS21*
Tioc
25
ns
DS40001723C-page 257
PIC12(L)F1571/2
FIGURE 26-8:
VDD
MCLR
30
Internal
POR
PWRT
Time-out
33
32
OSC
Start-up Time
Internal Reset(1)
Watchdog Timer
Reset(1)
34
31
34
I/O pins
Note 1: Asserted low.
DS40001723C-page 258
PIC12(L)F1571/2
TABLE 26-11: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER
AND BROWN-OUT RESET PARAMETERS
Standard Operating Conditions (unless otherwise stated)
Param.
No.
Sym.
Characteristic
Min.
Typ
Max.
Units
Conditions
30
TMCL
31
10
16
27
ms
32
TOST
1024
TOSC
33*
TPWRT
40
65
140
ms
34*
TIOZ
2.0
35
VBOR
2.55
2.70
2.85
BORV = 0
2.35
1.80
2.45
1.90
2.58
2.05
V
V
BORV = 1 (PIC12F1571/2)
BORV = 1 (PIC12LF1571/2)
VDD = 3.3V-5V,
1:16 Prescaler used
PWRTE = 0
36*
VHYST
25
60
mV
-40C TA +85C
37*
16
35
VDD VBOR
1.8
2.1
2.5
LPBOR = 1
38
*
FIGURE 26-9:
VDD
VBOR and VHYST
VBOR
37
Reset
(due to BOR)
33
DS40001723C-page 259
PIC12(L)F1571/2
FIGURE 26-10:
T0CKI
40
41
42
T1CKI
45
46
49
47
TMR0 or
TMR1
40*
Sym.
TT0H
Characteristic
Min.
No Prescaler
With Prescaler
TT0L
41*
No Prescaler
With Prescaler
Typ
Max.
Units
0.5 TCY + 20
ns
10
ns
0.5 TCY + 20
ns
10
ns
Greater of:
20 or TCY + 40
N
ns
42*
TT0P
T0CKI Period
45*
TT1H
0.5 TCY + 20
ns
15
ns
Asynchronous
30
ns
Synchronous, No Prescaler
0.5 TCY + 20
ns
15
ns
Asynchronous
30
ns
Greater of:
30 or TCY + 40
N
ns
TT1L
46*
T1CKI Low
Time
47*
TT1P
49*
Asynchronous
60
ns
2 TOSC
7 TOSC
Conditions
N = prescale value
N = prescale value
Timers in Sync
mode
DS40001723C-page 260
PIC12(L)F1571/2
TABLE 26-13: ANALOG-TO-DIGITAL CONVERTER (ADC) CHARACTERISTICS(1,2,3)
Operating Conditions (unless otherwise stated)
VDD = 3.0V, TA = 25C
Param.
Sym.
No.
Characteristic
Min.
Typ
Max.
Units
Conditions
AD01
NR
Resolution
10
AD02
EIL
Integral Error
1.7
AD03
EDL
Differential Error
AD04
2.5
AD05
EGN
2.0
Gain Error
bit
LSb VREF = 3.0V
LSb No missing codes
VREF = 3.0V
AD06
1.8
VDD
AD07
VAIN
Full-Scale Range
VSS
VREF
AD08
ZAIN
Recommended Impedance of
Analog Voltage Source
10
Note 1:
2:
3:
4:
DS40001723C-page 261
PIC12(L)F1571/2
FIGURE 26-11:
BSF ADCON0, GO
AD133
1 TCY
AD131
Q4
AD130
ADC_clk
9
ADC Data
0
NEW_DATA
OLD_DATA
ADRES
1 TCY
ADIF
GO
Sample
DONE
Sampling Stopped
AD132
FIGURE 26-12:
BSF ADCON0, GO
AD133
1 TCY
AD131
Q4
AD130
ADC_clk
9
ADC Data
OLD_DATA
ADRES
0
NEW_DATA
ADIF
1 TCY
GO
DONE
Sample
AD132
Sampling Stopped
Note 1: If the ADC clock source is selected as FRC, a time of TCY is added before the ADC clock starts. This allows the
SLEEP instruction to be executed.
DS40001723C-page 262
PIC12(L)F1571/2
TABLE 26-14: ADC CONVERSION REQUIREMENTS
Standard Operating Conditions (unless otherwise stated)
Param.
Sym.
No.
AD130* TAD
AD131 TCNV
Characteristic
Min.
Typ
Max. Units
1.0
6.0
1.0
2.0
Conversion Time
(not including Acquisition Time)(1)
11
Conditions
FOSC-based
6.0
TAD
5.0
1/2 TAD
1/2 TAD + 1TCY
FOSC-based
ADCS<2:0> = x11 (ADC FRC mode)
DS40001723C-page 263
PIC12(L)F1571/2
TABLE 26-15: COMPARATOR SPECIFICATIONS(1)
Operating Conditions (unless otherwise stated)
VDD = 3.0V, TA = 25C
Param.
No.
Sym.
Characteristics
Min.
Typ.
Max.
Units
Comments
CM01
VIOFF
7.5
60
mV
CM02
VICM
VDD
CM03
CMRR
50
dB
400
800
ns
CxSP = 1
200
400
ns
CxSP = 1
1200
ns
CxSP = 0
550
ns
CxSP = 0
10
25
mV
CM04A
CM04B
CM04C
TRESP(2)
CM04D
CM05*
TMC2OV
CM06
*
Note 1:
2:
CxSP = 1,
VICM = VDD/2
CxHYS = 1,
CxSP = 1
Sym.
Characteristics
Min.
Typ.
Max.
Units
VDD/32
DAC01*
CLSB
Step Size
DAC02*
CACC
Absolute Accuracy
1/2
LSb
DAC03*
CR
5K
CST
Time(2)
10
DAC04*
*
Note 1:
2:
Settling
Comments
DS40001723C-page 264
PIC12(L)F1571/2
FIGURE 26-13:
CK
US121
US121
DT
US122
US120
Note:
Symbol
US120
TCKH2DTV
US121
US122
TCKRF
TDTRF
FIGURE 26-14:
Characteristic
Min.
Max.
Units
Conditions
80
ns
100
ns
45
ns
50
ns
45
ns
50
ns
US125
DT
US126
Note: Refer to Figure 26-4 for load conditions.
Symbol
Characteristic
Min.
Max.
Units
10
ns
15
ns
Conditions
DS40001723C-page 265
PIC12(L)F1571/2
27.0
The graphs and tables provided in this section are for design guidance and are not tested.
In some graphs or tables, the data presented are outside specified operating range (i.e., outside specified VDD
range). This is for information only and devices are ensured to operate properly only within the specified range.
Note:
The graphs and tables provided following this note are a statistical summary based on a limited number of
samples and are provided for informational purposes only. The performance characteristics listed herein
are not tested or guaranteed. In some graphs or tables, the data presented may be outside the specified
operating range (e.g., outside specified power supply range) and therefore, outside the warranted range.
Typical represents the mean of the distribution at 25C. MAXIMUM, Max., MINIMUM or Min.
DS40001723C-page 266
PIC12(L)F1571/2
FIGURE 27-1:
6.0
5.5
Max.
Max: 85C + 3
Typical: 25C
5.0
4.5
Typical
IDD (A)
4.0
3.5
3.0
2.5
2.0
1.5
1.0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-2:
25
Max: 85C + 3
Typical: 25C
20
Max.
IDD (A)
Typical
15
10
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 267
PIC12(L)F1571/2
FIGURE 27-3:
40
Max: 85C + 3
Typical: 25C
35
Max.
Typical
IDD (A)
30
25
20
15
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-4:
50
Max.
Max: 85C + 3
Typical: 25C
45
IDD (A)
40
Typical
35
30
25
20
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 268
PIC12(L)F1571/2
FIGURE 27-5:
300
Typical: 25C
250
4 MHz
IDD (A)
200
150
100
1 MHz
50
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-6:
300
4 MHz
Max: 85C + 3
250
IDD (A)
200
150
100
1 MHz
50
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
DS40001723C-page 269
PIC12(L)F1571/2
FIGURE 27-7:
350
4 MHz
Typical: 25C
300
IDD (A)
250
200
150
1 MHz
100
50
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-8:
400
350
4 MHz
Max: 85C + 3
300
IDD (A)
250
200
1 MHz
150
100
50
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 270
PIC12(L)F1571/2
FIGURE 27-9:
2.5
Typical: 25C
IDD (mA)
2.0
32 MHz
1.5
16 MHz
1.0
8 MHz
0.5
0.0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-10:
2.5
Max: 85C + 3
32 MHz
IDD (mA)
2.0
1.5
16 MHz
1.0
8 MHz
0.5
0.0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
DS40001723C-page 271
PIC12(L)F1571/2
FIGURE 27-11:
2.5
Typical: 25C
2.0
32 MHz
IDD (mA)
1.5
16 MHz
1.0
8 MHz
0.5
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-12:
2.5
Max: 85C + 3
32 MHz
IDD (mA)
2.0
1.5
16 MHz
1.0
8 MHz
0.5
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 272
PIC12(L)F1571/2
FIGURE 27-13:
10
Max.
9
Max: 85C + 3
Typical: 25C
Typical
IDD (A)
8
7
6
5
4
3
2
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-14:
25
Max: 85C + 3
Typical: 25C
20
Max.
IDD (A)
Typical
15
10
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 273
PIC12(L)F1571/2
FIGURE 27-15:
170
160
Max: 85C + 3
Typical: 25C
Max.
IDD (A)
150
140
Typical
130
120
110
100
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-16:
260
Max.
Max: 85C + 3
Typical: 25C
240
Typical
220
IDD (A)
200
180
160
140
120
100
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 274
PIC12(L)F1571/2
FIGURE 27-17:
1.4
16 MHz
Typical: 25C
1.2
IDD (mA)
1.0
8 MHz
0.8
4 MHz
0.6
2 MHz
0.4
1 MHz
0.2
0.0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-18:
1.4
16 MHz
Max: 85C + 3
1.2
1.0
IDD (mA)
8 MHz
0.8
4 MHz
2 MHz
0.6
1 MHz
0.4
0.2
0.0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
DS40001723C-page 275
PIC12(L)F1571/2
FIGURE 27-19:
1.4
16 MHz
Typical: 25C
1.2
1.0
IDD (mA)
8 MHz
0.8
4 MHz
2 MHz
0.6
1 MHz
0.4
0.2
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
FIGURE 27-20:
1.6
1.4
16 MHz
Max: 85C + 3
1.2
IDD (mA)
1.0
8 MHz
0.8
4 MHz
2 MHz
0.6
1 MHz
0.4
0.2
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 276
PIC12(L)F1571/2
FIGURE 27-21:
350
300
Max: 85C + 3
Typical: 25C
Max.
IPD (nA
(nA)
250
200
150
100
Typical
50
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-22:
0.8
0.7
Max: 85C + 3
Typical: 25C
IPD (A
(A)
0.6
Max
0.5
0.4
0.3
Typical
0.2
0.1
0.0
20
2.0
2
2.5
5
3
3.0
0
3
3.5
5
4
4.0
0
4
4.5
5
5
5.0
0
5
5.5
5
6
6.0
0
VDD (V)
DS40001723C-page 277
PIC12(L)F1571/2
FIGURE 27-23:
1.0
0.9
Max: 85C + 3
Typical: 25C
0.8
Max.
IPD (A)
0.7
0.6
Typical
0.5
04
0.4
0.3
0.2
0.1
0.0
16
1.6
1
1.8
8
2
2.0
0
2
2.2
2
2
2.4
4
2
2.6
6
2
2.8
8
3
3.0
0
3
3.2
2
3
3.4
4
3
3.6
6
3
3.8
8
VDD (V)
FIGURE 27-24:
1.6
1.4
Max: 85C + 3
Typical: 25C
1.2
Max.
IPD (A
(A)
1.0
0.8
Typical
0.6
0.4
0.2
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 278
PIC12(L)F1571/2
FIGURE 27-25:
28
Max: 85C + 3
Typical: 25C
26
24
Max.
IPD (uA)
22
20
18
T i l
Typical
16
14
12
10
16
1.6
1
1.8
8
2
2.0
0
2
2.2
2
2
2.4
4
2
2.6
6
2
2.8
8
3
3.0
0
3
3.2
2
3
3.4
4
3
3.6
6
3
3.8
8
VDD (V)
FIGURE 27-26:
24
22
Max.
20
IPD (uA
(uA)
Typical
18
16
14
Max: 85C + 3
Typical: 25
C
25C
12
10
20
2.0
2
5
2.5
3
0
3.0
3
5
3.5
4
0
4.0
4
5
4.5
5
0
5.0
5
5
5.5
6
0
6.0
VDD (V)
DS40001723C-page 279
PIC12(L)F1571/2
FIGURE 27-27:
9
8.5
Max: 85C + 3
Typical: 25C
Max.
IPD ((uA)
7.5
7
Typical
6.5
6
5.5
5
4.5
24
2.4
2
2.5
5
2
2.6
6
2
2.7
7
2
2.8
8
2
2.9
9
3
3.0
0
3
3.1
1
3
3.2
2
3
3.3
3
3
3.4
4
3
3.5
5
3
3.6
6
3
3.7
7
5
4
5.4
5
6
5.6
VDD (V)
FIGURE 27-28:
12
11
Max: 85C + 3
Typical: 25C
10
Max.
IPD (uA)
9
8
Typical
7
6
5
4
2
8
2.8
3
0
3.0
3
2
3.2
3
4
3.4
3
6
3.6
3
8
3.8
4
0
4.0
4
2
4.2
4
4
4.4
4
6
4.6
4
8
4.8
5
0
5.0
5
2
5.2
VDD (V)
DS40001723C-page 280
PIC12(L)F1571/2
FIGURE 27-29:
1.8
16
1.6
Max: 85C + 3
Typical: 25C
1.4
Max.
IPD (uA
(uA)
1.2
1
0.8
0.6
0.4
Typical
0.2
0
2.4
2.5
2.6
2.7
2.8
2.9
3.0
3.1
3.2
3.3
3.4
3.5
3.6
3.7
VDD (V)
FIGURE 27-30:
1.8
Max: 85C + 3
Typical: 25C
1.6
Max.
1.4
IDD (A
(A)
1.2
1.0
0.8
0.6
Typical
0.4
0.2
0.0
28
2.8
3
3.0
0
3
3.2
2
3
3.4
4
3
3.6
6
3
3.8
8
4
4.0
0
4
4.2
2
4
4.4
4
4
4.6
6
4
4.8
8
5
5.0
0
5
5.2
2
5
5.4
4
5
5.6
6
VDD (V)
DS40001723C-page 281
PIC12(L)F1571/2
FIGURE 27-31:
500
450
Max: 85C + 3
Typical: 25C
400
Max.
350
IPD (A)
300
250
200
150
100
Typical
50
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
FIGURE 27-32:
1.4
Max: 85C + 3
Typical: 25C
1.2
Max.
IDD (A)
1.0
0.8
0.6
0.4
Typical
0.2
0.0
15
1.5
2
0
2.0
2
5
2.5
3
0
3.0
3
5
3.5
4
0
4.0
4
5
4.5
5
0
5.0
5
5
5.5
6
0
6.0
VDD (V)
DS40001723C-page 282
PIC12(L)F1571/2
FIGURE 27-33:
22
Max: 85C + 3
Typical: 25C
20
Max.
18
Typical
IPD (
(A)
16
14
12
10
8
6
4
2
0
2.0
2
5
2.5
3
0
3.0
3
5
3.5
4
0
4.0
4
5
4.5
5
0
5.0
5
5
5.5
6
0
6.0
VDD (V)
FIGURE 27-34:
32
Max: -40C + 3
Typical: 25C
30
28
Max.
IPD (A
(A)
26
24
22
Typical
20
18
16
14
12
16
1.6
1
1.8
8
2
2.0
0
2
2.2
2
2
2.4
4
2
2.6
6
2
2.8
8
3
3.0
0
3
3.2
2
3
3.4
4
3
3.6
6
3
3.8
8
VDD (V)
DS40001723C-page 283
PIC12(L)F1571/2
FIGURE 27-35:
45
Max: -40C
40C + 3
Typical: 25C
40
Max.
35
IPD (A
(A)
Typical
30
25
20
15
10
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 284
PIC12(L)F1571/2
FIGURE 27-36:
1100
Max: 85C + 3
Typical: 25C
1000
900
Max.
IPD (A
(A)
800
700
Typical
600
500
400
300
200
16
1.6
1
8
1.8
2
0
2.0
2
2
2.2
2
4
2.4
2
6
2.6
2
8
2.8
3
0
3.0
3
2
3.2
3
4
3.4
3
6
3.6
3
8
3.8
VDD (V)
FIGURE 27-37:
1,200
Max: 85C + 3
Typical: 25C
1,100
Max.
1,000
Typical
IPD (A
(A)
900
800
700
600
500
400
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
6.0
VDD (V)
DS40001723C-page 285
PIC12(L)F1571/2
FIGURE 27-38:
60
Max: Typical + 3
Typical: statistical mean @ 25C
50
Max.
Time (us)
40
Typical
30
20
Note:
The FVR Stabilization Period applies when:
1) coming out of RESET or exiting Sleep mode for PIC12/16LFxxxx devices.
2) when exiting sleep mode with VREGPM = 1 for PIC12/16Fxxxx devices
In all other cases, the FVR is stable when released from RESET.
10
0
1.6
1.8
2.0
2.2
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
VDD (V)
DS40001723C-page 286
PIC12(L)F1571/2
28.0
DEVELOPMENT SUPPORT
28.1
Multiple projects
Multiple tools
Multiple configurations
Simultaneous debugging sessions
DS40001723C-page 287
PIC12(L)F1571/2
28.2
MPLAB XC Compilers
28.3
MPASM Assembler
28.4
28.5
DS40001723C-page 288
PIC12(L)F1571/2
28.6
28.7
28.8
28.9
The MPLAB PICkit 3 allows debugging and programming of PIC and dsPIC Flash microcontrollers at a most
affordable price point using the powerful graphical user
interface of the MPLAB IDE. The MPLAB PICkit 3 is
connected to the design engineers PC using a fullspeed USB interface and can be connected to the target via a Microchip debug (RJ-11) connector (compatible with MPLAB ICD 3 and MPLAB REAL ICE). The
connector uses two device I/O pins and the Reset line
to implement in-circuit debugging and In-Circuit Serial
Programming (ICSP).
DS40001723C-page 289
PIC12(L)F1571/2
28.11 Demonstration/Development
Boards, Evaluation Kits, and
Starter Kits
A wide variety of demonstration, development and
evaluation boards for various PIC MCUs and dsPIC
DSCs allows quick application development on fully
functional systems. Most boards include prototyping
areas for adding custom circuitry and provide application firmware and source code for examination and
modification.
The boards support a variety of features, including LEDs,
temperature sensors, switches, speakers, RS-232
interfaces, LCD displays, potentiometers and additional
EEPROM memory.
DS40001723C-page 290
PIC12(L)F1571/2
29.0
PACKAGING INFORMATION
29.1
XXXXXXXX
XXXXXNNN
YYWW
NNN
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
Example
12F1571
E/Pe3 017
1310
Example
12F1571
E/SN1310
017
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week 01)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
DS40001723C-page 291
PIC12(L)F1571/2
Package Marking Information (Continued)
8-Lead MSOP (3x3 mm)
Example
L1571I
310017
XXXX
YYWW
NNN
PIN 1
DS40001723C-page 292
Example
MFQ0
1312
017
PIN 1
PIC12(L)F1571/2
TABLE 29-1:
Part Number
Marking
PIC12F1571-E/MF
MFY0/YYWW/NNN
PIC12F1572-E/MF
MGA0/YYWW/NNN
PIC12F1571-I/MF
MFZ0
PIC12F1572-I/MF
MGB0
PIC12LF1571-E/MF
MGC0
PIC12LF1572-E/MF
MCE0
PIC12LF1571-I/MF
MGD0
PIC12LF1572-I/MF
MGF0
DS40001723C-page 293
PIC12(L)F1571/2
29.2
Package Details
4
'(
"'# '5$ +")""'
5&'
'$'
''366+++(
(65
NOTE 1
E1
2
D
A2
A1
e
eB
b1
b
7'"
("
:('"
8#(*
&"
8-9/
8
8;
<
'
'
'
>
>
$$5
5""
.
2"'
'
>
>
#$ '
#$ ?$'
.
.
$$5?$'
/
=
;! :'
.=
.@
'
'
.
:$ 5""
=
*
@
=
2
>
>
7 :$?$'
:
+ :$?$'
;!
+,
2-
.
!"#$%&'# (! )*#'(#"'*
'$+'''$
,&'- ' "'
. ("
"$/$
'#$(
$&"
' #"
"
$&"
' #"
""
'%$0 "$
("
$'
/1
2-32"("
'%'!#"
++'
#''
"
+ -=2
DS40001723C-page 294
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 295
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 296
PIC12(L)F1571/2
!
""#$%& !'
4
'(
"'# '5$ +")""'
5&'
'$'
''366+++(
(65
DS40001723C-page 297
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 298
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 299
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 300
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 301
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 302
PIC12(L)F1571/2
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
DS40001723C-page 303
PIC12(L)F1571/2
APPENDIX A:
DATA SHEET
REVISION HISTORY
Revision A (10/2013)
Original release of this document.
Revision B (2/2014)
Updated PIC12(L)F1571/2 Family Types table
Program Memory Flash heading (words to Kwords).
Revision C (8/2014)
Updated PWM chapter. Changed to Final data sheet.
Updated IDD and IPD parameters in the Electrical
Specification chapter. Added Characterization Graphs.
Added Section
Conventions.
1.1:
Register
and
Bit
Naming
DS40001723C-page 304
PIC12(L)F1571/2
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Customers
should
contact
their
distributor,
representative or Field Application Engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://microchip.com/support
DS40001723C-page 305
PIC12(L)F1571/2
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
[X](1)
PART NO.
Device
/XX
XXX
Package
Pattern
Examples:
a)
b)
Device:
PIC12LF1571, PIC12F1571
PIC12LF1572, PIC12F1572
Blank
T
Temperature
Range:
I
E
= -40C to +85C
= -40C to +125C
Package:(2)
P
SN
MS
MF
c)
Pattern:
=
=
=
=
(Industrial)
(Extended)
Plastic DIP
SOIC
MSOP
DFN
DS40001723C-page 306
PIC12LF1571T - I/SO
Tape and Reel,
Industrial temperature,
SOIC package
PIC12F1572 - I/P
Industrial temperature
PDIP package
PIC12F1571-E/MF
Extended Temperature
DFN Package
Note 1:
2:
PIC12(L)F1571/2
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.
Trademarks
== ISO/TS 16949 ==
2013-2014 Microchip Technology Inc.
DS40001723C-page 307
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Austin, TX
Tel: 512-257-3370
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Novi, MI
Tel: 248-848-4000
Houston, TX
Tel: 281-894-5983
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
New York, NY
Tel: 631-435-6000
San Jose, CA
Tel: 408-735-9110
Canada - Toronto
Tel: 905-673-0699
Fax: 905-673-6509
DS40001723C-page 308
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
China - Hangzhou
Tel: 86-571-8792-8115
Fax: 86-571-8792-8116
China - Hong Kong SAR
Tel: 852-2943-5100
Fax: 852-2401-3431
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
China - Shenzhen
Tel: 86-755-8864-2200
Fax: 86-755-8203-1760
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Germany - Dusseldorf
Tel: 49-2129-3766400
Japan - Tokyo
Tel: 81-3-6880- 3770
Fax: 81-3-6880-3771
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
Germany - Pforzheim
Tel: 49-7231-424750
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
Italy - Venice
Tel: 39-049-7625286
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
Poland - Warsaw
Tel: 48-22-3325737
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
Taiwan - Hsin Chu
Tel: 886-3-5778-366
Fax: 886-3-5770-955
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
Sweden - Stockholm
Tel: 46-8-5090-4654
UK - Wokingham
Tel: 44-118-921-5800
Fax: 44-118-921-5820
Taiwan - Kaohsiung
Tel: 886-7-213-7830
Taiwan - Taipei
Tel: 886-2-2508-8600
Fax: 886-2-2508-0102
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
03/25/14