[ Log In ]
Image of the Atmega324p

Atmega324P

$8.50
Qty:
USB AVR programmer

USB AVR Programmer

$9.95
Qty:
Breadboard adapter for the USBasp AVR Programmer

USBasp Breadboard Breakout Adapter

$4.90
Qty:
Thumbnail: Crystal Oscillator 18.432 MHz for UART

18.432 MHz Crystal Oscillator 18pf 30ppm

$0.94
Qty:
Thumbnail: 22 pF Capacitor

22 pF Multilayer Ceramic Capacitor

$0.43
Qty:
Thumbnail: Quartz crystal oscillator - 16 MHz

16 MHz Crystal Oscillator 20 pF Through Hole

$0.75
Qty:
3 pin slide switch

SPDT Slide Switch 3 pin 30V

$1.49
Qty:
Serial to USB converter with Micro USB cable

USB to Serial Converter

$10.95
Qty:
Thumbnail: 4x4 keypad top view.

4x4 Keypad with Adhesive Backing

$3.80
Qty:
Thumbnail: quad buffer line driver 74HC126E

Quad Buffer Line Driver (Through Hole)

$0.69
Qty:
Skip Navigation Links

Microcontroller - A Beginners Guide - Installing the Programming Environment and Getting to Know a Little Bit About it - WIinAVR

To be able to make the microcontroller do something useful, we must write instructions for it to follow. While we can write these instructions with a simple text editor, many people find it much easier to use a dedicated "programming environment" to write their programs. The video in this tutorial takes you through each step needed to install one such programming environment (WinAVR) on the computer. I call it a programming environment because the program you will install has many features. This particular programming environment allows you to create and edit programs in various languages (we will focus on C), and then compile the program into an executable format that the microcontroller will understand. Finally, WinAVR will help us transfer this file into the microcontroller. WinAVR will also help us to do many other things, like debugging our programs and giving warnings when there are compilation and syntax errors. We will get into the particulars of these in later tutorials.

The installation process for WinAVR is very quick and concise. Here are the detailed steps:

  • Download the latest files from the WinAVR sourceforge files location. The official website has some information relating to the program, if you are inclined to explore it further.
  • Click on the latest release.
  • You will need to answer the security question asking whether you want to save the download or not, since you will be downloading an executable file.
  • Once it is downloaded, execute the file by clicking on it. The installation process will start.
  • The installation process will have the usual Windows install wizard information, and some questions offered to help you tailor the process. Most of these can simply be left as their default value, but select as you see appropriate.

Well, that's pretty much it for the installation. Not much different than the installation for most Windows programs. But you will probably notice the many options in the start menu folder for the WinAVR programming environment. Don't fear, you will typically use only one of these programs called the "Programmers Notepad." Clicking on this icon will start the user interface for the application that allows us to write our programs (creation and editing). The program also contains menu commands that will help us compile the code and then transfer it into the microcontroller.

Ok, so you may still be rusty on the compiling process. Recall that it's just the process where the computer converts the human-readable program you wrote into a set of instructions that the microcontroller can understand. The programmers notepad will take care of all of this for us behind the scenes, so we don't have to concern ourselves with all the details. You can, however, learn more about the process if you wish.

In the next video, we will test our configuration and installed components. The programmer will be tested so we can confirm that it is recognized by Windows, and it is fully able to communicate with the microcontroller device. We will then write a short "Do nothing" program to make sure there are no errors when we transfer the program onto the microcontroller.