{"id":18538959,"url":"https://github.com/simonthorell/atmega328p-io-gcc","last_synced_at":"2026-04-13T12:31:14.434Z","repository":{"id":234557627,"uuid":"766944370","full_name":"simonthorell/atmega328p-io-gcc","owner":"simonthorell","description":"ATmega328p project using C++ inside docker dev-container, compiling with AVR-GCC, and flashing/monitoring with Bash scripts","archived":false,"fork":false,"pushed_at":"2024-03-18T10:13:48.000Z","size":111,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-15T02:13:15.492Z","etag":null,"topics":["avr","bash","cpp","docker"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonthorell.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-03-04T12:27:41.000Z","updated_at":"2024-04-19T18:27:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"5bc02904-986b-4545-9b91-934fcd597e2d","html_url":"https://github.com/simonthorell/atmega328p-io-gcc","commit_stats":null,"previous_names":["simonthorell/atmega328p-io-gcc"],"tags_count":3,"template":false,"template_full_name":"simonthorell/avr-dev-template","purl":"pkg:github/simonthorell/atmega328p-io-gcc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fatmega328p-io-gcc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fatmega328p-io-gcc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fatmega328p-io-gcc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fatmega328p-io-gcc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonthorell","download_url":"https://codeload.github.com/simonthorell/atmega328p-io-gcc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonthorell%2Fatmega328p-io-gcc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31753004,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["avr","bash","cpp","docker"],"created_at":"2024-11-06T19:45:39.592Z","updated_at":"2026-04-13T12:31:14.415Z","avatar_url":"https://github.com/simonthorell.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ATmega328p Programming with AVR-GCC\n\nThis project demonstrates programming the ATmega328p microcontroller using C++, compiling with AVR-GCC, and flashing/monitoring with custom Bash scripts. It's designed to provide a straightforward way to develop and deploy code on the ATmega328p, with tools for easy UART communication monitoring.\n\nDeveloped using the [AVR Development Template](https://github.com/simonthorell/avr-dev-template), checkout the README in this repo for a more detailed setup and usage guide.\n\n## Prerequisites\nBefore you begin, ensure the following software is installed on your system:\n\n- **Docker**: For container management and isolation with pre-configured Linux dev environment.\n- **Visual Studio Code (VS Code)**: As the integrated development environment.\n- **Dev Containers**: A VS Code extension to simplify the use of Docker containers.\n- **avrdude**: For programming the microcontroller's memory.\n\n## Basic Usage\nGetting started with the ATmega328p microcontroller involves three primary steps: connecting the device to your computer, flashing the firmware, and monitoring UART communication. This enables you to deploy your code and interact with the microcontroller through UART commands.\n\n### Step 1: Connect the Microcontroller\n1. **Physical Connection**: Connect the ATmega328p MCU to one of your computer's USB ports.\n\n### Step 2: Develop \u0026 Build\nThe development and build process involves utilizing Docker for a consistent development environment and using CMake for compiling the project. Follow these steps to set up your environment and build your project within Visual Studio Code.\n\n#### **Start Docker Dev-Container**:\n1. **Run Docker**: Make sure Docker is running on your computer.\n2. **Open Command Palette**: In Visual Studio Code, press `F1` or `CMD+Shift+P` (macOS) / `Ctrl+Shift+P` (Windows/Linux) to open the Command Palette.\n3. **Rebuild Container**: Type `Dev Containers: Rebuild and Reopen in Container` and select it. This action will start Docker, build your development container based on the configuration in the `.devcontainer` folder, and reopen your project inside this container. This ensures that your development environment is consistent and isolated.\n\n#### **Build the Binary with CMake**:\n1. **Access CMake Commands**: With your project open in the Dev Container, press `F7` or again open the Command Palette with `F1` / `CMD+Shift+P` / `Ctrl+Shift+P` and type `CMake: Build`.\n2. **Initiate Build**: Select `CMake: Build` from the list to start the compilation process. CMake automates the configuration and generates the necessary build files, compiling your project into a binary.\n\nThis process encapsulates your development environment within a Docker container for a consistent development environment. It ensures that all dependencies are handled automatically, and your build environment is precisely configured as per the project's requirements.\n\n### Step 3: Flash the Firmware\nDue to limitations of a docker container getting access to your local computer's hardware, run the below in a terminal outside the development environment.\n\n4. **Prepare for Flashing**: Before you can flash the microcontroller, make sure you have installed all necessary software, such as `avrdude`, which is essential for the flashing process. The installation instructions for `avrdude` can vary depending on your operating system.\n   \n5. **Flash the Device**: Navigate to your project's `script` directory in the terminal or command prompt. Use the provided script to flash your firmware onto the ATmega328p:\n    ```bash\n    ./flash-firmware.sh -p \u003cYOUR-DEVICE-PORT\u003e\n    ```\n   Replace `\u003cYOUR-DEVICE-PORT\u003e` with the specific port your microcontroller is connected to.\n\n### Step 3: Monitor UART Communication\n6. **Initiate Monitoring**: To observe and interact with the microcontroller's serial communication, execute the monitoring script found in the `script` folder. This will open a command prompt for UART communication.\n    ```bash\n    ./monitor-mcu.sh\n    ```\n   \n7. **Use UART Commands**: With the monitoring script running, you can send commands to the microcontroller. Start by typing `help` in the command prompt. This will print a list of available UART commands that you can use to control or query the microcontroller.\n\n## Contribution\nContributions are welcome. Please fork the repository, make your changes, and submit a pull request.\n\n## License\nDistributed under the MIT License. See `LICENSE` for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonthorell%2Fatmega328p-io-gcc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonthorell%2Fatmega328p-io-gcc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonthorell%2Fatmega328p-io-gcc/lists"}