EE 476: Laboratory 3
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.
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.
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
- Light LED 0 if the code is 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
- The security manager sitting at the PC should be able to:
- Add a new security code. The system must be able to process at least 8 different codes. Codes should survive a power failure.
- Delete an existing security code.
- List all existing codes.
- Force an unlock at any time.
- Force a lockdown in which no code can open the door.
- Release a lockdown so that correct codes will open the door again.
- Set the time and day. The day is given as sequential days counting from
- 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 Dec 2006