Académique Documents
Professionnel Documents
Culture Documents
Data Sheet
28/40/44-Pin Flash-Based,
8-Bit CMOS Microcontrollers
• 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.
Information contained in this publication regarding device AmpLab, FilterLab, Linear Active Thermistor, Migratable
applications and the like is provided only for your convenience Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The
and may be superseded by updates. It is your responsibility to Embedded Control Solutions Company are registered trade-
ensure that your application meets with your specifications. marks of Microchip Technology Incorporated in the U.S.A.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR Analog-for-the-Digital Age, Application Maestro, CodeGuard,
IMPLIED, WRITTEN OR ORAL, STATUTORY OR dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
OTHERWISE, RELATED TO THE INFORMATION, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Cir-
INCLUDING BUT NOT LIMITED TO ITS CONDITION, cuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM,
QUALITY, PERFORMANCE, MERCHANTABILITY OR MPLAB Certified logo, MPLIB, MPLINK, PICkit, PICDEM,
FITNESS FOR PURPOSE. Microchip disclaims all liability PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, Power-
arising from this information and its use. Use of Microchip Mate, PowerTool, REAL ICE, rfLAB, Select Mode, Smart
devices in life support and/or safety applications is entirely at Serial, SmartTel, Total Endurance, UNI/O, WiperLock and
the buyer’s risk, and the buyer agrees to defend, indemnify ZENA are trademarks of Microchip Technology Incorporated
and hold harmless Microchip from any and all damages, in the U.S.A. and other countries.
claims, suits, or expenses resulting from such use. No
SQTP is a service mark of Microchip Technology Incorporated
licenses are conveyed, implicitly or otherwise, under any
in the U.S.A.
Microchip intellectual property rights.
All other trademarks mentioned herein are property of their
respective companies.
Trademarks
© 2007, Microchip Technology Incorporated, Printed in the
The Microchip name and logo, the Microchip logo, Accuron, U.S.A., All Rights Reserved.
dsPIC, KEELOQ, KEELOQ logo, microID, MPLAB, PIC, PICmi-
Printed on recycled paper.
cro, PICSTART, PRO MATE, rfPIC and SmartShunt are regis-
tered trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
Program
Memory SRAM 8-bit A/D Timers
Device I/Os Interrupts AUSART CCP
Flash (bytes) (ch) 8/16-bit
(words)
PIC16F722/ 2048 128 25 12 11 Yes 2 2/1
PIC16LF722
PIC16F723/ 4096 192 25 12 11 Yes 2 2/1
PIC16LF723
PIC16F724/ 4096 192 36 12 14 Yes 2 2/1
PIC16LF724
PIC16F726/ 8192 368 25 12 11 Yes 2 2/1
PIC16LF726
PIC16F727/ 8192 368 36 12 14 Yes 2 2/1
PIC16LF727
VPP/MCLR/RE3 1 28 RB7/ICSPDAT
VCAP(3)/SS(2)/AN0/RA0 2 27 RB6/ICSPCLK
AN1/RA1 3 26 RB5/AN13/CPS5/T1G
AN2/RA2 4 25 RB4/AN11/CPS4
PIC16LF722/723/726
24 RB3/AN9/CPS3/CCP2(1)
PIC16F722/723/726/
VREF/AN3/RA3 5
T0CKI/CPS6/RA4 6 23 RB2/AN8/CPS2
VCAP(3)/SS(2)/CPS7/AN4/RA5 7 22 RB1/AN10/CPS1
VSS 8 21 RB0/AN12/CPS0/INT
CLKIN/OSC1/RA7 9 20 VDD
VCAP(3)/CLKOUT/OSC2/RA6 10 19 VSS
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 16 25 RC6/TX/CK
CCP1/RC2 17 24 RC5/SDO
SCL/SCK/RC3 18 23 RC4/SDI/SDA
CPS8/RD0 19 22 RD3/CPS11
CPS9/RD1 20 21 RD2/CPS10
RC1/T1OSI/CCP2(1)
RC3/SCK/SCL
RC4/SDI/SDA
RD2/CPS10
RD3/CPS11
RC6/TX/CK
RC2/CCP1
RD1/CPS9
RD0/CPS8
RC5/SDO
NC
38
41
40
39
37
36
35
34
42
44
43
DT/RX/RC7 1 33 NC
CPS12/RD4 2 32 RC0/T1OSO/T1CKI
CPS13/RD5 3 31 RA6/OSC2/CLKOUT/VCAP(3)
CPS14/RD6 4 30 RA7/OSC1/CLKIN
CPS15/RD7 5 29 VSS
PIC16F724/727/
VSS 6 28 VDD
PIC16LF724/727
VDD 7 27 RE2/AN7
INT/CPS0/AN12/RB0 8 26 RE1/AN6
CPS1/AN10/RB1 9 25 RE0/AN5
CPS2/AN8/RB2 10 24 RA5/AN4/CPS7/SS(2)/VCAP(3)
CCP2(1)/CPS3/AN9/RB3 11 23 RA4/CPS6/T0CKI
12
13
14
15
16
17
18
19
20
21
22
NC
NC
CPS4/AN11/RB4
T1G/CPS5/AN13/RB5
ICSPCLK/RB6
ICSPDAT/RB7
VPP/MCLR/RE3
VCAP(3)/SS(2)/AN0/RA0
AN1/RA1
AN2/RA2
VREF/AN3/RA3
RC1/T1OSI/CCP2(1)
RC0/T1OSO/T1CKI
RC3/SCK/SCL
RC4/SDI/SDA
RD2/CPS10
RD3/CPS11
RC6/TX/CK
RC2/CCP1
RD1/CPS9
RD0/CPS8
RC5/SDO
44
43
42
41
40
39
37
36
35
34
38
DT/RX/RC7 1 33 RA6/OSC2/CLKOUT/VCAP(3)
CPS12/RD4 2 32 RA7/OSC1/CLKIN
CPS13/RD5 3 31 VSS
CPS14/RD6 4 30 VSS
CPS15/RD7 5 29 NC
VSS 6 PIC16F724/727/ 28 VDD
VDD 7 PIC16LF724/727 27 RE2/AN7
VDD 8 26 RE1/AN6
INT/CPS0/AN12/RB0 9 25 RE0/AN5
CPS1/AN10/RB1 10 24 RA5/AN4/CPS7/SS(2)/VCAP(3)
CPS2/AN8/RB2 11 23 RA4/CPS6/T0CKI
22
12
13
14
15
16
17
18
19
20
21
CCP2(1)/CPS3/AN9/RB3
NC
CPS4/AN11/RB4
T1G/CPS5/AN13/RB5
ICSPCLK/RB6
ICSPDAT/RB7
VPP/MCLR/RE3
VCAP(3)/SS(2)/AN0/RA0
AN1/RA1
AN2/RA2
VREF/AN3/RA3
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.
AN0 AN1 AN2 AN3 AN4 AN8 AN9 AN10 AN11 AN12 AN13 CPS0 CPS1 CPS2 CPS3 CPS4 CPS5 CPS6 CPS7
Configuration PORTA
13 8 RA0
Data Bus
Program Counter RA1
RA2
Flash
RA3
Program RA4
Memory 8 Level Stack RA5
(13-bit) RAM RA6
RA7
Program PORTB
14 9
Bus RAM Addr RB0
RB1
Instruction Addr MUX
Instruction Reg
reg RB2
7 Indirect RB3
Direct Addr
8 Addr RB4
RB5
FSR reg
FSR Reg RB6
RB7
STATUS
STATUS Reg
reg PORTC
8 RC0
RC1
RC2
3 MUX RC3
Power-up
Timer RC4
RC5
Instruction Oscillator
Decode
Decodeand & Start-up Timer RC6
ALU RC7
Control
OSC1/CLKIN Power-on
Reset 8 PORTD
RD0
Timing Watchdog RD1
OSC2/CLKOUT Generation W Reg
Timer
RD2
Brown-out RD3
Reset RD4
LDO(1) RD5
Internal Regulator
Oscillator RD6
Block CCP1 RD7
CCP1 PORTE
RE0
RE1
CCP2
MCLR VDD VSS RE2
CCP2
RE3
T1OSI Timer1
32 kHz
T1OSO Oscillator
SDI/ SCK/
TX/CK RX/DT SDO SDA SCL SS
T0CKI T1G T1CKI
Analog-To-Digital Converter
AN0 AN1 AN2 AN3 AN4 AN5 AN6 AN7 AN8 AN9 AN10 AN11 AN12 AN13
CPS0 CPS1 CPS2 CPS3 CPS4 CPS5 CPS6 CPS7 CPS8 CPS9 CPS10 CPS11 CPS12 CPS13 CPS14 CPS15
Bank 0
00h(2) INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx 31,40
01h TMR0 Timer0 Module Register xxxx xxxx 111,40
02h(2) PCL Program Counter (PC) Least Significant Byte 0000 0000 30,40
03h(2) STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 27,40
04h(2) FSR Indirect Data Memory Address Pointer xxxx xxxx 31,40
05h PORTA RA7 RA6 RA5 RA4 RA3 RA2 RA1 RA0 xxxx xxxx 54,40
06h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx 63,40
07h PORTC RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx 73,40
08h(3) PORTD RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 xxxx xxxx 80,40
09h PORTE — — — — RE3 RE2(3) RE1(3) RE0(3) ---- xxxx 85,40
0Ah(1, 2) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 30,40
0Bh(2) INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 46,40
0Ch PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 49,40
0Dh PIR2 — — — — — — — CCP2IF ---- ---0 50,40
0Eh TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx 120,40
0Fh TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx 120,40
10h T1CON TMR1CS1 TMR1CS0 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC — TMR1ON 0000 00-0 124,40
11h TMR2 Timer2 Module Register 0000 0000 127,40
12h T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 128,40
13h SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx 169,40
14h SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 186,40
15h CCPR1L Capture/Compare/PWM Register (LSB) xxxx xxxx 137,40
16h CCPR1H Capture/Compare/PWM Register (MSB) xxxx xxxx 137,40
17h CCP1CON — — DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 136,40
18h RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 155,40
19h TXREG USART Transmit Data Register 0000 0000 154,40
1Ah RCREG USART Receive Data Register 0000 0000 152,40
1Bh CCPR2L Capture/Compare/PWM Register 2 (LSB) xxxx xxxx 137,40
1Ch CCPR2H Capture/Compare/PWM Register 2 (MSB) xxxx xxxx 137,40
1Dh CCP2CON — — DC2B1 DC2B0 CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 136,40
1Eh ADRES A/D Result Register xxxx xxxx 105,41
1Fh ADCON0 — — CHS3 CHS2 CHS1 CHS0 GO/DONE ADON --00 0000 104,41
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: The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<12:8>, whose contents are
transferred to the upper byte of the program counter.
2: These registers can be addressed from any bank.
3: These registers/bits are not implemented on PIC16F722/723/726/PIC16LF722/723/726 devices, read as ‘0’.
4: Accessible only when SSPM<3:0> = 1001.
5: Accessible only when SSPM<3:0> ≠ 1001.
Bank 1
80h(2) INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx 31,40
81h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 28,41
82h(2) PCL Program Counter (PC) Least Significant Byte 0000 0000 30,40
83h(2) STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 27,40
84h(2) FSR Indirect Data Memory Address Pointer xxxx xxxx 31,40
85h TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111 54,41
86h TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 63,41
87h TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 73,41
88h(3) TRISD TRISD7 TRISD6 TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 1111 1111 81,41
89h TRISE — — — — TRISE3(3) TRISE2(3) TRISE1(3) TRISE0(3) ---- 1111 85,41
8Ah(1, 2) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 30,40
8Bh(2) INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 46,40
8Ch PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 47,41
8Dh PIE2 — — — — — — — CCP2IE ---- ---0 48,41
8Eh PCON — — — — — — POR BOR ---- --qq 29,41
8Fh T1GCON TMR1GE T1GPOL T1GTM T1GSPM T1GGO/ T1GVAL T1GSS1 T1GSS0 0000 0x00 125,41
DONE
90h OSCCON — — IRCF1 IRCF0 ICSL ICSS — — --10 qq-- 91,41
91h OSCTUNE — — TUN5 TUN4 TUN3 TUN2 TUN1 TUN0 --00 0000 92,41
92h PR2 Timer2 Period Register 1111 1111 127,41
93h SSPADD(5) Synchronous Serial Port (I2C mode) Address Register 0000 0000 177,41
93h SSPMSK(4) Synchronous Serial Port (I2C mode) Address Mask Register 1111 1111 188,41
94h SSPSTAT SMP CKE D/A P S R/W UA BF 0000 0000 187,41
95h WPUB WPUB7 WPUB6 WPUB5 WPUB4 WPUB3 WPUB2 WPUB1 WPUB0 1111 1111 64,41
96h IOCB IOCB7 IOCB6 IOCB5 IOCB4 IOCB3 IOCB2 IOCB1 IOCB0 0000 0000 64,41
97h — Unimplemented — —
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 154,41
99h SPBRG BRG7 BRG6 BRG5 BRG4 BRG3 BRG2 BRG1 BRG0 0000 0000 156,41
9Ah — Unimplemented — —
9Bh — Unimplemented — —
9Ch APFCON — — — — — — SSSEL CCP2SEL ---- --00 53,41
9Dh FVRCON FVRRDY FVREN — — — — ADFVR1 ADFVR0 q0-- --00 109,41
9Eh — Unimplemented — —
9Fh ADCON1 — ADCS2 ADCS1 ADCS0 — — ADREF1 ADREF0 0000 --00 105,41
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: The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<12:8>, whose contents are
transferred to the upper byte of the program counter.
2: These registers can be addressed from any bank.
3: These registers/bits are not implemented on PIC16F722/723/726/PIC16LF722/723/726 devices, read as ‘0’.
4: Accessible only when SSPM<3:0> = 1001.
5: Accessible only when SSPM<3:0> ≠ 1001.
Bank 2
100h(2) INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx 31,40
101h TMR0 Timer0 Module Register xxxx xxxx 111,40
102h(2) PCL Program Counter’s (PC) Least Significant Byte 0000 0000 30,40
103h(2) STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 27,40
104h(2) FSR Indirect Data Memory Address Pointer xxxx xxxx 31,40
105h — Unimplemented — —
106h — Unimplemented — —
107h — Unimplemented — —
108h CPSCON0 CPSON — — — CPSRNG1 CPSRNG0 CPSOUT T0XCS 0--- 0000 133,41
109h CPSCON1 — — — — CPSCH3 CPSCH2 CPSCH1 CPSCH0 ---- 0000 134,41
10Ah(1, 2) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 30,40
10Bh(2) INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 46,40
10Ch PMDATL Program Memory Read Data Register Low Byte xxxx xxxx 189,41
10Dh PMADRL Program Memory Read Address Register Low Byte xxxx xxxx 189,41
10Eh PMDATH — — Program Memory Read Data Register High Byte --xx xxxx 189,41
10Fh PMADRH — — — Program Memory Read Address Register High Byte ---x xxxx 189,41
Bank 3
180h(2) INDF Addressing this location uses contents of FSR to address data memory (not a physical register) xxxx xxxx 31,40
181h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 28,41
182h(2) PCL Program Counter (PC) Least Significant Byte 0000 0000 30,40
183h(2) STATUS IRP RP1 RP0 TO PD Z DC C 0001 1xxx 27,40
184h(2) FSR Indirect Data Memory Address Pointer xxxx xxxx 31,40
185h ANSELA — — ANSA5 ANSA4 ANSA3 ANSA2 ANSA1 ANSA0 --11 1111 55,41
186h ANSELB — — ANSB5 ANSB4 ANSB3 ANSB2 ANSB1 ANSB0 --11 1111 64,41
187h — Unimplemented — —
188h ANSELD ANSD7 ANSD6 ANSD5 ANSD4 ANSD3 ANSD2 ANSD1 ANSD0 1111 1111 81,41
189h(3) ANSELE — — — — — ANSE2 ANSE1 ANSE0 ---- -111 86,41
18Ah(1, 2) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 30,40
18Bh(2) INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 46,40
18Ch PMCON1 Reserved — — — — — — RD 1--- ---0 190,41
18Dh — Unimplemented — —
18Eh — Unimplemented — —
18Fh — 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: The upper byte of the program counter is not directly accessible. PCLATH is a holding register for the PC<12:8>, whose contents are
transferred to the upper byte of the program counter.
2: These registers can be addressed from any bank.
3: These registers/bits are not implemented on PIC16F722/723/726/PIC16LF722/723/726 devices, read as ‘0’.
4: Accessible only when SSPM<3:0> = 1001.
5: Accessible only when SSPM<3:0> ≠ 1001.
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
bit 7 IRP: Register Bank Select bit (used for indirect addressing)
1 = Bank 2, 3 (100h-1FFh)
0 = Bank 0, 1 (00h-FFh)
bit 6-5 RP<1:0>: Register Bank Select bits (used for direct addressing)
00 = Bank 0 (00h-7Fh)
01 = Bank 1 (80h-FFh)
10 = Bank 2 (100h-17Fh)
11 = Bank 3 (180h-1FFh)
bit 4 TO: Time-out bit
1 = After power-up, CLRWDT instruction or SLEEP instruction
0 = A WDT time-out occurred
bit 3 PD: Power-down bit
1 = After power-up or by the CLRWDT instruction
0 = By execution of the SLEEP instruction
bit 2 Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1 DC: Digit Carry/Digit Borrow bit (ADDWF, ADDLW,SUBLW,SUBWF instructions)(1)
1 = A carry-out from the 4th low-order bit of the result occurred
0 = No carry-out from the 4th low-order bit of the result
bit 0 C: Carry/Borrow bit(1) (ADDWF, ADDLW, SUBLW, SUBWF instructions)(1)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
Note 1: For Borrow, the polarity is reversed. A subtraction is executed by adding the two’s complement of the
second operand. For rotate (RRF, RLF) instructions, this bit is loaded with either the high-order or low-order
bit of the source register.
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
q = Value depends on condition
Note 1: Set BOREN<1:0> = 01 in the Configuration Word register for this bit to control the BOR.
Data
Memory
7Fh 1FFh
Bank 0 Bank 1 Bank 2 Bank 3
Note: For memory map detail, refer to Figures 2-4 and 2-5.
MCLRE
MCLR/VPP
Sleep
WDT WDT
Module Time-out
Reset
POR
Power-on Reset
VDD
Brown-out(1)
Reset
BOREN
OST/PWRT
OST
Chip_Reset
10-bit Ripple Counter
OSC1/
CLKIN
PWRT
WDTOSC 11-bit Ripple Counter
Enable PWRT
Enable OST
FIGURE 3-1: WATCHDOG TIMER BLOCK DIAGRAM FOR WDT TEST MODES
T1GSS = 11
TMR1GE
From TMR0
WDTE Clock Source
Low-Power
WDT OSC
0
Postscaler
Divide by
1
512
PS<2:0>
TO TMR0
PSA 0 1
WDT Reset
To T1G
WDTE
VDD
VBOR
Internal
Reset 64 ms(1)
VDD
VBOR
Internal < 64 ms
Reset 64 ms(1)
VDD
VBOR
Internal
Reset 64 ms(1)
XT, HS, LP(1) TPWRT + 1024 • 1024 • TOSC TPWRT + 1024 • 1024 • TOSC 1024 • TOSC
TOSC TOSC
RC, EC, INTOSC TPWRT — TPWRT — —
Note 1: LP mode with T1OSC disabled.
VDD
MCLR
Internal POR
TPWRT
OST Time-out
Internal Reset
VDD
MCLR
Internal POR
TPWRT
OST Time-out
Internal Reset
VDD
MCLR
Internal POR
TPWRT
OST Time-out
Internal Reset
IOC-RB0
IOCB0
IOC-RB1
IOCB1
SSPIF
SSPIE
IOC-RB2
IOCB2
TXIF
IOC-RB3 TXIE
IOCB3
RCIF
RCIE Wake-up (If in Sleep mode)(1)
IOC-RB4
IOCB4 T0IF
TMR2IF T0IE
Interrupt to CPU
IOC-RB5 TMR2IE INTF
IOCB5 INTE
TMR1IF RBIF
IOC-RB6 TMR1IE
RBIE
IOCB6
ADIF
IOC-RB7 ADIE PEIE
IOCB7
TMR1GIF GIE
TMR1GIE
CCP1IF
CCP1IE
CCP2IF
CCP2IE Note 1: Some peripherals depend upon the
system clock for operation. Since the
system clock is suspended during
Sleep, these peripherals will not wake
the part from Sleep. See Section 19.1
“Wake-up from Sleep”.
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
CLKOUT (3)
(4)
INT pin
(1)
(1)
INTF flag (5) Interrupt Latency (2)
(INTCON<1>)
GIE bit
(INTCON<7>)
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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: The appropriate bits in the IOCB register must also be set.
2: T0IF bit is set when Timer0 rolls over. Timer0 is unchanged on Reset and should be initialized before
clearing T0IF bit.
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’
-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
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000x
OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
PIE2 — — — — — — — CCP2IE ---- ---0 ---- ---0
PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
PIR2 — — — — — — — CCP2IF ---- ---0 ---- ---0
Legend: - = Unimplemented locations, read as ‘0’, u = unchanged, x = unknown. Shaded cells are not used by the Capture, Compare and PWM.
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
Reading the PORTA register (Register 6-2) reads the EXAMPLE 6-1: INITIALIZING PORTA
status of the pins, whereas writing to it will write to the BANKSEL PORTA ;
PORT latch. All write operations are read-modify-write CLRF PORTA ;Init PORTA
operations. Therefore, a write to a port implies that the BANKSEL ANSELA ;
port pins are read, this value is modified and then CLRF ANSELA ;digital I/O
written to the PORT data latch. BANKSEL TRISA ;
MOVLW 0Ch ;Set RA<3:2> as inputs
MOVWF TRISA ;and set RA<7:4,1:0>
;as outputs
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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
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.
6.2.2.4 RA3/AN3/VREF
Figure 6-2 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose input
• an analog input for the ADC
• a voltage reference input for the ADC
6.2.2.5 RA4/CPS6/T0CKI
Figure 6-3 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• a capacitive sensing input
• a clock input for Timer0
The Timer0 clock input function works independently
of any TRIS register setting. Effectively, if TRISA4 = 0,
the PORTA4 register bit will output to the pad and
Clock Timer0 at the same time.
VCAPEN = 00
D Q
WR CK Q I/O Pin
PORTA
D Q VSS
WR CK Q
TRISA
RD
TRISA
ANSA0
RD
PORTA
To SSP SS Input
To A/D Converter
D Q
WR CK Q I/O Pin
PORTA
D Q VSS
WR CK Q
TRISA
RD
TRISA
ANSAx
RD
PORTA
To A/D Converter
D Q
WR CK Q I/O Pin
PORTA
D Q VSS
WR CK Q
TRISA
RD
TRISA
ANSA4
RD
PORTA
VCAPEN = 01
D Q
WR CK Q I/O Pin
PORTA
D Q VSS
WR CK Q
TRISA
RD
TRISA
ANSA5
RD
PORTA
To SSP SS Input
To A/D Converter
To Cap Sensor
PIC16F72X only
To Voltage Regulator
VCAPEN = 10
Oscillator
CLKOUT(1) Circuit VDDIO
Enable
Data Bus RA7/OSC1
I/O Pin
FOSC/4 1
D Q 0
WR CK Q
PORTA
VSS
D Q
WR CK Q
TRISA
RD
TRISA
FOSC = LP or XT or HS
(00X OR 010)
RD
PORTA
Oscillator
Data Bus Circuit VDDIO
RA6/OSC2
I/O Pin
D Q
WR CK Q
PORTA
D Q VSS
WR CK Q
TRISA
RD
TRISA
OSC = INTOSC or
INTOSCIO
RD
PORTA
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’
-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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
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.
6.3.4.3 RB2/AN8/CPS2
Figure 6-8 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an analog input for the ADC
• a capacitive sensing input
6.3.4.4 RB3/AN9/CPS3/CCP2
Figure 6-9 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an analog input for the ADC
• a capacitive sensing input
• a Capture 2 input, Compare 2 output, and PWM2
output
Note: CCP2 pin location may be selected as
RB3 or RC1.
6.3.4.5 RB4/AN11/CPS4
Figure 6-8 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an analog input for the ADC
• a capacitive sensing input
Data Bus
D Q VDDIO
WR CK
WPUB Q Weak
VDDIO
RD RBPU
WPUB
D Q
WR CK Q I/O Pin
PORTB
D Q VSS
WR CK Q
TRISB
RD
TRISB
ANSB0
RD
PORTB
D Q
WR CK Q Q D
IOCB
EN Q3
RD
IOCB Q D
EN
Interrupt-on-
Change
RD PORTB
To External Interrupt Logic
To A/D Converter
To Cap Sensor
Data Bus
D Q VDDIO
WR CK
WPUB Q Weak
VDDIO
RD RBPU
WPUB
D Q
WR CK Q I/O Pin
PORTB
D Q VSS
WR CK Q
TRISB
RD
TRISB
ANSB<4,2,1>
RD
PORTB
D Q
WR CK Q Q D
IOCB
EN Q3
To A/D Converter
RD
IOCB Q D To Cap Sensor
EN
Interrupt-on-
Change
RD PORTB
Data Bus
D Q VDDIO
WR CK
WPUB Q Weak
CCP2OUT
Enable VDDIO
RD RBPU
WPUB
CCP2OUT 1
D Q 0
I/O Pin
WR CK Q
PORTB
VSS
D Q
WR CK Q
TRISB
RD
TRISB
ANSB<5,3>
RD
PORTB
D Q
WR CK Q Q D
IOCB
EN Q3
RD
IOCB Q D
EN
Interrupt-on-
Change
RD PORTB
To CCP2(1)
To A/D Converter
To Cap Sensor
Data Bus
D Q VDDIO
WR CK
WPUB Q Weak
CCP2OUT
Enable VDDIO
RD RBPU
WPUB
CCP2OUT 1
D Q 0
I/O Pin
WR CK Q
PORTB
VSS
D Q
WR CK Q
TRISB
RD
TRISB
ANSB<5,3>
RD
PORTB
D Q
WR CK Q Q D
IOCB
EN Q3
RD
IOCB Q D
EN
Interrupt-on-
Change
RD PORTB
To Timer1 Gate
To A/D Converter
To Cap Sensor
ICSP MODE
DEBUG
Data Bus
D Q VDDIO
WR CK
WPUB Q Weak
VDDIO
RD RBPU
WPUB PORT_ICDCLK
1
D Q
0 I/O Pin
WR CK Q
PORTB
D Q VSS
WR 0
CK Q
TRISB
1
RD
TRISB TRIS_ICDCLK
RD
PORTB
D Q
WR CK Q Q D
IOCB
EN Q3
RD
IOCB Q D
EN
Interrupt-on-
Change
RD PORTB
ICSPCLK
ICSP MODE
DEBUG
Data Bus
D Q VDDIO
WR CK Q Weak
WPUB
RBPU VDDIO
RD
WPUB PORT_ICDDAT
1
D Q
0
WR CK Q I/O Pin
PORTB
D Q VSS
0
WR CK Q
TRISB
1
RD
TRISB TRIS_ICDDAT
RD
PORTB
D Q
WR CK Q Q D
IOCB
EN Q3
RD
IOCB Q D
EN
Interrupt-on-
Change
RD PORTB
ICSPDAT_IN
ADCON0 — — CHS3 CHS2 CHS1 CHS0 GO/DONE ADON --00 0000 --00 0000
ANSELB — — ANSB5 ANSB4 ANSB3 ANSB2 ANSB1 ANSB0 --11 1111 --11 1111
APFCON — — — — — — SSSEL CCP2SEL ---- --00 ---- --00
CCP2CON — — DC2B1 DC2B0 CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 --00 0000
CPSCON0 CPSON — — — CPSRNG1 CPSRNG0 CPSOUT T0XCS 0--- 0000 0--- 0000
CPSCON1 — — — — CPSCH3 CPSCH2 CPSCH1 CPSCH0 ---- 0000 ---- 0000
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000X
IOCB IOCB7 IOCB6 IOCB5 IOCB4 IOCB3 IOCB2 IOCB1 IOCB0 0000 0000 0000 0000
OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx xxxx xxxx
T1GCON TMR1GE T1GPOL T1GTM T1GSPM T1GGO/ T1GVAL T1GSS1 T1GSS0 0000 0x00 uuuu uxuu
DONE
TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
WPUB WPUB7 WPUB6 WPUB5 WPUB4 WPUB3 WPUB2 WPUB1 WPUB0 1111 1111 1111 1111
Legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. Shaded cells are not used by Port B.
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
6.4.2 RC1/T1OSI/CCP2
Figure 6-14 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• a Timer1 oscillator input
• a Capture 2 input, Compare 2 output, and PWM2
output
Note: CCP2 pin location may be selected as
RB3 or RC1.
6.4.3 RC2/CCP1
Figure 6-15 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• a Capture 1 input, Compare 1 output, and PWM1
output
6.4.4 RC3/SCK/SCL
Figure 6-16 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• a SPI clock
• an I2C™ clock
6.4.5 RC4/SDI/SDA
Figure 6-17 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• a SPI data input
• an I2C data I/O
6.4.6 RC5/SDO
Figure 6-18 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• a SPI data output
6.4.7 RC6/TX/CK
Figure 6-19 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an asynchronous serial output
• a synchronous clock I/O
Oscillator
Circuit VDDIO
Data Bus
RC1/T1OSI
D Q
WR CK Q I/O Pin
PORTC
D Q VSS
WR CK Q
TRISC
RD
TRISC
T1OSCEN
RD
PORTC
To Timer1 CLK Input
CCP2OUT Oscillator
Enable Circuit
Data Bus VDDIO
RC0/T1OSO
CCP2OUT 1
D Q 0
WR CK Q I/O Pin
PORTC
D Q VSS
WR CK Q
TRISC
RD
TRISC
T1OSCEN
RD
PORTC
To CCP2(1) Input
CCP1OUT
Enable
Data Bus VDDIO
CCP1OUT 1
D Q 0
WR CK Q I/O Pin
PORTC
D Q VSS
WR CK Q
TRISC
RD
TRISC
RD
PORTC
To CCP1 Input
SCK_MASTER 1 VDDIO
SSPEN
Data Bus
0
1
D Q 0 (2)
I/O Pin
WR CK Q
PORTC
SCL VSS
D Q
WR CK Q
TRISC
RD
TRISC
To SSP SPI
Clock Input
1
0
RD
0
1
PORTC
SSPEN
SSPM = I2C MODE
To SSP I2C
SCL Input
I2C(1)
SSPEN
SSPM = I2C MODE VDDIO
Data Bus
1
D Q 0 (2)
I/O Pin
WR CK Q
PORTC
VSS
D Q
WR CK Q
TRISC
RD
TRISC
To SSP SPI
Data Input
1
0
RD
PORTC 0
1
To SSP I2C
SDA Input
I2C(1)
SSPEN
SSPM = SPI MODE VDDIO
Data Bus
SDO 1
D Q 0 I/O Pin
WR CK Q
PORTC
VSS
D Q SDO
EN
WR CK Q
TRISC
RD
TRISC
RD
PORTC
SYNC
USART_TX 0
VDDIO
USART_CK 1
1
Data Bus
D Q 0
WR CK Q I/O Pin
PORTC
D Q VSS
WR CK Q
TRISC
RD
TRISC
RD
PORTC
SPEN
TXEN 0
CSRC 1
SYNC
To USART
Sync Clock Input
SPEN
SYNC
Data Bus VDDIO
USART_DT 1
D Q 0
WR CK Q I/O Pin
PORTC
D Q VSS
WR CK Q
TRISC
RD
TRISC
RD
PORTC
SPEN
SYNC
TXEN
SREN
CREN
T1CON TMR1CS1 TMR1CS0 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC — TMR1ON 0000 00-0 uuuu uu-u
TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 0000 -010
TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 1111 1111
Legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. Shaded cells are not used by Port B.
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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
bit 7-0 ANSD<7:0>: Analog Select between Analog or Digital Function on Pins RD<7:0>, respectively
0 = Digital I/O. Pin is assigned to port or Digital special function.
1 = Analog input. Pin is assigned as analog input(1). Digital Input buffer disabled.
Note 1: When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
2: ANSELD register is not implemented on the PIC16F722/723/726/PIC16LF722/723/726. Read as ‘0’.
D Q
WR CK Q I/O Pin
PORTD
D Q VSS
WR CK Q
TRISD
RD
TRISD
ANSD<7:0>
RD
PORTD
To Cap Sensor
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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
Note 1: When setting a pin to an analog input, the corresponding TRIS bit must be set to Input mode in order to
allow external control of the voltage on the pin.
2: ANSELE register is not implemented on the PIC16F722/723/726/PIC16LF722/723/726. Read as ‘0’
ADCON0 — — CHS3 CHS2 CHS1 CHS0 GO/DONE ADON --00 0000 --00 0000
ANSELE — — — — — ANSE2 ANSE1 ANSE0 ---- -111 ---- -111
PORTE — — — — RE3 RE2 RE1 RE0 ---- xxxx ---- xxxx
TRISE — — — — TRISE3 TRISE2 TRISE1 TRISE0 ---- 1111 ---- 1111
Legend: x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTE
Note 1: These registers are not implemented on the PIC16F722/723/726/PIC16LF722/723/726 devices, read as ‘0’.
6.6.2 RE1/AN6(1)
Figure 6-22 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an analog input for the ADC
Note 1: RE1/AN6 is available on
PIC16F724/LF724 and PIC16F727/LF727
only.
6.6.3 RE2/AN7(1)
Figure 6-22 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose I/O
• an analog input for the ADC
Note 1: RE2/AN7 is available on
PIC16F724/LF724 and PIC16F727/LF727
only.
6.6.4 RE3/MCLR/VPP
Figure 6-23 shows the diagram for this pin. This pin is
configurable to function as one of the following:
• a general purpose input
• as Master Clear Reset with weak pull-up
• a programming voltage reference input
D Q
WR CK Q I/O Pin
PORTE
D Q VSS
WR CK Q
TRISE
RD
TRISE
ANSE<0:2>
RD
PORTE
To A/D Converter
VDDIO
ICSP Mode Detect
Weak
RD
TRISE
VSS
RD
PORTE
Power for Programming Flash
FOSC<2:0>
External Oscillator (Configuration Word 1)
OSC2
Sleep
LP, XT, HS, RC, EC
OSC1
MUX
System Clock
Internal Oscillator IRCF<1:0> (CPU and Peripherals)
(OSCCON Register)
INTOSC
500 kHz 0
16 MHz/500 kHz
MUX
11
4 MHz/125 kHz
01
2 MHz/62.5 kHz
00
PLLEN
(Configuration Word 1)
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
q = Value depends on condition
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
Note 1: Enabling Brown-out Reset does not automatically enable Power-up Timer.
2: The entire program memory will be erased when the code protection is turned off.
3: When MCLR is asserted in INTOSC or RC mode, the internal clock oscillator is disabled.
4: MPLAB® IDE masks unimplemented Configuration bits to ‘0’.
Note 1: Enabling Brown-out Reset does not automatically enable Power-up Timer.
2: The entire program memory will be erased when the code protection is turned off.
3: When MCLR is asserted in INTOSC or RC mode, the internal clock oscillator is disabled.
4: MPLAB® IDE masks unimplemented Configuration bits to ‘0’.
8.3 User ID
Four memory locations (2000h-2003h) are designated
as ID locations where the user can store checksum or
other code identification numbers. These locations are
not accessible during normal execution, but are read-
able and writable during Program/Verify mode. Only
the Least Significant 7 bits of the ID locations are
reported when using MPLAB IDE. See the
“PIC16F72X/PIC16LF72X Memory Programming
Specification” (DS41332) for more information.
AVDD
ADREF = 0x
ADREF = 11
VREF+ ADREF = 10
AN0 0000
AN1 0001
AN2 0010
AN3 0011
AN4 0100
AN5 0101
AN6 0110
AN7 0111
ADC
AN8 1000
GO/DONE 8
AN9 1001
AN10 1010
1011 ADRES
AN11
AN12 1100 ADON
AN13 1101
VSS
Reserved 1110
FVREF 1111
CHS<3:0>
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
(2) (2) (2)
Fosc/4 100 200 ns 250 ns 500 ns 1.0 μs 4.0 μs
(2) (2)
Fosc/8 001 400 ns 0.5 μs 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)
(3) (3)
Fosc/64 110 3.2 μs 4.0 μs 8.0 μs 16.0 μs 64.0 μs(3)
FRC x11 0.8-4.0 μs(1,4) 0.8-4.0 μs(1,4) 0.8-4.0 μs(1,4) 0.8-4.0 μs(1,4) 0.8-4.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: When the device frequency is greater than 1 MHz, the FRC clock source is only recommended if the
conversion will be performed during Sleep.
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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
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 ) ]
1
V AP P LI ED ⎛ 1 – --------------------------⎞ = V CHOLD ;[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
⎛ ---------⎞
1
V AP P LI ED ⎜ 1 – e ⎟ = V A PP LIE D ⎛⎝ 1 – --------------------------⎞ ;combining [1] and [2]
RC
⎝ ⎠ n+1 ⎠
(2 )–1
T C = – C HOLD ( R IC + R SS + R S ) ln(1/511)
= – 10pF ( 1k Ω + 7k Ω + 10k Ω ) ln(0.001957)
= 1.12 µs
Therefore:
T ACQ = 2µS + 1.12µS + [ ( 50°C- 25°C ) ( 0.05µS /°C ) ]
= 4.42µ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.
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
FFh
FEh
FDh
FCh
ADC Output Code
1 LSB ideal
FBh
Full-Scale
04h Transition
03h
02h
01h
00h Analog Input Voltage
1 LSB ideal
ADCON0 — — CHS3 CHS2 CHS1 CHS0 GO/DONE ADON --00 0000 --00 0000
ADCON1 — ADCS2 ADCS1 ADCS0 — — ADREF1 ADREF0 -000 --00 -000 --00
ANSELA — — ANSA5 ANSA4 ANSA3 ANSA2 ANSA1 ANSA0 --11 1111 --11 1111
ANSELB — — ANSB5 ANSB4 ANSB3 ANSB2 ANSB1 ANSB0 --11 1111 --11 1111
ANSELE — — — — — ANSE2 ANSE1 ANSE0 ---- -111 ---- -111
ADRES A/D Result Register Byte xxxx xxxx uuuu uuuu
CCP2CON — — DC2B1 DC2B0 CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 --00 0000
FVRCON FVRRDY FVREN — — — — ADFVR1 ADFVR0 q0-- --00 q0-- --00
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000x
PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111 1111 1111
TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
TRISE — — — — TRISE3 TRISE2 TRISE1 TRISE0 ---- 1111 ---- 1111
Legend: x = unknown, u = unchanged, — = unimplemented read as ‘0’, q = value depends on condition. Shaded cells are not used for ADC
module.
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
q = Value depends on condition
FOSC/4
Data Bus
T0XCS 0
8
T0CKI 1
0 Sync
1 2 TCY TMR0
0 Set Flag bit T0IF
Cap. Sensing 0
1 T0CS on Overflow
Oscillator T0SE 8-bit
Prescaler PSA Overflow to Timer1
1
T1GSS = 11
TMR1GE
PSA
WDTE 8
Low-Power PS<2:0>
WDT OSC 1
WDT
Time-out
Divide by
0
512
PSA
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
CPSCON0 CPSON — — — CPSRNG1 CPSRNG0 CPSOUT T0XCS 0--- 0000 0--- 0000
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000x
OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
TMR0 Timer0 Module Register xxxx xxxx uuuu uuuu
TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111 1111 1111
Legend: – = Unimplemented locations, read as ‘0’, u = unchanged, x = unknown. Shaded cells are not used by the Timer0 module.
T1GSS<1:0>
T1G 00 T1GSPM
The Timer1 Gate Enable mode is enabled by setting 12.6.2.3 Timer2 Match Gate Operation
the TMR1GE bit of the T1GCON register. The polarity
of the Timer1 Gate Enable mode is configured using The TMR2 register will increment until it matches the
the T1GPOL bit of the T1GCON register. value in the PR2 register. On the very next increment
cycle, TMR2 will be reset to 00h. When this Reset
When Timer1 Gate Enable mode is enabled, Timer1 occurs, a low-to-high pulse will automatically be
will increment on the rising edge of the Timer1 clock generated and internally supplied to the Timer1 Gate
source. When Timer1 Gate Enable mode is disabled, circuitry.
no incrementing will occur and Timer1 will hold the
current count. See Figure 12-3 for timing details. 12.6.2.4 Watchdog Overflow Gate Operation
The Watchdog Timer oscillator, prescaler and counter
TABLE 12-3: TIMER1 GATE ENABLE will be automatically turned on when TMR1GE = 1 and
SELECTIONS T1GSS selects the WDT as a gate source for Timer1
(T1GSS = 11). TMR1ON does not factor into the oscil-
T1CLK T1GPOL T1G Timer1 Operation lator, prescaler and counter enable. See Table 12-5.
↑ 0 0 Counts The PSA and PS bits of the OPTION register still
↑ 0 1 Holds Count control what time-out interval is selected. Changing the
↑ 1 0 Holds Count prescaler during operation may result in a spurious
capture.
↑ 1 1 Counts
Enabling the Watchdog Timer oscillator does not
12.6.2 TIMER1 GATE SOURCE automatically enable a Watchdog Reset or Wake-up
SELECTION from Sleep upon counter overflow.
The Timer1 Gate source can be selected from one of Note: When using the WDT as a gate source for
four different sources. Source selection is controlled by Timer1, operations that clear the Watchdog
the T1GSS bits of the T1GCON register. The polarity Timer (CLRWDT, SLEEP instructions) will
for each available source is also selectable. Polarity affect the time interval being measured for
selection is controlled by the T1GPOL bit of the capacitive sensing. This includes waking
T1GCON register. from Sleep. All other interrupts that might
wake the device from Sleep should be
TABLE 12-4: TIMER1 GATE SOURCES disabled to prevent them from disturbing
the measurement period.
T1GSS Timer1 Gate Source
As the gate signal coming from the WDT counter will
00 Timer1 Gate Pin generate different pulse widths depending on if the
01 Overflow of Timer0 WDT is enabled, when the CLRWDT instruction is
(TMR0 increments from FFh to 00h) executed, and so on, Toggle mode must be used. A
10 Timer2 match PR2 specific sequence is required to put the device into the
(TMR2 increments to match PR2) correct state to capture the next WDT counter interval.
11 Count Enabled by WDT Overflow
(Watchdog Time-out interval expired)
T1CKI = 1
when TMR1
Enabled
T1CKI = 0
when TMR1
Enabled
TMR1GE
T1GPOL
T1G_IN
T1CKI
T1GVAL
TMR1GE
T1GPOL
T1GTM
T1G_IN
T1CKI
T1GVAL
TMR1GE
T1GPOL
T1GSPM
Cleared by hardware on
T1GGO/ Set by software falling edge of T1GVAL
DONE
Counting enabled on
rising edge of T1G
T1G_IN
T1CKI
T1GVAL
Cleared by
TMR1GIF Cleared by software Set by hardware on software
falling edge of T1GVAL
TMR1GE
T1GPOL
T1GSPM
T1GTM
Cleared by hardware on
T1GGO/ Set by software falling edge of T1GVAL
DONE Counting enabled on
rising edge of T1G
T1G_IN
T1CKI
T1GVAL
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
TMR1CS<1:0> = 1X
This bit is ignored. Timer1 uses the internal clock when TMR1CS<1:0> = 1X.
bit 1 Unimplemented: Read as ‘0’
bit 0 TMR1ON: Timer1 On bit
1 = Enables Timer1
0 = Stops Timer1
Clears Timer1 Gate flip-flop
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
Sets Flag
TMR2
bit TMR2IF
Output
Prescaler Reset
FOSC/4 TMR2
1:1, 1:4, 1:16
2 Postscaler
Comparator
EQ 1:1 to 1:16
T2CKPS<1:0>
PR2 4
TOUTPS<3:0>
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
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000x
PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
PR2 Timer2 Module Period Register 1111 1111 1111 1111
TMR2 Holding Register for the 8-bit TMR2 Register 0000 0000 0000 0000
T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
Legend: x = unknown, u = unchanged, - = unimplemented read as ‘0’. Shaded cells are not used for Timer2 module.
Timer0 Module
Set
T0CS
T0XCS T0IF
FOSC/4 0
Overflow
T0CKI 0 TMR0
1
1
CPSCH<3:0>(2)
CPSON(3)
CPS0
CPS1 Test
CPS2 Output
CPS3 Timer1 Module
CPS4 CPSON T1CS<1:0>
CPS5
CPS6 FOSC
Capacitive
CPS7 Sensing FOSC/4
CPSCLK
Oscillator TMR1H:TMR1L
CPS8(1) T1OSC/ EN
(1)
CPS9 CPSOSC T1CKI
CPSOUT
CPS10(1)
T1GSEL<1:0>
CPS11(1) CPSRNG<1:0>
CPS12(1) T1G
CPS13(1) Timer1 Gate
CPS14(1) Control Logic
CPS15(1)
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
ANSELA — — ANSA5 ANSA4 ANSA3 ANSA2 ANSA1 ANSA0 --11 1111 --11 1111
ANSELB — — ANSB5 ANSB4 ANSB3 ANSB2 ANSB1 ANSB0 --11 1111 --11 1111
ANSELD ANSD7 ANSD6 ANSD5 ANSD4 ANSD3 ANSD2 ANSD1 ANSD0 1111 1111 1111 1111
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 0000 0000 0000
OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
T1CON TMR1CS1 TMR1CS0 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC — TMR1ON 0000 00-0 0000 00-0
T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
TRISA TRISA7 TRISA6 TRISA5 TRISA4 TRISA3 TRISA2 TRISA1 TRISA0 1111 1111 1111 1111
TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
TRISD TRISD7 TRISD6 TRISD5 TRISD4 TRISD3 TRISD2 TRISD1 TRISD0 1111 1111 1111 1111
Legend: - = Unimplemented locations, read as ‘0’, u = unchanged, x = unknown. Shaded cells are not used by the capacitive sensing module.
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
ADCON0 — — CH3 CH2 CH1 CH0 GO/DONE ADON --00 0000 --00 0000
ANSELB — — ANSB5 ANSB4 ANSB3 ANSB2 ANSB1 ANSB0 --11 1111 --11 1111
APFCON — — — — — — SSSEL CCP2SEL ---- --00 ---- --00
CCPxCON — — DCxB1 DCxB0 CCPxM3 CCPxM2 CCPxM1 CCPxM0 --00 0000 --00 0000
CCPRxL Capture/Compare/PWM Register X Low Byte xxxx xxxx uuuu uuuu
CCPRxH Capture/Compare/PWM Register X High Byte xxxx xxxx uuuu uuuu
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000x
PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
PIE2 — — — — — — — CCP2IE ---- ---0 ---- ---0
PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
PIR2 — — — — — — — CCP2IF ---- ---0 ---- ---0
T1CON TMR1CS1 TMR1CS0 T1CKPS1 T1CKPS0 T1OSCEN T1SYNC — TMR1ON 0000 00-0 uuuu uu-u
T1GCON TMR1GE T1GPOL T1GTM T1GSPM T1GGO/ T1GVAL T1GSS1 T1GSS0 0000 0x00 0000 0x00
DONE
TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
TRISB TRISB7 TRISB6 TRISB5 TRISB4 TRISB3 TRISB2 TRISB1 TRISB0 1111 1111 1111 1111
TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 1111 1111
Legend: - = Unimplemented locations, read as ‘0’, u = unchanged, x = unknown. Shaded cells are not used by the Compare.
CCPxCON<5:4>
Duty Cycle Registers
CCPRxL
CCPRxH(2) (Slave)
CCPx
Comparator R Q
(1) S
TMR2
TRIS
Comparator
Clear Timer2,
toggle CCPx pin and
latch duty cycle
PR2
TXEN
TRMT SPEN
Baud Rate Generator FOSC
÷n
TX9
n
+1 Multiplier x4 x16 x64
TX9D
SYNC 1 0 0
SPBRG BRGH x 1 0
+1 n
Multiplier x4 x16 x64
SYNC 1 0 0
SPBRG BRGH x 1 0 FIFO
FERR RX9D RCREG Register
8
Data Bus
RCIF Interrupt
RCIE
Write to TXREG
Word 1
BRG Output
(Shift Clock)
TX/CK pin
Start bit bit 0 bit 1 bit 7/8 Stop bit
Word 1
TXIF bit
(Transmit Buffer 1 TCY
Empty Flag)
Word 1
TRMT bit Transmit Shift Reg
(Transmit Shift
Reg. Empty Flag)
Write to TXREG
Word 1 Word 2
BRG Output
(Shift Clock)
TX/CK pin
Start bit bit 0 bit 1 bit 7/8 Stop bit Start bit bit 0
TXIF bit
(Transmit Buffer 1 TCY Word 1 Word 2
Empty Flag)
1 TCY
TRMT bit Word 1 Word 2
(Transmit Shift Transmit Shift Reg.
Reg. Empty Flag) Transmit Shift Reg.
Note: When the SPEN bit is set the TX/CK I/O 16.1.2.3 Receive Interrupts
pin is automatically configured as an
The RCIF interrupt flag bit of the PIR1 register is set
output, regardless of the state of the
whenever the AUSART receiver is enabled and there is
corresponding TRIS bit and whether or not
an unread character in the receive FIFO. The RCIF
the AUSART transmitter is enabled. The
interrupt flag bit is read-only, it cannot be set or cleared
PORT latch is disconnected from the
by software.
output driver so it is not possible to use the
TX/CK pin as a general purpose output. RCIF interrupts are enabled by setting all of the
following bits:
• RCIE interrupt enable bit of the PIE1 register
• PEIE peripheral interrupt enable bit of the
INTCON register
• GIE global interrupt enable bit of the INTCON
register
The RCIF interrupt flag bit of the PIR1 register will be
set when there is an unread character in the FIFO,
regardless of the state of interrupt enable bits.
RCIF
(Interrupt Flag)
OERR bit
CREN
Note: This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after the third word,
causing the OERR (overrun) bit to be set.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
-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
Note 1: The AUSART module automatically changes the pin from tri-state to drive as needed. Configure
TRISx = 1.
SYNC = 0, BRGH = 0
FOSC = 8.000 MHz FOSC = 4.000 MHz FOSC = 3.6864 MHz FOSC = 1.000 MHz
BAUD
RATE SPBRG SPBRG SPBRG SPBRG
Actual % Actual % Actual % Actual %
value value value value
Rate Error Rate Error Rate Error Rate Error
(decimal) (decimal) (decimal) (decimal)
300 — — — 300 0.16 207 300 0.00 191 300 0.16 51
1200 1202 0.16 103 1202 0.16 51 1200 0.00 47 1202 0.16 12
2400 2404 0.16 51 2404 0.16 25 2400 0.00 23 — — —
9600 9615 0.16 12 — — — 9600 0.00 5 — — —
10417 10417 0.00 11 10417 0.00 5 — — — — — —
19.2k — — — — — — 19.20k 0.00 2 — — —
57.6k — — — — — — 57.60k 0.00 0 — — —
115.2k — — — — — — — — — — — —
SYNC = 0, BRGH = 1
BAUD FOSC = 20.000 MHz FOSC = 18.432 MHz FOSC = 16.0000 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.8k 2.12 16 57.60k 0.00 11
115.2k 113.64k -1.36 10 115.2k 0.00 9 — — — 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 — — —
RX/DT
pin bit 0 bit 1 bit 2 bit 7 bit 0 bit 1 bit 7
Word 1 Word 2
TX/CK pin
Write to
TXREG Reg Write Word 1 Write Word 2
TXIF bit
(Interrupt Flag)
TRMT bit
‘1’ ‘1’
TXEN bit
Note: Synchronous Master mode, SPBRG = 0, continuous transmission of two 8-bit words.
TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
RX/DT
pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7
TX/CK pin
(SCKP = 0)
TX/CK pin
(SCKP = 1)
Write to
bit SREN
SREN bit
RCIF bit
(Interrupt)
Read
RXREG
Note: Timing diagram demonstrates Synchronous Master mode with bit SREN = 1 and bit BRGH = 0.
• Master mode
• Slave mode
SPI is a full-duplex protocol, with all communication
being bidirectional and initiated by a master device. All
clocking is provided by the master device and all bits
are transmitted, MSb first. Care must be taken to
ensure that all devices on the SPI bus are setup to
allow all controllers to send and receive data at the
same time.
Slave Select
General I/O SS
Processor 1 (optional) Processor 2
Internal
Data Bus
Read Write
SSPBUF Reg
SSPSR Reg
SDI bit 0 bit 7
Shift
Clock
SDO
SS
RA5/SS Control
Enable
RA0/SS SSSEL
2
Clock Select
Edge
Select
÷2 TMR2
Output
Edge
Select Prescaler FOSC
SCK 4, 16, 64
TRISx 4
SSPM<3:0>
Write to
SSPBUF
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
4 Clock
SCK Modes
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
SDO
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
(CKE = 0)
SDO
bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
(CKE = 1)
SDI
(SMP = 0)
bit 7 bit 0
Input
Sample
(SMP = 0)
SDI
(SMP = 1)
bit 7 bit 0
Input
Sample
(SMP = 1)
SSPIF
SSPSR to
SSPBUF
SS
Optional
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
SDI
(SMP = 0)
bit 7 bit 0
Input
Sample
(SMP = 0)
SSPIF
Interrupt
Flag
SSPSR to
SSPBUF
SS
Not Optional
SCK
(CKP = 0
CKE = 1)
SCK
(CKP = 1
CKE = 1)
Write to
SSPBUF
SDI
(SMP = 0)
bit 7 bit 0
Input
Sample
(SMP = 0)
SSPIF
Interrupt
Flag
SSPSR to
SSPBUF
SS
SCK
(CKP = 0
CKE = 0)
SCK
(CKP = 1
CKE = 0)
Write to
SSPBUF
SSPSR must be reinitialized by writing to
the SSPBUF register before the data can
be clocked out of the slave again.
SDI bit 0
(SMP = 0)
bit 7 bit 7
Input
Sample
(SMP = 0)
SSPIF
Interrupt
Flag
SSPSR to
SSPBUF
REGISTER 17-1: SSPCON: SYNC SERIAL PORT CONTROL REGISTER (SPI MODE)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0
bit 7 bit 0
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
Note 1: When enabled, these pins must be properly configured as input or output.
REGISTER 17-2: SSPSTAT: SYNC SERIAL PORT STATUS REGISTER (SPI Mode)
R/W-0 R/W-0 R-0 R-0 R-0 R-0 R-0 R-0
SMP CKE D/A P S R/W UA BF
bit 7 bit 0
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
Two pins are used for data transfer; the SCL pin (clock SDA
line) and the SDA pin (data line). The user must SCL
configure the two pin's data direction bits as inputs in
the appropriate TRIS register. Upon enabling I2C (optional)
mode, the I2C slew rate limiters in the I/O pads are
controlled by the SMP bit of SSPSTAT register. The The SSP module has six registers for I2C operation.
SSP module functions are enabled by setting the They are:
SSPEN bit of SSPCON register.
• SSP Control (SSPCON) register
Data is sampled on the rising edge and shifted out on
• SSP Status (SSPSTAT) register
the falling edge of the clock. This ensures that the SDA
signal is valid during the SCL high time. The SCL clock • Serial Receive/Transmit Buffer (SSPBUF) register
input must have minimum high and low times for proper • SSP Shift Register (SSPSR), not directly
operation. Refer to Section 23.0 “Electrical Specifi- accessible
cations”. • SSP Address (SSPADD) register
• SSP Address Mask (SSPMSK) register
FIGURE 17-7: I2C™ MODE BLOCK
DIAGRAM 17.2.1 HARDWARE SETUP
Selection of I2C mode, with the SSPEN bit of the
Internal SSPCON register set, forces the SCL and SDA pins to
Data Bus
be open drain, provided these pins are programmed as
Read Write inputs by setting the appropriate TRISC bits. The SSP
module will override the input state with the output data,
SCL SSPBUF Reg when required, such as for Acknowledge and
slave-transmitter sequences.
Shift
Clock Note: Pull-up resistors must be provided
externally to the SCL and SDA pins for
SSPSR Reg
proper operation of the I2C module.
SDA MSb LSb
SSPMSK Reg
SSPADD Reg
Start and
Stop bit Detect
SDA
SCL
S P
Change of Change of
Data Allowed Data Allowed
Start Stop
Condition Condition
17.2.3 ACKNOWLEDGE In such a case, the SSPSR register value is not loaded
into the SSPBUF, but bit SSPIF of the PIR1 register is
After the valid reception of an address or data byte, the
set. Table 17-2 shows the results of when a data
hardware automatically will generate the Acknowledge
transfer byte is received, given the status of bits BF and
(ACK) pulse and load the SSPBUF register with the
SSPOV. Flag bit BF is cleared by reading the SSPBUF
received value currently in the SSPSR register. There
register, while bit SSPOV is cleared through software.
are certain conditions that will cause the SSP module
not to generate this ACK pulse. They include any or all
of the following:
• The Buffer Full bit, BF of the SSPSTAT register,
was set before the transfer was received.
• The SSP Overflow bit, SSPOV of the SSPCON
register, was set before the transfer was received.
• The SSP Module is being operated in Firmware
Master mode.
SCL 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
SSPOV
Bit SSPOV is set because the SSPBUF register is still full.
ACK is not sent.
SCL 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
S P
Bus master
sends Stop
SSPIF condition
BF
SSPBUF is written Dummy read of SSPBUF
with contents of SSPSR to clear BF flag
SSPOV
Preliminary
SSPOV is set
because SSPBUF is
still full. ACK is not sent.
UA
CKP
DS41341A-page 181
PIC16F72X/PIC16LF72X
PIC16F72X/PIC16LF72X
17.2.6 TRANSMISSION Following the 8th falling clock edge, control of the SDA
line is released back to the master so that the master
When the R/W bit of the received address byte is set
can acknowledge or not acknowledge the response. If
and an address match occurs, the R/W bit of the
the master sends a not acknowledge, the slave's
SSPSTAT register is set and the slave will respond to
transmission is complete and the slave must monitor for
the master by reading out data. After the address match,
the next Start condition. If the master acknowledges,
an ACK pulse is generated by the slave hardware and
control of the bus is returned to the slave to transmit
the SCL pin is held low (clock is automatically stretched)
another byte of data. Just as with the previous byte, the
until the slave is ready to respond. See Section 17.2.7
clock is stretched by the slave, data must be loaded into
“Clock Stretching”. The data the slave will transmit
the SSPBUF and CKP must be set to release the clock
must be loaded into the SSPBUF register, which sets
line (SCL).
the BF bit. The SCL line is released by setting the CKP
bit of the SSPCON register.
An SSP interrupt is generated for each transferred data
byte. The SSPIF flag bit of the PIR1 register initiates an
SSP interrupt, and must be cleared by software before
the next byte is transmitted. The BF bit of the SSPSTAT
register is cleared on the falling edge of the 8th
received clock pulse. The SSPIF flag bit is set on the
falling edge of the ninth clock pulse.
SCL 1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
S P
Data in SCL held low
sampled while CPU
responds to SSPIF
SSPIF Cleared in software
BF
SCL 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
S Sr P
SSPIF
BF
SSPBUF is written with Dummy read of SSPBUF Dummy read of SSPBUF Write of SSPBUF Completion of
Preliminary
contents of SSPSR to clear BF flag to clear BF flag Dummy read of SSPBUF data transmission
UA to clear BF flag clears BF flag
DS41341A-page 183
PIC16F72X/PIC16LF72X
PIC16F72X/PIC16LF72X
17.2.7 CLOCK STRETCHING Refer to Application Note AN554, “Software
2 Implementation of I2C™ Bus Master” (DS00554) for more
During any SCL low phase, any device on the I C bus
information.
may hold the SCL line low and delay, or pause, the
transmission of data. This “stretching” of a transmission
17.2.9 MULTI-MASTER MODE
allows devices to slow down communication on the
bus. The SCL line must be constantly sampled by the In Multi-Master mode, the interrupt generation on the
master to ensure that all devices on the bus have detection of the Start and Stop conditions allow the
released SCL for more data. determination of when the bus is free. The Stop (P) and
Start (S) bits are cleared from a Reset or when the SSP
Stretching usually occurs after an ACK bit of a
module is disabled. The Stop (P) and Start (S) bits will
transmission, delaying the first bit of the next byte. The
toggle based on the Start and Stop conditions. Control
SSP module hardware automatically stretches for two
of the I2C bus may be taken when the P bit of the
conditions:
SSPSTAT register is set or when the bus is Idle, and
• After a 10-bit address byte is received (update both the S and P bits are clear. When the bus is busy,
SSPADD register) enabling the SSP Interrupt will generate the interrupt
• Anytime the CKP bit of the SSPCON register is when the Stop condition occurs.
cleared by hardware In Multi-Master operation, the SDA line must be moni-
The module will hold SCL low until the CKP bit is set. tored to see if the signal level is the expected output
This allows the user slave software to update SSPBUF level. This check only needs to be done when a high
with data that may not be readily available. In 10-bit level is output. If a high level is expected and a low level
addressing modes, the SSPADD register must be is present, the device needs to release the SDA and
updated after receiving the first and second address SCL lines (set TRIS bits). There are two stages where
bytes. The SSP module will hold the SCL line low until this arbitration of the bus can be lost. They are the
the SSPADD has a byte written to it. The UA bit of the Address Transfer and Data Transfer stages.
SSPSTAT register will be set, along with SSPIF, When the slave logic is enabled, the slave continues to
indicating an address update is needed. receive. If arbitration was lost during the address
transfer stage, communication to the device may be in
17.2.8 FIRMWARE MASTER MODE progress. If addressed, an ACK pulse will be
Master mode of operation is supported in firmware generated. If arbitration was lost during the data
using interrupt generation on the detection of the Start transfer stage, the device will need to re-transfer the
and Stop conditions. The Stop (P) and Start (S) bits of data at a later time.
the SSPSTAT register are cleared from a Reset or Refer to Application Note AN578, “Use of the SSP
when the SSP module is disabled (SSPEN cleared). Module in the I2C™ Multi-Master Environment”
The Stop (P) and Start (S) bits will toggle based on the (DS00578) for more information.
Start and Stop conditions. Control of the I2C bus may
be taken when the P bit is set or the bus is Idle and both
the S and P bits are clear.
In Firmware Master mode, the SCL and SDA lines are
manipulated by setting/clearing the corresponding TRIS
bit(s). The output level is always low, irrespective of the
value(s) in the corresponding PORT register bit(s).
When transmitting a ‘1’, the TRIS bit must be set (input)
and a ‘0’, the TRIS bit must be clear (output).
The following events will cause the SSP Interrupt Flag
bit, SSPIF, to be set (SSP Interrupt will occur if
enabled):
• Start condition
• Stop condition
• Data transfer byte transmitted/received
Firmware Master Mode of operation can be done with
either the Slave mode Idle (SSPM<3:0> = 1011), or
with either of the Slave modes in which interrupts are
enabled. When both master and slave functionality is
enabled, the software needs to differentiate the
source(s) of the interrupt.
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
SDA DX DX-1
SCL
Master device
asserts clock
CKP
Master device
deasserts clock
WR
SSPCON
REGISTER 17-3: SSPCON: SYNCHRONOUS SERIAL PORT CONTROL REGISTER (I2C Mode)
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0
bit 7 bit 0
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
Note 1: When this mode is selected, any reads or writes to the SSPADD SFR address accesses the SSPMSK register.
2: When enabled, these pins must be properly configured as input or output using the associated TRIS bit.
REGISTER 17-4: SSPSTAT: SYNCHRONOUS SERIAL PORT STATUS REGISTER (I2C Mode)
R/W-0 R/W-0 R-0 R-0 R-0 R-0 R-0 R-0
SMP CKE D/A P S R/W UA BF
bit 7 bit 0
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’
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
INTCON GIE PEIE T0IE INTE RBIE T0IF INTF RBIF 0000 000x 0000 000u
PIR1 TMR1GIF ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
PIE1 TMR1GIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx uuuu uuuu
SSPADD Synchronous Serial Port (I2C mode) Address Register 0000 0000 0000 0000
SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 0000 0000
SSPMSK(2) Synchronous Serial Port (I2C mode) Address Mask Register 1111 1111 1111 1111
SSPSTAT SMP(1) CKE(1) D/A P S R/W UA BF 0000 0000 0000 0000
TRISC TRISC7 TRISC6 TRISC5 TRISC4 TRISC3 TRISC2 TRISC1 TRISC0 1111 1111 1111 1111
Legend: x = unknown, u = unchanged, - = unimplemented locations read as ‘0’. Shaded cells are not used by SSP module in I2C
mode.
Note 1: Maintain these bits clear in I2C mode.
2: Accessible only when SSPM<3:0> = 1001.
NOP
NOP ;Any instructions here are ignored as program
;memory is read in second cycle after BSF
BANKSEL PMDATL ;
MOVF PMDATL, W ;W = LS Byte of Program Memory Read
MOVWF LOWPMBYTE ;
MOVF PMDATH, W ;W = MS Byte of Program Memory Read
MOVWF HIGHPMBYTE ;
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
bit 7-0 PMD<7:0>: The value of the program memory word pointed to by PMADRH and PMADRL after a
program memory read command.
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
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1(1)
CLKOUT(4) TOST(2)
INT pin
INTF flag
(INTCON reg.) Interrupt Latency (3)
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) Dummy Cycle Dummy Cycle
Executed Inst(PC - 1) Inst(0004h)
External
Programming VDD Device to be
Signals Programmed
VDD VDD
10k
VPP MCLR/VPP
GND VSS
Data ICSPDAT
Clock ICSPCLK
* * *
To Normal Connections
Before Instruction
W = 0x07
After Instruction
W = value of k8
C=0 W>f
C=1 W≤f
DC = 0 W<3:0> > f<3:0>
DC = 1 W<3:0> ≤ f<3:0>
VDD
VPOR
VPORR
VSS
NPOR
POR REARM
VSS
TVLOW(2) TPOR(3)
— — 33 33 μA 5.0
* These parameters are characterized but not tested.
† Data in “Typ” column is at 5.0V, 25°C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: The peripheral current is the sum of the base IDD or IPD and the additional current consumed when this peripheral is
enabled. The peripheral Δ current can be determined by subtracting the base IDD or IPD current from this limit. Max
values should be used when calculating total current consumption.
2: The power-down current in Sleep mode does not depend on the oscillator type. Power-down current is measured with
the part in Sleep mode, with all I/O pins in high-impedance state and tied to VDD.
3: Fixed Voltage Reference is automatically enabled whenever the BOR is enabled
4: A/D oscillator source is FRC
5: 0.1 μs capacitor on VCAP (RA0).
TH01 θJA Thermal Resistance Junction to Ambient 60 °C/W 28-pin SPDIP package
80 °C/W 28-pin SOIC package
90 °C/W 28-pin SSOP package
27.5 °C/W 28-pin QFN 6x6mm package
47.2 °C/W 40-pin PDIP package
46 °C/W 44-pin TQFP package
24.4 °C/W 44-pin QFN 8x8mm package
TH02 θJC Thermal Resistance Junction to Case 31.4 °C/W 28-pin SPDIP package
24 °C/W 28-pin SOIC package
24 °C/W 28-pin SSOP package
24 °C/W 28-pin QFN 6x6mm package
24.7 °C/W 40-pin PDIP package
14.5 °C/W 44-pin TQFP package
20 °C/W 44-pin QFN 8x8mm package
TH03 TJMAX Maximum Junction Temperature 150 °C
TH04 PD Power Dissipation — W PD = PINTERNAL + PI/O
TH05 PINTERNAL Internal Power Dissipation — W PINTERNAL = IDD x VDD(1)
TH06 PI/O I/O Power Dissipation — W PI/O = Σ (IOL * VOL) + Σ (IOH * (VDD - VOH))
TH07 PDER Derated Power — W PDER = PDMAX (TJ - TA)/θJA(2)
Note 1: IDD is current to run the chip alone without driving any load on the output pins.
2: TA = Ambient Temperature
3: TJ = Junction Temperature
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 SDI sc SCK
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)
5.5
VDD (V)
3.6
2.5
HS Oscillator
2.3 Limit
2.0
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 23-1 for each Oscillator mode’s supported frequencies.
VDD (V)
3.6
2.5
HS Oscillator
2.3 Limit
2.0
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 23-1 for each Oscillator mode’s supported frequencies.
FIGURE 23-6: HFINTOSC FREQUENCY ACCURACY OVER DEVICE VDD AND TEMPERATURE
125
+ 5%
85
Temperature (°C)
60
± 2%
25
0
-20
+ 5%
-40
1.8 2.0 2.5 3.0 3.3(2) 3.5 4.0 4.5 5.0 5.5
VDD (V)
Note 1: This chart covers both regulator enabled and regulator disabled states.
2: Regulator Nominal voltage
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
FIGURE 23-8: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out 32
OSC
Start-Up Time
Internal Reset(1)
Watchdog Timer
Reset(1)
31/
34 31A
34
I/O pins
VDD
VBOR and VHYST
VBOR
TBORREJ
37
Reset
33(1)
(due to BOR)
Note 1: 64 ms delay only if PWRTE bit in the Configuration Word register is programmed to ‘0’. 2 ms
delay if PWRTE = 0 and VREGEN = 1.
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
A/D CLK
A/D Data 7 6 5 4 3 2 1 0
ADIF 1 TCY
GO DONE
Sampling Stopped
AD132
Sample
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
BSF ADCON0, GO
AD134 (TOSC/2 + TCY(1)) 1 TCY
AD131
Q4
AD130
A/D CLK
A/D Data 7 6 5 4 3 2 1 0
ADIF 1 TCY
GO DONE
Sampling Stopped
AD132
Sample
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts. This allows the
SLEEP instruction to be executed.
CK
US121 US121
DT
US120 US122
Param.
Symbol Characteristic Min. Max. Units Conditions
No.
US120 TCKH2DTV SYNC XMIT (Master and Slave) 3.0-5.5V — 80 ns
Clock high to data-out valid 1.8-5.5V — 100 ns
US121 TCKRF Clock out rise time and fall time 3.0-5.5V — 45 ns
(Master mode) 1.8-5.5V — 50 ns
US122 TDTRF Data-out rise time and fall time 3.0-5.5V — 45 ns
1.8-5.5V — 50 ns
CK
US125
DT
US126
SS
SP70
SCK
(CKP = 0)
SP71 SP72
SP78 SP79
SCK
(CKP = 1)
SP79 SP78
SP80
SP75, SP76
SP74
SP73
SS
SP81
SCK
(CKP = 0)
SP71 SP72
SP79
SP73
SCK
(CKP = 1)
SP80
SP78
SP75, SP76
SP74
SS
SP70
SCK SP83
(CKP = 0)
SP71 SP72
SP78 SP79
SCK
(CKP = 1)
SP79 SP78
SP80
SP74
SP73
SP82
SS
SP70
SCK SP83
(CKP = 0)
SP71 SP72
SCK
(CKP = 1)
SP80
SP77
SP75, SP76
SDI
MSb In bit 6 - - - -1 LSb In
SP74
SCL
SP91 SP93
SP90 SP92
SDA
Start Stop
Condition Condition
SP90* TSU:STA Start condition 100 kHz mode 4700 — — ns Only relevant for Repeated
Setup time 400 kHz mode 600 — — Start condition
SP91* THD:STA Start condition 100 kHz mode 4000 — — ns After this period, the first
Hold time 400 kHz mode 600 — — clock pulse is generated
SP92* TSU:STO Stop condition 100 kHz mode 4700 — — ns
Setup time 400 kHz mode 600 — —
SP93 THD:STO Stop condition 100 kHz mode 4000 — — ns
Hold time 400 kHz mode 600 — —
* These parameters are characterized but not tested.
SCL
SP90
SP106
SP107
SP91 SP92
SDA
In
SP110
SP109
SP109
SDA
Out
XXXXXXXXXXXXXXXXX PIC16F722
XXXXXXXXXXXXXXXXX -I/SP e3
YYWWNNN 0710017
XXXXXXXXXXXXXXXXXX PIC16F724
XXXXXXXXXXXXXXXXXX -I/P e3
XXXXXXXXXXXXXXXXXX 0710017
YYWWNNN
XXXXXXXX 16F722
XXXXXXXX -I/ML e3
YYWWNNN 0710017
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.
* Standard PICmicro® device marking consists of Microchip part number, year code, week code and
traceability code. For PICmicro device marking beyond this, certain price adders apply. Please check
with your Microchip Sales Office. For QTP devices, any special marking adders are included in QTP
price.
XXXXXXXXXX PIC16F724
XXXXXXXXXX -I/ML e3
XXXXXXXXXX 0710017
YYWWNNN
XXXXXXXXXXXXXXXXXXXX PIC16F722
XXXXXXXXXXXXXXXXXXXX -I/SO e3
XXXXXXXXXXXXXXXXXXXX
0710017
YYWWNNN
XXXXXXXXXXXX PIC16F722
XXXXXXXXXXXX -I/SS e3
YYWWNNN 0710017
XXXXXXXXXXX PIC16F727
XXXXXXXXXXX -I/PT e3
XXXXXXXXXXX 0710017
YYWWNNN
/HDG6NLQQ\3ODVWLF'XDO,Q/LQH63±PLO%RG\>63',3@
1RWH )RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
NOTE 1
E1
1 2 3
A A2
L c
A1 b1
b e eB
8QLWV ,1&+(6
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI3LQV 1
3LWFK H %6&
7RSWR6HDWLQJ3ODQH $ ± ±
0ROGHG3DFNDJH7KLFNQHVV $
%DVHWR6HDWLQJ3ODQH $ ± ±
6KRXOGHUWR6KRXOGHU:LGWK (
0ROGHG3DFNDJH:LGWK (
2YHUDOO/HQJWK '
7LSWR6HDWLQJ3ODQH /
/HDG7KLFNQHVV F
8SSHU/HDG:LGWK E
/RZHU/HDG:LGWK E
2YHUDOO5RZ6SDFLQJ H% ± ±
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
6LJQLILFDQW&KDUDFWHULVWLF
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGSHUVLGH
'LPHQVLRQLQJDQ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HGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
D1
E
e
E1
N
b
NOTE 1 1 2 3
NOTE 2
A α
c φ
β A1 A2
L L1
8QLWV 0,//,0(7(56
'LPHQVLRQ/LPLWV 0,1 120 0$;
1XPEHURI/HDGV 1
/HDG3LWFK H %6&
2YHUDOO+HLJKW $ ± ±
0ROGHG3DFNDJH7KLFNQHVV $
6WDQGRII $ ±
)RRW/HQJWK /
)RRWSULQW / 5()
)RRW$QJOH
2YHUDOO:LGWK ( %6&
2YHUDOO/HQJWK ' %6&
0ROGHG3DFNDJH:LGWK ( %6&
0ROGHG3DFNDJH/HQJWK ' %6&
/HDG7KLFNQHVV F ±
/HDG:LGWK E
0ROG'UDIW$QJOH7RS
0ROG'UDIW$QJOH%RWWRP
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
&KDPIHUVDWFRUQHUVDUHRSWLRQDOVL]HPD\YDU\
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
U
UA ..................................................................................... 187
Update Address bit, UA..................................................... 187
USART
Synchronous Master Mode
Requirements, Synchronous Receive............... 234
Requirements, Synchronous Transmission ...... 233
Timing Diagram, Synchronous Receive............ 234
Timing Diagram, Synchronous Transmission ... 233
V
VREF. SEE ADC Reference Voltage
W
Wake-up Using Interrupts ................................................. 194
Watchdog Timer (WDT) ...................................................... 35
Clock Source............................................................... 35
Modes ......................................................................... 36
Period.......................................................................... 35
Specifications ............................................................ 229
WCOL bit................................................................... 174, 186
WPUB Register ................................................................... 64
Write Collision Detect bit (WCOL)............................. 174, 186
WWW Address.................................................................. 255
WWW, On-Line Support...................................................... 12
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
10/05/07