Assistance needed programming the ATTiny84 with the Arduino

Assistance needed programming the ATTiny84 with the Arduino Uno ATMega328P-PU.

I tried the following steps repeatedly.```

[list][quote][/quote][/list]
```

SKU:COM11232 ATTiny84 14 pin 20 MHz 8K 12A/D purchased from SparkFun

• Download: ATtiny (from this GitHub repository)

• Locate your Arduino sketchbook folder (you can find its location in the preferences dialog in the Arduino software)

• Create a new sub-folder called “hardware” in the sketchbook folder.

• Copy the attiny folder from inside the .zip to the hardware folder. You should end up with folder structure like Documents > Arduino > hardware > attiny that contains the file boards.txt and another folder called variants.

• Restart the Arduino development environment.

• You should see ATtiny entries in the Tools > Board menu.

Turning the Arduino board into a programmer

We’re going to use the Arduino board to program the ATtiny. First, we’ll need to turn the Arduino board into an “in-system programmer” (ISP). To this:

• Run the Arduino development environment.

• Open the ArduinoISP sketch from the examples menu.

• Note for Arduino 1.0: you need to make a small change to the ArduinoISP sketch before uploading it. Find the line in the heartbeat() function that says “delay(40);” and change it to “delay(20);”.

• Select the board and serial port that correspond to your Arduino board.

• Upload the ArduinoISP sketch.

Pin connections for ATtiny84:

• ATtiny84 Pin 4 to Arduino Pin 13 (or SCK of another programmer)

• ATtiny84 Pin 5 to Arduino Pin 12 (or MISO of another programmer)

• ATtiny84 Pin 6 to Arduino Pin 11 (or MOSI of another programmer)

• ATtiny84 Reset Pin to Arduino Pin 10 (or RESET of another programmer)

Configuring the ATtiny to run at 8 MHz (for SoftwareSerial support)

By default, the ATtiny’s run at 1 MHz (the setting used by the unmodified “ATtiny45″, etc. board menu items). You need to do an extra step to configure the microcontroller to run at 8 MHz – necessary for use of the SoftwareSerial library. Once you have the microcontroller connected, select the appropriate item from the Boards menu (e.g. “ATtiny45 (8 MHz)”). Then, run the “Burn Bootloader” command from the Tools menu. This configures the fuse bits of the microcontroller so it runs at 8 MHz. Note that the fuse bits keep their value until you explicitly change them, so you’ll only need to do this step once for each microcontroller.

The Burn Bootloader fails with the following message:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84

avrdude: Yikes! Invalid device signature.

Double check connections and try again, or use -F to override

this check.

Problem:

Avrdude dislikes your lovely 328-PU chips and says “avrdude: Yikes! Invalid device signature.” or “avrdude: Expected signature for ATMEGA328P is 1E 95 0F”

Soln:- This problem happens becoz ur arduino uses 328p - pu and if u bought 328pu(a couple dollars cheap).

The soln is to modify Arduino > hardware >tools>avr>etc and open avrdude.conf file as word document.keep backup of this file incase u mess up.

find 1E 95 0F text under Atmega328 and change it to 1E 95 14 and save.

restart arduino environment and burn bootloaders on all ur chips.use status leds as mogul said.they help a lot.

After burning change the text in avrdude.conf file back to 1E 95 0F and restart arduino ide.Then u can uplode code normally.

For anyone having problems burning bootloader into fresh AtMega328 pu and not 328p pu(pico power series),Here’s what you need to do

Problem:

“pins_arduino.h: No such file or directory”

Solution:

Copy the contents from the downloaded boards.txt in your src/hardware folder to the boards.txt in App folder instead. On OSX: right click the Arduino app and browse Contents/Resources/Java/hardware/arduino/boards.txt.

You may also need to add the line below after the other text you pasted as it’s missing in the downloadable example file:

atmega328bb.build.variant=standard

After this, the ArduinoISP example compiled fine and uploaded to the Duemilanove board that I’m using for burning the bootloader. The next problem I bumped into was that when I selected Tools → Burn Bootloader, avrdude couldn’t communicate with my board.

Problem:

1)stk500_getsync(): not in sync: resp=0x00

You can also get other hex numbers like resp=0x15 and resp=0xf0

Add either a 120 Ohm resistor (didn’t work for me) or a 10uF Capacitor (worked like a charm) between the Reset and 5V Pin.

For the Uno, connecting a 10μF capacitor between the RESET and GND lines works for me (as described in the linked thread).

http://www.arduino.cc/playground/Main/D … Connection

I had to fiddle a bit to get this right and once it worked I ran straight into the next problem…

Problem:

Avrdude dislikes your lovely 328-PU chips and says “avrdude: Yikes! Invalid device signature.” or “avrdude: Expected signature for ATMEGA328P is 1E 95 0F”

Soln:- This problem happens becoz ur arduino uses 328p - pu and if u bought 328pu(a couple dollars cheap).

The soln is to modify Arduino > hardware >tools>avr>etc and open avrdude.conf file as word document.keep backup of this file incase u mess up.

find 1E 95 0F text under Atmega328 and change it to 1E 95 14 and save.

restart arduino environment and burn bootloaders on all ur chips.use status leds as mogul said.they help a lot.

After burning change the text in avrdude.conf file back to 1E 95 0F and restart arduino ide.Then u can uplode code normally.

This did not work. I am still unable to burn the bootloader.

C:\Arduino\arduino-1.0\hardware/tools/avr/bin/avrdude -CC:\Arduino\arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -pattiny84 -cstk500v1 -P\.\COM5 -b19200 -e -Uefuse:w:0xff:m -Uhfuse:w:0xdf:m -Ulfuse:w:0xfe:m

avrdude: Version 5.11, compiled on Sep 2 2011 at 19:38:36

Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is “C:\Arduino\arduino-1.0\hardware/tools/avr/etc/avrdude.conf”

Using Port : \.\COM5

Using Programmer : stk500v1

Overriding Baud Rate : 19200

avrdude: Send: 0 [30] [20]

avrdude: Send: 0 [30] [20]

avrdude: Send: 0 [30] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [10]

AVR Part : ATtiny84

Chip Erase delay : 4500 us

PAGEL : P00

BS2 : P00

RESET disposition : possible i/o

RETRY pulse : SCK

serial program mode : yes

parallel program mode : yes

Timeout : 200

StabDelay : 100

CmdexeDelay : 25

SyncLoops : 32

ByteDelay : 0

PollIndex : 3

PollValue : 0x53

Memory Detail :

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


eeprom 65 6 4 0 no 512 4 0 4000 4500 0xff 0xff

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


flash 65 6 32 0 yes 8192 64 128 4500 4500 0xff 0xff

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00

Block Poll Page Polled

Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack


calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00

Programmer Type : STK500

Description : Atmel STK500 Version 1.x firmware

avrdude: Send: A [41] . [80] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [02]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [81] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [01]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [82] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [12]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [98] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

Hardware Version: 2

Firmware Version: 1.18

Topcard : Unknown

avrdude: Send: A [41] . [84] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [85] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [86] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [87] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [89] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

Vtarget : 0.0 V

Varef : 0.0 V

Oscillator : Off

SCK period : 0.1 us

avrdude: Send: A [41] . [81] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [01]

avrdude: Recv: . [10]

avrdude: Send: A [41] . [82] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [12]

avrdude: Recv: . [10]

avrdude: Send: B [42] . [14] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] @ [40] . [02] . [00] . [00] . [00] [20] . [00] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [10]

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84

avrdude: Send: P [50] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [10]

avrdude: AVR device initialized and ready to accept instructions

Reading | avrdude: Send: V [56] 0 [30] . [00] . [00] . [00] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

avrdude: Send: V [56] 0 [30] . [00] . [01] . [00] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

################avrdude: Send: V [56] 0 [30] . [00] . [02] . [00] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [00]

avrdude: Recv: . [10]

################################## | 100% 0.06s

avrdude: Device signature = 0x000000

avrdude: Yikes! Invalid device signature.

Double check connections and try again, or use -F to override

this check.

avrdude: Send: Q [51] [20]

avrdude: Recv: . [14]

avrdude: Recv: . [10]

avrdude done. Thank you.

Yahoo….

I added 1 @ 20 mhz crystal and 2 @ 22 pF capacitors on XTAL1 XTAL2 on the ATTiny84 which created an external AVR oscillator and now the bootloader for the ATTiny 84 ran successfully.

!!! SUCCESS !!!

I purchased what I thought was a 20 MHz chip, but reading the datasheet the 20 MHz signal is the maximum rating from an external source.

SKU:COM11232 ATTiny84 14 pin 20 MHz 8K 12A/D was purchased from SparkFun

The device is shipped with CKSEL = “0010”, SUT = “10”, and CKDIV8 programmed. The default

clock source setting is therefore the Internal RC Oscillator running at 8.0 MHz with longest startup

time and an initial system clock prescaling of 8, resulting in 1.0 MHz system clock. This

default setting ensures that all users can make their desired clock source setting using an in-system

or high-voltage programmer.

The boards.txt file that was used had three options for the ATTiny84:

ATTiny84 (internal 1MHz Clock)

ATTiny84 (internal 8MHz Clock) (This one works without the external 20 MHz signal)

ATTiny84 (external 20MHz Clock) (This is the one that I chose)

The bootloader looked for a 20 MHz external clock, which at the time did not exist and gave an error:

“avrdude: Yikes! Invalid device signature.”.

I added 1 @ 20 mhz crystal and 2 @ 22 pF capacitors on XTAL1 XTAL2 which created an external AVR oscillator and now the bootloader for the ATTiny 84 ran successfully.

NOTE:

If the chip is programmed at 20 MHz, then the configuration needs to contain the 20 MHz external source for communication even if you are attempting to set it to the internal 8 MHz clock.

If the chip is programmed at 8 MHz, then the configuration uses the internal clock but needs to contain the 20 MHz external source for if you are attempting to set it to the external 20 MHz clock.