
PIC18F2221/2321/4221/4321 FAMILY
DS39689F-page 20
2009 Microchip Technology Inc.
PORTB is a bidirectional I/O port. PORTB can be
software programmed for internal weak pull-ups on all
inputs.
RB0/INT0/FLT0/AN12
RB0
INT0
FLT0
AN12
33
9
8
I/O
I
TTL
ST
Analog
Digital I/O.
External Interrupt 0.
PWM Fault input for Enhanced CCP1.
Analog input 12.
RB1/INT1/AN10
RB1
INT1
AN10
34
10
9
I/O
I
TTL
ST
Analog
Digital I/O.
External Interrupt 1.
Analog Input 10.
RB2/INT2/AN8
RB2
INT2
AN8
35
11
10
I/O
I
TTL
ST
Analog
Digital I/O.
External Interrupt 2.
Analog Input 8.
RB3/AN9/CCP2
RB3
AN9
CCP2(2)
36
12
11
I/O
I
I/O
TTL
Analog
ST
Digital I/O.
Analog Input 9.
Capture 2 input/Compare 2 output/PWM2 output.
RB4/KBI0/AN11
RB4
KBI0
AN11
37
14
I/O
I
TTL
Analog
Digital I/O.
Interrupt-on-change pin.
Analog input 11.
RB5/KBI1/PGM
RB5
KBI1
PGM
38
15
I/O
I
I/O
TTL
ST
Digital I/O.
Interrupt-on-change pin.
Low-Voltage ICSP Programming enable pin.
RB6/KBI2/PGC
RB6
KBI2
PGC
39
16
I/O
I
I/O
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-circuit debugger and ICSP programming
clock pin.
RB7/KBI3/PGD
RB7
KBI3
PGD
40
17
I/O
I
I/O
TTL
ST
Digital I/O.
Interrupt-on-change pin.
In-circuit debugger and ICSP programming
data pin.
TABLE 1-3:
PIC18F4221/4321 PINOUT I/O DESCRIPTIONS (CONTINUED)
Pin Name
Pin Number
Pin
Type
Buffer
Type
Description
PDIP
QFN TQFP
Legend: TTL = TTL compatible input
CMOS = CMOS compatible input or output
ST = Schmitt Trigger input with CMOS levels
I
= Input
P = Power
I2C = ST with I2C or SMB levels
O
= Output
Note 1: Default assignment for CCP2 when Configuration bit, CCP2MX, is set.
2: Alternate assignment for CCP2 when Configuration bit, CCP2MX, is cleared.