Microcontroller Monday: I2C

Monday night (Nov 10) I’ll be going over the I2C protocol and how to make it work for you.  I2C is used in all sorts of sensors these days, and understanding how to make the AVR’s speak it is useful stuff!

I’ll bring in some I2C external memory chips, a temperature sensor, and a 3-axis accelerometer.  There’ll also surely be steaming hot, AVR-to-AVR, master-slave action.  After a little bit of lecture and some code demo, we’ll see how many of them we can get working…

7pm.  The Space.

AVR Microcontroller Class: Columbus Day Edition

Folks hard at work in the space

In honor of Columbus Day, the AVR class took a night off from “formal” instruction and messed around with noisemakers.  Specifically, using analog-to-digital conversion techniques to control the pitch of a square wave run through a small speaker.  Hilarity ensued.  (Follow along with us at the AVR Microcontroller Class Wiki Page.)

[youtube eVdtaEa8bXw Light Dependent Theremin]

Posted in Uncategorized

Microcontroller Class 0 a Success!

16 AVR programmer kits walked into a room in anti-static bags last night.  16 fully assembled and tested programmers walked out.  Many people learned to solder and the sweet smell of flux filled the air.  It doesn’t get better than that.

Except that next week, it will.

Special thanks to Mitch for the cool demos, soldering coaching, and endless enthusiasm.

If you couldn’t make it last night, don’t fret.  The course will run again at a later date.

Head on over to the wiki for class notes and downloadables.  http://wiki.hacdc.org/index.php?title=AVR_Microcontroller_Class

(And someone post up some photos.)

Posted in Uncategorized

Microcontroller Mondays Goes Educational!

What: A five-part microcontroller course, taking you from zero to hero in just 30 days!

Where: The space.

When: Monday nights, 7:00pm to 9:00pm (nominally).  Sept 8 through Oct 6.

Syllabus:

Each class will be about 30 min introductory lecture, 20 min lab, 20 min lecture, 20 min lab. We’ll cover two big topics per night (usually) and get cool projects working for each.

0) Setup: What the AVRs are, what all the pins do, what it can do for you. Then the toolchain: soldering together the programmer kits, getting the software up and running.  Reading the datasheets.  Labs: building the kit and running a test LED flasher. (Almost all lab today, little talk.)

1) Outputs and bit math: How to make chips speak to the outside world, pin-by-pin. Enough C programming fundamentals to make it work. Pulse-width modulation. Labs: Cylon eyes and dimming LED’s. Extra credit: cross-fading cylon eyes!

2) Inputs: Buttons and Analog-to-Digital conversion (ADC). Gather data input the world. Labs: pushbutton organ, light-dependent theremin.  Extra credit: something else!

3) Interrupts and Timers: Interrupts call subroutines when certain conditions are true. Timers let you time stuff. Together, they take a lot of the programming burden off your shoulders, and enable really cool stuff. Labs: Driving servo motors and/or build a better audio synth, use an LED as a light-source and light-sensor. Extra credit: capacitive touch-switch!

4) Serial I/O: Make the micro speak to your computer (and vice-versa). We can also cover other serial protocols (I2C, SPI). Labs: Basic serial in/out, data-logging light sensor.  Maybe SD/MMC cards? Extra credit: ADC + serial output + Python + laptop = ghetto oscilloscope.


5) EEPROM, PROGMEM, etc: Tying up loose ends, special requests. PROGMEM lets you use the program memory to store lots of (constant) data. EEPROM is like flash — there’s not much of it, but it stays when you power off. Can also do misc topic requests here. Labs: writing out really long strings to serial, saving last known states for battery failure.  Maybe I can think up something sexy to use these methods.  Maybe not.

The Kit: The class will be based around the  ATMega 48 ($4 in bulk).  The basics of a programming kit for the AVR chips include: a computer (bring a laptop), a programmer ($22), a breadboard ($5).  We’ll be rounding out the projects with some push-buttons, LEDs, light-sensing resistors, speakers, and servo motors.  Some of this stuff is in the space, some I’ll bring in, and some will be bought for you all.  $35 for the basic kit, delivered.

For $20 more, you can opt to get a super-swanky USB/TTL-serial cable, which will enable simple and clean bi-directional communication with laptops.  I highly recommend ponying up for one if you think you’ll continue using micros, but if you want to kludge something together out of a plain-old USB/RS-232 Serial converter, I can help.

Let me know by Friday, Aug 29, what kind of kit you want and if you’re interested but bringing your own gear.

Posted in Uncategorized