{"id":13340961,"url":"https://github.com/wykys/avr-makefile","last_synced_at":"2025-03-11T19:31:00.050Z","repository":{"id":95839536,"uuid":"111588728","full_name":"wykys/avr-makefile","owner":"wykys","description":"Support for projects based on AVR microcontrollers.","archived":false,"fork":false,"pushed_at":"2018-01-25T02:25:47.000Z","size":207,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-24T06:30:43.545Z","etag":null,"topics":["avr","avr-gcc","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":"lgpl-3.0","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":"2017-11-21T18:54:59.000Z","updated_at":"2020-01-03T01:26:54.000Z","dependencies_parsed_at":"2023-03-13T16:44:55.962Z","dependency_job_id":null,"html_url":"https://github.com/wykys/avr-makefile","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-makefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2Favr-makefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2Favr-makefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wykys%2Favr-makefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wykys","download_url":"https://codeload.github.com/wykys/avr-makefile/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-gcc","avrdude","fekt","vut","vutbr"],"created_at":"2024-07-29T19:25:07.148Z","updated_at":"2025-03-11T19:31:00.023Z","avatar_url":"https://github.com/wykys.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AVR Makefile\nSupport for projects based on AVR microcontrollers. Makefile automatically finds source files and detects their dependencies. Which is a great companion to life.\n\n## Installation on GNU/Linux\n```bash\n# my project template requires the following packages to be installed correctly:\n# GCC compiler adapted for AVR architecture\nsudo aptitude install gcc-avr\n# basic libraries for AVR\nsudo aptitude install avr-libc\n# binary utilities\nsudo aptitude install binutils-avr\n# GNU make utility\nsudo aptitude install make\n```\n\n## Use\n```bash\n# compiling the project, equivalen to make\nmake all\n# flash content\nmake 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├── bin\n│   └── Makefile\n├── inc\n│   ├── settings.h\n│   └── uart.h\n├── LICENSE\n├── Makefile\n├── README.md\n└── src\n    ├── asm-fnc.S\n    ├── main.c\n    ├── rand.S\n    └── uart.c\n\n3 directories, 10 files\n```\nThe source 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`, dependency files `*.list`, batch files `*.o`) and secondary `Makefile` are located in the `bin/` folder.\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 the 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### Microprocessor change\nChanging the microcontroller requires changing the `CHIP` variable in the` Makefile` file and the `MCU` variable in the `bin/ Makefile` file.\n\nThe `CHIP` variable is a parameter for `avrdude` and may contain the following values: http://www.nongnu.org/avrdude/user-manual/avrdude_4.html\n\nThe `MCU` variable is a parameter for `avr-gcc` and may contain the following values: https://gcc.gnu.org/onlinedocs/gcc/AVR-Options.html\n\nFor example, if I wanted ATmega328P (which is for example in arduino nano), I would make the following modifications:\n```Makefile\n# in Makefile\nCHIP = m328p\n# in bin/Makefile\nMCU = atmega328p\n```\n\n### Programmer change\nChanging the programmer will required change the value of `PROG` in` Makefile`. Possible parameters of the value that are passed to `avrdude` as `-c` are listed here: http://www.nongnu.org/avrdude/user-manual/avrdude_4.html\n\nFor example, if I wanted to use the arduino bootloader to flash the program, I would proceed as follows:\n```Makefile\n# in Makefile\nPROG = arduino\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwykys%2Favr-makefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwykys%2Favr-makefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwykys%2Favr-makefile/lists"}