Professional Documents
Culture Documents
PIC16F7X Data Sheet: 28/40-Pin, 8-Bit CMOS FLASH Microcontrollers
PIC16F7X Data Sheet: 28/40-Pin, 8-Bit CMOS FLASH Microcontrollers
PIC16F7X
Data Sheet
28/40-pin, 8-bit CMOS FLASH
Microcontrollers
• The PICmicro family meets the specifications contained in the Microchip Data Sheet.
• Microchip believes that its family of PICmicro microcontrollers is one of the most secure products 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 knowl-
edge, require using the PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be 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 product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
MCLR/VPP 1 28 RB7/PGD
RA0/AN0 2 27 RB6/PGC
RA1/AN1 3 26 RB5
RA2/AN2 4 25 RB4
PIC16F76/73
RA3/AN3/VREF 5 24 RB3/PGM
RA4/T0CKI 6 23 RB2
RA5/AN4/SS 7 22 RB1
VSS 8 21 RB0/INT
OSC1/CLKIN 9 20 VDD
OSC2/CLKOUT 10 19 VSS
RC0/T1OSO/T1CKI 11 18 RC7/RX/DT
RC1/T1OSI/CCP2 12 17 RC6/TX/CK
RC2/CCP1 13 16 RC5/SDO
RC3/SCK/SCL 14 15 RC4/SDI/SDA
MCLR/VPP
RB7/PGD
RB6/PGC
MLF
RA1/AN1
RA0/AN0
RB5
RB4
28 27 26 25 24 23 22
RA2/AN2 1 21 RB3/PGM
RA3/AN3/VREF 2 20 RB2
RA4/T0CKI 3 PIC16F73 19 RB1
RA5/AN4/SS 4 18 RB0/INT
VSS 5 PIC16F76 17 VDD
OSC1/CLKI 6 16 VSS
OSC2/CLKO 7 15 RC7/RX/DT
8 9 10 11 12 13 14
RC4/SDI/SDA
RC6/TX/CK
RC1/T1OSI/CCP2
RC2/CCP1
RC0/T1OSO/T1CKI
RC3/SCK/SCL
RC5/SDO
PDIP
MCLR/VPP 1 40 RB7/PGD
RA0/AN0 2 39 RB6/PGC
RA1/AN1 3 38 RB5
RA2/AN2 4 37 RB4
RA3/AN3/VREF 5 36 RB3/PGM
RA4/T0CKI 6 35 RB2
RA5/AN4/SS 7 34 RB1
PIC16F77/74
RE0/RD/AN5 8 33 RB0/INT
RE1/WR/AN6 9 32 VDD
RE2/CS/AN7 10 31 VSS
VDD 11 30 RD7/PSP7
VSS 12 29 RD6/PSP6
OSC1/CLKIN 13 28 RD5/PSP5
OSC2/CLKOUT 14 27 RD4/PSP4
RC0/T1OSO/T1CKI 15 26 RC7/RX/DT
RC1/T1OSI/CCP2 16 25 RC6/TX/CK
RC2/CCP1 17 24 RC5/SDO
RC3/SCK/SCL 18 23 RC4/SDI/SDA
RD0/PSP0 19 22 RD3/PSP3
RD1/PSP1 20 21 RD2/PSP2
PLCC
RA3/AN3/VREF
MCLR/VPP
RB7/PGD
RB6/PGC
RA2/AN2
RA1/AN1
RA0/AN0
RB5
RB4
NC
NC
6
5
4
3
2
1
44
43
42
41
40
RA4/T0CKI 7 39 RB3/PGM
RA5/AN4/SS 8 38 RB2
RE0/RD/AN5 9 37 RB1
RE1/WR/AN6 10 36 RB0/INT
RE2/CS/AN7 11 PIC16F77 35 VDD
VDD 12 34 VSS
VSS 13
PIC16F74 33 RD7/PSP7
OSC1/CLKIN 14 32 RD6/PSP6
OSC2/CLKOUT 15 31 RD5/PSP5
RC0/T1OSO/T1CK1 16 30 RD4/PSP4
NC 17 9 RC7/RX/DT
18
19
20
21
22
23
24
25
26
27
282
RC1/T1OSI/CCP2
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RC5/SDO
NC
RC4/SDI/SDA
RC6/TX/CK
QFP
RC1/T1OSI/CCP2
RC3/SCK/SCL
RC4/SDI/SDA
RC6/TX/CK
RC2/CCP1
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC5/SDO
NC
44
43
42
41
40
39
38
37
36
35
34
RC7/RX/DT 1 33 NC
RD4/PSP4 2 32 RC0/T1OSO/T1CKI
RD5/PSP5 3 31 OSC2/CLKOUT
RD6/PSP6 4 30 OSC1/CLKIN
RD7/PSP7 5 PIC16F77 29 VSS
VSS 6 28 VDD
VDD 7
PIC16F74 27 RE2/AN7/CS
RB0/INT 8 26 RE1/AN6/WR
RB1 9 25 RE0/AN5/RD
RB2 10 24 RA5/AN4/SS
RB3/PGM 11 23 RA4/T0CKI
12
13
14
15
16
17
18
19
20
21
22
RA1/AN1
NC
RB6/PGC
RB7/PGD
MCLR/VPP
RB5
RA0/AN0
RA2/AN2
RA3/AN3/VREF
NC
RB4
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)
• The Microchip Corporate Literature Center; U.S. FAX: (480) 792-7277
When contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (include liter-
ature number) you are using.
Synchronous
CCP1 CCP2 USART
Serial Port
RE0/AN5/RD
RE1/AN6/WR
RE2/AN7/CS
Synchronous
CCP1 CCP2 USART Parallel Slave Port
Serial Port
FIGURE 2-1: PROGRAM MEMORY MAPS AND STACKS FOR PIC16F7X DEVICES
PIC16F76/77 PIC16F73/74
PC<12:0> PC<12:0>
Page 0 Page 0
On-Chip
07FFh 07FFh
Program
0800h 0800h
Memory
On-Chip Page 1 Page 1
Program 0FFFh 0FFFh
1000h 1000h
Memory
Page 2
17FFh Unimplemented
1800h Read as ‘0’
Page 3
1FFFh 1FFFh
Indirect addr.(*) 00h Indirect addr.(*) 80h Indirect addr.(*) 100h Indirect addr.(*) 180h
TMR0 01h OPTION_REG 81h TMR0 101h OPTION_REG 181h
PCL 02h PCL 82h PCL 102h PCL 182h
STATUS 03h STATUS 83h STATUS 103h STATUS 183h
FSR 04h FSR 84h FSR 104h FSR 184h
PORTA 05h TRISA 85h 105h 185h
PORTB 06h TRISB 86h PORTB 106h TRISB 186h
PORTC 07h TRISC 87h 107h 187h
PORTD(1) 08h TRISD(1) 88h 108h 188h
PORTE(1) 09h TRISE(1) 89h 109h 189h
PCLATH 0Ah PCLATH 8Ah PCLATH 10Ah PCLATH 18Ah
INTCON 0Bh INTCON 8Bh INTCON 10Bh INTCON 18Bh
PIR1 0Ch PIE1 8Ch PMDATA 10Ch PMCON1 18Ch
PIR2 0Dh PIE2 8Dh PMADR 10Dh 18Dh
TMR1L 0Eh PCON 8Eh PMDATH 10Eh 18Eh
TMR1H 0Fh 8Fh PMADRH 10Fh 18Fh
T1CON 10h 90h 110h 190h
TMR2 11h 91h 111h 191h
T2CON 12h PR2 92h 112h 192h
SSPBUF 13h SSPADD 93h 113h 193h
SSPCON 14h SSPSTAT 94h 114h 194h
CCPR1L 15h 95h 115h 195h
CCPR1H 16h 96h 116h 196h
CCP1CON 17h 97h General 117h General 197h
Purpose Purpose
RCSTA 18h TXSTA 98h Register 118h Register 198h
TXREG 19h SPBRG 99h 16 Bytes 119h 16 Bytes 199h
RCREG 1Ah 9Ah 11Ah 19Ah
CCPR2L 1Bh 9Bh 11Bh 19Bh
CCPR2H 1Ch 9Ch 11Ch 19Ch
CCP2CON 1Dh 9Dh 11Dh 19Dh
ADRES 1Eh 9Eh 11Eh 19Eh
ADCON0 1Fh ADCON1 9Fh 11Fh 19Fh
20h A0h 120h 1A0h
Indirect addr.(*) 00h Indirect addr.(*) 80h Indirect addr.(*) 100h Indirect addr.(*) 180h
TMR0 01h OPTION_REG 81h TMR0 101h OPTION_REG 181h
PCL 02h PCL 82h PCL 102h PCL 182h
STATUS 03h STATUS 83h STATUS 103h STATUS 183h
FSR 04h FSR 84h FSR 104h FSR 184h
PORTA 05h TRISA 85h 105h 185h
PORTB 06h TRISB 86h PORTB 106h TRISB 186h
PORTC 07h TRISC 87h 107h 187h
PORTD(1) 08h TRISD(1) 88h 108h 188h
PORTE(1) 09h TRISE(1) 89h 109h 189h
PCLATH 0Ah PCLATH 8Ah PCLATH 10Ah PCLATH 18Ah
INTCON 0Bh INTCON 8Bh INTCON 10Bh INTCON 18Bh
PIR1 0Ch PIE1 8Ch PMDATA 10Ch PMCON1 18Ch
PIR2 0Dh PIE2 8Dh PMADR 10Dh 18Dh
TMR1L 0Eh PCON 8Eh PMDATH 10Eh 18Eh
TMR1H 0Fh 8Fh PMADRH 10Fh 18Fh
T1CON 10h 90h 110h 190h
TMR2 11h 91h
T2CON 12h PR2 92h
SSPBUF 13h SSPADD 93h
SSPCON 14h SSPSTAT 94h
CCPR1L 15h 95h
CCPR1H 16h 96h
CCP1CON 17h 97h
RCSTA 18h TXSTA 98h
TXREG 19h SPBRG 99h
RCREG 1Ah 9Ah
CCPR2L 1Bh 9Bh
CCPR2H 1Ch 9Ch
CCP2CON 1Dh 9Dh
ADRES 1Eh 9Eh
ADCON0 1Fh ADCON1 9Fh
120h 1A0h
20h A0h
General General
Purpose Purpose accesses accesses
Register Register
20h-7Fh A0h - FFh
96 Bytes 96 Bytes 16Fh 1EFh
170h 1F0h
04h(4) FSR Indirect Data Memory Address Pointer xxxx xxxx 27, 96
05h PORTA — — PORTA Data Latch when written: PORTA pins when read --0x 0000 32, 96
06h PORTB PORTB Data Latch when written: PORTB pins when read xxxx xxxx 34, 96
07h PORTC PORTC Data Latch when written: PORTC pins when read xxxx xxxx 35, 96
08h(5) PORTD PORTD Data Latch when written: PORTD pins when read xxxx xxxx 36, 96
0Ah(1,4) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 26, 96
0Bh(4) INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 21, 96
0Ch PIR1 PSPIF(3) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 23, 96
0Dh PIR2 — — — — — — — CCP2IF ---- ---0 24, 96
0Eh TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx 50, 96
0Fh TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx 50, 96
10h T1CON — — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 47, 96
11h TMR2 Timer2 Module Register 0000 0000 52, 96
12h T2CON — TOUTPS3 TOUTPS2 TOUTPS TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 52, 96
13h SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx 64, 68, 96
14h SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 61, 96
15h CCPR1L Capture/Compare/PWM Register1 (LSB) xxxx xxxx 56, 96
16h CCPR1H Capture/Compare/PWM Register1 (MSB) xxxx xxxx 56, 96
17h CCP1CON — — CCP1X CCP1Y CCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 54, 96
18h RCSTA SPEN RX9 SREN CREN — FERR OERR RX9D 0000 -00x 70, 96
19h TXREG USART Transmit Data Register 0000 0000 74, 96
1Ah RCREG USART Receive Data Register 0000 0000 76, 96
1Bh CCPR2L Capture/Compare/PWM Register2 (LSB) xxxx xxxx 58, 96
1Ch CCPR2H Capture/Compare/PWM Register2 (MSB) xxxx xxxx 58, 96
1Dh CCP2CON — — CCP2X CCP2Y CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 54, 96
1Eh ADRES A/D Result Register Byte xxxx xxxx 88, 96
GO/
1Fh ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 — ADON 0000 00-0 83, 96
DONE
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 during branches (CALL or GOTO).
2: Other (non power-up) RESETS include external RESET through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the 28-pin devices; always maintain these bits clear.
4: These registers can be addressed from any bank.
5: PORTD, PORTE, TRISD, and TRISE are not physically implemented on the 28-pin devices, read as ‘0’.
6: This bit always reads as a ‘1’.
84h(4) FSR Indirect data memory address pointer xxxx xxxx 27, 96
85h TRISA — — PORTA Data Direction Register --11 1111 32, 96
86h TRISB PORTB Data Direction Register 1111 1111 34, 96
87h TRISC PORTC Data Direction Register 1111 1111 35, 96
88h(5) TRISD PORTD Data Direction Register 1111 1111 36, 96
89h(5) TRISE IBF OBF IBOV PSPMODE — PORTE Data Direction Bits 0000 -111 38, 96
8Ah(1,4) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 21, 96
8Bh(4) INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 23, 96
8Ch PIE1 PSPIE(3) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 22, 96
8Dh PIE2 — — — — — — — CCP2IE ---- ---0 24, 97
8Eh PCON — — — — — — POR BOR ---- --qq 25, 97
8Fh — Unimplemented — —
90h — Unimplemented — —
91h — Unimplemented — —
92h PR2 Timer2 Period Register 1111 1111 52, 97
93h SSPADD Synchronous Serial Port (I2C mode) Address Register 0000 0000 68, 97
94h SSPSTAT SMP CKE D/A P S R/W UA BF 0000 0000 60, 97
95h — Unimplemented — —
96h — Unimplemented — —
97h — Unimplemented — —
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 69, 97
99h SPBRG Baud Rate Generator Register 0000 0000 71, 97
9Ah — Unimplemented —
9Bh — Unimplemented —
9Ch — Unimplemented —
9Dh — Unimplemented —
9Eh — Unimplemented —
9Fh ADCON1 — — — — — PCFG2 PCFG1 PCFG0 ---- -000 84, 97
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 during branches (CALL or GOTO).
2: Other (non power-up) RESETS include external RESET through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the 28-pin devices; always maintain these bits clear.
4: These registers can be addressed from any bank.
5: PORTD, PORTE, TRISD, and TRISE are not physically implemented on the 28-pin devices, read as ‘0’.
6: This bit always reads as a ‘1’.
104h(4) FSR Indirect Data Memory Address Pointer xxxx xxxx 27, 96
105h — Unimplemented — —
106h PORTB PORTB Data Latch when written: PORTB pins when read xxxx xxxx 34, 96
107h — Unimplemented — —
108h — Unimplemented — —
109h — Unimplemented — —
10Ah(1,4) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 21, 96
10Bh(4) INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 23, 96
10Ch PMDATA Data Register Low Byte xxxx xxxx 29, 97
10Dh PMADR Address Register Low Byte xxxx xxxx 29, 97
10Eh PMDATH — — Data Register High Byte xxxx xxxx 29, 97
10Fh PMADRH — — — Address Register High Byte xxxx xxxx 29, 97
Bank 3
180h(4) INDF Addressing this location uses contents of FSR to address data memory (not a physical register) 0000 0000 27, 96
181h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 20, 44, 96
182h(4) PCL Program Counter (PC) Least Significant Byte 0000 0000 26, 96
184h(4) FSR Indirect Data Memory Address Pointer xxxx xxxx 27, 96
185h — Unimplemented — —
186h TRISB PORTB Data Direction Register 1111 1111 34, 96
187h — Unimplemented — —
188h — Unimplemented — —
189h — Unimplemented — —
18Ah(1,4) PCLATH — — — Write Buffer for the upper 5 bits of the Program Counter ---0 0000 21, 96
18Bh(4) INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 23, 96
18Ch PMCON1 (6) — — — — — — RD 1--- ---0 29, 97
—
18Dh — Unimplemented —
18Eh — Reserved maintain clear 0000 0000
18Fh — Reserved maintain clear 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: 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 during branches (CALL or GOTO).
2: Other (non power-up) RESETS include external RESET through MCLR and Watchdog Timer Reset.
3: Bits PSPIE and PSPIF are reserved on the 28-pin devices; always maintain these bits clear.
4: These registers can be addressed from any bank.
5: PORTD, PORTE, TRISD, and TRISE are not physically implemented on the 28-pin devices, read as ‘0’.
6: This bit always reads as a ‘1’.
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 RP1:RP0: Register Bank Select bits (used for direct addressing)
11 = Bank 3 (180h - 1FFh)
10 = Bank 2 (100h - 17Fh)
01 = Bank 1 (80h - FFh)
00 = Bank 0 (00h - 7Fh)
Each bank is 128 bytes
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/borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the 4th low order bit of the result occurred
0 = No carry-out from the 4th low order bit of the result
bit 0 C: Carry/borrow bit (ADDWF, ADDLW, SUBLW, SUBWF instructions)
1 = A carry-out from the Most Significant bit of the result occurred
0 = No carry-out from the Most Significant bit of the result occurred
Note: 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 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 reset ’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 reset ’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 reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
Note 1: PSPIE is reserved on 28-pin devices; always maintain this bit clear.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’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 reset ’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 reset ’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 reset ’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 reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
PCLATH
Example 2-1 shows the calling of a subroutine in
page 1 of the program memory. This example assumes
that PCLATH is saved and restored by the Interrupt
Service Routine (if interrupts are used).
2.3.1 COMPUTED GOTO
A computed GOTO is accomplished by adding an offset EXAMPLE 2-1: CALL OF A SUBROUTINE
to the program counter (ADDWF PCL). When doing a IN PAGE 1 FROM PAGE 0
table read using a computed GOTO method, care ORG 0x500
should be exercised if the table location crosses a PCL BCF PCLATH,4
memory boundary (each 256 byte block). Refer to the BSF PCLATH,3 ;Select page 1
Application Note, “Implementing a Table Read" ;(800h-FFFh)
(AN556). CALL SUB1_P1 ;Call subroutine in
: ;page 1 (800h-FFFh)
2.3.2 STACK :
ORG 0x900 ;page 1 (800h-FFFh)
The PIC16F7X family has an 8-level deep x 13-bit wide SUB1_P1
hardware stack. The stack space is not part of either : ;called subroutine
program or data space and the stack pointer is not : ;page 1 (800h-FFFh)
readable or writable. The PC is PUSHed onto the stack :
RETURN ;return to Call
when a CALL instruction is executed, or an interrupt
;subroutine in page 0
causes a branch. The stack is POPed in the event of a ;(000h-7FFh)
RETURN, RETLW or a RETFIE instruction execution.
PCLATH is not affected by a PUSH or POP operation.
The stack operates as a circular buffer. This means that
after the stack has been PUSHed eight times, the ninth
push overwrites the value that was stored from the first
push. The tenth push overwrites the second push (and
so on).
Data
Memory(1)
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
05h PORTA — — RA5 RA4 RA3 RA2 RA1 RA0 --0x 0000 --0u 0000
85h TRISA — — PORTA Data Direction Register --11 1111 --11 1111
9Fh ADCON1 — — — — — PCFG2 PCFG1 PCFG0 ---- -000 ---- -000
Legend: x = unknown, u = unchanged, - = unimplemented locations read as '0'. Shaded cells are not used by PORTA.
Note: When using the SSP module in SPI Slave mode and SS enabled, the A/D converter must be set to one of
the following modes where PCFG2:PCFG0 = 100, 101, 11x.
TRIS Latch
RB0/INT D Q
06h, 106h PORTB RB7 RB6 RB5 RB4 RB3 RB2 RB1 RB0 xxxx xxxx uuuu uuuu
86h, 186h TRISB PORTB Data Direction Register 1111 1111 1111 1111
81h, 181h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0 1111 1111 1111 1111
Legend: x = unknown, u = unchanged. Shaded cells are not used by PORTB.
07h PORTC RC7 RC6 RC5 RC4 RC3 RC2 RC1 RC0 xxxx xxxx uuuu uuuu
87h TRISC PORTC Data Direction Register 1111 1111 1111 1111
Legend: x = unknown, u = unchanged
RD TRIS
Q D
ENEN
RD Port
08h PORTD RD7 RD6 RD5 RD4 RD3 RD2 RD1 RD0 xxxx xxxx uuuu uuuu
88h TRISD PORTD Data Direction Register 1111 1111 1111 1111
89h TRISE IBF OBF IBOV PSPMODE — PORTE Data Direction bits 0000 -111 0000 -111
Legend: x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PORTD.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CS
WR
RD
PORTD<7:0>
IBF
OBF
PSPIF
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
CS
WR
RD
PORTD<7:0>
IBF
OBF
PSPIF
08h PORTD Port data latch when written: Port pins when read xxxx xxxx uuuu uuuu
09h PORTE — — — — — RE2 RE1 RE0 ---- -xxx ---- -uuu
89h TRISE IBF OBF IBOV PSPMODE — PORTE Data Direction Bits 0000 -111 0000 -111
0Ch PIR1 PSPIF (1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
8Ch PIE1 PSPIE (1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
9Fh ADCON1 — — — — — PCFG2 PCFG1 PCFG0 ---- -000 ---- -000
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by the Parallel Slave Port.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
8
M 1
0
RA4/T0CKI U M
X SYNC
pin U 2 TMR0 reg
1 0
X Cycles
T0SE
T0CS
PSA Set Flag bit TMR0IF
on Overflow
PRESCALER
0
M 8-bit Prescaler
U
1 X
Watchdog 8
Timer
8 - to - 1MUX PS2:PS0
PSA
0 1
WDT Enable bit
MUX PSA
WDT
Time-out
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’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 reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
T1CKI
(Default high)
T1CKI
(Default low)
6.3 Timer1 Operation in Synchronized If T1SYNC is cleared, then the external clock input is
Counter Mode synchronized with internal phase clocks. The synchro-
nization is done after the prescaler stage. The pres-
Counter mode is selected by setting bit TMR1CS. In caler stage is an asynchronous ripple counter.
this mode, the timer increments on every rising edge of
In this configuration, during SLEEP mode, Timer1 will
clock input on pin RC1/T1OSI/CCP2, when bit
not increment even if the external clock is present,
T1OSCEN is set, or on pin RC0/T1OSO/T1CKI, when
since the synchronization circuit is shut-off. The
bit T1OSCEN is cleared.
prescaler, however, will continue to increment.
Note 1: When the T1OSCEN bit is cleared, the inverter is turned off. This eliminates power drain.
2: For the PIC16F73/76, the Schmitt Trigger is not implemented in External Clock mode.
0Bh,8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
0Eh TMR1L Holding register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
0Fh TMR1H Holding register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
10h T1CON — — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by the Timer1 module.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
The Timer2 module has an 8-bit period register, PR2. 7.2 Output of TMR2
Timer2 increments from 00h until it matches PR2 and
then resets to 00h on the next increment cycle. PR2 is The output of TMR2 (before the postscaler) is fed to the
a readable and writable register. The PR2 register is SSP module, which optionally uses it to generate shift
initialized to FFh upon RESET. clock.
The match output of TMR2 goes through a 4-bit FIGURE 7-1: TIMER2 BLOCK DIAGRAM
postscaler (which gives a 1:1 to 1:16 scaling inclusive)
to generate a TMR2 interrupt (latched in flag bit Sets Flag
TMR2 (1)
TMR2IF, (PIR1<1>)). bit TMR2IF Output
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
0Bh,8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh, 18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
11h TMR2 Timer2 Module Register 0000 0000 0000 0000
12h T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
92h PR2 Timer2 Period Register 1111 1111 1111 1111
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by the Timer2 module.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
TMR1H TMR1L
FIGURE 8-2: COMPARE MODE
CCP1CON<3:0> OPERATION BLOCK
Q’s DIAGRAM
CCP1CON<3:0>
Mode Select
8.3.2 TIMER1 MODE SELECTION
Timer1 must be running in Timer mode or Synchro- Set Flag bit CCP1IF
(PIR1<2>)
nized Counter mode for the CCP module to use the
capture feature. In Asynchronous Counter mode, the CCPR1H CCPR1L
0Bh,8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
87h TRISC PORTC Data Direction Register 1111 1111 1111 1111
0Eh TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
0Fh TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
10h T1CON — — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
17h CCP1CON — — CCP1X CCP1Y CCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 --00 0000
1Dh CCP2CON — — CCP2X CCP2Y CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 --00 0000
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by Capture and Timer1.
Note 1: The PSP is not implemented on the PIC16F73/76; always maintain these bits clear.
CCPR1H (Slave)
The PWM duty cycle is specified by writing to the
CCPR1L register and to the CCP1CON<5:4> bits. Up
to 10-bit resolution is available. The CCPR1L contains
Comparator R Q
the eight MSbs and the CCP1CON<5:4> contains the
RC2/CCP1 two LSbs. This 10-bit value is represented by
TMR2 (1) CCPR1L:CCP1CON<5:4>. The following equation is
S
(Note 1) used to calculate the PWM duty cycle in time:
TRISC<2> PWM duty cycle = (CCPR1L:CCP1CON<5:4>) •
Comparator
Clear Timer, TOSC • (TMR2 prescale value)
CCP1 pin and
PR2
latch D.C. CCPR1L and CCP1CON<5:4> can be written to at any
time, but the duty cycle value is not latched into
Note 1: The 8-bit timer is concatenated with the 2-bit inter-
CCPR1H until after a match between PR2 and TMR2
nal Q clock or the 2 bits of the prescaler to create the occurs (i.e., the period is complete). In PWM mode,
10-bit time-base. CCPR1H is a read only register.
A PWM output (Figure 8-4) has a time-base (period) The CCPR1H register and a 2-bit internal latch are
and a time that the output stays high (duty cycle). The used to double buffer the PWM duty cycle. This double
frequency of the PWM is the inverse of the period buffering is essential for glitchless PWM operation.
(1/period). When the CCPR1H and 2-bit latch match TMR2, con-
catenated with an internal 2-bit Q clock or 2 bits of the
FIGURE 8-4: PWM OUTPUT TMR2 prescaler, the CCP1 pin is cleared.
TMR2 TMR2
The maximum PWM resolution (bits) for a given PWM
RESET RESET frequency is given by the formula:
Period
(FOSC
log FPWM )
Resolution = bits
log(2)
Duty Cycle
Note: If the PWM duty cycle value is longer than
TMR2 = PR2
the PWM period, the CCP1 pin will not be
TMR2 = Duty Cycle cleared.
TMR2 = PR2
PWM Frequency 1.22 kHz 4.88 kHz 19.53 kHz 78.12 kHz 156.3 kHz 208.3 kHz
Timer Prescale (1, 4, 16) 16 4 1 1 1 1
PR2 Value 0xFF 0xFF 0xFF 0x3F 0x1F 0x17
Maximum Resolution (bits) 10 10 10 8 7 5.5
0Bh,8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
0Dh PIR2 — — — — — — — CCP2IF ---- ---0 ---- ---0
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
8Dh PIE2 — — — — — — — CCP2IE ---- ---0 ---- ---0
87h TRISC PORTC Data Direction Register 1111 1111 1111 1111
11h TMR2 Timer2 Module Register 0000 0000 0000 0000
92h PR2 Timer2 Module Period Register 1111 1111 1111 1111
12h T2CON — TOUTPS3 TOUTPS2 TOUTPS1 TOUTPS0 TMR2ON T2CKPS1 T2CKPS0 -000 0000 -000 0000
15h CCPR1L Capture/Compare/PWM Register1 (LSB) xxxx xxxx uuuu uuuu
16h CCPR1H Capture/Compare/PWM Register1 (MSB) xxxx xxxx uuuu uuuu
17h CCP1CON — — CCP1X CCP1Y CCP1M3 CCP1M2 CCP1M1 CCP1M0 --00 0000 --00 0000
1Bh CCPR2L Capture/Compare/PWM Register2 (LSB) xxxx xxxx uuuu uuuu
1Ch CCPR2H Capture/Compare/PWM Register2 (MSB) xxxx xxxx uuuu uuuu
1Dh CCP2CON — — CCP2X CCP2Y CCP2M3 CCP2M2 CCP2M1 CCP2M0 --00 0000 --00 0000
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by PWM and Timer2.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’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 reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
2
2: If the SPI is used in Slave mode with
Clock Select CKE = '1', then the SS pin control must be
enabled.
SSPM3:SSPM0
3: When the SPI is in Slave mode with SS
TMR2 Output
4 2 pin control enabled (SSPCON<3:0> =
‘0100’), the state of the SS pin can affect
Edge
Select the state read back from the TRISC<5>
Prescaler TCY bit. The Peripheral OE signal from the
RC3/SCK/ 4, 16, 64
SCL TRISC<3> SSP module into PORTC controls the
state that is read back from the
TRISC<5> bit (see Section 4.3 for infor-
mation on PORTC). If Read-Modify-Write
instructions, such as BSF are performed
on the TRISC register while the SS pin is
high, this will cause the TRISC<5> bit to
be set, thus disabling the SDO output.
SCK (CKP = 0,
CKE = 0)
SCK (CKP = 0,
CKE = 1)
SCK (CKP = 1,
CKE = 0)
SCK (CKP = 1,
CKE = 1)
SDI (SMP = 0)
bit7 bit0
SDI (SMP = 1)
bit7 bit0
SSPIF
SCK (CKP = 0)
SCK (CKP = 1)
SDI (SMP = 0)
bit7 bit0
SSPIF
SCK (CKP = 0)
SCK (CKP = 1)
SDI (SMP = 0)
bit7 bit0
SSPIF
0Bh,8Bh. INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
87h TRISC PORTC Data Direction Register 1111 1111 1111 1111
13h SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx uuuu uuuu
14h SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 0000 0000
85h TRISA — — PORTA Data Direction Register --11 1111 --11 1111
94h SSPSTAT SMP CKE D/A P S R/W UA BF 0000 0000 0000 0000
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used by the SSP in SPI mode.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
Set, RESET There are certain conditions that will cause the SSP
START and
STOP bit Detect S, P bits module not to give this ACK pulse. They include (either
(SSPSTAT reg) or both):
a) The buffer full bit BF (SSPSTAT<0>) was set
before the transfer was received.
The SSP module has five registers for I2C operation.
These are the: b) The overflow bit SSPOV (SSPCON<6>) was set
before the transfer was received.
• SSP Control Register (SSPCON)
In this case, the SSPSR register value is not loaded
• SSP Status Register (SSPSTAT)
into the SSPBUF, but bit SSPIF (PIR1<3>) is set.
• Serial Receive/Transmit Buffer (SSPBUF) Table 9-2 shows what happens when a data transfer
• SSP Shift Register (SSPSR) - Not directly accessible byte is received, given the status of bits BF and
• SSP Address Register (SSPADD) SSPOV. The shaded cells show the condition where
user software did not properly clear the overflow condi-
tion. Flag bit BF is cleared by reading the SSPBUF reg-
ister, while bit SSPOV is cleared through software.
The SCL clock input must have a minimum high and
low for proper operation. The high and low times of the
I2C specification, as well as the requirements of the
SSP module, are shown in timing parameter #100 and
parameter #101.
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 (SSPCON<6>)
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
S P
Data in SCL held low
sampled while CPU
responds to SSPIF
SSPIF (PIR1<3>) Cleared in software
BF (SSPSTAT<0>)
From SSP Interrupt
SSPBUF is written in software Service Routine
CKP (SSPCON<4>)
0Bh, 8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
13h SSPBUF Synchronous Serial Port Receive Buffer/Transmit Register xxxx xxxx uuuu uuuu
93h SSPADD Synchronous Serial Port (I2C mode) Address Register 0000 0000 0000 0000
14h SSPCON WCOL SSPOV SSPEN CKP SSPM3 SSPM2 SSPM1 SSPM0 0000 0000 0000 0000
94h SSPSTAT SMP(2) CKE(2) D/A P S R/W UA BF 0000 0000 0000 0000
87h TRISC PORTC Data Direction Register 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: PSPIF and PSPIE are reserved on the PIC16F73/76; always maintain these bits clear.
2: Maintain these bits clear in I2C mode.
REGISTER 10-1: TXSTA: TRANSMIT STATUS AND CONTROL REGISTER (ADDRESS 98h)
R/W-0 R/W-0 R/W-0 R/W-0 U-0 R/W-0 R-1 R/W-0
CSRC TX9 TXEN SYNC — BRGH TRMT TX9D
bit 7 bit 0
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’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 reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
1200 1,221 1.73% 255 1,202 0.16% 207 1,202 0.16% 129
2400 2,404 0.16% 129 2,404 0.16% 103 2,404 0.16% 64
9600 9,470 -1.36% 32 9,615 0.16% 25 9,766 1.73% 15
19,200 19,531 1.73% 15 19,231 0.16% 12 19,531 1.73% 7
38,400 39,063 1.73% 7 35,714 -6.99% 6 39,063 1.73% 3
57,600 62,500 8.51% 4 62,500 8.51% 3 52,083 -9.58% 2
76,800 78,125 1.73% 3 83,333 8.51% 2 78,125 1.73% 1
96,000 104,167 8.51% 2 83,333 -13.19% 2 78,125 -18.62% 1
115,200 104,167 -9.58% 2 125,000 8.51% 1 78,125 -32.18% 1
250,000 312,500 25.00% 0 250,000 0.00% 0 156,250 -37.50% 0
300 300 0.16% 207 300 0.00% 191 301 0.23% 185
1200 1,202 0.16% 51 1,200 0.00% 47 1,190 -0.83% 46
2400 2,404 0.16% 25 2,400 0.00% 23 2,432 1.32% 22
9600 8,929 -6.99% 6 9,600 0.00% 5 9,322 -2.90% 5
19,200 20,833 8.51% 2 19,200 0.00% 2 18,643 -2.90% 2
38,400 31,250 -18.62% 1 28,800 -25.00% 1 27,965 -27.17% 1
57,600 62,500 8.51% 0 57,600 0.00% 0 55,930 -2.90% 0
76,800 62,500 -18.62% 0 — — — — — —
1200 1,202 0.16% 207 1,200 0.00% 191 1,203 0.23% 185
2400 2,404 0.16% 103 2,400 0.00% 95 2,406 0.23% 92
9600 9,615 0.16% 25 9,600 0.00% 23 9,727 1.32% 22
19,200 19,231 0.16% 12 19,200 0.00% 11 18,643 -2.90% 11
38,400 35,714 -6.99% 6 38,400 0.00% 5 37,287 -2.90% 5
57,600 62,500 8.51% 3 57,600 0.00% 3 55,930 -2.90% 3
76,800 83,333 8.51% 2 76,800 0.00% 2 74,574 -2.90% 2
96,000 83,333 -13.19% 2 115,200 20.00% 1 111,861 16.52% 1
115,200 125,000 8.51% 1 115,200 0.00% 1 111,861 -2.90% 1
250,000 250,000 0.00% 0 230,400 -7.84% 0 223,722 -10.51% 0
Write to TXREG
Word 1
BRG Output
(Shift Clock)
RC6/TX/CK (pin)
START Bit Bit 0 Bit 1 Bit 7/8 STOP Bit
Word 1
TXIF bit
(Transmit Buffer
Reg. Empty Flag)
0Bh, 8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
18h RCSTA SPEN RX9 SREN CREN — FERR OERR RX9D 0000 -00x 0000 -00x
19h TXREG USART Transmit Register 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 0000 -010
99h SPBRG Baud Rate Generator Register 0000 0000 0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for asynchronous transmission.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
RC7/RX/DT
Pin Buffer Data
and Control Recovery RX9
Interrupt RCIF
Data Bus
RCIE
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. An overrun error indicates an error in user firmware.
Steps to follow when setting up an Asynchronous 6. Flag bit RCIF will be set when reception is com-
Reception: plete and an interrupt will be generated if enable
1. Initialize the SPBRG register for the appropriate bit RCIE is set.
baud rate. If a high speed baud rate is desired, 7. Read the RCSTA register to get the ninth bit (if
set bit BRGH (Section 10.1). enabled) and determine if any error occurred
2. Enable the asynchronous serial port by clearing during reception.
bit SYNC and setting bit SPEN. 8. Read the 8-bit received data by reading the
3. If interrupts are desired, then set enable bit RCREG register.
RCIE. 9. If any error occurred, clear the error by clearing
4. If 9-bit reception is desired, then set bit RX9. enable bit CREN.
5. Enable the reception by setting bit CREN. 10. If using interrupts, ensure that GIE and PEIE in
the INTCON register are set.
0Bh, 8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
18h RCSTA SPEN RX9 SREN CREN — FERR OERR RX9D 0000 -00x 0000 -00x
1Ah RCREG USART Receive Register 0000 0000 0000 0000
(1)
8Ch PIE1 PSPIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 0000 -010
99h SPBRG Baud Rate Generator Register 0000 0000 0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for asynchronous reception.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76 devices; always maintain these bits clear.
Q1Q2 Q3Q4 Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2 Q3Q4 Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4
TRMTTRMT
bit
’1’ ’1’
TXEN bit
Note: Sync Master mode; SPBRG = ’0’. Continuous transmission of two 8-bit words.
RC6/TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
0Bh, 8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
18h RCSTA SPEN RX9 SREN CREN — FERR OERR RX9D 0000 -00x 0000 -00x
19h TXREG USART Transmit Register 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 0000 -010
99h SPBRG Baud Rate Generator Register 0000 0000 0000 0000
Legend: x = unknown, - = unimplemented, read as '0'. Shaded cells are not used for synchronous master transmission.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76 devices; always maintain these bits clear.
RC7/RX/DT pin bit0 bit1 bit2 bit3 bit4 bit5 bit6 bit7
RC6/TX/CK pin
Write to
bit SREN
SREN bit
RCIF bit
(Interrupt)
Read
RXREG
Note: Timing diagram demonstrates Sync Master mode with bit SREN = ’1’ and bit BRG = ’0’.
10.4 USART Synchronous Slave Mode Follow these steps when setting up a Synchronous
Slave Transmission:
Synchronous Slave mode differs from the Master
mode, in that the shift clock is supplied externally at the 1. Enable the synchronous slave serial port by set-
RC6/TX/CK pin (instead of being supplied internally in ting bits SYNC and SPEN and clearing bit
Master mode). This allows the device to transfer or CSRC.
receive data while in SLEEP mode. Slave mode is 2. Clear bits CREN and SREN.
entered by clearing bit CSRC (TXSTA<7>). 3. If interrupts are desired, then set enable bit
TXIE.
10.4.1 USART SYNCHRONOUS SLAVE 4. If 9-bit transmission is desired, then set bit TX9.
TRANSMIT 5. Enable the transmission by setting enable bit
The operation of the Synchronous Master and Slave TXEN.
modes are identical except in the case of the SLEEP 6. If 9-bit transmission is selected, the ninth bit
mode. should be loaded in bit TX9D.
If two words are written to the TXREG and then the 7. Start transmission by loading data to the TXREG
SLEEP instruction is executed, the following will occur: register.
a) The first word will immediately transfer to the 8. If using interrupts, ensure that GIE and PEIE in
TSR register and transmit when the master the INTCON register are set.
device drives the CK line.
b) The second word will remain in TXREG register.
c) Flag bit TXIF will not be set.
d) When the first word has been shifted out of TSR,
the TXREG register will transfer the second
word to the TSR and flag bit TXIF will now be
set.
e) If enable bit TXIE is set, the interrupt will wake
the chip from SLEEP and if the global interrupt
is enabled, the program will branch to the inter-
rupt vector (0004h).
0Bh, 8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
18h RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x
19h TXREG USART Transmit Register 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 0000 -010
99h SPBRG Baud Rate Generator Register 0000 0000 0000 0000
Legend: x = unknown, - = unimplemented, read as '0'. Shaded cells are not used for synchronous slave transmission.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76 devices; always maintain these bits clear.
10.4.2 USART SYNCHRONOUS SLAVE Follow these steps when setting up a Synchronous
RECEPTION Slave Reception:
The operation of the Synchronous Master and Slave 1. Enable the synchronous master serial port by
modes is identical, except in the case of the SLEEP setting bits SYNC and SPEN and clearing bit
mode. Bit SREN is a “don't care” in Slave mode. CSRC.
2. If interrupts are desired, set enable bit RCIE.
If receive is enabled by setting bit CREN prior to the
SLEEP instruction, then a word may be received during 3. If 9-bit reception is desired, set bit RX9.
SLEEP. On completely receiving the word, the RSR 4. To enable reception, set enable bit CREN.
register will transfer the data to the RCREG register 5. Flag bit RCIF will be set when reception is com-
and if enable bit RCIE bit is set, the interrupt generated plete and an interrupt will be generated, if
will wake the chip from SLEEP. If the global interrupt is enable bit RCIE was set.
enabled, the program will branch to the interrupt vector 6. Read the RCSTA register to get the ninth bit (if
(0004h). enabled) and determine if any error occurred
during reception.
7. Read the 8-bit received data by reading the
RCREG register.
8. If any error occurred, clear the error by clearing
bit CREN.
9. If using interrupts, ensure that GIE and PEIE in
the INTCON register are set.
0Bh, 8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh,18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
18h RCSTA SPEN RX9 SREN CREN ADDEN FERR OERR RX9D 0000 000x 0000 000x
1Ah RCREG USART Receive Register 0000 0000 0000 0000
8Ch PIE1 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
98h TXSTA CSRC TX9 TXEN SYNC — BRGH TRMT TX9D 0000 -010 0000 -010
99h SPBRG Baud Rate Generator Register 0000 0000 0000 0000
Legend: x = unknown, - = unimplemented, read as '0'. Shaded cells are not used for synchronous slave reception.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76 devices, always maintain these bits clear.
The A/D allows conversion of an analog input signal to The ADCON0 register, shown in Register 11-1, con-
a corresponding 8-bit digital number. The output of the trols the operation of the A/D module. The ADCON1
sample and hold is the input into the converter, which register, shown in Register 11-2, configures the func-
generates the result via successive approximation. The tions of the port pins. The port pins can be configured
analog reference voltage is software selectable to as analog inputs (RA3 can also be a voltage reference),
either the device’s positive supply voltage (VDD), or the or as digital I/O.
voltage level on the RA3/AN3/VREF pin. Additional information on using the A/D module can be
The A/D converter has a unique feature of being able found in the PICmicro™ Mid-Range MCU Family Ref-
to operate while the device is in SLEEP mode. To oper- erence Manual (DS33023) and in Application Note,
ate in SLEEP, the A/D conversion clock must be AN546 (DS00546).
derived from the A/D’s internal RC oscillator.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
PCFG2:PCFG0 RA0 RA1 RA2 RA5 RA3 RE0(1) RE1(1) RE2(1) VREF
000 A A A A A A A A VDD
001 A A A A VREF A A A RA3
010 A A A A A D D D VDD
011 A A A A VREF D D D RA3
100 A A D D A D D D VDD
101 A A D D VREF D D D RA3
11x D D D D D D D D VDD
A = Analog input
D = Digital I/O
Note 1: RE0, RE1 and RE2 are implemented on the PIC16F74/77 only.
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR reset ’1’ = Bit is set ’0’ = Bit is cleared x = Bit is unknown
111
RE2/AN7(1)
110
RE1/AN6(1)
101
RE0/AN5(1)
100
RA5/AN4
VIN
(Input Voltage) 011
RA3/AN3/VREF
010
A/D RA2/AN2
Converter
001
RA1/AN1
VDD 000
RA0/AN0
000 or
010 or
VREF 100 or
11x
(Reference
Voltage) 001 or
011 or
101
PCFG2:PCFG0
CHOLD
VA CPIN I leakage = DAC Capacitance
5 pF VT = 0.6V ± 500 nA = 51.2 pF
VSS
TABLE 11-1: TAD vs. MAXIMUM DEVICE OPERATING FREQUENCIES (STANDARD DEVICES (C))
0Bh,8Bh, INTCON GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
10Bh, 18Bh
0Ch PIR1 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF 0000 0000 0000 0000
0Dh PIR2 — — — — — — — CCP2IF ---- ---0 ---- ---0
(1)
8Ch PIE1 PSPIE ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE 0000 0000 0000 0000
8Dh PIE2 — — — — — — — CCP2IE ---- ---0 ---- ---0
1Eh ADRES A/D Result Register xxxx xxxx uuuu uuuu
1Fh ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE — ADON 0000 00-0 0000 00-0
9Fh ADCON1 — — — — — PCFG2 PCFG1 PCFG0 ---- -000 ---- -000
05h PORTA — — RA5 RA4 RA3 RA2 RA1 RA0 --0x 0000 --0u 0000
85h TRISA — — PORTA Data Direction Register --11 1111 --11 1111
(2)
09h PORTE — — — — — RE2 RE1 RE0 ---- -xxx ---- -uuu
89h TRISE(2) IBF OBF IBOV PSPMODE — PORTE Data Direction Bits 0000 -111 0000 -111
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used for A/D conversion.
Note 1: Bits PSPIE and PSPIF are reserved on the PIC16F73/76; always maintain these bits clear.
2: These registers are reserved on the PIC16F73/76.
U-0 U-0 U-0 U-0 U-0 U-0 U-0 R/P-1 U-0 R/P-1 R/P-1 R/P-1 R/P-1 R/P-1
— — — — — — — BOREN — CP0 PWRTEN WDTEN FOSC1 FOSC0
bit13 bit0
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
- n = Value when device is unprogrammed u = Unchanged from programmed state
External
RESET
MCLR
SLEEP
WDT WDT
Module Time-out
Reset
VDD Rise
Detect
VDD Power-on Reset
Brown-out
Reset S
BODEN
OST/PWRT
OST
Chip_Reset
10-bit Ripple Counter R Q
OSC1
(1)
PWRT
On-chip
RC OSC 10-bit Ripple Counter
Enable PWRT
Enable OST
Note 1: This is a separate oscillator from the RC oscillator of the CLKIN pin.
POR BOR TO PD
Significance
(PCON<1>) (PCON<0>) (STATUS<4>) (STATUS<3>)
0 x 1 1 Power-on Reset
0 x 0 x Illegal, TO is set on POR
0 x x 0 Illegal, PD is set on POR
1 0 1 1 Brown-out Reset
1 1 0 1 WDT Reset
1 1 0 0 WDT Wake-up
1 1 u u MCLR Reset during normal operation
1 1 1 0 MCLR Reset during SLEEP or interrupt wake-up from
SLEEP
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
FIGURE 12-8: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
FIGURE 12-9: SLOW RISE TIME (MCLR TIED TO VDD THROUGH RC NETWORK)
5V
VDD 0V 1V
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
PSPIF(1)
PSPIE(1)
ADIF Wake-up (If in SLEEP mode)
TMR0IF
ADIE TMR0IE
RCIF INTF
RCIE INTE
Interrupt to CPU
TXIF RBIF
TXIE RBIE
SSPIF
SSPIE
PEIE
CCP1IF
CCP1IE GIE
TMR2IF
TMR2IE
TMR1IF
TMR1IE
CCP2IF
CCP2IE
0
M Postscaler
1 U
WDT Timer
X 8
8 - to - 1 MUX PS2:PS0
PSA
WDT
Enable Bit
To TMR0 (Figure 5-1)
0 1
MUX PSA
WDT
Time-out
Note: PSA and PS2:PS0 are bits in the OPTION_REG register.
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
2007h Config. bits (1) BODEN(1) — CP0 PWRTE(1) WDTE FOSC1 FOSC0
81h,181h OPTION_REG RBPU INTEDG T0CS T0SE PSA PS2 PS1 PS0
Legend: Shaded cells are not used by the Watchdog Timer.
Note 1: See Register 12-1 for operation of these bits.
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
CLKOUT(4) TOST(2)
INT pin
INTF Flag
(INTCON<1>) Interrupt Latency
(Note 2)
GIE bit
(INTCON<7>) Processor in
SLEEP
INSTRUCTION FLOW
PC PC PC+1 PC+2 PC+2 PC + 2 0004h 0005h
Instruction Inst(0004h)
Fetched Inst(PC) = SLEEP Inst(PC + 1) Inst(PC + 2) Inst(0005h)
Instruction SLEEP Inst(PC + 1) Dummy cycle Dummy cycle
Executed Inst(PC - 1) Inst(0004h)
Note: Additional information on the mid-range instruction set is available in the PICmicro™ Mid-Range MCU
Family Reference Manual (DS33023).
24CXX/
25CXX/
HCSXXX
PIC14000
MCP2510
PIC16C5X
PIC16C6X
PIC16C7X
PIC16C8X
PIC17C4X
MCRFXXX
PIC16F62X
PIC16F8XX
PIC16C7XX
PIC16C9XX
PIC17C7XX
PIC18CXX2
PIC18FXXX
PIC12CXXX
PIC16CXXX
MPLAB® Integrated
TABLE 14-1:
Development Environment
9
9
9
9
9
9
9
9
9
9
9
9
9
MPLAB® C17 C Compiler
9 9
9 9
MPLAB® C18 C Compiler
MPASMTM Assembler/
Software Tools
MPLINKTM Object Linker
9
9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9
9 9 9
9 9 9
ICEPICTM In-Circuit Emulator
9
9
9
9
9
9
9
9
MPLAB® ICD In-Circuit
* *
Debugger
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
PRO MATE® II
Universal Device Programmer **
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
9
PICDEMTM 2 Demonstration † †
Board
9
9
9
9
DEVELOPMENT TOOLS FROM MICROCHIP
PICDEMTM 3 Demonstration
Board
9
9
PICDEMTM 17 Demonstration
Board
9
* Contact the Microchip Technology Inc. web site at www.microchip.com for information on how to use the MPLAB® ICD In-Circuit Debugger (DV164001) with PIC16C62, 63, 64, 65, 72, 73, 74, 76, 77.
** Contact Microchip Technology Inc. for availability date.
DS30325B-page 117
PIC16F7X
6.0V
5.5V
5.0V
4.5V
Voltage
4.0V
3.5V
3.0V
2.5V
2.0V
16 MHz 20 MHz
Frequency
6.0V
5.5V
5.0V
4.5V
Voltage
4.0V
3.5V
3.0V
2.5V
2.0V
4 MHz 10 MHz
Frequency
FMAX = (12 MHz/V) (VDDAPPMIN - 2.5V) + 4 MHz
Note 1: VDDAPPMIN is the minimum voltage of the PICmicro® device in the application.
Note 2: FMAX has a maximum frequency of 10 MHz.
RL
CL CL
Pin Pin
VSS VSS
RL = 464Ω
CL = 50 pF for all pins except OSC2, but including PORTD and PORTE outputs as ports
15 pF for OSC2 output
Note: PORTD and PORTE are not implemented on the PIC16F73/76 devices.
OSC1
1 3 3 4 4
2
CLKOUT
Parameter
Symbol Characteristic Min Typ† Max Units Conditions
No.
FOSC External CLKIN Frequency DC — 1 MHz XT osc mode
(Note 1) DC — 20 MHz HS osc mode
DC — 32 kHz LP osc mode
Oscillator Frequency DC — 4 MHz RC osc mode
(Note 1) 0.1 — 4 MHz XT osc mode
4 — 20 MHz HS osc mode
5 — 200 kHz LP osc mode
1 TOSC External CLKIN Period 1000 — — ns XT osc mode
(Note 1) 50 — — ns HS osc mode
5 — — ms LP osc mode
Oscillator Period 250 — — ns RC osc mode
(Note 1) 250 — 10,000 ns XT osc mode
50 — 250 ns HS osc mode
5 — — ms LP osc mode
2 TCY Instruction Cycle Time 200 TCY DC ns TCY = 4/FOSC
(Note 1)
3 TosL, External Clock in (OSC1) 500 — — ns XT oscillator
TosH High or Low Time 2.5 — — ms LP oscillator
15 — — ns HS oscillator
4 TosR, External Clock in (OSC1) — — 25 ns XT oscillator
TosF Rise or Fall Time — — 50 ns LP oscillator
— — 15 ns HS oscillator
† Data in "Typ" column is at 5V, 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 consumption. All devices are tested to operate at "min." values with an
external clock applied to the OSC1/CLKIN pin. When an external clock input is used, the "max." cycle time
limit is "DC" (no clock) for all devices.
Q4 Q1 Q2 Q3
OSC1
10 11
CLKOUT
13 12
19 18
14 16
I/O Pin
(Input)
17 15
20, 21
Note: Refer to Figure 15-3 for load conditions.
Param
Symbol Characteristic Min Typ† Max Units Conditions
No.
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out
32
OSC
Time-out
Internal
RESET
Watchdog
Timer
Reset
31
34
34
I/O Pins
VDD VBOR
35
TABLE 15-3: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER, POWER-UP TIMER,
AND BROWN-OUT RESET REQUIREMENTS
Parameter
Sym Characteristic Min Typ† Max Units Conditions
No.
RA4/T0CKI
40 41
42
RC0/T1OSO/T1CKI
45 46
47 48
TMR0 or TMR1
RC1/T1OSI/CCP2
and RC2/CCP1
(Capture Mode)
50 51
52
RC1/T1OSI/CCP2
and RC2/CCP1
(Compare or PWM Mode)
53 54
Param
Symbol Characteristic Min Typ† Max Units Conditions
No.
50* TccL CCP1 and CCP2 No Prescaler 0.5TCY + 20 — — ns
input low time Standard(F) 10 — — ns
With Prescaler Extended(LF) 20 — — ns
51* TccH CCP1 and CCP2 No Prescaler 0.5TCY + 20 — — ns
input high time Standard(F) 10 — — ns
With Prescaler Extended(LF) 20 — — ns
52* TccP CCP1 and CCP2 input period 3TCY + 40 — — ns N = prescale
N value (1,4 or 16)
53* TccR CCP1 and CCP2 output rise time Standard(F) — 10 25 ns
Extended(LF) — 25 50 ns
54* TccF CCP1 and CCP2 output fall time Standard(F) — 10 25 ns
Extended(LF) — 25 45 ns
* These parameters are characterized but not tested.
† Data in "Typ" column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance only
and are not tested.
RE2/CS
RE0/RD
RE1/WR
65
RD7:RD0
62
64
63
Note: Refer to Figure 15-3 for load conditions.
Parameter
Symbol Characteristic Min Typ† Max Units Conditions
No.
SS
70
SCK
(CKP = 0)
71 72
78 79
SCK
(CKP = 1)
79 78
80
75, 76
SS
81
SCK
(CKP = 0)
71 72
79
73
SCK
(CKP = 1)
80
78
75, 76
74
SS
70
SCK
(CKP = 0) 83
71 72
78 79
SCK
(CKP = 1)
79 78
80
75, 76 77
74
73
82
SS
70
SCK
83
(CKP = 0)
71 72
SCK
(CKP = 1)
80
75, 76 77
SDI
MSb In Bit6 - - - -1 LSb In
74
Param
Symbol Characteristic Min Typ† Max Units Conditions
No.
SCL
91 93
90 92
SDA
START STOP
Condition Condition
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
90* TSU:STA START condition 100 kHz mode 4700 — — ns Only relevant for Repeated
Setup time 400 kHz mode 600 — — START condition
91* THD:STA START condition 100 kHz mode 4000 — — ns After this period, the first clock
Hold time 400 kHz mode 600 — — pulse is generated
92* TSU:STO STOP condition 100 kHz mode 4700 — — ns
Setup time 400 kHz mode 600 — —
93 THD:STO STOP condition 100 kHz mode 4000 — — ns
Hold time 400 kHz mode 600 — —
* These parameters are characterized but not tested.
SDA
Out
Param.
Symbol Characteristic Min Max Units Conditions
No.
100* THIGH Clock high time 100 kHz mode 4.0 — µs Device must operate at a
minimum of 1.5 MHz
400 kHz mode 0.6 — µs Device must operate at a
minimum of 10 MHz
SSP Module 1.5TCY —
101* TLOW Clock low time 100 kHz mode 4.7 — µs Device must operate at a
minimum of 1.5 MHz
400 kHz mode 1.3 — µs Device must operate at a
minimum of 10 MHz
SSP Module 1.5TCY —
102* TR SDA and SCL rise 100 kHz mode — 1000 ns
time 400 kHz mode 20 + 0.1CB 300 ns CB is specified to be from
10 - 400 pF
103* TF SDA and SCL fall 100 kHz mode — 300 ns
time 400 kHz mode 20 + 0.1CB 300 ns CB is specified to be from
10 - 400 pF
90* TSU:STA START condition 100 kHz mode 4.7 — µs Only relevant for
setup time 400 kHz mode 0.6 — µs Repeated START
condition
91* THD:STA START condition 100 kHz mode 4.0 — µs After this period the first
hold time 400 kHz mode 0.6 — µs clock pulse is generated
106* THD:DAT Data input hold time 100 kHz mode 0 — ns
400 kHz mode 0 0.9 µs
107* TSU:DAT Data input setup 100 kHz mode 250 — ns (Note 2)
time 400 kHz mode 100 — ns
92* TSU:STO STOP condition 100 kHz mode 4.7 — µs
setup time 400 kHz mode 0.6 — µs
109* TAA Output valid from 100 kHz mode — 3500 ns (Note 1)
clock 400 kHz mode — — ns
110* TBUF Bus free time 100 kHz mode 4.7 — µs Time the bus must be free
400 kHz mode 1.3 — µs before a new transmission
can start
CB Bus capacitive loading — 400 pF
* These parameters are characterized but not tested.
Note 1: As a transmitter, the device must provide this internal minimum delay time to bridge the undefined region
(min. 300 ns) of the falling edge of SCL to avoid unintended generation of START or STOP conditions.
2: A Fast mode (400 kHz) I2C bus device can be used in a Standard mode (100 kHz) I2C bus system, but the
requirement TSU:DAT ≥ 250 ns must then be met. This will automatically be the case if the device does not
stretch the LOW period of the SCL signal. If such a device does stretch the LOW period of the SCL signal, it
must output the next data bit to the SDA line TR max. + TSU:DAT = 1000 + 250 = 1250 ns (according to the
Standard mode I2C bus specification), before the SCL line is released.
RC6/TX/CK
pin 121
121
RC7/RX/DT
pin
120
122
Param
Symbol Characteristic Min Typ† Max Units Conditions
No.
RC6/TX/CK
pin 125
RC7/RX/DT
pin
126
Parameter
Symbol Characteristic Min Typ† Max Units Conditions
No.
Param
Sym Characteristic Min Typ† Max Units Conditions
No.
A/D DATA 7 6 5 4 3 2 1 0
ADIF
GO DONE
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.
Param
Sym Characteristic Min Typ† Max Units Conditions
No.
130 TAD A/D clock period PIC16F7X 1.6 — — µs TOSC based, VREF ≥ 3.0V
PIC16LF7X 2.0 — — µs TOSC based,
2.0V ≤ VREF ≤ 5.5V
PIC16F7X 2.0 4.0 6.0 µs A/D RC mode
PIC16LF7X 3.0 6.0 9.0 µs A/D RC mode
131 TCNV Conversion time (not including 9 — 9 TAD
S/H time) (Note 1)
132 TACQ Acquisition time 5* — — µs The minimum time is the
amplifier settling time. This
may be used if the “new” input
voltage has not changed by
more than 1 LSb (i.e.,
20.0 mV @ 5.12V) from the
last sampled voltage (as
stated on CHOLD).
134 TGO Q4 to A/D clock start — TOSC/2 — — 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.
* These parameters are characterized but not tested.
† Data in “Typ” column is at 5V, 25°C unless otherwise stated. These parameters are for design guidance
only and are not tested.
Note 1: ADRES register may be read on the following TCY cycle.
2: See Section 11.1 for minimum conditions.
“Typical” represents the mean of the distribution at 25°C. “Maximum” or “minimum” represents (mean + 3σ) or (mean - 3σ)
respectively, where σ is a standard deviation, over the whole temperature range.
FIGURE 16-1: TYPICAL IDD vs. FOSC OVER VDD (HS MODE)
6
5.0 V
4
4.5 V
IDD (mA)
3 4.0 V
3.5 V
3.0 V
1
2.5 V
2.0 V
0
4 6 8 10 12 14 16 18 20
F O S C (M H z )
FIGURE 16-2: MAXIMUM IDD vs. FOSC OVER VDD (HS MODE)
8
4 .5 V
IDD (mA)
4
4 .0 V
2 3 .5 V
3 .0 V
1
2 .5 V
2 .0 V
0
4 6 8 10 12 14 16 18 20
F O S C (M H z )
0.9
0.7
5.0V
0.6
4.5V
0.5
IDD (mA)
4.0V
0.4 3.5V
3.0V
0.3
2.5V
2.0V
0.2
0.1
0.0
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
FOSC (MHz)
FIGURE 16-4: MAXIMUM IDD vs. FOSC OVER VDD (XT MODE)
1.2
5.0V
0.8
4.5V
IDD (mA)
0.6 4.0V
3.5V
0.4 3.0V
2.5V
2.0V
0.2
0.0
0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
FOSC (MHz)
45 5.5V
40 5.0V
35 4.5V
IDD (µA)
4.0V
30
3.5V
25
3.0V
20 2.5V
2.0V
15
10
30 40 50 60 70 80 90 100
FOSC (kHz)
FIGURE 16-6: MAXIMUM IDD vs. FOSC OVER VDD (LP MODE)
100
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to 125°C)
Minimum: mean – 3σ (-40°C to 125°C) 5.5V
90
80
5.0V
70
4.5V
60
IDD (µA)
4.0V
50
3.5V
40
3.0V
2.5V
30
2.0V
20
30 40 50 60 70 80 90 100
FOSC (kHz)
4.0
3.5
10 kΩ
3.0
Freq (MHz)
2.5
2.0
1.5
1.0
100 kΩ
0.5
0.0
2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
4.0
5.1 kΩ
3.0
Freq (MHz)
10 kΩ
2.0
1.0
100 kΩ
0.0
2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
250
3.3 kΩ
200
5.1 kΩ
Freq (kHz)
150
10 kΩ
100
50
100 kΩ
0
2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 16-10: IPD vs. VDD (SLEEP MODE, ALL PERIPHERALS DISABLED)
100
Max 125°C
10
Max 85°C
IPD (uA)
Typ 25°C
0.1
0.01
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
1,000
Max (125˚C)
Typ (25˚C)
Device in
Indeterminant SLEEP
State
Device in
RESET
IDD (µA)
100
10
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 16-12: TYPICAL AND MAXIMUM ∆IWDT vs. VDD OVER TEMPERATURE
100
Max (125˚C)
10
∆IWDT (µA)
Typ (25˚C)
0.1
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
50
45
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to 125°C)
40 Minimum: mean – 3σ (-40°C to 125°C)
35
Max
(125°C)
WDT Period (ms)
30
25
Typ
(25°C)
20
Min
15
(-40°C)
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 16-14: AVERAGE WDT PERIOD vs. VDD OVER TEMPERATURE (-40°C TO 125°C)
50
45
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to 125°C)
Minimum: mean – 3σ (-40°C to 125°C)
40
125°C
35
85°C
WDT Period (ms)
30
25°C
25
20
-40°C
15
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
5.5
5.0
4.5
4.0
Max
3.5
Typ (25°C)
3.0
VOH (V)
2.5
Min
2.0
0.5
0.0
0 5 10 15 20 25
IOH (-mA)
FIGURE 16-16: TYPICAL, MINIMUM AND MAXIMUM VOH vs. IOH (VDD = 3V, -40°C TO 125°C)
3.5
2.5
Max
2.0
VOH (V)
Typ (25°C)
1.5
Min
1.0
0.5
0.0
0 5 10 15 20 25
IOH (-mA)
1.0
0.9
Max (125°C)
Typical: statistical mean @ 25°C
0.8 Maximum: mean + 3σ (-40°C to 125°C)
Minimum: mean – 3σ (-40°C to 125°C)
0.7
0.5
Typ (25°C)
0.4
0.3
Min (-40°C)
0.2
0.1
0.0
0 5 10 15 20 25
IOL (-mA)
FIGURE 16-18: TYPICAL, MINIMUM AND MAXIMUM VOL vs. IOL (VDD = 3V, -40°C TO 125°C)
3.0
Max (125°C)
2.5 Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to 125°C)
Minimum: mean – 3σ (-40°C to 125°C)
2.0
VOL (V)
1.5
Max (85°C)
1.0
Typ (25°C)
0.5
Min (-40°C)
0.0
0 5 10 15 20 25
IOL (-mA)
1.5
1.4
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to 125°C)
Minimum: mean – 3σ (-40°C to 125°C)
1.3
VTH Max (-40°C)
1.2
1.1
VTH Typ (25°C)
VIN (V)
1.0
0.8
0.7
0.6
0.5
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 16-20: MINIMUM AND MAXIMUM VIN vs. VDD (ST INPUT, -40°C TO 125°C)
4.0
2.5
2.0
1.5
0.5
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
XXXXXXXXXXXXXXXXX PIC16F76-I/SO
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
YYWWNNN 0210017
XXXXXXXXXXXX PIC16F73
XXXXXXXXXXXX -I/SS
YYWWNNN 0210017
1
XXXXXXXX
1
PIC16F73
XXXXXXXX -I/ML
YYWWNNN 0210017
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 PIC16F77
XXXXXXXXXX -I/PT
XXXXXXXXXX
YYWWNNN 0210017
XXXXXXXXXX PIC16F77
XXXXXXXXXX -I/L
XXXXXXXXXX
YYWWNNN 0210017
2
n 1 α
E A2
L
c
β A1 B1
eB B p
E
E1
p
B
2
n 1
h
α
45°
c
A A2
φ
β L A1
E1
p
B
2
n 1
α
A
c
A2
φ A1
L
β
D1 D D2
p
2
1 B
n
R
E2
CH x 45 L
TOP VIEW BOTTOM VIEW
A2 A
A1
A3
M B
PACKAGE
SOLDER EDGE
MASK
E1
2 α
n 1
A A2
L
c
β B1
A1
eB B p
E
E1
#leads=n1
D1 D
2
1
B
n
CH x 45 °
α
A
φ
β A1 A2
L
(F)
E
E1
#leads=n1
D1 D
n 1 2
CH2 x 45 ° CH1 x 45 °
A3 α
A2 A
35°
B1
c
B A1
β
p
E2 D2
I/O Ports 3 5 3 5
Interrupt Sources 11 12 11 12
Timers 3 3 3
Interrupts 11 or 12 13 or 14 11 or 12
Communication PSP, USART, SSP PSP, USART, SSP PSP, USART, SSP
(SPI, I2C Slave) (SPI, I2C Master/Slave) (SPI, I2C Slave)
CCP 2 2 2
RAM 192, 368 bytes 192, 368 bytes 192, 368 bytes
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this data sheet easy to follow? If not, why?
4. What additions to the data sheet do you think would enhance the structure and subject?
5. What deletions from the data sheet could be made without affecting the overall usefulness?
8. How would you improve our software, systems, and silicon products?
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
01/18/02