Forum: Mikrocontroller und Digitale Elektronik ATtiny841 per AVRDUDE auf Rasberry Pi programmieren


von (prx) A. K. (prx)


Lesenswert?

Der Tiny liess sich per avrdude/linuxspi (RasPi) problemlos ansprechen 
und programmieren, wenn die Taktquelle in den Fuses auf R/C-Oszillator 
stand. Standen die Fuses aber auf Quarzoszillator ging nichts. Der 
Dragon hatte in beiden Fällen keine Probleme.

Die avrdude 6.1 Version mit dem linuxspi Modul für RasPi stammt von
http://kevincuzner.com/2013/05/27/raspberry-pi-as-an-avr-programmer/
und hält sich beim Ablauf nicht wirklich an Atmels Vorgaben.

Quick and dirty Fix:
1
*** linuxspi.c.orig     2015-01-27 18:47:20.551705456 +0100
2
--- linuxspi.c  2015-01-27 18:52:15.385008936 +0100
3
***************
4
*** 271,290 ****
5
--- 271,293 ----
6
  static int linuxspi_initialize(PROGRAMMER* pgm, AVRPART* p)
7
  {
8
      int tries, rc;
9
10
      if (p->flags & AVRPART_HAS_TPI)
11
      {
12
          //we do not support tpi..this is a dedicated SPI thing
13
          fprintf(stderr, "%s: error: Programmer %s does not support TPI\n", progname, pgm->type);
14
          return -1;
15
      }
16
+
17
+     //AK
18
+     usleep(50000);
19
20
      //enable programming on the part
21
      tries = 0;
22
      do
23
      {
24
          rc = pgm->program_enable(pgm, p);
25
          if (rc == 0 || rc == -1)
26
              break;
27
          tries++;
28
      }

: Bearbeitet durch User
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.