https://github.com/digistump/DigistumpArduino/releases
Download the latest ARVDude program (for Windows, MacOS or Linux)
https://github.com/avrdudes/avrdude
For Windows user:
- download avrdude-v8.1-windows-x64.zip
- unzip to anywhere you like
- open terminal at the current folder containing your ardude files (avrdude.ext)
download t85_default.hex from github.com/micronucleus/micronucleus/tree/master/firmware/releases
Put the t85_default.hex file to the same folder of your avrdude folder
Connect Arduino with Badge pins.
Arduino UNO Badge(ATtiny85)
D10 <--- ---> RESET(PB5)
D11 <--- ---> MOSI(PB0)
D12 <--- ---> MISO(PB1)
D13 <--- ---> SCK(PB2)
GND <--- ---> GND
5V <--- ---> VCC
Also refer to this vedio for some connection details : https://www.youtube.com/watch?v=RlscDz5JCcI
Don't forget the 10uF capacitor between Arduino RESET and GND!
Use one Arduino UNO, as an ISP writer. (see the programming part) https://www.youtube.com/watch?v=B5HT5IKcprE&t=402s
- Remove 10uF capacitor
- Burning the Arduino ISP program to your Arduino UNO
- Insert 10uF capacitor
- Set the programmer to Arduino as ISP from your tool menu.
In my case it is COM10, change according to your environment in the following commands. Burn bootloader In command terminal (In my case, I use Windows)
use micronucleus bootloader, enable the usb to upload program (when operating at 5V)
./avrdude -v -P COM10 -b 19200 -c arduino -p attiny85 -Uflash:w:t85_default.hex:i -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m
(COM10, change this according to your environment)
Disconnect all the wires for the previous steps.
Steps are as shown in https://www.youtube.com/watch?v=m6aqmjp6AFM
Add the board support to the board manager in your Arduino IDE. add the following to your board manager URL in preference
http://drazzy.com/package_drazzy.com_index.json
Then install the board from the board manager "ATTinyCore"
for details, see https://www.youtube.com/watch?v=m6aqmjp6AFM
Use USB to connect to your PC, and flash the above program.
- disconnect the board, compile and upload
The program (or any other program):
//
const int ledPins[] = {0, 1, 2, 3, 4}; // PB0〜PB4 に相当
void setup() {
//
for (int i = 0; i < 5; i++) {
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
//
for (int i = 0; i < 5; i++) {
digitalWrite(ledPins[i], HIGH); // LED ON
delay(200);
digitalWrite(ledPins[i], LOW); // LED OFF
delay(200);
}
}
- get the prompt "Please plug in the device (will time out in 60 seconds) ..."
- connect the badge to usb
- start uploading the program
- done!
Use an Arduino UNO to upload program via Arduino ISP.
When using this method, you need to upload your program this way, every time, since the bootloader is not functioning at this mode.
- compile your program just as you compile any other program at Arduino IDE
- find the .hex file. you can find the log like this, after compiling
Compiling core...
Using precompiled core: C:\Users\demo\AppData\Local\Temp\arduino_cache_671532\core\core_4ef166371ad89eca6e92285427e7dab3.a
Linking everything together...
"C:\\Users\\demo\\Documents\\ArduinoData\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -Wall -Wextra -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=attiny85 -o "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010/simple.ino.elf" "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010\\sketch\\simple.ino.cpp.o" "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010\\libraries\\tinyNeoPixel_Static\\tinyNeoPixel_Static.cpp.o" "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010/..\\arduino_cache_671532\\core\\core_4ef166371ad89eca6e92285427e7dab3.a" "-LC:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010" -lm
"C:\\Users\\demo\\Documents\\ArduinoData\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010/simple.ino.elf" "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010/simple.ino.eep"
"C:\\Users\\demo\\Documents\\ArduinoData\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-objcopy" -O ihex -R .eeprom "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010/simple.ino.elf" "C:\\Users\\demo\\AppData\\Local\\Temp\\arduino_build_599010/simple.ino.hex"
notice there is a line with file extension .hex, this is the file you need. (simple.ino.hex)
./avrdude -v -P COM10 -b 19200 -c arduino -p attiny85 -Uflash:w:your_program_compiled.hex:i -U lfuse:w:0x62:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
(COM10, change this according to your environment)
- use Arduino UNO as an ISP programmer to upload the program to the badge. https://www.youtube.com/watch?v=BYlpzJzaDWs
ATTiny85 datasheet: https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/Atmel-7598_Automotive-Microcontrollers-ATtiny25-45-85_Datasheet.pdf