Software stack
Why write all the code from scratch if we can make use of the well documented Arduino core? There are libraries to read from I²C devices, libraries for serial communication, timer libraries, ...
The ATTINY series has been added to the list of supported devices. You can find the github repository here. Follow the instructions to install the library.
Details about the ATTINY84 Arduino implementation (pin mappings etc.) can be found here. Remark that the "clockwise pin mapping" is used.
Blinky
What "Hello world" is to software, is "Blinky" to firmware. Let's get started:
- Open Arduino IDE
- Copy the following code to the IDE
const byte LED_PIN=10; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(LED_PIN, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_PIN, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_PIN, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
- Select the correct board
- Board: "ATtiny24/44/84"
- Pin Mapping: Clockwise (like damellis core)
- Chip: "ATtiny84"
- Clock: "8MHz (internal)"
- Save EEPROM: "EEPROM retained"
- LTO : "disabled"
- BOD : "BOD disabled"
- Programmer : Select your programmer, "AVRISP MkII" in my case
- "Burn Bootloader" to program the fuse settings
- Upload your code
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.