1. Flash the ArduinoISP firmware onto the programmer board (ex. Arduino UNO) 2. Connect the Arduino's SPI header to the ATtiny:
Arduino | ATiny | Digispark |
---|---|---|
5V | VCC | Vin |
GND | GND | GND |
MOSI | PB0 | P0 |
MISO | PB1 | P1 |
SCK | PB2 | P2 |
RST or D10 | PB5 | P5 |
3. In your Platformio Project, add the following to your platformio.ini:
[env:attinyXX]
platform = atmelavr
board = attinyXX
framework = arduino
upload_protocol = stk500v1
upload_flags =
-P$UPLOAD_PORT
-b19200
; edit this line with the valid upload port
upload_port = /dev/ttyACM0
where XX
must be replaced with the number of model number of your ATttiny chip (ex. 85).
If desired, the fuse bits may also be set in the upload_flags
declarative.
4. With the Arduino connected via USB, upload the project and wait for the flashing process to complete
1. Wrong device signature:
There are numerous reasons why a wrong device signature is detected. First, ensure the compile target is set to the correct chip. If the signature is always 0x000000, then the device is either not powered or grounded, or the wiring for the MISO and MOSI pins are off. If the signature is rather random and changes on every attempt, ensure the reset pin is properly connected. On many Arduino's, the slave select pin cannot be used and the D10 pin has been assigned as the reset pin.