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

Assistance needed programming the ATTiny84 with the Arduino Uno ATMega328P-PU.
SKU:COM11232 ATTiny84 14 pin 20 MHz 8K 12A/D purchased from SparkFun

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.

I tried the following steps:

• 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/DisablingAutoResetOnSerialConnection
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.

I am including the detail of the error here:

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.

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

The programer (your Arduino Uno) appears to be working correctly.

The target (your ATtiny84) is not responding. The most likely culprit is wiring. Carefully recheck the wiring and try again. GND is connected to GND. MISO to MISO. MOSI to MOSI. SCK to SCK. Digital pin 10 on the programmer is connected to RESET on the target.

Try to follow this tutorial:
http://pdp11.byethost12.com/AVR/ArduinoAsProgrammer.htm

You have just to replace the target Atmega328p, given as an example, with your target ATtiny84 which means that: Gnd, Vcc, MOSI, MISO, SCK and Reset of your ATtiny84 on the breadboard are assigned to different pins.

Also instead of:
c:>avrdude -P COM3 -b 19200 -c avrisp -p m328p –n
use:
c:>avrdude -P COM3 -b 19200 -c avrisp -p t84 –n

Did you remember the 10uF capacitor across reset and gnd on the UNO after uploading the ArduinoISP

From my experience with Arduino Uno R3 as ISP programmer, no supplemental capacitor is needed.

I do appreciate the feedback.

I rechecked the cabling:
Pin connections for ATtiny84:
• ATtiny84 Pin 4 Physical Pin 9 to Arduino Pin 13 (or SCK of another programmer) NOTE: USCK on ATTiny84
• ATtiny84 Pin 5 Physical Pin 8 to Arduino Pin 12 (or MISO of another programmer)
• ATtiny84 Pin 6 Physical Pin 7 to Arduino Pin 11 (or MOSI of another programmer)
• ATtiny84 Reset Pin Physical Pin 4 to Arduino Pin 10 (or RESET of another programmer

I tried instead of:
c:>avrdude -P COM3 -b 19200 -c avrisp -p m328p –n
use:
c:>avrdude -P COM3 -b 19200 -c avrisp -p t84 –n

I tried using the 10uF capacitor between ground and Reset. (Specified for the UNO)
I tried using the 10uF capacitor between the Reset and 5V Pin.
--- All of my attempts thus far have failed ---

Reason: Arduino Uno needs a Reset.
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.14s
avrdude: Device signature = 0xffffff (Device signature = 0x000000)
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

Reasons:
a) ISP connections (SS, MOSI, MISO, SCK) -> (RESET, MOSI, MISO, SCK), between Arduino Uno and the Target AVR, are not good.
b) The AVR oscillator (external) does not work.

I DO NOT have an AVR Oscillator in the circuit. I purchased the 16 mhz crystal and 2 @ 22 pF capacitors illustrated in the example along with a USBTinyISP programmer and I am waiting for the parts to ship now..

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

You have switched the clock source to External Crystal Oscillator. You will have to provide a clock signal on the XTAL1 pin or connect the crystal + capacitors.

avrdude -P COM3 -b 19200 -c avrisp -p t84 –n

I have not had any luck with avrisp. I suggest using stk500v1 or arduino.

I tried using the 10uF capacitor between ground and Reset. (Specified for the UNO)

Correct. Attach the capacitor after uploading the ArduinoISP sketch.

I tried using the 10uF capacitor between the Reset and 5V Pin.

Wrong.

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

According to the datasheet, the Attiny84 you purchased is set to run using the internal 8 MHz RC oscillator ( likely divided by 8 ). So, as long as your Attiny84 is powered, the oscillator should work and avrdude should be able to talk with the target microcontroller, supposing the ISP connections are wired correctly.

As long as you can not communicate with the Attiny84 the 16 MHz Crystal is useless because you can not set the uC to use it.

I believe you have either a wiring problem or ArduinoISP has some troubles in communicating with an Attiny84. With a target Atmega328p it works fine.

As long as you can not communicate with the Attiny84 the 16 MHz Crystal is useless because you can not set the uC to use it.

Or, if the chip has been set to use external OC and there is no crystal present.

What Riva said.
I previously had to battle an attiny85 I had for some days (shame) before realizing this:
if you set a chip to work at a given frequency, you have to have it working exactly the same when you try to change it's bootloader.
If it was set to run at a higher-than-factory frequency with a crystal, everything should be exactly the same when burning a new bootloader.

:slight_smile:

Yahoo….
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.

!!! SUCCESS !!!

eraney:
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.

So, was your ATTiny 84 already set somehow by you to work with the external oscillator or you bought it configured for external oscillator?

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 files 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.

You bought the Attiny84 set to run with its internal RC oscillator.
Finally, without setting the Attiny84 to work with the 20 MHz Crystal, you attached the external oscillator and you programmed the controller.
How is it possible?

Likely your chip was already set for external crystal which is not its default state.