AVR Development Using the STK500

It has been a couple of years and a couple of computers ago since I have developed an embedded system using Atmel's AVR line of micro processors. My current project requires the use of an ATTiny44 to do some cool little battery wizardry for a marine project.
The first step was to get the STK500 up and going and write a small test program, like flash an LED or something. No problem.

Installation Guide

  1. Download and install AVR Studio to your PC.
  2. Install AVR Studio. When installing, you can skip the Jungo usb driver unless you have one of the Atmel USB devices.
  3. As an added bonus you can install the SP1 update for Win AFR
  4. Download and install WinAVR. AVR Studio only contains an assembly compiler. Since I would like to program in C. We will use WinAVR. to get gcc. Install with all of the defaults.
  5. Hook up the serial cable to your computer and the STK500 board.
  6. Start up AVR studio.
  7. Select Tools->Program AVR-Connect (or Auto connect if you are feeling brave).
  8. For the platform pick the STK500, and for the port pick your com port.
  9. At this point the STK-500 will try and go through an upgrade. If you are having problems here and you are using a USB to RS-232 cable, then you might be out of luck. I called tech support about this and they said that USB-RS-232 adapters don't work. If you find one that does, let me know.
  10. You will now get a STK500 menu and you can start programing your device.
The USB/RS-232 adapter problem had me really stuck for a day or two. I still don't have a good solution except that I am using an older computer with a fixed RS-232 port for the actual programming.

And that program for flashing the LEDs on the board? Here it is:


#include

int
main()
{
unsigned int i;

while (1) {
for (i=0; i<10000; i++) {
PORTB=0xf;
}
for (i=0; i < 5000; i++ ) {
PORTB=0x0;
}
}
}

No comments: