16F87X Datasheet - Version Resumida
16F87X Datasheet - Version Resumida
16F87X Datasheet - Version Resumida
Data Sheet
28/40-Pin 8-Bit CMOS FLASH
Microcontrollers
PIC16F877/874
RE0/RD/AN5 8 33 RB0/INT
branches which are two cycle RE1/WR/AN6 9 32 VDD
• Operating speed: DC - 20 MHz clock input RE2/CS/AN7 10 31 VSS
VDD 11 30 RD7/PSP7
DC - 200 ns instruction cycle
VSS 12 29 RD6/PSP6
• Up to 8K x 14 words of FLASH Program Memory, OSC1/CLKIN 13 28 RD5/PSP5
Up to 368 x 8 bytes of Data Memory (RAM) OSC2/CLKOUT 14 27 RD4/PSP4
PDIP, SOIC
MCLR/VPP 1 28 RB7/PGD
RA0/AN0 2 27 RB6/PGC
RA1/AN1 3 26 RB5
PIC16F876/873
RA2/AN2/VREF- 4 25 RB4
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
RA3/AN3/VREF+
RA2/AN2/VREF-
MCLR/VPP
RB7/PGD
RB6/PGC
RA1/AN1
RA0/AN0
PLCC
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 PIC16F877 35 VDD
VDD 12 34 VSS
VSS 13
PIC16F874 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
RC3/SCK/SCL
RC4/SDI/SDA
RC2/CCP1
RC3/SCK/SCL
RD0/PSP0
RD1/PSP1
RD2/PSP2
RD3/PSP3
RC1/T1OSI/CCP2
RC5/SDO
NC
RC4/SDI/SDA
RC6/TX/CK
RC6/TX/CK
RC2/CCP1
RD3/PSP3
RD2/PSP2
RD1/PSP1
RD0/PSP0
RC5/SDO
NC
QFP
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 PIC16F877 29 VSS
VSS 6 28 VDD
VDD 7
PIC16F874 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
RA3/AN3/VREF+
RB4
RB5
RA0/AN0
RA1/AN1
NC
NC
RB6/PGC
RB7/PGD
MCLR/VPP
RA2/AN2/VREF-
Key Features
PICmicro™ Mid-Range Reference PIC16F873 PIC16F874 PIC16F876 PIC16F877
Manual (DS33023)
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.
Program Data
Device Data Memory
FLASH EEPROM
PIC16F873 4K 192 Bytes 128 Bytes
PIC16F876 8K 368 Bytes 256 Bytes
Synchronous
Data EEPROM CCP1,2 USART
Serial Port
PC<12:0>
PC<12:0>
CALL, RETURN 13
CALL, RETURN 13
RETFIE, RETLW RETFIE, RETLW
17FFh
1800h
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 EEDATA 10Ch EECON1 18Ch
PIR2 0Dh PIE2 8Dh EEADR 10Dh EECON2 18Dh
TMR1L 0Eh PCON 8Eh EEDATH 10Eh Reserved(2) 18Eh
TMR1H 0Fh 8Fh EEADRH 10Fh Reserved(2) 18Fh
T1CON 10h 90h 110h 190h
TMR2 11h SSPCON2 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
ADRESH 1Eh ADRESL 9Eh 11Eh 19Eh
ADCON0 1Fh ADCON1 9Fh 11Fh 19Fh
20h A0h 120h 1A0h
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)
(for borrow, the polarity is reversed)
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 ’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: When using low voltage ICSP programming (LVP) and the pull-ups on PORTB are enabled, bit 3
in the TRISB register must be cleared to disable the pull-up on RB3 and ensure the proper oper-
ation of the device
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: PSPIE is reserved on PIC16F873/876 devices; always maintain this bit clear.
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
The INDF register is not a physical register. Addressing EXAMPLE 2-2: INDIRECT ADDRESSING
the INDF register will cause indirect addressing. MOVLW 0x20 ;initialize pointer
Indirect addressing is possible by using the INDF reg- MOVWF FSR ;to RAM
ister. Any instruction using the INDF register actually NEXT CLRF INDF ;clear INDF register
accesses the register pointed to by the File Select Reg- INCF FSR,F ;inc pointer
ister, FSR. Reading the INDF register itself, indirectly BTFSS FSR,4 ;all done?
GOTO NEXT ;no clear next
(FSR = ’0’) will read 00h. Writing to the INDF register
CONTINUE
indirectly results in a no operation (although status bits : ;yes continue
may be affected). An effective 9-bit address is obtained
by concatenating the 8-bit FSR register and the IRP bit
(STATUS<7>), as shown in Figure 2-6.
Data
Memory(1)
05h PORTA — — RA5 RA4 RA3 RA2 RA1 RA0 --0x 0000 --0u 0000
85h TRISA — — PORTA Data Direction Register --11 1111 --11 1111
9Fh ADCON1 ADFM — — — PCFG3 PCFG2 PCFG1 PCFG0 --0- 0000 --0- 0000
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 PCFG3:PCFG0 = 0100,0101, 011x, 1101, 1110, 1111.
Q D
Four of the PORTB pins, RB7:RB4, have an interrupt- RD Port
From other
on-change feature. Only pins configured as inputs can RB7:RB4 pins EN
cause this interrupt to occur (i.e., any RB7:RB4 pin Q3
configured as an output is excluded from the interrupt- RB7:RB6
on-change comparison). The input pins (of RB7:RB4) In Serial Programming Mode
are compared with the old value latched on the last Note 1: I/O pins have diode protection to VDD and VSS.
read of PORTB. The “mismatch” outputs of RB7:RB4 2: To enable weak pull-ups, set the appropriate TRIS
are OR’ed together to generate the RB Port Change bit(s) and clear the RBPU bit (OPTION_REG<7>).
Interrupt with flag bit RBIF (INTCON<0>).
RB0/INT bit0 TTL/ST(1) Input/output pin or external interrupt input. Internal software
programmable weak pull-up.
RB1 bit1 TTL Input/output pin. Internal software programmable weak pull-up.
RB2 bit2 TTL Input/output pin. Internal software programmable weak pull-up.
(3)
RB3/PGM bit3 TTL Input/output pin or programming pin in LVP mode. Internal software
programmable weak pull-up.
RB4 bit4 TTL Input/output pin (with interrupt-on-change). Internal software programmable
weak pull-up.
RB5 bit5 TTL Input/output pin (with interrupt-on-change). Internal software programmable
weak pull-up.
RB6/PGC bit6 TTL/ST(2) Input/output pin (with interrupt-on-change) or In-Circuit Debugger pin.
Internal software programmable weak pull-up. Serial programming clock.
RB7/PGD bit7 TTL/ST(2) Input/output pin (with interrupt-on-change) or In-Circuit Debugger pin.
Internal software programmable weak pull-up. Serial programming data.
Legend: TTL = TTL input, ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: Low Voltage ICSP Programming (LVP) is enabled by default, which disables the RB3 I/O function. LVP
must be disabled to enable RB3 as an I/O pin and allow maximum compatibility to the other 28-pin and
40-pin mid-range devices.
CKE
FIGURE 3-5: PORTC BLOCK DIAGRAM SSPSTAT<6>
(PERIPHERAL OUTPUT
Note 1: I/O pins have diode protection to VDD and VSS.
OVERRIDE) RC<2:0>, 2: Port/Peripheral select signal selects between port data
RC<7:5> and peripheral output.
3: Peripheral OE (output enable) is only activated if
peripheral select is active.
Port/Peripheral Select(2)
Data Latch
D Q
WR
TRIS CK Q
N
TRIS Latch
VSS
RD
TRIS
Schmitt
Trigger
Peripheral
OE(3) Q D
RD EN
Port
Peripheral Input
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
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 T0IF
on Overflow
PRESCALER
0
M 8-bit Prescaler
U
Watchdog 1 X 8
Timer
8 - to - 1MUX PS2:PS0
PSA
0 1
WDT Enable bit
MUX PSA
WDT
Time-out
bit 7 RBPU
bit 6 INTEDG
bit 5 T0CS: TMR0 Clock Source Select bit
1 = Transition on T0CKI pin
0 = Internal instruction cycle clock (CLKOUT)
bit 4 T0SE: TMR0 Source Edge Select bit
1 = Increment on high-to-low transition on T0CKI pin
0 = Increment on low-to-high transition on T0CKI pin
bit 3 PSA: Prescaler Assignment bit
1 = Prescaler is assigned to the WDT
0 = Prescaler is assigned to the Timer0 module
bit 2-0 PS2:PS0: Prescaler Rate Select bits
Bit Value TMR0 Rate WDT Rate
000 1:2 1:1
001 1:4 1:2
010 1:8 1:4
011 1 : 16 1:8
100 1 : 32 1 : 16
101 1 : 64 1 : 32
110 1 : 128 1 : 64
111 1 : 256 1 : 128
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: To avoid an unintended device RESET, the instruction sequence shown in the PICmicro™ Mid-Range MCU
Family Reference Manual (DS33023) must be executed when changing the prescaler assignment from
Timer0 to the WDT. This sequence must be followed even if the WDT is disabled.
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 ’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
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.
When setting up an Asynchronous Reception, follow 6. Flag bit RCIF will be set when reception is com-
these steps: 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
(bits 7 and 6) of the INTCON register are 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
PCFG3: AN7(1) AN6(1) AN5(1) AN4 AN3 AN2 AN1 AN0 CHAN/
VREF+ VREF-
PCFG0 RE2 RE1 RE0 RA5 RA3 RA2 RA1 RA0 Refs(2)
0000 A A A A A A A A VDD VSS 8/0
0001 A A A A VREF+ A A A RA3 VSS 7/1
0010 D D D A A A A A VDD VSS 5/0
0011 D D D A VREF+ A A A RA3 VSS 4/1
0100 D D D D A D A A VDD VSS 3/0
0101 D D D D VREF+ D A A RA3 VSS 2/1
011x D D D D D D D D VDD VSS 0/0
1000 A A A A VREF+ VREF- A A RA3 RA2 6/2
1001 D D A A A A A A VDD VSS 6/0
1010 D D A A VREF+ A A A RA3 VSS 5/1
1011 D D A A VREF+ VREF- A A RA3 RA2 4/2
1100 D D D A VREF+ VREF- A A RA3 RA2 3/2
1101 D D D D VREF+ VREF- A A RA3 RA2 2/2
1110 D D D D D D D A VDD VSS 1/0
1111 D D D D VREF+ VREF- D A RA3 RA2 1/2
A = Analog input D = Digital I/O
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
The ADRESH:ADRESL registers contain the 10-bit To determine sample time, see Section 11.1. After this
result of the A/D conversion. When the A/D conversion acquisition time has elapsed, the A/D conversion can
is complete, the result is loaded into this A/D result reg- be started.
ister pair, the GO/DONE bit (ADCON0<2>) is cleared
and the A/D interrupt flag bit ADIF is set. The block dia-
gram of the A/D module is shown in Figure 11-1.
After the A/D module has been configured as desired,
the selected channel must be acquired before the con-
version is started. The analog input channels must
have their corresponding TRIS bits selected as inputs.
111
RE2/AN7(1)
110
RE1/AN6(1)
101
RE0/AN5(1)
100
RA5/AN4
VAIN
(Input Voltage) 011
RA3/AN3/VREF+
010
A/D RA2/AN2/VREF-
Converter
001
RA1/AN1
VDD 000
RA0/AN0
VREF+
(Reference
Voltage)
PCFG3:PCFG0
VREF-
(Reference
Voltage)
VSS
PCFG3:PCFG0
= TAMP + TC + TCOFF
= 2µs + TC + [(Temperature -25°C)(0.05µs/°C)]
TC = CHOLD (RIC + RSS + RS) In(1/2047)
= - 120pF (1kΩ + 7kΩ + 10kΩ) In(0.0004885)
= 16.47µs
TACQ = 2µs + 16.47µs + [(50°C -25°C)(0.05µs/°C)
= 19.72µ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 leak-
age specification.
4: After a conversion has completed, a 2.0TAD delay must complete before acquisition can begin again.
During this time, the holding capacitor is not connected to the selected A/D input channel.
CHOLD
VA CPIN I LEAKAGE = DAC capacitance
5 pF VT = 0.6V ± 500 nA = 120 pF
VSS
TABLE 11-1: TAD vs. MAXIMUM DEVICE OPERATING FREQUENCIES (STANDARD DEVICES (C))
TCY to TAD TAD1 TAD2 TAD3 TAD4 TAD5 TAD6 TAD7 TAD8 TAD9 TAD10 TAD11
b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Conversion starts
Set GO bit
ADRES is loaded
GO bit is cleared
ADIF bit is set
Holding capacitor is connected to analog input
11.4.1 A/D RESULT REGISTERS Format Select bit (ADFM) controls this justification.
Figure 11-4 shows the operation of the A/D result justi-
The ADRESH:ADRESL register pair is the location fication. The extra bits are loaded with ’0’s’. When an
where the 10-bit A/D result is loaded at the completion A/D result will not overwrite these locations (A/D dis-
of the A/D conversion. This register pair is 16-bits wide. able), these registers may be used as two general
The A/D module gives the flexibility to left or right justify purpose 8-bit registers.
the 10-bit result in the 16-bit result register. The A/D
10-bit Result
ADFM = 1 ADFM = 0
7 2107 0 7 0765 0
0000 00 0000 00
Value on Value on
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 POR, MCLR,
BOR WDT
0Bh,8Bh, INTCON GIE PEIE T0IE INTE RBIE T0IF 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
1Eh ADRESH A/D Result Register High Byte xxxx xxxx uuuu uuuu
9Eh ADRESL A/D Result Register Low Byte xxxx xxxx uuuu uuuu
1Fh ADCON0 ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE — ADON 0000 00-0 0000 00-0
9Fh ADCON1 ADFM — — — PCFG3 PCFG2 PCFG1 PCFG0 --0- 0000 --0- 0000
85h TRISA — — PORTA Data Direction Register --11 1111 --11 1111
05h PORTA — — PORTA Data Latch when written: PORTA pins when read --0x 0000 --0u 0000
89h(1) TRISE IBF OBF IBOV PSPMODE — PORTE Data Direction bits 0000 -111 0000 -111
09h(1) PORTE — — — — — RE2 RE1 RE0 ---- -xxx ---- -uuu
Legend: x = unknown, u = unchanged, - = unimplemented, read as '0'. Shaded cells are not used for A/D conversion.
Note 1: These registers/bits are not available on the 28-pin devices.
ADIF
GO DONE
SAMPLING STOPPED
SAMPLE
Note: 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.
130 TAD A/D clock period Standard(F) 1.6 — — µs TOSC based, VREF ≥ 3.0V
Extended(LF) 3.0 — — µs TOSC based, VREF ≥ 2.0V
Standard(F) 2.0 4.0 6.0 µs A/D RC mode
Extended(LF) 3.0 6.0 9.0 µs A/D RC mode
131 TCNV Conversion time (not including S/H time) — 12 TAD
(Note 1)
132 TACQ Acquisition time (Note 2) 40 — µs
CP1 CP0 DEBUG — WRT CPD LVP BODEN CP1 CP0 PWRTE WDTE F0SC1 F0SC0
bit13 bit0
MCLR
SLEEP
WDT WDT
Module Time-out
Reset
VDD Rise
Detect
Power-on Reset
VDD
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
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
Legend: x = don’t care, u = unchanged
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
EEIF
EEIE
PSPIF
PSPIE
ADIF Wake-up (If in SLEEP mode)
T0IF
ADIE T0IE
RCIF INTF
RCIE INTE
Interrupt to CPU
TXIF RBIF
TXIE RBIE
SSPIF
SSPIE
PEIE
CCP1IF
CCP1IE GIE
TMR2IF
TMR2IE
TMR1IF
TMR1IE
CCP2IF
CCP2IE
BCLIF
BCLIE
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
Address Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
2007h Config. bits (1) BODEN(1) CP1 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.
Note: Additional information on the mid-range instruction set is available in the PICmicro™ Mid-Range MCU
Family Reference Manual (DS33023).
Description: The eight bit literal ’k’ is loaded Status Affected: None
into W register. The don’t cares
will assemble as 0’s.