Lab Project - Embedded Systems Lab

UNIVERSITY OF JORDAN
Embedded Systems Lab
Memory Game
Preferred Group
Grading
Project Due Date
Size
(3) Three is the allowed group (15) 15 marks is the project (26) Week starting 26th
size. The group can be from the weight, counted as part of the April 2015.
same class (recommended) , or final examination. Project marks
from in between classes (allowed are not disclosed to students
but highly discouraged)
Project Description:
In this lab course project, you are required to implement a memory game. There will be two PICs. One
of the PICs has the game coordinator role which sends a pattern of shapes generated randomly to the
other PIC. The second PIC has the player role which replies back to the coordinator PIC with the
received pattern, but within specific time period. If no answer within the specified time period, the
coordinator will assume that there is no answer, and the game will end and display the score on the
LCD.
Hardware Layout
This project will require one person to handle a game with two PIC microcontrollers. Each of the two
PICs performs specific functions. The two PICSs are a player’s and a coordinator’s PIC. They are
connected as in the following figure:
LCD
LCD
Coordinator’s
PIC
Player’s PIC
r
s
s
t
c
The coordinator’s PIC is connected to: 1) LCD, 2) One push button (s), and 3) To the player’s PIC. The
player’s PIC is connected to: 1) LCD, 2) Four push buttons (r, s, t, and c), 3) Seven segment display
and 4) To the coordinator’s PIC.
Game Rules
The push button on the coordinator is just to start/stop the game. The first time the button is clicked, the
game starts. Next click, the game stops and so on.
The 4 push buttons on the player’s PIC are corresponding to 4 shapes: an example is r for rectangle, s
for square, t for triangle, and c for circle. For instance, if the push button “r” is clicked, it is interpreted
as if the player entered rectangle. These four shapes are given just as an example. Each group must
build 4 different shapes.
Page 2 of 4
Once the game is started, the coordinator’s PIC will start sending a pattern of shapes sequentially to the
player’s PIC. The shapes are selected out of the four shapes which are represented by the four push
buttons connected to the player’s PIC. The pattern is generated randomly at the coordinator’ PIC. The
number of shapes to be sent per pattern can be selected by the team.
When the player’s PIC receives the pattern, the pattern is displayed on the LCD connected to the player
PIC for short period. After this short period, the pattern disappears. Also, a timer starts counting down
on the seven segment display (SSD) that is connected to the player’s PIC. The time on the SSD is the
remaining time during which the player can send the answer. Once the time arrives to zero, the game
will end and the score will be displayed on the LCD, the score represents the number of levels the
player has reached.
An example of how the game is played and supposing that the shapes that are saved on the 4 push
buttons are rectangle, square, circle and triangle: At level one of the game, if the coordinator sent the
following pattern to the player: rectangle, square, square, circle, rectangle, and square. The coordinator
also sent a timeout of 8 seconds and LCD timeout of 4 seconds. When the player’s PIC receives the
pattern along with the timeouts, the LCD shows the received pattern for 4 seconds. After 4 seconds the
pattern disappears from the LCD. Also, the seven segment display starts counting down from 8 to zero.
After 8 seconds, if the player did not enter the shown pattern, the time is out and the game will end
where the score will be displayed on the LCD. During the 8 seconds timeout, the player should enter
the correct pattern, in this case by pressing the push buttons in the following sequence: r, s, s, c, r, and
s.
The difficulty level of the game should increase as the game goes on and as the player answers
correctly. Difficulty level can be increased using one or more of the following ways:
1)
2)
3)
Sending more shapes, for example the first level is by sending 2 shapes and next
level by sending 3 shapes and so on,
Reducing the time to answer, for example the first level you have to answer within 3
seconds, second level within 2 seconds and so on.
Or reducing the time while pattern is shown on the LCD display. For example, the
first level shows the pattern for 4 seconds before the pattern disappears from the
LCD, the second level shows the pattern for 3 seconds and so on.
When the coordinator’s PIC sends the pattern to the player, the pattern will also be shown on the
coordinator’s LCD. Once the player sent the pattern back to the coordinator, the coordinator LCD will
show the received pattern from the player. And the player LCD will show whether the answer was
correct or wrong, along with the score of the player.
After the player sends the correct answer, the next pattern along with the score will be sent to the
player. The program should add suitable delays in order for the player to read the pattern on the LCD.
Page 3 of 4
Important Notes
 Start as early as possible on your project, though the project description sounds simples, there is
inherent complexity in both hardware and software aspects, so do not underestimate the time it
needs, you will have many problems along the way which you will have to resolve!
 Never think of buying a model or commissioning someone to do it for you, not only will you get a
zero in the project, but also your act will be considered as a direct violation to JU laws and your
actions shall be reported as cheating in the final exam!
 Code sharing between groups is not allowed!
 If you acquire a part of your software from a book, website, etc … kindly reference it properly, else
it will be considered as plagiarism.
 You are only allowed to base your project on PIC16877a or PIC1684a.
 All programming must be done in PIC ASSEMBLY language only; using high level languages in
the project will get you a Zero.
 Your submitted work must be professional:
1. Hardware: you are submitting a product, all electrical and electronic components must be
hidden from the user, only user-accessed components are visible, hide the wiring, be neat. Still,
the instructor should be easily able to examine the internal components at the time of
discussion when required!
2. Software: your work should be fully documented, all inputs/outputs should be listed, and
each subroutine/macro should be fully documented! Use functional comments! Refer to the last
section in experiment 3 regarding documentation.
 You should submit two types of flowcharts:
1. An abstract general flowchart of the whole program.
2. A flowchart for each of your written subroutines/macros (software codes taken from the lab
experiments ARE NOT required)
 Students are not allowed to move between groups once they are formed, so choose your group
carefully from the beginning! We are not responsible if your colleagues in the group chose to drop
the class, we will not allow you to join another group!
 Divide the work such that each student is responsible for a specific task, YET EVERY student is
required to answer for ANY QUESTIONS in relation to any submitted work of the project.
Report Guidelines
You should submit your report as a hard copy. Submission due date is week of April, 26th 2015
Your report should contain:
1. The flowcharts (as described above in the notes section)
2. Circuit diagram of your hardware (use Proteus or any other software to draw the circuit)
3. Any figures, tables which you find useful to include
4. The contribution of each student in the project!
Other Project Proposals
If you have another project idea which you would like to do instead! You should hand in a proposal (printed)
describing in details the idea of your project, the hardware components you think you might use, number of
students in this project to your direct engineer ONLY! He/She will notify you of the status of proposal
acceptance/refusal!
Proposals submissions deadline is March, 22nd 2014. Late proposal submissions will be turned down.
If you submit a project which has not been approved you will get a mark of Zero
Good Luck and Have Fun Building the Project
Page 4 of 4