PIC MICROCONTROLLER
ARCHITECTURE OF 8085
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
//Port RB4-RB7 are output port and Port RB0-RB3 are input port
|
|
//All pins at PORTC are assigned as input port
|
|
//All pins at PORTC are assigned as output port
|
|
//Port RB4-RB7 are input port and Port RB0-RB3 are output port
|
Detailed explanation-1: -PORTB and TRISB. PORTB has adjoined 8 pins. The appropriate register for data direction is TRISB. Setting a bit in TRISB register defines the corresponding port pin as input, and resetting a bit in TRISB register defines the corresponding port pin as output.
Detailed explanation-2: -TRIS is used to control direction (Input or Output) of each IO pin while PORT is used to Write or Read data from IO pins. Whereas in 18F PIC Microcontrollers there is an additional register, LAT. LAT stands for Port Latch. As in 16F, 18F also uses TRIS register to control direction of each IO pin.
Detailed explanation-3: -Control registers, called TRISA, for Port A and TRISB for Port B, determine whether the port is an input or an output, (or a mixture.) Writing logic 1 into a bit of TRISA causes the corresponding bit of Port A to input data. Logic 0 makes the corresponding bit output data. TRISB controls Port B in the same way.
Detailed explanation-4: -The name TRIS is a shortening of tri-state which refers to the possible states of a pin: logic 1 output, logic 0 output, high-impedance input. Each bit in each TRIS register controls the data direction for one I/O pin. If the bit is set to 0, that pin is an output. If a bit is set to 1, that pin is an input.