English
Language : 

PIC18F258 Datasheet, PDF (99/384 Pages) Microchip Technology – High Performance, 28/40-Pin Enhanced FLASH Microcontrollers with CAN
PIC18FXX8
TABLE 9-3: PORTB FUNCTIONS
Name
Bit# Buffer
Function
RB0/INT0
RB1/INT1
RB2/INT2/
CANTX
bit0 TTL/ST(1) Input/output pin or external interrupt 0 input.
Internal software programmable weak pull-up.
bit1 TTL/ST(1) Input/output pin or external interrupt 1 input.
Internal software programmable weak pull-up.
bit2 TTL/ST(1) Input/output pin, external interrupt 2 input or CAN bus transmit pin.
Internal software programmable weak pull-up.
RB3/CANRX bit3
RB4
bit4
TTL Input/output pin or CAN bus receive pin.
Internal software programmable weak pull-up.
TTL Input/output pin (with interrupt-on-change).
Internal software programmable weak pull-up.
RB5/PGM
RB6/PGC
RB7/PGD
bit5
TTL Input/output pin (with interrupt-on-change). Internal software programmable
weak pull-up. Low voltage serial programming enable.
bit6 TTL/ST(2) Input/output pin (with interrupt-on-change). Internal software programmable
weak pull-up. Serial programming clock.
bit7 TTL/ST(2) Input/output pin (with interrupt-on-change). 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.
TABLE 9-4: SUMMARY OF REGISTERS ASSOCIATED WITH PORTB
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR, BOR
Value on
all other
RESETS
PORTB
LATB
TRISB
INTCON
RB7
RB6
RB5
LATB Data Output Register
PORTB Data Direction Register
GIE/GIEH PEIE/GIEL TMR0IE
RB4
INT0IE
RB3
RBIE
RB2
RB1
TMR0IF INT0IF
RB0
RBIF
xxxx xxxx
xxxx xxxx
1111 1111
0000 000x
uuuu uuuu
uuuu uuuu
1111 1111
0000 000u
INTCON2 RBPU INTEDG0 INTEDG1 INTEDG2
—
TMR0IP
INTCON3 INT2IP INT1IP
—
INT2IE INT1IE
—
Legend: x = unknown, u = unchanged. Shaded cells are not used by PORTB.
—
INT2IF
RBIP
INT1IF
1111 -1-1
11-0 0-00
1111 -1-1
11-0 0-00
 2002 Microchip Technology Inc.
Preliminary
DS41159B-page 97