{"id":26583121,"url":"https://github.com/beckversync/uart-loopback-and-adc-communication","last_synced_at":"2025-08-01T00:06:57.094Z","repository":{"id":280812787,"uuid":"902804863","full_name":"Beckversync/UART-Loopback-and-ADC-Communication","owner":"Beckversync","description":" Implementing UART loopback communication and ADC sensor reading on the STM32 microcontroller. It also builds a simple communication protocol between the STM32 and a console terminal.","archived":false,"fork":false,"pushed_at":"2025-03-05T12:17:03.000Z","size":3536,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T13:26:22.435Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Beckversync.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-13T09:56:33.000Z","updated_at":"2025-03-05T12:18:53.000Z","dependencies_parsed_at":"2025-03-05T13:36:27.074Z","dependency_job_id":null,"html_url":"https://github.com/Beckversync/UART-Loopback-and-ADC-Communication","commit_stats":null,"previous_names":["beckversync/lab5_vxl_hcmut_241"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beckversync%2FUART-Loopback-and-ADC-Communication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beckversync%2FUART-Loopback-and-ADC-Communication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beckversync%2FUART-Loopback-and-ADC-Communication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Beckversync%2FUART-Loopback-and-ADC-Communication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Beckversync","download_url":"https://codeload.github.com/Beckversync/UART-Loopback-and-ADC-Communication/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245073595,"owners_count":20556579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-23T08:20:27.524Z","updated_at":"2025-03-23T08:20:28.230Z","avatar_url":"https://github.com/Beckversync.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# STM32 UART Loopback and ADC Communication 🚀\n\nThis project implements UART loopback communication and ADC sensor reading on the STM32 microcontroller. It also builds a simple communication protocol between the STM32 and a console terminal.\n\n## Table of Contents\n- [Project Overview](#project-overview)\n- [Features](#features)\n- [Implementation Steps](#implementation-steps)\n- [Communication Protocol](#communication-protocol)\n- [How to Use](#how-to-use)\n- [Tools and Environment](#tools-and-environment)\n- [Contributors](#contributors)\n- [License](#license)\n\n## Project Overview\nThis project showcases real-time UART loopback communication and ADC data acquisition on an STM32 microcontroller. The system receives console commands and sends sensor data in a specific protocol format.\n\n## Features ✨\n- **UART Loopback:** Echoes any received character back to the terminal.\n- **ADC Sensor Reading:** Captures analog voltage from PA0 and converts it to digital value.\n- **Real-time Data Transmission:** Sends ADC values over UART every 500ms.\n- **Command Parsing:** Supports specific console commands to request and acknowledge data.\n- **Timeout Management:** Resends data packet if no response is received within 3 seconds.\n\n## Implementation Steps 🛠️\n1. **Setup UART Communication:**\n   - Configure USART2 for interrupt-driven communication.\n   - Implement an interrupt callback for receiving and transmitting data.\n2. **Initialize ADC:**\n   - Read analog data from PA0.\n   - Convert ADC value to a readable format and transmit over UART.\n3. **Implement Command Parser FSM:**\n   - Receive and buffer incoming characters.\n   - Parse commands like `!RST#` and `!OK#`.\n4. **Build Communication FSM:**\n   - Respond to `!RST#` with ADC value in format `!ADC=1234#`.\n   - Wait for `!OK#` acknowledgment.\n   - Resend data if no response after 3 seconds.\n\n## Communication Protocol 📡\n| Command     | Description                  |\n|-------------|----------------------------|\n| `!RST#`     | Request sensor data         |\n| `!ADC=xxxx#`| Response with ADC value     |\n| `!OK#`      | Acknowledge received data   |\n\n## How to Use 🧑‍💻\n1. Flash the STM32 code onto your development board.\n2. Open a terminal emulator and connect to STM32’s UART.\n3. Send `!RST#` to request sensor data.\n4. Observe ADC readings and acknowledge with `!OK#`.\n\n## Tools and Environment 🧰\n- STM32F103C6 Microcontroller\n- STM32CubeIDE and HAL Library\n- Proteus for Simulation (Optional)\n- Serial Terminal Emulator (e.g., Tera Term, PuTTY)\n\n## Contributors 👩‍💻👨‍💻\n- Beckversync\n\n## License 📝\nHCMUT\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeckversync%2Fuart-loopback-and-adc-communication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeckversync%2Fuart-loopback-and-adc-communication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeckversync%2Fuart-loopback-and-adc-communication/lists"}