Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

We are using Silicon Labs the C8051F020-TB www.silabs.co This is a ping-pong game the class is the embedded system and the project needs to be

image text in transcribedimage text in transcribed

We are using Silicon Labs the C8051F020-TB

www.silabs.co

This is a ping-pong game the class is the embedded system and the project needs to be done using assembly language for the microcontroller 8051. The hardware is silicon laboratories

Introduction. In this project, you will design a two-player game using the bar graph and two push buttons. Each player will control one of two paddles" and each will try to return the "ball" to his opponent by pressing the button just as the ball arrives on his side. Using the hardware you have already developed for Lab 3, write an assembly program that meets the requirements on the next page. Document your code well. Write a file header that briefly describes your program. Each subroutine should have a header that describes its inputs, outputs and side effects. There should be no unexplained "magic" numbers, and 40% or more of the lines of code should either have or be a comment. The project must be demonstrated to your lab instructor, who will verify that it meets the requirements during your lab section. A copy of your assembly code is due during the following class period. Due dates will be announced in class. Requirements. The requirements for this project are as follows: 1. The display shall consist of a 10-LED bar graph mounted horizontally. For the 2. There shall be 2 buttons, each in the proximity of a different end of the bar graph. 3. Two DIP switches shall be used to configure the time window (see below) for 4. The buttons shall be sampled with a period of approximately 10 milliseconds. purposes of discussion, the LEDs are numbered from 1 to 10, starting from the leti. The button on the left is used by player 1 and the button on the right is used by player 2 player one, two more switches shall be used to configure the time window for player two, and the remaining switches shall be used to set the speed of the ball. 5. After the system is reset, the LED on one end of the bar graph shall be lit (either 6. The lowest configurable ball speed shall be 10 steps (LED changes) per second. 7. If the receiving player presses his button within his time window (see below), the LED 1 or LED 10) to represent the ball. Theli LED will then migrate toward the other end of the bar graph at a speed defined by the DIP switches. At least one faster speed must be available. This speed shall not exceed 100 steps per second. ball immediately reverses direction and his opponent becomes the new receiving player. If not, the ball stops at the last LED on the bar graph (either LED 1 or LED 10) and remains there until the system is reset. 8. The time window for player 1 is defined as the time the ball is at LED position 9. The time window for player 2 is defined as the time the ball is at LED position 10.Each time the system is reset, the ball is served in a direction opposite the 1 through n, where n is the time window size for player 1 (1 s ns3) 11-m through 10 where m is the time window size for player 2 (1 s ms 3) direction it was served in the previous game. Introduction. In this project, you will design a two-player game using the bar graph and two push buttons. Each player will control one of two paddles" and each will try to return the "ball" to his opponent by pressing the button just as the ball arrives on his side. Using the hardware you have already developed for Lab 3, write an assembly program that meets the requirements on the next page. Document your code well. Write a file header that briefly describes your program. Each subroutine should have a header that describes its inputs, outputs and side effects. There should be no unexplained "magic" numbers, and 40% or more of the lines of code should either have or be a comment. The project must be demonstrated to your lab instructor, who will verify that it meets the requirements during your lab section. A copy of your assembly code is due during the following class period. Due dates will be announced in class. Requirements. The requirements for this project are as follows: 1. The display shall consist of a 10-LED bar graph mounted horizontally. For the 2. There shall be 2 buttons, each in the proximity of a different end of the bar graph. 3. Two DIP switches shall be used to configure the time window (see below) for 4. The buttons shall be sampled with a period of approximately 10 milliseconds. purposes of discussion, the LEDs are numbered from 1 to 10, starting from the leti. The button on the left is used by player 1 and the button on the right is used by player 2 player one, two more switches shall be used to configure the time window for player two, and the remaining switches shall be used to set the speed of the ball. 5. After the system is reset, the LED on one end of the bar graph shall be lit (either 6. The lowest configurable ball speed shall be 10 steps (LED changes) per second. 7. If the receiving player presses his button within his time window (see below), the LED 1 or LED 10) to represent the ball. Theli LED will then migrate toward the other end of the bar graph at a speed defined by the DIP switches. At least one faster speed must be available. This speed shall not exceed 100 steps per second. ball immediately reverses direction and his opponent becomes the new receiving player. If not, the ball stops at the last LED on the bar graph (either LED 1 or LED 10) and remains there until the system is reset. 8. The time window for player 1 is defined as the time the ball is at LED position 9. The time window for player 2 is defined as the time the ball is at LED position 10.Each time the system is reset, the ball is served in a direction opposite the 1 through n, where n is the time window size for player 1 (1 s ns3) 11-m through 10 where m is the time window size for player 2 (1 s ms 3) direction it was served in the previous game

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions