ATtiny84 mit Arduino als ISP: Problem beim uploaden

Hi,

ich will ein kleines elektro “Spielzeug”-Auto bauen und benutze zum fernsteuern ein ATtiny84 (A PU), doch beim uploaden erscheint ein Fehler.

1.) Wie erkenne ich welche clock mein ATtiny hat?

2.) Wie behebe ich den Fehler?

Ein paar Informationen:

Das ist der Code:

#include <VirtualWire.h>
#include <VirtualWire_Config.h>

const int LEDPin_rc = 10;
//const int LEDPin_power = 9;
const int TransmitterPin = 8;
const int ButtonPin_rc = 1;
const int PotiPin_speed = 7;
const int PotiPin_direction = 6;
int speed = 0;
int direction = 0;
int last_speed = 0;
int last_direction = 0;
boolean rc = true;
boolean last_rc = true;
char *message;
String message_convert;

void setup() {
pinMode(LEDPin_rc, OUTPUT);
//pinMode(LEDPin_power, OUTPUT);
pinMode(TransmitterPin, OUTPUT);
pinMode(ButtonPin_rc, INPUT);
pinMode(PotiPin_speed, INPUT);
pinMode(PotiPin_direction, INPUT);
//digitalWrite(LEDPin_power, HIGH);

  vw_set_ptt_inverted(true);
  vw_setup(2000);
  vw_set_tx_pin(TransmitterPin);
}

void loop() {
  speed = analogRead(PotiPin_speed);
  direction = analogRead(PotiPin_direction);
  rc = analogRead(ButtonPin_rc);
  if(rc != last_rc) {
    message = "rrrr";
    vw_send((uint8_t *)message, strlen(message));
    vw_wait_tx();
    last_rc = rc;
  }
  if(rc) {
    analogWrite(LEDPin_rc, HIGH);
    if(last_speed != speed) {
      message_convert = String(0000 + ((speed / 2) - 256));
      message_convert.toCharArray(message, 4);
      last_speed = speed;
      vw_send((uint8_t *)message, strlen(message));
      vw_wait_tx();
    } else if(last_direction != direction) {
      message_convert = String(0000 + ((direction / 57) + 300));
      message_convert.toCharArray(message, 4);
      last_direction = direction;
      vw_send((uint8_t *)message, strlen(message));
      vw_wait_tx();
    }
  } else {
    analogWrite(LEDPin_rc, LOW);
  }
}

Beim uploaden kommt folgender Fehler:

avrdude: please define PAGEL and BS2 signals in the configuration file for part ATtiny84
avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50
avrdude: initialization failed, rc=-1
         Double check connections and try again, or use -F to override
         this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Schon mal danke im voraus.

MfG,

  • Paul

Geh nach dieser Anleitung

Und wie soll ich es beim ATtiny84 anschließen?

Na genau so wie beschrieben,
ATtiny -> Arduino
VCC(+) -> +5V
9 (SCK) -> Pin13
8 (MISO) -> Pin12
7 (MOSI) -> Pin11
2 (XTAL1) -> Pin9
(-) GND -> GND
Reset -> Pin10

Danke!!!

Es funktioniert!