Skip to content

aparreno14/MSP430FR6989-Digital-Lock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MSP430FR6989 Digital Lock (CCS)

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.

Authors

  • Alejandro Parreño Minaya — GitHub: aparreno14
  • Diego Ostos Arellano

Overview

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

Hardware / I-O mapping

  • 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)

How it works (state machine)

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.

UART input rules

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.

Repository contents

  • 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

Build and flash (CCS)

  1. Open Code Composer Studio.
  2. Import the repository as an existing CCS/Eclipse project.
  3. Select MSP430FR6989 LaunchPad (or use the provided target configuration).
  4. Build (Debug or Release) and run/debug to flash the firmware.

License

MIT — see LICENSE.

Disclaimer

Published for educational and portfolio purposes.

About

Digital lock firmware for the MSP430FR6989 LaunchPad: UART-based code entry, on-board LCD feedback, attempt counter, and long-press reset (Code Composer Studio, UCM Computer Structure 2023–24).

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors