You are on page 1of 3

ECP2216 Individual Assignment Trimester 1 2010/2011

________________________________________________________________________

Individual Assignment

Objectives
§ Gain experience in assembly language programming with MCS-51 instruction set.
§ Employ the knowledge in utilizing the 8051 on-chip peripherals.
§ Apply the interfacing techniques learnt through ECP2216.
§ Learn the fundamental of microcontroller system simulation.

Mode of submission
§ Assessment Marks: 10%
§ One printed report:
Ø Printed on A4 papers (single spacing with 12-pt Times New Roman).
Ø Properly stapled or bound with a cover showing the subject name and code,
name, student ID, email and course/major.
Ø Minimum 4 pages, maximum 8 pages, excluding the source codes.
§ A disk (CD/DVD) with complete source codes (ASM file), program (HEX file) and
report (DOC file).
§ Due date: 5pm on 23th August 2010 (Monday, Week 11).
§ Late submission: minus 2% (out of 10%) per day.
§ Submit to Mdm. Miskiah at Advanced Microprocessor Lab, Faculty of
Engineering, Multimedia University.

Description
Electronic locks are locking devices which are usually associated with access control
system. They may use magnets, solenoids, or motors to engage the lock via supplying or
removing electric current. There are various authentication methods used with electronic
locks, such as numerical codes (passcode), smart card, biometric, RFID etc.

In this assignment, the students are required to implement and simulate an electronic lock
system using the Edsim51 simulator (www.edsim51.com), which is based on the 8051
microcontroller. The system allows the user to enter a 4-digit passcode via a keypad as
the mean for authentication (as shown in Figure 1). Thus, it will make use of the keypad,
the LCD display module, the motor and its sensor and a switch (SW0) of the simulator.

Figure 1: An electronic lock with keypad.

________________________________________________________________________
Page 1 of 3
ECP2216 Individual Assignment Trimester 1 2010/2011
________________________________________________________________________
Basically, the system has four modes of operation as described below:
i. Initialization Mode
ii. Passcode Changing Mode
iii. Authentication Mode

Initialization Mode
The system will go into this mode upon power on or system reset, which consists of
performing the following steps in a sequential order:
i. Rotate the motor counter-clockwise to the initial position (motor is aligned with the
sensor, as shown in Figure 2).
ii. If the door is currently closed (SW0=0 when the door is opened and SW0=1 when the
door is closed), close the lock by rotating the motor clockwise for 1 rotation.
Otherwise, repeat this step until the door is closed and locked before proceeding to
the next step.
iii. Prompt and wait for the user to press a key, as shown in Figure 3.
iv. If the key pressed is ‘*’, go to the ‘Passcode Changing Mode’.
v. If the key pressed is ‘#’, go to the ‘Authentication Mode’.
vi. Go back to step (iii) if any other key is pressed.

Sensor

Figure 2: Initial position of the motor (sensor changes from black to red)

Figure 3: LCD display while waiting for the user’s input

Passcode Changing Mode


The following steps are carried out sequentially in this mode:
i. Prompt the user to enter the current passcode (a default passcode should be used after
power on or system reset), as shown in Figure 4.
ii. If an invalid passcode has been entered, as shown in Figure 5, go back to step (iii) of
the ‘Initialization Mode’.
iii. If a valid passcode has been entered, prompt the user to key in a new 4-digit
passcode, as shown in Figure 6.
iv. Prompt the user for the new passcode again for confirmation, as shown in Figure 7.
v. Go back to step (iii) of the ‘Initialization Mode’.

Figure 4: LCD display asking for old passcode.

Figure 5: LCD display if invalid passcode has been entered.

________________________________________________________________________
Page 2 of 3
ECP2216 Individual Assignment Trimester 1 2010/2011
________________________________________________________________________

Figure 6: LCD display asking for new passcode.

Figure 7: LCD display asking for new passcode for confirmation.

Authentication Mode
The following steps are carried out sequentially in this mode:
i. Prompt the user to key in the current passcode (a default passcode should be used
after power on or system reset), as shown in Figure 8.
ii. If an invalid passcode has been entered, as shown in Figure 5, go back to step (iii) of
the ‘Initialization Mode’.
iii. If a valid passcode has been entered, as shown in Figure 9, open the lock by rotating
the motor counter-clockwise for 1 rotation.
iv. Wait 30 seconds before going back to step (ii) of the ‘Initialization Mode’.

Figure 8: LCD display asking for current passcode to unlock door.

Figure 9: LCD display when the lock is opened.

Requirements
In this assignment, each student should write an assembly language program using the
MCS-51 instruction set to carry out the three basic modes of operation described above
and to simulate the system using the Edsim51 simulator. Additional marks will be
awarded if extra features (e.g. only allow three attempts for passcode entrance) or
operation modes are implemented. In this case, the extra features or operation modes can
only use the devices or peripherals available with the Edsim51 simulator.

Assessment Scheme
Report
A brief but succinct introduction to the assignment - 10
A concise explanation of the program (with flowcharts) - 25
A description of the additional features or operation modes - 15
A conclusion summarizing the achievement and limitation of the program - 10
Subtotal - 60

Program
Proper functionality (correct operation, stable etc.) - 25
Additional features or operation modes - 15
Subtotal - 40

Total 100
Actual 100/10 = 10%

________________________________________________________________________
Page 3 of 3

You might also like