User Tools

Site Tools


courses:minimalist_microcontroller_2011

Minimalist Microcontroller, December 2011

Background

Luna Mod Looper, High Low Tech group at MIT, 1-Bit symphony, ATtiny family of processors, Arduino with other cores, Wiring, etc.

ATtiny85

Copper tape circuit

We should have some in the Interaction Workshop (parts tower). If not, order from Elfa 80-903-18. Alternatively you can use thin brass foil with spray glue on the back.

  • Watch out for crossover, plan ahead with pencil
  • Copper tape is pricey, use wisely
  • Solder joint as the glue from the underside can prevent electrical contact

How to program ATtiny

Software options:

  1. Arduino 1.0 + ATtiny core from MIT High Low Tech group (this is the way we will work for this session)
  2. Arduino 023 + Arduino-Tiny

Hardware options:

  1. Dedicated ISP (in-system programmer), USBtinyISP
  2. Arduino as a programmer (Arduino as ISP), setup and information

For this session, we will only work with the software A and ISP method, for simplicity and efficiency.

  • Download and install Arduino 1.0
  • Locate your Arduino sketchbook folder (you can find its location in the preferences dialog in the Arduino software)
  • Create a new sub-folder called “hardware” in the sketchbook folder.
  • Copy the attiny folder from inside the .zip to the hardware folder.
  • Restart the Arduino development environment.
  • You should see ATtiny entries in the Tools > Board menu.


Arduino and sound

uC Hobby has very information series on Arduino and sound: part 1, part 2, part 3, DAC options

Luna Mod Looper, a simple handheld synth and looper box that generates intriguing sonic rhythms. youtube

RTTTL (RingTone Text Transfer Language) RingTone library and online player

Activities for this evening

  • pick a piece of scrap wood or thick cardboard/foamcore
  • plan a simple circuit with a battery, microcontroller, speaker and push button. LED(s) and light sensor are optional
  • hot-glue speaker, socket and battery holder to the panel, then connect everything with traces of copper tape
  • verify continuity/connection with the multimeter (mode to speaker icon, will make noise if electrical connection)
  • program the ATtiny 85 @ 8 MHz, remember to burn bootloader one time first to set the right oscillator speed (default is 1 MHz, your ringtone will play very slowy!!!)
  • experiment with the code, try to play a ringtone
  • try to play different ringtones with the same push button
  • extra point if you get to debug over a software serial connection!

We only have 3 programmers so share with everyone, thanks.

Code samples

Simple Blink with sensor

void setup() {                
  pinMode(0, OUTPUT); 
}
 
void loop() {
  int sensorVal = analogRead(2);
  int wait;
  if(sensorVal < 800){
    wait = 200;
  }else{
    wait = 50;
  }
  digitalWrite(0, HIGH);
  delay(wait);
  digitalWrite(0, LOW);
  delay(wait);
}

ATtiny85 basic sound

Download the sketch attiny85_basic_sound

ATtiny85 basic ringtone

Download the sketch attiny85_rigntone_1_0

Photos and Videos

vimeo_34121818

If you have more pictures of your creation, please upload them here. Thanks!

/Camille

courses/minimalist_microcontroller_2011.txt · Last modified: 2013/08/22 02:00 by rickard