Pages: 1 [2]   Go Down
Author Topic: Mega 2560 as ISP for ATTiny  (Read 5592 times)
0 Members and 1 Guest are viewing this topic.
Lawrence, MA
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a photo of my setup (without the USB cable).

It might be difficult to tell from the photo which pins are attached where, so for the SPI pins:
  • Red to 52
  • White to 50
  • Blue to 51
  • Orange to 53

The top of the breadboard has the red rail connected to +5V. This feeds the ATTiny and the line that runs through the two resistors and back to RESET. The resistors are 10ohms and 100ohms in series. A 10uF capacitor is also connected to the RESET line and then to the ground pin below 53 (a green wire) on the Mega2560. The setup on the left is the three LEDs on pins 9, 8, and 7 for feedback from ArduinoISP. The ground rail on the bottom of the breadboad grounds out the LEDs and the ATTiny.

And just for the sake of completeness, the desk is made of oak.


* ArduinoISP for ATTiny45.jpg (678.73 KB, 800x730 - viewed 83 times.)
« Last Edit: April 05, 2012, 08:57:08 pm by kwilson68 » Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 484
Posts: 18767
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Well this is what I tried - with success ...



I had an Attiny85 to hand, not an Attiny45 - but it's the same datasheet.

Orange: Attiny85 pin 5 (MOSI) to Mega pin 51
White: Attiny85 pin 6 (MISO) to Mega pin 50
Red: Attiny85 pin 7 (SCK) to Mega pin 52
Green: Attiny85 pin 1 (/RESET) to Mega pin 53

Blue: Gnd
Other red on right: +5V

47uF cap between Mega /RESET and Gnd

Decoupling 0.1 uF cap on breadboard.
Other components not connected (from earlier test).


Loaded ArduinoISP from Examples in the 1.0 Version of the IDE.

Hit reset button on the Mega. Waited till flickering stopped.

Sent command:

Code:
avrdude -c arduino -p t85 -vvvv -P /dev/tty.usbmodemfd141 -b 19200

Got response:

Code:
avrdude: Version 5.8cvs, compiled on Jan 15 2010 at 17:27:01
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/local/CrossPack-AVR-20100115/etc/avrdude.conf"
         User configuration file is "/Users/nick/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/tty.usbmodemfd141
         Using Programmer              : arduino
         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                      : ATtiny85
         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
...
         Programmer Type : Arduino
         Description     : Arduino
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 ATtiny85
avrdude: Send: P [50]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: AVR device initialized and ready to accept instructions

Reading |                                                    | 0% 0.00savrdude: Send: u [75]   [20]
avrdude: Recv: . [14] . [1e] . [93] . [0b] . [10]
Reading | ################################################## | 100% 0.04s

avrdude: Device signature = 0x1e930b
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [e2]
avrdude: Recv: . [10]
avrdude: safemode read 1, lfuse value: e2
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [e2]
avrdude: Recv: . [10]
avrdude: safemode read 2, lfuse value: e2
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [e2]
avrdude: Recv: . [10]
avrdude: safemode read 3, lfuse value: e2
avrdude: safemode: lfuse reads as E2
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [df]
avrdude: Recv: . [10]
avrdude: safemode read 1, hfuse value: df
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [df]
avrdude: Recv: . [10]
avrdude: safemode read 2, hfuse value: df
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [df]
avrdude: Recv: . [10]
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 1, efuse value: ff
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 2, efuse value: ff
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 3, efuse value: ff
avrdude: safemode: efuse reads as FF
avrdude: Send: V [56] . [a0] . [01] . [fc] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [01] . [fd] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [01] . [fe] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: Send: V [56] . [a0] . [01] . [ff] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]

avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [e2]
avrdude: Recv: . [10]
avrdude: safemode read 1, lfuse value: e2
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [e2]
avrdude: Recv: . [10]
avrdude: safemode read 2, lfuse value: e2
avrdude: Send: V [56] P [50] . [00] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [e2]
avrdude: Recv: . [10]
avrdude: safemode read 3, lfuse value: e2
avrdude: safemode: lfuse reads as E2
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [df]
avrdude: Recv: . [10]
avrdude: safemode read 1, hfuse value: df
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [df]
avrdude: Recv: . [10]
avrdude: safemode read 2, hfuse value: df
avrdude: Send: V [56] X [58] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [df]
avrdude: Recv: . [10]
avrdude: safemode read 3, hfuse value: df
avrdude: safemode: hfuse reads as DF
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 1, efuse value: ff
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 2, efuse value: ff
avrdude: Send: V [56] P [50] . [08] . [00] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [ff]
avrdude: Recv: . [10]
avrdude: safemode read 3, efuse value: ff
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK
avrdude: Send: Q [51]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]

avrdude done.  Thank you.

So it all works. Now you just need to work out where you differ from those steps. smiley
Logged


Global Moderator
Offline Offline
Brattain Member
*****
Karma: 484
Posts: 18767
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh and the desk is Laminex I think. smiley-razz
Logged


Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I had the same problem. I couldn't figure out how to program an ATtiny with an Arduino Mega as all the tutorials used Arduino Unos. I eventually figured it out and made my own tutorial and posted it on my blog.

http://jamestav.blogspot.com/2014/08/programming-attiny85-microchip-using.html
Logged

Pages: 1 [2]   Go Up
Jump to: