You are on page 1of 1

PIC Microcontroller Device

Device 16f877

00001111 PORTB.7-PORTB.4 are set as


output while PORTB.3-PORTB.0 are set as
input
Command: TRISB = 00001111

Crystal Oscillator:
Xtal 20

Others:

Port B as Output:
00000000 PORTB.7
00000000 PORTB.6
00000000 PORTB.5
00000000 PORTB.4
00000000 PORTB.3
00000000 PORTB.2
00000000 PORTB.1
00000000 PORTB.0

All:

Command: TRISB = 00000000


Port B as Input:
11111111 PORTB.7
11111111 PORTB.6
11111111 PORTB.5
11111111 PORTB.4
11111111 PORTB.3
11111111 PORTB.2
11111111 PORTB.1
11111111 PORTB.0
Command: TRISB = 11111111
Combination:

Input PORTB - Set PORTB as Input


Output PORTB - Set PORTB as Output
Specific:
Input PORTB.1 - Set PORTB.1 as Input
Output PORTB.1 - Set PORTB.1 as Output

You might also like