Digital lock firmware for the MSP430FR6989 LaunchPad, developed in C with Texas Instruments Code Composer Studio (CCS).
Coursework project (UCM, 2023–2024). Team of 2.
- Alejandro Parreño Minaya — GitHub: aparreno14
- Diego Ostos Arellano
This project implements a simple digital lock with:
- Code entry via UART (serial terminal)
- 6-character on-board LCD feedback
- Attempt counter and lockout state
- Short-press input clear and long-press reset
-
UART: eUSCI_A1 on P3.4 / P3.5 (serial terminal input)
-
Buttons:
- P1.1 (S1): confirm / set code depending on state
- P1.2 (S2): clear input; long-press resets the lock
-
LEDs:
- P1.0: red LED (lockout / error feedback)
- P9.7: green LED (unlocked indicator)
-
Display: on-board LCD (6-character buffer)
The lock tracks an internal “attempts/state” variable:
-
Unlocked state: shows OPEN on the LCD (green LED ON).
- Pressing S1 stores the current 6-character buffer as the new key and locks the system (shows CLOSED, green LED OFF).
-
Locked state (attempts remaining):
-
Pressing S1 compares the entered buffer with the stored key:
- If correct: unlocks (OPEN, green LED ON).
- If incorrect: decreases attempts, shows CLOSED and blinks the red LED; when attempts reach 0, it enters BLOCK state (red LED ON).
-
-
Blocked state:
- UART input is ignored and the display remains in BLOCK.
-
S2 behavior:
- Short press clears the input buffer and re-shows OPEN/CLOSED depending on the current state.
- Long press triggers a reset sequence (RESET blink), clears buffer, restores the unlocked state (OPEN), green LED ON, red LED OFF.
Incoming UART characters are shifted into a 6-character buffer (most recent character on the right). A space character is treated as “blank”.
Note: the LCD rendering assumes uppercase A–Z plus blank. For a production-grade version, sanitize input to avoid out-of-range characters.
- main.c — application firmware (UART ISR, button ISR, timer ISR, LCD output)
- lnk_msp430fr6989.cmd — linker command file
- .ccsproject / .cproject / targetConfigs — CCS project and target configuration
- Open Code Composer Studio.
- Import the repository as an existing CCS/Eclipse project.
- Select MSP430FR6989 LaunchPad (or use the provided target configuration).
- Build (Debug or Release) and run/debug to flash the firmware.
MIT — see LICENSE.
Published for educational and portfolio purposes.