Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

OBJECTIVE:
Learn how a seven-segment display can be used.  In this lab, you will be writing a program that will keep a count, and then output that count to a seven-segment display.

MATERIAL:

- AVR Studio4
- AT90USB1286 Trainer
- LED seven-segment display

BACKGROUND:

A seven-segment display is used to display numbers from zero to nine in an easy-to-read decimal format so that the majority of people do not need to know binary. It is made of seven

LEDs, each labeled with an alphabetic letter, like A, B, C, etc. The LEDs are arranged as is shown below:

In order to display a one, for ex, you would set the B and C pins high, since that would light up the B and C LEDs.
Since BCD only goes from zero to nine, it is perfectly adapted to being used to display decimal digits. This also means one digit can fit into four bits, allowing two digits to be “packed” into one byte. In the second part of this lab, you will use this fact to count from 0-99 as opposed to only counting from zero to nine.

ACTIVITY 1:

1. Start up AVR Studio, and begin a new project named lastname_lab5.  The debug platform and microcontroller are still the same, the AVR Simulator and AT90USB1286.

2. Read the datasheet for the seven-segment display, located here:
http://optoelectronics.liteon.com/enus/api/DwonloadFileHandler.ashx?txtSpecNo=DS30-2002-146&txtPartNo=LSHD-5503.
The data lines for the microcontroller are on port A.

3. Using what you have learned from the data sheet, figure out which lines need to be high for each number to be displayed, and construct a table in your lab notebook.

4. Use the table you've created to prepare a program that will count up from zero to nine, and display that number to the rightmost seven-segment display.

5. Now, extend what you’ve learned to implement a packed BCD counter that counts from zero to 99. The two seven-segment displays use the same data lines, but the left one is toggled by a transistor that is connected to pin D7, so by sending a low on pin D7, the rightmost display is active, and if pin D7 is high, then the leftmost display is active.

Hint: Use the list of AVR assembly instructions located below to check out possible instructions to use in order to make the packed BCD display work:
http://www.atmel.com/dyn/resources/prod_documents/doc0856.pdf

ACTIVITY 2:
prepare a program that find outs (PORTA + 4) * PORTB and sends out the result through PORTC and PORTD. Consider all the values unsigned.  Trace (single step) through your program using AVR Studio4.

ACTIVITY 3:

prepare a program to find out the result of (PORTA + PORTB)/2 and sends out the result through PORTC. Consider all the values unsigned. Trace through your program using AVR
Studio4.

ACTIVITY 4:

prepare a program that find outs (PORTA + 4) * PORTB and sends out the result through PORTC and PORTD. Consider all the values signed. Trace through your program using AVR Studio4.In your report,

1.  Identify the most important lessons of this lab exercise.
2.  Report any activity that gave you difficulty. 
3.  Formulate and document a plan for improving your understanding of

a) Packed and unpacked BCD
b) AVR unsigned arithmetic instructions
c) AVR signed arithmetic instructions

4.  Answer the following problems.

a) Find the value in R0 and R1 after the following code.

LDI  R16, 10
LDI  R17, 20
LDI  R18, 30
MUL R16, R17
ADD R0, R18
R0 = in hex
R1 = in hex

b) Find the value in R0 and R1 after the following code.

LDI  R19, 19
SUBI R19, 10
LDI R30, 30
MUL R30, R19
R0 = in hex
R1 = in hex

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91259

Have any Question?


Related Questions in Computer Engineering

Junit test labyou will be creating a junit test class for

JUnit Test Lab You will be creating a JUnit Test Class for Gradebook.java, that has been provided for you.   Add a getScoreSize() method to the Gradebook class which returns scoresSize; Add a toString() method to the Gra ...

Question 1 suppose i need 10 bits to specify the offset

Question 1 : Suppose I need 10 bits to specify the offset within a page and 22 bits to specify the virtual page number and 18 bits to specify the physical page number. How big is a page in bytes? How big is the virtual m ...

Question suppose a class car is a child of a class vehicle

Question : Suppose a class Car is a child of a class Vehicle. Suppose Vehicle and Car have methods Move(). Method Move() of the class Car calls method Move() of the class Vehicle(). Write the statement in Move() of the c ...

Questionhow can you start business by mobile application

Question How can you start business by Mobile Application Development ? Discuss the testing process of Mobile Applications in detail ? List important steps for publishing an app in the Target Market ?

Penetration testing is a technique used to identify

Penetration testing is a technique used to identify security weaknesses in your network. Discuss a type of penetration testing and the different methods utilized to recognize vulnerabilities in your network.

Question body image please respond to the followingdebate

Question: "Body Image" Please respond to the following: Debate It - take a position on this statement: Media cause individuals to develop negative and unrealistic body images. Support your views with two or three reasons ...

Explain that our ability to secure each computers stored

Explain that our ability to secure each computers stored information is now influenced by the security on each computer to which it is connected

You own a specialty company self made company smc which

You own a specialty company; self made company (SMC) which sells hats and jackets. You obtained an object IDENTIFIER 5000 under enterprises node from IANA. You have two branch locations. Each has an inventory system that ...

Question suppose you are given an instance of the

Question : Suppose you are given an instance of the fractional knapsack problem in which all the items have the same weight. Show that you can solve the fractional knapsack problem in this case in O(n) time.

Describe an ethical conundrum found in a magazine or

Describe an ethical conundrum found in a magazine or newspaper article, and please give your own thoughts. Give good citations, of course.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As