Usage tips and examples for the Digispark USB ATTiny85 clone. Built-in LED resides on the pin 1 (PB1
)
This README also contains info about programming of the Digispark USB ATTiny85 clone with the Bus Pirate
avrdude
-6.3
micronucleus
bootloader - v2.5Bus Pirate
device - v3b custom mod
Bus Pirate | Digispark ATtiny85 |
---|---|
GND (BR) | GND (or pin4) |
+5V (OR) | 5V (or pin8) |
CS (WT) | P5 (RESET) |
MOSI (GR) | P0 (MOSI) |
MISO (Blk) | P1 (MISO) |
CLK (PU) | P2 (SCLK/CLK) |
Check buspirate connection:
avrdude -P /dev/tty.usbserial -c buspirate -p t85 -v
Flash Micronucleus bootloader and set default Digispark fuses:
curl -LO https://github.com/micronucleus/micronucleus/raw/v2.5/firmware/releases/t85_default.hex
avrdude -P /dev/tty.usbserial -c buspirate -p t85 -b 115200 -U flash:w:t85_default.hex -U lfuse:w:0xe1:m -U hfuse:w:0xdd:m -U efuse:w:0xfe:m
-
The default fuses for a Digispark board:
- ATtiny85 Lfuse: 0xE1 - (digispark default) PLL Clock + Startup 64 ms
- ATtiny85 Hfuse: 0xDD - External Reset pin enabled (Pin5 not usable as I/O) + BOD 2.7 V + Enable Serial Program and Data Downloading
- ATtiny85 Efuse: 0xFE - self programming enabled. BOD enabled requires additional 20 µA in sleep state and therefore may be not desirable for low power battery applications. To disable BOD, use 0xDF as Hfuse.
-
AVR fuses calc: https://www.engbedded.com/fusecalc/
-
Microcontroller pinout cheat sheet: https://tinkerlog.com/2009/06/18/microcontroller-cheat-sheet/
-
Bus Pirate AVR Programming: http://dangerousprototypes.com/docs/Bus_Pirate_AVR_Programming
dtiny
core TinyDebugSerial
overrides Serial
and uses:
PB3
as TX for CPU frequencies <= 8MHzPB2
as TX for other frequencies
See TinyDebugSerial.h for the details
tiny
core TinySoftwareSerial
overrides Serial
and uses:
AIN0
(PB0
) as TXAIN1
(PB1
) as RX
See src/main.cpp for the example.