AVR Programming 02: The Hardware

You may be able to write the most eloquent code in the history of embedded systems but without a way to run it on the hardware it will be worthless. In this installment of the tutorial series we will:

  • Look at some of the available AVR programmer options
  • Place the microcontroller on a breadboard and connect it to a power supply and a programmer.
  • Use programming software to send some example code to the microcontroller

If you missed Part 1 take a few minutes to review that portion of the tutorial and then join us after the break.

Series roadmap:

Continue reading “AVR Programming 02: The Hardware”

AVR Programming 01: Introduction

We love looking at hardcore electronics projects with a beefy microcontroller and hundreds, if not thousands, of lines of code at its center. But everyone needs to get there somehow.

This tutorial series aims to make you comfortable programming the Atmel AVR line of microcontrollers. Whether you’ve never touched a microcontroller before, or you’ve cut your teeth with dozens of Arduino projects, this will help you get right down to the hardware and give you the confidence to build anything.

Series roadmap:

Continue reading “AVR Programming 01: Introduction”

AVR DDS Signal Generator Improvements

[Vassilis Papanikolaou] took a good thing and made it better with some design upgrades to this AVR based signal generator. We looked at version 1.0 of this tool back in 2006 and since then it saw an upgrade to 2.0. But [Vassilis] wanted to take things one step further, with a compact single-sided PCB. What you see above is the beautiful result of his work; a professionally made board that is compact, uses through-hole components, and has zero wire jumpers.

If you want to build one for yourself there’s a great parts list as well as board artwork and schematic. The system uses an ATmega16 so you’ll need a way to program one. There’s also just a bit of firmware tweaking to remap the control buttons to match the updated hardware layout.

Window Curtain Moves To Screen Pedestrians

[Niklas Roy] built a motorized window curtain to screen out foot traffic in front of his window. When you hear “motorized curtain” you may think that this will move up and down but it doesn’t. Instead, the small curtain move horizontally to cover passersby as they travel down the sidewalk. This is accomplished using a camera in conjunction with some motion sensing software. In the video after the break you can see that the software also anticipates the movement, and ends up doing a good job of keeping the target covered. That’s thanks to the Processing sketch working in conjunction with a rotary encoder on the hardware setup. Details for both are available on the page linked above.

This harkens to other community involvement hacks we’ve seen like the subway stair piano, or the bottle recycling video game. It’s fun and quirky, which is not too much of a surprise as we saw a glimpse of that when we looked at [Niklas’] public fountain hydropower generator.

Continue reading “Window Curtain Moves To Screen Pedestrians”

Lazarus-64, Not Actually 64 Bit But Still Blows Our Minds

Lazarus-64, breadboard game system; certainly sounds like something from the 1980s. We were surprised to find out not only the name, but also all the ICs used are only those available from the retro age of 30 years back (Save for the AVR controlling everything, of course). Even more amazing is how it has 256 flicker free color support, while not using NTSC chips. Which Goes to show that even if there are common solutions out there for cheap, building or compiling your own is not necessarily a bad thing or a waste of time.

There is a whole lot more to Lazarus, including double buffering and VMS, but sadly it appears progress has stopped on the Lazarus-64 breadboard game system, with the last update being last year. But we can still bask in the amazing glow that currently is.

Beginner Concepts: All About AVR Interrupts

Microcontroller interrupts are one of the big tools in our embedded programming arsenal. They make the chip listen for particular events, and once detected they stop what they’re doing and run a separate set of code called and Interrupt Service Routine. We’ve come across two fairly new tutorials on the subject that you should check out if you’re not yet a master on the topic. One is a ProtoShack tutorial on ATmega168 external interrupts, and the other is a Newbie’s Guide to AVR Interrupts by [Dean Camera] (we’ve been a fan of his tutorials for some time). Both cover a range of topics from what interrupts are, to avoiding the common problems of volatile data types and the compiler optimization caveats.

What can you do with interrupts? External interrupts can be used to wake up a project like this LED menorah from sleep mode. Interrupts can be used to monitor a timer for a certain value or an overflow for use in generating a pulse-width modulation signal. The TI Launchpad uses an interval timer interrupt for button debouncing in projects like this code which was ported from an AVR chip. The source for both is available if you wanted to compare how the two differ.

Interrupts are powerful. Learn them, love them, use them.

Full-featured AVR Time-lapse

This time-lapse photo trigger was built [Lukasz Goralczyk]. It is controlled by an ATmega168 and we were surprised to read that it uses about 12k of code. Curious about what takes up that much space, we were impressed to see all the features demonstrated in the video after the break. The small device, running on two AA batteries, has a well-designed user interface displayed on a 3V character LCD that is navigated with a clickable rotary encoder.

It isn’t the smallest intervalometer we’ve ever seen, but it deserves respect for the features packed into a diminutive form-factor.

Continue reading “Full-featured AVR Time-lapse”