Programming |  PIC's |  16F84A |  I/O Port B


Maximum current sourced100 mA
Maximum current sunk150 mA

Port B Hardware

PinNameInputOutputDescription
6RB0TTLTTLBi-directional I/O Port
INTST-External Interupt
7RB1TTLTTLBi-directional I/O Port B
8RB2TTLTTLBi-directional I/O Port B
9RB3TTLTTLBi-directional I/O Port B
10RB4TTLTTLBi-directional I/O Port B, interupt-on-change pin.
11RB5TTLTTLBi-directional I/O Port B, interupt-on-change pin.
12RB6TTLTTLBi-directional I/O Port B, interupt-on-change pin.
13RB7TTLTTLBi-directional I/O Port B, interupt-on-change pin.

Port B Register

Bit Kind Name Description Pwr Other
bit 7 R/W-x RB7 General Purpose I/O bit
1 = pin is > Vih.
0 = pin is < Vil.
x u
bit 6 R/W-x RB6 x u
bit 5 R/W-x RB5 x u
bit 4 R/W-X RB4 x u
bit 3 R/W-X RB3 x u
bit 2 R/W-X RB2 x u
bit 1 R/W-X RB1 x u
bit 0 R/W-X RB0 x u

TRISB Register

Bit Kind Name Description Pwr Other
bit 7R/W-1TRISB71 = pin is configured as an input.
0 = pin is configured as an output.
11
bit 6R/W-1TRISB611
bit 5R/W-1TRISB511
bit 4R/W-1TRISB411
bit 3R/W-1TRISB311
bit 2R/W-1TRISB211
bit 1R/W-1TRISB111
bit 0R/W-1TRISB011

        BCF     STATUS, RP0     ;
        CLRF    PORTB           ; Initialize PORTB by
                                ; clearing output
                                ; data latches
        BSF     STATUS, RP0     ; Select Bank 1
        MOVLW   b'11001111'     ; Value used to
                                ; initialize data
                                ; direction
        MOVWF   TRISB           ; Set RB7-RB6 and RB3-RB0 as inputs
                                ; RB5-RB4 as outputs