Infos:
- https://wolles-elektronikkiste.de/en/programming-attiny85-84-45-44-25-24
- https://www.heise.de/ratgeber/Erste-Schritte-mit-den-Mikrocontrollern-ATtiny84-und-85-4399393.html
- https://arduinodiy.wordpress.com/2012/02/28/program-an-attiny-with-an-arduino-nano/ → Verkabelung spezifisch für Arduino Nano
Vorgehen mit der ArduinoIDE:
- Arduino als Programmer einrichten:
- ATtiny nicht verbinden!
10µF-Kondensator zwischen GND und RST(hier nicht notwendig!)- File → Examples → ArduinoISP wählen
- Arduino Nano Every als Board auswählen
- Baudrate im Serial-Monitor gleich BAUDRATE im Sketch setzen
- Tools → Registers Emulation → None (ATMEGA4809) wählen
- Fehler
avrdude: jtagmkII_initialize(): Cannot locate "flash" and "boot" memories in description
ignorieren
- Programm für ATtiny hochladen
- ATtiny wie hier beschrieben verbinden (+0.1µF zwischen VCC und GND!)
- am Arduino 10µF-Kondensator zwischen GND und RST
- Sketch öffnen
- ATtiny als Board auswählen
- Tools → Processor → ATtiny84 (oder anderen)
- Tools → Programmer → Arduino as ISP
- Sketch → Upload using Programmer (Upload-Button geht nicht!)
- https://jloh02.github.io/projects/connecting-attiny85-serial-monitor/
- https://www.hackster.io/porrey/easy-serial-on-the-attiny-2676e6
- https://forum.arduino.cc/t/attiny85-using-software-serial-error-solved/389825/8
- Arduino as ISP-Sketch incl. Serial (Verkabelung)
- wie oben beschrieben hochladen:
- mit Sketch “ArduinoISP” funktioniert es nicht, daher anderen Sketch, z.B. Examples→Basic→Bare Minimum hochladen
(alles physische PIN-Nummern!)
Arduino | ATtiny |
---|---|
3.3V | Pin 1 (VCC) |
GND | Pin 14 (GND) |
screen /dev/ttyACM0 19200
- klappt Umstellung auf 8MHz → so testen:
avrdude -P /dev/ttyACM0 -b19200 -c avrisp -p attiny84 -v
- Pin-IDs = Spalte “PlatformIO”
- funktioniert
- https://github.com/SpenceKonde/ATTinyCore
- Anleitung
- “Also, if using ATTinyCore, consider using the builtin soft serial, instead of SoftwareSerial (SoftwareSerial prevents you from using all PCINTs in exchange for being able to use any pin for RX, mine doesn’t interfere with PCINTs (uses the analog comparator interrupt instead - but pins are fixed)” Quelle
- TX auf PA1 (Pin 12), RX auf PA2 (Pin 11)
- funktioniert
- https://github.com/FragJage/TinyDebugSerial
- TX auf PB0 (Pin 2)
#include "TinyDebugSerial.h"
int ledPin = 3; // = PA2
void setup() {
pinMode(ledPin, OUTPUT);
Serial.begin(9600);
}
void loop() {
digitalWrite(ledPin, HIGH);
Serial.println("blink");
delay(500);
digitalWrite(ledPin, LOW);
delay(500);
}
- Forumsdiskussion
- c’t-Links
- Blogbeitrag, auf dem wohl der c’t-Artikel basiert
- Anpassung an The Things Stack V3
- Noch ein Beitrag mit Sensor
- noch eine Forumsdiskussion
- Vom blink+serial-Sketch ausgehend Code hinzufügen:
- Ausgabe Voltage
- Schlafmodus
- RFM95.init()
- usw.