{"id":13340962,"url":"https://github.com/wykys/AVR-tools","last_synced_at":"2025-03-11T19:30:59.975Z","repository":{"id":95839543,"uuid":"149153649","full_name":"wykys/AVR-tools","owner":"wykys","description":"Tools for development of AVR microcontrollers.","archived":false,"fork":false,"pushed_at":"2022-10-12T21:26:25.000Z","size":64,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-24T06:30:42.789Z","etag":null,"topics":["avr","avr-binutils","avr-development","avr-gcc","avr-microcontroller","avr-programming","avr-toolchain","avrdude","fekt","vut","vutbr"],"latest_commit_sha":null,"homepage":null,"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/wykys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2018-09-17T16:17:36.000Z","updated_at":"2024-03-25T04:34:25.000Z","dependencies_parsed_at":"2023-05-22T08:30:48.010Z","dependency_job_id":null,"html_url":"https://github.com/wykys/AVR-tools","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2FAVR-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2FAVR-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2FAVR-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2FAVR-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wykys","download_url":"https://codeload.github.com/wykys/AVR-tools/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243098694,"owners_count":20236074,"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":["avr","avr-binutils","avr-development","avr-gcc","avr-microcontroller","avr-programming","avr-toolchain","avrdude","fekt","vut","vutbr"],"created_at":"2024-07-29T19:25:07.156Z","updated_at":"2025-03-11T19:30:59.962Z","avatar_url":"https://github.com/wykys.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AVR-tools\nTools for development of AVR microcontrollers.\n\n## Project wizard\n### First step\nOpen the terminal and go to a path where you want to create your AVR project. Use the `cd` command to change directory.\n\n### Getting the project template\nGetting the template is easy. Just clone this repository.\n```bash\n# if you prefer SSH\ngit clone git@github.com:wykys/AVR-tools.git\n# else use HTTPS\ngit clone https://github.com/wykys/AVR-tools.git\n```\n\n### Set the name of the project folder\nUse the `mv` command to change the folder name.\n```bash\n# replace the the_name_of_your_project with the desired name\nmv AVR-tools the_name_of_your_project\n# and go to your project folder\ncd the_name_of_your_project\n```\n\n### Open project in editor\nOpen your project in your favorite text editor. Choose one option.\n```bash\n# for Atom\natom .\n# for Visual Studio Code\ncode .\n```\n\n### Makefile settings\n`Makefile` describes the build of a project. It also allows you to run auxiliary tools used for programming the target processor, analyzing compilation results and so on.\n\nThe `Makefile` file is located in the root directory of your project. Using a text editor, you can edit variables as required by the application.\n\n#### Project name\nIt affects names of generated files.\n```makefile\n# find the following line\nTARGET = DEMO\n# change DEMO for the name of your project\nTARGET = the_name_of_your_project\n```\n\n#### Target microcontroller\nThe names of available microcontrollers are shown [here](https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html).\n\n##### First option\nEnter this command into the terminal: `make change_mcu`\n```\nMakefile MCU: atmega128\nVS Code  MCU: atmega128\nEnter new MCU \u003e\u003e\u003e atmega328p\nFLASH: 32 KiB; RAM: 2 KiB; EEPROM: 1 KiB\n```\n\n##### Second option\nYou can manually edit the Makefile and your editor's configuration files.\n\n```makefile\n# find the following line\nCHIP = atmega328p\n# change CHIP\nCHIP = the_name_of_your_chip\n```\n\n#### Code size optimization\nIt affects size and speed of the application.\n\n| __OPT__ | __DESCRIPTION__      |\n| ------- | -------------------- |\n| -O0     | optimization is off  |\n| -O1     | optimization level 1 |\n| -O2     | optimization level 2 |\n| -O3     | optimization level 3 |\n| -Os     | size optimization    |\n\n```makefile\n# find the following line\nOPT = -Os\n# change OPT\nOPT = required_optimization\n```\n\n#### Changing the programmer\nList of supported `avrdude` programmers is [here](https://www.nongnu.org/avrdude/user-manual/avrdude_4.html)\n```makefile\n# find the following line\nAVRDUDE = avrdude -p $(shell $(WTR)) -c arduino -P $(shell $(WFS))\n# change AVRDUDE\n# port is required only for some programmers\nAVRDUDE = avrdude -p $(shell $(WTR)) -c your_programmer -P programmer_port\n```\n\n### Usage of `make`\n`Makefile` allows compilation, programming and debugging of applications.\n```bash\n# compiling the project, equivalen to make\nmake all\n# flash content\nmake flash\n# compiling the project and programming the flash\nmake build_and_flash\n# deletes the compilation outputs\nmake clean\n# start avrdude terminal\nmake terminal\n# EEPROM dump_eeprom\nmake dump_eeprom\n# flash all (flash, EEPROM)\nmake flash_all\n# chip testing\nmake chip_test\n```\n\n## Application notes\n### File template hierarchy\n```bash\n.\n├── inc\n│   ├── settings.h\n│   └── uart.h\n├── LICENSE\n├── Makefile\n├── README.md\n└── src\n    ├── main.c\n    ├── rand.S\n    └── uart.c\n\n2 directories, 8 files\n```\nSource files `*.c` and `*.S` are located in the `src/` folder. Header files `*.h` are located in the `inc/` folder. The compilation outputs (binary files `*.hex`, `*.elf`, code disassembler [`*.lss`, `*.lst`], dependency files `*.d`, batch files `*.o`, map file `*.map`) are located in the `$(BUILD_DIR)` folder. Project scripts are located in the hidden folder `.scripts`.\n\n\n### Change of frequency\nThe `F_CPU` [Hz] constant used for delay functions is defined in the `settings.h` file. The `settings.h` file must be plugged into all files in which you want to use the constant. You can also add additional constants that affect the behavior of the entire program.\n\n```C\n#ifndef F_CPU\n  #define F_CPU 16000000UL // Hz\n#endif\n```\n\n## Scripts\nThese scripts are designed to simplify the development of AVR applications. They are described in a separate [README](https://github.com/wykys/AVR-tools/tree/master/.scripts).\n\n## Installation\nTo run `AVR-tools` it is required to install these packages:\n\n| __NAME__              | __LINK__                                                                      |\n| --------------------- | ----------------------------------------------------------------------------- |\n| `git`                 | https://git-scm.com/                                                          |\n| `make`                | https://www.gnu.org/software/make/                                            |\n| `avrdude`             | http://savannah.nongnu.org/projects/avrdude                                   |\n| `python3`             | https://www.python.org/                                                       |\n| `python3-pip`         | https://docs.python.org/3/installing/index.html                               |\n| `python3-venv`        | https://docs.python.org/3/library/venv.html                                   |\n| `atmel-avr-toolchain` | http://www.microchip.com/mplab/avr-support/avr-and-arm-toolchains-c-compilers |\n\n### For Debian Ubuntu and their derivatives\nJust enter the following command into the terminal for download and run shell installation script, which automatically installs the necessary tools.\n```bash\nsh -c \"$(wget https://raw.githubusercontent.com/wykys/AVR-tools/master/.scripts/install.sh -O -)\"\n```\n\n### Tested on operating systems\n\n| __NAME__   | __VERSION__ | __RESULT__ |\n| :--------- | ----------: | :--------: |\n| Linux Mint |          19 |     OK     |\n| Linux Mint |        18.3 |     OK     |\n| Xubuntu    |       16.04 |     OK     |\n| Debian     |       9.5.0 |     OK     |\n| Ubuntu     |     22.04.1 |     OK     |\n| Windows    |          10 |     ?      |\n\n\n#### Ubuntu 22.04\n\nIf you are using an arduino clone with a USB/UART __CH430__ converter, you must uninstall the system support for braille displays, or the converter will not show up as `/dev/ttyUSB*`.\n\n```bash\nsudo apt remove brltty\n```\n\n## Updates\nWith git you can get a newer version, but if you already have a project, I recommend that you make a backup first because there may be a collision between the files.\n\n```bash\n# go to the project folder and use this command\ngit pull\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwykys%2FAVR-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwykys%2FAVR-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwykys%2FAVR-tools/lists"}