Actions

AVR Microcontroller Class 2009: Difference between revisions

From HacDC Wiki

Line 15: Line 15:
'''Resources''':  
'''Resources''':  
* Slides from class: [[Media:class0.pdf]]
* Slides from class: [[Media:class0.pdf]]
* ATmega48P Datasheets: [http://www.atmel.com/dyn/resources/prod_documents/8025S.pdf ATmega48P Summary Datasheet] and [http://www.atmel.com/dyn/resources/prod_documents/doc8025.pdf The Long ATmega48P Datasheet]
* ATmega48P Datasheets: [http://www.atmel.com/dyn/resources/prod_documents/8025S.pdf ATmega48P Summary Datasheet] and [http://www.atmel.com/dyn/resources/prod_documents/doc8025.pdf The Long ATmega48P Datasheet] (Get both.)
* Download the software part of the toolchain:  For Mac folks: [http://www.obdev.at/products/avrmacpack/index.html AVR Mac Pack]. For Windows folks: [http://winavr.sourceforge.net/ WinAVR]. For Ubuntu linux folks: "sudo apt-get install build-essential avr-libc binutils-avr gcc-avr avrdude"
* Download the software part of the toolchain:  For Mac folks: [http://www.obdev.at/products/avrmacpack/index.html AVR Mac Pack]. For Windows folks: [http://winavr.sourceforge.net/ WinAVR]. For Ubuntu linux folks: "sudo apt-get install build-essential avr-libc binutils-avr gcc-avr avrdude"
* Programmer and mega48 pinouts: [[Image:FFVH7HBF5UO1JMR.MEDIUM.jpg]] [[Image:Screenshot-ATmega48-88-168.png|320px]]
* Programmer and mega48 pinouts: [[Image:FFVH7HBF5UO1JMR.MEDIUM.jpg]] [[Image:Screenshot-ATmega48-88-168.png|320px]]

Revision as of 21:34, 9 September 2008

Syllabus, course material, homeworks, photos, etc from an Introduction to Microcontrollers with AVR chips class can be found here.

Also see (and contribute to) Useful AVR Links


Class 0: Introduction and Setup

What the AVRs are, what all the pins do, what they can do for you. Then the toolchain: soldering together the programmer kits, getting the software up and running.

Labs: building the kit and running a test LED flasher. (Almost all lab today, little talk.)

Resources:

Class 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!


Class 2: Inputs: Buttons and Analog-to-Digital conversion (ADC)

Gather data from the world.

Labs: pushbutton organ, light-dependent theremin. Extra credit: something else!


Class 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!


Class 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.


Class 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.