Professional Documents
Culture Documents
Description
PIC16(L)F1574/5/8/9 microcontrollers combine the capabilities of 16-bit PWMs with Analog to suit a variety of applications.
These devices deliver four 16-bit PWMs with independent timers for applications where high resolution is needed, such as
LED lighting, stepper motors, power supplies and other general purpose applications. The core independent peripherals
(16-bit PWMs, Complementary Waveform Generator), Enhanced Universal Synchronous Asynchronous Receiver
Transceiver (EUSART) and Analog (ADCs, Comparator and DAC) enable closed-loop feedback and communication for
use in multiple market segments. The Peripheral Pin Select (PPS) functionality allows for I/O pin remapping of the digital
peripherals for increased flexibility. The EUSART peripheral enables the communication for applications such as LIN.
8-Bit/16-Bit Timers
Data Sheet Index
16-Bit PWM
5-Bit DAC
(Kwords)
EUSART
Debug(1)
(Kbytes)
I/O Pins
CWG
PPS
Device
Note: For other small form-factor package availability and marking information, please visit
http://www.microchip.com/packaging or contact your local sales office.
TABLE 2: PACKAGES
Packages PDIP SOIC TSSOP SSOP UQFN
PIC16(L)F1574
PIC16(L)F1575
PIC16(L)F1578
PIC16(L)F1579
VDD 1 14 VSS
RA5 2 13 RA0/ICSPDAT
PIC16(L)F1574/5
RA4 3 12 RA1/ICSPCLK
MCLR/VPP/RA3 4 11 RA2
RC5 5 10 RC0
RC4 6 9 RC1
RC3 7 8 RC2
VSS
NC
NC
16 15 14 13
RA5 1 12 RA0
/5
74
RA4 2 11 RA1
15
)F
MCLR/VPP/RA3 3 10 RA2
(L
RC5
16
4 9 RC0
C
PI
5 6 7 8
RC3
RC2
RC4
RC1
VDD 1 20 VSS
RA5 2 19 RA0
RA4 3 18 RA1
PIC16(L)F1578/9
MCLR/VPP/RA3 4 17 RA2
RC5 5 16 RC0
RC4 6 15 RC1
RC3 7 14 RC2
RC6 8 13 RB4
RC7 9 12 RB5
RB7 10 11 RB6
VDD
VSS
20 19 18 17 16
MCLR/VPP/RA3 1 15 RA1
/9
78
RC5 2 14 RA2
15
RC4 3 13 RC0
)F
(L
RC3 4 12 RC1
16
C
RC6 5 11 RC2
PI
6 7 8 9 10
RC7
RB7
RB6
RB5
RB4
16-Pin UQFN
Comparator
Reference
EUSART
Interrupt
Pull-up
Timers
Basic
PWM
CWG
ADC
I/O
20-Pin PDIP/SOIC/SSOP
20-Pin UQFN
Comparator
Reference
EUSART
Interrupt
Pull-up
Timers
Basic
CWG
PWM
ADC
I/O
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
PIC16(L)F1574
PIC16(L)F1575
PIC16(L)F1578
PIC16(L)F1579
Peripheral
Program
Flash Memory
RAM
PORTA
CLKOUT PORTB(4)
Timing
Generation
CPU
PORTC
CLKIN INTRC
Oscillator
(Note 3)
MCLR
Temp ADC
TMR2 TMR1 TMR0 C2 C1 DAC FVR
Indicator 10-bit
RA0/AN0/C1IN+/DAC1OUT1/ RA0 TTL/ST CMOS/OD General purpose input with IOC and WPU.
ICSPDAT AN0 AN — ADC Channel input.
C1IN+ AN — Comparator positive input.
DAC1OUT1 — AN Digital-to-Analog Converter output.
ICSPDAT ST CMOS ICSP™ Data I/O.
RA1/AN1/VREF+/C1IN0-/C2IN0-/ RA1 TTL/ST CMOS/OD General purpose input with IOC and WPU.
ICSPCLK AN1 AN — ADC Channel input.
VREF+ AN — Voltage Reference input.
C1IN0- AN — Comparator negative input.
C2IN0- AN — Comparator negative input.
ICSPCLK ST — ICSP Programming Clock.
RA2/AN2/T0CKI(1)/CWG1IN(1)/ RA2 TTL/ST CMOS/OD General purpose input with IOC and WPU.
INT(1) AN2 AN — ADC Channel input.
T0CKI TTL/ST — Timer0 clock input.
CWG1IN TTL/ST — CWG complementary input.
INT TTL/ST — External interrupt.
RA3/VPP/MCLR RA3 TTL/ST — General purpose input with IOC and WPU.
VPP HV — Programming voltage.
MCLR ST — Master Clear with internal pull-up.
(1)
RA4/AN3/T1G /CLKOUT RA4 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN3 AN — ADC Channel input.
T1G TTL/ST — Timer1 Gate input.
CLKOUT CMOS/OD CMOS FOSC/4 output.
RA5/CLKIN/T1CKI(1) RA5 TTL/ST CMOS/OD General purpose input with IOC and WPU.
CLKIN CMOS — External clock input (EC mode).
T1CKI TTL/ST — Timer1 clock input.
RC0/AN4/C2IN+ RC0 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN4 AN — ADC Channel input.
C2IN+ AN — Comparator positive input.
RC1/AN5/C1IN1-/C2IN1- RC1 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN5 AN — ADC Channel input.
C1IN1- AN — Comparator negative input.
C2IN1- AN — Comparator negative input.
RC2/AN6/C1IN2-/C2IN2- RC2 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN6 AN — ADC Channel input.
C1IN2- AN — Comparator negative input.
C2IN2- AN — Comparator negative input.
RC3/AN7/C1IN3-/C2IN3- RC3 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN7 AN — ADC Channel input.
C1IN3- AN — Comparator negative input.
C2IN3- AN — Comparator negative input.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open-Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels I2C™ = Schmitt Trigger input with I2C™
HV = High Voltage XTAL = Crystal levels
Note 1: Default peripheral input. Input can be moved to any other pin with the PPS input selection registers.
2: All pin outputs default to PORT latch data. Any pin can be selected as a digital peripheral output with the PPS output selection
registers. See Register 12-1.
3: These USART functions are bi-directional. The output pin selections must be the same as the input pin selections.
RA0/AN0/C1IN+/DAC1OUT/ RA0 TTL/ST CMOS/OD General purpose input with IOC and WPU.
ICSPDAT AN0 AN — ADC Channel input.
C1IN+ AN — Comparator positive input.
DAC1OUT — AN Digital-to-Analog Converter output.
ICSPDAT ST CMOS ICSP™ Data I/O.
RA1/AN1/VREF+/C1IN0-/C2IN0-/ RA1 TTL/ST CMOS/OD General purpose input with IOC and WPU.
ICSPCLK AN1 AN — ADC Channel input.
VREF+ AN — Voltage Reference input.
C1IN0- AN — Comparator negative input.
C2IN0- AN — Comparator negative input.
ICSPCLK ST — ICSP Programming Clock.
RA2/AN2/T0CKI(1)/CWG1IN(1)/ RA2 TTL/ST CMOS/OD General purpose input with IOC and WPU.
INT(1) AN2 AN — ADC Channel input.
T0CKI TTL/ST — Timer0 clock input.
CWG1IN TTL/ST — CWG complementary input.
INT TTL/ST — External interrupt.
RA3/VPP/MCLR RA3 TTL/ST — General purpose input with IOC and WPU.
VPP HV — Programming voltage.
MCLR ST — Master Clear with internal pull-up.
(1)
RA4/AN3/T1G /CLKOUT RA4 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN3 AN — ADC Channel input.
T1G TTL/ST — Timer1 Gate input.
CLKOUT — CMOS FOSC/4 output.
RA5/CLKIN/T1CKI(1) RA5 TTL/ST CMOS/OD General purpose input with IOC and WPU.
CLKIN CMOS — External clock input (EC mode).
T1CKI TTL/ST — Timer1 clock input.
RB4/AN10 RB4 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN10 AN — ADC Channel input.
(1)
RB5/AN11/RX RB5 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN11 AN — ADC Channel input.
RX ST — USART asynchronous input.
RB6 RB6 TTL/ST CMOS/OD General purpose input with IOC and WPU.
RB7/CK RB7 TTL/ST CMOS/OD General purpose input with IOC and WPU.
CK ST CMOS USART synchronous clock.
RC0/AN4/C2IN+ RC0 TTL/ST CMOS/OD General purpose input with IOC and WPU.
AN4 AN — ADC Channel input.
C2IN+ AN — Comparator positive input.
Legend: AN = Analog input or output CMOS = CMOS compatible input or output OD = Open-Drain
TTL = TTL compatible input ST = Schmitt Trigger input with CMOS levels I2C™ = Schmitt Trigger input with I2C™
HV = High Voltage XTAL = Crystal levels
Note 1: Default peripheral input. Input can be moved to any other pin with the PPS input selection registers.
2: All pin outputs default to PORT latch data. Any pin can be selected as a digital peripheral output with the PPS output selection
registers. See Register 12-1.
3: These USART functions are bidirectional. The output pin selections must be the same as the input pin selections.
Rev. 10-000055A
7/30/2013
15 Configuration
15 Data Bus 8
Program Counter
Flash
MUX
Program
Memory
16-Level Stack
RAM
(15-bit)
14
Program 12
Program Memory RAM Addr
Bus
Read (PMR)
Addr MUX
Instruction Reg
Indirect
Direct Addr 7 Addr
12
5 12
BSR Reg
15
FSR0 Reg
15 FSR1 Reg
STATUS Reg
8
3 MUX
Power-up
Instruction
Timer
Decode and
Power-on
Control
Reset ALU
8
Watchdog
CLKIN Timer
Timing
Generation Brown-out
CLKOUT Reset W Reg
Internal
Oscillator VDD VSS
Block
PC<14:0> PC<14:0>
CALL, CALLW CALL, CALLW
RETURN, RETLW 15 RETURN, RETLW
15
Interrupt, RETFIE Interrupt, RETFIE
Stack Level 0 Stack Level 0
Stack Level 1 Stack Level 1
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
Note 1: For Borrow, the polarity is reversed. A subtraction is executed by adding the two’s complement of the
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or low-order
bit of the source register.
PIC16(L)F1574/5/8/9
General General General General General General
32Fh 16 Bytes
Purpose Purpose Purpose Purpose Purpose Purpose Unimplemented
Register Register Register Register Register Register 330h Read as ‘0’
80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes Unimplemented
Read as ‘0’
PIC16(L)F1574/5/8/9
BANK0 BANK1 BANK2 BANK3 BANK4 BANK5 BANK6 BANK7
000h 080h 100h 180h 200h 280h 300h 380h
Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers
(Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2)
00Bh 08Bh 10Bh 18Bh 20Bh 28Bh 30Bh 38Bh
00Ch PORTA 08Ch TRISA 10Ch LATA 18Ch ANSELA 20Ch WPUA 28Ch ODCONA 30Ch SLRCONA 38Ch INLVLA
00Dh — 08Dh — 10Dh — 18Dh — 20Dh — 28Dh — 30Dh — 38Dh —
00Eh PORTC 08Eh TRISC 10Eh LATC 18Eh ANSELC 20Eh WPUC 28Eh ODCONC 30Eh SLRCONC 38Eh INLVLC
00Fh — 08Fh — 10Fh — 18Fh — 20Fh — 28Fh — 30Fh — 38Fh —
010h — 090h — 110h — 190h — 210h — 290h — 310h — 390h —
011h PIR1 091h PIE1 111h CM1CON0 191h PMADRL 211h — 291h — 311h — 391h IOCAP
012h PIR2 092h PIE2 112h CM1CON1 192h PMADRH 212h — 292h — 312h — 392h IOCAN
013h PIR3 093h PIE3 113h CM2CON0 193h PMDATL 213h — 293h — 313h — 393h IOCAF
014h — 094h — 114h CM2CON1 194h PMDATH 214h — 294h — 314h — 394h —
015h TMR0 095h OPTION_REG 115h CMOUT 195h PMCON1 215h — 295h — 315h — 395h —
016h TMR1L 096h PCON 116h BORCON 196h PMCON2 216h — 296h — 316h — 396h —
017h TMR1H 097h WDTCON 117h FVRCON 197h VREGCON(1) 217h — 297h — 317h — 397h IOCCP
018h T1CON 098h OSCTUNE 118h DACCON0 198h — 218h — 298h — 318h — 398h IOCCN
019h T1GCON 099h OSCCON 119h DACCON1 199h RCREG 219h — 299h — 319h — 399h IOCCF
01Ah TMR2 09Ah OSCSTAT 11Ah — 19Ah TXREG 21Ah — 29Ah — 31Ah — 39Ah —
01Bh PR2 09Bh ADRESL 11Bh — 19Bh SPBRGL 21Bh — 29Bh — 31Bh — 39Bh —
01Ch T2CON 09Ch ADRESH 11Ch — 19Ch SPBRGH 21Ch — 29Ch — 31Ch — 39Ch —
01Dh — 09Dh ADCON0 11Dh — 19Dh RCSTA 21Dh — 29Dh — 31Dh — 39Dh —
01Eh — 09Eh ADCON1 11Eh — 19Eh TXSTA 21Eh — 29Eh — 31Eh — 39Eh —
01Fh — 09Fh ADCON2 11Fh — 19Fh BAUDCON 21Fh — 29Fh — 31Fh — 39Fh —
020h 0A0h 120h 1A0h 220h 2A0h 320h 3A0h
General General General General General General General General
Purpose Purpose Purpose Purpose Purpose Purpose Purpose Purpose
Register Register Register Register Register Register Register Register
80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes
PIC16(L)F1574/5/8/9
General General General General General General
32Fh 16 Bytes
Purpose Purpose Purpose Purpose Purpose Purpose Unimplemented
Register Register Register Register Register Register 330h Read as ‘0’
80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes Unimplemented
Read as ‘0’
PIC16(L)F1574/5/8/9
General General General General General General General General
Purpose Purpose Purpose Purpose Purpose Purpose Purpose Purpose
Register Register Register Register Register Register Register Register
80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes 80 Bytes
PIC16(L)F1574/5/8/9
BANK 8 BANK 9 BANK 10 BANK 11 BANK 12 BANK 13 BANK 14 BANK 15
400h 480h 500h 580h 600h 680h 700h 780h
Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers
(Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2)
40Bh 48Bh 50Bh 58Bh 60Bh 68Bh 70Bh 78Bh
40Ch — 48Ch — 50Ch — 58Ch — 60Ch — 68Ch — 70Ch — 78Ch —
40Dh — 48Dh — 50Dh — 58Dh — 60Dh — 68Dh — 70Dh — 78Dh —
40Eh — 48Eh — 50Eh — 58Eh — 60Eh — 68Eh — 70Eh — 78Eh —
40Fh — 48Fh — 50Fh — 58Fh — 60Fh — 68Fh — 70Fh — 78Fh —
410h — 490h — 510h — 590h — 610h — 690h — 710h — 790h —
411h — 491h — 511h — 591h — 611h — 691h CWG1DBR 711h — 791h —
412h — 492h — 512h — 592h — 612h — 692h CWG1DBF 712h — 792h —
413h — 493h — 513h — 593h — 613h — 693h CWG1CON0 713h — 793h —
414h — 494h — 514h — 594h — 614h — 694h CWG1CON1 714h — 794h —
415h — 495h — 515h — 595h — 615h — 695h CWG1CON2 715h — 795h —
416h — 496h — 516h — 596h — 616h — 696h — 716h — 796h —
417h — 497h — 517h — 597h — 617h — 697h — 717h — 797h —
418h — 498h — 518h — 598h — 618h — 698h — 718h — 798h —
419h — 499h — 519h — 599h — 619h — 699h — 719h — 799h —
41Ah — 49Ah — 51Ah — 59Ah — 61Ah — 69Ah — 71Ah — 79Ah —
41Bh — 49Bh — 51Bh — 59Bh — 61Bh — 69Bh — 71Bh — 79Bh —
41Ch — 49Ch — 51Ch — 59Ch — 61Ch — 69Ch — 71Ch — 79Ch —
41Dh — 49Dh — 51Dh — 59Dh — 61Dh — 69Dh — 71Dh — 79Dh —
41Eh — 49Eh — 51Eh — 59Eh — 61Eh — 69Eh — 71Eh — 79Eh —
41Fh — 49Fh — 51Fh — 59Fh — 61Fh — 69Fh — 71Fh — 79Fh —
420h 4A0h 520h 5A0h 620h 6A0h 720h 7A0h
PIC16(L)F1574/5/8/9
Register Register Register Register 640h Read as ‘0’ Read as ‘0’ Read as ‘0’
80 Bytes 80 Bytes 80 Bytes 80 Bytes Unimplemented
Read as ‘0’
PIC16(L)F1574/5/8/9
BANK16 BANK17 BANK18 BANK19 BANK20 BANK21 BANK22 BANK23
800h 880h 900h 980h A00h A80h B00h B80h
Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers Core Registers
(Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2) (Table 3-2)
80Bh 88Bh 90Bh 98Bh A0Bh A8Bh B0Bh B8Bh
80Ch — 88Ch — 90Ch — 98Ch — A0Ch — A8Ch — B0Ch — B8Ch —
80Dh — 88Dh — 90Dh — 98Dh — A0Dh — A8Dh — B0Dh — B8Dh —
80Eh — 88Eh — 90Eh — 98Eh — A0Eh — A8Eh — B0Eh — B8Eh —
80Fh — 88Fh — 90Fh — 98Fh — A0Fh — A8Fh — B0Fh — B8Fh —
810h — 890h — 910h — 990h — A10h — A90h — B10h — B90h —
811h — 891h — 911h — 991h — A11h — A91h — B11h — B91h —
812h — 892h — 912h — 992h — A12h — A92h — B12h — B92h —
813h — 893h — 913h — 993h — A13h — A93h — B13h — B93h —
814h — 894h — 914h — 994h — A14h — A94h — B14h — B94h —
815h — 895h — 915h — 995h — A15h — A95h — B15h — B95h —
816h — 896h — 916h — 996h — A16h — A96h — B16h — B96h —
817h — 897h — 917h — 997h — A17h — A97h — B17h — B97h —
818h — 898h — 918h — 998h — A18h — A98h — B18h — B98h —
819h — 899h — 919h — 999h — A19h — A99h — B19h — B99h —
81Ah — 89Ah — 91Ah — 99Ah — A1Ah — A9Ah — B1Ah — B9Ah —
81Bh — 89Bh — 91Bh — 99Bh — A1Bh — A9Bh — B1Bh — B9Bh —
81Ch — 89Ch — 91Ch — 99Ch — A1Ch — A9Ch — B1Ch — B9Ch —
81Dh — 89Dh — 91Dh — 99Dh — A1Dh — A9Dh — B1Dh — B9Dh —
81Eh — 89Eh — 91Eh — 99Eh — A1Eh — A9Eh — B1Eh — B9Eh —
81Fh — 89Fh — 91Fh — 99Fh — A1Fh — A9Fh — B1Fh — B9Fh —
820h 8A0h 920h 9A0h A20h AA0h B20h BA0h
PIC16(L)F1574/5/8/9
C6Fh CEFh D6Fh DEFh E6Fh EEFh F6Fh FEFh
C70h CF0h D70h DF0h E70h EF0h F70h FF0h
Accesses Accesses Accesses Accesses Accesses Accesses Accesses Accesses
70h – 7Fh 70h – 7Fh 70h – 7Fh 70h – 7Fh 70h – 7Fh 70h – 7Fh 70h – 7Fh 70h – 7Fh
CFFh CFFh D7Fh DFFh E7Fh EFFh F7Fh FFFh
DEFh —
Legend: = Unimplemented data memory locations, read as ‘0’.
Bank 31
F8Ch
Unimplemented
Read as ‘0’
FE3h
FE4h STATUS_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
Bank 0-31
x00h or Addressing this location uses contents of FSR0H/FSR0L to address data memory
INDF0 xxxx xxxx uuuu uuuu
x80h (not a physical register)
x01h or Addressing this location uses contents of FSR1H/FSR1L to address data memory
INDF1 xxxx xxxx uuuu uuuu
x81h (not a physical register)
x02h or
PCL Program Counter (PC) Least Significant Byte 0000 0000 0000 0000
x82h
x03h or
STATUS — — — TO PD Z DC C ---1 1000 ---q quuu
x83h
x04h or
FSR0L Indirect Data Memory Address 0 Low Pointer 0000 0000 uuuu uuuu
x84h
x05h or
FSR0H Indirect Data Memory Address 0 High Pointer 0000 0000 0000 0000
x85h
x06h or
FSR1L Indirect Data Memory Address 1 Low Pointer 0000 0000 uuuu uuuu
x86h
x07h or
FSR1H Indirect Data Memory Address 1 High Pointer 0000 0000 0000 0000
x87h
x08h or
BSR — — — BSR<4:0> ---0 0000 ---0 0000
x88h
x09h or
WREG Working Register 0000 0000 uuuu uuuu
x89h
x0Ah or
PCLATH — Write Buffer for the upper 7 bits of the Program Counter -000 0000 -000 0000
x8Ah
x0Bh or
INTCON GIE PEIE TMR0IE INTE IOCIE TMR0IF INTF IOCIF 0000 0000 0000 0000
x8Bh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
PIC16(L)F1574/5/8/9
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 0
00Ch PORTA — — RA5 RA4 RA3 RA2 RA1 RA0 --xx xxxx --xx xxxx
00Dh PORTB(1) RB7 RB6 RB5 RB4 — — — — xxxx ---- xxxx ----
00Eh PORTC RC7(1) RC6(1) RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx xxxx xxxx
00Fh — Unimplemented — —
010h — Unimplemented — —
011h PIR1 TMR1GIF ADIF RCIF TXIF — — TMR2IF TMR1IF 0000 --00 0000 --00
012h PIR2 — C2IF C1IF — — — — — -00- ---- -00- ----
013h PIR3 PWM4IF PWM3IF PWM2IF PWM1IF — — — — 0000 ---- 0000 ----
014h — — —
015h TMR0 Holding Register for the 8-bit Timer0 Count xxxx xxxx uuuu uuuu
016h TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Count xxxx xxxx uuuu uuuu
017h TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Count xxxx xxxx uuuu uuuu
018h T1CON TMR1CS<1:0> T1CKPS<1:0> — T1SYNC — TMR1ON 0000 -0-0 uuuu -u-u
019h T1GCON TMR1GE T1GPOL T1GTM T1GSPM T1GGO/ T1GVAL T1GSS<1:0> 0000 0x00 uuuu uxuu
DONE
01Ah TMR2 Timer2 Module Register 0000 0000 0000 0000
01Bh PR2 Timer2 Period Register 1111 1111 1111 1111
01Ch T2CON — T2OUTPS<3:0> TMR2ON T2CKPS<1:0> -000 0000 -000 0000
01Dh — Unimplemented — —
01Eh — Unimplemented — —
01Fh — Unimplemented — —
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
2015 Microchip Technology Inc.
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
2015 Microchip Technology Inc.
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 1
08Ch TRISA — — TRISA5 TRISA4 —(3) TRISA2 TRISA1 TRISA0 --11 1111 --11 1111
08Dh TRISB(1) TRISB7 TRISB6 TRISB5 TRISB4 — — — — 1111 ---- 1111 ----
08Eh TRISC TRISC7(1) TRISC6(1) TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 1111 1111
08Fh — Unimplemented — —
090h — Unimplemented — —
091h PIE1 TMR1GIE ADIE RCIE TXIE — — TMR2IE TMR1IE 0000 --00 0000 --00
092h PIE2 — C2IE C1IE — — — — — -00- ---- -00- ----
093h PIE3 PWM4IE PWM3IE PWM2IE PWM1IE — — — — 0000 ---- 0000 ----
094h — — —
095h OPTION_REG WPUEN INTEDG TMR0CS TMR0SE PSA PS<2:0> 1111 1111 1111 1111
096h PCON STKOVF STKUNF — RWDT RMCLR RI POR BOR 00-1 11qq qq-q qquu
097h WDTCON — — WDTPS<4:0> SWDTEN --01 0110 --01 0110
098h OSCTUNE — — TUN<5:0> --00 0000 --00 0000
099h OSCCON SPLLEN IRCF<3:0> — SCS<1:0> 0011 1-00 0011 1-00
09Ah OSCSTAT — PLLR OSTS HFIOFR HFIOFL MFIOFR LFIOFR HFIOFS -0q0 0q00 -qqq qqqq
09Bh ADRESL ADC Result Register Low xxxx xxxx uuuu uuuu
09Ch ADRESH ADC Result Register High xxxx xxxx uuuu uuuu
09Dh ADCON0 — CHS<4:0> GO/DONE ADON -000 0000 -000 0000
09Eh ADCON1 ADFM ADCS<2:0> — — ADPREF<1:0> 0000 --00 0000 --00
PIC16(L)F1574/5/8/9
09Fh ADCON2 TRIGSEL<3:0> — — — — 0000 ---- 0000 ----
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
DS40001782A-page 37
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
DS40001782A-page 38
PIC16(L)F1574/5/8/9
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 2
10Ch LATA — — LATA5 LATA4 — LATA2 LATA1 LATA0 --xx -xxx --uu -uuu
10Dh LATB(1) LATB7 LATB6 LATB5 LATB4 — — — — xxxx ---- xxxx ----
10Eh LATC LATC7(1) LATC6(1) LATC5 LATC4 LATC3 LATC2 LATC1 LATC0 xxxx xxxx xxxx xxxx
10Fh — Unimplemented — —
110h — Unimplemented — —
111h CM1CON0 C1ON C1OUT — C1POL — C1SP C1HYS C1SYNC 00-0 -100 00-0 -100
112h CM1CON1 C1INTP C1INTN C1PCH<1:0> — C1NCH<2:0> 0000 -000 0000 -000
113h CM2CON0 C2ON C2OUT — C2POL — C2SP C2HYS C2SYNC 00-0 -100 00-0 -100
114h CM2CON1 C2INTP C2INTN C2PCH<1:0> — C2NCH<2:0> 0000 -000 0000 -000
115h CMOUT — — — — — — MC2OUT MC1OUT ---- --00 ---- --00
116h BORCON SBOREN BORFS — — — — — BORRDY 10-- ---q uu-- ---u
117h FVRCON FVREN FVRRDY TSEN TSRNG CDAFVR<1:0> ADFVR<1:0> 0q00 0000 0q00 0000
118h DACCON0 DACEN — DACOE — DACPSS<1:0> — — 0-0- 00-- 0-0- 00--
119h DACCON1 — — — DACR<4:0> ---0 0000 ---0 0000
11Ah
to — Unimplemented — —
11Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
2015 Microchip Technology Inc.
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
2015 Microchip Technology Inc.
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 3
18Ch ANSELA — — — ANSA4 — ANSA2 ANSA1 ANSA0 ---1 -111 ---1 -111
18Dh ANSELB(1) — — ANSB5 ANSB4 — — — — --11 ---- --11 ----
18Eh ANSELC ANSC7(1) ANSC6(1) — — ANSC3 ANSC2 ANSC1 ANSC0 11-- 1111 11-- 1111
18Fh — Unimplemented — —
190h — Unimplemented — —
191h PMADRL Flash Program Memory Address Register Low Byte 0000 0000 0000 0000
192h PMADRH —(3) Flash Program Memory Address Register High Byte 1000 0000 1000 0000
193h PMDATL Flash Program Memory Read Data Register Low Byte xxxx xxxx uuuu uuuu
194h PMDATH — — Flash Program Memory Read Data Register High Byte --xx xxxx --uu uuuu
195h PMCON1 —(3) CFGS LWLO FREE WRERR WREN WR RD 1000 x000 1000 q000
196h PMCON2 Flash Program Memory Control Register 2 0000 0000 0000 0000
197h VREGCON(2) — — — — — — VREGPM Reserved ---- --01 ---- --01
198h — Unimplemented — —
199h RCREG USART Receive Data Register 0000 0000 0000 0000
19Ah TXREG USART Transmit Data Register 0000 0000 0000 0000
19Bh SPBRGL Baud Rate Generator Data Register Low 0000 0000 0000 0000
19Ch SPBRGH Baud Rate Generator Data Register High 0000 0000 0000 0000
19Dh RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x
19Eh TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010
PIC16(L)F1574/5/8/9
19Fh BAUDCON ABDOVF RCIDL — SCKP BRG16 — WUE ABDEN 01-0 0-00 01-0 0-00
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
DS40001782A-page 39
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
DS40001782A-page 40
PIC16(L)F1574/5/8/9
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 4
20Ch WPUA — — WPUA5 WPUA4 WPUA3 WPUA2 WPUA1 WPUA0 --11 1111 --11 1111
20Dh WPUB(1) WPUB7 WPUB6 WPUB5 WPUB4 — — — — 1111 ---- 1111 ----
20Eh WPUC WPUC7(1) WPUC6(1) WPUC5 WPUC4 WPUC3 WPUC2 WPUC1 WPUC0 1111 1111 1111 1111
20Fh
to — Unimplemented — —
21Fh
Bank 5
28Ch ODCONA — — ODA5 ODA4 — ODA2 ODA1 ODA0 --00 -000 --00 -000
28Dh ODCONB(1) ODB7 ODB6 ODB5 ODB4 — — — — 0000 ---- 0000 ----
28Eh ODCONC ODC7(1) ODC6(1) ODC5 ODC4 ODC3 ODC2 ODC1 ODC0 0000 0000 0000 0000
28Fh
to — Unimplemented — —
29Fh
Bank 6
30Ch SLRCONA — — SLRA5 SLRA4 — SLRA2 SLRA1 SLRA0 --11 -111 --11 -111
30Dh SLRCONB(1) SLRB7 SLRB6 SLRB5 SLRB4 — — — — 1111 ---- 1111 ----
30Eh SLRCONC SLRC7(1) SLRC6(1) SLRC5 SLRC4 SLRC3 SLRC2 SLRC1 SLRC0 1111 1111 1111 1111
30Fh
to — Unimplemented — —
31Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
2015 Microchip Technology Inc.
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
2015 Microchip Technology Inc.
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 7
38Ch INLVLA — — INLVLA5 INLVLA4 INLVLA3 INLVLA2 INLVLA1 INLVLA0 --11 1111 --11 1111
38Dh INLVLB(1) INLVLB7 INLVLB6 INLVLB5 INLVLB4 — — — — 1111 ---- 1111 ----
38Eh INLVLC INLVLC7(1) INLVLC6(1) INLVLC5 INLVLC4 INLVLC3 INLVLC2 INLVLC1 INLVLC0 1111 1111 1111 1111
38Fh
to — Unimplemented — —
390h
391h IOCAP — — IOCAP5 IOCAP4 IOCAP3 IOCAP2 IOCAP1 IOCAP0 --00 0000 --00 0000
392h IOCAN — — IOCAN5 IOCAN4 IOCAN3 IOCAN2 IOCAN1 IOCAN0 --00 0000 --00 0000
393h IOCAF — — IOCAF5 IOCAF4 IOCAF3 IOCAF2 IOCAF1 IOCAF0 --00 0000 --00 0000
394h IOCBP(1) IOCBP7 IOCBP6 IOCBP5 IOCBP4 — — — — 0000 ---- --00 ----
395h IOCBN(1) IOCBN7 IOCBN6 IOCBN5 IOCBN4 — — — — 0000 ---- --00 ----
396h IOCBF(1) IOCBF7 IOCBF6 IOCBF5 IOCBF4 — — — — 0000 ---- --00 ----
397h IOCCP IOCCP7(1) IOCCP6(1) IOCCP5 IOCCP4 IOCCP3 IOCCP2 IOCCP1 IOCCP0 0000 0000 0000 0000
398h IOCCN IOCCN7(1) IOCCN6(1) IOCCN5 IOCCN4 IOCCN3 IOCCN2 IOCCN1 IOCCN0 0000 0000 0000 0000
399h IOCCF IOCCF7(1) IOCCF6(1) IOCCF5 IOCCF4 IOCCF3 IOCCF2 IOCCF1 IOCCF0 0000 0000 0000 0000
39Ah
to — Unimplemented — —
39Fh
Bank 8
40Ch
to — Unimplemented — —
PIC16(L)F1574/5/8/9
41Fh
Bank 9
48Ch
to — Unimplemented — —
49Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
DS40001782A-page 41
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
DS40001782A-page 42
PIC16(L)F1574/5/8/9
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 10
50Ch
to — Unimplemented — —
51Fh
Bank 11
58Ch
to — Unimplemented — —
59Fh
Bank 12
60Ch
to — Unimplemented — —
61Fh
Bank 13
68Ch
to — Unimplemented — —
690h
691h CWG1DBR — — CWG1DBR<5:0> --00 0000 --00 0000
692h CWG1DBF — — CWG1DBF<5:0> --xx xxxx --xx xxxx
693h CWG1CON0 G1EN — — G1POLB G1POLA — — G1CS0 0--0 0--0 0--0 0--0
694h CWG1CON1 G1ASDLB<1:0> G1ASDLA<1:0> — G1IS<2:0> 0000 -000 0000 -000
695h CWG1CON2 G1ASE G1ARSEN — — G1ASDSC2 G1ASDSC1 G1ASDSPPS — 00-- 000- 00-- 000-
696h
to — Unimplemented — —
69Fh
Banks 14-26
x0Ch/ — Unimplemented — —
x8Ch
—
x1Fh/
x9Fh
2015 Microchip Technology Inc.
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
2015 Microchip Technology Inc.
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 27
D8Ch — Unimplemented — —
D8Dh — Unimplemented — —
D8Eh PWMEN — — — — PWM4EN_A PWM3EN_A PWM2EN_A PWM1EN_A ---- 0000 ---- 0000
D8Fh PWMLD — — — — PWM4LDA_A PWM3LDA_A PWM2LDA_A PWM1LDA_A ---- 0000 ---- 0000
D90h PWMOUT — — — — PWM4OUT_A PWM3OUT_A PWM2OUT_A PWM1OUT_A ---- 0000 ---- 0000
D91h PWM1PHL PH<7:0> xxxx xxxx uuuu uuuu
D92h PWM1PHH PH<15:8> xxxx xxxx uuuu uuuu
D93h PWM1DCL DC<7:0> xxxx xxxx uuuu uuuu
D94h PWM1DCH DC<15:8> xxxx xxxx uuuu uuuu
D95h PWM1PRL PR<7:0> xxxx xxxx uuuu uuuu
D96h PWM1PRH PR<15:8> xxxx xxxx uuuu uuuu
D97h PWM1OFL OF<7:0> xxxx xxxx uuuu uuuu
D98h PWM1OFH OF<15:8> xxxx xxxx uuuu uuuu
D99h PWM1TMRL TMR<7:0> xxxx xxxx uuuu uuuu
D9Ah PWM1TMRH TMR<15:8> xxxx xxxx uuuu uuuu
D9Bh PWM1CON EN — OUT POL MODE<1:0> — — 0-00 00-- 0-00 00--
D9Ch PWM1INTE — — — — OFIE PHIE DCIE PRIE ---- 000 ---- 000
D9Dh PWM1INTF — — — — OFIF PHIF DCIF PRIF ---- 000 ---- 000
D9Eh PWM1CLKCON — PS<2:0> — — CS<1:0> -000 -000 -000 --00
PIC16(L)F1574/5/8/9
D9Fh PWM1LDCON LDA LDT — — — — LDS<1:0> 00-- -000 00-- --00
DA0h PWM1OFCON — OFM<1:0> OFO — — OFS<1:0> -000 -000 -000 --00
DA1h PWM2PHL PH<7:0> xxxx xxxx uuuu uuuu
DA2h PWM2PHH PH<15:8> xxxx xxxx uuuu uuuu
DA3h PWM2DCL DC<7:0> xxxx xxxx uuuu uuuu
DA4h PWM2DCH DC<15:8> xxxx xxxx uuuu uuuu
DA5h PWM2PRL PR<7:0> xxxx xxxx uuuu uuuu
DA6h PWM2PRH PR<15:8> xxxx xxxx uuuu uuuu
DA7h PWM2OFL OF<7:0> xxxx xxxx uuuu uuuu
DS40001782A-page 43
PIC16(L)F1574/5/8/9
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 27 (Continued)
DABh PWM2CON EN — OUT POL MODE<1:0> — — 0-00 00-- 0-00 00--
DACh PWM2INTE — — — — OFIE PHIE DCIE PRIE ---- 000 ---- 000
DADh PWM2INTF — — — — OFIF PHIF DCIF PRIF ---- 000 ---- 000
DAEh PWM2CLKCON — PS<2:0> — — CS<1:0> -000 -000 -000 --00
DAFh PWM2LDCON LDA LDT — — — — LDS<1:0> 00-- -000 00-- --00
DB0h PWM2OFCON — OFM<1:0> OFO — — OFS<1:0> -000 -000 -000 --00
DB1h PWM3PHL PH<7:0> xxxx xxxx uuuu uuuu
DB2h PWM3PHH PH<15:8> xxxx xxxx uuuu uuuu
DB3h PWM3DCL DC<7:0> xxxx xxxx uuuu uuuu
DB4h PWM3DCH DC<15:8> xxxx xxxx uuuu uuuu
DB5h PWM3PRL PR<7:0> xxxx xxxx uuuu uuuu
DB6h PWM3PRH PR<15:8> xxxx xxxx uuuu uuuu
DB7h PWM3OFL OF<7:0> xxxx xxxx uuuu uuuu
DB8h PWM3OFH OF<15:8> xxxx xxxx uuuu uuuu
DB9h PWM3TMRL TMR<7:0> xxxx xxxx uuuu uuuu
DBAh PWM3TMRH TMR<15:8> xxxx xxxx uuuu uuuu
DBBh PWM3CON EN — OUT POL MODE<1:0> — — 0-00 00-- 0-00 00--
DBCh PWM3INTE — — — — OFIE PHIE DCIE PRIE ---- 000 ---- 000
DBDh PWM3INTF — — — — OFIF PHIF DCIF PRIF ---- 000 ---- 000
DBEh PWM3CLKCON — PS<2:0> — — CS<1:0> -000 -000 -000 --00
DBFh PWM3LDCON LDA LDT — — — — LDS<1:0> 00-- -000 00-- --00
DC0h PWM3OFCON — OFM<1:0> OFO — — OFS<1:0> -000 -000 -000 --00
DC1h PWM4PHL PH<7:0> xxxx xxxx uuuu uuuu
DC2h PWM4PHH PH<15:8> xxxx xxxx uuuu uuuu
DC3h PWM4DCL DC<7:0>
2015 Microchip Technology Inc.
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 27 (Continued)
DC9h PWM4TMRL TMR<7:0> xxxx xxxx uuuu uuuu
DCAh PWM4TMRH TMR<15:8> xxxx xxxx uuuu uuuu
DCBh PWM4CON EN — OUT POL MODE<1:0> — — 0000 00-- 0000 00--
DCCh PWM4INTE — — — — OFIE PHIE DCIE PRIE ---- 000 ---- 000
DCDh PWM4INTF — — — — OFIF PHIF DCIF PRIF ---- 000 ---- 000
DCEh PWM4CLKCON — PS<2:0> — — CS<1:0> -000 -000 -000 --00
DCFh PWM4LDCON LDA LDT — — — — LDS<1:0> 00-- -000 00-- --00
DD0h PWM4OFCON — OFM<1:0> OFO — — OFS<1:0> -000 -000 -000 --00
DD1h
to — Unimplemented — —
DEFh
Bank 28
E0Ch
— — Unimplemented — —
E0Eh
E0Fh PPSLOCK — — — — — — — PPSLOCKED ---- ---0 ---- ---0
E10h INTPPS — — — INTPPS<4:0> ---0 0010 ---u uuuu
E11h T0CKIPPS — — — T0CKIPPS<4:0> ---0 0010 ---u uuuu
E12h T1CKIPPS — — — T1CKIPPS<4:0> ---0 0101 ---u uuuu
E13h T1GPPS — — — T1GPPS<4:0> ---0 0100 ---u uuuu
PIC16(L)F1574/5/8/9
E14h CWG1INPPS — — — CWGINPPS<4:0> ---0 0010 ---u uuuu
PIC16(L)F1574/5/8/9
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 29
E8Ch
—
E8Fh — Unimplemented — —
E90h RA0PPS — — — RA0PPS<4:0> ---0 0000 ---u uuuu
E91h RA1PPS — — — RA1PPS<4:0> ---0 0000 ---u uuuu
E92h RA2PPS — — — RA2PPS<4:0> ---0 0000 ---u uuuu
E93h — Unimplemented — —
E94h RA4PPS — — — RA4PPS<4:0> ---0 0000 ---u uuuu
E95h RA5PPS — — — RA5PPS<4:0> ---0 0000 ---u uuuu
E96h
—
E9Bh — Unimplemented — —
E9Eh (1 — — — RB6PPS<4:0>
RB6PPS ---0 0000 ---u uuuu
EA8h
—
EEFh — Unimplemented — —
Bank 30
F0Ch
— — Unimplemented — —
F1Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
TABLE 3-15: SPECIAL FUNCTION REGISTER SUMMARY (CONTINUED)
2015 Microchip Technology Inc.
Value on
Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
Bank 31
F8Ch — Unimplemented — —
—
FE3h
FE4h STATUS_ — — — — — Z_SHAD DC_SHAD C_SHAD ---- -xxx ---- -uuu
SHAD
FE5h WREG_ Working Register Shadow xxxx xxxx uuuu uuuu
SHAD
FE6h BSR_ — — — Bank Select Register Shadow ---x xxxx ---u uuuu
SHAD
FE7h PCLATH_ — Program Counter Latch High Register Shadow -xxx xxxx uuuu uuuu
SHAD
FE8h FSR0L_ Indirect Data Memory Address 0 Low Pointer Shadow xxxx xxxx uuuu uuuu
SHAD
FE9h FSR0H_ Indirect Data Memory Address 0 High Pointer Shadow xxxx xxxx uuuu uuuu
SHAD
FEAh FSR1L_ Indirect Data Memory Address 1 Low Pointer Shadow xxxx xxxx uuuu uuuu
SHAD
FEBh FSR1H_ Indirect Data Memory Address 1 High Pointer Shadow xxxx xxxx uuuu uuuu
SHAD
FECh — Unimplemented — —
PIC16(L)F1574/5/8/9
FEDh STKPTR — — — Current Stack Pointer ---1 1111 ---1 1111
FEEh TOSL Top-of-Stack Low byte xxxx xxxx uuuu uuuu
FEFh TOSH — Top-of-Stack High byte -xxx xxxx -uuu uuuu
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, r = reserved. Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16(L)F1578/9 only.
2: PIC16F1574/5/8/9 only.
3: Unimplemented, read as ‘1’.
DS40001782A-page 47
PIC16(L)F1574/5/8/9
3.4 PCL and PCLATH 3.4.2 COMPUTED GOTO
The Program Counter (PC) is 15 bits wide. The low byte A computed GOTO is accomplished by adding an offset to
comes from the PCL register, which is a readable and the program counter (ADDWF PCL). When performing a
writable register. The high byte (PC<14:8>) is not directly table read using a computed GOTO method, care should
readable or writable and comes from PCLATH. On any be exercised if the table location crosses a PCL memory
Reset, the PC is cleared. Figure 3-4 shows the five boundary (each 256-byte block). Refer to Application
situations for the loading of the PC. Note AN556, “Implementing a Table Read” (DS00556).
Rev. 10-000043A
7/30/2013
Rev. 10-000043B
7/30/2013
0x0F
0x0E
0x0D
0x0C
0x0B
0x0A
0x09 This figure shows the stack configuration
after the first CALL or a single interrupt.
0x08 If a RETURN instruction is executed, the
0x07 return address will be placed in the
Program Counter and the Stack Pointer
0x06 decremented to the empty state (0x1F).
0x05
0x04
0x03
0x02
0x01
TOSH:TOSL 0x00 Return Address STKPTR = 0x00
Rev. 10-000043C
7/30/2013
0x0F
0x0E
0x0D
0x0C
After seven CALLs or six CALLs and an
0x0B interrupt, the stack looks like the figure on
the left. A series of RETURN instructions will
0x0A
repeatedly place the return addresses into
0x09 the Program Counter and pop the stack.
0x08
0x07
TOSH:TOSL 0x06 Return Address STKPTR = 0x06
Rev. 10-000043D
7/30/2013
Rev. 10-000044A
7/30/2013
0x0000 0x0000
Traditional
Data Memory
0x0FFF 0x0FFF
0x1000
Reserved
0x1FFF
0x2000
Linear
Data Memory
0x29AF
0x29B0
Reserved
0x7FFF
FSR
0x8000 0x0000
Address
Range
Program
Flash Memory
0xFFFF 0x7FFF
Note: Not all memory regions are completely implemented. Consult device memory tables for memory limits.
Rev. 10-000056A
7/31/2013
From Opcode
4 BSR 0 6 0 7 FSRxH 0 7 FSRxL 0
0 0 0 0
0x7F
Bank 0 Bank 1 Bank 2 Bank 31
7 FSRnH 0 7 FSRnL 0
7 FSRnH 0 7 FSRnL 0 1
0 0 1
Location Select
Location Select 0x8000
0x2000 0x0000
0x020
Bank 0
0x06F
0x0A0
Bank 1
Program
0x0EF
Flash
0x120 Memory
Bank 2 (low 8 bits)
0x16F
0xF20
Bank 30 0x7FFF
0xF6F 0xFFFF
0x29AF
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘1’
‘0’ = Bit is cleared ‘1’ = Bit is set n = Value when blank or after Bulk Erase
Note 1: Enabling Brown-out Reset does not automatically enable Power-up Timer.
2: Once enabled, code-protect can only be disabled by bulk erasing the device.
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘1’
‘0’ = Bit is cleared ‘1’ = Bit is set n = Value when blank or after Bulk Erase
Note 1: This bit cannot be programmed to ‘0’ when programming mode is entered via LVP.
2: 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’.
3: See VBOR parameter for specific trip point voltages.
Note 1: This bit cannot be programmed to ‘0’ when programming mode is entered via LVP.
2: 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’.
3: See VBOR parameter for specific trip point voltages.
4.5 User ID
Four memory locations (8000h-8003h) are designated as
ID locations where the user can store checksum or other
code identification numbers. These locations are
readable and writable during normal execution. See
Section 10.4 “User ID, Device ID and Configuration
Word Access” for more information on accessing these
memory locations. For more information on checksum
calculation, see the “PIC16(L)F157x Memory
Programming Specification” (DS40001766).
R R R R R R R R
DEV<7:0>
bit 7 bit 0
Legend:
R = Readable bit
‘0’ = Bit is cleared ‘1’ = Bit is set x = Bit is unknown
R R R R R R R R
REV<7:0>
bit 7 bit 0
Legend:
R = Readable bit
‘0’ = Bit is cleared ‘1’ = Bit is set x = Bit is unknown
Rev. 10-000155A
10/11/2013
FOSC<1:0>
2 Reserved 01 Sleep
CLKIN
0 FOSC(1)
00
4x PLL(2) 1 to CPU and
Peripherals
INTOSC
PLLEN 1x
SPLLEN
2
16 MHz SCS<1:0>
8 MHz
4 MHz
(1) 2 MHz
HFPLL HFINTOSC
1 MHz
Prescaler
16 MHz
*500 kHz
31 kHz LFINTOSC(1)
to WDT, PWRT, and
Oscillator other Peripherals
to Peripherals
600 kHz FRC(1) to ADC and
Oscillator other Peripherals
5.2.1.1 EC Mode
The External Clock (EC) mode allows an externally
generated logic level signal to be the system clock
source. When operating in this mode, an external clock
source is connected to the CLKIN input. CLKOUT is
available for general purpose I/O or CLKOUT.
Figure 5-2 shows the pin connections for EC mode.
EC mode has three power modes to select from through
the FOSC bits in the Configuration Words:
• ECH - High-power, 4-20 MHz
• ECM - Medium-power, 0.5-4 MHz
• ECL - Low-power, 0-0.5 MHz
5.2.2.4 LFINTOSC
The Low-Frequency Internal Oscillator (LFINTOSC) is
an uncalibrated 31 kHz internal clock source.
The output of the LFINTOSC connects to a multiplexer
(see Figure 5-1). Select 31 kHz, via software, using the
IRCF<3:0> bits of the OSCCON register. See Section
5.2.2.8 “Internal Oscillator Clock Switch Timing” for
more information. The LFINTOSC is also the frequency
for the Power-up Timer (PWRT) and Watchdog Timer
(WDT).
The LFINTOSC is enabled by selecting 31 kHz
(IRCF<3:0> bits of the OSCCON register = 000) as the
system clock source (SCS bits of the OSCCON
register = 1x), or when any of the following are
enabled:
• Configure the IRCF<3:0> bits of the OSCCON
register for the desired LF frequency, and
• FOSC<1:0> = 00, or
• Set the System Clock Source (SCS) bits of the
OSCCON register to ‘1x’
Peripherals that use the LFINTOSC are:
• Power-up Timer (PWRT)
• Watchdog Timer (WDT)
The Low-Frequency Internal Oscillator Ready bit
(LFIOFR) of the OSCSTAT register indicates when the
LFINTOSC is running.
LFINTOSC
System Clock
LFINTOSC
System Clock
LFINTOSC HFINTOSC/MFINTOSC
LFINTOSC turns off unless WDT is enabled
LFINTOSC
Oscillator Delay(1) 2-cycle Sync Running
HFINTOSC/
MFINTOSC
IRCF <3:0> =0 0
System Clock
Note 1: See Table 5-1, “Oscillator Switching Delays” for more information.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Conditional
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Rev. 10-000006A
8/14/2013
Stack Underflow
Stack Overlfow
MCLRE
VPP/MCLR
Sleep
WDT
Time-out Device
Reset
Power-on
Reset
VDD
BOR
Active(1)
Brown-out R
Power-up
Reset
Timer
LFINTOSC
LPBOR PWRTE
Reset
6.2.1 BOR IS ALWAYS ON BOR protection is not active during Sleep. The device
wake-up will be delayed until the BOR is ready.
When the BOREN bits of Configuration Words are pro-
grammed to ‘11’, the BOR is always on. The device
6.2.3 BOR CONTROLLED BY SOFTWARE
start-up will be delayed until the BOR is ready and VDD
is higher than the BOR threshold. When the BOREN bits of Configuration Words are
programmed to ‘01’, the BOR is controlled by the
BOR protection is active during Sleep. The BOR does
SBOREN bit of the BORCON register. The device
not delay wake-up from Sleep.
start-up is not delayed by the BOR ready condition or
the VDD level.
6.2.2 BOR IS OFF IN SLEEP
BOR protection begins as soon as the BOR circuit is
When the BOREN bits of Configuration Words are pro-
ready. The status of the BOR circuit is reflected in the
grammed to ‘10’, the BOR is on, except in Sleep. The
BORRDY bit of the BORCON register.
device start-up will be delayed until the BOR is ready
and VDD is higher than the BOR threshold. BOR protection is unchanged by Sleep.
VDD
VBOR
Internal
Reset TPWRT(1)
VDD
VBOR
VDD
VBOR
Internal
Reset TPWRT(1)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
Internal RESET
Int. Oscillator
FOSC
Begin Execution
code execution (1) code execution (1)
Internal Oscillator, PWRTEN = 0 Internal Oscillator, PWRTEN = 1
VDD
Internal POR
TPWRT
Power-up Timer
MCLR
Internal RESET
Ext. Clock (EC)
FOSC
Begin Execution
code execution (1) code execution (1)
External Clock (EC modes), PWRTEN = 0 External Clock (EC modes), PWRTEN = 1
Note 1: Code execution begins 10 FOSC cycles after the FOSC clock is released.
Legend:
HC = Bit is cleared by hardware HS = Bit is set by hardware
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
TMR0IF Wake-up
TMR0IE (If in Sleep mode)
INTF
Peripheral Interrupts INTE
(TMR1IF) PIR1<0>
IOCIF
(TMR1IE) PIE1<0> Interrupt
IOCIE to CPU
PEIE
PIRn<7>
GIE
PIEn<7>
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
Interrupt
GIE
Interrupt
GIE
Interrupt
GIE
Interrupt
GIE
Q1 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) Interrupt Latency (2)
GIE
INSTRUCTION FLOW
PC PC PC + 1 PC + 1 0004h 0005h
Instruction
Fetched Inst (PC) Inst (PC + 1) — Inst (0004h) Inst (0005h)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: These bits are read-only. They must be cleared by addressing the Flag registers inside the module.
2: 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 appropri-
ate interrupt flag bits are clear prior to enabling an interrupt.
GIE bit
(INTCON reg.) Processor in
Sleep
Instruction Flow
PC PC PC + 1 PC + 2 PC + 2 PC + 2 0004h 0005h
Instruction Inst(PC + 1) Inst(PC + 2) Inst(0004h) Inst(0005h)
Fetched Inst(PC) = Sleep
Instruction Sleep Inst(PC + 1) Forced NOP Forced NOP
Executed Inst(PC - 1) Inst(0004h)
Low-Power Sleep mode allows the user to optimize the • Brown-Out Reset (BOR)
operating current in Sleep. Low-Power Sleep mode can • Watchdog Timer (WDT)
be selected by setting the VREGPM bit of the • External interrupt pin/Interrupt-on-change pins
VREGCON register, putting the LDO and reference • Timer1 (with external clock source)
circuitry in a low-power state whenever the device is in
Sleep. The Complementary Waveform Generator (CWG), the
Numerically Controlled Oscillator (NCO) and the Con-
8.2.1 SLEEP CURRENT VS. WAKE-UP figurable Logic Cell (CLC) modules can utilize the
TIME HFINTOSC oscillator as either a clock source or as an
input source. Under certain conditions, when the
In the Default Operating mode, the LDO and reference HFINTOSC is selected for use with the CWG, NCO or
circuitry remain in the normal configuration while in CLC modules, the HFINTOSC will remain active
Sleep. The device is able to exit Sleep mode quickly during Sleep. This will have a direct effect on the
since all circuits remain active. In Low-Power Sleep Sleep mode current.
mode, when waking up from Sleep, an extra delay time
is required for these circuits to return to the normal con- Please refer to section 24.10 “Operation During
figuration and stabilize. Sleep” for more information.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
WDTE<1:0> = 01
SWDTEN
WDTE<1:0> = 10
Sleep WDTPS<4:0>
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
ORGANIZATION BY DEVICE
7/30/2013
Write
Row Erase Start
Device Latches Read Operation
(words)
(words)
PIC16(L)F1574
PIC16(L)F1575 Select
32 32 Program or Configuration Memory
PIC16(L)F1578 (CFGS)
PIC16(L)F1579
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Flash Data INSTR (PC) INSTR (PC + 1) PMDATH,PMDATL INSTR (PC + 3) INSTR (PC + 4)
INSTR(PC + 1) INSTR(PC + 2)
INSTR(PC - 1) BSF PMCON1,RD instruction ignored instruction ignored INSTR(PC + 3) INSTR(PC + 4)
executed here executed here Forced NOP Forced NOP executed here executed here
executed here executed here
RD bit
PMDATH
PMDATL
Register
Unlock Sequence
(See Note 1)
Re-enable Interrupts
(GIE = 1)
End
Erase Operation
MOVLW 0AAh ;
MOVWF PMCON2 ; Write AAh
BSF PMCON1,WR ; Set WR bit to begin erase
NOP ; NOP instructions are forced as processor starts
NOP ; row erase of program memory.
;
; The processor stalls until the erase process is complete
; after erase processor continues with 3rd instruction
PIC16(L)F1574/5/8/9
Rev. 10-000004A
7 6 0 7 5 4 0 7 5 0 7 0 7/30/2013
14
Write Latch #0 Write Latch #1 Write Latch #30 Write Latch #31
PMADRL<4:0> 00h 01h 1Eh 1Fh
14 14 14 14
Address
PMADRH<6:0>: Decode Flash Program Memory
PMADRL<7:5>
400h 8000h - 8003h 8004h – 8005h 8006h 8007h – 8008h 8009h - 801Fh
DEVICE ID Configuration
USER ID 0 - 3 reserved reserved
CFGS = 1 Dev / Rev Words
Configuration Memory
PIC16(L)F1574/5/8/9
FIGURE 10-6: FLASH PROGRAM MEMORY WRITE FLOWCHART
Start
Write Operation
Unlock Sequence
Select
Last word to Yes (Figure10-3
Figure x-x)
Program or Config. Memory
(CFGS) write ?
Re-enable Interrupts
(GIE = 1)
Increment Address
(PMADRH:PMADRL++)
End
Write Operation
START_WRITE
BCF PMCON1,LWLO ; No more loading latches - Actually start Flash program
; memory write
MOVLW 0AAh ;
Required
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
TABLE 10-2: USER ID, DEVICE ID AND CONFIGURATION WORD ACCESS (CFGS = 1)
Address Function Read Access Write Access
8000h-8003h User IDs Yes Yes
8006h/8005h Device ID/Revision ID Yes No
8007h-8008h Configuration Words 1 and 2 Yes No
Start
Verify Operation
Read Operation
(See Note 1)
PMDAT = No
RAM image ?
Yes
Fail
Verify Operation
No
Last word ?
Yes
End
Verify Operation
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
bit 7-0 PMDAT<7:0>: Read/write value for Least Significant bits of program memory
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
bit 7-0 PMADR<7:0>: Specifies the Least Significant bits for program memory address
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
S = Bit can only be set x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared HC = Bit is cleared by hardware
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
S = Bit can only be set x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Some ports may have one or more of the following Data Register
additional registers. These registers are:
Data bus
• ANSELx (analog select) I/O pin
• WPUx (weak pull-up) Read PORTx
VSS
TABLE 11-1: PORT AVAILABILITY PER
DEVICE
PORTB
PORTC
PORTA
Device
PIC16(L)F1574 ● ●
PIC16(L)F1575 ● ●
PIC16(L)F1578 ● ● ●
PIC16(L)F1579 ● ● ●
The Data Latch (LATx registers) is useful for
read-modify-write operations on the value that the I/O
pins are driving.
A write operation to the LATx register has the same
effect as a write to the corresponding PORTx register.
A read of the LATx register reads of the values held in
the I/O PORT latches, while a read of the PORTx
register reads the actual I/O pin value.
Ports that support analog inputs have an associated
ANSELx register. When an ANSEL bit is set, the digital
input buffer associated with that bit is disabled.
Disabling the input buffer prevents analog signal levels
on the pin between a logic high and low from causing
excessive current in the logic input circuitry. A
simplified model of a generic I/O port, without the
interfaces to other peripherals, is shown in Figure 11-1.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Writes to PORTA are actually written to corresponding LATA register. Reads from PORTA register is return
of actual I/O pin values.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
2: The weak pull-up device is automatically disabled if the pin is configured as an output.
3: For the WPUA3 bit, when MCLRE = 1, weak pull-up is internally enabled, but not reported here.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: The INLVLA3 bit selects the input type on this pin only when the MCLR function is not selected. When the
MCLR function is selected, the input type for this pin will be ST.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Writes to PORTB are actually written to corresponding LATB register. Reads from PORTB register is return of
actual I/O pin values.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Writes to PORTB are actually written to corresponding LATB register. Reads from PORTB register is return of
actual I/O pin values.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
2: The weak pull-up device is automatically disabled if the pin is configured as an output.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Writes to PORTC are actually written to corresponding LATC register. Reads from PORTC register is return of actual
I/O pin values.
2: RC<7:6> are available on PIC16(L)F1578/9 only.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
bit 7-6 ANSC<7:6>: Analog Select between Analog or Digital Function on pins RC<7:6>, respectively(1, 2)
0 = Digital I/O. Pin is assigned to port or digital special function.
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
bit 5-4 Unimplemented: Read as ‘0’
bit 3-0 ANSC<3:0>: Analog Select between Analog or Digital Function on pins RC<3:0>, respectively(1)
0 = Digital I/O. Pin is assigned to port or digital special function.
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
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.
2: ANSC<7:6> are available on PIC16(L)F1578/9 only.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: Global WPUEN bit of the OPTION_REG register must be cleared for individual pull-ups to be enabled.
2: The weak pull-up device is automatically disabled if the pin is configured as an output.
3: WPUC<7:6> are available on PIC16(L)F1578/9 only.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
abcPPS RA0
RA0
Peripheral abc
RxyPPS
Rxy
Peripheral xyz
RC7 RC7PPS
xyzPPS RC7
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = value depends on peripheral
Note 1: See Table 12-1 for xxxPPS register list and Reset values.
2: PIC16(L)F1578/9 only.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Example: ADCACTPPS = 0x14 selects RC4 as the ADC Auto-Conversion Trigger input.
IOCANx D Q
R Q4Q1
edge
detect
RAx
to data bus
data bus = S
IOCAFx
IOCAPx D Q
0 or 1
D Q
R
write IOCAFx
IOCIE
Q2
IOC interrupt
to CPU core
from all other
IOCnFx individual
pin detectors
FOSC
Q1 Q1 Q1
Q2 Q2 Q2
Q3 Q3 Q3
Q4 Q4 Q4
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared HS - Bit is set in hardware
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared HS - Bit is set in hardware
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared HS - Bit is set in hardware
Rev. 10-000053A
8/6/2013
2
ADFVR<1:0>
1x
FVR_buffer1
2x
4x (To ADC Module)
2
CDAFVR<1:0>
1x
FVR_buffer2
2x
4x (To Comparators)
FVREN
+
_ FVRRDY
Note 1
Note 1: Any peripheral requiring the Fixed Reference (See Table 14-1)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
Note 1: To minimize current consumption when the FVR is disabled, the FVR buffers should be turned off by clear-
ing the Buffer Gain Selection bits.
2: FVRRDY is always ‘1’ for the PIC16F1574/5/8/9 devices.
3: See Section 15.0 “Temperature Indicator Module” for additional information.
4: Fixed Voltage Reference output cannot exceed VDD.
TABLE 14-2: SUMMARY OF REGISTERS ASSOCIATED WITH THE FIXED VOLTAGE REFERENCE
Register
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
on page
FVRCON FVREN FVRRDY TSEN TSRNG CDAFVR>1:0> ADFVR<1:0> 151
Legend: Shaded cells are unused by the Fixed Voltage Reference module.
Positive
VDD Reference
Select
VREF+ pin
VSS ADCS<2:0>
AN0
ANa VRNEG VRPOS
External .
Channel FOSC/n Fosc
. Divider FOSC
Inputs ADC
ADC_clk
. sampled Clock
ANz input Select FRC
FRC
Temp Indicator
Internal
Channel DACx_output ADC CLOCK SOURCE
Inputs
FVR_buffer1 ADC
Sample Circuit
CHS<4:0>
ADFM
set bit ADIF
10
complete 10-bit Result
Write to bit
GO/DONE
GO/DONE Q1 16
start
Q4
ADRESH ADRESL
Q2 Enable
Trigger Select
TRIGSEL<3:0> ADON
. . . VSS
Trigger Sources
AUTO CONVERSION
TRIGGER
ADC
ADCS<2:0
Clock 20 MHz 16 MHz 8 MHz 4 MHz 1 MHz
>
Source
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
Legend: Shaded cells are outside of recommended range.
Note: 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.
Rev. 10-000035A
7/30/2013
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 On the following cycle:
Holding capacitor disconnected
from analog input (THCD).
ADRESH:ADRESL is loaded,
GO bit is cleared,
Set GO bit ADIF bit is set,
holding capacitor is reconnected to analog input.
Enable ADC (ADON bit)
and
Select channel (ACS bits)
Rev. 10-000054A
7/30/2013
ADRESH ADRESL
OFx_match
When the conversion is complete, the ADC module will: PWMxOFIE
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note 1: When selecting the VREF+ pin as the source of the positive reference, be aware that a minimum voltage
specification exists. See Section 27.0 “Electrical Specifications” for details.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
T ACQ = Amplifier Settling Time + Hold Capacitor Charging Time + Temperature Coefficient
= T AMP + T C + T COFF
= 2µs + T C + Temperature - 25°C 0.05µs/°C
V AP P LI ED 1 – -------------------------- = V CHOLD
1
;[1] VCHOLD charged to within 1/2 lsb
n+1
2 –1
–TC
----------
RC
V AP P LI ED 1 – e = V CHOLD ;[2] VCHOLD charge response to VAPPLIED
– Tc
---------
V AP P LI ED 1 – e = V A PP LIE D 1 – -------------------------- ;combining [1] and [2]
RC 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 = 2µs + 1.715 µs + 50°C- 25°C 0.05 µs/°C
= 4.96µs
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.
VDD
Sampling
Analog switch
VT § 0.6V SS
RS Input pin RIC 1K RSS
6V
Legend: CHOLD = Sample/Hold Capacitance 5V
CPIN = Input Capacitance VDD 4V RSS
3V
ILEAKAGE = Leakage Current at the pin due to varies injunctions 2V
RIC = Interconnect Resistance
RSS = Resistance of Sampling switch
SS = Sampling Switch 5 6 7 8 9 10 11
VT = Threshold Voltage Sampling Switch
(k )
Full-Scale Range
3FFh
3FEh
3FDh
3FCh
ADC Output Code
3FBh
03h
02h
01h
00h
Analog Input Voltage
0.5 LSB 1.5 LSB
Ref- Zero-Scale
Transition Full-Scale
Transition Ref+
The positive input source (VSOURCE+) of the DAC can The Digital-to-Analog Converter (DAC) can be enabled
be connected to: by setting the DACEN bit of the DACxCON0 register.
Rev. 10-000026B
9/6/2013
VDD 00
VREF+ 01 VSOURCE+
FVR_buffer2 10 DACR<4:0>
5
Reserved 11 R
DACPSS R
DACEN R
R
32-to-1 MUX
32 DACx_output
To Peripherals
Steps
R DACxOUT1 (1)
DACOE1
R
VSOURCE-
VSS
DACR 4:0
DACx_output = VSOURCE+ – VSOURCE- -----------------------------
5 + VSOURCE-
2
Note: See the DACxCON0 register for the available VSOURCE+ and VSOURCE- selections.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Rev. 10-000027G
10/29/2014
3
CxNCH<2:0> CxON(1)
Interrupt CxINTP
Rising
Edge set bit
CxIN0- 000 CxIF
Interrupt CxINTN
CxIN1- 001
Falling
CxIN2- 010 CxON(1) Edge
CxOUT_sync to
peripherals
CxSYNC
CxIN+ 00 CxOE
TRIS bit
DAC_output 01 0
CxOUT
FVR_buffer2 10
D Q 1
11
Note 1: When CxON = 0, all multiplexer inputs are disconnected and the Comparator will produce a ‘0’ at the output.
Rev. 10-000071A
8/2/2013
VDD
Analog
VT § 0.6V
RS < 10K Input pin RIC
To Comparator
ILEAKAGE(1)
VA CPIN VT § 0.6V
5pF
VSS
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
• 8-bit timer/counter register (TMR0) 8-Bit Counter mode using the T0CKI pin is selected by
setting the TMR0CS bit in the OPTION_REG register to
• 3-bit prescaler (independent of Watchdog Timer)
‘1’.
• Programmable internal or external clock source
The rising or falling transition of the incrementing edge
• Programmable external clock edge selection
for either input source is determined by the TMR0SE bit
• Interrupt on overflow in the OPTION_REG register.
• TMR0 can be used to gate Timer1
Figure 19-1 is a block diagram of the Timer0 module.
Rev. 10-000017A
TMR0CS 8/5/2013
Fosc/4 PSA
T0CKI(1) 0 T0_overflow
1 T0CKI
TMR0
1 Prescaler 0 FOSC/2 Sync Circuit Q1
write R
to
TMR0
TMR0SE set bit
PS<2:0>
TMR0IF
Note 1: The T0CKI prescale output frequency should not exceed FOSC/8.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
000 1:2
001 1:4
010 1:8
011 1 : 16
100 1 : 32
101 1 : 64
110 1 : 128
111 1 : 256
T1GSPM
T1G 00
T0_overflow 01
1
C1OUT_sync 10 0 Single Pulse D Q T1GVAL
0
Reserved 11 1 Acq. Control
Q1
D Q
T1GPOL T1GGO/DONE
CK Q
TMR1ON Interrupt
set bit
R
T1GTM det TMR1GIF
TMR1GE
set flag bit
TMR1IF
TMR1ON
EN
TMR1(2)
T1_overflow Synchronized Clock Input
TMR1H TMR1L Q D 0
1
T1CLK
T1SYNC
TMR1CS<1:0>
LFINTOSC 11
(1)
T1CKI 10 Prescaler
Fosc Synchronize(3)
01 1,2,4,8
Internal Clock det
00
2
Fosc/4 Fosc/2
Internal Clock T1CKPS<1:0> Internal Sleep
Clock Input
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
TMR1GE
T1GPOL
t1g_in
T1CKI
T1GVAL
TMR1GE
T1GPOL
T1GTM
t1g_in
T1CKI
T1GVAL
TMR1GE
T1GPOL
T1GSPM
Cleared by hardware on
T1GGO/ Set by software falling edge of T1GVAL
DONE
Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Cleared by
TMR1GIF Cleared by software Set by hardware on software
falling edge of T1GVAL
TMR1GE
T1GPOL
T1GSPM
T1GTM
Cleared by hardware on
T1GGO/ Set by software falling edge of T1GVAL
DONE Counting enabled on
rising edge of T1G
t1g_in
T1CKI
T1GVAL
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared HC = Bit is cleared by hardware
Rev. 10-000019A
7/30/2013
T2_match
Prescaler To Peripherals
TMR2 R
Fosc/4 1:1, 1:4, 1:16, 1:64
2
Postscaler set bit
T2CKPS<1:0> Comparator
1:1 to 1:16 TMR2IF
PR2 T2OUTPS<3:0>
Rev. 10-000020A
7/30/2013
FOSC/4
1:4
Prescale
0x03
PR2
Note 1: The Pulse Width of T2_match is equal to the scaled input of TMR2.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Data bus
8 TXIE
Interrupt
TXREG register TXIF
TX_out
TXEN
TRMT
Baud Rate Generator
FOSC ÷n TX9
n
BRG16 TX9D
+1 Multiplier x4 x16 x64
SYNC 1 x 0 0 0
BRGH x 1 1 0 0
SPBRGH SPBRGL
BRG16 x 1 0 1 0
Rev. 10-000114A
7/30/2013
SPEN
SYNC 1 x 0 0 0
BRGH x 1 1 0 0
SPBRGH SPBRGL FIFO
BRG16 x 1 0 1 0 FERR RX9D RCREG Register
8
Data Bus
RCIF
Interrupt
RCIE
Write to TXREG
Word 1
BRG Output
(Shift Clock)
TX/CK
pin Start bit bit 0 bit 1 bit 7/8 Stop bit
Word 1
TXIF bit
(Transmit Buffer 1 TCY
Reg. Empty Flag)
Write to TXREG
Word 1 Word 2
BRG Output
(Shift Clock)
TX/CK
pin Start bit bit 0 bit 1 bit 7/8 Stop bit Start bit bit 0
TXIF bit 1 TCY Word 1 Word 2
(Transmit Buffer
Reg. Empty Flag) 1 TCY
• CREN = 1 Immediately after all data bits and the Stop bit have
been received, the character in the RSR is transferred
• SYNC = 0
to the EUSART receive FIFO and the RCIF interrupt
• SPEN = 1 flag bit of the PIR1 register is set. The top character in
All other EUSART control bits are assumed to be in the FIFO is transferred out of the FIFO by reading the
their default state. RCREG register.
Setting the CREN bit of the RCSTA register enables the Note: If the receive FIFO is overrun, no additional
receiver circuitry of the EUSART. Clearing the SYNC bit characters will be received until the overrun
of the TXSTA register configures the EUSART for condition is cleared. See Section
asynchronous operation. Setting the SPEN bit of the 22.1.2.5 “Receive Overrun Error” for
RCSTA register enables the EUSART. The programmer more information on overrun errors.
must set the corresponding TRIS bit to configure the
RX/DT I/O pin as an input. 22.1.2.3 Receive Interrupts
Note: If the RX/DT function is on an analog pin, The RCIF interrupt flag bit of the PIR1 register is set
the corresponding ANSEL bit must be whenever the EUSART receiver is enabled and there is
cleared for the receiver to function. an unread character in the receive FIFO. The RCIF
interrupt flag bit is read-only, it cannot be set or cleared
by software.
RCIF interrupts are enabled by setting all of the
following bits:
• RCIE, Interrupt Enable bit of the PIE1 register
• PEIE, Peripheral Interrupt Enable bit of the
INTCON register
• GIE, Global Interrupt Enable bit of the INTCON
register
The RCIF interrupt flag bit will be set when there is an
unread character in the FIFO, regardless of the state of
interrupt enable bits.
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.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
TABLE 22-4: SUMMARY OF REGISTERS ASSOCIATED WITH THE BAUD RATE GENERATOR
Register
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
on Page
BAUDCON ABDOVF RCIDL — SCKP BRG16 — WUE ABDEN 206
RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 205
SPBRGL BRG<7:0> 207*
SPBRGH BRG<15:8> 207*
TXSTA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 204
Legend: — = unimplemented location, read as ‘0’. Shaded cells are not used for the Baud Rate Generator.
* Page provides register information.
BAUD FOSC = 8.000 MHz FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 — — — 300 0.16 207 300 0.00 191 300 0.16 51
1200 1202 0.16 103 1202 0.16 51 1200 0.00 47 1202 0.16 12
2400 2404 0.16 51 2404 0.16 25 2400 0.00 23 — — —
9600 9615 0.16 12 — — — 9600 0.00 5 — — —
10417 10417 0.00 11 10417 0.00 5 — — — — — —
19.2k — — — — — — 19.20k 0.00 2 — — —
57.6k — — — — — — 57.60k 0.00 0 — — —
115.2k — — — — — — — — — — — —
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 16.000 MHz FOSC = 11.0592 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (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 9 111.1k -3.55 8 115.2k 0.00 5
BAUD FOSC = 8.000 MHz FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 — — — — — — — — — 300 0.16 207
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 5
19.2k 19231 0.16 25 19.23k 0.16 12 19.2k 0.00 11 — — —
57.6k 55556 -3.55 8 — — — 57.60k 0.00 3 — — —
115.2k — — — — — — 115.2k 0.00 1 — — —
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 16.000 MHz FOSC = 11.0592 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (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 9 111.11k -3.55 8 115.2k 0.00 5
BAUD FOSC = 8.000 MHz FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 299.9 -0.02 1666 300.1 0.04 832 300.0 0.00 767 300.5 0.16 207
1200 1199 -0.08 416 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 5
19.2k 19.23k 0.16 25 19.23k 0.16 12 19.20k 0.00 11 — — —
57.6k 55556 -3.55 8 — — — 57.60k 0.00 3 — — —
115.2k — — — — — — 115.2k 0.00 1 — — —
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 16.000 MHz FOSC = 11.0592 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
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
2400 2400 0.02 2082 2400 0.00 1919 2399.5 -0.02 1666 2400 0.00 1151
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
19.2k 19.23k 0.16 259 19.20k 0.00 239 19.23k 0.16 207 19.20k 0.00 143
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
BAUD FOSC = 8.000 MHz FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 1.000 MHz
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (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 0 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 8 115.2k 0.00 7 — — —
BRG Clock
RCIDL
RCIF bit
(Interrupt)
Read
RCREG
Note 1: The ABD sequence requires the EUSART module to be configured in Asynchronous mode.
Terminating the auto-baud process early to clear an Therefore, the initial character in the transmission must
overflow condition will prevent proper detection of the be all ‘0’s. This must be ten or more bit times, 13-bit
sync character fifth rising edge. If any falling edges of times recommended for LIN bus, or any number of bit
the sync character have not yet occurred when the times for standard RS-232 devices.
ABDEN bit is cleared then those will be falsely detected Oscillator Start-up Time
as start bits. The following steps are recommended to
Oscillator start-up time must be considered, especially
clear the overflow condition:
in applications using oscillators with longer start-up
1. Read RCREG to clear RCIF. intervals (i.e., LP, XT or HS/PLL mode). The Sync
2. If RCIDL is zero then wait for RCIF and repeat Break (or wake-up signal) character must be of
step 1. sufficient length, and be followed by a sufficient
3. Clear the ABDOVF bit. interval, to allow enough time for the selected oscillator
to start and provide proper initialization of the EUSART.
22.4.3 AUTO-WAKE-UP ON BREAK WUE Bit
During Sleep mode, all clocks to the EUSART are The wake-up event causes a receive interrupt by
suspended. Because of this, the Baud Rate Generator setting the RCIF bit. The WUE bit is cleared in
is inactive and a proper character reception cannot be hardware by a rising edge on RX/DT. The interrupt
performed. The Auto-Wake-up feature allows the condition is then cleared in software by reading the
controller to wake-up due to activity on the RX/DT line. RCREG register and discarding its contents.
This feature is available only in Asynchronous mode.
To ensure that no actual data is lost, check the RCIDL
The Auto-Wake-up feature is enabled by setting the bit to verify that a receive operation is not in process
WUE bit of the BAUDCON register. Once set, the normal before setting the WUE bit. If a receive operation is not
receive sequence on RX/DT is disabled, and the occurring, the WUE bit may then be set just prior to
EUSART remains in an Idle state, monitoring for a entering the Sleep mode.
wake-up event independent of the CPU mode. A
wake-up event consists of a high-to-low transition on the
RX/DT line. (This coincides with the start of a Sync Break
or a wake-up signal character for the LIN protocol.)
The EUSART module generates an RCIF interrupt
coincident with the wake-up event. The interrupt is
generated synchronously to the Q clocks in normal CPU
operating modes (Figure 22-7), and asynchronously if
the device is in Sleep mode (Figure 22-8). The interrupt
condition is cleared by reading the RCREG register.
The WUE bit is automatically cleared by the low-to-high
transition on the RX line at the end of the Break. This
signals to the user that the Break event is over. At this
point, the EUSART module is in Idle mode waiting to
receive the next character.
RCIF
Cleared due to User Read of RCREG
Note 1: The EUSART remains in Idle while the WUE bit is set.
Note 1: 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.
2: The EUSART remains in Idle while the WUE bit is set.
Write to TXREG
Dummy Write
BRG Output
(Shift Clock)
TX/CK pin
(SCKP = 1)
Write to
TXREG Reg Write Word 1 Write Word 2
TXIF bit
(Interrupt Flag)
TRMT bit
‘1’ ‘1’
TXEN bit
Note: Sync Master mode, SPBRGL = 0, continuous transmission of two 8-bit words.
TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
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
RCIF bit
(Interrupt)
Read
RCREG
Note: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0.
EN
PHx_match PWM Control
Unit D Q PWMxOUT
DCx_match
Q4 CK
OF4_match(1) 11 PWMxPOL
PWMx_output
OF3_match(1) 10 OF_match To Peripherals
Offset
OF2_match(1) 01 PRx_match PWMxOE
Control
OF1_match(1) 00
OFM<1:0> PWMx
E R U/D
OFS
PWM_clock PWMxTMR TRIS Control
16-bt Latch LDx_trigger 16-bt Latch LDx_trigger 16-bt Latch LDx_trigger 16-bt Latch LDx_trigger
Note 1: A PWM module cannot trigger from its own offset match event.
The input corresponding to a PWM module’s own offset match is reserved.
Rev. 10-000153A
4/21/2014
LD3_trigger(1) 11
LD2_trigger (1)
10
LD1_trigger(1) 01
Reserved 00 1
LDx_trigger
0 D Q
PWMxLDA(2)
PWMxLDS PRx_match
PWMxLDT
PWM_clock
Note 1. The input corresponding to a PWM module’s own load trigger is reserved.
2. PWMxLDA is cleared by hardware upon LDx_trigger.
PWMxDC – PWMx PH
Duty Cycle = -----------------------------------------------------------------
PWMxPR + 1 PWMxPR + 1 Prescale 2
Period = ---------------------------------------------------------------------------
PWMxCLK
Rev. 10-000142A
9/5/2013
Period
Duty Cycle
Phase
PWMxCLK
PWMxPR 10
PWMxPH 4
PWMxDC 9
PWMxTMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
PWMxOUT
Rev. 10-000143A
9/5/2013
PIC16(L)F1574/5/8/9
Period
Phase
PWMxCLK
PWMxPR 10
PWMxPH 4
PWMxTMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
DS40001782A-page 225
PWMxOUT
FIGURE 23-6: TOGGLE-ON MATCH PWM MODE TIMING DIAGRAM
DS40001782A-page 226
PIC16(L)F1574/5/8/9
Rev. 10-000144A
9/5/2013
Period
Phase
PWMxCLK
PWMxPR 10
PWMxPH 4
PWMxTMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
PWMxOUT
Period
Duty Cycle
PWMxCLK
PWMxPR 6
2015 Microchip Technology Inc.
PWMxDC 4
PWMxTMR 0 1 2 3 4 5 6 6 5 4 3 2 1 0 0 1 2 3
PWMxOUT
PIC16(L)F1574/5/8/9
23.3 Offset Modes timer will continue to count. Slaves operating in this
mode must have a PWMxPH register pair value equal
The Offset modes provide the means to adjust the to or greater than 1, otherwise, the phase match event
waveform of a slave PWM module relative to the wave- will not occur precluding the start of the PWM output
form of a master PWM module in the same device. duty cycle.
23.3.1 INDEPENDENT RUN MODE The offset timing will persist If both the master and
slave PWMxPR values are the same and the Slave
In Independent Run mode (OFM = 00), the PWM Offset mode is changed to Independent Run mode
module is unaffected by the other PWM modules in the while the PWM module is operating.
device. The PWMxTMR associated with the PWM
module in this mode starts counting as soon as the EN A detailed timing diagram of this mode used in
bit associated with this PWM module is set and contin- Standard PWM mode is shown in Figure 23-11.
ues counting until the EN bit is cleared. Period events Note: Unexpected results will occur if the slave
reset the PWMxTMR to zero after which the timer PWM_clock is a higher frequency than the
continues to count. master PWM_clock.
A detailed timing diagram of this mode used with
Standard PWM mode is shown in Figure 23-8. 23.3.5 OFFSET MATCH IN CENTER
ALIGNED MODE
23.3.2 SLAVE RUN MODE WITH SYNC
When a master is operating in Center Aligned mode the
START
offset match event depends on which direction the
In Slave Run mode with Sync Start (OFM = 01), the PWMxTMR is counting. Clearing the OFO bit of the
slave PWMxTMR waits for the master’s OF_match PWMxOFCON register will cause the OF_match event
event. When this event occurs, if the EN bit is set, the to occur when the timer is counting up. Setting the OFO
PWMxTMR begins counting and continues to count bit of the PWMxOFCON register will cause the
until software clears the EN bit. Slave period events OF_match event to occur when the timer is counting
reset the PWMxTMR to zero after which the timer down. The OFO bit is ignored in non-center aligned
continues to count. modes.
A detailed timing diagram of this mode used with The OFO bit is double buffered and requires setting the
Standard PWM mode is shown in Figure 23-9. LDA bit to take effect when the PWM module is operat-
ing.
23.3.3 ONE-SHOT SLAVE MODE WITH
Detailed timing diagrams of Center Aligned mode using
SYNC START
offset match control in Independent Slave with Sync
In One-Shot Slave mode with Synchronous Start (OFM Start mode can be seen in Figure 23-12 and
= 10), the slave PWMxTMR waits until the master’s Figure 23-13.
OF_match event. The timer then begins counting, start-
ing from the value that is already in the timer, and con-
tinues to count until the period match event. When the
period event occurs the timer resets to zero and stops
counting. The timer then waits until the next master
OF_match event after which it begins counting again to
repeat the cycle.
A detailed timing diagram of this mode used with
Standard PWM mode is shown in Figure 23-10.
PIC16(L)F1574/5/8/9
Rev. 10-000 146B
4/22/201 4
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR 10
PWM5PH 3
PWM5DC 5
PWM5OF 2
PWM5TMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
PWM5OUT
OF5_match
PH5_match
DC5_match
PR5_match
PWM6TMR 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0 1 2
PWM6PR 4
2015 Microchip Technology Inc.
PWM6PH 0
PWM6DC 1
PWM6OUT
FIGURE 23-9: SLAVE RUN MODE WITH SYNC START TIMING DIAGRAM
2015 Microchip Technology Inc.
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR 10
PWM5PH 3
PWM5DC 5
PWM5OF 2
PWM5TMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
PWM5OUT
OF5_match
PWM6TMR 0 1 2 3 4 0 1 2 3 4 0 1 2 3 4 0
PIC16(L)F1574/5/8/9
PWM6PR 4
PWM6PH 0
PWM6DC 1
PWM6OUT
DS40001782A-page 229
FIGURE 23-10: ONE-SHOT SLAVE RUN MODE WITH SYNC START TIMING DIAGRAM
DS40001782A-page 230
PIC16(L)F1574/5/8/9
Rev. 10-000 148B
4/22/201 4
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR 10
PWM5PH 3
PWM5DC 5
PWM5OF 2
PWM5TMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
PWM5OUT
OF5_match
PWM6TMR 0 1 2 3 4 0 1 2 3 4
PWM6PR 4
PWM6PH 0
PWM6DC 1
PWM6OUT
2015 Microchip Technology Inc.
FIGURE 23-11: CONTINUOUS SLAVE RUN MODE WITH IMMEDIATE RESET AND SYNC START TIMING DIAGRAM
2015 Microchip Technology Inc.
Period
Duty Cycle
Phase
Offset
PWM5CLK
PWM5PR 10
PWM5PH 3
PWM5DC 5
PWM5OF 2
PWM5TMR 0 1 2 3 4 5 6 7 8 9 10 0 1 2 3 4 5 6
PWM5OUT
OF5_match
PWM6TMR 0 1 2 3 4 0 1 2 3 4 0 1 1 2 3 4
PWM6PR 4
PIC16(L)F1574/5/8/9
PWM6PH 0
PWM6DC 1
PWM6OUT
DS40001782A-page 231
FIGURE 23-12: OFFSET MATCH ON INCREMENTING TIMER TIMING DIAGRAM
DS40001782A-page 232
PIC16(L)F1574/5/8/9
Rev. 10-000 150B
4/22/201 4
Period
Duty Cycle
Offset
PWM5CLK
PWM5PR 6
PWM5DC 2
PWM5OF 2
PWM5TMR 0 1 2 3 4 5 6 6 5 4 3 2 1 0 0 1 2 3
PWM5OUT
OF5_match
PH5_match
DC5_match
PR5_match
PWM6TMR 0 0 1 2 3 4 4 3 2 1 0 0 0 1
PWM6PR 4
PWM6DC 1
2015 Microchip Technology Inc.
PWM6OUT
FIGURE 23-13: OFFSET MATCH ON DECREMENTING TIMER TIMING DIAGRAM
2015 Microchip Technology Inc.
Period
Duty Cycle
Offset
PWM5CLK
PWM5PR 6
PWM5DC 2
PWM5OF 2
PWM5TMR 0 1 2 3 4 5 6 6 5 4 3 2 1 0 0 1 2 3
PWM5OUT
OF5_match
PH5_match
DC5_match
PR5_match
PIC16(L)F1574/5/8/9
PWM6TMR 0 0 1 2 3 4 4 3
PWM6PR 4
PWM6DC 1
PWM6OUT
DS40001782A-page 233
PIC16(L)F1574/5/8/9
23.4 Reload Operation 23.5 Operation in Sleep Mode
Four of the PWM module control register pairs and one Each PWM module will continue to operate in Sleep
control bit are double buffered so that all can be mode when either the HFINTOSC or LFINTOSC is
updated simultaneously. These include: selected as the clock source by PWMxCLKCON<1:0>.
• PWMxPHH:PWMxPHL register pair
• PWMxDCH:PWMxDCL register pair 23.6 Interrupts
• PWMxPRH:PWMxPRL register pair Each PWM module has four independent interrupts
• PWMxOFH:PWMxOFL register pair based on the phase, duty cycle, period, and offset
• ODO control bit match events. The interrupt flag is set on the rising
edge of each of these signals. Refer to Figures 23-8
When written to, these registers do not immediately and 23-12 for detailed timing diagrams of the match
affect the operation of the PWM. By default, writes to signals.
these registers will not be loaded into the PWM operat-
ing buffer registers until after the arming conditions are
met. The arming control has two methods of operation:
• 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.
Legend:
HC = Bit is cleared by hardware HS = Bit is set by hardware
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
HC = Bit is cleared by hardware HS = Bit is set by hardware
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Note: There are no long and short bit name variants for the following three mirror registers
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
PIC16(L)F1574/5/8/9
Rev. 10-000123F
12/18/2014
2
GxASDLA
00
1 GxASDLA = 01
‘0' 10
GxCS
‘1' 11
CWGxDBR
FOSC cwg_clock
6
HFINTOSC
CWGxA
1
3 EN
GxIS =
0
R
TRISx
C1OUT_async S Q GxPOLA
C2OUT_async Input Source
CWGxDBF
PWM1_out
PWM2_out 6
PWM3_out R Q
PWM4_out
CWG Input Pin
Reserved EN
= TRISx
R 0
1
GxPOLB CWGxB
00
CWG Input Pin
‘0' 10
GxASDSPPS
Auto-Shutdown GxASE
‘1'
2015 Microchip Technology Inc.
Source 11
C2OUT_async S shutdown
GxASDSC2 S Q D Q
2
C1OUT_async GxASDLB
GxASDSC1 GxASDLB = 01
GxASE Data Bit R Q
WRITE
GxARSEN set dominate
x = CWG module number
PIC16(L)F1574/5/8/9
FIGURE 24-2: TYPICAL CWG OPERATION WITH PWM1 (NO AUTO-SHUTDOWN)
cwg_clock
PWM1
CWGxA
PIC16(L)F1574/5/8/9
cwg_clock
Input Source
CWGxA
CWGxB
FIGURE 24-4: DEAD-BAND OPERATION, CWGxDBR = 03H, CWGxDBF = 04H, SOURCE SHORTER THAN DEAD BAND
cwg_clock
Input Source
CWGxA
CWGxB
CWG Input
Source
Shutdown Source
GxASE
No Shutdown
Shutdown Output Resumes
FIGURE 24-6: SHUTDOWN FUNCTIONALITY, AUTO-RESTART ENABLED (GxARSEN = 1,GxASDLA = 01, GxASDLB = 01)
PIC16(L)F1574/5/8/9
CWG Input
Source
Shutdown Source
GxASE
DS40001782A-page 254
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -n/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared q = Value depends on condition
25.2 Low-Voltage Programming Entry Another connector often found in use with the PICkit™
Mode programmers is a standard 6-pin header with 0.1 inch
spacing. Refer to Figure 25-2.
The Low-Voltage Programming Entry mode allows the
PIC® Flash MCUs to be programmed using VDD only,
without high voltage. When the LVP bit of Configuration
Words is set to ‘1’, the ICSP Low-Voltage Programming
Entry mode is enabled. To disable the Low-Voltage
ICSP mode, the LVP bit must be programmed to ‘0’.
Entry into the Low-Voltage Programming Entry mode
requires the following steps:
1. MCLR is brought to VIL.
2. A 32-bit key sequence is presented on
ICSPDAT, while clocking ICSPCLK.
Once the key sequence is complete, MCLR must be
held at VIL for as long as Program/Verify mode is to be
maintained.
If low-voltage programming is enabled (LVP = 1), the
MCLR Reset function is automatically enabled and
cannot be disabled. See Section 6.5 “MCLR” for more
information.
The LVP bit can only be reprogrammed to ‘0’ by using
the High-Voltage Programming mode.
Pin 1 Indicator
Pin Description*
1 = VPP/MCLR
1
2
2 = VDD Target
3
4 3 = VSS (ground)
5
6 4 = ICSPDAT
5 = ICSPCLK
6 = No connect
For additional interface recommendations, refer to your It is recommended that isolation devices be used to
specific device programmer manual prior to PCB separate the programming pins from other circuitry.
design. The type of isolation is highly dependent on the specific
application and may include devices such as resistors,
diodes, or even jumpers. See Figure 25-3 for more
information.
Rev. 10-000129A
7/30/2013
External Device to be
Programming VDD Programmed
Signals
VDD VDD
VPP MCLR/VPP
VSS VSS
Data ICSPDAT
Clock ICSPCLK
* * *
To Normal Connections
OPCODE only
13 0
OPCODE
CONTROL OPERATIONS
BRA k Relative Branch 2 11 001k kkkk kkkk
BRW – Relative Branch with W 2 00 0000 0000 1011
CALL k Call Subroutine 2 10 0kkk kkkk kkkk
CALLW – Call Subroutine with W 2 00 0000 0000 1010
GOTO k Go to address 2 10 1kkk kkkk kkkk
RETFIE k Return from interrupt 2 00 0000 0000 1001
RETLW k Return with literal in W 2 11 0100 kkkk kkkk
RETURN – Return from Subroutine 2 00 0000 0000 1000
INHERENT OPERATIONS
CLRWDT – Clear Watchdog Timer 1 00 0000 0110 0100 TO, PD
NOP – No Operation 1 00 0000 0000 0000
OPTION – Load OPTION_REG register with W 1 00 0000 0110 0010
RESET – Software device Reset 1 00 0000 0000 0001
SLEEP – Go into Standby mode 1 00 0000 0110 0011 TO, PD
TRIS f Load TRIS register with W 1 00 0000 0110 0fff
C-COMPILER OPTIMIZED
ADDFSR n, k Add Literal k to FSRn 1 11 0001 0nkk kkkk
MOVIW n mm Move Indirect FSRn to W with pre/post inc/dec 1 00 0000 0001 0nmm Z 2, 3
modifier, mm kkkk
k[n] Move INDFn to W, Indexed Indirect. 1 11 1111 0nkk 1nmm Z 2
MOVWI n mm Move W to Indirect FSRn with pre/post inc/dec 1 00 0000 0001 kkkk 2, 3
modifier, mm
k[n] Move W to INDFn, Indexed Indirect. 1 11 1111 1nkk 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.
Description: Bit ‘b’ in register ‘f’ is cleared. Description: If bit ‘b’ in register ‘f’ is ‘1’, the next
instruction is executed.
If bit ‘b’, in register ‘f’, is ‘0’, the next
instruction is discarded, and a NOP is
executed instead, making this a
2-cycle instruction.
C register f 0 Words: 1
Cycles: 1
Example: MOVF FSR, 0
After Instruction
LSRF Logical Right Shift
W = value in FSR register
Syntax: [ label ] LSRF f {,d} Z = 1
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: The contents of register ‘f’ are shifted
one bit to the right through the Carry
flag. A ‘0’ is shifted into the MSb. If ‘d’ is
‘0’, the result is placed in W. If ‘d’ is ‘1’,
the result is stored back in register ‘f’.
0 register f C
Before Instruction
W = 0x07
After Instruction
W = value of k8
Note 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 27-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.
Rev. 10-000130B
9/19/2013
5.5
VDD (V)
2.5
2.3
0 16 32
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 27-7 for each Oscillator mode’s supported frequencies.
Rev. 10-000131B
9/19/2013
3.6
VDD (V)
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 27-7 for each Oscillator mode’s supported frequencies.
PIC16F1574/5/8/9
Param. Sym. Characteristic Min. Typ† Max. Units Conditions
No.
D001 VDD Supply Voltage
VDDMIN VDDMAX
1.8 — 3.6 V FOSC 16 MHz
2.5 — 3.6 V FOSC 32 MHz (Note 3)
D001 2.3 — 5.5 V FOSC 16 MHz
2.5 — 5.5 V FOSC 32 MHz (Note 3)
D002* VDR RAM Data Retention Voltage(1)
1.5 — — V Device in Sleep mode
D002* 1.7 — — V Device in Sleep mode
D002A* VPOR Power-on Reset Release Voltage(2)
— 1.6 — V
D002A* — 1.6 — V
D002B* VPORR* Power-on Reset Rearm Voltage(2)
— 0.8 — V
D002B* — 1.5 — V
D003 VFVR Fixed Voltage Reference Voltage — 1.024 — V -40°C TA +85°C
D003A VADFVR FVR Gain Voltage Accuracy for 1x VFVR, ADFVR = 01, VDD 2.5V
ADC -4 — +4 % 2x VFVR, ADFVR = 10, VDD 2.5V
4x VFVR, ADFVR = 11, VDD 4.75V
D003B VCDAFVR FVR Gain Voltage Accuracy for 1x VFVR, CDAFVR = 01, VDD 2.5V
Comparator -4 — +4 % 2x VFVR, CDAFVR = 10, VDD 2.5V
4x VFVR, CDAFVR = 11, VDD 4.75V
D004* SVDD VDD Rise Rate(2) 0.05 — — V/ms Ensures that the Power-on Reset
signal is released properly.
*
These parameters are characterized but not tested.
†
Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: This is the limit to which VDD can be lowered in Sleep mode without losing RAM data.
2: See Figure 27-3, POR and POR REARM with Slow Rising VDD.
3: PLL required for 32 MHz operation.
VDD
VPOR
VPORR
SVDD
VSS
NPOR(1)
POR REARM
VSS
TVLOW(2) TPOR(3)
PIC16F1574/5/8/9
PIC16F1574/5/8/9
D022 Base IPD — 0.3 1.1 3.3 A 2.3 WDT, BOR, and FVR disabled, all
— 0.4 3.5 4.4 A 3.0 Peripherals inactive,
Low-Power Sleep mode,
— 0.5 4.2 5.2 A 5.0 VREGPM = 1
D022A Base IPD — 10.4 16.1 17.3 A 2.3 WDT, BOR, and FVR disabled, all
— 12.7 21.9 24.2 A 3.0 Peripherals inactive,
Normal-Power Sleep mode,
— 13.8 24.2 25.3 A 5.0 VREGPM = 0
D023 — 0.4 1.0 3.4 A 1.8 WDT Current
— 0.6 1.3 4.1 A 3.0
D023 — 0.6 2.0 4.8 A 2.3 WDT Current
— 0.7 2.2 5.1 A 3.0
— 0.9 2.5 5.5 A 5.0
D023A — 15 21 23 A 1.8 FVR Current
— 26 33 34 A 3.0
D023A — 19 28 29 A 2.3 FVR Current
— 22 35 36 A 3.0
— 23 38 41 A 5.0
D024 — 7.5 10.4 12.7 A 3.0 BOR Current
D024 — 8.1 11.5 12.7 A 3.0 BOR Current
— 9.2 13.8 15 A 5.0
D24A — 0.3 2.3 4.6 A 3.0 LPBOR Current
D24A — 0.5 2.3 4.6 A 3.0 LPBOR Current
— 0.6 3.5 5.8 A 5.0
D026 — 0.1 0.9 3.2 A 1.8 ADC Current (Note 3),
— 0.1 1.0 3.5 A 3.0 No conversion in progress
— 322 — — A 5.0
* These parameters are characterized but not tested.
† Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: The peripheral current can be determined by subtracting the base IPD current from this limit. Max. values should be
used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VSS.
3: ADC clock source is FRC.
— 19 28 30 A 5.0
D028A — 23 41 42 A 1.8 Comparator,
— 25 42 44 A 3.0 Normal Power, CxSP = 1
(Note 1)
D028A — 33 55 56 A 2.3 Comparator,
— 34 59 60 A 3.0 Normal Power, CxSP = 1
VREGPM = 1 (Note 1)
— 36 60 61 A 5.0
* These parameters are characterized but not tested.
† Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: The peripheral current can be determined by subtracting the base IPD current from this limit. Max. values should be
used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VSS.
3: ADC clock source is FRC.
Param.
Sym. Characteristic Min. Typ† Max. Units Conditions
No.
VIL Input Low Voltage
I/O PORT:
D030 with TTL buffer — — 0.8 V 4.5V VDD 5.5V
D030A — — 0.15 VDD V 1.8V VDD 4.5V
D031 with Schmitt Trigger buffer — — 0.2 VDD V 2.0V VDD 5.5V
with I2C™ levels — — 0.3 VDD V
with SMbus levels — — 0.8 V 2.7V VDD 5.5V
D032 MCLR — — 0.2 VDD V
VIH Input High Voltage
I/O PORT:
D040 with TTL buffer 2.0 — — V 4.5V VDD 5.5V
D040A 0.25 VDD + — — V 1.8V VDD 4.5V
0.8
D041 with Schmitt Trigger buffer 0.8 VDD — — V 2.0V VDD 5.5V
with I2C™ levels 0.7 VDD — — V
with SMbus levels 2.1 — — V 2.7V VDD 5.5V
D042 MCLR 0.8 VDD — — V
IIL Input Leakage Current(1)
D060 I/O Ports — ±5 ± 125 nA VSS VPIN VDD,
Pin at high-impedance, 85°C
— ±5 ± 1000 nA VSS VPIN VDD,
Pin at high-impedance, 125°C
D061 MCLR(2) — ± 50 ± 200 nA VSS VPIN VDD,
Pin at high-impedance, 85°C
IPUR Weak Pull-up Current
D070* 25 100 200 A VDD = 3.3V, VPIN = VSS
25 140 300 A VDD = 5.0V, VPIN = VSS
VOL Output Low Voltage
D080 I/O Ports IOL = 8 mA, VDD = 5V
— — 0.6 V IOL = 6 mA, VDD = 3.3V
IOL = 1.8 mA, VDD = 1.8V
VOH Output High Voltage
D090 I/O Ports IOH = 3.5 mA, VDD = 5V
VDD - 0.7 — — V IOH = 3 mA, VDD = 3.3V
IOH = 1 mA, VDD = 1.8V
Capacitive Loading Specifications on Output Pins
D101A* CIO All I/O pins — — 50 pF
*
These parameters are characterized but not tested.
†
Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: Negative current is defined as current sourced by the pin.
2: The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified levels represent
normal operating conditions. Higher leakage current may be measured at different input voltages.
Param.
Sym. Characteristic Typ. Units Conditions
No.
TH01 JA Thermal Resistance Junction to Ambient 70 C/W 14-pin PDIP package
95.3 C/W 14-pin SOIC package
100 C/W 14-pin TSSOP package
31.8 C/W 16-pin UQFN 4x4mm package
62.2 C/W 20-pin PDIP package
77.7 C/W 20-pin SOIC package
87.3 C/W 20-pin SSOP package
32.8 C/W 20-pin UQFN 4x4mm package
TH02 JC Thermal Resistance Junction to Case 32.75 C/W 14-pin PDIP package
31 C/W 14-pin SOIC package
24.4 C/W 14-pin TSSOP package
24.4 C/W 16-pin UQFN 4x4mm package
27.5 C/W 20-pin PDIP package
23.1 C/W 20-pin SOIC package
31.1 C/W 20-pin SSOP package
27.4 C/W 20-pin UQFN 4x4mm package
TH03 TJMAX Maximum Junction Temperature 150 C
TH04 PD Power Dissipation — W PD = PINTERNAL + PI/O
TH05 PINTERNAL Internal Power Dissipation — W PINTERNAL = IDD x VDD(1)
TH06 PI/O I/O Power Dissipation — W PI/O = (IOL * VOL) + (IOH * (VDD - VOH))
TH07 PDER Derated Power — W PDER = PDMAX (TJ - TA)/JA(2)
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
Rev. 10-000133A
8/1/2013
Load Condition
Pin
CL
VSS
Q4 Q1 Q2 Q3 Q4 Q1
CLKIN
OS02
OS04 OS04
OS03
CLKOUT
(CLKOUT Mode)
Param.
Sym. Characteristic Min. Typ† Max. Units Conditions
No.
OS01 FOSC External CLKIN Frequency(1) DC — 0.5 MHz External Clock (ECL)
DC — 4 MHz External Clock (ECM)
DC — 20 MHz External Clock (ECH)
OS02 TOSC External CLKIN Period(1) 50 — ns External Clock (EC)
OS03 TCY Instruction Cycle Time(1) 200 TCY DC ns TCY = 4/FOSC
* These parameters are characterized but not tested.
†Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: Instruction cycle period (TCY) equals four times the input oscillator time base period. All specified values are based on
characterization data for that particular oscillator type under standard operating conditions with the device executing code.
Exceeding these specified limits may result in an unstable oscillator operation and/or higher than expected current con-
sumption. All devices are tested to operate at “min” values with an external clock applied to CLKIN pin. When an external
clock input is used, the “max” cycle time limit is “DC” (no clock) for all devices.
Param. Freq.
Sym. Characteristic Min. Typ† Max. Units Conditions
No. Tolerance
OS08 HFOSC Internal Calibrated HFINTOSC ±2% — 16.0 — MHz VDD = 3.0V, TA = 25°C,
Frequency(1) (Note 2)
OS09 LFOSC Internal LFINTOSC Frequency — — 31 — kHz
OS10* TIOSC ST HFINTOSC — — 5 15 s
Wake-up from Sleep Start-up Time
OS10A* TLFOSC ST LFINTOSC — — 0.5 — ms -40°C TA +125°C
Wake-up from Sleep Start-up Time
*
These parameters are characterized but not tested.
†
Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: To ensure these oscillator frequency tolerances, VDD and VSS must be capacitively decoupled as close to the device as
possible. 0.1 F and 0.01 F values in parallel are recommended.
2: See Figure 27-6: “HFINTOSC Frequency Accuracy over Device VDD and Temperature.
FIGURE 27-6: HFINTOSC FREQUENCY ACCURACY OVER DEVICE VDD AND TEMPERATURE
125
± 5%
85
± 3%
Temperature (°C)
60
25 ± 2%
± 5%
-40
1.8 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FOSC
OS11 OS12
OS20
CLKOUT OS21
OS19 OS16 OS18
OS13 OS17
I/O pin
(Input)
OS15 OS14
I/O pin Old Value New Value
(Output)
OS18, OS19
Param.
Sym. Characteristic Min. Typ† Max. Units Conditions
No.
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out 32
OSC
Start-up Time
Internal Reset(1)
Watchdog Timer
Reset(1)
31
34
34
I/O pins
Param.
Sym. Characteristic Min. Typ† Max. Units Conditions
No.
VDD
VBOR and VHYST
VBOR
37
Reset
33
(due to BOR)
T0CKI
40 41
42
T1CKI
45 46
47 49
TMR0 or
TMR1
Param.
Sym. Characteristic Min. Typ† Max. Units Conditions
No.
40* TT0H T0CKI High Pulse Width No Prescaler 0.5 TCY + 20 — — ns
With Prescaler 10 — — ns
41* TT0L T0CKI Low Pulse Width No Prescaler 0.5 TCY + 20 — — ns
With Prescaler 10 — — ns
42* TT0P T0CKI Period Greater of: — — ns N = prescale value
20 or TCY + 40
N
45* TT1H T1CKI High Synchronous, No Prescaler 0.5 TCY + 20 — — ns
Time Synchronous, with Prescaler 15 — — ns
Asynchronous 30 — — ns
46* TT1L T1CKI Low Synchronous, No Prescaler 0.5 TCY + 20 — — ns
Time Synchronous, with Prescaler 15 — — ns
Asynchronous 30 — — ns
47* TT1P T1CKI Input Synchronous Greater of: — — ns N = prescale value
Period 30 or TCY + 40
N
Asynchronous 60 — — ns
49* TCKEZTMR1 Delay from External Clock Edge to Timer 2 TOSC — 7 TOSC — Timers in Sync
Increment mode
* These parameters are characterized but not tested.
† Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not
tested.
BSF ADCON0, GO
1 TCY
AD133
AD131
Q4
AD130
ADC_clk
ADC Data 9 8 7 6 3 2 1 0
ADIF 1 TCY
GO DONE
BSF ADCON0, GO
AD133 1 TCY
AD131
Q4
AD130
ADC_clk
ADC Data 9 8 7 6 3 2 1 0
ADIF 1 TCY
GO DONE
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.
Param.
Sym. Characteristic Min. Typ† Max. Units Conditions
No.
AD130* TAD ADC Clock Period (TADC) 1.0 — 6.0 s FOSC-based
ADC Internal FRC Oscillator Period (TFRC) 1.0 2.0 6.0 s ADCS<2:0> = x11 (ADC FRC mode)
AD131 TCNV Conversion Time — 11 — TAD Set GO/DONE bit to conversion
(not including Acquisition Time)(1) complete
AD132* TACQ Acquisition Time — 5.0 — s
AD133* THCD Holding Capacitor Disconnect Time — 1/2 TAD — FOSC-based
— 1/2 TAD + 1TCY — ADCS<2:0> = x11 (ADC FRC mode)
*These parameters are characterized but not tested.
†Data in “Typ” column is at 3.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Note 1: The ADRES register may be read on the following TCY cycle.
Param.
Sym. Characteristics Min. Typ. Max. Units Comments
No.
DAC01* CLSB Step Size — VDD/32 — V
DAC02* CACC Absolute Accuracy — — 1/2 LSb
DAC03* CR Unit Resistor Value (R) — 5K —
DAC04* CST Settling Time(2) — — 10 s
* These parameters are characterized but not tested.
Note 1: See Section 28.0 “DC and AC Characteristics Graphs and Charts” for operating characterization.
2: Settling time measured while DACR<4:0> transitions from ‘0000’ to ‘1111’.
CK
US121 US121
DT
US120 US122
Param.
Symbol Characteristic Min. Max. Units Conditions
No.
US120 TCKH2DTV SYNC XMIT (Master and Slave) — 80 ns 3.0V VDD 5.5V
Clock high to data-out valid — 100 ns 1.8V VDD 5.5V
US121 TCKRF Clock out rise time and fall time — 45 ns 3.0V VDD 5.5V
(Master mode) — 50 ns 1.8V VDD 5.5V
US122 TDTRF Data-out rise time and fall time — 45 ns 3.0V VDD 5.5V
— 50 ns 1.8V VDD 5.5V
CK
US125
DT
US126
Param.
Symbol Characteristic Min. Max. Units Conditions
No.
US125 TDTV2CKL SYNC RCV (Master and Slave)
Data-hold before CK (DT hold time) 10 — ns
US126 TCKL2DTL Data-hold after CK (DT hold time) 15 — ns
The MPASM Assembler generates relocatable object • Support for the entire device instruction set
files for the MPLINK Object Linker, Intel® standard HEX • Support for fixed-point and floating-point data
files, MAP files to detail memory usage and symbol • Command-line interface
reference, absolute LST files that contain source lines • Rich directive set
and generated machine code, and COFF files for • Flexible macro language
debugging.
• MPLAB X IDE compatibility
The MPASM Assembler features include:
• Integration into MPLAB X IDE projects
• User-defined macros to streamline
assembly code
• Conditional assembly for multipurpose
source files
• Directives that allow complete control over the
assembly process
PIC16LF1574
-P e3
1420123
PIC16LF1575
-SL e3
1420123
XXXXXXXX L1575ST
YYWW 1420
NNN 123
Note: 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.
PIC16
PIN 1 PIN 1
LF1575
ML e3
410017
Note: 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.
XXXXXXXXXXXXXXXXX PIC16F1578
XXXXXXXXXXXXXXXXX -P e3
YYWWNNN 1120123
PIC16F1578
-SO e3
1120123
PIC16F1578
-SS e3
1420123
Example
20-Lead UQFN (4x4x0.5 mm)
PIC16
F1579
PIN 1 PIN 1
ML e3
140123
4
&'
!&" &5# *!(!!&
5%&
&#&
&&366***'
'65
NOTE 1
E1
1 2 3
A A2
L c
A1
b1
b e eB
7&! 8,9.
'!
:'&! 8 8; <
8"')
%! 8
& 2,
&
& = =
##5
5!! 1 - 1
2!&
& 1 = =
"# &
"# >#& . - -1
##5>#& . 1 ?
; :& -1 1 1
&
& : 1 - 1
:#
5!! ? 1
7 :#>#& ) 1 @
:
* :#>#& ) ?
;
*+ 2 = = -
!"#$%&" ' ()"&'"!&)
&#*&&&#
+%&, & !&
- '!
!#.#
&"#'
#%!
& "!
!
#%!
& "!
!!
&$#/ !#
'!
#&
.01
2,32!'!
&$&"!
**&
"&&
!
* ,12
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
4
&'
!&" &5# *!(!!&
5%&
&#&
&&366***'
'65
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
16-Lead Ultra Thin Plastic Quad Flat, No Lead Package (JQ) - 4x4x0.5 mm Body [UQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D A B
N
NOTE 1
2
E
(DATUM B)
(DATUM A)
2X
0.20 C
2X
0.20 C TOP VIEW
C 0.10 C A1
SEATING A
PLANE 16X
(A3) 0.08 C
SIDE VIEW
0.10 C A B
D2
0.10 C A B
E2
2
e
2
1
NOTE 1
K
N
L 16X b
e 0.10 C A B
BOTTOM VIEW
Microchip Technology Drawing C04-257A Sheet 1 of 2
16-Lead Ultra Thin Plastic Quad Flat, No Lead Package (JQ) - 4x4x0.5 mm Body [UQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 16
Pitch e 0.65 BSC
Overall Height A 0.45 0.50 0.55
Standoff A1 0.00 0.02 0.05
Terminal Thickness A3 0.127 REF
Overall Width E 4.00 BSC
Exposed Pad Width E2 2.50 2.60 2.70
Overall Length D 4.00 BSC
Exposed Pad Length D2 2.50 2.60 2.70
Terminal Width b 0.25 0.30 0.35
Terminal Length L 0.30 0.40 0.50
Terminal-to-Exposed-Pad K 0.20 - -
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated
3. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
16-Lead Ultra Thin Plastic Quad Flat, No Lead Package (JQ) - 4x4x0.5 mm Body
[UQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
C1
X2
16
1
2
C2 Y2
Y1
X1
E SILK SCREEN
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Contact Pitch E 0.65 BSC
Optional Center Pad Width X2 2.70
Optional Center Pad Length Y2 2.70
Contact Pad Spacing C1 4.00
Contact Pad Spacing C2 4.00
Contact Pad Width (X16) X1 0.35
Contact Pad Length (X16) Y1 0.80
Notes:
1. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
Microchip Technology Drawing C04-2257A
!
4
&'
!&" &5# *!(!!&
5%&
&#&
&&366***'
'65
NOTE 1 E1
1 2 3
A A2
L
c
A1
b1
b e eB
7&! 8,9.
'!
:'&! 8 8; <
8"')
%! 8
& 2,
&
& = =
##5
5!! 1 - 1
2!&
& 1 = =
"# &
"# >#& . - - -1
##5>#& . 1 ?
; :& ? - @
&
& : 1 - 1
:#
5!! ? 1
7 :#>#& ) 1 @
:
* :#>#& ) ?
;
*+ 2 = = -
!"#$%&" ' ()"&'"!&)
&#*&&&#
+%&, & !&
- '!
!#.#
&"#'
#%!
& "!
!
#%!
& "!
!!
&$#/ !#
'!
#&
.01
2,3 2!'!
&$&"!
**&
"&&
!
* ,2
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
!
"#$% " &
"" '( ""&
4
&'
!&" &5# *!(!!&
5%&
&#&
&&366***'
'65
D
N
E1
NOTE 1
1 2
e
b
c
A A2
φ
A1
L1 L
& Y Y ?Y
:#>#& ) = -?
!"#$%&" ' ()"&'"!&)
&#*&&&#
'!
!#.#
&"#'
#%!
& "!
!
#%!
& "!
!!
&$#'' !#
- '!
#&
.01
2,3 2!'!
&$&"!
**&
"&&
!
.43 % '!
("!"*&
"&&
(%
%
'&
"
!!
* ,2
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
20-Lead Ultra Thin Plastic Quad Flat, No Lead Package (GZ) - 4x4x0.5 mm Body [UQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D A B
N
NOTE 1
1
2
E
(DATUM B)
(DATUM A)
2X
0.20 C
2X
0.20 C TOP VIEW
C 0.10 C A1
SEATING A
PLANE 20X
(A3) 0.08 C
SIDE VIEW
0.10 C A B
D2
L
0.10 C A B
E2
2
K
1
NOTE 1 N
20X b
e 0.10 C A B
BOTTOM VIEW
Microchip Technology Drawing C04-255A Sheet 1 of 2
20-Lead Ultra Thin Plastic Quad Flat, No Lead Package (GZ) - 4x4x0.5 mm Body [UQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Terminals N 20
Pitch e 0.50 BSC
Overall Height A 0.45 0.50 0.55
Standoff A1 0.00 0.02 0.05
Terminal Thickness A3 0.127 REF
Overall Width E 4.00 BSC
Exposed Pad Width E2 2.60 2.70 2.80
Overall Length D 4.00 BSC
Exposed Pad Length D2 2.60 2.70 2.80
Terminal Width b 0.20 0.25 0.30
Terminal Length L 0.30 0.40 0.50
Terminal-to-Exposed-Pad K 0.20 - -
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated
3. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
20-Lead Ultra Thin Plastic Quad Flat, No Lead Package (GZ) - 4x4x0.5 mm Body [UQFN]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
C1
X2
20
1
2
C2 Y2
G1
Y1
X1
E SILK SCREEN
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Contact Pitch E 0.50 BSC
Optional Center Pad Width X2 2.80
Optional Center Pad Length Y2 2.80
Contact Pad Spacing C1 4.00
Contact Pad Spacing C2 4.00
Contact Pad Width (X20) X1 0.30
Contact Pad Length (X20) Y1 0.80
Contact Pad to Center Pad (X20) G1 0.20
Notes:
1. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
Microchip Technology Drawing C04-2255A
Revision A (2/2015)
Original release of this document.
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 Microchip’s 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 Microchip’s 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.
QUALITY MANAGEMENT SYSTEM Microchip received ISO/TS-16949:2009 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
CERTIFIED BY DNV Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
== ISO/TS 16949 ==
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.