You are on page 1of 1

COMPILING AND PROGRAMMING AN ATTINY85 USING AVR STUDIO 4 WITH AN STK500 DEVELOPMENT BOARD

1. Ensure correct setup of the STK500 development board. 2. Start AVR Studio 4. To program an already existing .hex file onto the chip, skip to step 6. Otherwise, follow steps 3-5 to compile existing source code into a .hex file. 3. Create a new project and add all .c files to Source Files and all .h files to Header files under the project tree. 4. Specify an external makefile if one is necessary/present by going to Configuration Options under Project on the menu. Check Use External Makefile and browse for the file. (Also change any necessary settings, e.g. device, frequency, etc.) 5. Click Build All under Build on the menu. This compiles the project into a .hex file. Any warnings/errors will be shown in the messages box at the bottom left. 6. With a .hex file in hand, press the Connect button Select STK500 or AVRISP and Auto. Click Connect. 7. A popup STK500 in ISP mode with Attiny85 should pop up. Select ATtiny85 as the device and ISP mode as the programming mode. Click Read signature to ensure no errors in setup. 8. Under the Program tab, select the .hex file as the Input HEX file under Flash. Click Program and hope it works. 9. Under the Fuses tab, select the appropriate fuses. For most projects, CKDIV8 should be unchecked and brownout detection disabled. The only fuse enabled should be SPIEN (Serial Peripheral Interface Enable). As well, select an appropriate clock source1. For one frequency there will be a few options selecting the one with the highest PWRDWN/RESET time is usually best unless otherwise specified.

*Note: This procedure is easily modified for other AVR chips, however, the wiring and configuration of the STK500 board and the available fuses may differ.

For example, to use an 8Mhz external oscillator, Ext. Crystal Osc; Frequency 3.0-8.0Mhz; Start-up time PWRDWN/RESET: 16K CK/14 CK + 65 ms should be selected

You might also like