CHALKROACH-2
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
set up the programming environment for the chalkroach  
   

Back to resources

make a chalkroach ATMega32 microcontroller board

set up the programming environment for chalkroach

upload the bootloader and programs on chalkroach

introduction to C programming for microcontrollers

 
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Now that we have made and stuffed the chalkroach board, we can program the chip. The steps below will show you how to set up the programming environment on your computer. The softwares and tools below will enable you to write a C program and load it onto your microcontroller board.

Instructions for Windows: (for mac instructions click here)

1. download and install AVR-GCC

AVR-GCC is a freeware C compiler and assembler for the Atmel AVR microcontroller series. You can download the source code for free or get an ready installation package depending on your operating system.

. WinAVR is an open source set of software development tools for Windows.

. Download it from sourceforge here and install it to the default location.

. Now you need to configure WinAVR to be accessible from the commandline. To do that, right click on My Computer, click on the Advanced tab, click on Environment Variables. Create a new Environment Variable named AVR, then in the Variable Value field type C:\WinAVR.

. Then in System Variables, edit the Path field and add the following to the end of the Variable Value field: ;C:\WinAVR\bin;C:\WinAVR\utils\bin. Make sure that no extra spaces are added before or after the semicolon. Click OK.

more links:

WinAVR sourceforge project page

Downloading, Installing and Configuring WinAVR

AVR GCC website

2. download and install AVRlib

When writing code in most programming languages, it is a good idea to look on the internet for available libraries in order to reduce the time needed to perform common asks.

There are many C libraries for Atmel AVR processors, including the very user friendly Procyon Avrlib. This library covers simple and not so simple tasks and modules such as: Print functions, Command Line Interface, Fixed-Point Math Library, A/D Converter, RC-Servos, Graphic LCD Modules and a number of other tasks. Avrlib is a well documented and commented library and provides example programs to illustrate the use of the different functions.

To install Avrlib follow these steps:

. Download the avrlib zip file from here

. Unzip the downloaded file in a directory such as C:\Avrlib or C:\Program Files\Avrlib

. Create an environment variable called AVRLIB that points to the directory where you unzipped the files so that the compiler can find them:

Right click on My Computer

Click Properties

Open the Advanced tab

Click on Environment Variables

Under User Variables, click Create new environment variable with name= AVRLIB and value= the location where Avrlib is located

Then, under System Variables, in the end of Path, add a semicolon followed by the path of avrlib (no space)

more links:

AVRlib website

Installing Procyon AVRlib

(for mac instructions click here)

<< PREVIOUS              
 

Back to resources

make a chalkroach ATMega32 microcontroller board

set up the programming environment for chalkroach

upload the bootloader and programs on chalkroach

introduction to C programming for microcontrollers