PIC MICROCONTROLLER
ARCHITECTURE OF 8085
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
TRISB0 = 1; TRISB1 = 1;
|
|
TRISB = 0b11000000;
|
|
PORTB = 0b00000011;
|
|
RB0 = 1; RB1 = 1;
|
Detailed explanation-1: -8051 microcontrollers have 4 I/O ports each of 8-bit, which can be configured as input or output. Hence, total 32 input/output pins allow the microcontroller to be connected with the peripheral devices. Pin configuration, i.e. the pin can be configured as 1 for input and 0 for output as per the logic state.
Detailed explanation-2: -To use port-1 as input port, ‘1’ has to be written to the latch. In this input mode when ‘1’ is written to the pin by the external device then it read fine. But when ‘0’ is written to the pin by the external device then the external source must sink current due to internal pull-up.
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: -Writing 1’s to TRISx will make the corresponding PORTx pins as Input. Similarly writing 0’s to TRISx will make the corresponding PORTx pins as Output. TRISB = 0xff; // Configure PORTB as Input.