Amin Aun

cs122a

FINAL PROJECT: Follow Me ( 1 player )

aaun@cs.ucr.edu

 

DESCRIPTION OF PROJECT:

The circuit is actually a game that functions in a similar manner to Simon Says:

it has a series of sixteen buttons from which it lights one up for a predetermined amount of time, in which the user must press the button if he/she is to recieve a point. The game ends when the user has scored more than 99 points or has scored less than -99 points (in this game you can lose more than you have!!!). The game can be restarted by pressing any button when the initial run of the game has ended.

points are awarded based on the following requirements:

+1 - If the correct button was pressed in the time allowed to press the correct

button.

-1 - If the wrong button was pressed in the time allowed to press the correct

button.

-5 - If the correct button was not pressed in the time allowed to press the

correct button.

USER'S MANUAL:

1). In order to activate the game first, connect the power and ground to the

bread board that features the LCD display. The two wires should be connected

respectively to the power lines on which their colors correspond ( red =

power, black = ground ).

2). Pulse (set high for a moment, then low again ) dip pin # 9 on the 8052 chip

in order to get the program running.

3). The LCD display should light up and say "Press to start", at that time,

press any of the 16 buttons in order to begin playing

4). The game will randomly lit up one of the sixteen buttons, at that time you

must press the right button in the amount of time allowed, or lose points

5). If you get more than 99 points, the game will say "YOU WIN :-)". Likewise if

you get less than -99 points, the game will say "YOU LOSE :-(". It will then

give you the option to start playing again by saying "Press to play". Once

you have pressed any of the 16 buttons, the game will proceed normally as

described in steps 3 to 4.

IMPLEMENTATION:

The project was completed by using the following components:

  1. 1k resistor (1)
  2. 2. 4.7k resistor (1)

3. 16 momentary buttons

4. LCD

5. 5V power supply

6. Phillips PDS51 development board

7. Programmer LCPX5X40

8. NTE 7404 hex invertor

9. 16 red LED

10. MM74HC373 Octal D-type latch (4)

11. Motorola SN74LS138N decoder

12. Phillips 8052 microcontroller

13. 12 mhz ocillator

14. A LOT OF WIRE

15. "and a partridge in a pear tree"

IMPLEMENTATION:

I first had to write the code to implement the hardware, using as my foundation the

code that I wrote for lab 2, which involved using a keypad. I first set out

to wire the 16 momentary buttons in the same manner as showen in diagram 1 below. I did this in order to be able to manipulate the buttons in the same format as I had done with the keypad, and to have the same number of input and output connections.

 

Diagram 1

The next thing that I did was to wire up the buttons to the 8052 and the LCD.

As showen in diagram 2. After doing this step, I then connected a 4.7k resistor to the port 0.0 of the 8052 in order to be able to activate enable the SN74LS138N 4-to-8 decoder.

 

 

 

Source Code for Project
This page in word format