Ask Question, Ask an Expert

+1-415-315-9853

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

1 change the rectanglecomponent for the animation program

1. Change the RectangleComponent for the animation program in Section 9.10 so that the rectangle bounces off the edges of the component rather than simply moving outside. 2. Write a program that animates a car so that it ...

Cost and measurement analysisidentify two non-current

Cost and Measurement Analysis Identify two non-current assets and comment on how Yahoo values these two assets in the balance sheet. Does the Yahoo have other alternatives as to how they could value the two assets? Which ...

1 what do you think would happen if the control connection

1. What do you think would happen if the control connection were severed before the end of an FTP session? Would it affect the data connection? 2. In FTP, if the client needs to retrieve one file from the server site and ...

1 how many invalid unused code sequences can we have in

1. How many invalid (unused) code sequences can we have in 5B/6B encoding? How many in 3B/4B encoding? 2. What is the result of scrambling the sequence 11100000000000 using each of the following scrambling techniques? As ...

1 we need to upgrade a channel to a higher bandwidth answer

1. We need to upgrade a channel to a higher bandwidth. Answer the following questions: a. How is the rate improved if we double the bandwidth? b. How is the rate improved if we double the SNR? 2. We have a channel with 4 ...

1 study and suggest the best ways to defend the national

1. Study and suggest the best ways to defend the national critical infrastructure from potential attackers. 2. We indicated in the text that the best ways to manage security threats is to do an extensive risk assessment ...

Consider a linear filter whose impulse response is the

Consider a linear filter whose impulse response is the second derivative of the Gaussian kernel exp( -x 2/2a 2). Show that, regardless of the value of a, the response of this filter to an edge modeled by a step function, ...

Chapter 1 discussed four general methods for coping with

Chapter 1 discussed four general methods for coping with complexity: modularity, abstraction, hierarchy, and layering. Which of those four methods does a protocol stack use as its primary organizing scheme? Give two scen ...

1 in an alphabet with 20 symbols what is the number of

1. In an alphabet with 20 symbols, what is the number of leaves in a Huffman tree? 2. Is the following code an instantaneous one? Explain 00 01 10 11 001 011 111 3. Assume a message is made of four characters (A, B, C, a ...

A polygon is a closed geometric shape consisting of three

A polygon is a closed geometric shape consisting of three or more line segments that are connected end to end. The endpoints of the line segments are known as vertices, which can be defined by points in the two-dimension ...

  • 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

Section onea in an atwood machine suppose two objects of

SECTION ONE (a) In an Atwood Machine, suppose two objects of unequal mass are hung vertically over a frictionless

Part 1you work in hr for a company that operates a factory

Part 1: You work in HR for a company that operates a factory manufacturing fiberglass. There are several hundred empl

Details on advanced accounting paperthis paper is intended

DETAILS ON ADVANCED ACCOUNTING PAPER This paper is intended for students to apply the theoretical knowledge around ac

Create a provider database and related reports and queries

Create a provider database and related reports and queries to capture contact information for potential PC component pro

Describe what you learned about the impact of economic

Describe what you learned about the impact of economic, social, and demographic trends affecting the US labor environmen