This document contains two questions regarding microcontroller programs that display numeric values using 7-segment displays and an LCD screen. Question 1 involves a program that uses two 7-segment displays to count from 0000 to 9999 using four counters. Question 2 initializes an LCD display and shows two input numbers, their sum, product, and binary representations by converting the values to strings. Both programs continuously loop and refresh the displays.
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
12 views
Assignment 2
This document contains two questions regarding microcontroller programs that display numeric values using 7-segment displays and an LCD screen. Question 1 involves a program that uses two 7-segment displays to count from 0000 to 9999 using four counters. Question 2 initializes an LCD display and shows two input numbers, their sum, product, and binary representations by converting the values to strings. Both programs continuously loop and refresh the displays.
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7
Microprocessor Systems & Interfacing
Assignment 2
Name Muhammad Daniyal Akram
Registration Number FA21-BEE-233
Class BEE-5C
Instructor’s Name Dr. Sikender Gul
QUESTION: 1 Displaying 0000 to 9999 on separate 7SEG-Display: Code on Microchip Studio: Explanation: This AVR microcontroller program uses two 7-segment displays to count from 0000 to 9999 in a loop. It sets up Port D and Port B as outputs for the displays and defines patterns for digits 0 to 9. The program cycles through the four digits by sequentially displaying them on the two 7-segment displays, using delays to control the timing. It keeps track of each digit's value using four separate counters (counter1 to counter4) and increments them accordingly. When a counter reaches 10, it resets to 0, and the next counter is incremented. This loop continues indefinitely, creating a digital counter that cycles through numbers from 0000 to 9999 with a one-second delay between each count. Proteus Display: QUESTION: 2 Displaying sum and product using LCD Display: Code on Microchip Studio: Explanation: This AVR microcontroller program initializes an LCD display, sets up the necessary data and control pins, and displays information about two integers (num1 and num2), their sum, and their product on the LCD screen. It also converts these numbers into binary representations and displays them on the LCD. The program defines functions to send commands, data, integers, and long integers to the LCD and converts numbers into strings for display. The LCD displays information sequentially, clears itself, and loops indefinitely while displaying the numeric values and their binary representations on the first and second lines of the screen. Proteus Display: