PIC16 (L) F1526/7: 64-Pin Flash Microcontrollers With XLP Technology
PIC16 (L) F1526/7: 64-Pin Flash Microcontrollers With XLP Technology
PIC16 (L) F1526/7: 64-Pin Flash Microcontrollers With XLP Technology
Program Memory
Data Sheet Index
MSSP (I2C/SPI)
Advanced Control
Flash (words)
Data SRAM
(8/16-bit)
EUSART
Debug(1)
(bytes)
Timers
I/O’s(2)
10-bit (ch)
CCP
XLP
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.
RD0
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RE2
RE3
RE4
RE5
RE6
RE7
VDD
VSS
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
RE1 1 48 RB0
RE0 2 47 RB1
RG0 3 46 RB2
RG1 4 45 RB3
RG2 5 44 RB4
RG3 6 43 RB5
VPP/MCLR/RG5 7 42 RB6
RG4 8 PIC16(L)F1526 41 VSS
VSS 9 PIC16(L)F1527 40 RA6
VDD 10 39 RA7
RF7 11 38 VDD
RF6 12 37 RB7
RF5 13 36 RC5
RF4 14 35 RC4
RF3 15 34 RC3
RF2 16 33 RC2
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
RF1
RF0
RA3
RA2
RA5
RC1
RC0
RC6
RC7
RA1
RA0
RA4
AVSS
VSS
AVDD
VDD
RD0
RD1
RD2
RD3
RD4
RD5
RD6
RD7
RE2
RE3
RE4
RE5
RE6
RE7
VDD
VSS
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
RE1 1 48 RB0
RE0 2 47 RB1
RG0 3 46 RB2
RG1 4 45 RB3
RG2 5 44 RB4
RG3 6 43 RB5
VPP/MCLR/RG5 7 42 RB6
RG4 8 PIC16(L)F1526 41 VSS
VSS 9 PIC16(L)F1527 40 RA6
VDD 10 39 RA7
RF7 11 38 VDD
RF6 12 37 RB7
RF5 13 36 RC5
RF4 14 35 RC4
RF3 15 34 RC3
RF2 16 33 RC2
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
RF1
RF0
RA3
RA2
RA5
RC1
RC0
RC6
RC7
RA1
RA0
RA4
AVSS
VSS
AVDD
VDD
Interrupt
USART
Pull-up
Timers
Basic
ADC
CCP
SSP
I/O
RA0 24 AN0 — — — — — — —
RA1 23 AN1 — — — — — — —
RA2 22 AN2 — — — — — — —
RA3 21 AN3 — — — — — — VREF+
RA4 28 — T0CKI — — — — — —
RA5 27 AN4 T3G — — — — — —
RA6 40 — — — — — — — OSC2/CLKOUT
RA7 39 — — — — — — — OSC1/CLKIN
RB0 48 AN17 — — — — INT/ Y —
IOC
RB1 47 AN18 — — — — IOC Y —
RB2 46 AN19 — — — — IOC Y —
RB3 45 AN20 — — — — IOC Y —
RB4 44 AN21 T3CKI(1) — — — IOC Y —
RB5 43 AN22 T1G/T3CKI — — — IOC Y —
RB6 42 — — — — — IOC Y ICSPCLK/ICDCLK
RB7 37 — — — — — IOC Y ICSPDAT/ICDDAT
RC0 30 — SOSCO/T1CKI — — — — — —
RC1 29 — SOSCI CCP2 — — — — —
RC2 33 — — CCP1 — — — — —
RC3 34 — — — — SCK1/SCL1 — — —
RC4 35 — — — — SDI1/SDA1 — — —
RC5 36 — — — — SDO1 — — —
RC6 31 — — — TX1/CK1 — — — —
RC7 32 — — — RX1/DT1 — — — —
RD0 58 AN23 — — — — — Y —
RD1 55 AN24 T5CKI — — — — Y —
RD2 54 AN25 — — — — — Y —
RD3 53 AN26 — — — — — Y —
RD4 52 — — — — SDO2 — Y —
RD5 51 — — — — SDI2, SDA2 — Y —
RD6 50 — — — — SCK2, SCL2 — Y —
RD7 49 — — — — SS2 — Y —
RE0 2 AN27 — — — — Y —
RE1 1 AN28 — — — — — Y —
RE2 64 AN29 — CCP10 — — — Y —
RE3 63 — — CCP9 — — — Y —
RE4 62 — — CCP8 — — — Y —
RE5 61 — — CCP7 — — — Y —
RE6 60 — — CCP6 — — — Y —
Note 1: Alternate pin function selected with the APFCON (Register 12-1) register.
2: Weak pull-up is always enabled when MCLR is enabled, otherwise the pull-up is under user control.
Interrupt
USART
Pull-up
Timers
Basic
ADC
CCP
SSP
I/O
RE7 59 — — CCP2(1) — — — Y —
RF0 18 AN16 — — — — — — VCAP
RF1 17 AN6 — — — — — — —
RF2 16 AN7 — — — — — — —
RF3 15 AN8 — — — — — — —
RF4 14 AN9 — — — — — — —
RF5 13 AN10 — — — — — — —
RF6 12 AN11 — — — — — — —
RF7 11 AN5 — — — SS1 — — —
RG0 3 — — CCP3 — — — — —
RG1 4 AN15 — — TX2/CK2 — — — —
RG2 5 AN14 — — RX2/DT2 — — — —
RG3 6 AN13 — CCP4 — — — — —
RG4 8 AN12 T5G CCP5 — — — — —
RG5 7 — — — — — — Y(2) MCLR/VPP
VDD 10, 26, — — — — — — — VDD
38, 57
VSS 9, 25, — — — — — — — VSS
41, 56
AVDD 19 — — — — — — — AVDD
AVSS 20 — — — — — — — AVSS
Note 1: Alternate pin function selected with the APFCON (Register 12-1) register.
2: Weak pull-up is always enabled when MCLR is enabled, otherwise the pull-up is under user control.
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.
PIC16LF1527
PIC16LF1526
PIC16F1526
PIC16F1527
Peripheral
ADC ● ●
EUSART ● ●
Fixed Voltage Reference (FVR) ● ●
Temperature Indicator ● ●
Capture/Compare/PWM Modules
CCP1 ● ●
CCP2 ● ●
CCP3 ● ●
CCP4 ● ●
CCP5 ● ●
CCP6 ● ●
CCP7 ● ●
CCP8 ● ●
CCP9 ● ●
CCP10 ● ●
EUSARTs
EUSART1 ● ●
EUSART2 ● ●
Master Synchronous Serial Ports
MSSP1 ● ●
MSSP2 ● ●
Timers
Timer0 ● ●
Timer1/3/5 ● ●
Timer2/4/6 ● ●
/8/10
PORTA
Program
Flash Memory
RAM
PORTB
OSC2/CLKOUT Timing
Generation PORTC
OSC1/CLKIN INTRC
CPU
Oscillator
(Figure 2-1) PORTD
MCLR
PORTE
PORTF
PORTG
Temp. ADC
CCP1-10 MSSPs Indicator FVR
10-Bit
15
Configuration
Configuration 8
15 Data Bus
Program Counter
Flash
MUX
Program
Memory 16-Level
8 Level Stack
Stack
RAM
(13-bit)
(15-bit)
Program
14 Program Memory 12 RAM Addr
Bus
Read (PMR)
Addr MUX
Instruction
Instruction Reg
reg Indirect
Direct Addr 7 Addr
5 12 12
15 BSR
FSR Reg
reg
FSR0reg
FSR Reg
FSR1 Reg
FSR reg
15 STATUS Reg
STATUS reg
8
3 MUX
Power-up
Timer
Instruction Oscillator
Decodeand
Decode & Start-up Timer
ALU
Control
CLKIN Power-on
Reset 8
Timing Watchdog
CLKOUT Generation Timer W Reg
Brown-out
Reset
Internal
Oscillator
Block
VDD VSS
PC<14:0> PC<14:0>
CALL, CALLW 15
RETURN, RETLW
CALL, CALLW 15
RETURN, RETLW
Interrupt, RETFIE Interrupt, RETFIE
Stack Level 0 Stack Level 0
Stack Level 1 Stack Level 1
Page 7
3FFFh
Rollover to Page 0 4000h
my_function
;… LOTS OF CODE…
MOVLW DATA_INDEX
CALL constants
;… THE CONSTANT IS IN W
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.
6Fh
70h
Common RAM
(16 bytes)
7Fh
PIC16(L)F1526/7
06Fh 0EFh 16Fh 1EFh 26Fh 2EFh 36Fh 3EFh
070h 0F0h 170h 1F0h 270h 2F0h 370h 3F0h
Common RAM Common RAM Common RAM Common RAM Common RAM Common RAM Common RAM
Common RAM (Accesses (Accesses (Accesses (Accesses (Accesses (Accesses (Accesses
70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh)
07Fh 0FFh 17Fh 1FFh 27Fh 2FFh 37Fh 3FFh
Legend: = Unimplemented data memory locations, read as ‘0’.
PIC16(L)F1526/7
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 ANSELF 48Ch — 50Ch 58Ch — 60Ch — 68Ch 70Ch 78Ch
40Dh ANSELG 48Dh WPUG 58Dh — 60Dh —
40Eh — 48Eh — 58Eh — 60Eh —
40Fh — 48Fh — 58Fh — 60Fh —
410h — 490h — 590h — 610h —
411h TMR3L 491h RC2REG 591h — 611h CCPR6L
412h TMR3H 492h TX2REG 592h — 612h CCPR6H
413h T3CON 493h SP2BRG 593h — 613h CCP6CON
414h T3GCON 494h SP2BRGH 594h — 614h CCPR7L
TMR4 RC2STA Unimplemented TMR8 CCPR7H Unimplemented Unimplemented Unimplemented
415h 495h 595h 615h
416h PR4 496h TX2STA Read as ‘0’ 596h PR8 616h CCP7CON Read as ‘0’ Read as ‘0’ Read as ‘0’
417h T4CON 497h BAUD2CON 597h T8CON 617h CCPR8L
418h TMR5L 498h — 598h — 618h CCPR8H
419h TMR5H 499h — 599h — 619h CCP8CON
41Ah T5CON 49Ah — 59Ah — 61Ah CCPR9L
41Bh T5GCON 49Bh — 59Bh — 61Bh CCPR9H
41Ch TMR6 49Ch — 59Ch TMR10 61Ch CCP9CON
41Dh PR6 49Dh — 59Dh PR10 61Dh CCPR10L
41Eh T6CON 49Eh — 59Eh T10CON 61Eh CCPR10H
41Fh — 49Fh — 51Fh 59Fh — 61Fh CCP10CON 69Fh 71Fh 79Fh
420h 4A0h General Purpose 520h 5A0h 620h 6A0h 720h 7A0h
Common RAM Common RAM Common RAM Common RAM Common RAM Common RAM Common RAM Common RAM
(Accesses (Accesses (Accesses (Accesses (Accesses (Accesses (Accesses (Accesses
70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh) 70h – 7Fh)
47Fh 4FFh 57Fh 5FFh 67Fh 6FFh 77Fh 7FFh
Legend: = Unimplemented data memory locations, read as ‘0’.
Note 1: PIC16(L)F1527 only.
TABLE 3-3: PIC16(L)F1526/7 MEMORY MAP (CONTINUED)
2011-2015 Microchip Technology Inc.
PIC16(L)F1526/7
C7Fh CFFh D7Fh DFFh E7Fh EFFh F7Fh
PIC16(L)F1526/7
Bank 31
F80h
Core Registers
(Table 3-2)
F8Bh
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
FF0h
Common RAM
(Accesses
70h – 7Fh)
FFFh
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 — — — BSR4 BSR3 BSR2 BSR1 BSR0 ---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’.
Bank 0
00Ch PORTA PORTA Data Latch when written: PORTA pins when read xxxx xxxx uuuu uuuu
00Dh PORTB PORTB Data Latch when written: PORTB pins when read xxxx xxxx uuuu uuuu
00Eh PORTC PORTC Data Latch when written: PORTC pins when read xxxx xxxx uuuu uuuu
00Fh PORTD PORTD Data Latch when written: PORTD pins when read xxxx xxxx uuuu uuuu
010h PORTE PORTE Data Latch when written: PORTE pins when read xxxx xxxx uuuu uuuu
011h PIR1 TMR1GIF ADIF RC1IF TX1IF SSP1IF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
012h PIR2 OSFIF TMR5GIF TMR3GIF — BCL1IF TMR10IF TMR8IF CCP2IF 000- 0000 000- 0000
013h PIR3 CCP6IF CCP5IF CCP4IF CCP3IF TMR6IF TMR5IF TMR4IF TMR3IF 0000 0000 0000 0000
014h PIR4 CCP10IF CCP9IF RC2IF TX2IF CCP8IF CCP7IF BCL2IF SSP2IF 0000 0000 0000 0000
015h TMR0 Timer0 Module Register xxxx xxxx uuuu uuuu
016h TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
017h TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
018h T1CON TMR1CS<1:0> T1CKPS<1:0> SOSCEN T1SYNC — TMR1ON 0000 00-0 uuuu uu-u
019h T1GCON TMR1GE T1GPOL T1GTM T1GSPM T1GGO/ T1GVAL T1GSS<1:0> 0000 0x00 uuuu uxuu
DONE
01Ah TMR2 Timer 2 Module Register 0000 0000 0000 0000
01Bh PR2 Timer 2 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 — —
Bank 1
08Ch TRISA PORTA Data Direction Register 1111 1111 1111 1111
08Dh TRISB PORTB Data Direction Register 1111 1111 1111 1111
08Eh TRISC PORTC Data Direction Register 1111 1111 1111 1111
08Fh TRISD PORTD Data Direction Register 1111 1111 1111 1111
090h TRISE PORTE Data Direction Register 1111 1111 1111 1111
091h PIE1 TMR1GIE ADIE RC1IE TX1IE SSP1IE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
092h PIE2 OSFIE TMR5GIE TMR3GIE — BCL1IE TMR10IE TMR8IE CCP2IE 000- 0000 000- 0000
093h PIE3 CCP6IE CCP5IE CCP4IE CCP3IE TMR6IE TMR5IE TMR4IE TMR3IE 0000 0000 0000 0000
094h PIE4 CCP10IE CCP9IE RC2IE TX2IE CCP8IE CCP7IE BCL2IE SSP2IE 0000 0000 0000 0000
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 — Unimplemented — —
099h OSCCON — IRCF<3:0> — SCS<1:0> -011 1-00 -011 1-00
09Ah OSCSTAT SOSCR — OSTS HFIOFR — — LFIOFR HFIOFS 0-q0 --00 q-qq --0q
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
09Fh — Unimplemented — —
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
Bank 2
10Ch LATA PORTA Data Latch xxxx xxxx uuuu uuuu
10Dh LATB PORTB Data Latch xxxx xxxx uuuu uuuu
10Eh LATC PORTC Data Latch xxxx xxxx uuuu uuuu
10Fh LATD PORTD Data Latch xxxx xxxx uuuu uuuu
110h LATE PORTE Data Latch xxxx xxxx uuuu uuuu
111h
to — Unimplemented — —
115h
116h BORCON SBOREN BORFS — — — — — BORRDY 10-- ---q uu-- ---u
117h FVRCON FVREN FVRRDY TSEN TSRNG — — ADFVR<1:0> 0q00 0000 0q00 0000
118h
to — Unimplemented — —
11Ch
11Dh APFCON — — — — — — T3CKISEL CCP2SEL ---- --00 ---- --00
11Eh — Unimplemented — —
11Fh — Unimplemented — —
Bank 3
18Ch ANSELA — — ANSA5 — ANSA3 ANSA2 ANSA1 ANSA0 --1- 1111 --1- 1111
18Dh ANSELB — — ANSB5 ANSB4 ANSB3 ANSB2 ANSB1 ANSB0 --11 1111 --11 1111
18Eh ANSELC Unimplemented — —
18Fh ANSELD — — — — ANSD3 ANSD2 ANSD1 ANSD0 ---- 1111 ---- 1111
190h ANSELE — — — — — ANSE2 ANSE1 ANSE0 ---- -111 ---- -111
191h PMADRL Program Memory Address Register Low Byte 0000 0000 0000 0000
192h PMADRH —(2) Program Memory Address Register High Byte 1000 0000 1000 0000
193h PMDATL Program Memory Data Register Low Byte xxxx xxxx uuuu uuuu
194h PMDATH — — Program Memory Data Register High Byte --xx xxxx --uu uuuu
195h PMCON1 —(2) CFGS LWLO FREE WRERR WREN WR RD 1000 x000 1000 q000
196h PMCON2 Program Memory control register 2 0000 0000 0000 0000
197h VREGCON(1) — — — — — — VREGPM Reserved ---- --01 ---- --01
198h — Unimplemented — —
199h RC1REG USART Receive Data Register 0000 0000 0000 0000
19Ah TX1REG USART Transmit Data Register 0000 0000 0000 0000
19Bh SP1BRG BRG<7:0> 0000 0000 0000 0000
19Ch SP1BRGH BRG<15:8> 0000 0000 0000 0000
19Dh RC1STA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x
19Eh TX1STA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010
19Fh BAUD1CON 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, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
Bank 4
20Ch — Unimplemented — —
20Dh WPUB WPUB7 WPUB6 WPUB5 WPUB4 WPUB3 WPUB2 WPUB1 WPUB0 1111 1111 1111 1111
20Eh — Unimplemented — —
20Fh WPUD WPUD7 WPUD6 WPUD5 WPUD4 WPUD3 WPUD2 WPUD1 WPUD0 1111 1111 1111 1111
210h WPUE WPUE7 WPUE6 WPUE5 WPUE4 WPUE3 WPUE2 WPUE1 WPUE0 1111 1111 1111 1111
211h SSP1BUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx uuuu uuuu
212h SSP1ADD Synchronous Serial Port (I2C mode) Address Register 0000 0000 0000 0000
213h SSP1MSK Synchronous Serial Port (I2C mode) Address Mask Register 1111 1111 1111 1111
214h SSP1STAT SMP CKE D/A P S R/W UA BF 0000 0000 0000 0000
215h SSP1CON1 WCOL SSPOV SSPEN CKP SSPM<3:0> 0000 0000 0000 0000
216h SSP1CON2 GCEN ACKSTAT ACKDT ACKEN RCEN PEN RSEN SEN 0000 0000 0000 0000
217h SSP1CON3 ACKTIM PCIE SCIE BOEN SDAHT SBCDE AHEN DHEN 0000 0000 0000 0000
218h — Unimplemented — —
219h SSP2BUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx uuuu uuuu
21Ah SSP2ADD Synchronous Serial Port (I2C mode) Address Register 0000 0000 0000 0000
21Bh SSP2MSK Synchronous Serial Port (I2C mode) Address Mask Register 1111 1111 1111 1111
21Ch SSP2STAT SMP CKE D/A P S R/W UA BF 0000 0000 0000 0000
21Dh SSP2CON1 WCOL SSPOV SSPEN CKP SSPM<3:0> 0000 0000 0000 0000
21Eh SSP2CON2 GCEN ACKSTAT ACKDT ACKEN RCEN PEN RSEN SEN 0000 0000 0000 0000
21Fh SSP2CON3 ACKTIM PCIE SCIE BOEN SDAHT SBCDE AHEN DHEN 0000 0000 0000 0000
Bank 5
28Ch PORTF RF7 RF6 RF5 RF4 RF3 RF2 RF1 RF0 xxxx xxxx uuuu uuuu
28Dh PORTG — — RG5 RG4 RG3 RG2 RG1 RG0 --xx xxxx --uu uuuu
28Eh — Unimplemented — —
28Fh — Unimplemented — —
290h — Unimplemented — —
291h CCPR1L Capture/Compare/PWM Register 1 (LSB) xxxx xxxx uuuu uuuu
292h CCPR1H Capture/Compare/PWM Register 1 (MSB) xxxx xxxx uuuu uuuu
293h CCP1CON — — DC1B<1:0> CCP1M<3:0> --00 0000 --00 0000
294h — Unimplemented — —
295h — Unimplemented — —
296h — Unimplemented — —
297h — Unimplemented — —
298h CCPR2L Capture/Compare/PWM Register 2 (LSB) xxxx xxxx uuuu uuuu
299h CCPR2H Capture/Compare/PWM Register 2 (MSB) xxxx xxxx uuuu uuuu
29Ah CCP2CON — — DC2B<1:0> CCP2M<3:0> --00 0000 --00 0000
29Bh — Unimplemented — —
29Ch — Unimplemented — —
29Dh CCPTMRS0 C4TSEL<1:0> C3TSEL<1:0> C2TSEL<1:0> C1TSEL<1:0> 0000 0000 0000 0000
29Eh CCPTMRS1 C8TSEL<1:0> C7TSEL<1:0> C6TSEL<1:0> C5TSEL<1:0> 0000 0000 0000 0000
29Fh CCPTMRS2 — — — — C10TSEL<1:0> C9TSEL<1:0> ---- 0000 ---- 0000
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
Bank 6
30Ch TRISF TRISF7 TRISF6 TRISF5 TRISF4 TRISF3 TRISF2 TRISF1 TRISF0 1111 1111 1111 1111
30Dh TRISG — — —(2) TRISG4 TRISG3 TRISG2 TRISG1 TRISG0 --11 1111 --11 1111
30Eh — Unimplemented — —
30Fh — Unimplemented — —
310h — Unimplemented — —
311h CCPR3L Capture/Compare/PWM Register 3 (LSB) xxxx xxxx uuuu uuuu
312h CCPR3H Capture/Compare/PWM Register 3 (MSB) xxxx xxxx uuuu uuuu
313h CCP3CON — — DC3B<1:0> CCP3M<3:0> --00 0000 --00 0000
314h — Unimplemented — —
315h — Unimplemented — —
316h — Unimplemented — —
317h — Unimplemented — —
318h CCPR4L Capture/Compare/PWM Register 4 (LSB) xxxx xxxx uuuu uuuu
319h CCPR4H Capture/Compare/PWM Register 4 (MSB) xxxx xxxx uuuu uuuu
31Ah CCP4CON — — DC4B<1:0> CCP4M<3:0> --00 0000 --00 0000
31Bh — Unimplemented — —
31Ch CCPR5L Capture/Compare/PWM Register 5 (LSB) xxxx xxxx uuuu uuuu
31Dh CCPR5H Capture/Compare/PWM Register 5 (MSB) xxxx xxxx uuuu uuuu
31Eh CCP5CON — — DC5B<1:0> CCP5M<3:0> --00 0000 --00 0000
31Fh — Unimplemented — —
Bank 7
38Ch LATF LATF7 LATF6 LATF5 LATF4 LATF3 LATF2 LATF1 LATF0 xxxx xxxx uuuu uuuu
38Dh LATG — — — LATG4 LATG3 LATG2 LATG1 LATG0 ---x xxxx ---u uuuu
38Eh
to — Unimplemented — —
393h
394h IOCBP IOCBP7 IOCBP6 IOCBP5 IOCBP4 IOCBP3 IOCBP2 IOCBP1 IOCBP0 0000 0000 0000 0000
395h IOCBN IOCBN7 IOCBN6 IOCBN5 IOCBN4 IOCBN3 IOCBN2 IOCBN1 IOCBN0 0000 0000 0000 0000
396h IOCBF IOCBF7 IOCBF6 IOCBF5 IOCBF4 IOCBF3 IOCBF2 IOCBF1 IOCBF0 0000 0000 0000 0000
397h
to — Unimplemented — —
39Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
Bank 8
40Ch ANSELF ANSF7 ANSF6 ANSF5 ANSF4 ANSF3 ANSF2 ANSF1 ANSF0 1111 1111 1111 1111
40Dh ANSELG — — — ANSG4 ANSG3 ANSG2 ANSG1 — ---1 111- ---1 111-
40Eh — Unimplemented — —
40Fh — Unimplemented — —
410h — Unimplemented — —
411h TMR3L Holding Register for the Least Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu
412h TMR3H Holding Register for the Most Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu
413h T3CON TMR3CS<1:0> T3CKPS<1:0> SOSCEN T3SYNC — TMR3ON 0000 00-0 uuuu uu-u
414h T3GCON TMR3GE T3GPOL T3GTM T3GSPM T3GGO/ T3GVAL T3GSS<1:0> 0000 0x00 uuuu uxuu
DONE
415h TMR4 Timer 4 Module Register 0000 0000 0000 0000
416h PR4 Timer 4 Period Register 1111 1111 1111 1111
417h T4CON — T4OUTPS<3:0> TMR4ON T4CKPS<1:0> -000 0000 -000 0000
418h TMR5L Holding Register for the Least Significant Byte of the 16-bit TMR5 Register xxxx xxxx uuuu uuuu
419h TMR5H Holding Register for the Most Significant Byte of the 16-bit TMR5 Register xxxx xxxx uuuu uuuu
41Ah T5CON TMR5CS<1:0> T5CKPS<1:0> SOSCEN T5SYNC — TMR5ON 0000 00-0 uuuu uu-u
41Bh T5GCON TMR5GE T5GPOL T5GTM T5GSPM T5GGO/ T5GVAL T5GSS<1:0> 0000 0x00 uuuu uxuu
DONE
41Ch TMR6 Timer 6 Module Register 0000 0000 0000 0000
41Dh PR6 Timer 6 Period Register 1111 1111 1111 1111
41Eh T6CON — T6OUTPS<3:0> TMR6ON T6CKPS<1:0> -000 0000 -000 0000
41Fh — Unimplemented — —
Bank 9
48Ch — Unimplemented — —
48Dh WPUG — — WPUG5 — — — — — --1- ---- --1- ----
48Dh
to — Unimplemented — —
490h
491h RC2REG USART Receive Data Register 0000 0000 0000 0000
492h TX2REG USART Transmit Data Register 0000 0000 0000 0000
493h SP2BRG BRG<7:0> 0000 0000 0000 0000
494h SP2BRGH BRG<15:8> 0000 0000 0000 0000
495h RC2STA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x
496h TX2STA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 0000 0010 0000 0010
497h BAUD2CON ABDOVF RCIDL — SCKP BRG16 — WUE ABDEN 01-0 0-00 01-0 0-00
498h
to — Unimplemented — —
49Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
Bank 10
50Ch
— — Unimplemented — —
51Fh
Bank 11
58Ch
— — Unimplemented — —
594h
595h TMR8 Timer 8 Module Register 0000 0000 0000 0000
596h PR8 Timer 8 Period Register 1111 1111 1111 1111
597h T8CON — T8OUTPS<3:0> TMR8ON T8CKPS<1:0> -000 0000 -000 0000
598h
— — Unimplemented — —
59Bh
59Ch TMR10 Timer 10 Module Register 0000 0000 0000 0000
59Dh PR10 Timer 10 Period Register 1111 1111 1111 1111
59Eh T10CON — T10OUTPS<3:0> TMR10ON T10CKPS<1:0> -000 0000 -000 0000
59Fh — Unimplemented — —
Bank 12
60Ch
— — Unimplemented — —
610h
611h CCPR6L Capture/Compare/PWM Register 6 (LSB) xxxx xxxx uuuu uuuu
612h CCPR6H Capture/Compare/PWM Register 6 (MSB) xxxx xxxx uuuu uuuu
613h CCP6CON — — DC6B<1:0> CCP6M<3:0> --00 0000 --00 0000
614h CCPR7L Capture/Compare/PWM Register 7 (LSB) xxxx xxxx uuuu uuuu
615h CCPR7H Capture/Compare/PWM Register 7 (MSB) xxxx xxxx uuuu uuuu
616h CCP7CON — — DC7B<1:0> CCP7M<3:0> --00 0000 --00 0000
617h CCPR8L Capture/Compare/PWM Register 8 (LSB) xxxx xxxx uuuu uuuu
618h CCPR8H Capture/Compare/PWM Register 8 (MSB) xxxx xxxx uuuu uuuu
619h CCP8CON — — DC8B<1:0> CCP8M<3:0> --00 0000 --00 0000
61Ah CCPR9L Capture/Compare/PWM Register 9 (LSB) xxxx xxxx uuuu uuuu
61Bh CCPR9H Capture/Compare/PWM Register 9 (MSB) xxxx xxxx uuuu uuuu
61Ch CCP9CON — — DC9B<1:0> CCP9M<3:0> --00 0000 --00 0000
61Dh CCPR10L Capture/Compare/PWM Register 10 (LSB) xxxx xxxx uuuu uuuu
61Eh CCPR10H Capture/Compare/PWM Register 10 (MSB) xxxx xxxx uuuu uuuu
61Fh CCP10CON — — DC10B<1:0> CCP10M<3:0> --00 0000 --00 0000
Bank 13-30
x0Ch
or
x8Ch
to — Unimplemented — —
x1Fh
or
x9Fh
Legend: x = unknown, u = unchanged, q = value depends on condition, - = unimplemented, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
Bank 31
F8Ch
— — Unimplemented — —
FE3h
FE4h STATUS_SHAD — — — — — Z_SHAD DC_SHAD C_SHAD ---- -xxx ---- -uuu
FE5h WREG_SHAD Working Register Normal (Non-ICD) Shadow xxxx xxxx uuuu uuuu
FE6h BSR_SHAD — — — Bank Select Register Normal (Non-ICD) Shadow ---x xxxx ---u uuuu
FE7h PCLATH_SHAD — Program Counter Latch High Register Normal (Non-ICD) Shadow -xxx xxxx uuuu uuuu
FE8h FSR0L_SHAD Indirect Data Memory Address 0 Low Pointer Normal (Non-ICD) Shadow xxxx xxxx uuuu uuuu
FE9h FSR0H_SHAD Indirect Data Memory Address 0 High Pointer Normal (Non-ICD) Shadow xxxx xxxx uuuu uuuu
FEAh FSR1L_SHAD Indirect Data Memory Address 1 Low Pointer Normal (Non-ICD) Shadow xxxx xxxx uuuu uuuu
FEBh FSR1H_SHAD Indirect Data Memory Address 1 High Pointer Normal (Non-ICD) Shadow xxxx xxxx uuuu uuuu
FECh — Unimplemented — —
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, read as ‘0’, r = reserved.
Shaded locations are unimplemented, read as ‘0’.
Note 1: PIC16F1526/7 only.
2: Unimplemented, read as ‘1’.
0x0C
0x0B
0x0A
Initial Stack Configuration:
0x09
After Reset, the stack is empty. The
0x08 empty stack is initialized so the Stack
Pointer is pointing at 0x1F. If the Stack
0x07
Overflow/Underflow Reset is enabled, the
0x06 TOSH/TOSL registers will return ‘0’. If
the Stack Overflow/Underflow Reset is
0x05 disabled, the TOSH/TOSL registers will
return the contents of stack address 0x0F.
0x04
0x03
0x02
0x01
0x00
Stack Reset Enabled
TOSH:TOSL 0x1F 0x0000 STKPTR = 0x1F
(STVREN = 1)
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
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
0x0A will repeatedly place the return addresses
into the Program Counter and pop the stack.
0x09
0x08
0x07
TOSH:TOSL 0x06 Return Address STKPTR = 0x06
0x0000 0x0000
Traditional
Data Memory
0x0FFF 0x0FFF
0x1000
Reserved
0x1FFF
0x2000
Linear
Data Memory
0x29AF
0x29B0
FSR Reserved
0x7FFF
Address
Range 0x8000 0x0000
Program
Flash Memory
0xFFFF 0x7FFF
Note: Not all memory regions are completely implemented. Consult device memory tables for memory limits.
0x7F
Bank 0 Bank 1 Bank 2 Bank 31
0xF20
Bank 30 0x7FFF
0xFFFF
0x29AF 0xF6F
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
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
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 11.5 “User ID, Device ID and Configuration
Word Access” for more information on accessing these
memory locations. For more information on checksum
calculation, see the “PIC16F/LF151X/152X Memory
Programming Specification” (DS41422).
R R R R R R R R
DEV<2:0> REV<4:0>
bit 7 bit 0
Legend:
R = Readable bit U = Unimplemented bit, read as ‘1’
‘1’ = Bit is set ‘0’ = Bit is cleared -n/n = Value at POR and BOR/Value at all other Resets
DEVID<13:0> Values
Device
DEV<8:0> REV<4:0>
PIC16F1526 01 0101 100 x xxxx
PIC16F1527 01 0101 101 x xxxx
PIC16LF1526 01 0101 110 x xxxx
PIC16LF1527 01 0101 111 x xxxx
Primary Clock
00
SOSCO/
Secondary 01
T1CKI Secondary Clock
Oscillator
(SOSC)
SOSCI
INTOSC
1x
Internal Oscillator
IRCF<3:0>
4 4
HF-8 MHz
Logic /2 1110
HF-4 MHz
/4 1101
HF-2 MHz
/8 1100
HF-1 MHz
Divide Circuit
EC mode has three power modes to select from through Figure 5-3 and Figure 5-4 show typical circuits for
Configuration Words: quartz crystal and ceramic resonators, respectively.
OSC1/CLKIN OSC1/CLKIN
C1 To Internal C1 To Internal
Logic Logic
Quartz
RF(2) Sleep RP(3)
Crystal RF(2) Sleep
C2 OSC2/CLKOUT
RS(1) OSC2/CLKOUT
C2 Ceramic RS(1)
Resonator
Note 1: A series resistor (RS) may be required for
quartz crystals with low drive level. Note 1: A series resistor (RS) may be required for
ceramic resonators with low drive level.
2: The value of RF varies with the Oscillator mode
selected (typically between 2 M to 10 M. 2: The value of RF varies with the Oscillator mode
selected (typically between 2 M to 10 M.
3: An additional parallel feedback resistor (RP)
Note 1: Quartz crystal characteristics vary may be required for proper ceramic resonator
according to type, package and operation.
manufacturer. The user should consult the
manufacturer data sheets for specifications
and recommended application. 5.2.1.3 Oscillator Start-up Timer (OST)
2: Always verify oscillator performance over If the oscillator module is configured for LP, XT or HS
the VDD and temperature range that is modes, the Oscillator Start-up Timer (OST) counts
expected for the application. 1024 oscillations from OSC1. This occurs following a
3: For oscillator design assistance, reference Power-on Reset (POR) and when the Power-up Timer
the following Microchip Applications Notes: (PWRT) has expired (if configured), or a wake-up from
Sleep. During this time, the program counter does not
• AN826, “Crystal Oscillator Basics and increment and program execution is suspended,
Crystal Selection for rfPIC® and PIC® unless either FSCM or Two-Speed Start-Up are
Devices” (DS00826) enabled. The OST ensures that the oscillator circuit,
• AN849, “Basic PIC® Oscillator Design” using a quartz crystal resonator or ceramic resonator,
(DS00849) has started and is providing a stable system clock to
• AN943, “Practical PIC® Oscillator the oscillator module.
Analysis and Design” (DS00943) In order to minimize latency between external oscillator
• AN949, “Making Your Oscillator Work” start-up and code execution, the Two-Speed Clock
(DS00949) Start-up mode can be selected (see Section 5.4
“Two-Speed Clock Start-up Mode”).
REXT
PIC® MCU
OSC1/CLKIN Internal
SOSCI Clock
CEXT
C1 To Internal
Logic VSS
32.768 kHz
Quartz
OSC2/CLKOUT
Crystal FOSC/4 or I/O(1)
SOSCO
C2 Recommended values: 10 k REXT 100 k, <3V
3 k REXT 100 k, 3-5V
CEXT > 20 pF, 2-5V
HFINTOSC
Oscillator Delay(1) 2-cycle Sync Running
LFINTOSC
System Clock
HFINTOSC
2-cycle Sync Running
LFINTOSC
System Clock
LFINTOSC HFINTOSC
LFINTOSC turns off unless WDT or FSCM is enabled
LFINTOSC
Oscillator Delay(1) 2-cycle Sync Running
HFINTOSC
IRCF <3:0> =0 0
System Clock
Note: See Table 5-1, “Oscillator Switching Delays” for more information.
• Default system oscillator determined by FOSC The secondary oscillator is enabled using the SOSCEN
bits in Configuration Words control bit in the TxCON register. See Section 18.0
“Timer1/3/5 Module with Gate Control” for more
• Secondary oscillator 32 kHz crystal
information about the Timer1 peripheral.
• Internal Oscillator Block (INTOSC)
5.3.4 SECONDARY OSCILLATOR READY
5.3.1 SYSTEM CLOCK SELECT (SCS)
(SOSCR) BIT
BITS
The user must ensure that the secondary oscillator is
The System Clock Select (SCS) bits of the OSCCON
ready to be used before it is selected as a system clock
register selects the system clock source that is used for
source. The Secondary Oscillator Ready (SOSCR) bit
the CPU and peripherals.
of the OSCSTAT register indicates whether the
• When the SCS bits of the OSCCON register = 00, secondary oscillator is ready to be used. After the
the system clock source is determined by value of SOSCR bit is set, the SCS bits can be configured to
the FOSC<2:0> bits in the Configuration Words. select the secondary oscillator.
• When the SCS bits of the OSCCON register = 01,
the system clock source is the secondary 5.3.5 CLOCK SWITCHING BEFORE
oscillator. SLEEP
• When the SCS bits of the OSCCON register = 1x, When clock switching from an old clock to a new clock,
the system clock source is chosen by the internal prior to entering Sleep mode, it is necessary to confirm
oscillator frequency selected by the IRCF<3:0> that the switch is complete before the Sleep instruction
bits of the OSCCON register. After a Reset, the is executed. Failure to do so may result in an
SCS bits of the OSCCON register are always incomplete switch and consequential loss of the
cleared. system clock altogether. Clock switching is confirmed
Note: Any automatic clock switch, which may by monitoring the clock status bits in the OSCSTAT
occur from Two-Speed Start-up or register. Switch confirmation can be accomplished by
Fail-Safe Clock Monitor, does not update sensing that the ready bit for the new clock is set or the
the SCS bits of the OSCCON register. The ready bit for the old clock is cleared. For example,
user can monitor the OSTS bit of the when switching between the internal oscillator with the
OSCSTAT register to determine the current PLL and the internal oscillator without the PLL, monitor
system clock source. the PLLR bit. When PLLR is set, the switch to 32 MHz
operation is complete. Conversely, when PLLR is
When switching between clock sources, a delay is cleared the switch from the 32 MHz operation to the
required to allow the new clock to stabilize. These oscil- selected internal clock is complete.
lator delays are shown in Table 5-1.
INTOSC
TOST
OSC2
Program Counter PC - N PC PC + 1
System Clock
Sample Clock
System Oscillator
Clock Failure
Output
Note: The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in
this example have been chosen for clarity.
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
Stack
Pointer
MCLRE
Sleep
WDT
Time-out Device
Reset
Power-on
Reset
VDD
Brown-out PWRT
R
Reset Done
LPBOR
Reset PWRTE
LFINTOSC
BOR
Active(1)
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
TMCLR
Internal RESET
Oscillator Modes
External Crystal
TOST
Oscillator Start-Up Timer
Oscillator
FOSC
Internal Oscillator
Oscillator
FOSC
CLKIN
FOSC
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 -m/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>
PIEn<7>
GIE
OSC1
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
OSC1
CLKOUT (3)
(4)
INT pin
(1)
(1)
INTF (5) 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: The IOCIF flag bit is read-only and cleared when all the Interrupt-on-Change flags in the IOCBF register
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
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
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)
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
10.2 WDT Operating Modes The WDT is cleared when any of the following condi-
tions occur:
The Watchdog Timer module has four operating modes • Any Reset
controlled by the WDTE<1:0> bits in Configuration
• CLRWDT instruction is executed
Words. See Table 10-1.
• Device enters Sleep
10.2.1 WDT IS ALWAYS ON • Device wakes up from Sleep
When the WDTE bits of Configuration Words are set to • Oscillator fail
‘11’, the WDT is always on. • WDT is disabled
WDT protection is active during Sleep. • Oscillator Start-up Timer (OST) is running
See Table 10-2 for more information.
10.2.2 WDT IS OFF IN SLEEP
When the WDTE bits of Configuration Words are set to 10.5 Operation During Sleep
‘10’, the WDT is on, except in Sleep.
When the device enters Sleep, the WDT is cleared. If
WDT protection is not active during Sleep. the WDT is enabled during Sleep, the WDT resumes
counting.
10.2.3 WDT CONTROLLED BY SOFTWARE
When the device exits Sleep, the WDT is cleared
When the WDTE bits of Configuration Words are set to
again. The WDT remains clear until the OST, if
‘01’, the WDT is controlled by the SWDTEN bit of the
enabled, completes. See Section 5.0 “Oscillator
WDTCON register.
Module (with Fail-Safe Clock Monitor)” for more
WDT protection is unchanged by Sleep. See information on the OST.
Table 10-1 for more details.
When a WDT time-out occurs while the device is in
Sleep, no Reset is generated. Instead, the device
TABLE 10-1: WDT OPERATING MODES wakes up and resumes operation. The TO and PD bits
Device WDT in the STATUS register are changed to indicate the
WDTE<1:0> SWDTEN
Mode Mode event. The RWDT bit in the PCON register can also be
used. See Section 3.0 “Memory Organization” and
11 X X Active The STATUS register (Register 3-1) for more
information.
Awake Active
10 X
Sleep Disabled
1 X Active
01
0 X Disabled
00 X X Disabled
TABLE 10-2: WDT CLEARING CONDITIONS
Conditions WDT
WDTE<1:0> = 00
WDTE<1:0> = 01 and SWDTEN = 0
WDTE<1:0> = 10 and enter Sleep
Cleared
CLRWDT Command
Oscillator Fail Detected
Exit Sleep + System Clock = SOSC, EXTRC, INTOSC, EXTCLK
Exit Sleep + System Clock = XT, HS, LP Cleared until the end of OST
Change INTOSC divider (IRCF bits) Unaffected
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
u = Bit is unchanged x = Bit is unknown -m/n = Value at POR and BOR/Value at all other Resets
‘1’ = Bit is set ‘0’ = Bit is cleared
End
Read Operation
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
Figure 11-3
(FIGURE x-x)
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)F1526/7
7 6 0 7 5 4 0 7 5 0 7 0
PMADRH PMADRL - - PMDATH PMDATL
- r9 r8 r7 r6 r5 r4 r3 r2 r1 r0 c4 c3 c2 c1 c0 6 8
14
Program Memory Write Latches
10 5
14 14 14 14
Write Latch #0 Write Latch #1 Write Latch #30 Write Latch #31
PMADRL<4:0> 00h 01h 1Eh 1Fh
14 14 14 14
400h 8000h - 8003h 8004h - 8005h 8006h 8007h – 8008h 8009h - 801Fh
DEVID Configuration
USER ID 0 - 3 reserved reserved
REVID Words
CFGS = 1
Configuration Memory
PIC16(L)F1526/7
FIGURE 11-6: FLASH PROGRAM MEMORY WRITE FLOWCHART
Start
Write Operation
Unlock Sequence
Select
Last word to Yes (Figure11-3
Figure x-x)
Program or Config. Memory
(CFGS) write ?
Re-enable Interrupts
(GIE = 1)
Increment Address
(PMADRH:PMADRL++)
End
Erase Operation
START_WRITE
BCF PMCON1,LWLO ; No more loading latches - Actually start Flash program
; memory write
MOVLW 0AAh ;
Required
Erase Operation
(Figure11-4
Figure x.x)
Write Operation
use RAM image
(Figure11-5
Figure x.x)
End
Modify Operation
TABLE 11-2: USER ID, DEVICE ID AND CONFIGURATION WORD ACCESS (CFGS = 1)
Address Function Read Access Write Access
8000h-8003h User IDs Yes Yes
8006h Device ID/Revision ID Yes No
8007h-8008h Configuration Words 1 and 2 Yes No
Start
Verify Operation
Read Operation
(Figure
Figure x.x)
11-2
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
PORTG
PORTC
PORTD
PORTE
PORTF
Device
PIC16(L)F1526 ● ● ● ● ● ● ●
PIC16(L)F1527 ● ● ● ● ● ● ●
The Data Latch (LATA register) is useful for
read-modify-write operations on the value that the I/O
pins are driving.
A write operation to the LATA register has the same
effect as a write to the corresponding PORTA register.
A read of the LATA register reads of the values held in
the I/O PORT latches, while a read of the PORTA
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 12-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
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: 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 in 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
Note 1: Writes to PORTC are actually written to corresponding LATC register. Reads from PORTC 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 PORTC are actually written to corresponding LATC register. Reads from PORTC 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: Writes to PORTD are actually written to corresponding LATD register. Reads from PORTD 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 PORTD are actually written to corresponding LATD register. Reads from PORTD 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 in 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
Note 1: Writes to PORTE are actually written to corresponding LATE register. Reads from PORTE 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 PORTE are actually written to corresponding LATE register. Reads from PORTE 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 in 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
Note 1: Writes to PORTF are actually written to corresponding LATF register. Reads from PORTF 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 PORTF are actually written to corresponding LATF register. Reads from PORTF 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
bit 7-0 ANSF<7:0>: Analog Select between Analog or Digital Function on pins RF<7:0>, respectively
1 = Analog input. Pin is assigned as analog input(1). Digital input buffer disabled.
0 = Digital I/O. Pin is assigned to port or digital special function.
Note 1: When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
ANSELF ANSF7 ANSF6 ANSF5 ANSF4 ANSF3 ANSF2 ANSF1 ANSF0 130
LATF LATF7 LATF6 LATF5 LATF4 LATF3 LATF2 LATF1 LATF0 129
PORTF RF7 RF6 RF5 RF4 RF3 RF2 RF1 RF0 129
TRISF TRISF7 TRISF6 TRISF5 TRISF4 TRISF3 TRISF2 TRISF1 TRISF0 129
Legend: x = unknown, u = unchanged, - = unimplemented locations read as ‘0’. Shaded cells are not used by PORTF.
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 PORTG are actually written to corresponding LATG register. Reads from PORTG 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 PORTG are actually written to corresponding LATG register. Reads from PORTG 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
IOCBNx D Q4Q1
Q
CK edge
detect
R
RBx
CK write IOCBFx CK
IOCIE
R
Q2
from all other
IOCBFx individual IOC interrupt
pin detectors to CPU core
Q1 Q1 Q1
Q2 Q2 Q2
Q3 Q3 Q3
Q4 Q4 Q4 Q4
Q4Q1 Q4Q1 Q4Q1 Q4Q1
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
ADFVR<1:0>
2
x1
FVR_buffer1
x2
(To ADC Module)
x4
1.024V Fixed
Reference
FVREN +
FVRRDY
-
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
AVDD
ADPREF = 00
ADPREF = 11
VREF ADPREF = 10
AN0 00000
AN1 00001
AN2 00010
VREF+/AN3 00011 Ref+
AN4 00100
ADC
AN5 00101
GO/DONE 10
AN6 00110
0 = Left Justify
ADFM
1 = Right Justify
ADON(1) 16
AN29 11101
Temp Indicator 11110 AVSS ADRESH ADRESL
FVR Buffer1 11111
CHS<4:0>(2)
ADC
ADCS<2:0> 20 MHz 16 MHz 8 MHz 4 MHz 1 MHz
Clock Source
FOSC/2 000 100 ns(2) 125 ns(2) 250 ns(2) 500 ns(2) 2.0 s
FOSC/4 100 200 ns (2)
250 ns (2)
500 ns (2)
1.0 s 4.0 s
FOSC/8 001 400 ns(2) 0.5 s(2) 1.0 s 2.0 s 8.0 s(3)
FOSC/16 101 800 ns 1.0 s 2.0 s 4.0 s 16.0 s(3)
FOSC/32 010 1.6 s 2.0 s 4.0 s 8.0 s(3)
32.0 s(3)
FOSC/64 110 3.2 s 4.0 s 8.0 s (3)
16.0 s (3)
64.0 s(3)
FRC x11 1.0-6.0 s(1,4) 1.0-6.0 s(1,4) 1.0-6.0 s(1,4) 1.0-6.0 s(1,4) 1.0-6.0 s(1,4)
Legend: Shaded cells are outside of recommended range.
Note 1: The FRC source has a typical TAD time of 1.6 s for VDD.
2: These values violate the minimum required TAD time.
3: For faster conversion times, the selection of another clock source is recommended.
4: The ADC clock period (TAD) and total ADC conversion time can be minimized when the ADC clock is derived from the
system clock FOSC. However, the FRC clock source must be used when conversions are to be performed with the
device in Sleep mode.
TCY - TAD TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD9 TAD10 TAD11
b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Conversion starts
Holding capacitor is disconnected from analog input (typically 100 ns)
Set GO bit
On the following cycle:
ADRESH:ADRESL is loaded, GO bit is cleared,
ADIF bit is set, holding capacitor is connected to analog input.
ADRESH ADRESL
(ADFM = 0) MSB LSB
bit 7 bit 0 bit 7 bit 0
Note: A device Reset forces all registers to their Using the Special Event Trigger does not assure proper
Reset state. Thus, the ADC module is ADC timing. It is the user’s responsibility to ensure that
turned off and any pending conversion is the ADC timing requirements are met.
terminated. Refer to Section 20.0 “Capture/Compare/PWM
Modules” 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
Note 1: When selecting the FVR or the VREF+ pin as the source of the positive reference, be aware that a
minimum voltage specification exists. See Section 25.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
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)
= – 10pF 1k + 7k + 10k ln(0.000488)
= 1.37 µs
Therefore:
T A CQ = 2µs + 1.37µs + 50°C- 25°C 0.05 µs/°C
= 4.62µs
Note 1: The reference voltage (VREF) 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
Analog Sampling
Input Switch
VT 0.6V
Rs pin RIC 1k SS Rss
VA CPIN I LEAKAGE(1)
VT 0.6V CHOLD = 10 pF
5 pF
VSS/VREF-
6V
5V RSS
Legend: CHOLD = Sample/Hold Capacitance VDD 4V
3V
CPIN = Input Capacitance 2V
I LEAKAGE = Leakage current at the pin due to
various junctions
5 6 7 8 9 10 11
RIC = Interconnect Resistance
Sampling Switch
RSS = Resistance of Sampling Switch (k)
SS = Sampling Switch
VT = Threshold Voltage
Full-Scale Range
3FFh
3FEh
3FDh
3FCh
ADC Output Code
3FBh
03h
02h
01h
00h
Analog Input Voltage
0.5 LSB 1.5 LSB
VREF- Zero-Scale
Transition Full-Scale
Transition VREF+
FOSC/4
Data Bus
0
8
T0CKI 1
Sync
1 2 TCY TMR0
0
TMR0SE TMR0CS Set Flag bit TMR0IF
8-bit on Overflow
Prescaler PSA
Overflow to Timer1/3/5
PS<2: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
000 1:2
001 1:4
010 1:8
011 1 : 16
100 1 : 32
101 1 : 64
110 1 : 128
111 1 : 256
TxGSS<1:0>
TxG 00 TxGSPM
LFINTOSC 11
Prescaler Synchronize(3)
Secondary Oscillator 1, 2, 4, 8 det
SOSC/TxCKI
10
(See Figure 18-2) 2
FOSC TxCKPS<1:0>
Internal 01
Clock FOSC/2
Internal Sleep input
FOSC/4 Clock
Internal 00
Clock
TMR1CS<1:0>
0
10
SOSCO/T1CKI OUT 1 LFINTOSC 11
Timer1
Secondary FOSC/4 00
Oscillator
FOSC 01
SOSCI Timer 1
EN
T1CON[SOSCEN]
T3CON[SOSCEN]
T5CON[SOSCEN]
TMR3CS<1:0>
1
(1) 10
T3CKI 0 LFINTOSC 11
Timer3
FOSC/4 00
FOSC 01
Timer 3
TMR5CS<1:0>
1
(1) 10
T5CKI 0 LFINTOSC 11
Timer5
FOSC/4 00
FOSC 01
Timer 5
TXCKI = 1
when TMR1
Enabled
TXCKI = 0
when TMR1
Enabled
TMRxGE
TxGPOL
txg_in
TxCKI
TxGVAL
TMRxGE
TxGPOL
TxGTM
txg_in
TxCKI
TxGVAL
TMRxGE
TxGPOL
TxGSPM
Cleared by hardware on
TxGGO/ Set by software falling edge of TxGVAL
DONE
Counting enabled on
rising edge of TxG
txg_in
TxCKI
TxGVAL
Cleared by
TMRxGIF Cleared by software Set by hardware on software
falling edge of TxGVAL
TMRxGE
TxGPOL
TxGSPM
TxGTM
Cleared by hardware on
TxGGO/ Set by software falling edge of TxGVAL
DONE Counting enabled on
rising edge of TxG
txg_in
TxCKI
TxGVAL
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
TMRxCS<1:0> = 0X:
This bit is ignored.
bit 1 Unimplemented: Read as ‘0’
bit 0 TMRxON: Timer1/3/5 On bit
1 = Enables Timer1/3/5
0 = Stops Timer1/3/5
Clears Timer1/3/5 gate flip-flop
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
Prescaler Reset
FOSC/4 TMRx TMRx Output
1:1, 1:4, 1:16, 1:64
2 Postscaler
Comparator Sets Flag bit TMRxIF
EQ 1:1 to 1:16
TxCKPS<1:0>
PRx 4
TxOUTPS<3: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
and Capture
Edge Detect Enable
TMRxH TMRxL
CCPxM<3:0>
System Clock (FOSC)
log 4 PRx + 1
EQUATION 20-3: DUTY CYCLE RATIO Resolution = ------------------------------------------ bits
log 2
CCPRxL:CCPxCON<5:4>
Duty Cycle Ratio = -----------------------------------------------------------------------
4 PRx + 1
Note: If the pulse width value is greater than the
period the assigned PWM pin(s) will
remain unchanged.
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 Reset
‘1’ = Bit is set ‘0’ = Bit is cleared
0011 = Reserved
0010 = Compare mode: toggle output on match
0001 = Reserved
0000 = Capture/Compare/PWM off (resets CCPx module)
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
Data Bus
Read Write
SSPxBUF Reg
SDIx
SDO_out
SSPxSR Reg
SDOx bit 0 Shift
Clock
Edge
Select SCK_out
SSPM<3:0>
4
( TMR22Output )
SCKx
Edge Prescaler TOSC
Select 4, 16, 64
Baud Rate
Generator
TRIS bit (SSPxADD)
Internal
data bus [SSPM 3:0]
Read Write
SSPxSR
Clock Cntl
MSb LSb
Receive Enable (RCEN)
Internal
Data Bus
Read Write
Shift
Clock
SSPxSR Reg
SDAx MSb LSb
SSPxMSK Reg
SSPxADD Reg
SCKx SCKx
SPI Master
SDOx SDIx SPI Slave
SDIx SDOx #1
General I/O SSx
General I/O
General I/O SCKx
SDIx SPI Slave
SDOx #2
SSx
SCKx
SDIx SPI Slave
SDOx #3
SSx
Slave Select
General I/O SSx
Processor 1 (optional) Processor 2
Write to
SSPxBUF
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
4 Clock
SCKx Modes
(CKP = 0
CKE = 1)
SCKx
(CKP = 1
CKE = 1)
Input
Sample
(SMP = 1)
SSPxIF
SSPxSR to
SSPxBUF
SCK SCK
SPI Master
SDOx SDIx SPI Slave
SDIx SDOx #1
General I/O SSx
SCK
SDIx SPI Slave
SDOx #2
SSx
SCK
SDIx SPI Slave
SDOx #3
SSx
SSx
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
Write to
SSPxBUF
Shift register SSPxSR
and bit count are reset
SSPxBUF to
SSPxSR
SDIx bit 0
bit 7 bit 7
Input
Sample
SSPxIF
Interrupt
Flag
SSPxSR to
SSPxBUF
SSx
Optional
SCKx
(CKP = 0
CKE = 0)
SCKx
(CKP = 1
CKE = 0)
Write to
SSPxBUF
Valid
SDOx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
SDIx
bit 7 bit 0
Input
Sample
SSPxIF
Interrupt
Flag
SSPxSR to
SSPxBUF
Write Collision
detection active
SSx
Not Optional
SCKx
(CKP = 0
CKE = 1)
SCKx
(CKP = 1
CKE = 1)
Write to
SSPxBUF
Valid
SDOx bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
SDIx
bit 7 bit 0
Input
Sample
SSPxIF
Interrupt
Flag
SSPxSR to
SSPxBUF
Write Collision
detection active
SDAx
SCLx
S P
Change of Change of
Data Allowed Data Allowed
Start Stop
Condition Condition
Sr
Change of Change of
Data Allowed Data Allowed
Restart
Condition
When the R/W bit of a matching received address byte Slave device reception with AHEN and DHEN set
is clear, the R/W bit of the SSPxSTAT register is operate the same as without these options with extra
cleared. The received address is loaded into the interrupts and clock stretching added after the 8th fall-
SSPxBUF register and acknowledged. ing edge of SCLx. These additional interrupts allow the
When the overflow condition exists for a received slave software to decide whether it wants to ACK the
address, then not Acknowledge is given. An overflow receive address or data byte, rather than the hard-
condition is defined as either bit BF of the SSPxSTAT ware. This functionality adds support for PMBus™ that
register is set, or bit SSPOV of the SSPxCON1 register was not present on previous versions of this module.
is set. The BOEN bit of the SSPxCON3 register This list describes the steps that need to be taken by
modifies this operation. For more information see slave software to use these options for I2C communi-
Register 21-4. cation. Figure 21-16 displays a module using both
An MSSPx interrupt is generated for each transferred address and data holding. Figure 21-17 includes the
data byte. Flag bit, SSPxIF, must be cleared by operation with the SEN bit of the SSPxCON2 register
software. set.
When the SEN bit of the SSPxCON2 register is set, 1. S bit of SSPxSTAT is set; SSPxIF is set if
SCLx will be held low (clock stretch) following each interrupt on Start detect is enabled.
received byte. The clock must be released by setting 2. Matching address with R/W bit clear is clocked
the CKP bit of the SSPxCON1 register, except in. SSPxIF is set and CKP cleared after the 8th
sometimes in 10-bit mode. See Section 21.2.3 “SPI falling edge of SCLx.
Master Mode” for more detail. 3. Slave clears the SSPxIF.
4. Slave can look at the ACKTIM bit of the SSPx-
21.5.2.1 7-bit Addressing Reception
CON3 register to determine if the SSPxIF was
This section describes a standard sequence of events after or before the ACK.
for the MSSPx module configured as an I2C slave in 5. Slave reads the address value from SSPxBUF,
7-bit Addressing mode. Figure 21-14 and Figure 21-15 clearing the BF flag.
is used as a visual reference for this description. 6. Slave sets ACK value clocked out to the master
This is a step by step process of what typically must by setting ACKDT.
be done to accomplish I2C communication. 7. Slave releases the clock by setting CKP.
1. Start bit detected. 8. SSPxIF is set after an ACK, not after a NACK.
2. S bit of SSPxSTAT is set; SSPxIF is set if 9. If SEN = 1 the slave hardware will stretch the
interrupt on Start detect is enabled. clock after the ACK.
3. Matching address with R/W bit clear is received. 10. Slave clears SSPxIF.
4. The slave pulls SDAx low sending an ACK to the Note: SSPxIF is still set after the 9th falling edge of
master, and sets SSPxIF bit. SCLx even if there is no clock stretching and
5. Software clears the SSPxIF bit. BF has been cleared. Only if NACK is sent
6. Software reads received address from to master is SSPxIF not set
SSPxBUF clearing the BF flag. 11. SSPxIF set and CKP cleared after 8th falling
7. If SEN = 1; Slave software sets CKP bit to edge of SCLx for a received data byte.
release the SCLx line. 12. Slave looks at ACKTIM bit of SSPxCON3 to
8. The master clocks out a data byte. determine the source of the interrupt.
9. Slave drives SDAx low sending an ACK to the 13. Slave reads the received data from SSPxBUF
master, and sets SSPxIF bit. clearing BF.
10. Software clears SSPxIF. 14. Steps 7-14 are the same for each received data
11. Software reads the received byte from byte.
SSPxBUF clearing BF. 15. Communication is ended by either the slave
12. Steps 8-12 are repeated for all received bytes sending an ACK = 1, or the master sending a
from the master. Stop condition. If a Stop is sent and Interrupt on
Stop Detect is disabled, the slave will only know
13. Master sends Stop condition, setting P bit of
by polling the P bit of the SSTSTAT register.
SSPxSTAT, and the bus goes idle.
SCLx
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
SSPxIF
SSPxIF set on 9th
Cleared by software Cleared by software falling edge of
SCLx
BF
First byte
SSPxBUF is read of data is
available
in SSPxBUF
SSPOV
DS40001458D-page 211
PIC16(L)F1526/7
FIGURE 21-15:
DS40001458D-page 212
Receive Address Receive Data Receive Data ACK
SDAx A7 A6 A5 A4 A3 A2 A1 R/W=0 ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3 D2 D1 D0
SSPxIF
BF
First byte
of data is
SSPxBUF is read available
in SSPxBUF
SSPOV
SCLx
S 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 P
Slave software
clears ACKDT to Slave software
ACK the received sets ACKDT to
CKP byte not ACK
When AHEN=1:
When DHEN=1: CKP set by software,
CKP is cleared by hardware
CKP is cleared by SCLx is released
and SCLx is stretched hardware on 8th falling
edge of SCLx
ACKTIM
P
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 0, AHEN = 1, DHEN = 1)
DS40001458D-page 213
PIC16(L)F1526/7
Master sends
FIGURE 21-17:
Stop condition
Master releases
R/W = 0 SDAx to slave for ACK sequence
DS40001458D-page 214
Receiving Address Receive Data Receive Data ACK
SDAx ACK
A7 A6 A5 A4 A3 A2 A1 D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3 D2 D1 D0
SCLx
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 P
S
PIC16(L)F1526/7
SSPxIF
Cleared by software No interrupt after
if not ACK
from Slave
BF
Received
address is loaded into Received data is SSPxBUF can be
SSPxBUF available on SSPxBUF read any time before
next byte is loaded
ACKDT
ACKTIM
P
I2C SLAVE, 7-BIT ADDRESS, RECEPTION (SEN = 1, AHEN = 1, DHEN = 1)
DS40001458D-page 216
SCLx
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
SSPxIF
Cleared by software
PIC16(L)F1526/7
BF
BF is automatically
Received address Data to transmit is cleared after 8th falling
is read from SSPxBUF loaded into SSPxBUF edge of SCLx
CKP
When R/W is set CKP is not
SCLx is always held for not
held low after 9th SCLx Set by software ACK
falling edge
ACKSTAT
Indicates an address
has been received
DS40001458D-page 218
SDAx ACK
A7 A6 A5 A4 A3 A2 A1 D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3 D2 D1 D0
SCLx
S 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
P
SSPxIF
Cleared by software
PIC16(L)F1526/7
BF BF is automatically
Received address Data to transmit is cleared after 8th falling
is read from SSPxBUF loaded into SSPxBUF edge of SCLx
ACKDT
Slave clears
ACKDT to ACK
address
ACKSTAT
Master’s ACK
response is copied
to SSPxSTAT
CKP
When AHEN = 1; CKP not cleared
CKP is cleared by hardware When R/W = 1; Set by software, after not ACK
after receiving matching CKP is always releases SCLx
address. cleared after ACK
ACKTIM
I2C SLAVE, 7-BIT ADDRESS, TRANSMISSION (AHEN = 1)
R/W
D/A
Master sends
Stop condition
DS40001458D-page 220
Receive First Address Byte Receive Second Address Byte Receive Data Receive Data
SDAx
1 1 1 1
0 A9 A8 ACK A7 A6 A5 A4 A3 A2 A1 A0 ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK
SCLx
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9 P
S
PIC16(L)F1526/7
SSPxIF
Set by hardware Cleared by software
on 9th falling edge
BF
If address matches Receive address is Data is read
SSPxADD it is loaded into read from SSPxBUF from SSPxBUF
SSPxBUF
UA
When UA = 1; Software updates SSPxADD
SCLx is held low and releases SCLx
CKP
SCLx S 1 2 3 4 5 6 7 8 9 UA 1 2 3 4 5 6 7 8 9 UA 1 2 3 4 5 6 7 8 9 1 2
BF
UA
DS40001458D-page 221
PIC16(L)F1526/7
FIGURE 21-22:
Master sends
DS40001458D-page 222
Master sends Stop condition
Restart event Master sends
not ACK
Receiving Address R/W = 0 Receiving Second Address Byte Receive First Address Byte Transmitting Data Byte ACK = 1
SDAx 1 1 1 1 0 A9 A8 ACK A7 A6 A5 A4 A3 A2 A1 A0 ACK 1 1 1 1 0 A9 A8 ACK D7 D6 D5 D4 D3 D2 D1 D0
SCLx 1 2 3 4 5 6 7 8 9 1 6 7 8 9 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
PIC16(L)F1526/7
S 2 3 4 5 P
Sr
SSPxIF
BF
Indicates an address
has been received
I2C SLAVE, 10-BIT ADDRESS, TRANSMISSION (SEN = 0, AHEN = 0, DHEN = 0)
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
SDAx DX DX ‚ – 1
SCLx
Master device
CKP asserts clock
Master device
releases clock
WR
SSPxCON1
SCLx
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S
SSPxIF
BF (SSPxSTAT<0>)
Cleared by software
SSPxBUF is read
GCEN (SSPxCON2<7>)
’1’
Master mode is enabled by setting and clearing the The master device generates all of the serial clock
appropriate SSPM bits in the SSPxCON1 register and pulses and the Start and Stop conditions. A transfer is
by setting the SSPEN bit. In Master mode, the SDA and ended with a Stop condition or with a Repeated Start
SCK pins must be configured as inputs. The MSSP condition. Since the Repeated Start condition is also
peripheral hardware will override the output driver TRIS the beginning of the next serial transfer, the I2C bus will
controls when necessary to drive the pins low. not be released.
Master mode of operation is supported by interrupt In Master Transmitter mode, serial data is output
generation on the detection of the Start and Stop con- through SDAx, while SCLx outputs the serial clock. The
ditions. The Stop (P) and Start (S) bits are cleared from first byte transmitted contains the slave address of the
a Reset or when the MSSPx module is disabled. Con- receiving device (7 bits) and the Read/Write (R/W) bit.
trol of the I 2C bus may be taken when the P bit is set, In this case, the R/W bit will be logic ‘0’. Serial data is
or the bus is Idle. transmitted 8 bits at a time. After each byte is transmit-
ted, an Acknowledge bit is received. Start and Stop
In Firmware Controlled Master mode, user code conditions are output to indicate the beginning and the
conducts all I 2C bus operations based on Start and end of a serial transfer.
Stop bit condition detection. Start and Stop condition
detection is the only active circuitry in this mode. All In Master Receive mode, the first byte transmitted con-
other communication is done by the user software tains the slave address of the transmitting device
directly manipulating the SDAx and SCLx lines. (7 bits) and the R/W bit. In this case, the R/W bit will be
logic ‘1’. Thus, the first byte transmitted is a 7-bit slave
The following events will cause the SSPx Interrupt Flag address followed by a ‘1’ to indicate the receive bit.
bit, SSPxIF, to be set (SSPx interrupt, if enabled): Serial data is received via SDAx, while SCLx outputs
• Start condition detected the serial clock. Serial data is received 8 bits at a time.
After each byte is received, an Acknowledge bit is
• Stop condition detected
transmitted. Start and Stop conditions indicate the
• Data transfer byte transmitted/received beginning and end of transmission.
• Acknowledge transmitted/received
A Baud Rate Generator is used to set the clock
• Repeated Start generated frequency output on SCLx. See Section 21.7 “Baud
Note 1: The MSSPx module, when configured in Rate Generator” for more detail.
I2C Master mode, does not allow queue-
ing of events. For instance, the user is not
allowed to initiate a Start condition and
immediately write the SSPxBUF register
to initiate transmission before the Start
condition is complete. In this case, the
SSPxBUF will not be written to and the
WCOL bit will be set, indicating that a
write to the SSPxBUF did not occur
2: When in Master mode, Start/Stop detec-
tion is masked and an interrupt is gener-
ated when the SEN/PEN bit is cleared and
the generation is complete.
SDAx DX DX ‚ – 1
BRG decrements on
Q2 and Q4 cycles
BRG
03h 02h 01h 00h (hold off) 03h 02h
Value
TBRG
SCLx
S
TBRG
DS40001458D-page 230
Write SSPxCON2<0> SEN = 1 ACKSTAT in
Start condition begins SSPxCON2 = 1
From slave, clear ACKSTAT bit SSPxCON2<6>
SEN = 0
Transmitting Data or Second Half
Transmit Address to Slave R/W = 0 ACK
of 10-bit Address
SDAx A7 A6 A5 A4 A3 A2 A1 ACK = 0 D7 D6 D5 D4 D3 D2 D1 D0
SCLx 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
SCLx held low
while CPU
responds to SSPxIF
SSPxIF
Cleared by software service routine
Cleared by software from SSPx interrupt
Cleared by software
BF (SSPxSTAT<0>)
PEN
R/W
I2C MASTER MODE WAVEFORM (TRANSMISSION, 7 OR 10-BIT ADDRESS)
begin Start condition ACK from Master Set ACKEN, start Acknowledge sequence
Master configured as a receiver SDAx = ACKDT = 0 SDAx = ACKDT = 1
by programming SSPxCON2<3> (RCEN = 1)
DS40001458D-page 232
SEN = 0
PEN bit = 1
Write to SSPxBUF occurs here, RCEN cleared RCEN = 1, start RCEN cleared
ACK from Slave next receive automatically written here
start XMIT automatically
Transmit Address to Slave Receiving Data from Slave Receiving Data from Slave
SDAx A7 A6 A5 A4 A3 A2 A1 R/W ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK D7 D6 D5 D4 D3 D2 D1 D0 ACK
Bus master
ACK is not sent terminates
transfer
3 6 7 9
PIC16(L)F1526/7
1 2 4 5 8 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
SCLx S P
Data shifted in on falling edge of CLK Set SSPxIF at end
of receive Set SSPxIF interrupt
Set SSPxIF interrupt at end of Acknow-
Set SSPxIF interrupt ledge sequence
at end of receive at end of Acknowledge
SSPxIF sequence
Set P bit
Cleared by software Cleared by software Cleared by software Cleared by software (SSPxSTAT<4>)
SDAx = 0, SCLx = 1 Cleared in
while CPU software and SSPxIF
responds to SSPxIF
BF
(SSPxSTAT<0>) Last bit is shifted into SSPxSR and
contents are unloaded into SSPxBUF
SSPOV
ACKEN
I2C MASTER MODE WAVEFORM (RECEPTION, 7-BIT ADDRESS)
RCEN
Master configured as a receiver RCEN cleared ACK from Master RCEN cleared
by programming SSPxCON2<3> (RCEN = 1) automatically SDAx = ACKDT = 0 automatically
SCLx 8 9
SSPxIF
Cleared in
SSPxIF set at software
the end of receive Cleared in
software SSPxIF set at the end
of Acknowledge sequence
Note: TBRG = one Baud Rate Generator period.
SDAx ACK
P
TBRG TBRG TBRG
SCLx brought high after TBRG
SDAx asserted low before rising edge of clock
to setup Stop condition
SDAx
BCLxIF
SDAx
SCLx
Set SEN, enable Start SEN cleared automatically because of bus collision.
condition if SDAx = 1, SCLx = 1 SSPx module reset into Idle state.
SEN
SDAx sampled low before
Start condition. Set BCLxIF.
S bit and SSPxIF set because
BCLxIF SDAx = 0, SCLx = 1.
SSPxIF and BCLxIF are
cleared by software
SSPxIF
TBRG TBRG
SDAx
FIGURE 21-35: BRG RESET DUE TO SDA ARBITRATION DURING START CONDITION
SDAx = 0, SCLx = 1
Set S Set SSPxIF
Less than TBRG
TBRG
SCLx S
SCLx pulled low after BRG
time-out
SEN
Set SEN, enable Start
sequence if SDAx = 1, SCLx = 1
BCLxIF ’0’
SSPxIF
SDAx = 0, SCLx = 1, Interrupts cleared
set SSPxIF by software
SDAx
SCLx
RSEN
BCLxIF
Cleared by software
S ’0’
SSPxIF ’0’
TBRG TBRG
SDAx
SCLx
S ’0’
SSPxIF
PEN
BCLxIF
P ’0’
SSPxIF ’0’
SDAx
PEN
BCLxIF
P ’0’
SSPxIF ’0’
SSPM<3:0> SSPxADD<7: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
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 by hardware C = User 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 = Cleared by hardware S = User set
bit 7 GCEN: General Call Enable bit (in I2C Slave mode only)
1 = Enable interrupt when a general call address (0x00 or 00h) is received in the SSPxSR
0 = General call address disabled
bit 6 ACKSTAT: Acknowledge Status bit (in I2C mode only)
1 = Acknowledge was not received
0 = Acknowledge was received
bit 5 ACKDT: Acknowledge Data bit (in I2C mode only)
In Receive mode:
Value transmitted when the user initiates an Acknowledge sequence at the end of a receive
1 = Not Acknowledge
0 = Acknowledge
bit 4 ACKEN: Acknowledge Sequence Enable bit (in I2C Master mode only)
In Master Receive mode:
1 = Initiate Acknowledge sequence on SDAx and SCLx pins, and transmit ACKDT data bit.
Automatically cleared by hardware.
0 = Acknowledge sequence idle
bit 3 RCEN: Receive Enable bit (in I2C Master mode only)
1 = Enables Receive mode for I2C
0 = Receive idle
bit 2 PEN: Stop Condition Enable bit (in I2C Master mode only)
SCKx Release Control:
1 = Initiate Stop condition on SDAx and SCLx pins. Automatically cleared by hardware.
0 = Stop condition idle
bit 1 RSEN: Repeated Start Condition Enabled bit (in I2C Master mode only)
1 = Initiate Repeated Start condition on SDAx and SCLx pins. Automatically cleared by hardware.
0 = Repeated Start condition idle
bit 0 SEN: Start Condition Enable/Stretch Enable bit
In Master mode:
1 = Initiate Start condition on SDAx and SCLx pins. Automatically cleared by hardware.
0 = Start condition idle
In Slave mode:
1 = Clock stretching is enabled for both slave transmit and slave receive (stretch enabled)
0 = Clock stretching is disabled
Note 1: For bits ACKEN, RCEN, PEN, RSEN, SEN: If the I2C module is not in the Idle mode, this bit may not be
set (no spooling) and the SSPxBUF may not be written (or writes to the SSPxBUF are disabled).
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: For daisy-chained SPI operation; allows the user to ignore all but the last received byte. SSPOV is still set
when a new byte is received and BF = 1, but hardware continues to write the most recent byte to SSPxBUF.
2: This bit has no effect in Slave modes that Start and Stop condition detection is explicitly listed as enabled.
3: The ACKTIM Status bit is only active when the AHEN bit or DHEN bit is 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
REGISTER 21-6: SSPxADD: MSSPx ADDRESS AND BAUD RATE REGISTER (I2C MODE)
R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0 R/W-0/0
ADD<7:0>
bit 7 bit 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
Master mode:
bit 7-3 Not used: Unused for Most Significant Address byte. Bit state of this register is a “don’t care”. Bit pat-
tern sent by master is fixed by I2C specification and must be equal to ‘11110’. However, those bits are
compared by hardware and are not affected by the value in this register.
bit 2-1 ADD<2:1>: Two Most Significant bits of 10-bit address
bit 0 Not used: Unused in this mode. Bit state is a “don’t care”.
10-Bit Slave mode — Least Significant Address byte:
TXEN
TRMT
Baud Rate Generator FOSC
÷n
TX9
BRG16 n
+1 Multiplier x4 x16 x64
TX9D
SYNC 1 X 0 0 0
SPxBRGH SPxBRGL BRGH X 1 1 0 0
BRG16 X 1 0 1 0
BRG16
+1 n
Multiplier x4 x16 x64
SYNC 1 X 0 0 0
SPxBRGH SPxBRGL BRGH FIFO
X 1 1 0 0 FERR RX9D RCxREG Register
BRG16 X 1 0 1 0
8
Data Bus
RCxIF Interrupt
RCxIE
Write to TXxREG
Word 1
BRG Output
(Shift Clock)
TXx/CKx pin
Start bit bit 0 bit 1 bit 7/8 Stop bit
Word 1
TXxIF bit
(Transmit Buffer 1 TCY
Reg. Empty Flag)
Write to TXxREG
Word 1 Word 2
BRG Output
(Shift Clock)
TXx/CKx pin Start bit Start bit
bit 0 bit 1 bit 7/8 Stop bit bit 0
TXxIF bit 1 TCY Word 1 Word 2
(Interrupt Reg. Flag)
1 TCY
TRMT bit Word 1 Word 2
(Transmit Shift Transmit Shift Reg
Reg. Empty Flag) Transmit Shift Reg
Read Rcv
Buffer Reg
RCxREG
RCxIF
(Interrupt Flag)
OERR bit
CREN
Note: This timing diagram shows three words appearing on the RXx/DTx input. The RCxREG (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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
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
Reset
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 Values
on page
BAUD1CON ABDOVF RCIDL — SCKP BRG16 — WUE ABDEN 260
BAUD2CON ABDOVF RCIDL — SCKP BRG16 — WUE ABDEN 260
RC1STA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 259
RC2STA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 259
SP1BRGL EUSART1 Baud Rate Generator, Low Byte 261*
SP1BRGH EUSART1 Baud Rate Generator, High Byte 261*
SP2BRGL EUSART2 Baud Rate Generator, Low Byte 261*
SP2BRGH EUSART2 Baud Rate Generator, High Byte 261*
TX1STA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 258
TX2STA CSRC TX9 TXEN SYNC SENDB BRGH TRMT TX9D 258
Legend: — = unimplemented, read as ‘0’. Shaded bits are not used by the BRG.
* Page provides register information.
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
RCxIF bit
(Interrupt)
Read
RCxREG
Note 1: The ABD sequence requires the EUSART module to be configured in Asynchronous mode.
RXx/DTx Line
RCxIF
Cleared due to User Read of RCxREG
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 TXxREG
Dummy Write
BRG Output
(Shift Clock)
Write to
TXxREG Reg Write Word 1 Write Word 2
TXxIF bit
(Interrupt Flag)
TRMT bit
‘1’ ‘1’
TXEN bit
Note: Sync Master mode, SPxBRGL = 0, continuous transmission of two 8-bit words.
TXx/CKx pin
Write to
TXxREG reg
TXxIF bit
TRMT bit
TXEN bit
RXx/DTx
pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7
TXx/CKx pin
(SCKP = 0)
TXx/CKx pin
(SCKP = 1)
Write to
bit SREN
SREN bit
RCxIF bit
(Interrupt)
Read
RCxREG
Note: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 0.
Pin 1 Indicator
Pin Description*
1 1 = VPP/MCLR
2
2 = VDD Target
3
4 3 = VSS (ground)
5
6 4 = ICSPDAT
5 = ICSPCLK
6 = No Connect
External
Programming VDD Device to be
Signals Programmed
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
k[n] Move INDFn to W, Indexed Indirect. 1 11 1111 0nkk kkkk Z 2
MOVWI n mm Move W to Indirect FSRn with pre/post inc/dec 1 00 0000 0001 1nmm 2, 3
modifier, mm
k[n] Move W to INDFn, Indexed Indirect. 1 11 1111 1nkk kkkk 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
Description: The W register is loaded with the 8-bit Description: The contents of register ‘f’ are rotated
literal ‘k’. The program counter is one bit to the left through the Carry
loaded from the top of the stack (the flag. If ‘d’ is ‘0’, the result is placed in
return address). This is a 2-cycle the W register. If ‘d’ is ‘1’, the result is
instruction. stored back in register ‘f’.
Words: 1 C Register f
Cycles: 2
Words: 1
Example: CALL TABLE;W contains table
;offset value Cycles: 1
• ;W now has table value Example: RLF REG1,0
TABLE •
Before Instruction
•
REG1 = 1110 0110
ADDWF PC ;W = offset
C = 0
RETLW k1 ;Begin table
After Instruction
RETLW k2 ;
REG1 = 1110 0110
•
W = 1100 1100
•
C = 1
•
RETLW kn ; End of table
Before Instruction
W = 0x07
After Instruction
W = value of k8
† 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 to maximum rating conditions for
extended periods may affect device reliability.
5.5
VDD (V)
2.5
2.3
0 4 10 16 20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 25-1 for each Oscillator mode’s supported frequencies.
3.6
2.5
1.8
0 4 10 16 20
Frequency (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
2: Refer to Table 25-1 for each Oscillator mode’s supported frequencies.
125
-15% to +12.5%
85
Temperature (°C)
60
± 8%
25 ± 6.5%
-15% to +12.5%
-40
1.8 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 25-4: POR AND POR REARM WITH SLOW RISING VDD
VDD
VPOR
VPORR
VSS
NPOR(1)
POR REARM
VSS
TVLOW(2) TPOR(3)
D022 Base IPD — 0.20 3.0 10 A 2.3 WDT, BOR, FVR and SOSC disabled,
— 0.30 4.0 12 A 3.0 all peripherals inactive,
Low-power regulator active
— 0.47 6.0 15 A 5.0
D023 — 0.50 6.0 14 A 1.8 WDT Current (Note 1)
— 0.80 7.0 17 A 3.0
D023 — 0.50 6.0 15 A 2.3 WDT Current (Note 1)
— 0.77 7.0 20 A 3.0 VREGPM = 1
— 1.4 10 25 A 5.0
D026* — 0.10 1.0 9.0 A 1.8 ADC Current (Note 1, 3),
— 0.10 2.0 10 A 3.0 No conversion in progress
1. TppS2ppS
2. TppS
T
F Frequency T Time
Lowercase letters (pp) and their meanings:
pp
cc CCP1 osc OSC1
ck CLKOUT rd RD
cs CS rw RD or WR
di SDIx sc SCKx
do SDO ss SS
dt Data in t0 T0CKI
io I/O PORT t1 T1CKI
mc MCLR wr WR
Uppercase letters and their meanings:
S
F Fall P Period
H High R Rise
I Invalid (High-impedance) V Valid
L Low Z High-impedance
Pin CL
VSS
Q4 Q1 Q2 Q3 Q4 Q1
OSC1/CLKIN
OS02
OS04 OS04
OS03
OSC2/CLKOUT
(LP,XT,HS Modes)
OSC2/CLKOUT
(CLKOUT Mode)
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)
Oscillator Frequency(1) — 32.768 — kHz LP Oscillator
0.1 — 4 MHz XT Oscillator
1 — 4 MHz HS Oscillator
1 — 20 MHz HS Oscillator, VDD > 2.7V
DC — 4 MHz RC Oscillator, VDD >2.0V
OS02 TOSC External CLKIN Period(1) 27 — s LP Oscillator
250 — ns XT Oscillator
50 — ns HS Oscillator
50 — ns External Clock (EC)
Oscillator Period(1) — 30.5 — s LP Oscillator
250 — 10,000 ns XT Oscillator
50 — 1,000 ns HS Oscillator
250 — — ns RC Oscillator
OS03 TCY Instruction Cycle Time(1) 200 TCY DC ns TCY = 4/FOSC
OS04* TosH, External CLKIN High, 2 — — s LP oscillator
TosL External CLKIN Low 100 — — ns XT oscillator
20 — — ns HS oscillator
OS05* TosR, External CLKIN Rise, 0 — — ns LP oscillator
TosF External CLKIN Fall 0 — — ns XT oscillator
0 — — ns HS oscillator
* 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 OSC1 pin. When an external
clock input is used, the “max” cycle time limit is “DC” (no clock) for all devices.
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
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
VDD
VBOR and VHYST
VBOR
37
Reset
33(1)
(due to BOR)
Note 1: 64 ms delay only if PWRTE bit in the Configuration Words is programmed to ‘0’.
2 ms delay if PWRTE = 0.
T0CKI
40 41
42
T1CKI
45 46
47 49
TMR0 or
TMR1
CC01 CC02
CC03
BSF ADCON0, GO
1 TCY
AD134 (TOSC/2(1))
AD131
Q4
AD130
ADC CLK
ADC Data 7 6 5 4 3 2 1 0
ADIF 1 TCY
GO DONE
Sampling Stopped
Sample AD132
Note 1: If the ADC clock source is selected as RC, a time of TCY is added before the ADC clock starts. This allows the
SLEEP instruction to be executed.
BSF ADCON0, GO
AD134 (TOSC/2 + TCY(1)) 1 TCY
AD131
Q4
AD130
ADC CLK
ADC Data 7 6 5 4 3 2 1 0
ADIF 1 TCY
GO DONE
Note 1: If the ADC clock source is selected as RC, a time of TCY is added before the ADC clock starts. This allows the
SLEEP instruction to be executed.
CK
US121 US121
DT
US120 US122
CK
US125
DT
US126
SSx
SP70
SCKx
(CKP = 0)
SP71 SP72
SP78 SP79
SCKx
(CKP = 1)
SP79 SP78
SP80
SP75, SP76
SP74
SP73
SSx
SP81
SCKx
(CKP = 0)
SP71 SP72
SP79
SP73
SCKx
(CKP = 1)
SP80
SP78
SP75, SP76
SP74
SSx
SP70
SCKx SP83
(CKP = 0)
SP71 SP72
SP78 SP79
SCKx
(CKP = 1)
SP79 SP78
SP80
SP74
SP73
SP70
SCKx SP83
(CKP = 0)
SP71 SP72
SCKx
(CKP = 1)
SP80
SP77
SP75, SP76
SDIx
MSb In bit 6 - - - -1 LSb In
SP74
SCLx
SP91 SP93
SP90 SP92
SDAx
Start Stop
Condition Condition
SCLx
SP90
SP106
SP107
SP91 SP92
SDAx
In
SP110
SP109
SP109
SDAx
Out
30
25 Max: 85°C + 3ı
Typical: 25°C Max.
20
IDD (μA)
15 Typical
10
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
45
Max: 85°C + 3ı Max.
40
Typical: 25°C
35
30 Typical
IDD (μA)
25
20
15
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
400
250
IDD (μA)
200
150
1 MHz XT
100
50
1 MHz EXTRC
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
450
300
IDD (μA)
250
200
150 1 MHz XT
100
50 1 MHz EXTRC
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
500
4 MHz XT
450 Typical: 25°C
400
4 MHz EXTRC
350
300
IDD (μA)
250 1 MHz XT
200
150
1 MHz EXTRC
100
50
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
600
4 MHz XT
Max: 85°C + 3ı
500
4 MHz EXTRC
400
IDD (μA)
300 1 MHz XT
200
1 MHz EXTRC
100
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
30
Max: 85°C + 3ı
25 Typical: 25°C Max.
20
IDD (μA)
15 Typical
10
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
FIGURE 26-8: IDD, EXTERNAL CLOCK (ECL), LOW-POWER MODE, FOSC = 32 kHz,
PIC16F1526/7 ONLY
40
Max: 85°C + 3ı Max.
35 Typical: 25°C
30
Typical
25
IDD (μA)
20
15
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
70
60 Max: 85°C + 3ı
Typical: 25°C Max.
50
40
IDD (μA)
Typical
30
20
10
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
FIGURE 26-10: IDD, EXTERNAL CLOCK (ECL), LOW-POWER MODE, FOSC = 500 kHz,
PIC16F1526/7 ONLY
80
70 Max.
60
Typical
50
IDD (μA)
40
30
20
Max: 85°C + 3ı
10 Typical: 25°C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
400
250
IDD (μA)
200
150
100 1 MHz
50
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
450
300
IDD (μA)
250
200
150
1 MHz
100
50
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
450
4 MHz
350
300
IDD (μA)
250
200
1 MHz
150
100
50
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
500
400 4 MHz
350
300
IDD (μA)
250
1 MHz
200
150
100
50
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
1.8
20 MHz
1.6 Typical: 25°C
1.4
1.2 16 MHz
IDD (mA)
1.0
0.8
0.6 8 MHz
0.4
0.2
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
2.0
1.6
1.4
16 MHz
1.2
IDD (mA)
1.0
0.8
0.6 8 MHz
0.4
0.2
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
1.8
1.2 16 MHz
1.0
IDD (mA)
0.8
0.6 8 MHz
0.4
0.2
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
2.0
1.4
16 MHz
1.2
IDD (mA)
1.0
0.8
8 MHz
0.6
0.4
0.2
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
30
Max: 85°C + 3ı
25
Typical: 25°C
Max.
20
IDD (μA)
15 Typical
10
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
35
Max.
30
25 Typical
IDD (μA)
20
15
10
5 Max: 85°C + 3ı
Typical: 25°C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
400
Max.
Max: 85°C + 3ı
350 Typical: 25°C
300 Typical
IDD (μA)
250
200
150
100
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
500
Max.
450 Max: 85°C + 3ı
Typical: 25°C
400 Typical
350
IDD (μA)
300
250
200
150
100
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
1.8
16 MHz
1.6 Typical: 25°C
1.4
1.2
8 MHz
IDD (mA)
1.0
0.8 4 MHz
0.6
0.4
0.2
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
2.0
16 MHz
1.8 Max: 85°C + 3ı
1.6
1.4
1.2 8 MHz
IDD (mA)
1.0
0.8 4 MHz
0.6
0.4
0.2
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
1.8
16 MHz
1.6 Typical: 25°C
1.4
1.2
8 MHz
1.0
IDD (mA)
0.8 4 MHz
0.6
0.4
0.2
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
2.0
16 MHz
1.8 Max: 85°C + 3ı
1.6
1.4
8 MHz
1.2
IDD (mA)
1.0
4 MHz
0.8
0.6
0.4
0.2
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
2.5
Typical: 25°C
2.0 20 MHz
1.5
IDD (mA)
1.0
8 MHz
0.5 4 MHz
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
2.5
2.0
1.5
IDD (mA)
1.0 8 MHz
4 MHz
0.5
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
2.5
20 MHz
Typical: 25°C
2.0
1.5
IDD (mA)
8 MHz
1.0
4 MHz
0.5
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
3.0
20 MHz
2.0
IDD (mA)
1.5
8 MHz
1.0
4 MHz
0.5
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
450
Max: 85°C + 3
M 3ı Max.
400
Typical: 25°C
350
300
D (nA)
250
IPD
200
150
100
Typical
50
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
FIGURE 26-32: IPD BASE, LOW-POWER SLEEP MODE, VREGPM = 1, PIC16F1526/7 ONLY
600
Max.
Max: 85°C + 3ı
500 Typical: 25°C
400
IPD (nA)
300
Typical
200
100
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
1.4
Max: 85°C + 3ı
1.2 Typical: 25°C
Max.
1.0
0 8
0.8
(μA)
IPD (μA
Typical
0.6
0.4
0.2
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
1.2
Max: 85°C + 3ı
1.0
Typical: 25°C
Max.
0.8
A)
IPD (μA
0.6 Typical
0.4
0.2
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
25
Max.
20 Typical
15
A)
IPD (μA
10
Max: 85°C + 3ı
5
Typical: 25°C
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
30
25 Max.
20
Typical
IPD (μA)
15
10
5 Max: 85°C + 3ı
Typical: 25°C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
12
8
Typical
D (μA)
6
IPD
0
16
1.6 1 8
1.8 2 0
2.0 2 2
2.2 2 4
2.4 2 6
2.6 2 8
2.8 3 0
3.0 3 2
3.2 3 4
3.4 3 6
3.6 3 8
3.8
VDD (V)
14
Max: 85°C + 3ı
Ma Max
Max.
12 Typical: 25°C
10
Typical
8
IPD (μA)
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
6.0
Max: 85°C + 3ı
5.0
Typical: 25°C
Max.
4.0
A)
IPD (μA
3.0
Typical
2.0
1.0
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
12
Max: 85°C + 3ı
10
Typical: 25°C
Max.
8
IPD (μA)
6 Typical
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
4
VOH (V)
3
125°C
Typical
2
-40°C
Graph represents
1
3ı Limits
0
-45 -40 -35 -30 -25 -20 -15 -10 -5 0
IOH (mA)
FIGURE 26-42: VOL vs. IOL OVER TEMPERATURE, VDD = 5.5V, PIC16F1526/7 ONLY
125°C
Graph represents
4 3ı Limits
3
VOL (V)
Typical
2
-40°C
0
0 10 20 30 40 50 60 70 80 90 100
IOL (mA)
3.5
Graph represents
3.0 3ı Limits
2.5
VOH (V)
2.0
125°C
1.5
Typical
1.0
-40°C
0.5
0.0
-15 -13 -11 -9 -7 -5 -3 -1
IOH (mA)
3.0
125°C
Graph represents
2.5
3ı Limits
Typical
2.0
-40°C
VOL (V)
1.5
1.0
0.5
0.0
0 5 10 15 20 25 30 35 40
IOL (mA)
2.0
1.4
125°C
1.2
VOH (V)
1.0
Typical
0.8
0.6
-40°C
0.4
0.2
0.0
-4.5 -4.0 -3.5 -3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0
IOH (mA)
FIGURE 26-46: VOL vs. IOL OVER TEMPERATURE, VDD = 1.8V, PIC16LF1526 ONLY
1.8
Graph represents
1.6
3ı Limits
1.4
125°C
1.2
Typical
VOL (V)
1.0
-40°C
0.8
0.6
0.4
0.2
0.0
0 1 2 3 4 5 6 7 8 9 10
IOL (mA)
1.70
1.68
Max.
1.66
1.64 Typical
1.62
Voltage (V)
Min.
1.60
1.58
1.56
1.50
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
1.54
1.46
Voltage (V)
1.44
Typical
1.42
1.40
Min.
1.38
1.36
1.34
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
2.00
Max.
1.95
Voltage (V)
Typical
1.90
1.85 Min.
Max: Typical + 3ı
Min: Typical - 3ı
1.80
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
60
50 Max.
Max: Typical + 3ı
40 Typical: 25°C
Min: Typical - 3ı
Voltage (mV)
Typical
30
20
Min.
10
0
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
2.60
2.55 Max.
2.50
Typical
Voltage (V)
2.45
Min.
2.40
Max: Typical + 3ı
2.35 Min: Typical - 3ı
2.30
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
70
Max.
60
Max: Typical + 3ı
50 Typical: 25°C
Min: Typical - 3ı
Voltage (mV)
40
Typical
30
20
Min.
10
0
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
2.80
2.75
Max.
2.70
Voltage (V)
Typical
2.65
Min.
Max: Typical + 3ı
2.60 Min: Typical - 3ı
2.55
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
90
80
Min.
70
60
Typical
Voltage (mV)
50
40 Max: Typical + 3ı
Typical: 25°C
30 Min: Typical - 3ı
20
Max.
10
0
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
2.50
Max.
Max: Typical + 3ı
2.40
Min: Typical - 3ı
2.30
Typical
Voltage (V)
2.20
2.10
2.00
Min.
1.90
1.80
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
45
25
Min.
20
15
10
0
-60 -40 -20 0 20 40 60 80 100 120 140
Temperature (°C)
24
22 Max.
20
Time (ms)
18 Typical
16
Min.
14
100
80
Time (ms)
70 Typical
60
Min.
50
40
1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
40
Max: Typical + 3ı
35 Max. Typical: statistical mean @ 25°C
30
Typical
25
Time (us)
20
15
Note:
10 The FVR Stabilization Period applies when:
1) coming out of Reset or exiting Sleep mode for PIC12/16LFxxxx devices.
2) when exiting Sleep mode with VREGPM = 1 for PIC12/16Fxxxx devices
5 In all other cases, the FVR is stable when released from Reset.
0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
36
34
Max.
32
30
Typical
Frequency (kHz)
28
26 Min.
24
Max: Typical + 3ı (-40°C to +125°C)
22 Typical: statistical mean @ 25°C
Min: Typical - 3ı (-40°C to +125°C)
20
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
FIGURE 26-61: LFINTOSC FREQUENCY OVER VDD AND TEMPERATURE, PIC16F1526/7 ONLY
36
34
Max.
32
30
Frequency (kHz)
Typical
28
26 Min.
24
Max: Typical + 3ı (-40°C to +125°C)
22 Typical: statistical mean @ 25°C
Min: Typical - 3ı (-40°C to +125°C)
20
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
5.0
4.5
Max.
4.0
3.5
3.0 Typical
Time (us)
2.5
2.0
1.5
Max: 85°C + 3ı
1.0 Typical: 25°C
0.5
0.0
1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8
VDD (V)
35
Max.
30
Typical
25
Time (us)
20
15
10
5 Max: 85°C + 3ı
Typical: 25°C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
12
Max.
10
8
Time (us)
Typical
6
2 Max: 85°C + 3ı
Typical: 25°C
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0
VDD (V)
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
XXXXXXXXXX
XXXXXXXXXX PIC16LF1527
XXXXXXXXXX -E/PT e3
YYWWNNN 1527017
PIN 1 PIN 1
XXXXXXXXXXX
XXXXXXXXXXX PIC16LF1527
XXXXXXXXXXX -E/MR e3
YYWWNNN 1527017
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.
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
D
D1
D1/2
D
NOTE 2
E1/2
A B
E1 E
A A
SEE DETAIL 1
N
4X N/4 TIPS
0.20 C A-B D 1 3
2
4X
NOTE 1
0.20 H A-B D
TOP VIEW
A2
A
C 0.05
SEATING
PLANE
A1
64 X b
0.08 C e 0.08 C A-B D
SIDE VIEW
64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
E
L T
(L1) X=A—B OR D
SECTION A-A X
e/2
DETAIL 1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Leads N 64
Lead Pitch e 0.50 BSC
Overall Height A - - 1.20
Molded Package Thickness A2 0.95 1.00 1.05
Standoff A1 0.05 - 0.15
Foot Length L 0.45 0.60 0.75
Footprint L1 1.00 REF
Foot Angle I 0° 3.5° 7°
Overall Width E 12.00 BSC
Overall Length D 12.00 BSC
Molded Package Width E1 10.00 BSC
Molded Package Length D1 10.00 BSC
Lead Thickness c 0.09 - 0.20
Lead Width b 0.17 0.22 0.27
Mold Draft Angle Top D 11° 12° 13°
Notes: Mold Draft Angle Bottom E 11° 12° 13°
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Chamfers at corners are optional; size may vary.
3. Dimensions D1 and E1 do not include mold flash or protrusions. Mold flash or
protrusions shall not exceed 0.25mm per side.
4. 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.
Microchip Technology Drawing C04-085C Sheet 2 of 2
64-Lead Plastic Thin Quad Flatpack (PT)-10x10x1 mm Body, 2.00 mm Footprint [TQFP]
Note: For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
C1
C2
Y1
X1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Contact Pitch E 0.50 BSC
Contact Pad Spacing C1 11.40
Contact Pad Spacing C2 11.40
Contact Pad Width (X28) X1 0.30
Contact Pad Length (X28) Y1 1.50
Distance Between Pads G 0.20
Notes:
1. Dimensioning and tolerancing per ASME Y14.5M
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
Microchip Technology Drawing C04-2085B Sheet 1 of 1
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
Revision A (01/2011)
Original release.
Revision B (05/2011)
Electrical Spec updates.
Revision C (01/2013)
Updated Electrical Spec and added Characterization
Data Graphs.
Revision D (09/2015)
Updated chapters High-Performance RISC CPU,
Device Overview, Memory Organization, Device
Configuration, Enhanced Universal Synchronous
Asynchronous Receiver Transmitter (EUSART),
Packaging Information. Other minor corrections.
• 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.