Home - Blog

STK500: A Great Way to Program Microcontrollers

Are you looking for an easier way to program in a safer environment? Do you need a break from the more popular Raspberry Pi and Arduino boards? If your answers are affirmative, consider the STK500.

Interestingly, the STK500 does more than programming. It also offers development options for Atmel’s AVR microcontrollers.

Still curious? Read on to find out what an STK500 is, its features, and how to program with the STR500 development system.

What is STK500?

Atmel AT29C020 Microcontroller

Atmel AT29C020 Microcontroller

Source: Wikimedia Commons

The STK500 is a starter kit developed by Atmel for their AVR microcontrollers. Additionally, the STK500 is capable of designing and programming codes for these AVR microcontrollers and other prototypes.

It also helps designers try out new things and create unique designs. Furthermore, designers can use Atmel’s IDE to debug and write codes with the STK500.

With STK500, you can also program Arduino boards easily. How? It eliminates the need to use Arduino IDE. For this reason, Arduino fans can program nodes directly or via internet browsers.

However, they’ll still need a javascript-enabled STK500v1 programmer for this task.

Arduino

Arduino

Source: Pixabay

Features

STK500 Features

STK500 Features

Source: Flickr

The STK500 comes packed with many features that make programming fun and easy. These features include:

  • A serial in-system programming.
  • The STK500 kit comes with LEDs and pushes buttons for experimentation.
  • It also has sockets for four types of AVR devices, including 8-,20-,28-, and 40-pin devices.
  • You can easily upgrade from the AVR studio.
  • The STK500 also features in-system programming for external target systems.
  • You can get access to a flexible clocking, reset, and voltage system.
  • The R2-232 on the STK500 allows interfacing with computers.
  • The STK500 kit also offers an extra RS-232 driver and connector.
  • You can use the STK500 for serial high-voltage and parallel programming.
  • Also, you can use pin header connectors to easily access all AVR I/O ports.
  • The STK500 works with a supply voltage of 9-12v.
  • It also works with a 1.8-6.0v target voltage.

How to Program on an STK500?

Before we get into programming with an STK500, there are key prerequisites to consider. They involve setting up your hardware and connecting everything properly before using your STK500.

STK500 Hardware

STK500 Hardware

Source: Flickr

Hardware Setup

Here are six hardware setup requirements you need to meet before powering up your STK500:

  1. Connect the power supply to the power connector and make sure you connect the supply to the mains voltage.
  2. Afterward, join the 10-pin ribbon cable between PORTD and SWITCHES connectors.
  3. Next, combine a second 10-pin ribbon cable between PORTD and LEDS connectors.
  4. Link the serial programming cable to your computer’s serial port and the RS232 CTRL connector.
  5. Connect the 6-pin ribbon cable between the SPROG3 and ISP6PIN connectors.
  6. Mount the Atmega32 chip in the SCKT3100A3 socket. Ensure the chip’s marker points towards SWITCHES.

After fulfilling these steps, power up your STK500. The LED will glow red, then green once the booting process is over. At this point, the STK500 is ready to go.

LEDs

LEDs

Source: Flickr

Programming on an STK500

First, check if your STK500’s programming function is working correctly. You can use this command function to find out.

For Avrdude, use the following command:

If it works, you’ll see a report indicating your target device is present.

How to Upload a Code

It’s also easy to upload a code to your STK500 using Avrdude. For example, if you have a hex-code file, use to following commands to upload it:

When the code gets uploaded, the STK’s LEDs will display a yellow light. When the upload is complete, you’ll see a success report.

Note: Change ‘test. rom’ to the name of your file

Setting the Clock Source

The STK500 uses an internal RC-oscillator as its system clock source. It also utilizes fuse bits (specifically the lower fuse byte) to select its clock source. You can use the following command to read fuses:

Check the AVR database for more details.

Note: the clock source stays on 1.0 MHZ for all pre-project activities.

Fuse Byte Table

Fuse Byte Table

Note: the clock source stays on 1.0 MHZ for all pre-project activities

Common Mistakes Made when Programming on the STK 500

Here are some common mistakes to avoid when using the STK 500:

Errors with the Ports and Pins
Port and Pin

Port and Pin

Source: Wikimedia Commons

Remember to always connect the other terminals of the STK500’s LEDs to a voltage source. Also, the LEDs glow when the ATMEGA32’s PORT pin is on ground level (zero).

However, if you don’t set the LED port as output, your LEDs will only have a low glow that’s almost invisible. Therefore, you should also set the button port as input and the pull-up resistors as ON. 

You can check the datasheet to ensure you have connected the correct ports and pins.

Errors with Timing

If your project involves accurate timing, you’ll need hardware PWM or interrupts features. So, avoid using delay_us and delay_ms functions because they’re not so reliable.

These functions are more similar to an empty loop. They also won’t work correctly without the code’s FCPU flag and the compiler optimization level. You’ll get low or high-time delays if you use these functions without optimization.

Coding on your STK500

You’ll need the AVR-libc library for coding on your STK 500. But what is an AVR-libc? It’s a library for working AVRs. 

Additionally, various programs can help you test your development tools and coding. You click here to find these programs.

What is the STK600?

The STK600 is simply an updated variant of the STK 500 with even more features for programming AVR microcontrollers. It also has USB ports, and its development kit comes with a USB cable.

Final Words

Atmel AVR Microcontroller

Atmel AVR Microcontroller

Source: Wikimedia Commons

The STK 500 is excellent for programming in a safe environment and getting a fresh taste of a different development board. It also has excellent support for AVR devices and even Arduino (with an STK 500 programmer.)

Interestingly, the STK 500 programmer uses javascript to enable direct coding on Arduino boards. And it also works with an STK500v2 browser implementation to allow programming Arduinos through browsers.

What are your thoughts on the STK 500? Let us know if you have any questions.

Hommer Zhao
Hi, I am Hommer, the founder of WellPCB. So far, we have more than 4,000 customers worldwide. If you have any questions, you can feel free to contact me. I really appreciate any help you can provide.

Services