EE 476: Laboratory 3
Security system
Introduction.
You will produce a security system with keypad and LED display. The security
system will be controlled by and report to a administrators PC. The operation
of the PC interface and keypad interface must be fully concurrent.
Procedure:
The Keypad:
You will need to get user input from a keypad as you did in the last lab. The keypad must be debounced.
Serial connection to the PC:
Be sure to read the serial
communication page. The serial port on the STK500 board should be connected
to the COM port of the PC which has the USB dongle. There is also a jumper on the STK500 which must be added
to enable the serial port. On the PC, the terminal program should be set
to 9600 baud, no parity, one stop bit, and no flow control.
Assignment
Write a program in C for the microcontroller with these specifications:
- Wait for the user to enter a 4-digit (digits 0 to
9 inclusive) security code using the keypad. After four digits are
entered:
- Light LED 0 if the code is correct correct, and log the clock time (day:hrs:min)
and 4-digit security code to Hyperterm on the PC.
- Light LED 7 if the code is incorrect, and log the clock time (day:hrs:min)
and security code to the PC, with a indication of incorrect status (for
instance, an astrisk next to the security code).
- Lock out the user for one minute if there are 3 incorrect consecutive
tries.
- The security manager sitting at the PC should be able to:
- Add a new security code. Eight different codes
should be available for demo.
- Delete an existing security code.
- List all existing codes.
- Force an unlock.
- Force a lockdown.
- Set the time and day. The day is given as sequential days counting from
Jan 1.
- The only code running on the PC and interacting with the microcontroller
program should be Hyperterm.
- Keypad entry and security manager interactions must be fully concurrent.
The keypad must operate correctly even when the security manager is communicating
with the microcontroller. Neither the keypad or serial link to the PC can
block while waiting for input.
When you demonstrate the program to a staff member, you should exercise the
keyboard entry functions and PC commands simultaneously.
Your written lab report should include:
- The scheme you used to decode the keyboard.
- The scheme you used to convert the code to formatted ASCII.
- A schematic of the curcuit you built.
- A heavily commented listing of your code.
Copyright Cornell University Oct 2005