MICROPROCESSOR AND MICROCONTROLLER

PIC MICROCONTROLLER

ARCHITECTURE OF 8085

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Port RC0 of a PIC microcontroller is connected with an active high switch. An LED with active low connection is connected at pin RD0. The LED must turn on if switch is pressed and turn off if release. Which code suitable with this application
A
if (RC0 ==0) RD0 = 1;else RD0 = 0;
B
if (RC0 ==1) RD0 = 1;else RD0 = 0;
C
if (RC0 ==0) RD0 = 0;else RD0 = 1;
D
if (RC0 ==1) RD0 = 0;else RD0 = 1;
Explanation: 

Detailed explanation-1: -Microcontroller pin becomes ground and current start flowing from 5 volt source to ground making led to switch on.

Detailed explanation-2: -External Interrupt Pins They are on PORTB pins RB0, RB1, and RB2 shown in the below image. These interrupts are edge-triggered interrupts i.e. triggered by either a rising edge or by a falling edge.

Detailed explanation-3: -Basic interfacing circuit of a push button switch is given below. Here, the switch is directly connected to the microcontroller through a resistor to limit the sourcing current. Sourcing current is the current which passes to the microcontroller when the switch is closed (ON state).

Detailed explanation-4: -In order to define a pin as input or output pin, the right combination of zeros and ones must be written in TRIS register. If the appropriate bit of TRIS register contains logical “1", then that pin is an input pin, and if the opposite is true, it’s an output pin.

There is 1 question to complete.