ATtiny84 programmieren

Guten Abend,

ich möchten einen ATtiny programmieren. Ich nutze einen Arduino Mega als ISP Programmer.
Den Code um den Arduino als Programmer zu nutzen habe ich auf den Arduino geladen.
Beim versuch den Code auf den ATtiny84 zu laden bekomme ich folgende Fehlermeldung:

`*avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\jsiev\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM3
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     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
       flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

     Programmer Type : STK500
     Description     : Atmel STK500 Version 1.x firmware
     Hardware Version: 2
     Firmware Version: 1.18
     Topcard         : Unknown
     Vtarget         : 0.0 V
     Varef           : 0.0 V
     Oscillator      : Off
     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Beim Hochladen des Sketches ist ein Fehler aufgetreten
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.*`

Jemand eine Idee woran das liegen könnte ?

Pinbelegung Mega:
MOSI 51
MISO 50
SCK 52
RESET 53

Pinbelegung ATtiny:
MOSI 7
MISO 8
SCK 9
RESET 4

Zusätzlich noch VCC und GND von Arduino und ATtiny verbunden.

Vermutlich fehlt der Elko 10yF am Reset des Mega. Der verhindert, das der Sketch auf Mega geschrieben wird.

Ist der nicht intern schon mit auf dem Board des Mega verbaut ?

Nein, dann würde das Flashen ja überhaupt nicht funktionieren.
Hier ein Tutorial.

Sowas passiert auch gerne, wenn der Attiny versehentlich auf eine externe Taktquelle gefused wurde...

Wurde also schon mal etwas mit dem Controller gemacht, oder ist der "frisch aus der Verpackung"?

Ein Forum reicht dir nicht?

Kondensatoren hab ich bestellt werde ich dann mal testen.
Wofür word der Reset vom Mega denn benötigt ?

Der ATtiny kommt neu aus der Verpackung.

Der Kondensator verhindert den Reset. Und das ist wichtig.

Ohh....liest du nicht, was wir dir schreiben ?
Das steht in Post #2

Ich hatte den Mega schon für andere einfache Projekte mit tastern und Leds in der Schule im Einsatz. Da lief alles gut ohne Kondensator am Reset.

Gerne nochmal für dich zum mitlesen.

Der Kondensator 10yF am Resetpin des Mega verhindert das der Mega beim übertragen des Sketch auf den ATtiny selbst resettet und damit den Sketch für sich annimmt.

Und bitte unterlass dein Crossposting, das wird nicht gern gesehen.

1 Like

Was mir aktuell noch auffällt, womit hast du den Pin53 (Reset) vom Mega verbunden ?

Der Pin53 vom Mega ist mit dem Pin4 (Reset) vom ATtiny verbunden.

Na, dann war das Posten des Links in #4 wohl umsonst...

Auch das ist völlig falsch.
Offensichtlich hast du dir bisher keinerlei Beschreibung dazu angesehen.
Der Pin 53 des Mega geht auf den Elko und Pin 4 des ATtiny auf Pin 10 des Mega.

Warum poste ich dir ein Tutorial, wenn du es dir nicht ansiehst ?

Guten Abend,

das Tutorial hatte ich nicht gesehen sorry.
Den Kondensator habe ich jetzt eingebaut und alles genauso verdrahtet wie im Tutorial.
Das ISP Sketch habe ich auf den Mega geladen. Wenn ich versuche den Code auf den ATtiny zu laden kommt immer noch der selbe Fehler.

avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\jsiev\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM3
     Using Programmer              : stk500v1
     Overriding Baud Rate          : 19200
     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
       flash         65     6    32    0 yes      8192   64    128  4500  4500 0xff 0xff
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

     Programmer Type : STK500
     Description     : Atmel STK500 Version 1.x firmware
     Hardware Version: 2
     Firmware Version: 1.18
     Topcard         : Unknown
     Vtarget         : 0.0 V
     Varef           : 0.0 V
     Oscillator      : Off
     SCK period      : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000 (retrying)

Beim Hochladen des Sketches ist ein Fehler aufgetreten
Reading | ################################################## | 100% 0.03s

avrdude: Device signature = 0x000000
avrdude: Yikes! Invalid device signature.
Double check connections and try again, or use -F to override
this check.

avrdude done. Thank you.

Muss noch ein Bootloader auf den Tiny geladen werden ?

Nein kein Bootloader, außer du brauchst eine andere Taktfrequenz als 1MHz.
Du musst deine Verdrahtung bis auf den Resetpin des Mega ATtiny und dem Elko so lassen wie zuvor. Du hast doch einen Mega und keinen Uno ?

Sorry, vertippt. :wink:

Ja ich habe einen Mega.

Ich habs nochmal aufgezeichnet wie ich es verdrahtet habe damit keine Missverständnisse aufkommen.

So ist es doch verdrahtet wie bei dem Tutorial ?
Verbaut ist ein 10uF Kondensator. Allerdings ein Keramik Kondensator und kein Elko.

Arduino Pinbelegung nach Programm:

// The standard pin configuration.
#ifndef ARDUINO_HOODLOADER2

  #define RESET     10 // Use pin 10 to reset the target rather than SS
  #define LED_HB    9
  #define LED_ERR   8
  #define LED_PMODE 7

  // Uncomment following line to use the old Uno style wiring
  // (using pin 11, 12 and 13 instead of the SPI header) on Leonardo, Due...

  #define USE_OLD_STYLE_WIRING

  #ifdef USE_OLD_STYLE_WIRING

    #define PIN_MOSI	11
    #define PIN_MISO	12
    #define PIN_SCK		13

  #endif

  // HOODLOADER2 means running sketches on the ATmega16U2 serial converter chips
  // on Uno or Mega boards. We must use pins that are broken out:
#else

  #define RESET     	4
  #define LED_HB    	7
  #define LED_ERR   	6
  #define LED_PMODE 	5

#endif

Warum machst du sowas ?
Die jetzigen Pins sind vom Uno, nicht vom Mega.

Mit Mega wird das nicht funktionieren Mega hat die Pins seitlich :wink: