Tools
- Development board. I use the Konijntje-thermo-humi board from a previous project.
- ISP programmer. I use the Atmel AVRISP MkII
PlatformIO setup
- Create a new project and select "Generic ATtiny84 (Atmel)". The Arduino-framework will automatically be selected.
- Adjust the platformio.ini file:
[env:attiny84] platform = atmelavr board = attiny84 framework = arduino upload_protocol = avrispmkII upload_port = usb ; https://www.engbedded.com/fusecalc/ board_build.f_cpu = 1000000L board_fuses.lfuse = 0x62 board_fuses.hfuse = 0xD7 board_fuses.efuse = 0xFF upload_flags = -B ; bit clock needs to be slowed down (original=1) when underclocking the MCU 10 lib_deps = stevemarple/AsyncDelay @ ^1.1.2 thomasfredericks/Bounce2 @ ^2.70 ; FTDI TTL-232R-3V3-WE monitor_port = /dev/ttyUSB0 monitor_speed = 4800
- Simply hit the "Upload"-button to program your device.
That's it. No makefiles, no menu configs.
Remember to upload your code again after programming the fuses (if needed).
Here goes the blinkenlight example:
LED_BUILTIN = PIN_PB2
#include <Arduino.h>
void setup()
{
// put your setup code here, to run once:
pinMode(PIN_PB0, OUTPUT);
}
void loop()
{
// put your main code here, to run repeatedly:
digitalWrite(PIN_PB0, HIGH);
delay(500);
digitalWrite(PIN_PB0, LOW);
delay(500);
}
framework-arduino-avr-attiny
More info about the framework (and the pin numbering) can be found on:
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.