Professional Documents
Culture Documents
Lab 5
Lab 5
Lab 5
1. Use PORTB and PORTC as input ports, which receive 8-bit information. Information received
from PORTB and PORTC are added, and the results should be displayed on PORTD. Connect 8
LEDs with PORTD to visualize the result present on PORTD. Repeat this addition process for the
indefinite time interval
CODE SCREENSHOT:
PROTEUS SCREENSHOT:
2. Receive two 8-bit numbers from PORTB and PORTD and Check if the numbers are equal or
not. If numbers are equal, turn on the LED connected with RC0; otherwise, turn on the LED
connected with RC4. Repeat this checking mechanism for an indefinite time interval.
CODE SCREENSHOT:
PROTEUS SCREENSHOT:
3. Receive the number from PORTC and check it is zero or not. If it is zero, then keep checking
the PORTC content. If any result received from PORTC becomes non-zero, turn on the LED
connected with RB2 and stop the program and do not check the content coming from PORTC.
CODE SCREEENSHOT:
PROTEUS SCREENSHOT:
4. Connect Two LEDs with RB0 and RB1. Also Connect a switch with RB2. Turn on the LED
connected with RB0 if switch is on and Turn on the LED connected with RB1 if switch is off.
CODE SCREENSHOT:
PROTEUS SCREENSHOT: