Program Artou ATmega32 Development Board

Program an AVR development board without installing any software. ExpressIDE and AVRdudess.

Program Artou ATmega32 Development Board

Story

Later in the project you can look at a list of programmer devices.

XpressIDE

Log in to XpressIDE online and create a new project. Click on menu File -> New Project or type Ctrl+Shift+N on your keyboard.

XpressIDE

Select¬†Microchip Embedded ‚Äď Standalone¬†Next.

Microchip Embedded

Select device ATmega32 Next.

Select device ATmega32

Project Name at32 Finish.

Project Name at32

Look in the Source Files folder and we have no files. We need to create what is called a main file. The file can be any name but it needs to have a main function in the code.

Click directly on the Source Files folder New File. If you muff it up you can come back, later, and use Add Existing Item.

Add Existing Item

XC8 Compiler ‚Äď C Main file¬†Next. The compiler is on servers at MicroChip.

XC8 Compiler - C Main file

Leave name newmain.c. Finish.

newmain

Default code will compile but not perform any function. Click the Run menu and Build Project or type Ctrl+Alt+B on your keyboard. Build Successful because the default code is grammatically correct.

Build Successful

Replace with our code

// toggle IOs on output ports
#define F_CPU 16000000
#include <avr/io.h>
#include <util/delay.h>
int main(void)
  { DDRA=0xFF; DDRB=0xFF; DDRC=0xFF; DDRD=0xFF;  // all ports as output
while(1)
  { PORTA++; PORTB++; PORTC++; PORTD++;   // binary count
    _delay_ms(50); }}
// ATmega32 has a PORTA

We will use the menus across the top. Icons for useful commands.

Run menu

Run Project generates a hex file in your Downloads folder. Build Project command checks that your code compiles. Clean and Build Project ensures a fresh rebuild of all code.

Run menu

After we click Build Project we will see an Output screen with text information about our build. Look closely and you see the build commands and parameters.

Build successful we are ready.

Run Project

Run menu click Run Project. We now have a new file in our download folder. Look at the bottom of the screen.

Run Project

You may see at32(1).hex if there is an older file there. You need to delete old hex files or they will accumulate. They are all valid programs.

Downloads

Look in downloads. This is the hex file generated by the XPressIDE webpage and delivered to your computer. We now have to upload to our board.

Downloads

Upload

We are going to use portable AVRdudess from a USB key. Find the avrdudess.exe executable and double click to open.

portable AVRdudess

At the top of the AVRdudess screen use the Programmer(-c) menu to select usbasp on the usb port. Select MCU(-p) ATmega32 and click Detect. Use the box with dots… in the Flash menu to navigate to our downloaded hex file located in Downloads.

hex file located in Downloads

Look at the bottom of the screen below the word Program!

the word Program

This is good. The program has checked the MCU connected through the usbasp and sees that it is an ATmega32 device. We have located a hex file and can upload just by clicking Program!.

AVRdudess is ready to execute the terminal command¬†avrdude.exe-c usbasp -p m32 -P usb -U flash:w:‚ÄĚC:\Users\user\Downloads\at32.hex‚ÄĚ:a. If you type avrdude commands in the dos window you know this is what we want to do.

Source: Program Artou ATmega32 Development Board

About The Author

Muhammad Bilal

I am highly skilled and motivated individual with a Master's degree in Computer Science. I have extensive experience in technical writing and a deep understanding of SEO practices.

Scroll to Top