How to Configure AVR Studio 4 to Talk to an Atmel STK500

We’ve purchased, installed, and set up the STK500 board for programming an Atmel AVR ATtiny chip. Now, we’re going to run the application and verify that we have a good connection.

Connecting with AVR Studio 4

Launch AVR Studio from the Atmel AVR Tools menu in the Windows OS Start menu.

Atmel AVR Studio application start menu

Atmel AVR Studio application start menu.

Power on the STK500 by sliding the power switch. The red LED near the power switch should light up. The green LED (marked STATUS) near the ribbon cable should blink a couple of times and turn solid green. If not, power off and check your cables.

On the toolbar, click the Connect icon. The same function can also be found at Tools->Program AVR->Connect menu.

AVR Studio connect toolbar

AVR Studio connect toolbar.

A window appears with the choice of programming boards and computer ports. Choose STK500 and whatever serial port you have connected it to. Then, click the Connect button.

AVR Studio programmer connection choices

AVR Studio programmer connection choices.

On the Main tab, on the “Device and Signature Bytes” menu pulldown, choose the ATtiny45 or whatever chip you have installed. Click the Read Signature button.

Verifying good chip communication in AVR Studio

Verifying good chip communication in AVR Studio.

If communication is working properly, you'll see a bunch of “OK!” status messages at the bottom of the window. More importantly, you'll see a message toward the top that says “Signature matches selected device”. This confirms that you have the correct wiring, correct communication settings, and the correct device.

If you do NOT receive this message, there are six common mistakes:

I suppose there are other possible causes, such as the chip is dead or can only be programmed in high-voltage mode. But, those are less common.

Target Frequency

From the factory, most of the chips have a built-in oscillator with an 8 MHz clock rate divided by 8 -- for a 1 MHz effective rate. The STK500 communication rate must 1/4 or slower than the chip rate in order to communicate.

Click the Settings button on the Main tab if you are having difficulty communicating with a chip. Set the menu to 115.2 kHz and click the Write button to save that value to the STK500 board. This is a board setting; not a chip setting.

STK500 ISP communication frequency

STK500 ISP communication frequency.

Unfortunately, 115.2 kHz is slow enough to be bothersome when programming microcontrollers that have larger Flash memory. So, you'll often turn off the CKDIV8 fuse or connect those chips to an external oscillator. That allows you to bump up the ISP frequency to 460.8 kHz or 1.845 MHz for much faster programming.

Weeks later, you decide to program a factory fresh ATtiny45 and it refuses to communicate. An error saying “WARNING: Signature does not match selected device!” usually appears when trying to read the signature. You forgot to set the frequency back to a slow rate!

Target Voltage

You can connect the ISP cable from the STK500 board to your project’s board. That allows you to program and debug the chip while it is installed on the project itself.

Most AVR chips work up to 5 V. However, your project board may run at 3.3 V or some other voltage. In that case, you can set the STK500 to supply a lower voltage by clicking on the HW Setting tab.

STK500 voltage settings in AVR Studio

STK500 voltage settings in AVR Studio.

Similar to the ISP frequency setting, the voltage setting for the power and analog reference are saved to the STK500 tool, not to the chip. So, if you choose a lower voltage and click the Write button, but then try to program a chip with a brownout fuse bit set to a higher voltage, the STK500 will be unable to communicate with that chip because the CPU stays asleep at that voltage.

In this example, the chip is an ATtiny45 DIP chip. It can be removed from the socket on my project and installed in the STK500. Therefore, I can safely set the VTarget voltage of the STK500 to 5 V, to be sure it will supply a high enough voltage to wake the ATtiny45 regardless of its brownout fuse setting.