Kevin Gagnon
Published © GPL3+

An ATtiny85 Deep Dive: Lesson 1 - Programming an AVR

For beginner Arduino programmers wanting to learn other AVR chips. The relative simplicity of the ATtiny85 is a great place to start!

BeginnerProtip1 hour13,287
An ATtiny85 Deep Dive: Lesson 1 - Programming an AVR

Things used in this project

Hardware components

ATtiny85
Microchip ATtiny85
×1
Arduino UNO
Arduino UNO
×1
Breadboard (generic)
Breadboard (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
LED (generic)
LED (generic)
Different colors will work best. Red - Error, Green - Programming, Blue - Heartbeat, and any other color for the one experiment we'll run to make sure everything is working as we expect.
×4
Resistor 330 ohm
Resistor 330 ohm
×4

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Breadboard Wiring for using the ArduinoISP Sketch

Breadboard Wiring for the Neo-Blink.ino example

Code

Neo-Blink.ino

C/C++
Example Sketch for Lesson 1
//////////////////////////////////////////////////////////////////////
// Neo-Blink.ino
// Author:  Kevin Gagnon
// Origin: ATTiny85 - A Deep Dive Series - Lesson 1: Programming an AVR
// Purpose: Make an LED connected to PB1 blink at a specific rate
////////////////////////////////////////////////////////////////////// 
void setup() 
{
  
   //Set PB1/Pin 6 as an output
   DDRB  = B00000010;      
   
   //Configure Timer/Counter1 Control Register 1 (TCCR1)
   TCCR1 = B10011111;      
   
   //Set LED blink rate
   OCR1C = 100;            
  
} 
  
void loop() 
{ 
 //////////////
 //Message from CPU: I'M BORED!!
 /////////////
}

Credits

Kevin Gagnon

Kevin Gagnon

3 projects • 33 followers
Tinkerer and maker of things.

Comments