-
Notifications
You must be signed in to change notification settings - Fork 110
How to use AVR template on Windows
-
Download and install Visual Studio Code source code editor.
-
Download and install Git. During installation choose the default editor used by Git as Use Visual Studio Code as Git's default editor.
-
Download and run MinGW Installation Manager. During installation keep installation directory as
C:\MinGW
.In MinGW Installation Manager, mark mingw32-base-bin package for installation and apply changes in menu Installation > Apply Changes.
Add
C:\MinGW\bin
to your Path environment variable: This PC > Properties > Advanced system settings > Environment Variables... -
Download the latest version of Avrdude, such as avrdude-6.3-mingw32.zip and extract avrdude.conf and avrdude.exe files to
C:\Appz\Avr
(Do NOT use any spaces in the file path). Copy libusb0.dll dynamic link library toC:\Appz\Avr
. You can find the dll as part of Arduino IDE as well. -
Download and install PuTTy client for serial communication between Arduino Uno board and your computer.
-
Download the latest toolchain AVR 8-bit Toolchain v3.62 - Windows from Microchip webpage, from this repository, or from Microchip's archive and extract all files to
C:\Appz\Avr\avr8-gnu-toolchain-win32_x86
. -
Install the CH340 drivers and restart the computer.
-
Download and extract
Examples
folder from this repository to local computer. -
Start Visual Studio Code source code editor, open template folder, in
Examples/Makefile.in
file enable and/or modify Windows parameters according to your local settings:## Linux #PREFIX = /opt/avr8-gnu-toolchain-linux_x86_64 #AVRDUDE = avrdude #RM = rm -f ## See "dmesg" command output #USBPORT = /dev/ttyUSB0 ## Windows PREFIX = C:\Appz\Avr\avr8-gnu-toolchain-win32_x86 AVRDUDE = C:\Appz\Avr\avrdude.exe RM = del # See USB-SERIAL CH340 port in Device Manager USBPORT = COM3
-
Open a new terminal in menu Terminal > New Terminal and change working directory to
Examples/blink
.cd Examples cd blink ls
Instead of
ls
command you can trydir
.All processes are done with help of
Makefile
script file. The following commands allow project compilation and programming:mingw32-make.exe all mingw32-make.exe flash mingw32-make.exe size mingw32-make.exe list mingw32-make.exe clean
-
To create a new project, make a new directory within
Labs
folder and copy three filesmain.c
,Makefile
, andREADME.md
fromExamples/blink
project toLabs/new-project-folder
.If your Arduino board (or clone) does not contain any bootloader, follow instructions at Instructables or Arduino webpages.
For Windows 10, you can install Windows Subsystem for Linux and then follow the AVR installation notes for Linux.
Version | Result (yyyy-mm-dd) | Note |
---|---|---|
Windows 10 | OK (2021-10-21) | Office |
Windows 10 | OK (2020-09-03) | Lab SC 6.61 |
Windows 10 | OK (2019-11-26) | Lab SC 6.66 |
Windows 7 | OK (2019-05-17) | Lab SC 6.61 |
C language
AVR toolchain