Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pm:prj2026:jan.vaduva:33160 [2026/05/09 23:19]
tudor_mihai.petcu
— (current)
Line 1: Line 1:
-====== Smart Digital Puzzle Game ====== 
  
-**Author**: Petcu Tudor-Mihai,​ grupa 333CD 
- 
-===== Introduction ===== 
- 
-The purpose of this project is to build an interactive digital puzzle game based on the ATmega328P Xplained Mini development board. The game will run directly on a 16x2 LCD, where the user will see the current level, the remaining time, and the puzzle state. The user will interact with the system through a keypad, while a bi-color LED and a buzzer will provide visual and audio feedback. 
- 
-The main idea behind the project is to create a simple embedded game that combines display control, keypad input, timing logic, and feedback signals. The project started from the idea of a simple access system, then evolved into a puzzle box concept, and finally became a fully digital puzzle game displayed on the LCD. This version is more practical, easier to test, and better suited for the available hardware. 
- 
-We chose this idea because it is interactive,​ easy to demonstrate,​ and allows us to combine several topics studied during the laboratory sessions, especially interrupts, timers/PWM, and UART for debugging. We think the project is useful for us because it gives us practical experience with both hardware and software integration. 
- 
-===== General Description ===== 
- 
-The project is built around the ATmega328P Xplained Mini development board, which controls all the hardware components. The system has the following main modules: 
- 
-  * **Main control unit** – the ATmega328P Xplained Mini coordinates the entire system. 
-  * **Input module** – a 4x4 keypad is used for user input, menu navigation, start, finish, and reset actions. 
-  * **Display module** – a 16x2 LCD shows the puzzle, the current level, the remaining time, and result messages. 
-  * **Feedback module** – a buzzer and a bi-color LED indicate game status, success, timeout, or errors. 
-  * **Game logic module** – software manages the countdown, level difficulty, puzzle updates, state transitions,​ and result validation. 
-  * **Debug module** – UART can be used for debugging and testing the hardware modules during development. 
- 
-A simple logical flow of the system is the following: 
- 
-  * the system waits in an idle state 
-  * the user presses a keypad button to start the game 
-  * the LCD shows the puzzle, the current level, and the countdown timer 
-  * the user interacts with the puzzle using the keypad 
-  * the puzzle state is updated on the LCD 
-  * if the user solves the puzzle before timeout, the system shows success and moves to the next level 
-  * if the timer reaches zero first, the system signals failure 
-  * the user can restart the game or continue to the next round 
- 
-The project can be described using the following software states: 
- 
-  * **Idle** 
-  * **Start Game** 
-  * **Game Running** 
-  * **Success** 
-  * **Fail / Timeout** 
-  * **Next Level / Reset** 
- 
-==== Block Diagram ==== 
- 
-The following block diagram presents the main hardware modules of the system and the way they interact. The ATmega328P Xplained Mini is the central control unit. It receives input from the buttons, controls the LCD, drives the servo motor, activates the buzzer and LEDs, and can optionally communicate with a PC through UART for debugging. 
- 
-<​html>​ 
-<​!DOCTYPE html> 
-<​html>​ 
-<​head>​ 
-<​title>​Untitled Diagram.drawio.html</​title>​ 
-<meta charset="​utf-8"/>​ 
-</​head>​ 
-<​body>​ 
-<div class="​mxgraph"​ style="​max-width:​100%;​border:​1px solid transparent;"​ data-mxgraph="​{&​quot;​highlight&​quot;:&​quot;#​0000ff&​quot;,&​quot;​nav&​quot;:​true,&​quot;​resize&​quot;:​true,&​quot;​xml&​quot;:&​quot;&​lt;​mxfile host=\&​quot;​app.diagrams.net\&​quot;&​gt;&​lt;​diagram name=\&​quot;​Page-1\&​quot;​ id=\&​quot;​ISBjk71iAZlT5E4kvOMc\&​quot;&​gt;&​lt;​mxGraphModel dx=\&​quot;​814\&​quot;​ dy=\&​quot;​616\&​quot;​ grid=\&​quot;​1\&​quot;​ gridSize=\&​quot;​10\&​quot;​ guides=\&​quot;​1\&​quot;​ tooltips=\&​quot;​1\&​quot;​ connect=\&​quot;​1\&​quot;​ arrows=\&​quot;​1\&​quot;​ fold=\&​quot;​1\&​quot;​ page=\&​quot;​1\&​quot;​ pageScale=\&​quot;​1\&​quot;​ pageWidth=\&​quot;​850\&​quot;​ pageHeight=\&​quot;​1100\&​quot;​ math=\&​quot;​0\&​quot;​ shadow=\&​quot;​0\&​quot;&​gt;&​lt;​root&​gt;&​lt;​mxCell id=\&​quot;​0\&​quot;/&​gt;&​lt;​mxCell id=\&​quot;​1\&​quot;​ parent=\&​quot;​0\&​quot;/&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​fff2cc;​strokeColor=#​d6b656;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​150\&​quot;​ x=\&​quot;​350\&​quot;​ y=\&​quot;​140\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-2\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontSize=16;​fontColor=#​FFB366;​\&​quot;​ value=\&​quot;​Power Supply\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​110\&​quot;​ x=\&​quot;​370\&​quot;​ y=\&​quot;​155\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-4\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​424\&​quot;​ y=\&​quot;​200\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​424\&​quot;​ y=\&​quot;​270\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-5\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​dae8fc;​strokeColor=#​6c8ebf;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​190\&​quot;​ x=\&​quot;​330\&​quot;​ y=\&​quot;​270\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-6\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontSize=20;​fontColor=#​7EA6E0;​\&​quot;​ value=\&​quot;​ATmega328P Xplained Mini\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​395\&​quot;​ y=\&​quot;​285\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-8\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​Array as=\&​quot;​points\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​220\&​quot;​ y=\&​quot;​300\&​quot;/&​gt;&​lt;/​Array&​gt;&​lt;​mxPoint x=\&​quot;​220\&​quot;​ y=\&​quot;​200\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​330\&​quot;​ y=\&​quot;​300\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-10\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​d5e8d4;​strokeColor=#​82b366;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​120\&​quot;​ x=\&​quot;​160\&​quot;​ y=\&​quot;​140\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-11\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontSize=20;​fontColor=#​97D077;​\&​quot;​ value=\&​quot;​Buttons\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​190\&​quot;​ y=\&​quot;​155\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-13\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​Array as=\&​quot;​points\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​610\&​quot;​ y=\&​quot;​300\&​quot;/&​gt;&​lt;/​Array&​gt;&​lt;​mxPoint x=\&​quot;​520\&​quot;​ y=\&​quot;​300\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​610\&​quot;​ y=\&​quot;​200\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-14\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​e1d5e7;​strokeColor=#​9673a6;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​120\&​quot;​ x=\&​quot;​550\&​quot;​ y=\&​quot;​140\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-15\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontSize=16;​fontColor=#​B5739D;​\&​quot;​ value=\&​quot;​LCD 16x2 Display\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​100\&​quot;​ x=\&​quot;​560\&​quot;​ y=\&​quot;​155\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-16\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;​5V Power\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​425\&​quot;​ y=\&​quot;​220\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-17\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;​GPIO/​Interrupts\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​220\&​quot;​ y=\&​quot;​240\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-18\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;​GPIO\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​600\&​quot;​ y=\&​quot;​240\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-19\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​424\&​quot;​ y=\&​quot;​330\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​424\&​quot;​ y=\&​quot;​520\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-20\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​Array as=\&​quot;​points\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​220\&​quot;​ y=\&​quot;​420\&​quot;/&​gt;&​lt;/​Array&​gt;&​lt;​mxPoint x=\&​quot;​425\&​quot;​ y=\&​quot;​420\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​220\&​quot;​ y=\&​quot;​520\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-21\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​Array as=\&​quot;​points\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​610\&​quot;​ y=\&​quot;​420\&​quot;/&​gt;&​lt;/​Array&​gt;&​lt;​mxPoint x=\&​quot;​425\&​quot;​ y=\&​quot;​420\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​610\&​quot;​ y=\&​quot;​520\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-22\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​e3c800;​fontColor=#​000000;​strokeColor=#​B09500;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​120\&​quot;​ x=\&​quot;​160\&​quot;​ y=\&​quot;​520\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-23\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontSize=16;​fontColor=#​FFFF99;​\&​quot;​ value=\&​quot;​SERVO\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​190\&​quot;​ y=\&​quot;​535\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-24\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​e51400;​fontColor=#​ffffff;​strokeColor=#​B20000;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​120\&​quot;​ x=\&​quot;​550\&​quot;​ y=\&​quot;​520\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-25\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontColor=#​00FF00;​fontSize=16;​\&​quot;​ value=\&​quot;​LEDS\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​580\&​quot;​ y=\&​quot;​535\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-26\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​76608a;​fontColor=#​ffffff;​strokeColor=#​432D57;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​120\&​quot;​ x=\&​quot;​365\&​quot;​ y=\&​quot;​520\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-27\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontSize=16;​fontColor=light-dark(#​c01c28,​ #​ededed);​\&​quot;​ value=\&​quot;&​amp;​lt;​div&​amp;​gt;​Buzzer&​amp;​lt;/​div&​amp;​gt;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​395\&​quot;​ y=\&​quot;​535\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-28\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;&​amp;​lt;​div&​amp;​gt;​GPIO&​amp;​lt;/​div&​amp;​gt;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​210\&​quot;​ y=\&​quot;​460\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-29\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;​GPIO\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​420\&​quot;​ y=\&​quot;​460\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-31\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;​GPIO\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​600\&​quot;​ y=\&​quot;​460\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-32\&​quot;​ edge=\&​quot;​1\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​endArrow=classic;​html=1;​rounded=0;​\&​quot;​ value=\&​quot;​\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​50\&​quot;​ relative=\&​quot;​1\&​quot;​ width=\&​quot;​50\&​quot;​ as=\&​quot;​geometry\&​quot;&​gt;&​lt;​mxPoint x=\&​quot;​424\&​quot;​ y=\&​quot;​580\&​quot;​ as=\&​quot;​sourcePoint\&​quot;/&​gt;&​lt;​mxPoint x=\&​quot;​424\&​quot;​ y=\&​quot;​720\&​quot;​ as=\&​quot;​targetPoint\&​quot;/&​gt;&​lt;/​mxGeometry&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-33\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​rounded=1;​whiteSpace=wrap;​html=1;​fillColor=#​f5f5f5;​gradientColor=#​b3b3b3;​strokeColor=#​666666;​\&​quot;​ value=\&​quot;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​60\&​quot;​ width=\&​quot;​120\&​quot;​ x=\&​quot;​365\&​quot;​ y=\&​quot;​720\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-34\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​fontColor=#​666666;​fontSize=16;​\&​quot;​ value=\&​quot;&​amp;​lt;​div&​amp;​gt;​UART&​amp;​lt;/​div&​amp;​gt;​\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​395\&​quot;​ y=\&​quot;​735\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;​mxCell id=\&​quot;​eeTA-m969tc2DToLa9s2-35\&​quot;​ parent=\&​quot;​1\&​quot;​ style=\&​quot;​text;​html=1;​whiteSpace=wrap;​strokeColor=none;​fillColor=none;​align=center;​verticalAlign=middle;​rounded=0;​\&​quot;​ value=\&​quot;​UART\&​quot;​ vertex=\&​quot;​1\&​quot;&​gt;&​lt;​mxGeometry height=\&​quot;​30\&​quot;​ width=\&​quot;​60\&​quot;​ x=\&​quot;​420\&​quot;​ y=\&​quot;​630\&​quot;​ as=\&​quot;​geometry\&​quot;/&​gt;&​lt;/​mxCell&​gt;&​lt;/​root&​gt;&​lt;/​mxGraphModel&​gt;&​lt;/​diagram&​gt;&​lt;/​mxfile&​gt;&​quot;,&​quot;​toolbar&​quot;:&​quot;​pages zoom layers lightbox&​quot;,&​quot;​page&​quot;:​0}"></​div>​ 
-<script type="​text/​javascript"​ src="​https://​app.diagrams.net/​js/​viewer-static.min.js"></​script>​ 
-</​body>​ 
-</​html>​ 
- 
-===== Hardware Design ===== 
- 
-==== Components list ==== 
- 
-  ^ Components ^ Purpose ^ 
-  | ATmega328P Xplained Mini development board | Main control unit of the project | 
-  | Micro-USB data cable | Used for powering, programming,​ and debugging the board | 
-  | 4x4 keypad | Main input device used for controlling the game | 
-  | 16x2 LCD, 5V | Displays the level, timer, puzzle state, and messages | 
-  | Active buzzer | Provides sound feedback for game events | 
-  | Bi-color LED (red/green, 3 pins) | Provides visual feedback for success or failure | 
-  | 220 Ohm resistors (x2) | Limit the current for the bi-color LED | 
-  | 10 kOhm potentiometer | Adjusts the LCD contrast | 
-  | Breadboard | Used for prototyping and hardware connections | 
-  | Jumper wires | Used to connect the components together | 
- 
- NOTE: If I use other components in addition to those mentioned, they will be added to the list of components, if it is necessary. 
- 
-==== Hardware description ==== 
- 
-The ATmega328P Xplained Mini development board is the main controller and coordinates the entire system. Unlike a standalone microcontroller mounted directly on a breadboard, this board already includes the basic support circuitry, the programming interface, and the USB connection, which simplifies both development and debugging. 
- 
-The LCD will display the current level, the timer, and game messages such as: 
-  * "Press Start" 
-  * "Level 1" 
-  * "Time left: 45 s" 
-  * "​Success"​ 
-  * "Time over" 
- 
-The keypad will be used as the main input device. It replaces separate push buttons and allows the user to start the game, confirm actions, reset the round, and potentially navigate through levels or menu options. 
- 
-The buzzer will provide sound notifications:​ 
-  * game start 
-  * warning near timeout 
-  * success 
-  * failure 
- 
-The bi-color LED will provide simple visual feedback: 
-  * green = success 
-  * red = failure or timeout 
- 
-The breadboard is used for the external hardware connections,​ such as the buzzer, LED, resistors, LCD interface, and signal routing between the development board and the external components. 
- 
-The 10 kOhm potentiometer is used to adjust the contrast of the LCD. 
- 
-===== Software Design ===== 
- 
-The firmware will be developed in C for AVR using PlatformIO as the main development environment. PlatformIO is useful for this project because it offers an easier build system, project structure, library management, serial monitor support, and firmware upload integration. 
- 
-At this stage, the implementation is still in progress, so this section presents the general software structure and the main ideas that will be used in the final version. 
- 
-==== Development environment ==== 
- 
-  * **PlatformIO** – used for project management, building, uploading, and serial monitoring 
-  * **AVR toolchain** – used for compiling the firmware for the ATmega328P 
-  * **AVRDUDE** – used for uploading the compiled code to the development board 
-  * **UART serial monitor** – used for debugging and hardware testing during development 
- 
-==== Libraries and external resources ==== 
- 
-For the moment, the project mainly relies on standard AVR headers and basic low-level control of the microcontroller peripherals. Depending on the final implementation,​ simple helper modules may be added for: 
-  * LCD control 
-  * keypad scanning 
-  * UART debugging 
-  * timer management 
-  * game logic 
- 
-At this stage, the focus is on understanding and controlling the hardware directly, without relying too much on complex third-party libraries. 
- 
-==== General software structure ==== 
- 
-The software will be organized into simple functional modules, each responsible for one part of the system. A possible structure is the following: 
- 
-  * `main.c` – main program flow and initialization 
-  * `keypad.c / keypad.h` – keypad scanning and key detection 
-  * `lcd.c / lcd.h` – LCD control and message display 
-  * `buzzer.c / buzzer.h` – buzzer control and sound signals 
-  * `led.c / led.h` – bi-color LED control 
-  * `timer.c / timer.h` – countdown and timing logic 
-  * `uart.c / uart.h` – debugging through serial communication 
-  * `game.c / game.h` – game states, puzzle logic, and level progression 
- 
-The exact number of source files may change during implementation,​ but the software will follow this modular idea. 
- 
-==== Main algorithms and planned logic ==== 
- 
-The project will be based on a **finite state machine**, because the application naturally moves through several distinct stages. The most important software states are: 
- 
-  * **Idle** – the system waits for user input 
-  * **Start Game** – a new round begins 
-  * **Running** – the puzzle is active and the countdown is displayed 
-  * **Success** – the user finishes in time 
-  * **Fail / Timeout** – the user does not finish before the timer expires 
-  * **Next Level / Reset** – the system prepares the next round 
- 
-The main software logic will include: 
-  * keypad input reading 
-  * LCD screen updates 
-  * countdown handling using timers 
-  * buzzer and LED feedback 
-  * digital puzzle generation and update 
-  * level progression and reset logic 
-  * UART-based debugging during testing 
- 
-==== Planned firmware behavior ==== 
- 
-At a general level, the firmware is expected to work as follows: 
- 
-  * initialize all hardware modules 
-  * wait for the user to start the game 
-  * display the puzzle on the LCD 
-  * show the current level and remaining time on the LCD 
-  * read user commands from the keypad 
-  * update the puzzle state according to the pressed keys 
-  * detect whether the puzzle is completed in time 
-  * signal success or failure using the buzzer and bi-color LED 
-  * move to the next level or restart the game 
- 
-===== Conclusions ===== 
- 
-This project is a good example of combining embedded programming with interactive user input and simple game logic. Even though the implementation is still in progress, the project already has a clear structure and a well-defined goal. 
- 
-From an educational point of view, the project is useful because it brings together several important concepts studied during the laboratory sessions, such as UART, interrupts, timers / PWM, I2C, GPIO usage, and hardware debugging. 
- 
-The final objective is to obtain a complete and functional digital puzzle game that is simple enough to be implemented with the available hardware, but also complex enough to demonstrate practical embedded systems design. 
- 
-===== Jurnal ===== 
- 
-  * **Week 1** 
-    * the project received approval this week 
-    * work started on both the hardware and software parts 
-    * the main components were selected and the project structure was outlined 
- 
-  * **Week 2** 
-    * the plan is to complete most of the hardware setup by the end of next week 
-    * the main hardware modules will be connected and tested 
-    * software development and debugging will continue in parallel 
- 
-  * **Week 3** 
-    * the goal is to fully complete both the hardware and software parts 
-    * the final integration and testing of the whole system will be carried out 
pm/prj2026/jan.vaduva/33160.1778357960.txt.gz · Last modified: 2026/05/09 23:19 by tudor_mihai.petcu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0