User Tools

Site Tools


courses:minimalist_microcontroller_2011

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
courses:minimalist_microcontroller_2011 [2013/08/22 01:58]
rickard
courses:minimalist_microcontroller_2011 [2013/08/22 02:00] (current)
rickard
Line 1: Line 1:
 +====== Minimalist Microcontroller,​ December 2011 ======
 +
 +
 +==== Background ====
 +
 +[[http://​www.youtube.com/​watch?​v=wHnuMnm6YkE|Luna Mod Looper]], [[http://​hlt.media.mit.edu/​|High Low Tech group]] at MIT, [[http://​www.youtube.com/​watch?​v=XZEXX9Yezjw|1-Bit symphony]], ATtiny family of processors, Arduino with other cores, [[http://​wiring.org.co/​|Wiring]],​ etc.
 +
 +==== ATtiny85 ====
 +
 +{{ :​courses:​attiny85_pins.png?​direct |}}
 +
 +==== Copper tape circuit ====
 +We should have some in the Interaction Workshop (parts tower). If not, order from Elfa [[https://​www.elfa.se/​elfa3~se_en/​elfa/​init.do?​item=80-903-18&​toc=0|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:​** ​
 +  - Arduino 1.0 + [[https://​github.com/​damellis/​attiny/​tree/​Arduino1|ATtiny core]] from MIT High Low Tech group (this is the way we will work for this session)
 +  - Arduino 023 + [[http://​code.google.com/​p/​arduino-tiny/​|Arduino-Tiny]]
 +
 +**Hardware options:​** ​
 +  - Dedicated ISP (in-system programmer),​ [[http://​www.ladyada.net/​make/​usbtinyisp/​|USBtinyISP]]
 +  - Arduino as a programmer (Arduino as ISP), [[http://​hlt.media.mit.edu/?​p=1706|setup and information]]
 +
 +For this session, we will only work with the software A and ISP method, for simplicity and efficiency. ​
 +  * Download and install [[http://​arduino.cc/​en/​Main/​Software|Arduino 1.0]]
 +  * Download [[https://​github.com/​damellis/​attiny/​archive/​master.zip|ATtiny]] (from [[https://​github.com/​damellis/​attiny|this GitHub repository]])
 +  * 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.
 +
 +{{:​courses:​attiny_boards.png?​direct|}}
 +\\ 
 +==== Arduino and sound ====
 +
 +[[http://​www.uchobby.com/​|uC Hobby]] has very information series on Arduino and sound: [[http://​www.uchobby.com/​index.php/​2007/​11/​11/​arduino-sound-part-1/​|part 1]], [[http://​www.uchobby.com/​index.php/​2007/​11/​14/​arduino-sound-part-2-hello-world/​|part 2]], [[http://​www.uchobby.com/​index.php/​2007/​11/​22/​arduino-sound-part-3-playing-a-melody/​|part 3]], [[http://​www.uchobby.com/​index.php/​2008/​01/​08/​arduino-audio-dac-options/​|DAC options]]
 +
 +[[http://​makeprojects.com/​Project/​The-Luna-Mod-Looper/​974/​1|Luna Mod Looper]], a simple handheld synth and looper box that generates intriguing sonic rhythms. [[http://​www.youtube.com/​watch?​v=w4mP25Mxuv0|youtube]]
 +
 +
 +**RTTTL (RingTone Text Transfer Language)**
 +[[http://​www.2thumbswap.com/​members/​tones/​nokia/​tones_nokia_genre_christmas.html|RingTone library]] and [[http://​www.cellringtones.com/​toneplayer.php|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**
 +
 +<code c>
 +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);​
 +}</​code>​
 +
 +
 +**ATtiny85 basic sound**
 +
 +Download the sketch {{:​courses:​attiny85_basic_sound.zip|attiny85_basic_sound}}
 +
 +** ATtiny85 basic ringtone**
 +
 +Download the sketch {{:​courses:​attiny85_rigntone_1_0.zip|attiny85_rigntone_1_0}}
 +
 +
 +==== Photos and Videos ====
 +{{vimeo>​34121818?​large}}
 +
 +{{:​courses:​attiny_p1150599.jpg?​400|}}
 +{{:​courses:​attiny_p1150597.jpg?​400|}}
 +{{:​courses:​attiny_6769.jpg?​400|}}
 +{{:​courses:​attiny_6773.jpg?​400|}}
 +{{:​courses:​attiny_6803.jpg?​400|}}
 +{{:​courses:​attiny_daniel1.jpg?​400|}}
 +{{:​courses:​attiny_daniel2.jpg?​400|}}
 +{{:​courses:​attiny_daniel3.jpg?​400|}}
 +
 +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