8085 microprocessor project8085projects.in/wp-content/uploads/2016/12/15-16-report.pdf.pdf · aim...
TRANSCRIPT
8085
MICROPROCESSOR
PROJECT
GOATS AND TIGER GAME
MADE BY:
AJAY SINGH (15/EC/13)
AKASH NIRBHIK (16/EC/13)
SYNOPSIS
Aim – To make Goat and Tiger game using 8085
Microprocessor.
Description of Game –
The figure given represents the game board. The tiger and
goats can be placed on the intersections represented by black
dots. It’s a two player game, one player will control 1 tiger and
the other will control 5 goats. The goats and tigers can only be
moved along the lines of the board.
Gameplay – All the goats are placed on the board individually
at the beginning. You can only move the goats after you place
all the goats on the board. A tiger can capture a goat if there is
an empty intersection for the tiger to jump. The tiger wins if it
captures two goats, and goats win if they corner the tiger (i.e
when tiger is at a position where it cannot move anywhere).
There is a time limit of 1 minute for each player to play their
turn.
Implementation-
All the positions on the board are realized through 10 bicolour
leds. Each position will have a switch to select the same. The
goats and the tiger will be represented with different colours.
Two leds will be used to denote the turn. 6 leds will be used to
convey time limit(Initially all 6 leds will be on at the starting of
each players turn, then after an interval of 10 seconds each led
will go to off state thus all 6 leds comprising 1 minute). Two 7-
segmet displays will show the score of both the players.
ACKNOWLEDGEMENT
Firstly, we would like to thank Prof. Dhananjay Gadre for his unconditional support and thorough guidance without which this project would not have seen the light of the day. He not only guided us through the project but also played a vital role in helping us relate the theoretical concepts with their practical concepts and instilled in us enthusiasm to LEARN BY DOING. This project was definitely a milestone in our career and we learnt a lot more than just electronics, values of hard work and team work. We would also like to thank our friends and classmates especially Ayush gupta, Tyagi ,Ankush and Abhishek Pandey who worked with us and helped at each and every point of time we needed help and assistance. From helping us learn EAGLE, guiding to get PCB ready, helping us through the soldering sessions, getting corrections in software and also final checks on the clock and what not, they were always with us. It was a really good memorable experience working with all of them. We would also like to thank all the staff of the Department of
Electronics of Netaji Subhas Institute of Technology for
providing us with all the requisites for completion of this project.
BLOCK DIAGRAM
SCHEMATIC
BOARD
Final board
CODE ;Goats and Tiger Game Code
MVI A,80H ;INITIALLY TOP LED IS RED
STA ADDR
OUT 00H
MVI A,00H ;INITIALLY ALL GREEN LED OFF
OUT O1H
OUT 02H ;INITIALLY REMAINING TWO GREEN AND RED LEDS OFF
MVI A,80H ;CONTROL WORD FOR 8255_1
OUT 03H ;CONTROL REGISTER FOR 8255_1
MVI A,92H ;CONTROL WORD FOR 8255_2
OUT 43H ;CONTROL REGISTER FOR 8255_2
MVI E,05H
LXI SP,8000H
LXI H,FFFFH ;TO UPDATE THE NO. OF GREEN LEDS ON
MVI D,80H
LOOP: IN 40H ;PORT A OF 8255_2 (8 SWITCHES)
MOV B,A
IN 41H ;PORT B OF 8255_2 (REMAINING 2 SWITCHES)
ORI FCH
MOV C,A
ANA B
CMA
JZ LOOP ;SWITCH LOOP ENDS
MVI A,FFH ;FOR DOUBLE LOOP FOR MOVING GREEN LEDS
SUB E
JZ LOOP1
MOV A,D
JP NEXT
CALL GREEN
JMP AGAIN
NEXT: CALL RED
AGAIN: MOV A,D
CMA
MOV D,A
JMP LOOP
RED: MVI A,00H ;SUBROUTINE FOR RED
OUT 00H
MOV A,L
CMA
ANI 30H
OUT 02H
MOV A,B
CMA
OUT 00H ;PORT A OF 8255_1 (FOR RED LEDS)
MOV A,C
STA ADDR
CMA
ANI 03H
OUT 02H ;PORT C OF 8255_1 (FOR REMAINING 2 RED LEDS)
RET
GREEN: MVI A,00H ;SUBROUTINE FOR GREEN
OUT 01H
LDA ADDR
CMA
ANI 03H
OUT 02H
MOV A,E
JZ CHANGE
MOV A,B ;PLACING OF 5 GREEN LEDS
ANA H
CMA
MOV B,A
MOV A,C
ANA L
CMA
ANI 03H
MOV C,A
MOV A,B
OUT 01H ;PORT B OF 8255_1 (FOR GREEN LEDS)
MOV A,C
RLC
RLC
RLC
RLC
OUT 02H ;PORT C OF 8255_1 (FOR REMAINING 2 GREEN LEDS)
MOV A,B
CMA
MOV H,A
MOV A,C
CMA
MOV L,A
DCR E
RET
CHANGE: MVI A,00H
OUT 01H
LDA ADDR
CMA
ANI 03H
OUT 02H
PUSH D ;MOVEMENT OF GREEN LEDS(SWITCHING OFF LED)
MOV A,B
CMA
ORA H
MOV H,A
CMA
OUT 01H
MOV A,C
CMA
ORA L
MOV L,A
CMA
RLC
RLC
RLC
RLC
OUT 03H
MVI E,FFH
JMP LOOP
POP D
LOOP1: MOV A,B ;MOVEMENT OF GREEN LEDS(SWITCHING ON LED)
ANA H
CMA
MOV B,A
MOV A,C
ANA L
CMA
ANI 03H
MOV C,A
MOV A,B
OUT 01H
MOV A,C
RLC
RLC
RLC
RLC
OUT 02H
MOV A,B
CMA
MOV H,A
MOV A,C
CMA
MOV L,A
RET
CONCLUSION
EC-316 MICROPROCESSORS PROJECT has been a thoroughly enriching experience. We thank Prof. Gadre for such an opportunity which made us learn in depth about microprocessors and assembly language programming as well as small electronics things which are generally bypassed by the big concepts like led voltages, role of resistors, capacitors etc. It gave a good experience in digital as well as analog electronics. Learning by doing was accomplished. We gathered all the basic knowledge about the microprocessor
8085 and brushed up digital logic concepts which was to be
used in this project. The schematic diagram of various
components and connections was drawn on PCB software
EAGLE. The project gave us a good hand on experience to
work on EAGLE.
BIBLIOGRAPHY
TEXTBOOKS: 1. Microprocessor Architecture, Programming, and Applications with the 8085 Author: Ramesh Gaonkar Publisher: Penram International Publishing (India) Pvt. Ltd Edition: 5th edition ISBN: 9788187972099 2. The 8085 Microprocessor: Architecture, Programming and Interfacing Author: K.Udaya Kumar, B.S.Umashankar Publisher: Pearson Education India Edition: 1st edition ISBN: 9788177584554 3. Microprocessors and Interfacing Author: Douglas V. Hall Publisher: Mcgraw Hill Education Edition: 3rd edition ISBN: 9781259006159 DATASHEETS PROVIDED BY PROF. GADRE https://drive.google.com/folderview?id=0ByFqcybodzN8LS1PRTliN1lSdUU&usp=sharin g WEB LINKS 1. https://en.wikipedia.org/wiki/Intel_8085 2. www.nptel.ac.in/courses/106108100/pdf/Teacher_Slides/mod1/M1L2.pdf 3.http:// electronicsproject.org/microprocessor-based-home-security-system/ 4.http://8085projects.info/