Professional Documents
Culture Documents
System
MICRO P
SEE 3223
SEMESTER 2 2009/2010
ASSIGNMENT 10
“ALARM SYSTEM”
Section 01
1
SEE 3223 Microprocessor Alarm
System
Table of Contents
1: Introduction 3
2: Objectives 4
4:Statement of Problem 5
5:System Design
5.1: Flow Chart
5.1.1: Interrupt 8
5.1.2.:Exit , Entry and Protective Mode 11
5.2: IDE 68k Alarm System Design 14
7: Discussions
7.1: Interrupt, Exception ,Trap 21
7.2: IDE 68k Alarm system 22
8: Conclusion 25
9: References 26
2
SEE 3223 Microprocessor Alarm
System
1. Introduction
and design the flow chart. Finally, students need to write the program by
using IDE 68k assembler and run the program. Interrupts, exception, trap,
language. The output was tested by using the hardware of visual simulator
such as switch, LED and seven segment display. Finally students try to
3
SEE 3223 Microprocessor Alarm
System
2. Objectives
simulator.
4
SEE 3223 Microprocessor Alarm
System
4. Statement of Problem
In this assignment you will be using the 68000 IDE Version 2.11 and the
Visual Simulator Version 1.40. You will build 68000 program, cross-assemble
and assemble it using the 68000 IDE. You will run the program using the Visual
Simulator. The program will use the Peripheral simulator built in the Visual
Simulator for its Input/Output interface.
Bit Function
#
0 SECTOR1_LED
1 SECTOR2_LED
2 SECTOR3_LED
3 SECTOR4_LED
4 Siren On (SIREN_ON)
5 Counting Down done (COUNT_ZERO)
6 Alarm Armed (ARMED_LED)
7 Alarm Disarmed (DISARMED_LED)
5
SEE 3223 Microprocessor Alarm
System
Bit Function
#
0 Main door opened (MAINDOOR)
1 Sensors at sector 1 (SECTOR1_SENSOR)
2 Sensors at sector 2 (SECTOR2_SENSOR)
3 Sensors at sector 3 (SECTOR3_SENSOR)
4 Sensors at sector 4 (SECTOR4_SENSOR)
5 Password bit #0
6 Password bit #1
7 Password bit #2
Requirements:
If alarm is DISARMED the system will do nothing while waiting for an Arm
alarm signal.
When the Alarm is ARMED and it will go into EXITENTRYDOOR mode
first before entering PROTECTIVE mode. In the EXITDOOR mode seven the
segment panel begins counting down from ten to zero in lapse of
approximately 1 second per count. In this mode the ARMED_LED will flicker.
When the count reach zero the alarm will go into PROTECTIVE mode.
In PROTECTIVE mode, if the main door is opened the alarm will go into
ENTRY mode. In the ENTRY mode seven the segment panel begins counting
down from ten to zero in lapse of approximately 2 second per count. In this
mode the DISARMED_LED will flicker. In this mode, unless the correct
PASSWORD is entered before the count is zero; the siren will be switch ON.
The password is entered by setting the switch panel then followed by
pressing the I5 button
Anytime in the PROTECTION mode, if any of the sectors’sensors are
activated, the siren will be switched ON.
Assuming a condition that the owner has not exit the main door (say just
woke up or accidentally trigger an ALARM), anytime in the PROTECTION
mode, if a PASSWORD entry is entered and correct, the alarm will be
DISARMED and the siren will be switched OFF (regardless of its current
state).
When siren is ON, the alarm disarm button will not disarm the alarm
unless a correct 8-bit password has been entered from the switch panel,
6
SEE 3223 Microprocessor Alarm
System
STANDBY bit 0
COUNTDOWN 10
Do ; ARMED:EXITDOOR mode
COUNTDOWN COUNTDOWN-1
Toggle ARMED_LED bit
Wait 1 second
While (COUNTDOWN <> 0)
COUNT_ZERO 1
Repeat
If (ALARM_ARM flag= 1)
If (MAINDOOR = ON)
Siren Bit 1
Else
ALARM_ARM 2 ;PROTECTION mode
ARMED_LED 1
DISARMED_LED 0
Endif
Endif
If (ALARM_ARM flag= 2) ;PROTECTION mode
IF (PASSWORD_CORRECT flag = 1) ;Password correct
ALARM_ARM flag 0
Siren LED 0 ;OFF siren
End if
Endif
If (SIREN_ON = 1)
IF (PASSWORD_CORRECT flag = 1) ;Password correct
Siren LED 0 ;OFF siren
ARMED_LED 0 ;
DISARMED_LED 1
End if
Elseif (ALARM_ARM flag = 2) ;If ARMED:PROTECTION mode
If (MAINDOOR = ON) ;
COUNTDOWN 10
7
SEE 3223 Microprocessor Alarm
System
Forever
End
8
SEE 3223 Microprocessor Alarm
System
5. System Design
Interrupt 4 Interrupt 5
INT 4 INT 5
INTERRUPT 4 INTERRUPT 5
EXCEPTION
“DEVIDE BY ZERO” PASSWORD = 11110000
D0-11110000
NO
TRAP #15 PASSWORD ARMED LED = 1
INCORRECT DISARMED LED = 0
DO =0? SIREN LED =1
SOUND =1
YES
PASSWORD
CORRECTCO
ARMED LED = 0
DISARMED LED = 1
SIREN LED =0
SOUND =0
9
SEE 3223 Microprocessor Alarm
System
Interrupt 6 Interrupt 7
INT 6 INT 7
INTERRUPT 6 INTERRUPT 7
SYSTEM ARMED
OR EXIT MODE
SYSTEM DISARMED
(Correct password must
key in. Otherwise, alarm
will be triggered. )
ARMED LED =1
DISARMED LED=0
10
SEE 3223 Microprocessor Alarm
System
START START
PRESS “INT 6”
DO
NOTHING
ARMED LED =1
DISARMED LED =0
END SYSTEM ARMED
SYSTEM
DISARMED
DO=10
D0 =D0 -1
DELAY 1S
DISPLAYED D0
NO
DO =0?
YES
PROTECTIVE
MODE
11
P
SEE 3223 Microprocessor Alarm
System
ENTRY MODE
PROTECTION MODE
NO
MAINDOOR
Q OPEN?
YES
DO=10
D0 =D0 -1
DELAY 2S
DISPLAYED D0
NO
DO =0?
YES
SIREN NO
ARMED LED =1 ENTER CORRECT
SIREN LED =1 PASSWORD?
SOUND=1
YES
SYSTEM DISARMED
ARMED LED = 0
DISARMED LED =1
SIREN LED =0
SOUND=0 12
SEE 3223 Microprocessor Alarm
System
PROTECTIVE MODE
NO
ARMED LED =1 SENSOR 1
SIREN LED = 1 =1?
SECTOR1 LED = 1
YES
YES
YES
YES
P
13
SEE 3223 Microprocessor Alarm
System
14
SEE 3223 Microprocessor Alarm
System
15
SEE 3223 Microprocessor Alarm
System
16
SEE 3223 Microprocessor Alarm
System
17
SEE 3223 Microprocessor Alarm
System
18
SEE 3223 Microprocessor Alarm
System
SECTOR SECTOR
ARMED SIREN 3 1
6.2. SWITCH
19
SEE 3223 Microprocessor Alarm
System
20
SEE 3223 Microprocessor Alarm
System
7.Discussion
Interrupt function
Interrupt 4
First, Interrupt function 4 will start by display the name of the Group
member.
Start from Damian, Ngo and sam
Output:
Finally, it will run Trap #9 function which will terminate the program. We
need to reset the program in order to run it again.
21
SEE 3223 Microprocessor Alarm
System
The system is enter the exit mode, end counter will count for 10 amd displau in
seven segment display.
When the counter finish count, it will go into protective mode which denoted by
“Prot”at seven segment display and armed LED=1 .
In the protective mode. If the main door open (switch0=1) the program will enter
the “entry mode”counter will count 10 times with 2 second delay each time.
During the counting time, correct password need to enter to disarmed the alarm
The correct password is #%11110000
If the password correct: disarmed LED=1, seven segment display: “darm”
22
SEE 3223 Microprocessor Alarm
System
If the password is incorrect or no password is key in after the counting time. The
alarm will triggered. It will denoted by
Armed LED=1
Siren LED =1
Seven Segment display : “beeP”
Sound =1
23
SEE 3223 Microprocessor Alarm
System
In the protective mode. If the main door not open (switch0=0) the program will
remained at the “protective mode”. which denoted by “Prot”at seven segment
display and armed LED=1 .
If any sensor switch is triggered. The alarm system will be triggered as well.
Example: sensor 2 is triggered
Output: Armed LED=1
Siren LED=1
Sensor 2 LED=1
Sound =1
Seven Segment display : “beeP”
To disarmed the triggered alarm, user can only use the interrupt 7 (disarmed
interrupt) and key in the correct password,
The alarm remained triggered as long as incorrect password is keyed in.
24
SEE 3223 Microprocessor Alarm
System
8.0 Conclusion
of the program.
Visual Simulator.
Flight 68k.
25
SEE 3223 Microprocessor Alarm
System
9.0 References
by M. RAFIQUZZAMAN, Ph.D.
26
SEE 3223 Microprocessor Alarm
System
27