Actions

AVR Microcontroller Class 2011: Difference between revisions

From HacDC Wiki

No edit summary
Line 22: Line 22:


'''Homework''': More soldering, and Cylon Eyes.  Optional extra credit: Simple POV toy (hint, make the timing a lot faster and swing your arms).  Super bonus points: Make a neat POV toy.  
'''Homework''': More soldering, and Cylon Eyes.  Optional extra credit: Simple POV toy (hint, make the timing a lot faster and swing your arms).  Super bonus points: Make a neat POV toy.  
'''Resources''':
* Slides from class: [[Media:avr2011_class0.pdf]]
* ATmega48P Datasheets (get both): [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] 
* Bootloader appnote [http://www.atmel.com/dyn/resources/prod_documents/doc1644.pdf]
* [[Installing AVR Toolchain]]




Line 27: Line 36:
== Class 1: Digital and Serial I/O ==
== Class 1: Digital and Serial I/O ==


Gathering simple data from the world, and learn how to spit it back out.  A
'''Covers''': Gathering simple data from the world, and learn how to spit it back out.  A
serial link with your computer enables all sorts of tricks, and
serial link with your computer enables all sorts of tricks, and
enables the microcontroller version of printf debugging.  Some boolean logic comes in handy here.
enables the microcontroller version of printf debugging.  Some boolean logic comes in handy here.
Line 40: Line 49:
== Class 2: ADC and PWM: "Analog" I/O ==
== Class 2: ADC and PWM: "Analog" I/O ==


Learn about ways to fake analog data into and out of your
'''Covers''': Learn about ways to fake analog data into and out of your
microcontroller.  We'll learn how to switch logic states fast to
microcontroller.  We'll learn how to switch logic states fast to
emulate an analog output, and how to use the built-in
emulate an analog output, and how to use the built-in
Line 52: Line 61:
== Class 3: Interrupts and Timers ==
== Class 3: Interrupts and Timers ==


Interrupts call subroutines when certain conditions are true. Timers
'''Covers''': Interrupts call subroutines when certain conditions are true. Timers
and counters let you time and count events. Together, they take a lot of the
and counters let you time and count events. Together, they take a lot of the
programming burden off your shoulders, and enable really cool stuff.
programming burden off your shoulders, and enable really cool stuff.
Line 64: Line 73:
== Class 4: EEPROM, PROGMEM, ?, Profit. ==
== Class 4: EEPROM, PROGMEM, ?, Profit. ==


PROGMEM lets you use the program memory to store lots of (constant)
'''Covers''': 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
data.  EEPROM is like flash -- there's not much of it, but it stays
around when you power off.  We'll also cover simple state machines and
around when you power off.  We'll also cover simple state machines and
Line 77: Line 86:
== Class 4: I2C, USB, SD Cards, GPS ==
== Class 4: I2C, USB, SD Cards, GPS ==


Learning to use other people's code and tie it in to our packages.
'''Covers''': Learning to use other people's code and tie it in to our packages.
Interfacing with all sorts of random devices for fun and profit.   
Interfacing with all sorts of random devices for fun and profit.   


Line 88: Line 97:




'''Resources''':
* Slides from class: [[Media:avr2011_class0.pdf]]
* ATmega48P Datasheets (get both): [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] 
* Bootloader appnote [http://www.atmel.com/dyn/resources/prod_documents/doc1644.pdf]
* [[Installing AVR Toolchain]]




[[Category:Microcontrollers]]
[[Category:Microcontrollers]]
[[Category:Classes]]
[[Category:Classes]]

Revision as of 23:46, 3 March 2011

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

Covers: What the AVRs are, what all the pins do, what they can do for you. A brief tour of the toolchain, and getting your firmware up and running on the chip. Reading the datasheets. How to make chips speak digital to the outside world, pin-by-pin. Just enough C programming fundamentals to make it work.

Lab: Building the kit and running a test LED flasher.

For detailed info on the class kit, see Avr2011_kit.

avr2011_LED_Demo.c avr2011_LED_Demo_Makefile


Homework: More soldering, and Cylon Eyes. Optional extra credit: Simple POV toy (hint, make the timing a lot faster and swing your arms). Super bonus points: Make a neat POV toy.


Resources:



Class 1: Digital and Serial I/O

Covers: Gathering simple data from the world, and learn how to spit it back out. A serial link with your computer enables all sorts of tricks, and enables the microcontroller version of printf debugging. Some boolean logic comes in handy here.

Along the way, we'll learn debouncing switches, simple audio generation, and more!

Labs: Pushbutton organ, ASCII-to-binary keymapper (utility?)

HW: Ghetto logic probe / analyzer


Class 2: ADC and PWM: "Analog" I/O

Covers: Learn about ways to fake analog data into and out of your microcontroller. We'll learn how to switch logic states fast to emulate an analog output, and how to use the built-in analog-to-digital converters to measure the complex real-world.

Labs: Auto-dimming LEDs, a better organ, servo motor driving, ghetto oscilloscope

Homework: Basic light-level data logger or battery charger/discharger


Class 3: Interrupts and Timers

Covers: Interrupts call subroutines when certain conditions are true. Timers and counters let you time and count events. Together, they take a lot of the programming burden off your shoulders, and enable really cool stuff. Additionally, you're a step closer to building that real-time operating system you've always wanted.

Labs: Yet another push-button organ, frequency counter, capacitive sensing

Homework: Capacitive touch-switch. Optional "theremin"

Class 4: EEPROM, PROGMEM, ?, Profit.

Covers: 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 around when you power off. We'll also cover simple state machines and menu-driven interfaces here.

Labs: Arbitrary waveform generation by direct-digital synthesis, and a menu system to run it

Homework: Not sure yet...


Class 4: I2C, USB, SD Cards, GPS

Covers: Learning to use other people's code and tie it in to our packages. Interfacing with all sorts of random devices for fun and profit.

Labs: I'll be providing example code interfacing with all sorts of external gear. Pick and choose whichever you'd like to implement.

Homework: None. It's project time! Start thinking up what you'd like to do here...